Equipment fault diagnosis method and device and IP core for equipment fault diagnosis
By performing multi-scale wavelet packet decomposition and attention mechanism weighting on the equipment status signal, the problem of poor monitoring effect caused by single modal features in the existing equipment fault diagnosis model is solved, and higher accuracy equipment fault diagnosis is achieved.
Patent Information
- Application Number
- CN202511151063.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-21
AI Technical Summary
Existing equipment fault diagnosis models often focus only on a single modal feature, resulting in poor monitoring of equipment health status and low accuracy.
By acquiring device status signals, the signals are segmented into multiple sub-signals based on overlapping sliding window segmentation, and multi-scale wavelet packet decomposition is performed to extract temporal and spatial features. The features are weighted using an attention mechanism module, and finally the prediction results are output through the prediction module.
It improves the comprehensiveness and accuracy of feature extraction, enhances the precision and performance of equipment fault diagnosis, and optimizes the impact of key features by integrating information from time and space dimensions, thereby improving the diagnostic effect.
Smart Images

Figure CN120995215A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent fault diagnosis of equipment, and particularly relates to an equipment fault diagnosis method, an equipment and an IP core for equipment fault diagnosis. BACKGROUND
[0002] Equipment fault diagnosis is performed by using monitoring data in the running process of equipment. The state signal of the equipment contains rich machine health information, and an effective feature extraction method helps to improve the diagnosis accuracy of the equipment diagnosis model.
[0003] However, the state signal generated in the running process of the mechanical equipment usually contains a large amount of noise interference and redundant information, and direct use for prediction will significantly reduce the accuracy of the model. Moreover, the existing equipment fault diagnosis model often only focuses on single modal features, lacks an effective fusion mechanism for space-time features, and thus causes poor running monitoring effect and low accuracy for the health state of the equipment. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide an equipment fault diagnosis method, aiming to solve the problem that the existing equipment fault diagnosis model often only focuses on single modal features, resulting in poor running monitoring effect and low accuracy for the health state of the equipment.
[0005] The embodiments of the present application are implemented in this way. An equipment fault diagnosis method, the method comprises:
[0006] obtaining a state signal of the equipment;
[0007] segmenting the state signal into a plurality of continuous sub-signals based on an overlapping sliding window segmentation, performing multi-scale wavelet packet decomposition on each of the sub-signals to obtain frequency band information;
[0008] performing time feature extraction and space feature extraction on the frequency band information to obtain time features and space features;
[0009] weighting the time features and the space features based on an attention mechanism module to obtain weighted information;
[0010] analyzing the weighted information based on a prediction module to output a prediction result.
[0011] Another purpose of the embodiments of the present application is to provide an equipment fault diagnosis device, the device comprises:
[0012] a signal acquisition module configured to acquire a state signal of the equipment;
[0013] a signal preprocessing module, configured to divide the state signal into a plurality of continuous sub-signals based on overlapping sliding window segmentation, and perform multi-scale wavelet packet decomposition on each of the plurality of sub-signals to obtain frequency band information;
[0014] a feature extraction module, configured to perform time feature extraction and spatial feature extraction on the frequency band information respectively to obtain time features and spatial features;
[0015] an attention mechanism module, configured to weight the time features and the spatial features to obtain weighting information;
[0016] a prediction module, configured to perform analysis prediction on the weighting information to output a prediction result.
[0017] Another purpose of the embodiments of the present application is to provide an IP core for equipment fault diagnosis, which is obtained by packaging the equipment fault diagnosis device described above through an HLS tool chain.
[0018] The equipment fault diagnosis method provided by the embodiments of the present application divides the equipment state signal into a plurality of sub-signals, and performs multi-scale wavelet packet decomposition on each sub-signal to obtain frequency band information, which facilitates subsequent multi-scale analysis. By mining time features and spatial features in the frequency band information, information in the time dimension and the space dimension can be comprehensively analyzed, which effectively improves the comprehensiveness and accuracy of feature extraction, provides a reliable feature data basis for equipment fault diagnosis, and further improves the precision and performance of the diagnosis model. Moreover, the attention mechanism module is used to weight and optimize the time features and the spatial features, increase the influence of key features, and improve the precision of the diagnosis model. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A flowchart of the equipment fault diagnosis method provided by the embodiments of the present application;
[0020] Figure 2 A flowchart of the method for weighting the time features and the spatial features based on the attention mechanism module provided by the embodiments of the present application;
[0021] Figure 3 A flowchart of the method for analyzing the weighting information based on the prediction module provided by the embodiments of the present application;
[0022] Figure 4 A structural block diagram of the equipment fault diagnosis device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0023] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.
[0024] It can be understood that the terms "first", "second", etc. used in the present application can be used herein to describe various elements, but unless specifically stated, these elements are not limited by these terms. These terms are only used to distinguish the first element from another element. For example, without departing from the scope of the present application, the first xx script can be referred to as the second xx script, and similarly, the second xx script can be referred to as the first xx script.
[0025] Figure 1 A flowchart of a device fault diagnosis method provided in an embodiment of the present application is shown in FIG. 1, and the method comprises the following steps. Figure 1
[0026] Step S100: obtaining a state signal of a device.
[0027] In the present embodiment, the state signal can be a vibration signal, and the device can be a mechanical device capable of generating vibration or a part in the mechanical device, for example, the device can be a bearing of a rotating machine. By monitoring and collecting the vibration information of the bearing through a sensor, the state signal of the device can be obtained.
[0028] Step S200: dividing the state signal into a plurality of continuous sub-signals based on overlapping sliding window segmentation, and performing multi-scale wavelet packet decomposition on each sub-signal to obtain frequency band information.
[0029] In the present embodiment, the wavelet packet decomposition can decompose the original state signal into a series of frequency bands, which provides additional decomposition of the high-frequency part of the state signal on the basis of wavelet decomposition, and significantly improves the resolution of the state signal in each frequency band. Multi-scale wavelet packet decomposition facilitates subsequent multi-scale analysis of the signal. Specifically, a plurality of scales of signals are obtained by decomposing the signal in multiple layers, and the plurality of scales of signals constitute the frequency band information.
[0030] Specifically, the state signal f(t) can be represented by a plurality of sub-signals as follows:
[0031]
[0032] wherein the sub-signals are specifically:
[0033]
[0034] wherein the wavelet packet coefficient of the i-th sub-signal at scale m and frequency band k;
[0035] ψ m,k,i (t) represents the wavelet packet base function of the i-th sub-model at scale m and frequency band k.
[0036] That is, the state signal is divided into i sub-signals, each sub-signal is subjected to m-layer wavelet packet decomposition, and the decomposition results of each layer are saved. Each layer of decomposition results has 2 m frequency bands. In some embodiments, the energy of the frequency band can be used as the feature information of the frequency band and represents the frequency band, and the energy information of all frequency bands is combined to obtain the frequency band information.
[0037] In some embodiments of the present application, the scale factor m is set to a range of 2-5, that is, the sub-signal is subjected to 2-5 layers of wavelet packet decomposition. The average energy of the frequency band component signal needs to be greater than or equal to one-tenth of the total energy of the sub-signal. When it is lower than one-tenth of the total energy of the sub-signal, it is very difficult to extract the signal features. Considering the actual situation, the scale factor is set to a range of 2-5 to meet the energy requirement of the frequency band component signal.
[0038] Step S300: performing time feature extraction and space feature extraction on the frequency band information to obtain time features and space features.
[0039] In some embodiments of the present application, the time feature extraction can be performed by an LSTM module, and the space feature extraction can be performed by a CNN module.
[0040] In some embodiments, the algorithm principle of the LSTM module is as follows:
[0041] f1=sigmoid(ω1[h t-1 ,x t ]+b1)
[0042]
[0043] c t =f1×c t-1 +f2
[0044] h t =sigmoid(ω3[h t-1 ,x t ]+b3)×tanh(c t )
[0045] where ω1, ω2, and ω3 represent weight matrices, b 1, b2, and b3 represent bias terms, sigmoid, tanh represent activation functions, and xt As the input of the LSTM module, f1 is the forget gate, f2 is the new information input under the control of the input gate, c is the cell state, and h is the output gate.
[0046] Therefore, the time feature extracted using the LSTM network is represented by the following formula:
[0047] F T = f t (tanh(W T *FM i ))
[0048] Where F T is the time feature, f t is the time feature extraction function, tanh(*) is the activation function, W T is the weight matrix learned by the LSTM module through training, and FM i is the frequency band information.
[0049] In some embodiments of the present application, the CNN module is used to extract spatial features, and the CNN module can include two convolutional layers and two max-pooling layers, each of which is followed by normalization and activation processing. The size of the convolution kernel used by the two convolutional layers can be 4x1, and the pooling size of the two max-pooling layers can be 2x1. The CNN extracted spatial features can be represented by the following formula:
[0050] F S = f s (tanh(W S *FM i ))
[0051] Where F S is the spatial feature, f s is the spatial feature extraction function, tanh(*) is the activation function, W S is the weight matrix learned by the CNN module through training, and FM i is the frequency band information.
[0052] Step S400: weighting the time feature and the spatial feature based on the attention mechanism module to obtain weighted information.
[0053] It can be understood that the core idea of the attention mechanism is to dynamically assign different importance weights to the input features, so that the model can "focus" on the most relevant part of the current task when processing information. In the present application, the attention mechanism is used to weight and optimize the time features and spatial features, highlight the influence of key features, suppress the influence of redundant features, enable the model to more comprehensively and deeply understand the complex characteristics of the state signal, improve the comprehensiveness and accuracy of the equipment health state monitoring and diagnosis, and improve the diagnosis effect.
[0054] Step S500: Based on the prediction module, the weighting information is analyzed, and a prediction result is output.
[0055] In the present embodiment, the prediction module can be a neural network model, which learns the characteristics of state signals of various fault types through training, for example, for bearings, it can be inner ring fault, outer ring fault, rolling element fault, etc. By analyzing the weighting information through the trained prediction module, a prediction result can be obtained, for example, the fault type of the bearing can be obtained.
[0056] In the present embodiment, the state signal of the equipment is obtained, the state signal is segmented into a plurality of continuous sub-signals through overlapping sliding window segmentation, each sub-signal is subjected to multi-scale wavelet packet decomposition, and frequency band information is obtained. Then the frequency band information is input into the LSTM module and the CNN module respectively for feature extraction, time features and spatial features are obtained, and the attention mechanism module is used to weight and optimize the time features and spatial features to highlight the key features, and obtain the weighting information. Finally, the weighting information is input into the prediction module for prediction to obtain the prediction result.
[0057] In the present application, the equipment state signal is segmented into a plurality of sub-signals, and each sub-signal is subjected to multi-scale wavelet packet decomposition to obtain frequency band information, which facilitates subsequent multi-scale analysis. By mining the time features and spatial features in the frequency band information, the information in the time dimension and the space dimension can be comprehensively analyzed, the comprehensiveness and accuracy of feature extraction can be effectively improved, reliable feature data basis can be provided for equipment fault diagnosis, and the precision and performance of the diagnosis model can be improved. Moreover, the attention mechanism module is used to weight and optimize the time features and spatial features, increase the influence of key features, and improve the precision of the diagnosis model.
[0058] In some embodiments of the present application, as shown in Figure 2 The method for weighting the time features and the spatial features based on the attention mechanism module includes:
[0059] Step S410: weighting the time feature based on the first feature attention module to obtain a weighted time feature.
[0060] Step S420: weighting the space feature based on the first space attention module to obtain a weighted space feature.
[0061] Step S430: weighting the spatio-temporal feature based on the hybrid attention module to obtain a weighted spatio-temporal feature, the spatio-temporal feature being obtained by splicing the time feature and the space feature; wherein the weighted time feature, the weighted space feature and the weighted spatio-temporal feature constitute the weighted information.
[0062] In the embodiment, the first feature attention module and the first space attention module respectively assign weights to the time feature and the space feature, highlight the key features, and thus enhance the influence of the key features. In addition, the time feature and the space feature are spliced to obtain the spatio-temporal feature, and then the spatio-temporal feature is weighted by the hybrid attention module to obtain the weighted spatio-temporal feature, which can fuse the spatio-temporal feature and dynamically optimize the weight, so as to realize more accurate prediction.
[0063] In some embodiments of the present application, the hybrid attention module is composed of a parallel second feature attention module and a second space attention module, and the method of weighting the spatio-temporal feature based on the hybrid attention module to obtain the weighted spatio-temporal feature comprises:
[0064] inputting the spatio-temporal feature into the second feature attention module to obtain a first feature matrix.
[0065] inputting the spatio-temporal feature into the second space attention module to obtain a second feature matrix.
[0066] based on the formula fusing the first feature matrix and the second feature matrix to obtain the weighted spatio-temporal feature, wherein W Tem and W Spa are trainable parameter matrices, F WT is the first feature matrix, F WS is the second feature matrix, is an operator of multiplying corresponding elements of matrices, is an operator of adding corresponding elements of matrices, is the weighted spatio-temporal feature.
[0067] In the embodiment, the spatio-temporal feature is weighted and optimized by the parallel second feature attention module and the second space attention module, avoiding loss of single modal information, and W Tem and W SpaFor the trainable parameter matrix, the contribution ratio of the time / space feature can be dynamically adjusted according to the input, the time feature and the space feature are fused and weighted optimization is performed, the key features of the whole are highlighted, and the prediction accuracy of the model is improved. In some embodiments of the present application, the structure of the second feature attention module is similar to that of the first attention module, and the structure of the second space attention module is similar to that of the first space attention module.
[0068] In some embodiments of the present application, the hybrid attention module is composed of a parallel second feature attention module and a parallel second space attention module, which are used to analyze the space-time feature F C ∈R H×2W , the space-time feature F C ∈R H×2W is spliced by the time feature F T ∈R H ×W and the space feature F S ∈R H×W , and is specifically shown as follows:
[0069]
[0070] Wherein, F C ∈R H×2W is the space-time feature, F T ∈R H×W is the time feature, F S ∈R H×W is the space feature, H represents the length of the feature, W represents the number of features, and R represents a matrix. The space-time feature F C ∈R H×2W is input into the hybrid attention module to obtain a first feature matrix F WT ∈R H×2W and a second feature matrix F WC ∈R H×2W .
[0071] Subsequently, the first feature matrix and the second feature matrix are fused, and are specifically represented as follows:
[0072]
[0073] Wherein, W Tem and W Spa are trainable parameter matrices, and as the training process proceeds, the trainable parameter matrices W Tem and W Spa are optimized using the adaptive moment estimation (Adam) algorithm; F WT is the first feature matrix, F WS is the second feature matrix, is an operator for multiplying corresponding elements of a matrix. This is an operator for adding corresponding elements of a matrix. The weighted spatiotemporal features are as described above.
[0074] In some embodiments of this application, the time feature is in single-channel matrix form, with each column of the matrix being a sub-feature. The method for obtaining the weighted time feature by weighting the time feature based on a first feature attention module includes:
[0075] Using one column of time features as a channel, the time features are transformed into a multi-channel time input matrix.
[0076] The sub-features of all channels of the time input matrix are compressed using a global average pooling operation to obtain a multi-channel compressed matrix.
[0077] Based on formula Obtain the channel weights, where the first process weight W1 and the second process weight are... W 2 is generated by two fully connected layers. Let be the channel weights, u be the multi-channel compression matrix, and sigmoid(·) and ReLU(·) be the activation functions.
[0078] Multiply the time input matrix by the corresponding elements of the channel weights to obtain the time output matrix.
[0079] The time output matrix is converted into a single-channel matrix form to obtain the weighted time feature.
[0080] In this embodiment, by transforming the channels, each sub-feature can be weighted to enhance the influence of key features, suppress the influence of redundant features, and ensure the accuracy of prediction.
[0081] Specifically, in some embodiments, the original single-channel time feature F is... T ∈R H×W Transform the time input matrix Z∈R to W channels H×1×W In other words, each column of the time feature is a channel, and each column of the time feature is a sub-feature; thus, one channel is one sub-feature. The time feature F... T ∈R H×W as follows:
[0082]
[0083] Among them, F T ∈R H×W Let R represent the time feature, H be the feature length, and W be the number of features.
[0084] Subsequently, the sub-features of all channels are compressed using a global average pooling operation to obtain a compression matrix u e R 1 ×1×W , which is specifically as follows:
[0085]
[0086] wherein u e R 1×1×W is the compression matrix, Z e R H×1×W is a time input matrix of W channels, H is the length of a feature, and W is the number of features.
[0087] Finally, the channel weight of each channel is obtained by
[0088]
[0089] wherein the first process weight W1 and the second process weight W2 are generated by two fully connected layers,
[0090] is the channel weight, u is the multi-channel compression matrix, and sigmoid(·) and ReLU(·) are activation functions.
[0091] The transformed time input matrix Z e R H×1×W is multiplied by the channel weight to obtain a newly calibrated time output matrix which is specifically expressed as:
[0092]
[0093] The multi-channel time output matrix is converted into a single-channel weighted time feature
[0094] which is specifically expressed as:
[0095]
[0096] In some embodiments of the present application, the method for weighting the spatial features based on the first spatial attention module includes:
[0097] A one-dimensional convolution operation in three parallel ways is performed on the spatial features, with a convolution kernel size of 1, to obtain a query matrix Q, a key matrix K, and a value matrix V.
[0098] The weighted spatial features are obtained based on the formula wherein the weighted spatial features are obtained based on the formula is the weighted spatial feature, softmax(·) is a softmax activation function, Q is the query matrix, KT is the transpose of the key matrix K, V is the value matrix, F S is the spatial feature.
[0099] In this embodiment, the spatial correlation is captured by directly capturing the spatial correlation through soft max(Q·K T )·V, and adding the original spatial feature F S , the basic features that are not focused on by the first spatial attention module can be retained, and the key information in the original data is not discarded, providing more comprehensive feature support for subsequent fault diagnosis.
[0100] Specifically, the expression of the spatial feature F S ∈R H×W is:
[0101]
[0102] The input feature set F S ∈R H×W is subjected to three one-dimensional convolution operations, and the convolution kernel size is 1, to obtain the query matrix Q∈R H×W , the key matrix K∈R H×W and the value matrix V∈R H×W :
[0103] Q=f LeakyRelu (f conv (F S ∈R H×W ))∈R H×W
[0104] K=f LeakyRelu (f conv (F S ∈R H×W ))∈R H×W
[0105] V=f LeakyRelu (f conv (F S ∈R H×W ))∈R H×W
[0106] wherein, f conv (·) represents one-dimensional convolution operation with a convolution kernel size of 1, f LeakyRelu (·) represents a LeakyRelu activation function, and softmax represents a softmax activation function.
[0107] The weighted spatial feature is obtained based on the formula , and the weighted spatial feature is represented as:
[0108]
[0109] In some embodiments of the present application, as shown in Figure 3 the method for outputting a prediction result based on the prediction module analyzing and predicting the weighting information includes:
[0110] Step S510: processing the weighted temporal feature, the weighted spatial feature and the weighted spatio-temporal feature through a three-layer fully connected layer respectively, and outputting a temporal prediction value, a spatial prediction value and a spatio-temporal prediction value respectively.
[0111] Specifically, the processing of the weighted temporal feature by the three-layer fully connected layer can be represented as:
[0112]
[0113] In the formula, represents the temporal prediction value; represents the temporal feature weighted and calibrated by the first feature attention module, and l(·) represent the ReLU activation function and the linear activation function of the three-layer fully connected layer respectively; w T,1 , w T,2 and w T,3 represent the weight matrix of the three-layer fully connected layer; b T,1 , b T,2 , and b T,3 represent the bias term of the three-layer fully connected layer.
[0114] The processing of the weighted spatial feature by the three-layer fully connected layer can be represented as:
[0115]
[0116] In the formula, represents the spatial prediction value; represents the spatial feature weighted and calibrated by the first spatial attention module, and l(·) represent the ReLU activation function and the linear activation function of the three-layer fully connected layer respectively; w T,1 , w T,2 and w T,3 represent the weight matrix of the three-layer fully connected layer; b T,1 , b T,2 , and b T,3 represent the bias term of the three-layer fully connected layer.
[0117] The processing of the weighted spatio-temporal feature by the three-layer fully connected layer can be represented as:
[0118]
[0119] In the formula, represents the spatio-temporal prediction value; denotes a weighted spatio-temporal feature; and l(·) represent the ReLU activation function and linear activation function of the three-layer fully connected layer respectively; w T,1 , w T,2 , and w T,3 represent the weight matrix of the three-layer fully connected layer respectively; b T,1 , b T,2 , and b T,3 represent the bias term of the three-layer fully connected layer respectively.
[0120] Step S520: fusing the time prediction value, the space prediction value, and the spatio-temporal prediction value to obtain a fusion result.
[0121] Specifically, the fusion manner can be adding the time prediction value, the space prediction value, and the spatio-temporal prediction value, and the specific expression is as follows:
[0122]
[0123] Step S530: processing the fusion result again through the three-layer fully connected layer to obtain a prediction result.
[0124] In this embodiment, by fusing the prediction values, the prediction values obtained by comprehensively considering the time feature, the space feature, and the spatio-temporal feature are processed and predicted again through the three-layer fully connected layer, the spatio-temporal information can be comprehensively considered, and the prediction accuracy can be improved.
[0125] Specifically, the process of processing the fusion result again through the three-layer fully connected layer can be expressed as follows:
[0126]
[0127] In the formula, denotes a prediction result; F ST denotes a fusion result; and l(·) represent the ReLU activation function and linear activation function of the three-layer fully connected layer respectively; w T,1 , w T,2 , and w T,3 represent the weight matrix of the three-layer fully connected layer respectively; b T,1 , b T,2 , and b T,3 represent the bias term of the three-layer fully connected layer respectively.
[0128] As shown in FIG. Figure 4 In one embodiment, a device fault diagnosis apparatus is provided, which can specifically include:
[0129] The signal acquisition module 610 is configured to acquire a device state signal.
[0130] The signal preprocessing module 620 is configured to divide the state signal into a plurality of sub-signals, and perform multi-scale wavelet packet decomposition on the plurality of sub-signals respectively to obtain frequency band information.
[0131] The feature extraction module 630 is configured to perform feature extraction processing on the frequency band information based on an LSTM module to obtain time features, and perform feature extraction processing on the frequency band information based on a CNN module to obtain space features.
[0132] The attention mechanism module 640 is configured to weight the time features and the space features to obtain weighted information.
[0133] The prediction module 650 is configured to perform analysis prediction on the weighted information to output a prediction result.
[0134] In this embodiment, the device state signal is divided into a plurality of sub-signals by the signal preprocessing module 620, and multi-scale wavelet packet decomposition is performed on each sub-signal to obtain frequency band information. The time features and the space features in the frequency band information are mined by the LSTM and the CNN in the feature extraction module 630. In this way, the information in the time dimension and the space dimension can be comprehensively extracted, the comprehensiveness and accuracy of feature extraction are effectively improved, reliable feature data basis is provided for the prediction module 650, and the accuracy and performance of the diagnosis model are improved. Moreover, the time features and the space features are weighted and optimized by the attention mechanism module 640, the influence of key features is increased, and the accuracy of the diagnosis model is improved.
[0135] In one embodiment, the device fault diagnosis apparatus provided in the present application can be implemented in the form of a computer program, and the computer program can run on a computer device. The computer program composed of various program modules in the device fault diagnosis apparatus enables the processor to execute the steps in the device fault diagnosis method of various embodiments of the present application described in the specification.
[0136] In some embodiments, the present application further provides an IP core for device fault diagnosis, characterized in that the device fault diagnosis apparatus is encapsulated by an HLS tool chain to obtain the IP core.
[0137] In some embodiments of the present application, the HLS implementation of wavelet packet decomposition can be achieved by decomposing the multi-layer calculation of wavelet packet decomposition, such as the decomposition layer number corresponding to the scale factor 2-5, into a multi-stage pipeline stage. For a scale factor m, the calculation of the kth layer decomposition can be processed in parallel with the k+1th layer decomposition, and the seamless connection between the flow stages is realized by the HLS pipeline instruction to improve the processing throughput.
[0138] The input continuous sub-signal array is segmented, allowing different sub-signals to be simultaneously decomposed at different stages of the pipeline, dynamically receiving a scale factor m through an HLS register interface, and generating corresponding decomposition filter coefficients in hardware according to the m value, such as when m = 3, automatically selecting high-pass / low-pass filter parameters required for 3-layer decomposition, designing a time-division multiplexing filter unit, dynamically switching the filter calculation path under different scale factors through a state machine, avoiding separate instantiation of hardware modules for each scale factor, and saving logic resources.
[0139] In some embodiments of the present application, the HLS implementation of the feature extraction and attention mechanism module is time-division multiplexing of a multi-scale convolution kernel array. In the feature extraction module, a plurality of groups of convolution kernel parameters (such as 3x3, 5x5 convolution kernels) suitable for scale factors 2-5 are predefined, a hardware configuration signal is received through a register, the convolution kernel corresponding to the current scale factor is dynamically selected, and then a single convolution calculation unit is used to process feature maps of different scales through time-division multiplexing.
[0140] The global average pooling operation of the first feature attention module or the second feature attention module can sum and average the spatial dimensions of the feature map through HLS instructions, calculate the global statistics of each channel, and then map the two fully connected networks to a hardware multiply-accumulator (MAC) array. The weight parameters are stored as ROM or distributed RAM using instructions, intermediate results are passed to reduce off-chip memory delay, a lookup table (LUT) or piecewise linear approximation is used to implement the Sigmoid function, and a hardware function is instantiated through instructions to improve calculation efficiency.
[0141] Parallel processing of the spatial attention module: the generation processes of the query matrix Q, the key matrix K, and the value matrix V are designed as parallel convolution operations, the attention weights at different positions are calculated in parallel using instructions, the Softmax function is implemented by exponential operation approximation and normalization network, the hls::exp and hls::div instructions in the HLS tool chain are used to optimize floating point operations, or fixed point operations are used to reduce hardware complexity.
[0142] The Softmax function contains exponential operation and division operation, and when directly implemented in hardware, resource consumption is large and delay is high, therefore, the floating point operation is optimized by using hls::exp and hls::div instructions or fixed point number operation is used, here, the hls::exp (exponential operation) and hls::div (division operation) special instructions provided by the callable HLS are used, these instructions are optimized through independent operation, and can generate operation with reduced delay compared with the overall operation of the general logic Softmax function. The fixed point number operation quantizes the input data into fixed point numbers, 16 bits or 8 bits, at this time, the exponential and division operations can be implemented through LUT (i.e. lookup table, which is a data structure for realizing fast query through pre-stored data), which is suitable for FPGA embedded scenarios and image processing, the corresponding output value is directly retrieved through the input value, so as to avoid repeated calculation, reduce operation consumption and improve operation rate.
[0143] In some embodiments of the present application, the IP core is integrated with a parallel voting decision maker, which can simultaneously receive multiple inference results and perform parallel voting processing to fuse the results.
[0144] In some embodiments of the present application, the IP core is subjected to multi-dimensional verification, specifically including the following steps:
[0145] Multi-scale state signals containing different bearing fault types are injected to verify the frequency band resolution of wavelet packet decomposition. In this embodiment, multi-scale state signals containing different bearing fault types (such as inner ring fault, outer ring fault, rolling element fault, etc.) are generated, and these signals are input into the IP core for wavelet packet decomposition through the signal injection module, the frequency band distribution after decomposition is observed, and whether the frequency band resolution meets the design requirements is verified, and whether the characteristic frequencies of different fault types can be clearly distinguished in the corresponding frequency band is checked.
[0146] The robustness of feature fusion is tested by simulating the dynamic change scenario of the scale factor through Monte Carlo simulation. In this embodiment, the dynamic change scenario of the scale factor in the range of 2-5 is simulated through Monte Carlo simulation, and the value of the scale factor is randomly changed during the simulation process to test the output stability of the feature fusion module under different scale factors, for example, the scale factor is randomly switched multiple times, and whether the data set after feature fusion can maintain an effective representation of the device fault features is observed to test the robustness of the feature fusion module.
[0147] The SystemC-TLM model is used to perform timing analysis on the IP core pipeline architecture, and the cache access strategy is optimized to reduce the critical path delay by 30%. During simulation, the hardware performance counter is used to monitor the resource utilization rate in real time, and the area-power-performance balance of the IP core on the heterogeneous platform such as Xilinx Zynq UltraScale+ is ensured.
[0148] In this embodiment, the SystemC-TLM model is used to perform timing analysis on the pipeline architecture of the IP core, simulate the flow of data in each stage of the pipeline, identify the critical path, and reduce the delay on the critical path by optimizing the cache access strategy, such as adjusting the cache block size, optimizing the cache replacement algorithm, etc. After optimization, the critical path delay is reduced by 30%. At the same time, during the simulation process, the hardware performance counter is used to monitor the resource utilization of the IP core in real time, including CPU utilization, memory occupation, power consumption, etc. to ensure that the IP core achieves a balance between area, power consumption and performance on the heterogeneous platform such as Xilinx Zynq UltraScale+.
[0149] By injecting multi-scale state signals of different device fault types, the frequency band resolution of wavelet packet decomposition is comprehensively verified to ensure that it can effectively decompose signals with different fault characteristics, providing a reliable foundation for subsequent feature extraction and diagnosis. The SystemC-TLM model is used for timing analysis and cache optimization to reduce the critical path delay and improve the running speed of the IP core. At the same time, the resource utilization is monitored in real time to ensure that the IP core reasonably utilizes hardware resources on the heterogeneous platform, achieving a balance between area, power consumption and performance, and improving the applicability and reliability of the IP core, providing a strong guarantee for its deployment and application in actual industrial scenarios.
[0150] It should be understood that although each step in the flowchart of each embodiment of the present application is displayed in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least a part of the steps in each embodiment can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least a part of other steps or sub-steps or stages of other steps.
[0151] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware. The program can be stored in a non-volatile computer readable storage medium, and when the program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0152] Any combination of the technical features of the above-mentioned embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above-mentioned embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0153] The above-mentioned is only the preferred embodiment of the present application, and does not limit the present application. Any modification, equivalent replacement and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A device failure diagnosis method characterized by comprising: The method comprises: acquiring a state signal of a device; segmenting the state signal into a plurality of continuous sub-signals based on overlapping sliding window segmentation, performing multi-scale wavelet packet decomposition on each of the sub-signals to obtain frequency band information; performing time feature extraction and space feature extraction on the frequency band information to obtain time features and space features; weighting the time features and the space features based on an attention mechanism module to obtain weighted information; analyzing the weighted information based on a prediction module to output a prediction result.
2. The method of claim 1, wherein, The attention mechanism module comprises a first feature attention module, a first space attention module, and a hybrid attention module; the method of weighting the time features and the space features based on the attention mechanism module to obtain weighted information comprises: weighting the time features based on the first feature attention module to obtain weighted time features; weighting the space features based on the first space attention module to obtain weighted space features; weighting spatio-temporal features based on the hybrid attention module to obtain weighted spatio-temporal features, wherein the spatio-temporal features are obtained by concatenating the time features and the space features; wherein the weighted time features, the weighted space features, and the weighted spatio-temporal features constitute the weighted information.
3. The method of claim 2, wherein, The hybrid attention module is composed of a parallel second feature attention module and a second space attention module; the method of weighting the spatio-temporal features based on the hybrid attention module to obtain the weighted spatio-temporal features comprises: inputting the spatio-temporal features into the second feature attention module to obtain a first feature matrix; inputting the spatio-temporal features into the second space attention module to obtain a second feature matrix; Based on the formula Fusion is performed on the first feature matrix and the second feature matrix to obtain the weighted spatiotemporal feature, wherein W Tem and W Spa are trainable parameter matrices, F WT is the first feature matrix, F WS is the second feature matrix, is an operator for multiplying corresponding elements of matrices, is an operator for adding corresponding elements of matrices, is the weighted spatiotemporal feature.
4. The method of claim 2, wherein, The time features are in the form of a single-channel matrix, each column of the matrix being a sub-feature; the method of weighting the time features based on the first feature attention module to obtain the weighted time features comprises: transforming the time features into a multi-channel time input matrix by taking one column of the time features as one channel; compressing the sub-features of all channels of the time input matrix using a global average pooling operation to obtain a multi-channel compression matrix; Based on the formula obtaining channel weights, wherein the first process weight W1 and the second process weight W2 are generated by two full connection layers, for the channel weights, u is the multi-channel compression matrix, sigmoid(·) and ReLU(·) are activation functions; multiplying the time input matrix and the corresponding elements of the channel weight to obtain a time output matrix; transforming the time output matrix into the form of a single-channel matrix to obtain the weighted time features.
5. The method of claim 2, wherein, The method of weighting the space features based on the first space attention module to obtain the weighted space features comprises: performing a one-dimensional convolution operation in three parallel channels on the space features, with a convolution kernel size of 1, to obtain a query matrix Q, a key matrix K, and a value matrix V; Based on the formula The weighted spatial features are obtained, wherein, softmax(·) is a softmax activation function, Q is the query matrix, K T is the transpose of the key matrix K, V is the value matrix, F S is the space feature.
6. The method of claim 2, wherein, The method of analyzing the weighted information based on the prediction module to output a prediction result comprises: processing the weighted time features, the weighted space features, and the weighted spatio-temporal features through three fully connected layers respectively, and outputting a time prediction value, a space prediction value, and a spatio-temporal prediction value respectively; fusing the time prediction value, the space prediction value, and the spatio-temporal prediction value to obtain a fusion result; processing the fusion result again through the three fully connected layers to obtain a prediction result.
7. An apparatus failure diagnosis device characterized by comprising: The device comprises: a signal acquisition module for acquiring a device state signal; a signal preprocessing module for dividing the state signal into a plurality of continuous sub-signals based on overlapping sliding window segmentation, performing multi-scale wavelet packet decomposition on the plurality of sub-signals respectively, and obtaining frequency band information; a feature extraction module for performing time feature extraction and spatial feature extraction on the frequency band information respectively, and obtaining time features and spatial features; an attention mechanism module for weighting the time features and the spatial features, and obtaining weighting information; a prediction module for performing analytical prediction on the weighting information, and outputting a prediction result.
8. An IP core for equipment fault diagnosis, characterized in that, The IP core is obtained by packaging the device fault diagnosis apparatus of claim 7 through an HLS tool chain.