An oil pumping condition recognition method based on cross-layer multi-granularity fusion algorithm
By employing a cross-level, multi-granularity fusion algorithm, and utilizing AFENet, Edge-aware Hybrid Encoder, and deformable Transformer decoder, the problems of low accuracy and slow speed in oil well condition identification are solved, achieving highly intelligent, fast, and accurate oil well condition identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING FUDAO OIL & GAS INTELLIGENT CONTROL TECH CO LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-09
AI Technical Summary
In the existing technology, the oil well operating condition identification method based on the pumping unit electrical parameters and indicator diagram has problems such as low accuracy, slow speed, and great influence from individual subjective factors. As well as the slow identification speed and low accuracy of deep learning methods, it is difficult to effectively identify the operating condition of the pumping unit.
A cross-level, multi-granularity fusion algorithm is adopted, which extracts multi-scale features through AFENet, performs deep interaction and fusion with Edge-aware Hybrid Encoder, and combines with deformable Transformer decoder to achieve rapid and accurate identification of oil pumping conditions.
It achieves highly intelligent, accurate, generalizable, and fast identification of oil pumping conditions, reduces labor costs and improves detection efficiency, and solves the shortcomings of traditional methods in multi-scale feature extraction and information fusion.
Smart Images

Figure CN122176365A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil well production and pumping, and specifically to a method for identifying pumping conditions based on a cross-level multi-granularity fusion algorithm. Technical Background
[0002] Dynamometer diagrams and pumping unit electrical parameters are the primary means of understanding the working status of the tubing, rods, and pumps downhole. However, the pumping unit's current cannot fully reflect downhole information, and there are cases where some current characteristics are the same but the operating conditions differ. Therefore, using current technology, the accuracy of algorithms for determining the operating condition of a pumping well based on its electrical parameters is relatively low. On the other hand, all abnormal phenomena in the operation of a deep well pump can be intuitively reflected on the dynamometer diagram. Analyzing and interpreting the dynamometer diagram is a primary means of directly understanding the working condition of a deep well pump. The pumping unit is a core piece of equipment in the oil extraction process. Relying solely on manual judgment of the pumping unit's operating condition and operation is inefficient and cannot meet the needs of industry development. In the current context of the trend of artificial intelligence, especially the use of deep learning technology to mine the information expressed by electrical parameters and dynamometer diagrams, improving the accuracy and efficiency of pumping unit condition or fault identification, and ensuring the stable and reliable operation of the pumping unit are of great significance.
[0003] Currently, traditional methods for identifying pumping wells include mechanical model analysis and expert systems for diagnosing rod pump well faults. However, due to geological differences in various regions and machine aging, the results of traditional dynamometer card identification methods vary significantly. Currently, pumping condition identification mainly relies on electrical parameter judgment, but suffers from low overall accuracy. Manual dynamometer card identification methods also exist, but these are slow, highly susceptible to individual subjective factors, and lack consistency. Machine identification based on dynamometer cards is gradually emerging, but due to variations in the overall shape and detail granularity of pumping dynamometer cards under different operating conditions, as well as differences in resolution and operating condition feature details across different acquisition methods, conventional deep learning methods suffer from slow identification speed and low accuracy. Summary of the Invention
[0004] To address the problems existing in the background technology, this application proposes a method for identifying oil pumping conditions based on a cross-level multi-granularity fusion algorithm.
[0005] Technical solution:
[0006] A method for identifying pumping conditions based on a cross-level multi-granularity fusion algorithm is disclosed. This method uses a cross-level multi-granularity fusion algorithm to identify and classify pumping conditions based on the pumping indicator diagram. It can quickly and accurately distinguish between various conditions such as normal, heavy oil, insufficient fluid supply, floating valve leakage, bottom-impact pump, and fixed valve leakage. The specific steps include: training the cross-level multi-granularity fusion algorithm network model; and identifying the pumping conditions based on the cross-level multi-granularity fusion algorithm network model. The network model of the cross-level multi-granularity fusion algorithm comprises three parts: an adaptive feature enhancement network (AFENet), an edge-aware hybrid encoder, and a deformable Transformer decoder. The edge-aware hybrid encoder, wherein:
[0007] AFENet efficiently extracts multi-scale features from the input pumping diagram;
[0008] The Edge-aware Hybrid Encoder is responsible for deep interaction and fusion of multi-scale features output by AFENet, and adopts a dual-path fusion architecture that combines top-down and bottom-up approaches.
[0009] Preferably, the training steps for the cross-level multi-granularity fusion algorithm network model specifically include:
[0010] (1) Obtain the load and displacement data collected by the dynamometer of the oil well, and draw the dynamometer diagram based on the above data;
[0011] (22) Business experts classify and label the indicator drawings;
[0012] (3) Train the cross-level multi-granularity fusion algorithm network model based on the labeled sample set;
[0013] (4) Determine whether the training accuracy is greater than 99%.
[0014] (4-1) If the training accuracy is not greater than 99%, return to step (2-4).
[0015] (4-2) If the training accuracy is greater than 99%, proceed to the next step;
[0016] (5) After training is completed, save the weights of the trained cross-level multi-granularity fusion algorithm network model;
[0017] (6) Identify the dynamometer diagrams of the sample set;
[0018] (7) Output the training results.
[0019] Preferably, the step of identifying working conditions based on a cross-level, multi-granularity fusion algorithm network model specifically includes:
[0020] (1) Obtain the dynamometer card of the oil well to be tested;
[0021] (2) Input the dynamometer diagram into the trained cross-level multi-granularity fusion algorithm network model for recognition;
[0022] (3) Output the recognition results.
[0023] Preferably, AFENet efficiently extracts multi-scale features from the input pumping indicator map. The structural features and data processing flow of AFENet are as follows:
[0024] 1) Input and backbone network processing: The input oil pumping dynamometer image first enters the AFENet backbone network. The image is processed by the first layer of the hybrid receptive field backbone module HGStem, which performs preliminary feature extraction and 4x downsampling to generate a feature map at the S2 scale.
[0025] 2) Multi-scale feature extraction: The feature map at scale S2 is then fed into a sequence of alternating Cross-Stage Feature Mixer Block (CSFM Block) and downsampling convolutional layers; each time it passes through a downsampling convolutional layer, the spatial resolution of the feature map is halved, thereby generating three feature maps of different scales, S3, S4 and S5, to capture different levels of information from local details to global semantics.
[0026] Preferably, the edge-aware hybrid encoder comprises an Intrascale Feature Interaction with Dynamic PositionBias (IFIDPB), a Progressive Edge Fusion Block (PEF Block), a Synergistic Guidance Fusion (SGFusion), and a Reparameterized Cascaded Feature Enhancement Module (RCFEM). Its data processing flow is as follows:
[0027] 1) High-level semantic feature encoding: The S5 scale feature map from the deepest layer of the backbone network is first processed by a 1×1 convolution for channel adjustment, and then fed into IFIDPB for encoding to enhance the model's ability to focus on key semantic information; the encoded features are then processed by a 1×1 convolution to generate the highest-level feature map F5.
[0028] 2) Fusion of high-frequency edge information and multi-scale features: Feature fusion is performed using two paths, top-down and bottom-up. In the top-down path, the high-level feature F5 is upsampled and then fused with the S4-scale feature map processed by PEF Block through SGFusion. The fused features are then refined by RCFEM. This process is repeated once to fuse the S3-scale feature map, and finally, multi-scale features containing rich edge and semantic information are generated.
[0029] Preferably, the structural and data processing features of the deformable Transformer decoder are as follows:
[0030] 1) The decoder is composed of a preset number of Deformable TransformerDecoder Layers stacked together, used to perform layer-by-layer iterative optimization on a set of initialized object query vectors;
[0031] 2) The decoder uses a set of learnable object query vectors to perform sparse sampling and information aggregation on the feature map through a multi-scale deformable attention mechanism, and iteratively optimizes the query vectors layer by layer, so that they gradually focus on the real working conditions in the image.
[0032] Beneficial effects
[0033] 1. Based on the pumping indicator diagram, a cross-level multi-granularity fusion algorithm is used to identify and classify pumping conditions. This breaks through the limitations of traditional identification methods and fully integrates cross-level and multi-granularity information of the algorithm model. It effectively avoids problems such as the difference in the overall shape and detailed granularity of the pumping indicator diagram under different conditions, as well as the differences in resolution and detailed features of different acquisition methods. Thus, it accurately distinguishes the types of operating conditions such as normal, heavy oil, insufficient liquid supply, floating valve leakage, bottom-collision pump, and fixed valve leakage. It has the advantages of high intelligence, high identification accuracy, good generalization performance, fast speed, reduced labor costs, and effective improvement of detection efficiency, and its application value is obvious.
[0034] 2. AFENet, based on a hierarchical feature extraction architecture, overcomes the shortcomings of traditional convolutional backbone networks in multi-scale feature extraction, information fusion, and computational efficiency through dynamic convolutional kernel selection and cross-level information fusion, thus achieving morphological adaptability. Its basic building block, the CSFM Block, employs a dual-path parallel flow design, enabling efficient feature reuse and gradient preservation: on the one hand, refined branches ensure in-depth mining of subtle dynamometer map details; on the other hand, identity-preserving branches maintain the integrity of the original dynamometer map gradient, effectively solving the information loss problem when deep networks process minute details of dynamometer map curves. Furthermore, its core TADC module overcomes the limitations of traditional single static receptive fields, achieving geometrically adaptive perception of the morphology of pumping dynamometer maps. The network can dynamically reconstruct the convolutional kernel weights based on the global context information of the image: when processing strip-shaped working condition images such as "insufficient fluid supply" and "bottom-impact pump", it adaptively enhances the response of the strip-shaped convolutional kernel; when detecting isotropic clumped working condition images such as "normal", "oil extraction", "floating valve leakage", and "fixed valve leakage", it focuses on feature extraction of square convolutional kernels. This mechanism of dynamically adjusting the receptive field according to the working condition shape significantly improves the model's feature extraction efficiency and recognition accuracy for multi-scale and multi-shaped oil extraction dynamometer images.
[0035] 3. In the Edge-aware Hybrid Encoder, IFIDPB achieves spatial awareness of two-dimensional feature maps of arbitrary size without the need for manual design of position encoding through a direct and efficient gradient propagation path. It focuses on key areas in the oil pumping indicator map and extracts their deep semantic information, thereby improving the model's robustness to deformation, translation and multi-scale structures.
[0036] 4. PEF Block simultaneously detects, aggregates, and fuses boundary information at multiple semantic and spatial scales, sharpening the boundary details of the dynamometer map that have become blurred due to noise or signal attenuation, and improving the model's ability to perceive subtle features. The high-frequency changes in its global context representation correspond to the boundary between a large dynamometer map region and the surrounding tissue, while the high-frequency changes in the local feature map correspond to the fine texture of the key points of the dynamometer map, providing high-quality low-level features for subsequent accurate identification and localization.
[0037] 5. The high-level semantic information in SGFusion can guide the network to focus on edge features that are enhanced by PEF Block and are consistent with the crack morphology. At the same time, the accurate edge information also provides spatial constraints for semantic understanding and prevents the model from misjudging background noise as working condition information.
[0038] 6. RCFEM employs a two-stage channel dimensionality reduction strategy and a cascaded convolutional structure, which significantly reduces computational cost while maintaining the ability to capture complex features.
[0039] 7. The end-to-end query mechanism in the Transformer Decoder treats work condition identification as a direct set prediction problem, avoiding the complex anchor box design and non-maximum suppression (NMS) post-processing steps in traditional detection methods. This not only simplifies the process but also fundamentally solves the problem of NMS potentially erroneously suppressing the detection of dense or neighboring work maps, thus improving the overall performance and robustness of the detection. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating the training process of the network model based on the cross-level multi-granularity fusion algorithm of the present invention.
[0041] Figure 2 This is a diagram of the network model structure based on the cross-level multi-granularity fusion algorithm of the present invention.
[0042] Figure 3 This is a structural diagram of the CSFM Block based on the cross-level multi-granularity fusion algorithm network model of the present invention.
[0043] Figure 4 This is a diagram of the TADC structure based on the cross-level multi-granularity fusion algorithm network model of the present invention.
[0044] Figure 5 This is a structural diagram of the IFIDPB network model based on the cross-level multi-granularity fusion algorithm of the present invention.
[0045] Figure 6 This is a diagram of the PEF Block structure based on the cross-level multi-granularity fusion algorithm network model of the present invention.
[0046] Figure 7 This is a structural diagram of the SGFusion network model based on a cross-level multi-granularity fusion algorithm according to the present invention.
[0047] Figure 8 This is a structural diagram of the RCFEM network model based on the cross-level multi-granularity fusion algorithm of the present invention.
[0048] Figure 9 This is a structural diagram of the Transformer decoder based on the cross-level multi-granularity fusion algorithm network model of the present invention.
[0049] Figure 10 This is a flowchart of the working condition identification process based on the cross-level multi-granularity fusion algorithm network model of the present invention.
[0050] Figure 11 The image shows the oil pumping condition identification result of the oil pumping condition identification method based on the cross-level multi-granularity fusion algorithm of the present invention.
[0051] Figure 12 The screenshot shown is of the upper computer displaying the "normal" operating condition in the actual engineering application of the oil pumping condition identification method based on cross-level multi-granularity fusion algorithm of the present invention.
[0052] Figure 13 The screenshot shown is from the host computer displaying the identification of the "heavy oil" condition in a practical engineering application of the oil pumping condition identification method based on cross-level multi-granularity fusion algorithm of the present invention.
[0053] Figure 14 The screenshot shown is from a host computer displaying the "insufficient fluid supply" condition in a practical engineering application of the oil pumping condition identification method based on cross-level multi-granularity fusion algorithm of the present invention.
[0054] Figure 15 The screenshot shown is of the upper computer displaying the "floating valve leakage" condition in the actual engineering application of the oil pumping condition identification method based on cross-level multi-granularity fusion algorithm of the present invention.
[0055] Figure 16 The screenshot shown is from the host computer displaying the "pump failure due to bottom contact" condition in a practical engineering application of the oil pumping condition identification method based on cross-level multi-granularity fusion algorithm of the present invention.
[0056] Figure 17 The screenshot shown is from a host computer displaying the oil pumping condition identification method based on a cross-level multi-granularity fusion algorithm of the present invention, which is identified as "fixed valve leakage" in a practical engineering application. Detailed Implementation
[0057] The present invention will be further described below with reference to embodiments, but the scope of protection of the present invention is not limited thereto:
[0058] A method for identifying pumping conditions based on a cross-level multi-granularity fusion algorithm is proposed. The method identifies and classifies pumping conditions based on pumping indicator images using a cross-level multi-granularity fusion algorithm. The specific steps include: training a network model of the cross-level multi-granularity fusion algorithm and identifying the pumping conditions based on the network model of the cross-level multi-granularity fusion algorithm.
[0059] Combination Figure 1 The training steps for the cross-level, multi-granularity fusion algorithm network model specifically include the following process:
[0060] 1) Obtain the load and displacement data collected by the dynamometer of the oil well, and draw the dynamometer diagram based on the above data;
[0061] 2) Business experts categorized and labeled the indicator diagrams, forming a labeled sample set of 2064 samples;
[0062] 3) Train the cross-level multi-granularity fusion algorithm network model based on the labeled sample set;
[0063] 4) Determine if the training accuracy is greater than 99%.
[0064] 4-1) If the training accuracy is not greater than 99%, return to step (2-4).
[0065] 4-2) If the training accuracy is greater than 99%, proceed to the next step;
[0066] 5) After training is completed, save the weights of the trained cross-level multi-granularity fusion algorithm network model;
[0067] 6) Identify the dynamometer diagrams of the sample set;
[0068] 7) Output the training results.
[0069] The overall structure of the network model is as follows Figure 2 As shown, the specific steps are as follows:
[0070] 1) The input scalar map undergoes initial feature extraction and 4x downsampling through the HGStem module: First, a 3×3 convolution with a stride of 2 is used to perform the first downsampling and expand the channel dimension. Then, it is fed into two parallel paths. One path uses two consecutive 2×2 convolutions to downsample and then upsample the channels with minimal computation, extracting compact 2×2 local details. The other path uses 2×2 max pooling to perform another "parameterless" downsampling on the same feature map, thus obtaining two representations with different levels of abstraction at the same spatial granularity. The results of the two paths are concatenated in the channel dimension and then cross-path information exchange is achieved through a 3×3 convolution. Finally, a 1×1 convolution is used to fuse the two paths to generate a feature map at the S2 scale. Subsequently, this S2 feature map is passed through a stacked structure containing convolutional downsampling layers and CSFM Blocks to generate multi-scale feature maps of S3 (8x downsampling), S4 (16x downsampling), and S5 (32x downsampling) level by level.
[0071] 2) The CSFM Block is a core component of AFENet, such as... Figure 3 As shown, it adopts a channel separation and fusion structure. The input features are divided into two parts in the channel dimension. One part is directly passed to retain the original feature information, and the other part is sent to a deep processing module containing a Feature Refinement Block (FRB), a Hierarchical Multi-kernel Feature Aggregator (HMFA), and a Convolutional Gated Linear Unit (CGLU).
[0072] 2-1) Within each FRB, the features are first statistically standardized using BatchNorm, and then fed into HMFA;
[0073] 2-2) HMFA mainly consists of a Tri-directional Adaptive Depthwise Convolution (TADC) mechanism, which sets up three different shapes of depthwise separable convolution kernels in parallel: a standard square convolution kernel (K×K), a horizontal strip convolution kernel (1×M), and a vertical strip convolution kernel (M×1), where M=3K+2. Three sets of dynamic weights are generated through global average pooling, and after softmax normalization, the three convolution results are weighted and fused to simultaneously capture point textures, horizontal edges, and vertical edges within the same layer, achieving a multi-frequency receptive field. For example... Figure 4 The diagram shows the structure of the TADC. The fused features are reassembled using a 1×1 convolution and added back to the backbone as residuals.
[0074] 2-3) Then FRB continues to call CGLU in the same residual paradigm to further model cross-channel dependencies;
[0075] 2-4) CGLU expands the input features in the channel dimension through a 1×1 convolution and divides them into two parallel tensors. One tensor is processed by a 3×3 depthwise separable convolution to capture local spatial context information, while the other tensor is not processed and is directly used as a gate signal. Subsequently, the depthwise convolution tensor is multiplied element-wise with the gate signal tensor, and the channel information is selectively enhanced or suppressed according to the feature content, thereby highlighting the key features related to the working condition and filtering out irrelevant noise.
[0076] 2-5) The refined features of the n FRB outputs are concatenated with the initially retained branches in the channel dimension, and finally projected to the target dimension through a 1×1 convolution.
[0077] 3) The deepest S5 feature map output by AFENet is obtained through, for example... Figure 5 The IFIDB module shown performs deep semantic encoding, using dynamic position offset DPB instead of traditional fixed position encoding.
[0078] 3-1) The input feature map is first flattened into a sequence format. When calculating the query-key similarity, an additional relative position bias predicted by a lightweight MLP is introduced. This bias is dynamically generated based on the relative coordinates between tokens and is added to the attention score one by one. The attention intensity is automatically adjusted for different spatial offsets.
[0079] 3-2) Subsequently, the attention output is added back to the original features in the form of residuals and normalized by LayerNorm; after passing through the standard feed-forward network, it also ends with residual connections and LayerNorm.
[0080] 4) The shallower S3 and S4 feature maps are respectively fed into... Figure 6 The PEF Block shown performs high-frequency edge enhancement. The core of this module is the Multi-scale Edge Aggregation Pyramid (MEAP), which contains Edge Enhancement Units (EEUs) with different receptive fields, composed of Edge Feature Extraction Units (EFEUs).
[0081] 4-1) The input features are first channel-expanded through a CBS layer and then split into two features. One half is retained as a bypass connection, and the other half is fed into the MEAP module. Each MEAP module performs its complex multi-scale edge aggregation operation.
[0082] 4-2) MEAP opens four "spatial resolution channels" in parallel, and compresses the feature map to different granularities through adaptive average pooling of 3×3, 6×6, 9×9 and 12×12 respectively. The low-resolution features after pooling are first reduced in dimensionality by 1×1 convolution, and then local edges are extracted by 3×3 group convolution and sent to the corresponding edge enhancement unit EFEU.
[0083] 4-3) In EFEU, features are first generated by AvgPool to produce blurred features containing only low-frequency information, simulating a smooth background prior. All high-frequency details, including meaningful edges and useless noise, are statically separated through a subtraction operation. Subsequently, a Conv layer with learnable weights processes the high-frequency map. Noise is suppressed by learning the Sigmoid function, while meaningful edges are enhanced, i.e., pixels corresponding to edges and textures have high activation values.
[0084] 4-4) The output of EFEU is then restored to its original size through bilinear interpolation. After sharpening by the four branches, it is concatenated with the result of an additional local convolution in the channel dimension, and finally fused into the output of MEAP by a 1×1 convolution. Finally, the bypass connection part is concatenated with the output of each MEAP module for final fusion, resulting in a new feature map with the same dimension as the input but with significantly enhanced edge information.
[0085] 5) Deep features encoded by IFIDPB are upsampled and combined with shallow features enhanced by PEF Blocks via a process such as... Figure 7 The SGFusion module shown is fused.
[0086] 5-1) Align and stitch the two features along the channel dimension, divide the channel into several semantic groups according to the preset number of groups, capture the commonalities of the channels through global average pooling within each group, and then multiply and sum them pixel by pixel with the original features to obtain the spatial response map within the group.
[0087] 5-2) Next, the response map is standardized by subtracting the mean and dividing by the standard deviation to eliminate amplitude differences and highlight relatively significant areas. Then, linear calibration is performed through learnable within-group weights and biases, and group-level spatial attention coefficients are generated by Sigmoid activation.
[0088] 5-3) After multiplying the coefficient with the original splicing feature pixel by pixel, it is split into weighted feature maps corresponding to x0 and x1 according to the original channel ratio;
[0089] 5-4) Finally, the weighted x0 and x1 are cross-residual superimposed so that high-level semantic information can guide the selection of edge details, and edge details can also provide precise spatial constraints for semantic understanding;
[0090] 6) The features after each fusion operation are processed as follows: Figure 8 The RCFEM module shown is lightweight and refined. This module uses quadratic channel dimensionality reduction and cascaded convolutional structures to deeply purify the fused features with low computational overhead.
[0091] 6-1) The input features are first increased in dimensionality by 1×1 convolution, and then divided into two branches along the channel dimension. One half is directly retained, and the other half enters the subsequent deep refinement path.
[0092] 6-2) RepConv is used to achieve initial refinement, which is equivalent to a multi-branch structure to enhance representation during the training phase and is fused into a single 3×3 convolution during the inference phase, balancing accuracy and efficiency.
[0093] 6-3) This feature then flows through n-1 standard 3×3 convolutions in sequence, with each level further extracting local context at the same spatial resolution, forming n intermediate feature maps of the same size but different levels of abstraction;
[0094] 6-4) Finally, a 1×1 convolution is used to compress the channels of the final-level features to obtain another set of outputs. These outputs are then concatenated along the channel dimension with the original half-branch and intermediate features of each level that were previously retained. Finally, a 1×1 convolution is used to map the total number of channels back to the target number of channels c2, thus completing the fusion output.
[0095] 6-5) Finally, after completing the bidirectional path fusion from top to bottom and bottom to top, three sets of feature maps, P3, P4 and P5, containing rich multi-scale information are output for subsequent decoder use.
[0096] 7) The multi-scale feature map output by the encoder is fed into, for example... Figure 9 The deformable Transformer decoder is shown.
[0097] 7-1) Each "object query" is first subjected to linear projection to obtain a 2-D normalized reference point and the corresponding query features.
[0098] 7-2) The multi-scale deformable cross-attention module is responsible for realizing the information interaction between the object query vector and the multi-scale feature map output by the Edge-awareHybrid Encoder;
[0099] 7-3) For each object query vector and its corresponding reference bounding box, a set of sampling offsets and corresponding attention weights on the multi-scale feature map are predicted by linear transformation.
[0100] 7-4) By extracting features only on sparse sampling points near the reference bounding box and performing weighted aggregation based on attention weights, the computational complexity is significantly reduced and the model efficiency is improved, thus replacing global attention computation.
[0101] 7-5) In the decoder, the output of the i-th layer is used as the input of the i+1-th layer. Through layer-by-layer propagation and optimization, the prediction of the target location and category is made from coarse to fine. The output of each layer of the decoder is connected to a classification prediction head and a bounding box regression prediction head to generate the final working condition recognition result of that layer.
[0102] like Figure 10 As shown, the steps for identifying operating conditions based on a cross-level, multi-granularity fusion algorithm network model are as follows:
[0103] 1) Obtain the dynamometer card of the oil well to be tested;
[0104] 2) Input the dynamometer image into the trained cross-level multi-granularity fusion algorithm network model for recognition;
[0105] 3) Output the recognition results.
[0106] The oil pumping condition identification result of the method based on cross-level multi-granularity fusion algorithm is as follows: Figure 11As shown, the types of pumping conditions include: normal, heavy oil, insufficient fluid supply, leakage of floating valve, leakage of pump bottom and stationary valve, etc.
[0107] Heavy oil, due to its high concentration, has physical properties such as high viscosity and high density. Heavy oil increases resistance during the oil extraction process, affecting the opening and closing timing of both the floating and stationary valves, causing them to lag behind the ideal state.
[0108] Under insufficient liquid supply conditions, the water pump cannot deliver enough liquid into the pump casing during the oil extraction process. A clear characteristic of the indicator diagram for insufficient liquid supply is that the unloading line during the downstroke is concave, indicating a slower unloading speed, but the unloading line and the loading line are still approximately parallel.
[0109] Under conditions of leakage from the floating valve, during the piston's upward stroke, the floating valve cannot close completely, causing fluid in the pump barrel to flow back into the oil pipe, preventing the pump barrel from filling completely. During the piston's downward stroke, the leakage from the floating valve has a smaller impact on the pump barrel; therefore, the downstroke portion of the indicator diagram is similar to that under normal operating conditions.
[0110] Under the downward-collision pump condition, if the distance between the piston and the fixed valve is too small during the downward stroke, the piston will collide with the fixed valve, causing a sudden drop in piston load and a corresponding sudden drop in the load on the polished rod. During the upward stroke, an irregular tail ring phenomenon appears in the lower left corner of the indicator diagram.
[0111] Under fixed valve leakage, a gap will appear in the lower right corner of the indicator diagram during the downstroke, indicating that the pump barrel is not fully filled.
[0112] Figures 12-17 The screenshots are taken from the host computer in the actual engineering application of the oil pumping condition identification method based on the cross-level multi-granularity fusion algorithm. The corresponding "condition diagnosis" results of the indicator diagram are: normal, heavy oil, insufficient fluid supply, leakage of the floating valve, and leakage of the bottom-impact pump and the fixed valve.
[0113] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A method for identifying oil pumping conditions based on a cross-level multi-granularity fusion algorithm, characterized in that... Based on the oil pumping indicator image, a cross-level multi-granularity fusion algorithm is used to identify and classify oil pumping conditions. The specific steps include: training the cross-level multi-granularity fusion algorithm network model; and identifying the operating conditions based on the cross-level multi-granularity fusion algorithm network model. The cross-level multi-granularity fusion algorithm network model comprises three parts: an adaptive feature enhancement network (AFENet), an edge-aware hybrid encoder, and a deformable Transformer decoder. AFENet efficiently extracts multi-scale features from the input pumping diagram; The Edge-aware Hybrid Encoder is responsible for deep interaction and fusion of multi-scale features output by AFENet, and adopts a dual-path fusion architecture that combines top-down and bottom-up approaches.
2. The method according to claim 1, characterized in that... The specific training steps for the cross-level multi-granularity fusion algorithm network model include: (2-1) Obtain the load and displacement data collected by the dynamometer of the oil well, and draw the dynamometer diagram based on the above data; (2-2) Business experts classify and label the indicator diagrams; (2-3) The cross-level multi-granularity fusion algorithm network model is trained based on the labeled sample set; (2-4) Determine if the training accuracy is greater than 99%. (2-4-1) If the training accuracy is not greater than 99%, return to step (2-4). (2-4-2) If the training accuracy is greater than 99%, proceed to the next step; (2-5) After training is completed, save the weights of the trained cross-level multi-granularity fusion algorithm network model; (2-6) Identify the dynamometer diagrams of the sample set; (2-7) Output the training results.
3. The method according to claim 1, characterized in that... The steps for identifying working conditions based on a cross-level, multi-granularity fusion algorithm network model specifically include: (3-1) Obtain the dynamometer card of the oil well to be tested; (3-2) Input the dynamometer diagram into the trained cross-level multi-granularity fusion algorithm network model for recognition; (3-3) Output the recognition results.
4. The method according to claim 1, characterized in that, AFENet efficiently extracts multi-scale features from the input oil pumping diagram. Through dynamic convolution kernel selection and cross-level information fusion, it achieves morphological adaptability. AFENet is based on a hierarchical feature extraction architecture, and the specific structural features and data processing flow are as follows: 1) Input and backbone network processing: The input oil pumping dynamometer image first enters the AFENet backbone network. The image is processed by the first layer of the hybrid receptive field backbone module HGStem, which performs preliminary feature extraction and 4x downsampling to generate a feature map at the S2 scale. 2) Multi-scale feature extraction: The feature map at scale S2 is then fed into a sequence of alternating cross-stage feature mixer (CSFM) blocks and downsampling convolutional layers. Each time a downsampling convolutional layer is passed, the spatial resolution of the feature map is halved, thereby generating feature maps at three different scales, S3, S4 and S5, to capture different levels of information from local details to global semantics.
5. The method according to claim 1, characterized in that, The Edge-aware Hybrid Encoder consists of an intra-scale feature interaction module IFIDPB with dynamic positional bias, a progressive edge fusion module PEFBlock, a collaborative guided fusion module SGFusion, and a reparameterized cascaded feature enhancement module RCFEM. Its data processing flow is as follows: 1) High-level semantic feature encoding: The S5 scale feature map from the deepest layer of the backbone network is first processed by a 1×1 convolution for channel adjustment, and then fed into IFIDPB for encoding to enhance the model's ability to focus on key semantic information; the encoded features are then processed by a 1×1 convolution to generate the highest-level feature map F5. 2) Fusion of high-frequency edge information and multi-scale features: Feature fusion is performed using two paths, top-down and bottom-up. In the top-down path, the high-level feature F5 is upsampled and then fused with the S4-scale feature map processed by PEF Block through SGFusion. The fused features are then refined by RCFEM. This process is repeated once to fuse the S3-scale feature map, focusing on the pumping indicator map and its edge regions, and finally generating multi-scale features containing rich edge and semantic information.
6. The method according to claim 1, characterized in that, The structural and data processing characteristics of the deformable Transformer decoder are as follows: 1) The decoder is composed of a preset number of Deformable TransformerDecoder Layers stacked together, used to perform layer-by-layer iterative optimization on a set of initialized object query vectors; 2) The decoder uses a set of learnable object query vectors to perform sparse sampling and information aggregation on the feature map through a multi-scale deformable attention mechanism, and iteratively optimizes the query vectors layer by layer, so that they gradually focus on the real working conditions in the image.
7. The method according to claim 4, characterized in that, The Cross-Stage Feature Mixer Module (CSFM Block) adopts a dual-path parallel flow design, achieving efficient feature reuse and gradient preservation. On the one hand, it ensures in-depth mining of weak dynamometer features through refined branches; on the other hand, it maintains the integrity of the original dynamometer gradient using identity preservation branches, effectively solving the information loss problem when deep networks process micro-cracks. The specific structural features of the Cross-Stage Feature Mixer Module (CSFM Block) are as follows: The CSFM Block employs a channel separation and fusion structure. Input features are divided into two parts along the channel dimension: one part is directly passed to retain the original feature information, while the other part is fed into a depth processing module containing a Feature Refinement Block (FRB), a Hierarchical Multi-Kernel Feature Aggregator (HMFA), and a Convolutional Gated Linear Unit (CGLU); the data flow is as follows: 7-1) Within each FRB, the features are first statistically standardized using BatchNorm, and then fed into HMFA; 7-2) HMFA consists of a three-way adaptive depthwise convolutional TADC module, which sets up three different shapes of depthwise separable convolutional kernels in parallel: a standard square convolutional kernel K×K, a horizontal strip convolutional kernel 1×M, and a vertical strip convolutional kernel M×1, where M=3K+2; three sets of dynamic weights are generated by global average pooling, and after softmax normalization, the three convolutional results are weighted and fused to simultaneously capture point textures, horizontal edges and vertical edges in the same layer to achieve multi-frequency receptive fields; the fused features are re-integrated by 1×1 convolution and added back to the backbone in a residual manner; The TADC module breaks through the limitations of the traditional single static sensing field and realizes geometric adaptive sensing of the morphology of the oil pumping indicator. The network can dynamically reconstruct the convolutional kernel weights based on the global context information of the image: when processing strip-shaped working condition images including "insufficient liquid supply" and "bottom-impact pump", it adaptively enhances the response of the strip convolutional kernel; when detecting isotropic clumped working condition images including "normal", "oil extraction", "floating valve leakage" and "fixed valve leakage", it focuses on feature extraction of square convolutional kernels; this mechanism of dynamically adjusting the receptive field according to the working condition shape significantly improves the model's feature extraction efficiency and recognition accuracy for multi-scale and multi-shaped oil extraction dynamometer images; 7-3) Then FRB continues to call CGLU in the same residual paradigm to further model cross-channel dependencies; 7-4) CGLU expands the input features in the channel dimension through a 1×1 convolution and divides them into two parallel tensors. One tensor is processed by a 3×3 depthwise separable convolution to capture local spatial context information, while the other tensor is not processed and is directly used as a gate signal. Subsequently, the depthwise convolution tensor is multiplied element-wise with the gate signal tensor, and the channel information is selectively enhanced or suppressed according to the feature content, thereby highlighting the key features related to the working condition and filtering out irrelevant noise. 7-5) The refined features of the n FRB outputs are concatenated with the originally retained branches in the channel dimension, and finally projected to the target dimension through a 1×1 convolution.
8. The method according to claim 5, characterized in that, The PEF Block structure is as follows: PEF Block performs high-frequency edge enhancement. The core of this module is the Multi-Scale Edge Aggregation Pyramid (MEAP), which contains Edge Feature Extraction Units (EEUs) with receptive fields of different scales, composed of Edge Feature Extraction Units (EFEUs). The data flow is as follows: 8-1) The input features are first channel-expanded through the CBS layer and then split into two features; one half is retained as a bypass connection and the other half is fed into the MEAP module; each MEAP module performs its complex multi-scale edge aggregation operation. 8-2) MEAP opens four "spatial resolution channels" in parallel, and compresses the feature map to different granularities through adaptive average pooling of 3×3, 6×6, 9×9 and 12×12 respectively; the low-resolution features after pooling are first reduced in dimensionality by 1×1 convolution, and then extracted by 3×3 group convolution, and then fed into the corresponding edge enhancement unit EFEU; 8-3) In EFEU, features are first generated by AvgPool to produce blurred features containing only low-frequency information to simulate a smooth background prior; all high-frequency details, including meaningful edges and useless noise, are statically separated by subtraction; then, the high-frequency map is processed by Conv layers with learnable weights; noise is suppressed by learning the Sigmoid function, while meaningful edges are enhanced, i.e., pixels corresponding to edges and textures have high activation values; 8-4) The output of EFEU is then restored to its original size through bilinear interpolation. After sharpening by the four branches, it is concatenated with an additional local convolution result in the channel dimension. Finally, it is fused into the output of MEAP by a 1×1 convolution. Finally, the bypass connection part is concatenated with the output of each MEAP module for final fusion, resulting in a new feature map with the same dimension as the input but with significantly enhanced edge information.
9. The method according to claim 5, characterized in that, The SGFusion structure is as follows: 9-1) Align and concatenate the two features along the channel dimension, divide the channel into several semantic groups according to the preset number of groups, capture the commonalities of the channels through global average pooling within each group, and then multiply and sum the features pixel by pixel to obtain the spatial response map within the group. 9-2) Next, the response plot is standardized by subtracting the mean and dividing by the standard deviation to eliminate amplitude differences and highlight relatively significant areas. Then, linear calibration is performed using learnable within-group weights and biases, and group-level spatial attention coefficients are generated by Sigmoid activation. 9-3) After multiplying the coefficient with the original splicing feature pixel by pixel, it is split into weighted feature maps corresponding to x0 and x1 according to the original channel ratio; 9-4) Finally, the weighted x0 and x1 are cross-residual superimposed, so that high-level semantic information can guide the selection of edge details, and edge details can also provide precise spatial constraints for semantic understanding.