A method for detecting surface defects of a sucker rod special for oil fields
By combining ultrasonic detection and electromagnetic eddy current detection technologies, and utilizing vector cross product alignment and gradient boosting algorithms, a sucker rod defect identification model was constructed. This solved the problem that ultrasonic single-channel detection could not accurately identify surface defects of sucker rods, and achieved high-precision defect detection and decision support.
Patent Information
- Application Number
- CN202511492667.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing ultrasonic single-channel testing technology cannot accurately identify and distinguish different types of defects on the surface of sucker rods, resulting in inaccurate test results.
An ultrasonic detection component and an electromagnetic eddy current detection component are combined, and an acoustic-electric coupling detection unit is formed by calibration through a vector cross product alignment algorithm. A surface defect identification model is constructed by combining a gradient boosting algorithm, and the defect type is determined by matching with a sucker rod defect knowledge graph.
It significantly improves the accuracy and positioning precision of defect detection, reduces the error range, and enables the rapid and accurate identification of defect areas and the formulation of targeted decisions, thereby reducing the failure rate.
Smart Images

Figure CN120992756B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of defect detection engineering, in particular to a surface defect detection method for oilfield special sucker rod. BACKGROUND
[0002] In the process of oilfield exploitation, the beam-type pumping unit is the most common mechanical oil production equipment. In its operation process, the downhole oil pump is connected with the ground equipment through the sucker rod string, and relies on the up and down reciprocating movement of the sucker rod string to lift the crude oil to the ground. As the key force transmission component connecting the ground and the downhole, the sucker rod is subjected to the combined action of alternating load, corrosive medium and abrasive particles for a long time, and is prone to surface defects such as cracks, corrosion, peeling and deformation. If these defects cannot be found and evaluated in time and accurately, it may lead to rod string fracture, and in severe cases, cause downhole tool to fall, production to be interrupted, and even safety accidents.
[0003] In the prior art, the common detection method is ultrasonic single-channel detection, which utilizes the propagation characteristics of ultrasonic waves in the sucker rod. The ultrasonic probe emits high-frequency ultrasonic waves to the sucker rod, and when the ultrasonic waves propagate in the sucker rod, they will be reflected, refracted and scattered when encountering defects. However, when ultrasonic single-channel detection detects different types of defects such as cracks, corrosion pits and peeling, the reflection and refraction characteristics of ultrasonic waves are different. For example, cracks may cause strong reflection of ultrasonic waves, while corrosion pits may cause scattering of ultrasonic waves. Therefore, it is often only possible to judge the defects according to pre-set parameters and experience, and for complex and diverse defect types, it may not be possible to accurately identify and distinguish them, resulting in inaccurate detection results. SUMMARY
[0004] In view of the deficiencies of the prior art, the present application provides a surface defect detection method for oilfield special sucker rod, which solves the problem that ultrasonic single-channel detection may not accurately identify and distinguish different types of defects, resulting in inaccurate detection results.
[0005] To achieve the above purpose, the present application realizes the following technical scheme: a surface defect detection method for oilfield special sucker rod, comprising the following steps:
[0006] Step S1: calibrate and align the ultrasonic detection assembly and the electromagnetic eddy current detection assembly by vector cross multiplication alignment algorithm to obtain an acoustic-electric coupling detection unit;
[0007] Step S2: detect the surface of the standard sucker rod by the acoustic-electric coupling detection unit to obtain an ultrasonic baseline vector and an electromagnetic baseline vector, and associate the ultrasonic baseline vector and the electromagnetic baseline vector with the position coordinates of the surface of the standard sucker rod respectively to form a field baseline map;
[0008] Step S3: detecting the oil well internal sucker rod using the acoustic-electric coupling detection unit to obtain the acoustic channel real-time signal and the electric channel real-time signal, comparing the acoustic channel real-time signal and the electric channel real-time signal based on the field baseline map, calculating the acoustic channel divergence and the electric channel divergence, and determining the defect area on the surface of the sucker rod based on the acoustic channel divergence and the electric channel divergence;
[0009] Step S4: image acquisition and preprocessing are performed on the defect area to obtain a sucker rod surface defect image, feature extraction is performed on the sucker rod surface defect image to obtain a high-dimensional feature vector and a bottom feature vector, and a fusion vector is constructed by fusing the acoustic channel real-time signal and the electric channel real-time signal;
[0010] Step S5: a surface defect recognition model is constructed based on a gradient boosting algorithm, the fusion vector is input into the surface defect recognition model, and a sucker rod surface defect type is output;
[0011] Step S6: a sucker rod defect knowledge graph is constructed, oil well internal environment data is collected, the sucker rod surface defect type and the oil well internal data are combined, and cosine similarity and Euclidean distance algorithms are used to match the sucker rod defect knowledge graph to obtain a sucker rod defect origin.
[0012] Preferably, the ultrasonic detection assembly and the electromagnetic eddy current detection assembly are aligned by a vector cross multiplication alignment algorithm to obtain an acoustic-electric coupling detection unit, which comprises:
[0013] The detection assembly is integrated as follows:
[0014] An ultrasonic probe with a center frequency of 5MHz-10MHz and a focusing depth of 1mm-5mm and an electromagnetic eddy current probe with an excitation frequency of 10kHz-100kHz and a detection depth of 0.1mm-2mm are selected, and the two probes are fixed on a compact probe mounting bracket made of aluminum alloy;
[0015] To realize accurate coincidence of the probe axis, a vector cross multiplication alignment algorithm is used for calibration:
[0016] The axis vector of the ultrasonic probe is defined as :
[0017]
[0018] wherein, is the starting position vector of the ultrasonic probe axis, is the direction vector of the ultrasonic probe axis, and t is a parameter to describe any position on the axis;
[0019] The axis vector of the electromagnetic eddy current probe is defined as :
[0020]
[0021] wherein, is the initial position vector of the electromagnetic eddy current probe axis, is the direction vector of the electromagnetic eddy current probe axis;
[0022] by making , the two probe initial positions are parallelly aligned; and , the two probe axis directions are consistent, the two probe center positions are coincided and the axis are parallel, and finally the detection area is overlapped with the precision not greater than 0.5mm.
[0023] Preferably, the step S2 comprises:
[0024] selecting a standard pumping rod calibration section in good condition in the well site, controlling the pumping rod to pass through the detection window at a uniform speed of 0.1m / s, and synchronously collecting the response signals of the acoustic channel and the electric channel:
[0025] for the ultrasonic channel, continuously collecting groups of time domain signals , obtaining the ultrasonic baseline vector by averaging the 50 groups of signals:
[0026]
[0027] wherein, represents the ultrasonic baseline vector, which is obtained by averaging the 50 groups of ultrasonic time domain signals, and this vector represents the average signal characteristics of the ultrasonic channel under the standard state; represents the number of groups of collected time domain signals; represents the i-th group of time domain signals in the ultrasonic channel;
[0028] for the electromagnetic channel, continuously collecting groups of time domain signals in the same way, and obtaining the electromagnetic baseline vector by averaging:
[0029]
[0030] wherein, represents the electromagnetic baseline vector, which is obtained by averaging the 50 groups of electromagnetic time domain signals, and this vector represents the average signal characteristics of the electromagnetic channel under the standard state; represents the i-th group of time domain signals in the electromagnetic channel;
[0031] the above ultrasonic baseline vector , electromagnetic baseline vector The position coordinates of the surface of the sucker rod are respectively associated with the ultrasonic baseline vector and the electromagnetic baseline vector to form a field baseline atlas.
[0032] Preferably, the acoustic-electric coupling detection unit is used to detect the inside of the sucker rod to obtain the real-time signal of the acoustic channel and the real-time signal of the electric channel, which includes:
[0033] The real-time signal is collected as follows:
[0034] The entire acoustic-electric coupling detection unit is kept coaxial with the sucker rod and slowly moves along the axial direction of the sucker rod at a speed of 1 mm per second. In this way, the sucker rod is carefully detected and the real-time response signals of the acoustic channel and the electric channel are collected.
[0035] For any position x on the outer surface of the sucker rod, the real-time signal of the acoustic channel and the real-time signal of the electric channel are respectively obtained.
[0036] Preferably, based on the field baseline atlas, the real-time signal of the acoustic channel and the real-time signal of the electric channel are compared respectively, and the divergence degree of the acoustic channel and the divergence degree of the electric channel are calculated. Based on the divergence degree of the acoustic channel and the divergence degree of the electric channel, the defect area on the surface of the sucker rod is determined, which includes:
[0037] The divergence degree of the real-time signal of the acoustic channel and the ultrasonic baseline vector is calculated , and the divergence degree of the real-time signal of the electric channel and the electromagnetic baseline vector is calculated . The calculation formula is as follows:
[0038]
[0039]
[0040] ;
[0041] The defect area on the surface of the sucker rod is determined by three-layer judgment and positioning of defects:
[0042] When and , that is, the acoustic channel and the electric channel simultaneously show strong divergence relative to their respective baselines, the position is marked as a candidate defect point.
[0043] Neighborhood consistency. Considering the possible local interference factors of the aluminum-clad steel belt, the neighborhood around the candidate defect point is analyzed, and the average value of the divergence degree in the neighborhood is calculated:
[0044]
[0045] Among them, the molecular part Indicates the neighboring region Deviation at all locations within To perform summation, that is, to calculate from arrive The sum of the deviations at all locations within this range; the denominator is... Because the neighborhood range is from arrive There are a total of One location point;
[0046] Set neighborhood consistency threshold ,when At that time, it was confirmed that the signal anomaly in the area was spatially continuous, isolated noise interference was ruled out, and the existence of defects in the area was further confirmed.
[0047] To ensure repeatability and avoid artifacts caused by factors such as adhered grease films, coupling fluctuations, or subtle changes in proximity, multiple tests are performed at the same location. Let the number of tests be... The signal detected next is , No. The signal detected next is Calculate the difference between the two detected signals:
[0048]
[0049] Set the repeatability stability threshold ,when When the abnormal signal at that location exhibits stable characteristics across multiple detections, the area where the location is ultimately identified as a defect region, achieving a positioning accuracy of up to [percentage missing]. ;
[0050] The final identified defect area is , indicating the location point within the defect area, i.e. Location points that satisfy the three-level criteria .
[0051] Preferably, feature extraction is performed on the surface defect image of the sucker rod to obtain a high-dimensional feature vector and a low-level feature vector, including:
[0052] To accommodate defects of varying sizes on the sucker rod surface, an improved multi-scale feature fusion module is employed. This module extracts features at different levels from the preprocessed sucker rod surface defect image: on one hand, it performs 2×2 max pooling on the image and extracts the global max pooling value to capture the overall contour of small defects; on the other hand, it compresses the number of channels through 1×1 convolution and extracts the global max pooling value and the global average pooling value respectively for the feature representation of large defects. Finally, these features are fused to form a 3-channel multi-scale feature map.
[0053] The NonLocalBlock module is embedded to strengthen the feature weight of the defect area. First, the attention coefficient matrix is calculated:
[0054]
[0055] wherein, is the input feature map, and is a 1×1 convolution operation, represents the height of the feature map, represents the width, represents the number of channels, is a normalization function, C is the number of channels of the feature map, and then the output feature map after attention enhancement is obtained through and , and is a 1×1 convolution operation;
[0056] Global pooling is performed on the feature map after attention enhancement , the three-dimensional spatial feature is compressed into a one-dimensional vector, the spatial dimension information is eliminated, the semantic feature of the defect is retained, the dimension is adjusted and the semantic enhancement is performed: the vector after pooling is mapped to 256 dimensions through a fully connected layer, to ensure that its dimension is uniform and can be efficiently integrated into the cross-modal fusion vector, and finally is obtained.
[0057] The bottom visual feature is supplemented, the defect morphology and texture features are extracted, and different types of defects are distinguished.
[0058] Defect perimeter : the total number of edge pixels of the defect area, reflecting the extension range of the defect; area : the total number of pixels in the defect area, reflecting the size of the defect.
[0059] Circularity The formula is as follows:
[0060]
[0061] wherein, takes 3.14, is the defect area, is the defect perimeter; the circularity quantifies the defect morphology, which is used to distinguish between peeling and cracking.
[0062] Texture feature, texture entropy formula:
[0063]
[0064] wherein, is the number of LBP sample neighborhoods; is the probability of the kth LBP pattern appearing; is the probability of the kth LBP pattern appearing; texture entropy, quantifying the texture complexity of the defect region, used to distinguish corrosion from other defects, forming the bottom feature vector .
[0065] Preferably, the fusion of the acoustic channel real-time signal and the electric channel real-time signal is constructed to obtain a fusion vector, which includes:
[0066] The feature fusion is constructed as follows:
[0067] The cross-modal fusion vector is constructed in combination with the acoustic and electric features output by step S3 , integrating the depth information of acoustic and electric signals and the shape and texture information of visual signals:
[0068] Formula:
[0069] wherein, is the acoustic channel divergence calculated in step S3, reflecting the difference in reflection of sound waves by the defect; is the electric channel divergence calculated in step S3, reflecting the difference in interference of electromagnetic field by the defect; is the neighborhood divergence mean calculated in step S3, reflecting the spatial continuity of the defect; is the L2 norm of the kth and k-1th detection signals calculated in step S3, reflecting the stability of the defect; is the 256-dimensional high-level feature vector after attention enhancement, containing the semantic features of the defect; the fusion vector The total dimension is 136, covering acoustic, electric, and visual multi-dimensional features, avoiding misjudgment of complex defects by a single modality.
[0070] Preferably, based on the gradient boosting algorithm, a surface defect recognition model is constructed, the fusion vector is input into the surface defect recognition model, and the output is obtained to obtain the sucker rod surface defect type, which includes:
[0071] Surface defect recognition model architecture:
[0072] An XGBoost classifier is used, with the input layer being the fusion vector , passing through 3 fully connected layers, and the output layer having 3 neurons corresponding to the probability distribution of the three types of defects: cracks, corrosion, and peeling;
[0073] The mixed supervision training is as follows:
[0074] The teacher model is trained using at least 50 pixel-level labeled images until it converges. When the teacher model makes predictions on unlabeled images, samples with a prediction confidence of 0.9 or higher are considered reliable samples, and those with a confidence of less than 0.9 are considered uncertain samples.
[0075] The student model is trained using a joint loss formula:
[0076]
[0077] in, It is the total loss of the surface defect recognition model. It is the cross-entropy loss of the labeled samples. The loss is the loss from the pseudo-labeled samples; the total loss of the model. It consists of two parts, one of which is the cross-entropy loss of the labeled samples. The other part is the loss from pseudo-labeled samples. and These are weights, used to balance the proportion of these two parts of the loss in the total loss. This training method is usually used in semi-supervised learning, which trains the model using a small amount of labeled data and a large amount of unlabeled data.
[0078] The classification reasoning is as follows:
[0079] When the fusion vector When used as input, find the probability that The largest Value, of which The range of values is This probability Indicates that, given a fusion vector In the case of, belonging to the first The probability of a class of defects;
[0080] Specifically, the defect type is determined using the following formula:
[0081]
[0082] in, The final determined defect type is represented by a variable, which is a possible defect type number; Indicates that, given a fusion vector Under the conditions, the defect belongs to the first The probability of a class; argmax is an operation that finds the index of the maximum value, its purpose is to... When taking 1, 2, and 3, a [missing information] was found. Value Maximum, at and Find the corresponding probability among these three possible defect types. The largest one The value, this The defect type corresponding to the value is the defect type we infer;
[0083] The confidence formula is:
[0084]
[0085] Among them, The confidence, that is, the credibility of the determined defect type, means that after calculating all The maximum value is taken as the confidence;
[0086] The output layer, the defect type determination result, outputs the defect type and confidence in the form of "Typ, ".
[0087] Preferably, the sucker rod defect knowledge graph is constructed, including:
[0088] The sucker rod defect knowledge graph is constructed as follows:
[0089] First, the graph architecture is designed, and the core entity types in the knowledge graph are determined, including the sucker rod surface defect type, well environment data, sucker rod material information, and well site working condition information;
[0090] The relationship types between entities are defined, and related knowledge is extracted from historical sucker rod defect detection records, repair reports, and well site production data. The extracted sucker rod surface defect type, corresponding well environment data, sucker rod material, and well site working condition information are entered according to the designed graph architecture;
[0091] The graph storage and management are adopted to store the constructed sucker rod defect knowledge graph in the graph database, ensuring efficient query and retrieval of data; and a data update mechanism is established to update the knowledge graph in time when new data is obtained.
[0092] Preferably, the cosine similarity and Euclidean distance algorithm are used to match the sucker rod defect knowledge graph, and the sucker rod defect origin is obtained, including:
[0093] The current detected sucker rod surface defect type And the well environment data are integrated to form a data sample to be analyzed;
[0094] The cosine similarity and Euclidean distance of the data sample to be analyzed with the existing data records in the sucker rod defect knowledge graph are calculated respectively;
[0095] The cosine similarity calculation formula is:
[0096]
[0097] Where A and B represent the data sample vector to be analyzed and the data record vector in the knowledge graph, respectively. This represents the cosine similarity between vector A and vector B. The value of the cosine similarity is between (-1) and 1. The closer it is to 1, the more similar the two vectors are.
[0098] The Euclidean distance calculation formula is:
[0099]
[0100] in, and These are the i-th elements of vectors A and B, respectively, where n is the dimension of the vectors;
[0101] Based on the actual application scenario, determine the weights of cosine similarity and Euclidean distance in the comprehensive similarity calculation, and then calculate the comprehensive similarity. The calculation formula is:
[0102]
[0103] in, The overall similarity score is a value obtained by considering both cosine similarity and Euclidean distance. and These are the weights of cosine similarity and Euclidean distance in the overall similarity calculation; based on the overall similarity value... The top 5 cases with the highest similarity were selected from the sucker rod defect knowledge graph. The defect origin records of the selected similar cases were analyzed and combined with the predefined defect origin inference rules in the knowledge graph.
[0104] This invention provides a method for detecting surface defects in oilfield sucker rods, involving machine learning and deep learning technologies, which has the following beneficial effects:
[0105] (1) This oilfield-specific sucker rod surface defect detection method, by comprehensively utilizing ultrasonic detection components and electromagnetic eddy current detection components, and calibrating them through a vector cross product alignment algorithm to form an acoustic-electric coupling detection unit, can more accurately obtain sucker rod surface information. Compared with single detection technologies, it greatly improves the accuracy of defect detection.
[0106] (2) This oilfield-specific sucker rod surface defect detection method constructs a field baseline map by probing the surface of a standard sucker rod, providing a precise comparison basis for subsequent actual well site sucker rod inspection. Simultaneously, in actual inspection, the acoustic and electrical channel deviations are calculated based on the map, enabling rapid and accurate identification of defect areas. This reduces the error range for defect area location from ±10mm to ±5mm, saving significant time and manpower costs for subsequent defect handling.
[0107] (3), the oil field special pumping rod surface defect detection method, through the construction pumping rod defect knowledge graph, combine well environment data, through cosine similarity and euclidean distance algorithm matching, accurately get the defect origin. Based on this, it can make scientific and targeted decisions for different defect origins. For example, for defects caused by well fluid corrosion, accurate decision can be made to replace the corrosion-resistant pumping rod material, effectively reducing the failure rate of subsequent pumping rods. BRIEF DESCRIPTION OF DRAWINGS
[0108] Figure 1 A flow chart of the oil field special pumping rod surface defect detection method is provided.
[0109] Figure 2 A hierarchical diagram of the oil field special pumping rod surface defect detection method is obtained.
[0110] Figure 3 A hierarchical diagram of the oil field special pumping rod surface defect detection method is obtained. DETAILED DESCRIPTION
[0111] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0112] Please refer to Figures 1-3 The present application provides a technical solution: a pumping rod surface defect detection method for oil field. Specifically, the following pumping rod surface defect detection method for oil field is provided, please refer to Figure 1 The method comprises the following steps:
[0113] Step S1: align the ultrasonic detection assembly and the electromagnetic eddy current detection assembly by vector cross multiplication alignment algorithm, and obtain the acoustic-electric coupling detection unit.
[0114] The detection assembly is integrated as follows:
[0115] Select an ultrasonic probe with a center frequency of 5MHz-10MHz and a focusing depth of 1mm-5mm, and an electromagnetic eddy current probe with an excitation frequency of 10kHz-100kHz and a detection depth of 0.1mm-2mm, and fix them on a compact probe mounting bracket made of aluminum alloy. The starting position vectors of the ultrasonic probe and the electromagnetic eddy current probe are and The direction vector is determined based on a mechanical coordinate system of a probe mounting bracket and Calibration is performed at the initial stage of installation through a laser light calibrator.
[0116] To realize accurate coincidence of the probe axis, a vector cross product alignment algorithm is used for calibration:
[0117] The axis vector of the ultrasonic probe is defined as :
[0118]
[0119] wherein, is a starting position vector of the ultrasonic probe axis, which is determined based on a mechanical coordinate system of a probe mounting bracket; is a direction vector of the ultrasonic probe axis, and t is a parameter to describe an arbitrary position on the axis;
[0120] The axis vector of the electromagnetic eddy current probe is defined as :
[0121]
[0122] wherein, is a starting position vector of the electromagnetic eddy current probe axis, is a direction vector of the electromagnetic eddy current probe axis.
[0123] By making , the starting positions of the two probes are parallelly aligned; and , the directions of the two probe axes are consistent, the center positions of the two probes are coincided and the axes are parallel, and finally the detection area is overlapped with a precision of not more than 0.5 mm.
[0124] The mechanical limiting structure is as follows:
[0125] Two sets of orthogonally arranged slide rail mechanisms are adopted, each set of slide rail is matched with a set of locking and limiting mechanism, to realize independent adjustment of the probe in the pitch and yaw directions, to allow the probe to be adjusted in the pitch angle within a range of ±10°, after the adjustment is completed, a micrometer is used to calibrate the probe posture and is fixed through a locking nut, to ensure that the included angle between the probe axis and the surface normal of the sucker rod is not more than 3 degrees, and to guarantee the effectiveness of the detection signal.
[0126] To make the detection unit adapt to the harsh working conditions such as oil sludge, sand containing, temperature difference and the like in the oil field, the following configurations are made:
[0127] The temperature-resistant coupling and cleaning system is internally provided with a silicon oil circulating pump with a temperature-resistant range of 20-120 DEG C, which flushes the probe contact surface at a flow rate of 0.5 L / min to eliminate the influence of oil sludge and oil stains on detection; meanwhile, an automatic scraping and cleaning ring with a hardness of HRC45-HRC50 is arranged, which is driven by a stepping motor and performs reciprocating scraping at a speed of 50 mm / s after detecting 10 oil extraction rods to further remove the residual attachments on the probe surface.
[0128] The elastic loading mechanism is constructed by a constant force spring with an elastic coefficient , and the probe theoretical contact point is set as the origin based on the outer surface of the oil extraction rod. The distance between the probe and the origin when the spring is naturally elongated is represented by L0.
[0129]
[0130] wherein, , is the actual distance from the probe to the surface of the oil extraction rod, is the preset fitting pressure, and the fitting pressure between the probe and the surface of the oil extraction rod is adjusted so that the distance from the probe to the surface of the oil extraction rod deviates from the reference value (the default value is 1.5 mm) by not more than 0.1 mm, thereby ensuring that the distance between the probe and the surface of the rod body is stable and controllable and improving the consistency of the detection data of the two channels.
[0131] This step is used to integrate the ultrasonic detection assembly and the electromagnetic eddy current detection assembly in the same device, and through accurate coaxial arrangement, the two types of detection paths overlap and cover the same region of the outer surface of the oil extraction rod.
[0132] Step S2: detecting the surface of the standard oil extraction rod through the acoustic-electric coupling detection unit to obtain an ultrasonic baseline vector and an electromagnetic baseline vector, associating the ultrasonic baseline vector and the electromagnetic baseline vector with the position coordinates of the surface of the standard oil extraction rod to form a field baseline map.
[0133] This step is carried out after the detection unit is arranged in step S1, and through the alignment of the time base and the collection of the field baseline, a unified time sequence reference and a response reference in the defect-free state are provided for the subsequent comparison and analysis of the acoustic-electric dual-channel data.
[0134] To ensure the synchronization of the ultrasonic and electromagnetic dual-channel detection data in the time and space dimensions, the following method is used to realize the alignment of the time base:
[0135] A synchronization trigger and a position marker are installed on the sucker rod drive side. The synchronization trigger serves as a timing reference for unifying the ultrasonic pulse emission time and the electromagnetic excitation time; the position marker (such as a keyway machined on the sucker rod surface or a geometrically identifiable mark) serves as the zero-point anchor for the mechanical position. When the sucker rod passes through the detection window, the ultrasonic pulse emission time is set based on the trigger signal from the position marker. Electromagnetic excitation timing The mechanical position signal of the sucker rod through the probe window Associated with the same timing reference frame, making (in (For the trigger time of the position identifier component), the timing synchronization error is ultimately controlled within 10μs.
[0136] Select a standard sucker rod calibration section in good condition at the well site (calibration section length not less than 500mm, and confirmed to be defect-free by manual inspection or historical inspection records), and control the sucker rod to pass through the detection window at a uniform speed of 0.1m / s, simultaneously acquiring the response signals of the acoustic and electrical channels:
[0137] For the ultrasound channel, continuous acquisition Group time domain signals The ultrasound baseline vector was obtained by averaging the 50 sets of signals. :
[0138]
[0139] in, The ultrasound baseline vector is obtained by averaging 50 sets of ultrasound time-domain signals. This vector represents the average signal characteristics of the ultrasound channel under standard conditions. Indicates the number of time-domain signal groups acquired; This represents the i-th time-domain signal in the ultrasound channel. Here, the value of i ranges from 1 to 50. .
[0140] For the electromagnetic channel, data are continuously collected in the same manner. Group time domain signals The electromagnetic baseline vector is obtained by taking the mean:
[0141]
[0142] in, The electromagnetic baseline vector is obtained by averaging 50 sets of electromagnetic time-domain signals. This vector represents the average signal characteristics of the electromagnetic channel under standard conditions. This represents the i-th time-domain signal in the electromagnetic channel.
[0143] The above ultrasound baseline vector , electromagnetic baseline vector respectively, forming a field baseline atlas. The atlas can reflect the current well site temperature, well fluid medium composition, rod body material hysteresis characteristics, surface coating state and surface roughness and other working conditions under the response normality of the acoustic and electric channels in the absence of defects, providing a reference basis for subsequent defect judgment links.
[0144] Step S3: The acoustic and electric coupling detection unit is used to detect the sucker rod inside the oil well, and the acoustic channel real-time signal and the electric channel real-time signal are obtained. Based on the field baseline atlas, the acoustic channel real-time signal and the electric channel real-time signal are compared respectively, and the acoustic channel divergence and the electric channel divergence are calculated. Based on the acoustic channel divergence and the electric channel divergence, the defect area on the surface of the sucker rod is determined.
[0145] This step is based on the isochronous base established in step S2 and the field baseline. Through acoustic and electric coupling detection technology, the sucker rod is detected in real time, and a double-channel consistency criterion is established to determine whether a defect exists, and the defect area is accurately positioned.
[0146] The real-time signal acquisition is as follows:
[0147] The entire acoustic and electric coupling detection unit maintains coaxial with the sucker rod, and slowly moves along the axial direction of the sucker rod at a speed of 1 mm per second. In this way, the sucker rod is detected in detail in sections, and the real-time response signals of the acoustic channel and the electric channel are collected.
[0148] For any position x on the outer surface of the sucker rod, discrete position sampling is performed at intervals of 1 mm, and each position point corresponds to a signal acquisition value. The acoustic channel real-time signal and the electric channel real-time signal are obtained respectively.
[0149] The divergence of the acoustic channel real-time signal and the ultrasonic baseline vector is calculated as , and the divergence of the electric channel real-time signal and the electromagnetic baseline vector is calculated as , and the calculation formula is as follows:
[0150]
[0151]
[0152] wherein, is the acoustic channel divergence; is the electric channel divergence;
[0153] The preset divergence threshold for the acoustic channel is and the preset divergence threshold for the electric channel is For the electrical channel, when or , it is preliminarily determined that there is a signal anomaly at the position. Considering the different characteristics of ultrasonic and electromagnetic detection, the two thresholds are usually different. For example, , .
[0154] The defect area on the surface of the sucker rod is determined by three-layer judgment of defect positioning:
[0155] Co-location consistency, when and , that is, the ultrasonic channel and the electrical channel simultaneously show strong deviation from their respective baselines, the position is marked as a candidate defect point.
[0156] Neighborhood consistency. Considering that the plating layer of the sucker rod surface is aluminum-coated steel material, local unevenness may cause signal interference. The neighborhood around the candidate defect point (where ) is analyzed. The average deviation in the neighborhood is calculated:
[0157]
[0158] where the numerator part represents the sum of the deviation of all positions in the neighborhood , that is, the sum of the deviation of all positions in the range from to ; the denominator part , since the neighborhood range is from to , there are position points in total (for example, when , from to there are points in total). The entire formula calculates the average deviation of all positions in the neighborhood, that is, the average deviation of the neighborhood .
[0159] Set the neighborhood consistency threshold , when , it is confirmed that the signal anomaly in this area has spatial continuity, excluding isolated noise interference, and further confirming that there is a defect in this area. For example, .
[0160] Repetition stability. In order to avoid false images caused by factors such as adhering grease film, coupling fluctuation or slight changes in proximity, the same position is detected multiple times. Set the signal of the th detection as , No. The signal detected next is Calculate the difference between the two detected signals:
[0161]
[0162] Set the repeatability stability threshold ,when When the abnormal signal at that location exhibits stable characteristics across multiple detections, the area where the location is ultimately identified as a defect region, achieving a positioning accuracy of up to [percentage missing]. .For example, .
[0163] The final identified defect area is This indicates the location point within the defect area, i.e. Location points that satisfy the three-level criteria By employing the aforementioned three-tiered criterion system of "co-identical evidence, neighboring city consistency, and repeatability stability," the false alarm and false alarm rates in the defect determination process can be significantly reduced, enabling accurate determination and location of sucker rod facies defects and providing a target range for further detailed analysis of the defect area.
[0164] Step S4: Acquire and preprocess the image of the defect area to obtain the surface defect image of the sucker rod. Extract features from the surface defect image of the sucker rod to obtain high-dimensional feature vectors and low-level feature vectors. Then, fuse the real-time signals of the acoustic channel and the real-time signals of the electrical channel to construct a fused vector.
[0165] The images of surface defects on the sucker rod are as follows:
[0166] Receive the set of defect region coordinates output in step S3 (in The image represents the location point on the sucker rod surface that satisfies the three criteria of "co-location evidence, neighborhood consistency, and repeatability stability" (subscript 'a' satisfies 1 ≤ a ≤ n, unit: mm). This triggers a synchronous capture by an industrial camera mounted on the front end of a flexibly adjustable robotic arm. The robotic arm is precisely programmed to quickly move to the defect area. The camera lens is perpendicular to the sucker rod defect area, and the distance is strictly set at 10 cm. This distance ensures high-resolution defect images while avoiding image distortion or loss of detail due to excessively close or distant distances. During acquisition, the camera rotates 360 degrees around the defect area to capture image information from various angles. An IP67-rated oil-resistant industrial camera (1280×720 resolution, 60fps) is used, paired with a 450nm wavelength ring-shaped blue LED supplementary lighting module. This ensures that the spatial overlap between the acquisition area and the acoustic-electric detection area is ≤0.5mm, preventing feature misalignment due to positional shifts.
[0167] The surface defect image of the sucker rod is preprocessed as follows:
[0168] The collected surface defect image of the sucker rod is processed by a logarithmic transformation formula:
[0169]
[0170] wherein, is the gray value of the original image at coordinates , is the transformed gray value, is a contrast adjustment constant, and this operation can enhance the defect details in the dark area, such as a small corrosion point covered by an oil film.
[0171] The surface defect image of the sucker rod is then subjected to median filtering using a kernel of ,
[0172] At the same time, in order to process the points on the boundary, a boundary expansion method (mirror expansion) can be used. When or is at the image boundary, the pixel value outside the boundary is obtained by mirror expansion. Assuming that the width of the image is and the height is , for the pixels and , the formula is as follows:
[0173]
[0174] wherein, is the filtered gray value, represents the gray value of the pixel before filtering; the max and min functions are used to process the boundary conditions to ensure that the index is within the image range. For example, when , , the index is prevented from going out of bounds. This filtering method can effectively remove dust noise while preserving the defect edges. The processed image needs to satisfy the peak signal-to-noise ratio (PSNR) of dB and the structural similarity index (SSIM) of .
[0175] The histogram equalization process is as follows:
[0176] First, the gray cumulative distribution function is calculated:
[0177]
[0178] wherein is the gray level, and are the height and width of the image, respectively, is the number of pixels with gray level . Then the gray mapping is performed by the following equation:
[0179]
[0180] wherein, represents the new gray value corresponding to the gray level after gray mapping, is the gray level of the image, which usually ranges from 0 to 255 (for an 8-bit image); is the total number of gray levels of the image, here , corresponding to the number of gray levels of an 8-bit image; round( ): this is a rounding function that rounds the calculation result. This process can make the gray distribution of the image more uniform, solve the problem of low background contrast caused by uneven illumination of the well site, and the standard deviation of the gray distribution of the processed sucker rod surface defect image should be less than 10 and not less than 8. Setting such a range of "less than 10 and not less than 8" is to ensure that the image has sufficient gray contrast (can clearly distinguish defects and background), while avoiding other problems (such as obvious noise caused by excessive enhancement) that may be caused by too large standard deviation (too dispersed and uneven gray distribution), so that the processed image is in a suitable state for defect detection in terms of gray distribution.
[0181] In order to adapt to different sizes of defects on the surface of the sucker rod, an improved multi-scale feature fusion module is used to extract different levels of features from the pre-processed sucker rod surface defect image: on the one hand, the global maximum pooling value is extracted after 2x2 maximum pooling of the image, which is used to capture the overall outline of small size defects (such as 1mm micro-cracks); on the other hand, the global maximum pooling value and the global average pooling value are extracted respectively after 1x1 convolution compression of the channel number, which are used for feature expression of large size defects (such as 10mm peeling area), and finally these features are fused to form a 3-channel multi-scale feature map.
[0182] The NonLocalBlock module is embedded to strengthen the feature weight of the defect area. First, the attention coefficient matrix is calculated:
[0183]
[0184] wherein, is the input feature map, and are 1x1 convolution operations, represents the height of the feature map (in pixels), represents the width (in pixels), denotes the number of channels, is a normalization function, C is the number of channels of the feature map, and then and obtain the output feature map after attention enhancement wherein and is a 1x1 convolution operation. This process enables the model to focus on the defect area and reduce background interference.
[0185] The feature map after attention enhancement is globally pooled (global average pooling), compressing the three-dimensional spatial feature into a one-dimensional vector, eliminating spatial dimension information and retaining semantic features of the defect (such as "crack directionality" and "corrosion point density"), obtaining a one-dimensional vector. The pooled vector is mapped to a 256-dimensional vector through a fully connected layer, ensuring uniform dimensions and efficient integration into the cross-modal fusion vector.
[0186] Layer bottom visual feature supplement, extracting defect morphological and texture features to assist in distinguishing different types of defects;
[0187] Morphological features, including perimeter, area, and circularity;
[0188] Defect perimeter: the total number of edge pixels in the defect area (in pixels), reflecting the extension range of the defect; Area: the total number of pixels in the defect area (in pixels), reflecting the size of the defect;
[0189] Circularity formula:
[0190]
[0191] wherein, take 3.14, is the defect area, is the defect perimeter; circularity quantifies the defect morphology closer to 1 indicates that the defect is closer to circular, and is used to distinguish between peeling (irregular morphology but close to circular) and cracks (linear extension morphology).
[0192] Texture feature, texture entropy formula:
[0193]
[0194] wherein, is the number of LBP (Local Binary Pattern) sampling neighborhoods (value 8); is the probability of the kth LBP pattern appearing; texture entropy (the greater the value, the more chaotic the texture), which quantifies the texture complexity of the defect area through texture entropy, is used to distinguish corrosion (surface texture is chaotic) from other defects (cracks, peeling texture is relatively regular), forming a bottom feature vector . .
[0195] The feature fusion is constructed as follows:
[0196] The acoustic-electric features output in step S3 are combined to construct a cross-modal fusion vector , which integrates the depth information of the acoustic signal and the shape and texture information of the visual signal:
[0197] Formula:
[0198] wherein, is the acoustic channel divergence (dimensionless, threshold ) calculated in step S3, reflecting the difference in reflection of the defect to the acoustic wave; is the electric channel divergence (dimensionless, threshold ) calculated in step S3, reflecting the difference in interference of the defect to the electromagnetic field; is the neighborhood divergence mean value (dimensionless, threshold ) calculated in step S3, reflecting the spatial continuity of the defect; is the L2 norm of the kth and k-1th detection signals (dimensionless, threshold ) calculated in step S3, reflecting the stability of the defect; is the 256-dimensional high-level feature vector after attention enhancement, containing the semantic features of the defect (such as "crack directionality" and "corrosion point density"); the fusion vector has a total dimension of 136, covering acoustic-electric, visual multi-dimensional features, avoiding misjudgment of complex defects (such as "corrosion + scratch" superimposed defects) by a single modality.
[0199] Step S5: based on the gradient boosting algorithm, a surface defect recognition model is constructed, the fusion vector is input into the surface defect recognition model, and the type of sucker rod surface defect is output;
[0200] Surface defect recognition model architecture:
[0201] An XGBoost classifier is used, and the input layer of the classifier is the fusion vector (136 dimensions), and three fully connected layers (with 256, 128, 64 nodes respectively and ReLU activation function), and the output layer has 3 neurons, corresponding to the probability distribution of the three types of defects: cracks, corrosion, and peeling.
[0202] The mixed supervision training is as follows:
[0203] The teacher model is trained with at least 50 pixel-level labeled images until it converges. The teacher model predicts the unlabeled images, and the samples with prediction confidence greater than or equal to 0.9 are considered reliable samples, and the samples with prediction confidence less than 0.9 are considered uncertain samples.
[0204] The student model is trained by the joint loss function:
[0205]
[0206] wherein, is the total loss of the surface defect recognition model, is the cross-entropy loss of the labeled samples, based on the error between the model prediction and the true label, is the loss of the pseudo-label samples, calculated based on the pseudo-label (the model's prediction result for the unlabeled data); the total loss of the model is composed of two parts: one is the cross-entropy loss of the labeled samples , and the other is the loss of the pseudo-label samples and is the weight used to balance the proportion of the two losses in the total loss. When , it means that the cross-entropy loss of the labeled samples accounts for 30% of the total loss, and the loss of the pseudo-label samples accounts for 70% of the total loss. This training method is commonly used in semi-supervised learning, which trains the model by using a small amount of labeled data and a large amount of unlabeled data.
[0207] The classification inference is as follows:
[0208] When the fusion vector is input, find the value that makes the probability maximum, wherein takes values in the range . This probability represents the probability of belonging to the th class of defects given the fusion vector , when is crack, is corrosion, is peeling.
[0209] The output layer uses the Softmax function to calculate the probability value of each class, i.e.:
[0210]
[0211] wherein, the original output value of the jth neuron (or output node), e is a natural constant, k is a loop variable of the summation operation, is the original output value of the kth neuron;
[0212] Specifically, the defect type is determined by the following formula:
[0213]
[0214] wherein, represents the final determined defect type, and is a variable representing the number of possible defect types; represents the probability that the defect belongs to the kth type under the condition that the fusion vector is given; argmax is an operation for finding the maximum index, which is used to find a value that makes maximum when 1, 2, and 3 are taken. Among the three possible defect types, the value corresponding to the maximum probability is found, and the defect type corresponding to the value is the inferred defect type.
[0215] The formula for calculating the confidence degree is:
[0216]
[0217] wherein, represents the confidence degree, i.e., the reliability of the determined defect type, which means that after all are calculated, the maximum value thereof is taken as the confidence degree.
[0218] The output layer outputs the defect type and the confidence degree in the form of “Type, ”.
[0219] This step is based on the gradient boosting algorithm to construct a surface defect recognition model. The fusion vector is input into the surface defect recognition model, and the surface defect type of the sucker rod is output. The fusion vector constructed in the foregoing is used to accurately identify the defect type on the surface of the sucker rod through the trained model, which provides a key basis for finally formulating a targeted decision.
[0220] Step S6: Constructing the sucker rod defect knowledge graph, collecting the oil well internal environment data, combining the sucker rod surface defect types and the oil well internal data, and matching with the sucker rod defect knowledge graph through the cosine similarity and Euclidean distance algorithm to obtain the origin of the sucker rod defect.
[0221] The sucker rod defect knowledge graph is constructed as follows:
[0222] First, the graph architecture is designed to determine the core entity types in the knowledge graph, including the sucker rod surface defect type, the well internal environment data, the sucker rod material information, and the well site working condition information.
[0223] The relationship types between entities are defined, such as "defect-occurs-in-well-site", "defect-related-to-environment-data", "sucker rod-made-of-material", etc.
[0224] Knowledge extraction and entry: Extract relevant knowledge from historical sucker rod defect detection records, maintenance reports, and well site production data, etc. Extract the sucker rod surface defect type, corresponding well internal environment data (such as sand content, pH value, temperature, flow rate, formation pressure, etc.), sucker rod material (composition, heat treatment process), well site working condition (production life, well depth, oil production method), etc. According to the designed graph architecture, enter the information.
[0225] Graph storage and management: The constructed sucker rod defect knowledge graph is stored in a graph database (such as Neo4j) to ensure efficient query and retrieval of data; and a data update mechanism is established to update the knowledge graph in time when new data is obtained.
[0226] Defect origin inference rules of the sucker rod defect knowledge graph, including crack defect origin inference rules, corrosion defect origin inference rules, and spalling defect origin inference rules. According to the sucker rod surface defect type in step S5, select the corresponding defect origin inference rule for application. The similar cases in the rule come from the knowledge graph containing historical data.
[0227] The crack defect origin inference rule is as follows:
[0228] Manufacturing process association rule: If the similar cases show the characteristics of "distribution along the rolling direction of the material, and the depth is more than 3 times the size of the material grain", and more than 80% of the corresponding cases are caused by "residual stress not released in the forging / rolling process", and the production batch process parameters of the current sucker rod match these cases with a matching degree ≥75%, then it is inferred that the crack origin is the manufacturing process residual stress.
[0229] Fatigue stress correlation rule: When the crack "length increases linearly with the increase of pumping times, and there are multiple source expansion signs at the crack tip" in similar cases, and the cumulative working cycle number of the current sucker rod (according to the oilfield production record) deviates from the "fatigue crack initiation cycle number" in the case by ≤10%, it is concluded that the crack originates from fatigue damage under alternating load.
[0230] Corrosion defect origin inference rules are as follows:
[0231] Medium corrosion rule: If similar cases are in an oil well environment with "Cl concentration ≥500 mg / L, HS partial pressure ≥0.05 MPa", and the corrosion defects show "dense pitting, pit bottom with black corrosion products" characteristics, and the medium detection data of the current sucker rod service environment match the case environment by ≥85%, it is concluded that the corrosion originates from oil well medium chemical corrosion.
[0232] Electrochemical corrosion rule: When the corrosion area in similar cases "has obvious anode and cathode potential difference (through historical potential detection data, potential difference ≥0.2V), and the corrosion form is local galvanic corrosion", and the current sucker rod surface coating damage rate (through imaging detection) overlaps with the damage rate interval (such as 10%-20%) of the case "coating damage induced galvanic corrosion", it is concluded that the corrosion originates from electrochemical corrosion.
[0233] Peeling defect origin inference rules are as follows:
[0234] Coating failure rule: If the peeling area of similar cases "has bubbles at the coating and substrate interface, and the peeling layer thickness deviates from the coating design thickness by ≤10%", and more than 70% of the cases are caused by "coating spraying substrate pretreatment not up to standard (such as oil residue, roughness Ra<1.6μm)", and the coating pretreatment process record of the current sucker rod does not match these cases by >20%, it is concluded that the peeling originates from coating pretreatment process defects.
[0235] Mechanical impact rule: When the peeling of similar cases "presents irregular chunks, and there are obvious mechanical scratches (scratch depth ≥0.5mm) around", and the sucker rod in the case has been subjected to "stuck drill pipe, collision during tripping (verified by operation log)", and there are similar impact operation records in the operation log of the current sucker rod, it is concluded that the peeling originates from mechanical impact damage.
[0236] Well site sensor data collection is as follows:
[0237] Through the installation of sand content sensors based on optical or mechanical principles at the wellhead, the sand content in the well fluid is measured in real time. The sensor counts sand particles through light scattering or mechanical blocking principle, thereby obtaining sand content data;
[0238] The pH sensor based on the principle of glass electrode or ion selective electrode is installed on the pipeline through which the well fluid flows to measure the pH value of the well fluid. The sensor determines the pH value by measuring the concentration of hydrogen ions;
[0239] The thermocouple or thermistor temperature sensor is installed on the sucker rod or well fluid pipeline to monitor the temperature in the well in real time. These sensors work based on the principle of thermoelectric effect or resistance change with temperature;
[0240] The strain gauge or piezoelectric sensor is installed on the connection part of the sucker rod to measure the load change of the sucker rod during operation. The strain gauge reflects the load by measuring the metal strain, and the piezoelectric sensor uses the principle that piezoelectric materials generate electric charge when subjected to force.
[0241] The current detected sucker rod surface defect type and the well environment data are integrated to form a data sample to be analyzed.
[0242] For the data sample to be analyzed, the cosine similarity and Euclidean distance between it and the existing data records in the sucker rod defect knowledge graph are calculated respectively.
[0243] The cosine similarity calculation formula is:
[0244]
[0245] where A and B represent the data sample vector to be analyzed and the data record vector in the knowledge graph, respectively, and is the cosine similarity between vector A and vector B. The value of cosine similarity is between (-1) and 1, and the closer to 1 indicates that the two vectors are more similar.
[0246] The Euclidean distance calculation formula is:
[0247]
[0248] where and are the i-th elements of vectors A and B, and n is the vector dimension.
[0249] According to the actual application scenario, the weights of cosine similarity and Euclidean distance in comprehensive similarity calculation are determined. For example, set the cosine similarity weight to and the Euclidean distance weight to , then the comprehensive similarity is calculated by the formula:
[0250]
[0251] where is the comprehensive similarity, which is the similarity value obtained by comprehensively considering the cosine similarity and Euclidean distance. and cosine similarity and Euclidean distance weight in the comprehensive similarity calculation, respectively.
[0252] According to the comprehensive similarity value , the top 5 similar cases are selected from the sucker rod defect knowledge graph, and the defect origin records of the selected similar cases are analyzed, combined with the predefined defect origin inference rules in the knowledge graph.
[0253] For example, the current detection of the sucker rod surface exists corrosion defects, the sand content of the well fluid is 0.6%, the pH value is 4.0, the sucker rod material is 20CrNiMo, the well depth is 1800 meters, and the mining life is 3 years. These data are integrated into the data sample to be analyzed, and the similarity calculation is performed with the cases in the knowledge graph, and the top 5 similar cases are selected.
[0254] Origin inference, among the selected similar cases (top 5), 3 cases have corrosion defect type, well fluid sand content between 0.5%-0.7%, pH value between 3.5-4.5, material 20CrNiMo or similar material, and defect origin is "sand wear + acid corrosion", combined with the current environmental data, it can be inferred that the origin of the current corrosion defect is "sand wear + acid corrosion".
[0255] The decision is as follows:
[0256] According to the inferred defect origin, combined with the size, number and other characteristics of the current sucker rod surface defect type, the severity of the defect is evaluated.
[0257] For example, for corrosion defects, if the origin is "sand corrosion + acid corrosion", and the corrosion area accounts for more than 20% of the sucker rod surface area, it is determined as a serious defect.
[0258] According to the defect severity, the corresponding decision scheme is made.
[0259] High-risk decision (serious defect) as follows:
[0260] Such as immediately stop and replace the sucker rod, select the sucker rod material with higher corrosion and wear resistance (such as 35CrMoA), and conduct comprehensive detection on the same batch of sucker rods.
[0261] Medium-risk decision (moderate defect) as follows:
[0262] For example, adopt targeted repair measures, such as hot spraying repair of corrosion parts, and install real-time monitoring devices to shorten the monitoring cycle (such as from once a month to once a week).
[0263] Low-risk decision (mild defect) as follows:
[0264] For example, adjust the working parameters of the sucker rod (such as reducing the pumping speed), check and repair the defect site at the next planned maintenance, and strengthen daily inspection before maintenance.
[0265] This step traces the root cause of the defect through the combination of knowledge graph and environmental data, and formulates a scientific and reasonable treatment decision according to the origin of the defect, which is the ultimate goal of the whole process and guarantees the normal operation of the sucker rod.
[0266] The present application surrounds the detection and treatment of sucker rod defects, from detection component calibration, baseline graph construction, defect area determination, defect type identification to defect origin analysis and decision making, and constructs a complete and innovative system. The system integrates a variety of advanced technologies and exhibits excellent performance improvement at each link, which can effectively solve the problems of low detection accuracy, inaccurate defect identification and lack of targeted decision making in traditional sucker rod detection, and provides strong technical support for the safe and efficient operation of the sucker rod in oil exploitation, and has broad application prospects in the field of oil exploitation, and is expected to significantly improve the economic benefit and safety of oil exploitation.
[0267] It should be noted that in this paper, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations. The statement "including a limited element" does not exclude the existence of another identical element in the process, method, article or equipment including the element.
[0268] Although embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. A method for detecting surface defects in oilfield-specific sucker rods, characterized in that, Includes the following steps: Step S1: Align the ultrasonic detection component and the electromagnetic eddy current detection component using a vector cross product alignment algorithm to obtain the acoustic-electric coupling detection unit; Step S2: The surface of the standard sucker rod is detected by the acoustic-electric coupling detection unit to obtain the ultrasonic baseline vector and the electromagnetic baseline vector. The ultrasonic baseline vector and the electromagnetic baseline vector are respectively associated with the position coordinates of the surface of the standard sucker rod to form a field baseline map. Step S3: Use an acoustic-electric coupling detection unit to detect the sucker rod inside the oil well to obtain real-time acoustic channel signals and real-time electrical channel signals. Based on the field baseline map, compare the real-time acoustic channel signals and real-time electrical channel signals respectively to calculate the acoustic channel deviation and electrical channel deviation. Based on the acoustic channel deviation and electrical channel deviation, determine the defect area on the surface of the sucker rod. Step S4: Acquire and preprocess the image of the defect area to obtain the surface defect image of the sucker rod. Extract features from the surface defect image of the sucker rod to obtain high-dimensional feature vector and low-level feature vector. Then fuse the real-time signal of the acoustic channel and the real-time signal of the electrical channel to construct a fused vector. Step S5: Based on the gradient boosting algorithm, construct a surface defect identification model, input the fused vector into the surface defect identification model, and output the surface defect type of the sucker rod; Step S6: Construct a knowledge graph of sucker rod defects, collect data on the internal environment of the oil well, combine the surface defect types of the sucker rod with the data on the internal environment of the oil well, and match them with the knowledge graph of sucker rod defects using cosine similarity and Euclidean distance algorithms to obtain the origin of sucker rod defects.
2. The method for detecting surface defects of oilfield-specific sucker rods according to claim 1, characterized in that, The ultrasonic detection component and the electromagnetic eddy current detection component are aligned using a vector cross product alignment algorithm to obtain an acoustic-electric coupling detection unit, including: The detection components are integrated as follows: Select an ultrasonic probe with a center frequency of 5MHz to 10MHz and a focusing depth of 1mm to 5mm, and an electromagnetic eddy current probe with an excitation frequency of 10kHz to 100kHz and a detection depth of 0.1mm to 2mm. Fix both of them on a compact probe mounting bracket made of aluminum alloy. To achieve precise alignment of the probe axes, a vector cross product alignment algorithm is used for calibration. Define the axis vector of the ultrasound probe for: ; in, This is the starting position vector of the ultrasonic probe axis. is the direction vector of the ultrasonic probe axis, and t is a parameter to describe any position on the axis; Define the axis vector of the electromagnetic eddy current probe. for: ; in, This is the starting position vector of the electromagnetic eddy current probe axis. This is the direction vector of the electromagnetic eddy current probe axis; By making Ensure that the starting positions of the two probes are parallel and aligned; and This ensures that the axes of the two probes are aligned, that the centers of the two probes coincide and are parallel to the axes, and that the overlap coverage accuracy of the detection area is no more than 0.5mm.
3. The method for detecting surface defects of oilfield-specific sucker rods according to claim 2, characterized in that, Step S2 includes: A standard sucker rod calibration section in good condition was selected at the well site. The sucker rod was controlled to pass through the detection window at a uniform speed of 0.1 m / s, and the response signals of the acoustic and electrical channels were collected simultaneously. For the ultrasound channel, continuous acquisition Group time domain signals The ultrasound baseline vector was obtained by averaging the 50 sets of signals. : ; in, The ultrasound baseline vector is obtained by averaging 50 sets of ultrasound time-domain signals. This vector represents the average signal characteristics of the ultrasound channel under standard conditions. Indicates the number of time-domain signal groups acquired; This represents the i-th time-domain signal in the ultrasound channel; For the electromagnetic channel, data is continuously collected in the same manner. Group time domain signals The electromagnetic baseline vector is obtained by taking the mean: ; in, The electromagnetic baseline vector is obtained by averaging 50 sets of electromagnetic time-domain signals. This vector represents the average signal characteristics of the electromagnetic channel under standard conditions. This represents the i-th time-domain signal in the electromagnetic channel; The above ultrasound baseline vector Electromagnetic baseline vector The coordinates of the positions on the surface of the sucker rod are correlated to form a field baseline map.
4. The method for detecting surface defects of oilfield-specific sucker rods according to claim 3, characterized in that, An acoustic-electric coupling detection unit was used to detect the sucker rod inside the oil well, obtaining real-time acoustic and electrical channel signals, including: Real-time signal acquisition is as follows: The entire acoustic-electric coupling detection unit is kept coaxial with the sucker rod and moves slowly along the axis of the sucker rod at a speed of 1 millimeter per second. In this way, the sucker rod is detected segment by segment in detail, and the real-time response signals of the acoustic channel and the electrical channel are collected. For any position x on the outer surface of the sucker rod, acquire the real-time signal of the acoustic channel. Real-time signal of electrical channel .
5. The method for detecting surface defects of oilfield-specific sucker rods according to claim 4, characterized in that, Based on the aforementioned field baseline map, the real-time signals of the acoustic channel and electrical channel are compared separately to calculate the acoustic channel deviation and electrical channel deviation. Based on these deviations, the defect areas on the sucker rod surface are determined, including: Calculate the real-time signal of the acoustic channel and the ultrasonic baseline vector Deviation degree and the real-time signal of the electrical channel and the electromagnetic baseline vector Deviation degree The calculation formula is as follows: ; ; in, It is the acoustic channel deviation; It is the electrical channel deviation; The defect area on the sucker rod surface is determined by using a three-layer defect location assessment: Co-provided evidence, when and When the acoustic channel and electrical channel simultaneously exhibit strong divergence from their respective baselines, this location is marked as a candidate defect point. Neighborhood consistency refers to the consistency of the neighborhood around a candidate defect point. Perform the analysis and calculate the mean deviation within the neighborhood. : ; Among them, the molecular part Indicates the neighboring region Deviation at all locations within To perform summation, that is, to calculate from arrive The sum of the deviations at all locations within this range; the denominator is... Because the neighborhood range is from arrive There are a total of One location point; Set neighborhood consistency threshold ,when At that time, it was confirmed that the signal anomaly in the area was spatially continuous, isolated noise interference was ruled out, and the existence of defects in the area was further confirmed. To ensure repeatability and avoid artifacts caused by factors such as adhered grease films, coupling fluctuations, or minor changes in proximity, multiple tests are performed at the same location. Let the number of tests be... The signal detected next is , No. The signal detected next is Calculate the difference between the two detected signals: ; Set the repeatability stability threshold ,when When the abnormal signal at that location exhibits stable characteristics across multiple detections, the area where the location is ultimately identified as a defect region, achieving a positioning accuracy of up to [percentage missing]. ; The final identified defect area is , indicating the location point within the defect area, i.e. Location points that satisfy the three-level criteria .
6. The method for detecting surface defects of oilfield-specific sucker rods according to claim 5, characterized in that, Feature extraction is performed on the surface defect image of the sucker rod to obtain high-dimensional feature vectors and low-level feature vectors, including: To accommodate defects of varying sizes on the sucker rod surface, an improved multi-scale feature fusion module is employed. This module extracts features at different levels from the preprocessed sucker rod surface defect image: on one hand, it performs 2×2 max pooling on the image and extracts the global max pooling value to capture the overall contour of small defects; on the other hand, it compresses the number of channels through 1×1 convolution and extracts the global max pooling value and the global average pooling value respectively for the feature representation of large defects. Finally, these features are fused to form a 3-channel multi-scale feature map. To enhance the feature weights of defective regions by embedding a NonLocalBlock module, the attention coefficient matrix is first calculated: ; in, These are input features. and It is a 1×1 convolution operation. Indicates the feature map height. Indicates width, Indicates the number of channels. It is a normalization function, where C is the number of channels in the feature map, and then through... and Obtain the output feature map after attention enhancement , and It is a 1×1 convolution operation; Feature maps after attention enhancement Global pooling is performed to compress 3D spatial features into 1D vectors, eliminating spatial dimensionality information while preserving semantic features. Dimensional adjustment and semantic enhancement are achieved by mapping the pooled vectors to 256 dimensions through a fully connected layer, ensuring dimensional uniformity and efficient integration into cross-modal fusion vectors, ultimately yielding... ; Supplementing visual features at the bottom of the layer, extracting morphological and textural features of defects, and helping to distinguish different types of defects; Defect perimeter The total number of pixels at the edge of the defect area reflects the extent of the defect; area. The total number of pixels within the defect area, reflecting the size of the defect; Circularity The formula is as follows: ; in, Take 3.14, The defect area is... The perimeter of the defect is used; the defect morphology is quantified by a circle to distinguish between spalling and cracks. Texture features, texture entropy formula: ; in, It is the number of LBP sampling neighbors; It is the first The probability of LBP mode occurring; Texture entropy quantifies the texture complexity of defective regions, distinguishing erosion from other defects and forming the underlying feature vector. .
7. The method for detecting surface defects of oilfield-specific sucker rods according to claim 6, characterized in that, By fusing the real-time signals from the acoustic channel and the electrical channel, a fusion vector is constructed, including: The feature fusion constructs the following: Combining the acoustic and electrical features output in step S3, a cross-modal fusion vector is constructed. It integrates depth information from acoustic and electrical signals with morphological and texture information from visual signals: official: ; in, It is the acoustic channel deviation calculated in step S3, which reflects the difference in sound wave reflection caused by the defect; It is the electrical channel deviation calculated in step S3, which reflects the difference in the interference of the defect on the electromagnetic field; It is the mean of the neighborhood deviation calculated in step S3, which reflects the spatial continuity of the defect; It is the L2 norm of the k-th and (k-1)-th detection signals calculated in step S3, reflecting the stability of the defect; It is a 256-dimensional high-level feature vector after attention enhancement, containing semantic features of the defect; fused vector The total dimensions are 136, covering multiple dimensions of acoustic, electronic, and visual features, avoiding misjudgment of complex defects by a single modality.
8. The method for detecting surface defects of oilfield-specific sucker rods according to claim 7, characterized in that, A surface defect identification model is constructed based on the gradient boosting algorithm. The fused vector is input into the surface defect identification model, and the output is the surface defect type of the sucker rod, including: Surface defect identification model architecture: The XGBoost classifier is used, with the input layer being a fused vector. After passing through 3 fully connected layers, the output layer has 3 neurons, corresponding to the probability distribution of three types of defects: cracks, corrosion, and peeling. Hybrid supervised training is as follows: The teacher model is trained using at least 50 pixel-level labeled images until it converges. When the teacher model makes predictions on unlabeled images, samples with a prediction confidence of 0.9 or higher are considered reliable samples, and those with a confidence of less than 0.9 are considered uncertain samples. The student model is trained using a joint loss formula: ; in, It is the total loss of the surface defect recognition model. It is the cross-entropy loss of the labeled samples. The loss is the loss from the pseudo-labeled samples; the total loss of the model. It consists of two parts, one of which is the cross-entropy loss of the labeled samples. The other part is the loss from pseudo-labeled samples. and These are weights, used to balance the proportion of these two parts of the loss in the total loss. This training method is usually used in semi-supervised learning, which trains the model using a small amount of labeled data and a large amount of unlabeled data. The classification reasoning is as follows: When the fusion vector When used as input, find the probability that The largest Value, of which The range of values is This probability Indicates that, given a fusion vector In the case of the first The probability of a class of defects; Specifically, the defect type is determined using the following formula: ; in, The final determined defect type is represented by a variable, which is a possible defect type number; Indicates that, given a fusion vector Under the conditions, the defect belongs to the first The probability of a class; argmax is an operation that finds the index of the maximum value, its purpose is to... When taking 1, 2, and 3, a [missing information] was found. Value Maximum, at and Find the corresponding probability among these three possible defect types. The biggest one Value, this The defect type corresponding to the value is the defect type we inferred; The formula for calculating confidence level is: ; in, This represents the confidence level, or the degree of certainty regarding a given defect type. This means that after calculating all... Then, the maximum value among them is taken as the confidence level; Output layer, defect type determination result, in the format "Type", Output the defect type and confidence level in the form of "".
9. The method for detecting surface defects of oilfield-specific sucker rods according to claim 8, characterized in that, Constructing a knowledge graph of sucker rod defects, including: The knowledge graph of sucker rod defects is constructed as follows: First, the knowledge graph architecture is designed to determine the core entity types in the knowledge graph, including sucker rod surface defect types, well environment data, sucker rod material information, and well site operating condition information. Define the types of relationships between entities, extract relevant knowledge from multi-source data such as historical sucker rod defect detection records, maintenance reports, and well site production data, and input the extracted sucker rod surface defect types, corresponding well environment data, sucker rod materials, and well site operating conditions information according to the designed map architecture; The knowledge graph storage and management system uses a graph database to store the constructed sucker rod defect knowledge graph, ensuring efficient data querying and retrieval; and establishes a data update mechanism to update the knowledge graph in a timely manner when new data is acquired.
10. The method for detecting surface defects of oilfield-specific sucker rods according to claim 9, characterized in that, By matching the knowledge graph of sucker rod defects with cosine similarity and Euclidean distance algorithms, the origins of sucker rod defects are obtained, including: The types of surface defects on the sucker rod obtained from the current detection Integrate the well environment data with the data to form a data sample to be analyzed; For the data sample to be analyzed, calculate its cosine similarity and Euclidean distance with the existing data records in the sucker rod defect knowledge graph; The formula for calculating cosine similarity is: ; Where A and B represent the data sample vector to be analyzed and the data record vector in the knowledge graph, respectively. This represents the cosine similarity between vector A and vector B. The value of the cosine similarity is between -1 and 1. The closer it is to 1, the more similar the two vectors are. The Euclidean distance calculation formula is: ; in, and These are the i-th elements of vectors A and B, respectively, where n is the dimension of the vectors; Based on the actual application scenario, determine the weights of cosine similarity and Euclidean distance in the comprehensive similarity calculation, and then calculate the comprehensive similarity. The calculation formula is: ; in, The overall similarity score is a value obtained by combining cosine similarity and Euclidean distance. and These are the weights of cosine similarity and Euclidean distance in the overall similarity calculation; based on the overall similarity value... The top 5 cases with the highest similarity were selected from the sucker rod defect knowledge graph. The defect origin records of the selected similar cases were analyzed and combined with the predefined defect origin inference rules in the knowledge graph.
Citation Information
Patent Citations
Pipeline repairing method and system based on defect detection
CN119295042A
Joint denoising method and system based on multi-source noise suppression and sparse representation
CN120761518A