Oil pumping unit edge fault diagnosis method
By establishing fault diagnosis models for indicator diagrams and electrical dynamometer diagrams, and combining them with deep learning networks and data verification, the problems of accuracy and real-time performance in pumping unit fault diagnosis have been solved, enabling efficient and accurate fault diagnosis of pumping units and supporting the intelligent development of oilfields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-04-07
AI Technical Summary
Existing methods for diagnosing pumping unit faults are inadequate in terms of accuracy, real-time performance, ability to handle complex faults, and adaptability to the field. This makes it difficult to diagnose pumping unit faults in a timely and effective manner, thus hindering the intelligent development of oilfields.
A fault diagnosis model for the pumping unit's indicator diagram and electrical power diagram was established. Suspension point displacement data, suspension point load data, and electrical power data were collected. The data integrity, validity, and consistency were verified. A comprehensive judgment was made in conjunction with a deep learning network model. Fault diagnosis was performed using multi-scale convolutional features and an improved VGG16 model, and the fault type and severity score were output.
It improves the comprehensiveness and accuracy of pumping unit fault diagnosis, can accurately extract core fault types under multiple fault coupling conditions, adapts to different working conditions, provides practical engineering guidance, reduces the amount of calculation and manual intervention, and enhances the support for the intelligent development of oilfields.
Smart Images

Figure CN121803221A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of crude oil extraction, and more specifically to a method for diagnosing edge faults in oil pumping units. Background Technology
[0002] Oil pumping units are key surface equipment in oil extraction. Rod pump oil extraction is one of the earliest and most widely used artificial lift methods in the global oil industry, and it plays a dominant role in oil extraction. Ensuring its stable operation and timely detection and resolution of oil pumping unit failures are of paramount importance.
[0003] Traditional diagnostic methods primarily rely on direct measurement of pumping unit operating parameters and manual experience analysis, such as dynamometer card analysis and current analysis. Dynamometer card analysis is currently the most important diagnostic method, but its accuracy largely depends on the experience and subjective judgment of technicians, resulting in low diagnostic efficiency and susceptibility to human factors, making it difficult to diagnose complex operating conditions. Furthermore, traditional dynamometer card acquisition devices operate in harsh outdoor environments for extended periods, making them prone to drift or damage, affecting the accuracy and real-time nature of the data. Current analysis, on the other hand, has limited range and is susceptible to interference from external factors, leading to inaccurate judgments.
[0004] In actual oil wells, multiple faults may occur simultaneously, resulting in complex and mutually influential signal characteristics. Existing intelligent algorithms need to improve their accuracy in diagnosing multi-fault coupling problems. Therefore, existing pumping unit fault diagnosis methods still have shortcomings in terms of accuracy, real-time performance, ability to handle complex faults, and field adaptability, making it difficult to perform timely and effective fault diagnosis of pumping unit wells and hindering the intelligent development of oil fields. Summary of the Invention
[0005] This invention provides a method for diagnosing edge faults in oil pumping units, which addresses the shortcomings of existing oil pumping unit fault diagnosis methods in terms of accuracy, real-time performance, ability to handle complex faults, and field adaptability. The aim is to improve the effectiveness and accuracy of diagnosing complex faults in oil pumping units and promote the intelligent development of oilfields.
[0006] This invention is achieved through the following technical solution:
[0007] A method for diagnosing edge faults in an oil pumping unit includes the following steps:
[0008] S1. Establish fault diagnosis models for the indicator diagram and electrical dynamometer diagram of the oil pumping unit, respectively.
[0009] S2. Collect the suspension point displacement data, suspension point load data, and electrical power data of the pumping unit to be diagnosed;
[0010] S3. Determine whether the indicator diagram and electrical power diagram of the pumping unit to be diagnosed under the current operating conditions can be obtained:
[0011] If a dynamometer diagram or electrical power diagram cannot be obtained, return to step S2;
[0012] If only the indicator diagram under the current operating condition can be obtained, then the indicator diagram under the current operating condition is input into the pumping unit indicator diagram fault diagnosis model, and the output is whether a fault has occurred and the fault type.
[0013] If only the electrical power diagram under the current operating condition can be obtained, then the electrical power diagram under the current operating condition is input into the pumping unit electrical power diagram fault diagnosis model, and the output is whether a fault has occurred and the fault type.
[0014] If the indicator diagram and electrical power diagram under the current operating condition can be obtained simultaneously, the indicator diagram under the current operating condition is input into the pumping unit indicator diagram fault diagnosis model, and the electrical power diagram under the current operating condition is input into the pumping unit electrical power diagram fault diagnosis model to comprehensively determine whether a fault has occurred and the type of fault.
[0015] To address the shortcomings of existing pumping unit fault diagnosis methods in terms of accuracy, real-time performance, ability to handle complex faults, and field adaptability, this invention proposes a method for diagnosing edge faults in pumping units. This method first establishes a dynamometer diagram fault diagnosis model and a power voltmeter diagram fault diagnosis model for the pumping unit. Then, it collects suspension point displacement data, suspension point load data, and electrical power data of the pumping unit to be diagnosed. It then determines whether the dynamometer diagram and power voltmeter diagram of the pumping unit under the current operating conditions can be obtained. If neither dynamometer diagram nor power voltmeter diagram can be obtained, it indicates severe data loss, and the process returns to step S2 to re-collect data. If only the dynamometer diagram under the current operating conditions can be obtained, fault diagnosis is performed based on the dynamometer diagram fault diagnosis model; if only the power voltmeter diagram under the current operating conditions can be obtained, fault diagnosis is performed based on the power voltmeter diagram fault diagnosis model. If both the dynamometer diagram and power voltmeter diagram under the current operating conditions can be obtained simultaneously, the output results of the two fault diagnosis models are used to comprehensively determine whether a fault has occurred and its type.
[0016] This application comprehensively extracts suspension point displacement data, suspension point load data, and electrical power data, utilizing the complementarity of different data types and combining dynamometer diagrams and electrical power diagrams for fault diagnosis, resulting in more comprehensive information. Furthermore, this application can also perform fault diagnosis on oil wells lacking load displacement data or electrical power data, which not only improves the efficiency of oil pumping unit fault diagnosis but also effectively avoids the uncertainty and randomness brought about by manual feature selection. Compared with existing technologies, it significantly improves the comprehensiveness and accuracy of fault diagnosis.
[0017] Furthermore, in step S3, the method for determining whether the indicator diagram and electrical power diagram of the pumping unit to be diagnosed under the current operating conditions can be obtained includes:
[0018] Based on the data collected in step S2, perform data integrity verification, data validity verification, displacement-load consistency verification, and displacement-electric power consistency verification.
[0019] If the suspension point displacement data and suspension point load data both pass the data integrity verification and data validity verification, and the displacement-load consistency verification passes, then it is determined that a dynamometer diagram can be obtained.
[0020] If the electrical power data passes the data integrity verification, data validity verification, and displacement-electric power consistency verification, then it is determined that an electrical power diagram can be obtained.
[0021] This solution proposes a method to quickly determine whether the dynamometer and electrical power diagram of the pumping unit under the current operating conditions can be obtained based on the collected basic data. This method can quickly and efficiently determine whether the dynamometer and electrical power diagram can be obtained through data integrity verification, data validity verification, and consistency verification. It is beneficial for edge processing of the collected data and reduces the computational load of edge processing.
[0022] Furthermore, in step S3, the method for comprehensively determining whether a fault has occurred and the type of fault includes:
[0023] Based on the aforementioned pumping unit electrical dynamometer fault diagnosis model, the first maximum fault probability w1 and the corresponding fault type f1 are obtained.
[0024] Based on the fault diagnosis model of the pumping unit indicator diagram, the second maximum fault probability w2 and the corresponding fault type f2, and the second maximum fault probability w3 and the corresponding fault type f3 are obtained.
[0025] Perform the following judgment:
[0026] If both the first maximum failure probability w1 and the second maximum failure probability w2 are less than 30%, then no failure has occurred.
[0027] If |w2-w3|≥10%, compare f1 and f2: if f1=f2, then the fault type is f2; otherwise, the fault type is f1.
[0028] If |w2-w3|<10%, compare f1 with f2 and f3: if f1=f2, then the fault type is f2; if f1=f3, then the fault type is f3; if any two of f1, f2, and f3 are not equal, then the fault type is f1.
[0029] This solution obtains the maximum fault probability w1 and the corresponding fault type f1 through the pumping unit dynamometer diagram fault diagnosis model; it also obtains the maximum and second largest fault types and their corresponding fault probabilities through the pumping unit indicator diagram fault diagnosis model, and then makes a comprehensive judgment based on the above diagnostic results.
[0030] This solution can overcome the shortcomings of low accuracy in multi-fault coupling caused by the complexity of signal characteristics and mutual influence when multiple faults occur simultaneously. It can accurately extract the core fault type and its probability, which is conducive to improving the accuracy in diagnosing multi-fault coupling problems.
[0031] Furthermore, the fault diagnosis model for the pumping unit indicator diagram is established using the following method:
[0032] S111. Obtain historical displacement and load data at several pumping unit suspension points, preprocess them, draw several historical indicator diagrams based on a preset resolution, and obtain the fault type corresponding to each historical indicator diagram; the fault type here includes the "no fault" condition.
[0033] S112. Extract image blocks from each historical demonstration image, and extract the multi-scale convolutional features of the image blocks;
[0034] S113. Construct a deep learning network model using multi-scale convolutional features as input and fault type and fault rate as output.
[0035] S114. Based on the multi-scale convolutional features, divide the training set, validation set, and test set, and iteratively train and validate the deep learning network model to obtain the pumping unit indicator diagram fault diagnosis model.
[0036] In this solution, the historical dynamometer diagram can be drawn using existing technology, which is not difficult for those skilled in the art to implement. By analyzing the dynamometer diagram, parameters such as the pumping unit's operating efficiency, power consumption, and output can be determined, indicating whether the pumping unit has malfunctioned and identifying the type of malfunction. This provides a raw dataset for training deep learning network models.
[0037] Furthermore, this approach extracts multi-scale convolutional features as model input, which can balance versatility and adaptability to pumping unit operating conditions, resulting in better prediction performance.
[0038] Furthermore, in step S112, multi-scale convolutional features of the image patch are extracted using a convolutional neural network; the convolutional neural network includes:
[0039] Basic scale feature extraction layer: Extracts the edge contours, inflection point coordinates, and curve slope abrupt change points of historical dynamometer maps through 3×3 or 5×5 parallel convolution kernels;
[0040] Feature extraction layer for each stroke stage: Ordinary convolution with an expansion rate of 1 is used in the upstroke stage of the pumping unit; dilated convolution with an expansion rate of 2 is used in the downstroke stage of the pumping unit; deformable convolution is used in the transition stage between the upstroke and downstroke of the pumping unit.
[0041] Fault-sensitive region feature extraction layer: embeds the first attention module and extracts global semantic features through an 11×11 large convolutional kernel.
[0042] This scheme improves the targeting of dynamometer diagram feature extraction by setting different convolution branches for the three stroke stages of the pumping unit through a stroke stage feature extraction layer, thereby improving the accuracy of the model. Specifically: the upper stroke stage uses ordinary convolution with an expansion rate of 1 to extract details of the load increase stage; the lower stroke stage uses dilated convolution with an expansion rate of 2 to cover global features of the load decrease stage; and the transition stage uses deformable convolution to adaptively capture irregular curves in the start-stop stage, focusing on extracting the load peak, valley, and duration features of each stage.
[0043] In addition, this solution can automatically focus on load change zones and closed curve distortion zones through a fault-sensitive area feature extraction layer.
[0044] Furthermore, the deep learning network model adopts an improved VGG16 model, wherein the convolutional layers include Conv1-Conv5;
[0045] The improved VGG16 model includes: inserting an upstroke convolution kernel in Conv4, an understroke convolution kernel in Conv3, and a transition segment convolution kernel in Conv5.
[0046] Upstroke convolution kernel: The number of channels is 1.2 times that of the main convolution kernel. It is used to receive the upstroke data of the pumping unit after convolution by the main convolution kernel and perform 3×3 convolution.
[0047] Downstroke convolution kernel: The number of channels is equal to the number of channels of the main convolution kernel. It is used to receive the downstroke data of the pumping unit after convolution by the main convolution kernel and perform 5×5 convolution.
[0048] Transition segment convolution kernel: The number of channels is 0.8 times that of the main convolution kernel. It is used to receive the transition segment data of the pumping unit after convolution by the main convolution kernel and perform 4×4 convolution.
[0049] The improved VGG16 model further includes: adding a BiFPN feature fusion module after the Conv5 layer to fuse multi-scale convolutional features of the dynamometer map; and embedding a second attention module before the fully connected layer to automatically focus on features of fault-sensitive regions and suppress invalid background features.
[0050] Those skilled in the art should understand that VGG16 is an existing mature model, whose convolutional layers include a main convolutional kernel and five convolutional blocks, Conv1-Conv5. This solution improves and optimizes the network structure of the traditional VGG16 model by inserting convolutional kernels corresponding to the three stroke stages of the pumping unit into Conv3-Conv5, thereby better adapting to the real-time diagnostic needs of the pumping unit and significantly improving diagnostic accuracy.
[0051] Furthermore, during the iterative training of the deep learning network model in step S114, a flooding perturbation mechanism is adopted, and the hyperparameter floodlevel is dynamically updated using the following formula: floodlevel=baseflood×(1+β×0.5+θ×0.3); where baseflood represents the floodlevel before the update, β is the proportion of fault samples in the training set, and θ is the operating condition fluctuation coefficient.
[0052] During the iterative training of the deep learning network model in step S114, the learning rate is dynamically adjusted according to the pumping unit stroke stage, such that: the learning rate for the pumping unit upstroke stage = 1e-4 × 1.2, the learning rate for the pumping unit downstroke stage = 1e-4 × 0.9, and the learning rate for the pumping unit transition stage = 1e-4; where le is the initial learning rate, which can be set manually.
[0053] In step S114, during the iterative training of the deep learning network model, the loss function used is: L = Le + λ×L f Where L represents the composite loss, Le represents the weighted cross-entropy loss, and L f Represents the failure distance loss, λ is the balance coefficient; and satisfies:
[0054] ;
[0055] ;
[0056] In the formula: w i The weight of the i-th sample is represented by y. i p represents the true label of the i-th sample; i f is the model's predicted probability; K is the number of fault samples in the training set; i Let cy be the deep feature vector of the i-th sample; i The feature center represents the fault category corresponding to the i-th sample.
[0057] This approach improves upon the classic VGG16 model by introducing a flooding perturbation mechanism during training. This allows the model parameters to converge more stably to a better solution, thereby enhancing the model's generalization ability and robustness against interference.
[0058] In the flooding disturbance mechanism, floodlevel is the core hyperparameter. This solution introduces a condition-aware adaptive function to this hyperparameter, which can dynamically update floodlevel according to the current operating conditions, thereby improving the adaptability to the operating conditions of the pumping unit and enhancing the accuracy of fault diagnosis.
[0059] This approach also links the learning rate during model training to the pumping unit stroke stage, significantly enhancing the ability to learn fault characteristics through stage-differentiated learning rates.
[0060] Furthermore, this solution creatively proposes a composite loss function based on weighted cross-entropy and fault distance loss, which is more suitable for the fault diagnosis needs of pumping units and improves the accuracy of the diagnostic structure.
[0061] Furthermore, the output of the deep learning network model also includes a fault severity score; the fault severity score is calculated using the following formula:
[0062] S= 0.5×D + 0.3×ΔP+0.2×ΔE;
[0063] In the formula: S is the fault severity score; D is the degree of distortion of the indicator diagram; ΔP is the load deviation rate; ΔE is the electrical power distribution offset; and satisfies:
[0064] D = 1 - C;
[0065] ΔP=|P max -Ps max | / Ps max ;
[0066] ΔE=|E st -E it |;
[0067] Where: C represents the overlap degree obtained after pixel-level matching between the dynamometer card to be diagnosed and the standard dynamometer card; P max The maximum load on the indicator diagram to be diagnosed; Ps max E represents the maximum load on the standard dynamometer diagram. st E represents the histogram mean of the electrical activity diagram to be diagnosed. it This is the histogram mean of the standard electrical power diagram.
[0068] In this solution, in addition to outputting diagnostic results, a fault severity score can also be output, thus enabling the application to combine diagnostic accuracy with engineering practicality. A higher fault severity score indicates a more severe fault, thereby providing a reference and guidance for prioritizing maintenance and repair operations in the oilfield. The standard indicator diagram is a pre-obtained indicator diagram under standard operating conditions based on the current pumping unit model and rated power.
[0069] Furthermore, the fault diagnosis model for the pumping unit's electrical dynamometer diagram is used for fault diagnosis using the following method:
[0070] S121. Obtain the current power data of the pumping unit motor, and perform filtering and normalization processing on the current power data;
[0071] S122. Divide the normalized current power data into M intervals according to the magnitude of the power data, count the frequency of the power data in each interval, and obtain the histogram of the current power graph.
[0072] S123. Calculate the similarity between the histogram of the current electrical power diagram and the histogram of the standard electrical power diagram;
[0073] S124. Determine if the similarity is greater than the similarity threshold:
[0074] If so, it is considered a normal state;
[0075] If not, output the fault type and fault probability based on the preset fault type set.
[0076] This scheme clearly defines the diagnostic process of the EMGraph fault diagnosis model for oil pumping units, providing a reasonable basis for diagnosing oil pumping unit faults through EMGraphs. The standard EMGraph is a EMGraph obtained in advance under standard operating conditions based on the current model and rated power of the oil pumping unit.
[0077] Furthermore, in step S123, the similarity between the histogram of the current electrical power diagram and the histogram of the standard electrical power diagram is calculated using the following formula:
[0078] S=1-[Σ(γ×α×β×(A k -B k )²) / (A k +B k +ε)] / [Σ(γ×α×β)+ε];
[0079] In the formula: S represents the similarity; A k B is the frequency of the k-th interval of the histogram of the current electrical power diagram; kγ is the frequency of the k-th interval of the histogram of the standard electrical power diagram; γ is the stroke stage weight; α is the fault sensitivity factor; β is the operating condition dynamic factor; ε is the learning rate correlation coefficient, taken as ε=1e-6, and le is the initial learning rate;
[0080] The method for determining the weight γ of the stroke stage is as follows:
[0081] For the upstroke section of the pumping unit, γ = 0.4; for the downstroke section, γ = 0.35; and for the transition section, γ = 0.25.
[0082] Since the electrical data has been divided into M intervals in the aforementioned steps, for the frequency of the k-th interval, it is determined which stroke stage of the pumping unit it belongs to, and then the corresponding stroke stage weight γ is assigned. It can be seen that this scheme binds the similarity calculation process with the stroke stage of the pumping unit, which can more accurately calculate the similarity between the histogram of the current electrical power diagram and the histogram of the standard electrical power diagram, and thus output the fault diagnosis result of the electrical power diagram more accurately.
[0083] Furthermore, the method for determining the value of the fault sensitivity factor α is as follows:
[0084] S1231. Collect several sets of historical samples containing electrical power data and corresponding fault labels, and divide them into M intervals according to the magnitude of the electrical power data.
[0085] S1232. For each power interval, calculate the mutual information value between the frequency of the power interval and each fault type, and take the maximum value of the mutual information value as the fault association strength of the power interval.
[0086] S1233. The fault correlation strength of all electrical power intervals is clustered using the K-means clustering algorithm to obtain the first clustering threshold T1 and the second clustering threshold T2, where T1 < T2.
[0087] S1234. Determine the fault correlation strength of each electrical power range:
[0088] If the fault correlation strength of a certain power range is ≥ T2, then the fault sensitivity factor α of that power range is taken as 1.6.
[0089] If T1 ≤ the fault correlation strength of a certain power range < T2, then take the fault sensitivity factor α = 1.2 for that power range.
[0090] If the fault correlation strength of a certain power range is < T1, then the fault sensitivity factor α of that power range is taken as 1.
[0091] This scheme establishes a mapping relationship between power intervals and fault association strength using historical fault data. It then uses the K-means clustering algorithm to cluster the fault association strength of all power intervals, classifying the fault association strength into three categories based on the clustering results. Two thresholds are obtained: the smaller threshold is defined as the first clustering threshold T1, and the larger threshold is defined as the second clustering threshold T2. For the k-th interval of the current power graph's histogram, the corresponding fault association strength is obtained through steps S1232, and then compared with T1 and T2 to obtain the fault sensitivity factor for the k-th interval of the current power graph's histogram.
[0092] Furthermore, the method for determining the value of the operating condition dynamic factor β is as follows:
[0093] Based on the current power diagram, determine the real-time average power Pavg, and determine the operating condition dynamic factor β based on the ratio of the real-time average power Pavg to the rated power Prated.
[0094] If Pavg / Prated < 0.8, then take the dynamic factor β = 1.3.
[0095] If 0.8≤Pavg / Prated≤1.2, then take the dynamic factor β=1.
[0096] If Pavg / Prated > 1.2, then take the dynamic factor β = 1.4.
[0097] This solution can adapt to the differences in electrical power distribution under different load conditions, which is more conducive to obtaining accurate electrical power diagram diagnosis results.
[0098] Compared with the prior art, the present invention has at least the following advantages and beneficial effects:
[0099] 1. The present invention provides a method for diagnosing edge faults of oil pumping units. By comprehensively extracting suspension point displacement data, suspension point load data, and electrical power data, and utilizing the complementarity of different types of data, the method combines dynamometer diagrams and electrical power diagrams for fault diagnosis, resulting in more comprehensive information and promoting the intelligent development of oilfields.
[0100] 2. The present invention provides a method for diagnosing edge faults in oil pumping units, which can also diagnose faults in oil pumping wells that lack load displacement data or electrical power data. This not only improves the efficiency of oil pumping unit fault diagnosis, but also effectively avoids the uncertainty and randomness caused by manual feature selection. Compared with the prior art, it significantly improves the comprehensiveness and accuracy of fault diagnosis.
[0101] 3. The present invention provides a method for diagnosing edge faults in oil pumping units. Through data integrity verification, data validity verification, and consistency verification, it can quickly and efficiently determine whether dynamometer diagrams and electrical dynamometer diagrams can be obtained, which is beneficial for edge processing of collected data and reduces the computational load of edge processing.
[0102] 4. The present invention provides a method for diagnosing edge faults in oil pumping units, which can overcome the shortcomings of low accuracy in multi-fault coupling caused by the complexity of signal characteristics and mutual influence when multiple faults occur simultaneously. It can accurately extract the core fault type and its fault probability, which is beneficial to improving the accuracy in diagnosing multi-fault coupling problems.
[0103] 5. This invention provides a method for diagnosing edge faults in pumping units. Different convolutional branches are set for each of the three stroke stages of the pumping unit, significantly improving the targeting of feature extraction from the pumping unit's indicator diagram and thus enhancing model accuracy. Furthermore, based on the traditional VGG16 model, its network structure is improved and optimized by inserting convolutional kernels corresponding to the three stroke stages of the pumping unit into Conv3-Conv5, thereby better adapting to the real-time diagnostic needs of the pumping unit and significantly improving diagnostic accuracy.
[0104] 6. This invention provides a method for diagnosing edge faults in pumping units. During the model training process, an optimized Flooding perturbation mechanism is introduced, which can dynamically update the floodlevel according to the current operating conditions, thereby improving the adaptability to the operating conditions of the pumping unit and improving the accuracy of fault diagnosis. Furthermore, a composite loss function based on weighted cross-entropy and fault distance loss is proposed, which can better adapt to the fault diagnosis needs of pumping units and improve the accuracy of the diagnostic structure.
[0105] 7. The present invention provides a method for diagnosing edge faults in oil pumping units. In addition to outputting diagnostic results, the fault diagnosis model of the oil pumping unit indicator diagram can also output a fault severity score, thereby enabling the present application to have both diagnostic accuracy and engineering practicality. The higher the fault severity score, the more serious the fault, thus providing a reference and guidance for prioritizing maintenance and repair operations in oilfields.
[0106] 8. The present invention provides a method for diagnosing edge faults in a pumping unit. In the pumping unit electrical power diagram fault diagnosis model, the similarity calculation process is bound to the pumping unit stroke stage, which can more accurately calculate the similarity between the histogram of the current electrical power diagram and the histogram of the standard electrical power diagram, thereby outputting the fault diagnosis result of the electrical power diagram more accurately; it can also adapt to the differences in electrical power distribution under different load conditions, which is more conducive to obtaining accurate electrical power diagram diagnosis results. Attached Figure Description
[0107] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:
[0108] Figure 1 This is a schematic diagram of the overall process of a specific embodiment of the present invention;
[0109] Figure 2 This is a flowchart illustrating the fault diagnosis model of the pumping unit indicator diagram in a specific embodiment of the present invention;
[0110] Figure 3 This is a flowchart illustrating the fault diagnosis model of the pumping unit electrical power diagram in a specific embodiment of the present invention;
[0111] Figure 4 This is a schematic diagram of a fault diagnosis device in a specific embodiment of the present invention.
[0112] The attached diagram shows the markings and corresponding component names:
[0113] 1-Mounting hole, 2-Explosion-proof box, 3-IoT switch, 4-Designated light, 5-Interface. Detailed Implementation
[0114] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are for explaining the invention only and are not intended to limit the invention. In the description of this application, it should be understood that terms such as "front," "rear," "left," "right," "upper," "lower," "vertical," "horizontal," "high," "low," "inner," and "outer," indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the scope of protection of this application.
[0115] Example 1:
[0116] like Figure 1 The method for diagnosing edge faults in an oil pumping unit, as shown, includes the following steps:
[0117] Step S1: Establish fault diagnosis models for the pumping unit indicator diagram and the pumping unit electrical dynamometer diagram, respectively.
[0118] Step S2: Collect the suspension point displacement data, suspension point load data, and electrical power data of the pumping unit to be diagnosed;
[0119] Step S3: Determine whether the indicator diagram and electrical power diagram of the pumping unit to be diagnosed under the current operating conditions can be obtained:
[0120] If a dynamometer diagram or electrical power diagram cannot be obtained, return to step S2;
[0121] If only the indicator diagram under the current operating condition can be obtained, then the indicator diagram under the current operating condition is input into the pumping unit indicator diagram fault diagnosis model, and the output is whether a fault has occurred and the fault type.
[0122] If only the electrical power diagram under the current operating condition can be obtained, then the electrical power diagram under the current operating condition is input into the pumping unit electrical power diagram fault diagnosis model, and the output is whether a fault has occurred and the fault type.
[0123] If both the indicator diagram and the electrical power diagram under the current operating condition can be obtained simultaneously, then the indicator diagram under the current operating condition is input into the pumping unit indicator diagram fault diagnosis model, and the electrical power diagram under the current operating condition is input into the pumping unit electrical power diagram fault diagnosis model, to comprehensively determine whether a fault has occurred and the type of fault; the specific methods for comprehensive determination here include:
[0124] Based on the aforementioned pumping unit electrical dynamometer fault diagnosis model, the first maximum fault probability w1 and the corresponding fault type f1 are obtained.
[0125] Based on the fault diagnosis model of the pumping unit indicator diagram, the second maximum fault probability w2 and the corresponding fault type f2, and the second maximum fault probability w3 and the corresponding fault type f3 are obtained.
[0126] Perform the following judgment:
[0127] If both the first maximum failure probability w1 and the second maximum failure probability w2 are less than 30%, then no failure has occurred.
[0128] If |w2-w3|≥10%, compare f1 and f2: if f1=f2, then the fault type is f2; otherwise, the fault type is f1.
[0129] If |w2-w3|<10%, compare f1 with f2 and f3: if f1=f2, then the fault type is f2; if f1=f3, then the fault type is f3; if any two of f1, f2, and f3 are not equal, then the fault type is f1.
[0130] In this embodiment, the method for determining whether the indicator diagram and electrical power diagram of the pumping unit to be diagnosed under the current operating conditions can be obtained includes:
[0131] Based on the data collected in step S2, perform data integrity verification, data validity verification, displacement-load consistency verification, and displacement-electric power consistency verification.
[0132] If the suspension point displacement data and suspension point load data both pass the data integrity verification and data validity verification, and the displacement-load consistency verification passes, then it is determined that a dynamometer diagram can be obtained.
[0133] If the electrical power data passes the data integrity verification, data validity verification, and displacement-electric power consistency verification, then it is determined that an electrical power diagram can be obtained.
[0134] Preferably, the data integrity verification includes:
[0135] Suspension point displacement data integrity verification: If the number of suspension point displacement data points in a single stroke cycle is ≥500 and the suspension point displacement data missing rate is ≤5%, then the suspension point displacement data is determined to have passed the integrity verification.
[0136] Suspension load data integrity verification: If the data length of the suspension load data is consistent with the data length of the suspension displacement data, and the data missing rate of the suspension load data is ≤3%, then the suspension load data is deemed to have passed the integrity verification.
[0137] Power data integrity verification: If the number of power data points in a single stroke cycle is ≥300 and the power data missing rate is ≤5%, then the power data is deemed to have passed the integrity verification.
[0138] Preferably, the data validity verification includes:
[0139] Validation of suspension point displacement data: If the period difference of any three consecutive strokes is ≤5%, and the displacement amplitude is within 80%~120% of the rated stroke, then the suspension point displacement data is deemed to have passed the validity verification.
[0140] Suspension load data validity verification: If the peak load is within 70% to 130% of the rated load, and no sudden change occurs in any 10 consecutive suspension load data points, then the suspension load data is deemed to have passed the validity verification.
[0141] Power data validity verification: If the power amplitude is within 50% to 150% of the rated power, and there is no zero value or constant value for more than 2 seconds except for sensor failure, the power data is deemed to have passed the validity verification.
[0142] Preferably, the method for verifying the consistency of displacement and load includes: calculating the Pearson correlation coefficients r1 and r2 of the suspension point displacement data and suspension point load data during the upstroke stage and the downstroke stage, respectively; if r1≥0.6 and r2≥0.5, then the displacement-load consistency verification is passed.
[0143] Preferably, the method for verifying the consistency of displacement-electric power includes: calculating the Pearson correlation coefficients r3 and r4 of the suspension point displacement data and the electric power data during the upstroke stage and the downstroke stage, respectively. If r3 ≥ 0.4 and r4 ≥ 0.35, then the consistency verification of displacement-electric power is passed.
[0144] Example 2:
[0145] A method for diagnosing edge faults in an oil pumping unit, based on Example 1, describes the process of establishing the fault diagnosis model for the oil pumping unit's indicator diagram as follows: Figure 2 As shown, the specific steps include:
[0146] Step S111: Obtain historical displacement data and load data at several pumping unit suspension points, preprocess them, draw several historical indicator diagrams based on a preset resolution, and obtain the fault type corresponding to each historical indicator diagram.
[0147] Displacement data refers to the positional changes of the suspension point over time during the operation of the pumping unit. It describes the movement of the pumping unit in the horizontal, vertical, or axial directions. Load data refers to the actual load borne by the suspension point during the operation of the pumping unit. The load includes the weight of the sucker rod, tubing, fluid, and frictional resistance. The displacement and load data of the pumping unit reflect its operating status and can thus be used to assess its performance.
[0148] The preprocessing in this step includes normalization and removal of errors, incompleteness, or inaccuracy from the data to improve data quality and accuracy, thus enabling better subsequent data analysis. After preprocessing, the corresponding preprocessed data is obtained.
[0149] In this embodiment, the preset resolution is set to 224*224 and dpi=100. By analyzing the indicator diagram, parameters such as the working efficiency, power consumption, and output of the pumping unit can be determined, whether the pumping unit has malfunctioned, and the type of malfunction of the pumping unit can be obtained.
[0150] Step S112: Extract image patches from each historical dynamometer image, and extract multi-scale convolutional features of the image patches using a convolutional neural network; the convolutional neural network includes:
[0151] Basic scale feature extraction layer: Extracts the edge contours, inflection point coordinates, and curve slope abrupt change points of historical dynamometer maps through 3×3 or 5×5 parallel convolution kernels;
[0152] Stroke phase feature extraction layer: In the upstroke phase of the pumping unit, a normal convolution with an expansion rate of 1 is used to extract details of the load rising phase; in the downstroke phase of the pumping unit, a dilated convolution with an expansion rate of 2 is used to cover global features of the load falling phase; in the transition phase between the upstroke and downstroke of the pumping unit, a deformable convolution is used to adaptively capture irregular curves in the start-stop phase, focusing on extracting load peak, valley and duration features of each phase;
[0153] Fault-sensitive region feature extraction layer: The first attention module GAM is embedded to automatically focus on the load change region and the closed curve distortion region, and extracts global semantic features through an 11×11 large convolution kernel.
[0154] Step S113: Construct a deep learning network model using multi-scale convolutional features as input and fault type and fault rate as output. The deep learning network model in this embodiment improves the classic VGG16 model by introducing a Flooding perturbation mechanism during the training process.
[0155] The training process can be summarized as follows:
[0156] The training set is input into the deep learning network model. During model training, the gradients are first cleared to prevent gradient accumulation from affecting the training results. Then, forward propagation is performed, passing the input data through the improved VGG16 model to obtain prediction results. The loss value is calculated based on the prediction results and the true labels using a loss function. Next, backpropagation is performed to calculate the gradient of the loss function with respect to the model parameters, and the parameters are updated according to the optimizer's rules. The deep learning network model makes corresponding predictions based on the dynamometer maps in the training set, outputting the corresponding fault type and fault rate. The loss function is used to evaluate the difference between the deep learning network model's prediction results and the actual faults. By calculating the value of the loss function, the training results of the model can be known, allowing for adjustments to the model parameters. These parameters are saved, and by continuously adjusting the model parameters, the value of the loss function is minimized to make the model's prediction results closer to the true values.
[0157] In this embodiment, the improved VGG16 model retains the basic architecture of the VGG16 model, which consists of 5 convolutional layers and 3 fully connected layers. The improvements include: inserting an upstroke convolutional kernel in Conv4, an understroke convolutional kernel in Conv3, and a transition segment convolutional kernel in Conv5.
[0158] Upstroke convolution kernel: The number of channels is 1.2 times that of the main convolution kernel. It is used to receive the upstroke data of the pumping unit after convolution by the main convolution kernel and perform 3×3 convolution.
[0159] Downstroke convolution kernel: The number of channels is equal to the number of channels of the main convolution kernel. It is used to receive the downstroke data of the pumping unit after convolution by the main convolution kernel and perform 5×5 convolution.
[0160] Transition segment convolution kernel: The number of channels is 0.8 times that of the main convolution kernel. It is used to receive the transition segment data of the pumping unit after convolution by the main convolution kernel and perform 4×4 convolution.
[0161] Preferably, the improved VGG16 model further includes: adding a BiFPN feature fusion module after the Conv5 layer to fuse multi-scale features of the dynamometer diagram; and embedding a second attention module GAM before the fully connected layer to automatically focus on features of fault-sensitive areas and suppress invalid background features.
[0162] Preferably, the input adaptation requirements of the deep learning network model in this embodiment are: supporting 224×224 single-channel (load-displacement curve), three-channel (load-displacement-time fusion graph) and multimodal input to adapt to different data acquisition scenarios.
[0163] Preferably, the deep learning network model in this embodiment also has the following anti-interference design: ① Add an adaptive BatchNorm (ABN) layer after the convolutional layer; ② Insert Dropout into the fully connected layer, where the dropout rate is 0.35, to improve the model's generalization ability.
[0164] Step S114: Based on the multi-scale convolutional features, divide the training set, validation set, and test set, and iteratively train and validate the deep learning network model to obtain the pumping unit indicator diagram fault diagnosis model.
[0165] In this embodiment, during the iterative training of the deep learning network model, a flooding perturbation mechanism is adopted, and the hyperparameter floodlevel is dynamically updated using the following formula: floodlevel=baseflood×(1+β×0.5+θ×0.3); where baseflood represents the floodlevel before the update, β is the proportion of fault samples in the training set, and θ is the operating condition fluctuation coefficient.
[0166] Preferably, the method for calculating the operating condition fluctuation coefficient θ is as follows:
[0167] Take N consecutive electrical power samples {P1, P2, ..., P} within the training batch. n};
[0168] Calculate the standard deviation σ of the power output of this batch;
[0169] The standard deviation σ is normalized, and the normalized value is used as the operating condition fluctuation coefficient θ.
[0170] Preferably, during the iterative training of the deep learning network model in step S114, the learning rate is dynamically adjusted according to the pumping unit stroke stage, such that: the learning rate of the pumping unit upstroke stage = 1e-4 × 1.2, the learning rate of the pumping unit downstroke stage = 1e-4 × 0.9, and the learning rate of the pumping unit transition stage = 1e-4; where le is the initial learning rate.
[0171] It can be seen that the lower the proportion of faulty samples and the greater the fluctuation of operating conditions, the higher the flood level, thus avoiding the model from being biased towards normal samples; in addition, this embodiment also correlates the learning rate with the pumping unit stroke stage.
[0172] Preferably, in step S114, during the iterative training of the deep learning network model, the loss function used is: L = Le + λ×L f Where L represents the composite loss, Le represents the weighted cross-entropy loss, and L f Represents the failure distance loss, λ is the balance coefficient; and satisfies:
[0173] ;
[0174] ;
[0175] In the formula: w i The weight of the i-th sample is represented by y. i p represents the true label of the i-th sample; i f is the model's predicted probability; K is the number of fault samples in the training set; i Let cy be the deep feature vector of the i-th sample; i The feature center represents the fault category corresponding to the i-th sample.
[0176] Preferably, for fault samples, w is taken. i =3, for normal samples, take w i =1.
[0177] In a more preferred embodiment, the output of the deep learning network model further includes a fault severity score; the fault severity score is calculated using the following formula:
[0178] S= 0.5×D + 0.3×ΔP+0.2×ΔE;
[0179] In the formula: S is the fault severity score; D is the degree of distortion of the indicator diagram; ΔP is the load deviation rate; ΔE is the electrical power distribution offset; and satisfies:
[0180] D = 1 - C;
[0181] ΔP=|P max -Ps max | / Ps max ;
[0182] ΔE=|E st -E it |;
[0183] Where: C represents the overlap degree obtained after pixel-level matching between the dynamometer card to be diagnosed and the standard dynamometer card; Pmax The maximum load on the indicator diagram to be diagnosed; Ps max E represents the maximum load on the standard dynamometer diagram. st E represents the histogram mean of the electrical activity diagram to be diagnosed. it This is the histogram mean of the standard electrical power diagram.
[0184] Example 3:
[0185] A method for diagnosing edge faults in an oil pumping unit, based on embodiment 1 or 2, wherein the fault diagnosis model of the oil pumping unit electrical power diagram is as follows: Figure 3 As shown, fault diagnosis is performed using the following method:
[0186] Step S121: Obtain the current power data of the pumping unit motor, and perform filtering and normalization processing on the current power data.
[0187] Specifically, an adaptive median filtering algorithm is used to filter the collected electrical power data to remove noise interference. The filtered electrical power data is then normalized, mapping its numerical range to the [0,1] interval to eliminate dimensional differences between different electrical power data and improve the accuracy of subsequent histogram feature extraction.
[0188] Step S122: Divide the normalized current power data into M intervals according to the amplitude of the power data, count the frequency of the power data in each interval, and obtain the histogram of the current power graph. The number of intervals can be adjusted according to actual needs to balance the richness of features and computational complexity.
[0189] Step S123: Extract the mean, variance, skewness, and kurtosis from the histogram, and calculate the similarity between the histogram of the current power diagram and the histogram of the standard power diagram.
[0190] Step S124: Determine if the similarity is greater than the similarity threshold:
[0191] If so, it is considered a normal state;
[0192] If not, output the fault type and fault probability based on the preset fault type set. The preset fault type set can include any one or more of the following: normal operating condition, insufficient liquid supply, fixed valve leakage, gas influence, rod breakage, floating valve leakage, severe insufficient liquid supply, and pumping failure, to determine the fault type and fault probability.
[0193] The similarity threshold can be adaptively set based on experimental data and / or historical experience.
[0194] Preferably, the similarity in step S123 is calculated using the following formula:
[0195] S=1-[Σ(γ×α×β×(A k -B k )²) / (A k +B k +ε)] / [Σ(γ×α×β)+ε];
[0196] In the formula: S represents the similarity; A k B is the frequency of the k-th interval of the histogram of the current electrical power diagram; k γ is the frequency of the k-th interval of the histogram of the standard electrical power diagram; γ is the stroke stage weight; α is the fault sensitivity factor; β is the operating condition dynamic factor; ε is the learning rate correlation coefficient, taken as ε=1e-6, and le is the initial learning rate.
[0197] The method for determining the weight γ during the stroke phase is as follows:
[0198] For the upstroke section of the pumping unit, γ = 0.4; for the downstroke section, γ = 0.35; and for the transition section, γ = 0.25. This method of setting values can focus on strengthening the upstroke stage, which is prone to failure, thereby improving the response capability to critical stages.
[0199] The method for determining the value of the fault sensitivity factor α is as follows:
[0200] S1231. Collect several sets of historical samples containing electrical power data and corresponding fault tags, and divide them into M intervals according to the amplitude of the electrical power data. Preferably, the interval division here is consistent with the division in step S122.
[0201] S1232. For each power interval, calculate the mutual information value between the frequency of the power interval and each fault type, and take the maximum value of the mutual information value as the fault association strength of the power interval.
[0202] S1233. The fault correlation strength of all electrical power intervals is clustered using the K-means clustering algorithm to obtain the first clustering threshold T1 and the second clustering threshold T2, where T1 < T2.
[0203] S1234. Determine the fault correlation strength of each electrical power range:
[0204] If the fault correlation strength of a certain power range is ≥ T2, then the fault sensitivity factor α of that power range is taken as 1.6.
[0205] If T1 ≤ the fault correlation strength of a certain power range < T2, then take the fault sensitivity factor α = 1.2 for that power range.
[0206] If the fault correlation strength of a certain power range is < T1, then the fault sensitivity factor α of that power range is taken as 1.
[0207] The method for determining the value of the dynamic factor β under the operating conditions is as follows:
[0208] Based on the current power diagram, determine the real-time average power Pavg, and determine the operating condition dynamic factor β based on the ratio of the real-time average power Pavg to the rated power Prated.
[0209] If Pavg / Prated < 0.8, then take the dynamic factor β = 1.3.
[0210] If 0.8≤Pavg / Prated≤1.2, then take the dynamic factor β=1.
[0211] If Pavg / Prated > 1.2, then take the dynamic factor β = 1.4.
[0212] Example 4:
[0213] A pumping unit edge fault diagnosis device is provided for performing the pumping unit edge fault diagnosis method described in any of the above embodiments. The pumping unit edge fault diagnosis device is as follows: Figure 4 As shown, it includes an explosion-proof box 2, an IoT gateway 3 located inside the explosion-proof box 2, a processing module, and a storage module.
[0214] The explosion-proof box 2 is provided with mounting holes 1 on its surface for installation at a suitable position on the oil pumping unit to achieve distributed edge fault diagnosis.
[0215] The IoT gateway 3 is used to realize functions such as data collection and data forwarding. It has several interfaces 5, which are used to connect with sensors that monitor the displacement data of the suspension point, sensors that monitor the load data of the suspension point, and sensors that monitor the power data of the electrical point. In addition, the IoT gateway 3 can also connect with the back-end central control system.
[0216] The explosion-proof box 2 is also equipped with designated lights 4 on its surface to indicate the operating status of the diagnostic device.
[0217] The pumping unit indicator diagram fault diagnosis model and the pumping unit electrical diagram fault diagnosis model are both preset in the storage module; the processing module executes the contents of steps S2-S3 and calls them from the storage module when needed.
[0218] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0219] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Additionally, the term "connection" as used herein, unless otherwise specified, can refer to a direct connection or an indirect connection via other components.
Claims
1. A method for diagnosing edge faults in an oil pumping unit, characterized in that, Includes the following steps: S1. Establish fault diagnosis models for the indicator diagram and electrical dynamometer diagram of the oil pumping unit, respectively. S2. Collect the suspension point displacement data, suspension point load data, and electrical power data of the pumping unit to be diagnosed; S3. Determine whether the indicator diagram and electrical power diagram of the pumping unit to be diagnosed under the current operating conditions can be obtained: If a dynamometer diagram or electrical power diagram cannot be obtained, return to step S2; If only the indicator diagram under the current operating condition can be obtained, then the indicator diagram under the current operating condition is input into the pumping unit indicator diagram fault diagnosis model, and the output is whether a fault has occurred and the fault type. If only the electrical power diagram under the current operating condition can be obtained, then the electrical power diagram under the current operating condition is input into the pumping unit electrical power diagram fault diagnosis model, and the output is whether a fault has occurred and the fault type. If the indicator diagram and electrical power diagram under the current operating condition can be obtained simultaneously, the indicator diagram under the current operating condition is input into the pumping unit indicator diagram fault diagnosis model, and the electrical power diagram under the current operating condition is input into the pumping unit electrical power diagram fault diagnosis model to comprehensively determine whether a fault has occurred and the type of fault.
2. The method for diagnosing edge faults in an oil pumping unit according to claim 1, characterized in that, In step S3, the methods for determining whether the indicator diagram and electrical power diagram of the pumping unit to be diagnosed under the current operating conditions can be obtained include: Based on the data collected in step S2, perform data integrity verification, data validity verification, displacement-load consistency verification, and displacement-electric power consistency verification. If the suspension point displacement data and suspension point load data both pass the data integrity verification and data validity verification, and the displacement-load consistency verification passes, then it is determined that a dynamometer diagram can be obtained. If the electrical power data passes the data integrity verification, data validity verification, and displacement-electric power consistency verification, then it is determined that an electrical power diagram can be obtained.
3. The method for diagnosing edge faults in an oil pumping unit according to claim 1, characterized in that, In step S3, the method for comprehensively determining whether a fault has occurred and the type of fault includes: Based on the aforementioned pumping unit electrical dynamometer fault diagnosis model, the first maximum fault probability w1 and the corresponding fault type f1 are obtained. Based on the fault diagnosis model of the pumping unit indicator diagram, the second maximum fault probability w2 and the corresponding fault type f2, and the second maximum fault probability w3 and the corresponding fault type f3 are obtained. Perform the following judgment: If both the first maximum failure probability w1 and the second maximum failure probability w2 are less than 30%, then no failure has occurred. If |w2-w3|≥10%, compare f1 and f2: if f1=f2, then the fault type is f2; otherwise, the fault type is f1. If |w2-w3|<10%, compare f1 with f2 and f3: if f1=f2, then the fault type is f2; if f1=f3, then the fault type is f3; if any two of f1, f2, and f3 are not equal, then the fault type is f1.
4. The method for diagnosing edge faults in an oil pumping unit according to claim 1, characterized in that, The fault diagnosis model for the pumping unit indicator diagram is established using the following method: S111. Obtain historical displacement data and load data at several pumping unit suspension points, preprocess them, draw several historical dynamometer diagrams based on a preset resolution, and obtain the fault type corresponding to each historical dynamometer diagram. S112. Extract image blocks from each historical demonstration image, and extract the multi-scale convolutional features of the image blocks; S113. Construct a deep learning network model using multi-scale convolutional features as input and fault type and fault rate as output. S114. Based on the multi-scale convolutional features, divide the training set, validation set, and test set, and iteratively train and validate the deep learning network model to obtain the pumping unit indicator diagram fault diagnosis model.
5. The method for diagnosing edge faults in an oil pumping unit according to claim 4, characterized in that, In step S112, multi-scale convolutional features of the image patch are extracted using a convolutional neural network; the convolutional neural network includes: Basic scale feature extraction layer: Extracts the edge contours, inflection point coordinates, and curve slope abrupt change points of historical dynamometer maps through 3×3 or 5×5 parallel convolution kernels; Feature extraction layer for each stroke stage: Ordinary convolution with an expansion rate of 1 is used in the upstroke stage of the pumping unit; dilated convolution with an expansion rate of 2 is used in the downstroke stage of the pumping unit; deformable convolution is used in the transition stage between the upstroke and downstroke of the pumping unit. Fault-sensitive region feature extraction layer: embeds the first attention module and extracts global semantic features through an 11×11 large convolutional kernel.
6. The method for diagnosing edge faults in an oil pumping unit according to claim 4, characterized in that, The deep learning network model adopts an improved VGG16 model, wherein the convolutional layers include Conv1-Conv5; The improved VGG16 model includes: inserting an upstroke convolution kernel in Conv4, an understroke convolution kernel in Conv3, and a transition segment convolution kernel in Conv5. Upstroke convolution kernel: The number of channels is 1.2 times that of the main convolution kernel. It is used to receive the upstroke data of the pumping unit after convolution by the main convolution kernel and perform 3×3 convolution. Downstroke convolution kernel: The number of channels is equal to the number of channels of the main convolution kernel. It is used to receive the downstroke data of the pumping unit after convolution by the main convolution kernel and perform 5×5 convolution. Transition segment convolution kernel: The number of channels is 0.8 times that of the main convolution kernel. It is used to receive the transition segment data of the pumping unit after convolution by the main convolution kernel and perform 4×4 convolution. The improved VGG16 model also includes: adding a BiFPN feature fusion module after the Conv5 layer and embedding a second attention module before the fully connected layer.
7. The method for diagnosing edge faults in an oil pumping unit according to claim 4, characterized in that, During the iterative training of the deep learning network model in step S114, a flooding perturbation mechanism is adopted and the hyperparameter floodlevel is dynamically updated using the following formula: floodlevel=baseflood×(1+β×0.5+θ×0.3); where baseflood represents the floodlevel before the update, β is the proportion of fault samples in the training set, and θ is the operating condition fluctuation coefficient. During the iterative training of the deep learning network model in step S114, the learning rate is dynamically adjusted according to the pumping unit stroke stage, such that: the learning rate of the pumping unit upstroke stage = 1e-4 × 1.2, the learning rate of the pumping unit downstroke stage = 1e-4 × 0.9, and the learning rate of the pumping unit transition stage = 1e-4; where le is the initial learning rate. In step S114, during the iterative training of the deep learning network model, the loss function used is: L = Le + λ×L f Where L represents the composite loss, Le represents the weighted cross-entropy loss, and L f Represents the failure distance loss, λ is the balance coefficient; and satisfies: ; ; In the formula: w i The weight of the i-th sample is represented by y. i p represents the true label of the i-th sample; i f is the model's predicted probability; K is the number of fault samples in the training set; i Let cy be the deep feature vector of the i-th sample; i The feature center represents the fault category corresponding to the i-th sample.
8. The method for diagnosing edge faults in an oil pumping unit according to claim 4, characterized in that, The output of the deep learning network model also includes a fault severity score; the fault severity score is calculated using the following formula: S= 0.5×D + 0.3×ΔP+0.2×ΔE; In the formula: S is the fault severity score; D is the degree of distortion of the indicator diagram; ΔP is the load deviation rate; ΔE is the electrical power distribution offset; and satisfies: D = 1 - C; ΔP=|P max -Ps max | / Ps max ; ΔE=|E st -E it |; Where: C represents the overlap degree obtained after pixel-level matching between the dynamometer card to be diagnosed and the standard dynamometer card; P max The maximum load on the indicator diagram to be diagnosed; Ps max E represents the maximum load on the standard dynamometer diagram. st E represents the histogram mean of the electrical activity diagram to be diagnosed. it This is the histogram mean of the standard electrical power diagram.
9. The method for diagnosing edge faults in an oil pumping unit according to claim 1, characterized in that, The fault diagnosis model for the pumping unit's electrical dynamometer diagram is used for fault diagnosis through the following method: S121. Obtain the current power data of the pumping unit motor, and perform filtering and normalization processing on the current power data; S122. Divide the normalized current power data into M intervals according to the magnitude of the power data, count the frequency of the power data in each interval, and obtain the histogram of the current power graph. S123. Calculate the similarity between the histogram of the current electrical power diagram and the histogram of the standard electrical power diagram; S124. Determine if the similarity is greater than the similarity threshold: If so, it is considered a normal state; If not, output the fault type and fault probability based on the preset fault type set.
10. The method for diagnosing edge faults in an oil pumping unit according to claim 9, characterized in that, In step S123, the similarity between the histogram of the current electrical power diagram and the histogram of the standard electrical power diagram is calculated using the following formula: S=1-[Σ(γ×α×β×(A k -B k )²) / (A k +B k +e)] / [Σ(γ×α×β)+e]; In the formula: S represents the similarity; A k B is the frequency of the k-th interval of the histogram of the current electrical power diagram; k γ is the frequency of the k-th interval of the histogram of the standard electrical power diagram; γ is the stroke stage weight; α is the fault sensitivity factor; β is the dynamic factor of operating conditions; ε is the learning rate correlation coefficient, taken as ε=1e-6, and le is the initial learning rate; The method for determining the weight γ of the stroke stage is as follows: For the upstroke section of the pumping unit, γ = 0.4; for the downstroke section, γ = 0.35; and for the transition section, γ = 0.
25. The method for determining the value of the fault sensitivity factor α is as follows: S1231. Collect several sets of historical samples containing electrical power data and corresponding fault labels, and divide them into M intervals according to the magnitude of the electrical power data. S1232. For each power interval, calculate the mutual information value between the frequency of the power interval and each fault type, and take the maximum value of the mutual information value as the fault association strength of the power interval. S1233. The fault correlation strength of all electrical power intervals is clustered using the K-means clustering algorithm to obtain the first clustering threshold T1 and the second clustering threshold T2, where T1 < T2. S1234. Determine the fault correlation strength of each electrical power range: If the fault correlation strength of a certain power range is ≥ T2, then the fault sensitivity factor α of that power range is taken as 1.
6. If T1 ≤ the fault correlation strength of a certain power range < T2, then take the fault sensitivity factor α = 1.2 for that power range. If the fault correlation strength of a certain power range is < T1, then the fault sensitivity factor α of that power range is taken as 1. The method for determining the value of the dynamic factor β under the operating conditions is as follows: Based on the current power diagram, determine the real-time average power Pavg, and determine the operating condition dynamic factor β based on the ratio of the real-time average power Pavg to the rated power Prated. If Pavg / Prated < 0.8, then take the dynamic factor β = 1.
3. If 0.8≤Pavg / Prated≤1.2, then take the dynamic factor β=1. If Pavg / Prated > 1.2, then take the dynamic factor β = 1.4.