A reciprocating pump fault diagnosis method, device, equipment and medium
Patent Information
- Application Number
- CN202611352276.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-02
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]但因往复泵的故障表征为极其微弱且陡峭的瞬态冲击,其持续时间极短、能量极低,在采用时频分析对强噪振动信号进行处理时,往往会将这类极短暂的冲击视为“异常噪声”而予以平滑削弱而出现对信号局部瞬态变化的“钝化”效应,导致后续的符号化过程中关键的故障拓扑模式在离散符号序列中完全消失或严重变形,使得最终在利用模型进行故障分类时难以进行故障分类,最终难以对往复泵进行高灵敏度的故障诊断
本发明通过卡尔曼滤波的预测更新递归估计,在有效滤除原始振动信号中随机噪声与测量误差的同时,完整保留故障瞬态冲击脉冲的陡峭形态与时序位置,从根本上避免了传统时频去噪方法对微弱冲击特征的“钝化”丢失问题,为后续符号化转换提供了高保真度信号基底,基于这一高保真度信号,均匀分箱符号化将连续幅值映射为离散符号索引,使特征表达从易受工况波动影响的幅值驱动转向结构拓扑驱动,以阻断残余噪声沿特征链路的持续传递,阻断残余噪声后通过可训练嵌入映射将离散符号索引转换为连续语义向量,构建出兼具结构稳定性与丰富表达能力的分布式特征空间,来从分布式特征空间的角度保留关键的故障拓扑模式以进行准确的故障分类,最终对往复泵进行高灵敏度的故障诊断。
Smart Images

Figure CN122886237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mechanical fault diagnosis technology, and in particular to a method, apparatus, equipment and medium for diagnosing reciprocating pump faults. Background Technology
[0002] As a core power equipment in industrial production, the operating status of the hydraulic end components (valves, pistons, springs, etc.) of reciprocating pumps directly affects system safety and production efficiency. Reciprocating pumps operate under high pressure, strong vibration, and complex load conditions. The vibration signal is easily affected by the strong superposition interference of fluid dynamics and mechanical vibration, exhibiting high non-stationarity and non-Gaussian characteristics. Moreover, the background noise is strong, which causes key fault characteristics to be severely masked.
[0003] Currently, fault diagnosis solutions mainly combine time-frequency analysis denoising, symbolic representation, and deep learning models in series for fault handling. Specifically, the vibration signal is first processed using time-frequency analysis methods such as Fourier transform, wavelet transform, or empirical mode decomposition. Then, the features in the vibration signal are extracted through symbolic representation. Finally, convolutional neural networks or recurrent neural networks are used to automatically mine fault features from massive amounts of data.
[0004] However, because the fault characteristics of reciprocating pumps are extremely weak and steep transient impacts with very short duration and low energy, when using time-frequency analysis to process strong vibration signals, these extremely short-lived impacts are often regarded as "abnormal noise" and smoothed out, resulting in a "passivation" effect on the local transient changes of the signal. This causes the key fault topology patterns to completely disappear or be severely deformed in the discrete symbol sequence during the subsequent symbolization process, making it difficult to classify faults using the model and ultimately making it difficult to perform high-sensitivity fault diagnosis of reciprocating pumps. Summary of the Invention
[0005] This invention provides a method, apparatus, equipment, and medium for diagnosing reciprocating pump faults, which can solve the problems existing in the prior art.
[0006] This invention provides a method for diagnosing faults in a reciprocating pump, comprising the following steps: Collect the original vibration signal of the reciprocating pump; Kalman filtering is used iteratively to estimate and denoise the original vibration signal of the reciprocating pump, recursively reconstruct the true signal trajectory, and output the denoised vibration signal. Uniform binning symbolization is performed on the denoised signal to map the continuous amplitude of the vibration signal to a finite symbol index, generating a discrete structural state sequence. Based on trainable embedding mapping, each symbol index in the discrete structural state sequence is converted into a continuous semantic vector, and the embedding feature matrix is output. By inputting the embedded feature matrix into the pre-built fault diagnosis model, the fault diagnosis results of the reciprocating pump are obtained.
[0007] Preferably, the acquisition of the denoised vibration signal includes: Set the initial state estimate and the initial error covariance; In the prediction phase, the state prediction for the current moment is made based on the optimal state estimate of the previous moment, and the prior error covariance for the current moment is calculated based on the error covariance of the previous moment and the preset process noise covariance. During the update phase, the Kalman gain is calculated based on the prior error covariance and the preset measurement noise covariance; the Kalman gain is used to perform weighted correction on the deviation between the predicted state value and the actual observed value to obtain the optimal state estimate at the current time and update the error covariance. After recursive iterative calculation, the final denoised vibration signal is output.
[0008] Preferably, the construction of the discrete structural state sequence includes: Based on the maximum and minimum amplitude values of the denoised vibration signal throughout the entire dynamic range, the dynamic range is uniformly divided into a preset number of equal-width intervals. Each signal sampling point within an equal-width interval is assigned a unique corresponding symbol index, mapping the continuous amplitude signal into a discrete symbol index sequence. Symbol indices that exceed the index range generated during the mapping process are truncated at the boundary to obtain a complete symbol sequence characterized as a discrete topological mode.
[0009] Preferably, obtaining the embedding feature matrix includes: Construct a learnable embedding matrix that matches the actual number of symbols in the discrete symbol sequence and the preset embedding dimension, and initialize the embedding matrix using a Xavier uniform distribution; Using the index of each symbol in the discrete symbol sequence as the lookup key, the corresponding row vector is extracted from the initialized learnable embedding matrix, and the symbol sequence is converted into a continuous embedding feature matrix.
[0010] Preferably, the construction of the fault diagnosis model includes: Construct a fault diagnosis model that includes a hierarchical convolutional encoder, a multi-head attention fusion layer, and a classifier; The hierarchical convolutional encoder consists of multiple convolutional layers stacked sequentially, used to compress and extract multi-scale local feature maps layer by layer by performing convolution operations, activation function processing and pooling operations on the embedded feature matrix. The multi-head attention fusion layer maps the multi-scale local feature map into corresponding query vectors, key vectors, and value vectors; by sharing the basic weight matrix of all attention heads and combining it with the low-rank projection matrix specific to each attention head, the attention features of each head are calculated, and the fused feature map is obtained after concatenation and linear transformation. The classifier is used to perform global pooling, bottleneck layer mapping and activation processing on the fused feature map in the time dimension to generate high-level bottleneck representations, and to map the high-level bottleneck representations to the predicted probabilities of various reciprocating pump faults through the Softmax activation function.
[0011] Preferably, the hierarchical convolutional encoder is composed of three convolutional layers stacked sequentially; The first convolutional layer has a kernel size of 5, an output channel count of 64, a pooling kernel size of 8, and a dropout rate of 0.2. The second convolutional layer has a kernel size of 5, an output channel count of 128, and a pooling kernel size of 4. The third convolutional layer has a kernel size of 3, an output channel count of 128, and a pooling kernel size of 4.
[0012] Preferably, the training of the fault diagnosis model includes: The cross-entropy loss function is used to measure the difference between the predicted probability distribution output by the fault diagnosis model and the true label. During the backpropagation of the model, a targeted update strategy is adopted for the learnable embedding matrix, so that the gradient of backpropagation only flows to the embedding rows indexed by the current batch of samples, and the non-indexed embedding rows do not participate in the gradient update. When updating the model parameters, a cosine annealing learning rate scheduling strategy is adopted, setting an initial learning rate and a minimum learning rate, so that the learning rate decays periodically from the initial learning rate to the minimum learning rate according to the cosine function as the number of model training steps increases.
[0013] This invention also provides a reciprocating pump fault diagnosis device, comprising: The data module is used to collect the original vibration signals of the reciprocating pump; The identification module is used to iteratively estimate and denoise the original vibration signal of the reciprocating pump using Kalman filtering, recursively reconstruct the true signal trajectory, and output the denoised vibration signal. It performs uniform binning symbolization processing on the denoised signal, maps the continuous amplitude of the vibration signal to a finite symbol index, and generates a discrete structure state sequence. Based on the trainable embedding mapping, it transforms each symbol index in the discrete structure state sequence into a continuous semantic vector and outputs the embedding feature matrix. The classification module is used to input the embedded feature matrix into the pre-built fault diagnosis model to obtain the fault diagnosis results of the reciprocating pump.
[0014] This invention also provides an electronic device, including a memory and a processor; The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the steps of a reciprocating pump fault diagnosis method as described above.
[0015] This invention also provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the steps of a reciprocating pump fault diagnosis method as described above.
[0016] This invention provides a method, apparatus, equipment, and medium for diagnosing reciprocating pump faults. Compared with the prior art, its advantages are as follows: This invention utilizes Kalman filtering for predictive update recursive estimation. While effectively filtering out random noise and measurement errors in the original vibration signal, it fully preserves the steep shape and temporal position of the transient impact pulse of the fault. This fundamentally avoids the "passivation" loss problem of weak impact features in traditional time-frequency denoising methods, providing a high-fidelity signal base for subsequent symbolic conversion. Based on this high-fidelity signal, uniform binning symbolization maps continuous amplitudes to discrete symbol indices, shifting feature representation from amplitude-driven, which is susceptible to fluctuations in operating conditions, to structure-topology-driven. This blocks the continuous transmission of residual noise along the feature path. After blocking residual noise, the discrete symbol indices are converted into continuous semantic vectors through trainable embedding mapping, constructing a distributed feature space that combines structural stability and rich expressive power. This allows for the preservation of key fault topology patterns from the perspective of the distributed feature space for accurate fault classification, ultimately enabling highly sensitive fault diagnosis of reciprocating pumps.
[0017] This invention performs uniform binning and symbolization on the denoised smooth signal, mapping continuous amplitudes to discrete symbol sequences with boundary truncation constraints. This shifts the feature representation from amplitude-driven, which is susceptible to fluctuations in operating conditions, to structure and topology-driven, thereby blocking the continuous transmission of residual noise along the feature link and effectively alleviating the problem of feature distribution drift under varying operating conditions.
[0018] This invention converts discrete symbol indices into continuous semantic vectors through trainable embedding maps, and automatically mines temporal associations and latent semantic relationships between different symbol states with the help of learnable embedding matrices. It constructs a distributed feature space that has both structural stability and rich expressive power, which not only solves the problems of discrete symbols being non-differentiable and lacking semantics, but also provides a compact and discriminative input representation for subsequent deep models.
[0019] This invention combines multi-head attention convolutional neural networks to achieve adaptive focusing and long-range dependency modeling of fault modes, significantly improving the identification accuracy and cross-condition robustness of weak and intermittent faults in reciprocating pumps under strong noise and multi-condition conditions. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the overall diagnostic process provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the experimental platform deployment and faulty components provided in an embodiment of the present invention; Figure 3 The vibration signal of the mud pump at 600 rpm provided in the embodiment of the present invention; Figure 4 This is a schematic diagram of the network architecture of the MHA convolutional neural network provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the MHA fusion layer architecture provided in an embodiment of the present invention; Figure 6 This is a t-SNE visualization diagram of the test set features under 600rpm operating conditions provided in an embodiment of the present invention. Detailed Implementation
[0021] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0022] Existing fault diagnosis methods have three main limitations: First, traditional time-frequency analysis methods are difficult to adapt to the complex characteristics of reciprocating pump signals, resulting in poor fault feature extraction. Second, existing deep learning methods mostly focus on rotating machinery and are not well adapted to the non-stationarity and multi-source coupling characteristics of reciprocating pumps, and lack robustness in low signal-to-noise ratio (SNR) environments. Third, traditional models have problems such as noise-induced feature ambiguity, unstable feature representation, and insufficient global dependency modeling, resulting in large fluctuations in diagnostic accuracy across operating conditions.
[0023] To address the shortcomings of current fault diagnosis methods, this invention provides a reciprocating pump fault diagnosis method that combines Kalman filtering and symbolic attention, such as... Figure 1 As shown, through a three-level collaborative mechanism of signal domain smoothing, semantic domain abstraction, and dynamic weighting in the feature domain, an end-to-end accurate mapping from noisy signals to fault categories is achieved, solving problems such as difficulty in fault feature extraction, poor diagnostic robustness, and weak adaptability across operating conditions in noisy environments; specifically including: Step 1: Kalman smoothing of vibration data.
[0024] (1) Collect vibration data of the reciprocating pump X={ x 1, x 2,…, xt ,…, x n As an observation of a dynamic system, x t Indicates the number of collections t Vibration data values at each sampling point n This represents the total number of sampling points.
[0025] (2) The optimal state is estimated by prediction-update iteration using Kalman filtering; let the initial state be... x̂ 0|0 = z 0, P 0|0 =1.
[0026] The prediction phase estimates the prior state and covariance at the current time step based on the state at the previous time step: in: x̂ k|k For the first k Time-optimal state estimation P k|k To estimate the error covariance, Q Let be the process noise covariance.
[0027] The update phase calculates the Kalman gain and updates the state and covariance: in: R To measure the noise covariance, K k Kalman gain; The final output, after noise reduction and smoothing, is obtained through recursion. x̂ ( t ), x̂ ( t )={ x̂ 1, x̂ 2,…, x̂ n}
[0028] Step 2: Structure-driven representation transformation.
[0029] (1) Symbolization of uniform boxing.
[0030] (1.1) Determine the box interval.
[0031] Smooth the signal x̂ ( t The dynamic range of ) is uniformly divided into V A series of equal-width intervals: Where: min( x̂ i ) represents the entire smoothed signal x̂ ( t The minimum value of the amplitude; max( x̂ i ) represents the entire smoothed signal x̂ ( t The maximum amplitude of ) V This indicates the preset number of uniformly divided boxes.
[0032] (1.2) Signal points are mapped to symbols.
[0033] For any sample point x̂ [ n ], its symbol index s [ n Determined through digital operation: in: s [ n ] indicates the first n The symbol index corresponding to each sampling point; x̂ [ n ] indicates the Kalman filter result. n A smooth signal sampling point.
[0034] (1.3) Boundary stage processing.
[0035] Additional truncation is required; the expression is: The complete symbol sequence S=[ is obtained, characterized as a discrete topological mode. s [1], s [2],…, s [ N ]] T .
[0036] (2) Embedding-based representation learning.
[0037] (2.1) Construct the embedding matrix.
[0038] Constructing a learnable embedding matrix E∈ℝ v×d The embedding matrix E is initialized using a Xavier uniform distribution: in: v The number of different symbols that actually appear in the discrete symbol sequence ( v ≤ V ), d For the embedded dimension.
[0039] For the input symbol sequence S=[ s [1], s [2],…, s [ N ]] T The embedding operation extracts the corresponding row vectors by index lookup, forming the embedding feature matrix X: Among them: the n OK x [ n ]=E[ s [ n ]] represents a symbol s [ n ]of d 3D embedding vector features; the first i row vector e i ∈ℝ d As a symbol i Distributed representation.
[0040] This operation is mathematically equivalent to matrix multiplication with a one-hot encoded vector: Where: o[ n ]∈{0,1} v Indicates the first n a symbol s [ n The one-hot encoded vector of ].
[0041] The final embedded feature matrix X=[E S[1] E S[2] ,…,E S[N] ] T , X∈ℝ Nd .
[0042] Step 3: MHA-CNN Feature Extraction and Fault Classification.
[0043] (1) Hierarchical convolutional encoder.
[0044] The embedded feature matrix X is input into the hierarchical convolutional encoder, and the encoder parameters are configured as shown in Table 1.
[0045] Table 1. Specific parameter configuration of the convolutional encoder Convolutional layer 1 5 64 8 0.2 Convolutional layer 2 5 128 4 0 Convolutional layer 3 3 128 4 0 The feature evolution expressions for each layer are as follows: Where: X (i) For the first i The convolutional layer outputs a feature map, X.(0) =X (where X is the embedding feature matrix), W (i) and b (i) The first i Layer convolution kernel weights and biases, * denotes one-dimensional convolution operation.
[0046] The final output is a multi-scale local feature map H with dimensions [L, C]. cnn L is the length of the compressed sequence, and C is the number of output channels.
[0047] (2) MHA fusion layer.
[0048] (2.1) The multi-scale local feature map H cnn Introduce MHA.
[0049] Low-dimensional embedding projects the input convolutional feature map into a more compact space, the third h The core calculations for each attention head are as follows: in: d k Let Q be the query vector, K be the key vector, and V be the value vector. h K h V h The first h The projection matrix of each attention head is obtained by the following formula: Among them: W Q h W K h W V h For the first h The linear transformation matrix of the head.
[0050] (2.2) Parameter sharing and group projection strategy.
[0051] Multi-head attention shares a basic weight submatrix, and constructs exclusive weights through a grouped convolutional weight generation method: Among them: W Q W K W V P is the basic weight matrix shared by all attention heads. h For the first h The low-rank projection matrix or sparse selection matrix of the head.
[0052] (2.3) Limit the number of attention heads.
[0053] In MHA, the outputs of each attention head are concatenated and output through a linear mapping matrix W. O Projecting back to the original feature dimension: Wherein: H attn This represents the MHA output feature map with the same dimensions as the input features. H For the number of attention heads.
[0054] (3) Bottleneck feature layer and classifier.
[0055] (3.1) H of the attention layer output attn After global average pooling over time, the flattened H attn Input bottleneck feature layer: Where: z∈ℝ 128 W represents a high-level bottleneck characteristic. b b b These are the weights and biases of the bottleneck layer, respectively.
[0056] (3.2) Output the probability of various faults through the Softmax activation function: in: ŷ i For the first i Predicted probability of class-specific faults C w represents the total number of fault categories. i For the first i The weight vector of the class.
[0057] Step 4: Model training and validation strategies.
[0058] (1) Model training.
[0059] The model uses class cross-entropy loss as the optimization objective to measure the predicted probability distribution. ŷ i With real labels y i The KL divergence (relative entropy) between the training data of batch size B is defined by the loss function as follows: in: ŷ i,c =softmax( z i ) c This represents the class probability of the bottleneck feature after being mapped by the classifier head.
[0060] The embedding layer maps the symbol sequence to E( using index lookup). s iForward propagation is a non-parametric lookup process, while during backward propagation, the gradient flows only to the indexed embedding rows. Where: e i [ n ] is a symbol s The corresponding embedding vector; the summation term iterates through all samples in the batch that satisfy the condition. s i [ n ]= s [ n ] samples i .
[0061] (2) Adopting a cosine annealing learning rate scheduling strategy: in: η max =10 −3 (Initial learning rate) η min =0.01× η max (Minimum learning rate) T total This represents the total number of training steps.
[0062] Specific experiment: Step S1: Kalman smoothing of vibration data.
[0063] Step S1.1: Collect measured vibration data of the three-cylinder reciprocating pump.
[0064] like Figure 2 As shown, the experimental setup uses a horizontal, single-acting, three-cylinder drilling pump as its core, driven by a 600kW diesel engine with a rated stroke rate of 90 strokes / min, a maximum displacement of 1760L / min, and a rated discharge pressure of 33.5MPa. Accelerometers were installed on the top of the valve covers of the three cylinders to collect vibration response characteristics of key components under different operating conditions. The data covers four typical operating conditions: normal state, valve leakage, piston leakage, and spring degradation. Signals were recorded for 90 seconds at three speeds (600rpm, 800rpm, and 1000rpm), with a uniform sampling frequency of 25.6kHz. Figure 3 The image shows the vibration signal over 90 seconds at 600 rpm.
[0065] Step S1.2: Construct the dataset.
[0066] The original signals for each operating condition are normalized, and samples are extracted using the sliding window method. The sample representation is: X={ x 1, x 2,…, x t,…, x 32768}, x t Indicates the number of collections t Vibration data values from each sampling point; 1000 samples, ultimately forming a real reciprocating pump dataset containing 4000 samples across 4 types of faults. Stratified random sampling was used to divide the dataset into training, validation, and test sets at 64%, 16%, and 20% of the total data, respectively.
[0067] Step S1.3: Treat the vibration data X as the observation value of the dynamic system, and use Kalman filtering to estimate the optimal state through prediction-update iteration; let the initial state be... x̂ 0|0 = z 0, P 0|0 =1.
[0068] The prediction phase estimates the prior state and covariance at the current time step based on the state at the previous time step: in: x̂ k|k For the first k Time-optimal state estimation P k|k To estimate the error covariance, 0.01 represents the process noise covariance.
[0069] The update phase calculates the Kalman gain and updates the state and covariance: in, R To measure the noise covariance, K k For Kalman gain.
[0070] The final output, after noise reduction and smoothing, is obtained through recursion. x̂ ( t ), x̂ ( t )={ x̂ 1, x̂ 2,…, x̂ 32768}
[0071] Step S2: Semantic domain abstraction transformation.
[0072] Step S2.1: Symbolization of uniformly divided bins.
[0073] Step S2.1.1: Determine the compartment section.
[0074] Smooth the signal x̂ (t The dynamic range of the device is evenly divided into 50 equal-width intervals: Where: min( x̂ i ) represents the entire smoothed signal x̂ ( t The minimum value of the amplitude; max( x̂ i ) represents the entire smoothed signal x̂ ( t The maximum amplitude of ); 50 represents the preset number of uniformly divided boxes.
[0075] Step S2.1.2: Map signal points to symbols.
[0076] For any sample point x̂ [ n ], its symbol index s [ n The digital operation is as follows: in: s [ n ] indicates the first n The symbol index corresponding to each sampling point; x̂ [ n ] indicates the Kalman filter result. n A smooth signal sampling point.
[0077] Step S2.1.3, Boundary stage processing.
[0078] Additional truncation is required; the expression is: The complete symbol sequence S=[ is obtained, characterized as a discrete topological mode. s [1], s [2],…, s
[32768] T .
[0079] Step S2.2: Embedding-based representation learning.
[0080] Step S2.2.1: Construct the embedding matrix.
[0081] Constructing a learnable embedding matrix E∈ℝ v×d The embedding matrix E is initialized using a Xavier uniform distribution: in: v The number of different symbols that actually appear in the discrete symbol sequence (v ≤128), where 128 is the embedding dimension.
[0082] For the input symbol sequence S=[ s [1], s [2],…, s
[32768] T The embedding operation extracts the corresponding row vectors by index lookup, forming the embedding feature matrix X: Among them: the n OK x [ n ]=E[ s [ n ]] represents a symbol s [ n The 128-dimensional embedding vector features of ]; i row vector e i ∈ℝ 128 As a symbol i Distributed representation.
[0083] This operation is mathematically equivalent to matrix multiplication with a one-hot encoded vector: Where: o[ n ]∈{0,1} v Indicates the first n a symbol s [ n The one-hot encoded vector of ].
[0084] The final embedded feature matrix X=[E S[1] E S[2] ,…,E S
[32768] ] T , X∈ℝ 32768128 .
[0085] Step S3: MHA-CNN feature extraction and fault classification.
[0086] like Figure 4 The diagram shows the network structure of the MHA-CNN neural network.
[0087] Step S3.1, Hierarchical convolutional encoder.
[0088] The embedded feature matrix X is input into the hierarchical convolutional encoder, and the feature evolution expression for each layer is as follows: Where: X (i) For the first i The convolutional layer outputs a feature map, X. (0)=X (where X is the embedding feature matrix), W (i) and b (i) The first i Layer convolution kernel weights and biases, * denotes one-dimensional convolution operation.
[0089] The final output is a multi-scale local feature map H with dimensions [256, 128]. cnn 256 is the length of the compressed sequence, and 128 is the number of output channels.
[0090] Step S3.2, MHA fusion layer.
[0091] like Figure 5 The diagram shown is a schematic of the MHA fusion layer. Step S3.2.1: Convert the multi-scale local feature map H cnn Introduce MHA.
[0092] Low-dimensional embedding projects the input convolutional feature map into a more compact space, the third h The core calculations for each attention head are as follows: in: d k Let Q be the query vector, K be the key vector, and V be the value vector. h K h V h The first h The projection matrix of each attention head is obtained by the following formula: Among them: W Q h W K h W V h For the first h The linear transformation matrix of the head.
[0093] Step S3.2.2, parameter sharing and group projection strategy.
[0094] Multi-head attention shares a basic weight submatrix, and constructs exclusive weights through a grouped convolutional weight generation method: Among them: W Q W K W V P is the basic weight matrix shared by all attention heads. h For the first h The low-rank projection matrix or sparse selection matrix of the head.
[0095] Step S3.2.3: Limit the number of attention heads.
[0096] In MHA, the outputs of each attention head are concatenated and output through a linear mapping matrix W. O Projecting back to the original feature dimension: Wherein: H attn This represents the MHA output feature map with the same dimensions as the input features; Step S3.3: Bottleneck Feature Layer and Classifier.
[0097] Step S3.3.1: Calculate the H output from the attention layer. attn After global average pooling over time, the flattened H attn Input bottleneck feature layer: Where, z∈ℝ 128 W represents a high-level bottleneck characteristic. b b b These are the weights and biases of the bottleneck layer, respectively.
[0098] Step S3.3.2: Output the probability of each type of fault using the Softmax activation function: in: ŷ i For the first i Predicted probability of class-specific faults C w represents the total number of fault categories. i For the first i The weight vector of the class.
[0099] Step S4: Model training and validation strategy.
[0100] Step S4.1: Model training.
[0101] The model uses class cross-entropy loss as the optimization objective to measure the predicted probability distribution. ŷ i With real labels y i The relative entropy (Kullback-Leibler divergence) between the training data of batch size B is defined by the loss function as follows: in: ŷ i,c =softmax( z i ) c This represents the class probability of the bottleneck feature after being mapped by the classifier head.
[0102] The embedding layer maps the symbol sequence to E( using index lookup). s i Forward propagation is a non-parametric lookup process, while during backward propagation, the gradient flows only to the indexed embedding rows. Where: e i [ n ] is a symbol s The corresponding embedding vector; the summation term iterates through all samples in the batch that satisfy the condition. s i [ n ]= s [ n ] samples i .
[0103] Step S4.2: Adopt a cosine annealing learning rate scheduling strategy: in: η max =10 −3 (Initial learning rate) η min =0.01× η max (Minimum learning rate) T total This represents the total number of training steps.
[0104] Step S5: Verify the diagnostic effectiveness and performance using the fault diagnosis results.
[0105] Step S5.1: Configure model parameters.
[0106] Table 2 shows the key hyperparameter configurations for the experimental model.
[0107] Table 2 Main Hyperparameter Configurations Initial learning rate <![CDATA[1×10 −3 ]]> Learning rate scheduling strategy Cosine decay (k=0.01) Maximum number of training rounds 80 Early Stop Mechanism Patience Value 10 Batch size 32 Number of symbolic clusters 50 Symbol Embedding Dimension 128 Step S5.2, Evaluation Indicators.
[0108] The experiment selected average accuracy (Accuracy, Acc) as the primary evaluation metric, and the calculation formula is as follows: in: N For the number of test samples, y i and ŷ i They represent the first i The true label and predicted label of each sample.
[0109] The robustness of the model is represented by the standard deviation (SD) and coefficient of variation (CV) of the accuracy under different operating conditions, and the calculation formulas are as follows: Among them: Acc k For the first k The average diagnostic accuracy under certain operating conditions is given by cc, where cc represents the average accuracy under all operating conditions.
[0110] Step S5.3, Conclusion Analysis.
[0111] The experimental results of this invention have the following characteristics: 1. High diagnostic accuracy: The average diagnostic accuracy reaches 99.87% on a real noisy three-cylinder reciprocating pump dataset, with 100% classification accuracy achieved at 600rpm and 800rpm, and 99.60±0.31% accuracy at 1000rpm; 2. Strong robustness across operating conditions: The SD and CV values of cross-operating condition accuracy are only 0.002 and 0.10%, respectively; 3. Strong feature representation ability: such as... Figure 6 As shown, the characteristics of different fault data form compact, separable clusters.
[0112] The core of this invention is to construct an end-to-end noise-resistant diagnostic framework to address the critical issues of strong noise interference and fault feature masking in reciprocating pump vibration signals. A one-dimensional Kalman filter is used to smooth the original noisy signal. The true signal trajectory is estimated through a "prediction-update" iterative recursion, suppressing Gaussian noise and measurement errors while fully preserving the transient impact characteristics of the fault, avoiding phase distortion, and providing a stable signal foundation for subsequent processing. Uniform binning symbolization transforms the smoothed signal into a discrete symbol sequence, dividing the signal's dynamic range into... V The system assigns symbol indices to intervals to focus on signal topology patterns rather than amplitude fluctuations, thus suppressing noise propagation and feature distribution drift. A trainable embedding mapping mechanism then converts each symbol index in the discrete structural state sequence into a continuous semantic vector. By learning the potential relationships between different structural states, a distributed feature space with both structural stability and semantic expressive power is constructed, addressing the issues of non-differentiability and lack of semantic meaning in discrete symbols. A hybrid MHA-CNN network is used for collaborative feature extraction: a hierarchical convolutional encoder captures multi-scale local fault patterns; the MHA fusion layer models long-range temporal dependencies through parameter sharing and sparse constraints, balancing efficiency and global modeling capabilities; and the bottleneck feature layer and classifier output fault probabilities after pooling and Dropout regularization. Combined with class cross-entropy loss, directional gradient propagation, and cosine annealing learning rate scheduling, the entire network is collaboratively optimized.
[0113] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for diagnosing faults in a reciprocating pump, characterized in that, Includes the following steps: Collect the original vibration signal of the reciprocating pump; Kalman filtering is used iteratively to estimate and denoise the original vibration signal of the reciprocating pump, recursively reconstruct the true signal trajectory, and output the denoised vibration signal. Uniform binning symbolization is performed on the denoised signal to map the continuous amplitude of the vibration signal to a finite symbol index, generating a discrete structural state sequence. Based on trainable embedding mapping, each symbol index in the discrete structural state sequence is converted into a continuous semantic vector, and the embedding feature matrix is output. By inputting the embedded feature matrix into the pre-built fault diagnosis model, the fault diagnosis results of the reciprocating pump are obtained.
2. The method for diagnosing a reciprocating pump fault according to claim 1, characterized in that, The acquisition of the denoised vibration signal includes: Set the initial state estimate and the initial error covariance; In the prediction phase, the state prediction for the current moment is made based on the optimal state estimate of the previous moment, and the prior error covariance for the current moment is calculated based on the error covariance of the previous moment and the preset process noise covariance. During the update phase, the Kalman gain is calculated based on the prior error covariance and the preset measurement noise covariance; the Kalman gain is used to perform weighted correction on the deviation between the predicted state value and the actual observed value to obtain the optimal state estimate at the current time and update the error covariance. After recursive iterative calculation, the final denoised vibration signal is output.
3. The method for diagnosing a reciprocating pump fault according to claim 2, characterized in that, The construction of the discrete structural state sequence includes: Based on the maximum and minimum amplitude values of the denoised vibration signal throughout the entire dynamic range, the dynamic range is uniformly divided into a preset number of equal-width intervals. Each signal sampling point within an equal-width interval is assigned a unique corresponding symbol index, mapping the continuous amplitude signal into a discrete symbol index sequence. Symbol indices that exceed the index range generated during the mapping process are truncated at the boundary to obtain a complete symbol sequence characterized as a discrete topological mode.
4. The method for diagnosing a reciprocating pump fault according to claim 3, characterized in that, The acquisition of the embedded feature matrix includes: Construct a learnable embedding matrix that matches the actual number of symbols in the discrete symbol sequence and the preset embedding dimension, and initialize the embedding matrix using a Xavier uniform distribution; Using the index of each symbol in the discrete symbol sequence as the lookup key, the corresponding row vector is extracted from the initialized learnable embedding matrix, and the symbol sequence is converted into a continuous embedding feature matrix.
5. The method for diagnosing a reciprocating pump fault according to claim 4, characterized in that, The construction of the fault diagnosis model includes: Construct a fault diagnosis model that includes a hierarchical convolutional encoder, a multi-head attention fusion layer, and a classifier; The hierarchical convolutional encoder consists of multiple convolutional layers stacked sequentially, used to compress and extract multi-scale local feature maps layer by layer by performing convolution operations, activation function processing and pooling operations on the embedded feature matrix. The multi-head attention fusion layer maps the multi-scale local feature map into corresponding query vectors, key vectors, and value vectors; by sharing the basic weight matrix of all attention heads and combining it with the low-rank projection matrix specific to each attention head, the attention features of each head are calculated, and the fused feature map is obtained after concatenation and linear transformation. The classifier is used to perform global pooling, bottleneck layer mapping and activation processing on the fused feature map in the time dimension to generate high-level bottleneck representations, and to map the high-level bottleneck representations to the predicted probabilities of various reciprocating pump faults through the Softmax activation function.
6. The method for diagnosing a reciprocating pump fault according to claim 5, characterized in that, The hierarchical convolutional encoder is composed of three convolutional layers stacked sequentially. The first convolutional layer has a kernel size of 5, an output channel count of 64, a pooling kernel size of 8, and a dropout rate of 0.
2. The second convolutional layer has a kernel size of 5, an output channel count of 128, and a pooling kernel size of 4. The third convolutional layer has a kernel size of 3, an output channel count of 128, and a pooling kernel size of 4.
7. A method for diagnosing faults in a reciprocating pump according to claim 5, characterized in that, The training of the fault diagnosis model includes: The cross-entropy loss function is used to measure the difference between the predicted probability distribution output by the fault diagnosis model and the true label. During the backpropagation of the model, a targeted update strategy is adopted for the learnable embedding matrix, so that the gradient of backpropagation only flows to the embedding rows indexed by the current batch of samples, and the non-indexed embedding rows do not participate in the gradient update. When updating the model parameters, a cosine annealing learning rate scheduling strategy is adopted, setting an initial learning rate and a minimum learning rate, so that the learning rate decays periodically from the initial learning rate to the minimum learning rate according to the cosine function as the number of model training steps increases.
8. A reciprocating pump fault diagnosis device, characterized in that, include: The data module is used to collect the original vibration signals of the reciprocating pump; The identification module is used to iteratively estimate and denoise the original vibration signal of the reciprocating pump using Kalman filtering, recursively reconstruct the true signal trajectory, and output the denoised vibration signal. It performs uniform binning symbolization processing on the denoised signal, maps the continuous amplitude of the vibration signal to a finite symbol index, and generates a discrete structure state sequence. Based on the trainable embedding mapping, it transforms each symbol index in the discrete structure state sequence into a continuous semantic vector and outputs the embedding feature matrix. The classification module is used to input the embedded feature matrix into the pre-built fault diagnosis model to obtain the fault diagnosis results of the reciprocating pump.
9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the steps of the reciprocating pump fault diagnosis method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the steps of a reciprocating pump fault diagnosis method as described in any one of claims 1 to 7.