Method for detecting surface defects of sucker rod special for oil field
By identifying surface defects on sucker rods using an acoustic-electric coupling detection unit and a gradient boosting algorithm, and combining this with knowledge graph matching to identify defect origins, the accuracy problem of single-channel ultrasonic detection is solved, enabling high-precision defect identification and scientific decision-making.
Patent Information
- Application Number
- CN202511492667.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-11-21
- 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 acoustic-electric coupling detection unit is formed by calibrating ultrasonic and electromagnetic eddy current detection components using a vector cross product alignment algorithm. Combined with gradient boosting algorithm and sucker rod defect knowledge graph, multi-scale feature extraction and fusion are performed to construct a defect identification model. Cosine similarity and Euclidean distance algorithms are used to match the origin of defects.
It improves the accuracy of defect detection, reducing the positioning accuracy from ±10mm to ±5mm, lowering the failure rate, and providing a scientific basis for defect handling decisions.
Smart Images

Figure CN120992756A_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 necessary to rely on pre-set parameters and experience to judge the defects. 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: Step S1: calibrate and align the ultrasonic detection assembly and the electromagnetic eddy current detection assembly by vector cross multiplication alignment algorithm to obtain a sound-electricity coupling detection unit; Step S2: detect the surface of a standard sucker rod by the sound-electricity 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; Step S3: detecting the oil well internal sucker rod using the acoustic-electric coupling detection unit to obtain an acoustic channel real-time signal and an 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 an acoustic channel divergence and an electric channel divergence, and determining a defect area on the surface of the sucker rod based on the acoustic channel divergence and the electric channel divergence; 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; 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; Step S6: a sucker rod defect knowledge graph is constructed, oil well internal environment data are 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.
[0006] 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: The detection assembly is integrated as follows: 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 fixed on a compact probe mounting bracket made of aluminum alloy; To realize accurate coincidence of the probe axis, a vector cross multiplication alignment algorithm is used for calibration: The axis vector of the ultrasonic probe is defined as :
[0007] 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; The axis vector of the electromagnetic eddy current probe is defined as :
[0008] wherein, is the starting position vector of the electromagnetic eddy current probe axis, is the direction vector of the electromagnetic eddy current probe axis; By making , ensure that the two probe starting position parallel alignment (in vector calculation, if two vectors cross equal to 0, then two vectors parallel collinear); and , ensure that the two probe axis direction consistent, realize two probe center position coincides with the axis parallel, ultimately make the detection area overlap coverage accuracy is not greater than 0.5mm.
[0009] Preferably, step S2 includes: 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: For the ultrasonic channel, continuously collecting 50 groups of time domain signals , obtaining an ultrasonic baseline vector by averaging the 50 groups of signals:
[0010] Among them, 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 standard conditions; represents the number of groups of time domain signals collected; represents the i-th group of time domain signals in the ultrasonic channel; For the electromagnetic channel, continuously collect 50 groups of time domain signals in the same way, and obtain an electromagnetic baseline vector by averaging:
[0011] Among them, 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 standard conditions; represents the i-th group of time domain signals in the electromagnetic channel; The above ultrasonic baseline vector and electromagnetic baseline vector are associated with the position coordinates of the pumping rod surface, respectively, to form a field baseline atlas.
[0012] Preferably, the acoustic-electric coupling detection unit is used to detect the inside of the oil well, and the real-time signals of the acoustic channel and the electric channel include: The real-time signal collection is as follows: The entire acoustic-electric coupling detection unit maintains coaxial with the pumping rod, and slowly moves along the axial direction of the pumping rod at a speed of 1mm per second, thereby finely detecting the pumping rod in sections and collecting the real-time response signals of the acoustic channel and the electric channel. 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 .
[0013] Preferably, based on the field baseline map, the real-time signals of the acoustic channel and the electrical channel are compared respectively to calculate the acoustic channel deviation and the electrical channel deviation. Based on the acoustic channel deviation and the electrical channel deviation, the defect areas on the surface of the sucker rod 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 is considered, taking into account potential local interference factors in the aluminum-clad steel strip, and the neighborhood around the candidate defect point is considered. Perform the analysis and calculate the mean deviation within the neighborhood. :
[0014] 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 a defect in the area was further confirmed. 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:
[0015] 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 .
[0016] 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: 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:
[0017] in, It is the input feature map. 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 the three-dimensional spatial features into a one-dimensional vector, eliminating spatial dimension information and retaining semantic features of the defects. Dimension adjustment and semantic enhancement: the pooled vector is mapped to 256 dimensions through a fully connected layer to ensure uniform dimensions and efficient integration into the cross-modal fusion vector. Finally, the cross-modal fusion vector is obtained ; Layer bottom visual feature supplement, extraction of defect morphology and texture features, to assist in distinguishing different types of defects; Defect perimeter : the total number of edge pixels in 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; Circularity The formula is as follows:
[0018] Wherein, Take 3.14, is the defect area, is the defect perimeter; the circularity quantifies the defect morphology and is used to distinguish between peeling and cracking; Texture feature, texture entropy Formula:
[0019] Wherein, is the number of LBP sampling neighborhoods; is the probability of the occurrence of the th LBP pattern; is the texture entropy, which quantifies the texture complexity of the defect area through the texture entropy and is used to distinguish between corrosion and other defects to form the bottom feature vector .
[0020] Preferably, the fusion of the acoustic channel real-time signal and the electric channel real-time signal is constructed to obtain the fusion vector, which includes: The feature fusion construction is as follows: The cross-modal fusion vector is constructed by combining the acoustic and electric features output by step S3, integrating the depth information of the acoustic and electric signals and the morphology and texture information of the visual signal: Formula:
[0021] Wherein, is the acoustic channel divergence calculated in step S3, reflecting the difference in reflection of the acoustic wave by the defect; is the electric channel divergence calculated in step S3, reflecting the difference in electromagnetic field interference by the defect; is the average neighborhood divergence calculated in step S3, reflecting the spatial continuity of the defect; The L2 norm of the k-th and k1-th detection signals calculated in step S3 reflects 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.
[0022] Preferably, 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 shows that the surface defect types of the sucker rod include: Surface defect identification model architecture: The XGBoost classifier is used, with its 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 with at least 50 pixel-level labeled images until it converges. The teacher model makes predictions on unlabeled images, and samples with a prediction confidence of 0.9 or higher are considered reliable samples, while those with a confidence of 0.7 or 0.9 are considered uncertain samples. The student model is trained using a joint loss formula:
[0023] 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:
[0024] 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:
[0025] 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=2 (corrosion), Output the defect type and confidence level in the form of "".
[0026] Preferably, constructing a knowledge graph of sucker rod defects includes: 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.
[0027] Preferably, 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: combining the current detected sucker rod surface defect type and the well environment data to form a to-be-analyzed data sample; For the to-be-analyzed data sample, the cosine similarity and the Euclidean distance of the to-be-analyzed data sample and the existing data record in the sucker rod defect knowledge graph are calculated respectively. The cosine similarity calculation formula is:
[0028] Wherein, A and B represent the to-be-analyzed data sample vector and the data record vector in the knowledge graph, The cosine similarity between vector A and vector B is represented, and the value of the cosine similarity is between (-1) and 1, and the closer to 1 indicates that the two vectors are more similar. The Euclidean distance calculation formula is:
[0029] Wherein, And The i-th element of vector A and B is n, and n is the vector dimension. According to the actual application scene, the weights of the cosine similarity and the Euclidean distance in the comprehensive similarity calculation are determined, and the comprehensive similarity The calculation formula is:
[0030] Wherein, The comprehensive similarity is represented, and the similarity value obtained by comprehensively considering the cosine similarity and the Euclidean distance, And The cosine similarity and the Euclidean distance are weights in the comprehensive similarity calculation, respectively. According to the comprehensive similarity value , the top 5 cases with similarity are selected from the sucker rod defect knowledge graph, and the defect origin record of the selected similar cases is analyzed, and the predefined defect origin inference rule in the knowledge graph is combined.
[0031] The present application provides a kind of oilfield special sucker rod surface defect detection method, it is related to machine learning and deep learning technology, it has the following beneficial effects: (1), the oilfield special sucker rod surface defect detection method, by comprehensively using ultrasonic detection component and electromagnetic eddy current detection component, is aligned by vector cross product algorithm Calibration forms acoustic-electric coupling detection unit, can be more accurately obtain the sucker rod surface information.Compared with single detection technology, the accuracy of defect detection is greatly improved.
[0032] (2) The oil field special sucker rod surface defect detection method, by detecting the standard sucker rod surface, the baseline atlas is constructed, which provides accurate comparison basis for subsequent actual well field sucker rod detection. At the same time, in the actual detection, based on the atlas, the sound channel divergence and the electric channel divergence are calculated, which can quickly and accurately determine the defect area, which reduces the error range of defect area positioning from ±10mm to ±5mm, and saves a lot of time and labor cost for subsequent defect treatment.
[0033] (3) The oil field special sucker rod surface defect detection method, by constructing the sucker rod defect knowledge graph, combining with the well environment data, the defect origin is accurately obtained by cosine similarity and Euclidean distance algorithm matching. Based on this, scientific and targeted decisions can be made for different defect origins. For example, for defects caused by well fluid corrosion, the corrosion-resistant sucker rod material can be accurately decided to replace, which effectively reduces the subsequent sucker rod failure rate. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 A flow chart of the oil field special sucker rod surface defect detection method is provided for the present application; Figure 2 A hierarchical diagram of the oil field special sucker rod surface defect detection method is provided for the present application to obtain the sucker rod defect area; Figure 3 A hierarchical diagram of the oil field special sucker rod surface defect detection method is provided for the present application to obtain the sucker rod defect origin. DETAILED DESCRIPTION
[0035] 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 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.
[0036] Please refer to Figures 1-3 The present application provides a technical solution: an oil field special sucker rod surface defect detection method. Specifically, the following oil field special sucker rod surface defect detection method is provided, please refer to Figure 1 The method comprises the following steps: Step S1: align the ultrasonic detection assembly and the electromagnetic eddy current detection assembly by vector cross multiplication alignment algorithm, to obtain a sound and electricity coupling detection unit.
[0037] The detection assembly is integrated as follows: An ultrasonic probe with a center frequency of 5-10 MHz and a focusing depth of 1-5 mm and an electromagnetic eddy current probe with an excitation frequency of 10-100 kHz and a detection depth of 0.1-2 mm are fixed on an aluminum alloy compact probe mounting bracket. The initial position vectors of the ultrasonic probe and the electromagnetic eddy current probe are and The direction vectors of the ultrasonic probe and the electromagnetic eddy current probe are determined based on the mechanical coordinate system of the probe mounting bracket and Calibrated at the initial stage of installation by a laser light calibrator.
[0038] To realize accurate coincidence of the probe axes, a vector cross product alignment algorithm is used for calibration: The axis vector of the ultrasonic probe is defined as :
[0039] wherein, is the initial position vector of the ultrasonic probe axis, determined based on the mechanical coordinate system of the probe mounting bracket; is the direction vector of the ultrasonic probe axis, and t is a parameter to describe any position on the axis; The axis vector of the electromagnetic eddy current probe is defined as :
[0040] wherein, is the initial position vector of the electromagnetic eddy current probe axis, is the direction vector of the electromagnetic eddy current probe axis.
[0041] By making , the initial positions of the two probes are parallelly aligned (in vector calculation, if the cross product of two vectors is equal to 0, the two vectors are parallel and collinear); and , the directions of the axes of the two probes are consistent, realizing coincidence of the central positions of the two probes and parallelism of the axes, and finally making the overlap coverage precision of the detection area not greater than 0.5 mm.
[0042] The mechanical limiting structure is as follows: Two sets of orthogonally arranged slide rail mechanisms are used, each set of slide rail is matched with a set of locking and limiting mechanism, realizing independent adjustment of the probe in the pitch and yaw directions, allowing the probe to be adjusted in the pitch angle within ±10°, after the adjustment is completed, the probe attitude is calibrated using a micrometer and fixed through a locking nut, ensuring that the included angle between the probe axis and the surface normal of the sucker rod is not greater than 3 degrees, and guaranteeing the effectiveness of the detection signal.
[0043] To make the detection unit adapt to the harsh working conditions such as oilfield sludge, sand, temperature difference, etc., the following configurations are made: 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 rods to further remove the residual attachments on the probe surface.
[0044] 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 point based on the outer surface of the oil rod as the reference surface. , which represents the distance between the probe and the origin point when the spring is naturally elongated, and the force balance equation is as follows:
[0045] , wherein represents the distance between the probe and the origin point when the spring is naturally elongated, is the actual distance from the probe to the surface of the oil rod, is the preset fitting pressure, and the fitting pressure between the probe and the surface of the oil rod is adjusted so that the distance from the probe to the surface of the oil rod deviates from the reference value (default value 1.5 mm) by no more than 0.1 mm, thereby ensuring that the distance between the probe and the surface of the oil rod is stable and controllable and improving the consistency of the detection data of the two channels.
[0046] 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 rod.
[0047] Step S2: detecting the surface of the standard oil 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 rod, and forming an on-site baseline map.
[0048] This step is carried out after the detection unit is arranged in step S1, and through the co-time base alignment and on-site baseline acquisition, 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.
[0049] To ensure the synchronization of the ultrasonic and electromagnetic dual-channel detection data in the time and space dimensions, the co-time base alignment is realized in the following manner: The synchronous trigger and position identification component are installed on the sucker rod driving side. The synchronous trigger is used to unify the time sequence reference of the ultrasonic pulse emission time and the electromagnetic excitation time. The position identification component (such as a key groove processed on the surface of the sucker rod or a geometric mark with identifiable features) is used as the zero point anchor of the mechanical position. When the sucker rod passes through the detection window, the trigger signal of the position identification component is used as the reference to associate the ultrasonic pulse emission time , the electromagnetic excitation time , and the mechanical position signal of the sucker rod passing through the detection window to the same time sequence reference system, so that (where is the position identification component trigger time), and finally the time sequence synchronization error is controlled within 10 μs.
[0050] A standard sucker rod calibration section with good state in the well site (the calibration section length is not less than 500 mm, and no defects are confirmed by manual detection or historical detection records) is selected. The sucker rod is controlled to pass through the detection window at a uniform speed of 0.1 m / s. The response signals of the acoustic channel and the electric channel are synchronously collected: For the ultrasonic channel, 50 groups of time domain signals are continuously collected. The ultrasonic baseline vector is obtained by averaging the 50 groups of signals:
[0051] wherein represents the ultrasonic baseline vector, which is obtained by averaging the 50 groups of ultrasonic time domain signals. This vector represents the average signal characteristics of the ultrasonic channel under 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. Here, the value range of i is from 1 to 50, that is .
[0052] For the electromagnetic channel, 50 groups of time domain signals are continuously collected in the same way. The electromagnetic baseline vector is obtained by averaging:
[0053] wherein represents the electromagnetic baseline vector, which is obtained by averaging the 50 groups of electromagnetic time domain signals. This vector represents the average signal characteristics of the electromagnetic channel under standard state; represents the i-th group of time domain signals in the electromagnetic channel.
[0054] The above ultrasonic baseline vector and the electromagnetic baseline vector respectively, to form a field baseline atlas. The atlas can reflect the normal response of the acoustic-electric channel in the absence of defects under current well site temperature, well fluid medium composition, rod material hysteresis characteristics, surface coating state, and surface roughness conditions, providing a reference basis for subsequent defect determination.
[0055] Step S3: The acoustic-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.
[0056] This step is based on the co-time base established in step S2 and the field baseline. Through acoustic-electric coupling detection technology, the sucker rod is detected in real time, and a dual-channel consistency criterion is established to determine whether a defect exists, and the defect area is accurately located.
[0057] The real-time signal acquisition is as follows: The entire acoustic-electric coupling detection unit maintains coaxial with the sucker rod, and moves slowly 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, and the real-time response signals of the acoustic channel and the electric channel are collected.
[0058] 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.
[0059] 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 The calculation formula is as follows: ; ; Wherein, is the acoustic channel divergence; is the electric channel divergence; The preset divergence threshold (for the acoustic channel) and (for the electric channel) are or , which preliminarily determines that there is a signal anomaly at this position. Considering the different characteristics of ultrasonic and electromagnetic detection, the two threshold values are usually different. For example, , .
[0060] The defect area on the surface of the sucker rod is determined by three-layer defect positioning: The same position is confirmed when and , that is, the acoustic channel and the electric channel simultaneously show strong deviation from their respective baselines, and the position is marked as a candidate defect point.
[0061] Neighborhood consistency. Considering that the plating layer on the surface of the sucker rod is aluminum-coated steel material, local unevenness may cause signal interference. The neighborhood (where ) around the candidate defect point is analyzed. The average deviation in the neighborhood is calculated:
[0062] where the numerator 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 , since the neighborhood range is from to , there are position points (for example, when , from to there are points). The entire formula calculates the average deviation of all positions in the neighborhood, that is, the average deviation of the neighborhood .
[0063] 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, .
[0064] Repeat stability. To avoid false positives caused by factors such as adherent grease film, coupled wave fluctuations, or small changes in proximity, the same position is detected multiple times. Let the signal of the th detection be , the signal of the th detection be , and the difference between the two detection signals be calculated:
[0065] Set the repeat stability threshold When , it indicates that the abnormal signal of the position shows stable characteristics in multiple detections, and finally determines the area where the position is located as a defect area, and the positioning accuracy can reach . For example, .
[0066] The finally determined defect area is , indicating the position points in the defect area, that is the position points satisfying the three-layer criterion . Through the above-mentioned three-layer criterion system of “same position, consistent neighborhood, and repeated stability”, the false positive and false negative rates in the defect determination process can be significantly reduced, the accurate determination and positioning of the sucker rod surface defects are realized, and the target range for further detailed analysis of the defect area is provided.
[0067] 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.
[0068] The sucker rod surface defect image is collected as follows: The defect area coordinate set output by step S3 is received (wherein represents the sucker rod surface position point satisfying the three-layer criterion of “same position, consistent neighborhood, and repeated stability”, the subscript a satisfies 1≤a≤n, and the unit is mm), an industrial camera is triggered for synchronous snapshot, and is installed at the front end of a flexible mechanical arm. The mechanical arm can be quickly moved to the position of the defect area after accurate programming. The camera lens is perpendicular to the sucker rod defect area, and the distance is strictly set to 10 centimeters. This distance can not only ensure that a high-resolution defect image is obtained, but also avoid image distortion or detail loss caused by too close or too far distance. During the collection process, the camera rotates around the defect area by 360 degrees to obtain image information of the defect area from various angles. An IP67 level oil-resistant industrial camera (resolution 1280×720, frame rate 60 fps) is selected, and a wavelength of 450 nm is selected for the ring blue light LED light supplement module to ensure that the spatial coincidence deviation of the collection area and the acoustic and electric detection area is ≤0.5 mm, avoiding feature misplacement caused by position deviation.
[0069] The sucker rod surface defect image is preprocessed as follows: The collected sucker rod surface defect image is processed through a logarithmic transformation formula:
[0070] wherein, is the original image in the coordinate the gray value at the position, is the transformed gray value, is a contrast adjustment constant, this operation can enhance the defect details in dark areas, such as small corrosion points covered by oil film, etc.
[0071] The surface defect image of the sucker rod is then subjected to median filtering, using a kernel of to perform median filtering, and at the same time, in order to process the points on the boundary, a boundary expansion method (mirror expansion) can be used, when or at the image boundary, the pixel values outside the boundary are obtained through mirror expansion, assuming that the width of the image is and the height is , for the pixels and the formula is as follows:
[0072] 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 .
[0073] The histogram equalization process is as follows: First, calculate the gray cumulative distribution function :
[0074] wherein is the gray level, and are the height and width of the image respectively, is the number of pixels with a gray level of . Then perform gray mapping through the following formula:
[0075] wherein, represents the new gray value corresponding to the gray level after gray mapping, is a representation of the gray level of the image, its value range is usually 0 to 255 (for 8-bit images). is the total number of image gray levels, here , corresponds 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 defect-to-background contrast caused by uneven illumination at 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 excessive enhancement leading to obvious noise) that may be caused by too large standard deviation (gray distribution is too dispersed and uneven), so that the processed image is in a suitable state for defect detection in terms of gray distribution.
[0076] In order to adapt to different sizes of defects on the sucker rod surface, 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 is 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.
[0077] The NonLocalBlock module is embedded to strengthen the feature weight of the defect area. First, the attention coefficient matrix is calculated:
[0078] 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), represents the number of channels, is a normalization function, and C is the number of channels of the feature map, then the attention-enhanced output feature map and are obtained through wherein and are 1x1 convolution operations. This process can make the model focus on the defect area and reduce background interference.
[0079] Global pooling (global average pooling) is performed on the attention-enhanced feature map , and the three-dimensional spatial feature Compression into a one-dimensional vector eliminates spatial dimensional information while retaining the semantic features of the defect (such as "crack directionality" and "corrosion pit density"), resulting in... A 256-dimensional vector is mapped from a pooled vector to a 256-dimensional vector through a fully connected layer. This ensures that its dimensions are consistent and can be efficiently integrated into cross-modal fusion vectors.
[0080] Supplementing visual features at the bottom of the layer, extracting morphological and textural features of defects, and helping to distinguish different types of defects; Morphological characteristics include perimeter, area, and roundness; Defect perimeter: The total number of pixels (in pixels) at the edge of the defect area, reflecting the extent of the defect; area The total number of pixels (in pixels) within the defect area reflects the size of the defect; Circularity The formula is as follows:
[0081] in, Take 3.14, The defect area is... The perimeter of the defect; the defect shape is quantified by a circle. The closer the value is to 1, the closer the defect is to a circle, used to distinguish spalling ( (irregular shape but close to circular) and cracks ( (linear extension form).
[0082] Texture features, texture entropy formula:
[0083] in, This is the number of LBP (Local Binary Pattern) sampling neighbors (value 8); It is the first The probability of LBP mode occurring; It is texture entropy (the larger the value, the more chaotic the texture). Texture entropy quantifies the texture complexity of defective areas and is used to distinguish erosion. The surface texture is messy, while other defects (cracks, peeling textures are relatively regular) form the underlying feature vector. .
[0084] 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: formula:
[0085] wherein, is the acoustic channel divergence (dimensionless, threshold value ) calculated in step S3, reflecting the difference in reflection of acoustic waves by the defect; is the electrical channel divergence (dimensionless, threshold value ) calculated in step S3, reflecting the difference in interference of electromagnetic field by the defect; is the neighborhood divergence mean (dimensionless, threshold value ) calculated in step S3, reflecting the spatial continuity of the defect; is the L2 norm of the k-th and k-1-th detection signals (dimensionless, threshold value ) 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" "corrosion point density"); fusion vector The total dimension is 136, covering acoustic, electrical, and visual multi-dimensional features, avoiding misjudgment of complex defects (such as "corrosion + scratch" superimposed defects) by a single modality.
[0086] 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 surface defect type of the sucker rod is output; Surface defect recognition model architecture: An XGBoost classifier is used, with the input layer being the fusion vector (136 dimensions), passing through 3 fully connected layers (node numbers are 256, 128, and 64 respectively, and the activation function is ReLU), and the output layer has 3 neurons, corresponding to the probability distribution of the three types of defects: cracks, corrosion, and peeling.
[0087] The mixed supervision training is as follows: A 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 a prediction confidence greater than or equal to 0.9 are considered reliable samples, and the samples with a prediction confidence between 0.7 and 0.9 are considered uncertain samples.
[0088] The student model is trained through a joint loss function:
[0089] 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 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. When This indicates that the cross-entropy loss of labeled samples accounts for 30% of the total loss, while the loss of pseudo-labeled samples accounts for 70% of the total loss. This training method is typically used in semi-supervised learning, where the model is trained using a small amount of labeled data and a large amount of unlabeled data.
[0090] 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 class defects, when It is a crack. For corrosion, For peeling.
[0091] The output layer uses the Softmax function to calculate the probability value for each category, i.e.:
[0092] in, The original output value of the j-th neuron (or output node), where e is the natural constant and k is the loop variable for the summation operation. It is the original output value of the k-th neuron; Specifically, the defect type is determined using the following formula:
[0093] 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. and Find the corresponding probability among these three possible defect types. The biggest one The value corresponding to the defect type is the defect type we infer. The confidence level is calculated as follows:
[0094] The confidence level is calculated as follows:
[0095] wherein, represents the confidence level, i.e., the reliability of the determined defect type, which means that after calculating all The maximum value is taken as the confidence level.
[0096] The output layer outputs the defect type determination result in the form of "Type = 2 (corrosion), and the confidence level.
[0097] In this step, 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 surface defect type of the sucker rod is output; by using the fusion vector constructed in the foregoing, the trained model is used to accurately identify the defect type on the surface of the sucker rod, which provides a key basis for finally formulating a targeted decision.
[0098] Step S6: Constructing a sucker rod defect knowledge graph, collecting oil well internal environment data, combining the sucker rod surface defect type and the oil well internal data, and matching the sucker rod defect knowledge graph through cosine similarity and Euclidean distance algorithm to obtain the origin of the sucker rod defect.
[0099] The construction of the sucker rod defect knowledge graph is as follows: First, the graph architecture design is performed, and the core entity types in the knowledge graph are determined, including the sucker rod surface defect type, the well internal environment data, the sucker rod material information, the well site working condition information, etc.
[0100] 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.
[0101] Knowledge extraction and input: relevant knowledge is extracted from historical sucker rod defect detection records, repair reports, well site production data, etc. The extracted sucker rod surface defect type, corresponding well internal environment data (such as sand content of well fluid, 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. information is input according to the designed graph architecture.
[0102] The atlas storage and management adopts a graph database (such as Neo4j) to store the constructed sucker rod defect knowledge graph, ensures efficient query and retrieval of data, and establishes a data updating mechanism to update the knowledge graph in a timely manner when new data is obtained.
[0103] The defect origin inference rules of the sucker rod defect knowledge graph are divided into 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, the corresponding defect origin inference rules are selected for application. The similar cases in the rules come from the knowledge graph containing historical data. The crack defect origin inference rules are as follows: Manufacturing process correlation rules: if the cracks in the similar cases exhibit 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 during forging / rolling", and the production batch process parameters of the current sucker rod match these cases with a matching degree of ≥75%, then it is inferred that the crack origin is the residual stress of the manufacturing process.
[0104] Fatigue stress correlation rules: when the cracks in the similar cases "linearly increase in length with the increase of pumping times, and there are multiple source expansion signs at the crack tip", 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 cases by ≤10%, then it is inferred that the crack origin is fatigue damage under alternating load.
[0105] The corrosion defect origin inference rules are as follows: Medium corrosion rules: if the similar cases are in an oil well environment with "Cl concentration ≥500mg / L, HS partial pressure ≥0.05MPa", and the corrosion defects exhibit the characteristics of "dense pitting corrosion pits, and black corrosion products at the pit bottom", and the medium detection data of the current sucker rod service environment match the case environment with a matching degree of ≥85%, then it is inferred that the corrosion origin is the chemical corrosion of the oil well medium.
[0106] Electrochemical corrosion rules: when the corrosion area in the similar cases "has obvious anodic and cathodic 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 "coating damage induced galvanic corrosion" in the cases, then it is inferred that the corrosion origin is electrochemical corrosion.
[0107] The spalling defect origin inference rules are as follows: Coating failure rules: If the peeling area of similar cases has "bubbles at the coating-substrate interface, and the thickness deviation of the peeling layer is ≤10% of the designed coating thickness", and more than 70% of the cases are caused by "inadequate substrate pretreatment (such as oil residue, roughness Ra <1.6 μm) during coating spraying", and the current pumping rod coating pretreatment process record does not match these cases by >20%, then it is concluded that the peeling origin is the coating pretreatment process defect.
[0108] Mechanical impact rules: When the peeling of similar cases "presents irregular fragments, and there are obvious mechanical scratches (scratch depth ≥0.5 mm) around", and the pumping rod has been subjected to "stuck drill pipe during tripping, collision (verified by operation log)", and there are similar impact operation records in the current pumping rod operation log, then it is concluded that the peeling origin is mechanical impact damage.
[0109] Well site sensor data collection is as follows: By installing sand content sensors based on optical or mechanical principles at the wellhead, real-time measurement of sand content in well fluid is achieved. The sensor counts sand particles through light scattering or mechanical blocking principle, thus obtaining sand content data; pH value sensors based on glass electrode or ion-selective electrode principle are installed on the pipeline through which well fluid flows to measure the acidity and alkalinity of well fluid. The sensor determines the pH value by measuring the concentration of hydrogen ions; Thermocouple or thermistor temperature sensors are installed on the pumping 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; Strain gauge or piezoelectric sensors are installed at the connection points of the pumping rod to measure the load changes of the pumping rod during operation. Strain gauges reflect the load by measuring metal strain, and piezoelectric sensors use the principle that piezoelectric materials generate electric charge when stressed.
[0110] The current detected pumping rod surface defect type and well environment data are integrated to form a data sample to be analyzed.
[0111] For the data sample to be analyzed, the cosine similarity and Euclidean distance between it and the existing data records in the pumping rod defect knowledge graph are calculated respectively.
[0112] The cosine similarity calculation formula is:
[0113] where A and B represent the data sample vector to be analyzed and the data record vector in the knowledge graph, denotes 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.
[0114] The Euclidean distance calculation formula is:
[0115] wherein, and are the i-th elements of vectors A and B, and n is the vector dimension.
[0116] According to the actual application scenario, the weights of the cosine similarity and the Euclidean distance in the comprehensive similarity calculation are determined. For example, the cosine similarity weight is set to , the Euclidean distance weight is set to , and the comprehensive similarity is calculated according to the following formula:
[0117] wherein, represents the comprehensive similarity, which is a similarity value obtained by comprehensively considering the cosine similarity and the Euclidean distance, and are the weights of the cosine similarity and the Euclidean distance in the comprehensive similarity calculation.
[0118] According to the comprehensive similarity value , the top 5 similar cases in the sucker rod defect knowledge graph are screened out, and the defect origin records of the screened similar cases are analyzed, combined with the predefined defect origin inference rules in the knowledge graph.
[0119] For example, it is currently detected that there is a corrosion defect on the surface of the sucker rod, 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 age is 3 years. These data are integrated into the data sample to be analyzed, and the similarity is calculated with the cases in the knowledge graph to screen out the top 5 similar cases.
[0120] Origin inference, among the screened similar cases (top 5), 3 cases have the defect type of corrosion, the sand content of the well fluid is between 0.5%-0.7%, the pH value is between 3.5-4.5, the material is 20CrNiMo or similar material, and the 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”.
[0121] The decision is as follows: 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.
[0122] For example, for corrosion defects, if the origin is "sand-containing corrosion + acid corrosion", and the corrosion area accounts for more than 20% of the surface area of the sucker rod, it is determined as a serious defect.
[0123] According to the severity of the defect, a corresponding decision scheme is made.
[0124] High-risk decisions (serious defects) are as follows: Such as immediately stopping the machine and replacing the sucker rod, selecting a sucker rod material with higher corrosion resistance and abrasion resistance (such as 35CrMoA), and conducting comprehensive detection on the same batch of sucker rods.
[0125] Medium-risk decisions (moderate defects) are as follows: For example, targeted repair measures are adopted, such as hot spraying repair of the corrosion site and installation of real-time monitoring devices, and the monitoring cycle is shortened (such as from once a month to once a week).
[0126] Low-risk decisions (mild defects) are as follows: For example, adjust the working parameters of the sucker rod (such as reduce the pumping speed), check and repair the defect site during the next planned maintenance, and strengthen daily inspection before maintenance.
[0127] 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 entire process and guarantees the normal operation of the sucker rod.
[0128] 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. This 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 sucker rods in oil extraction, and has broad application prospects in the field of oil extraction, and is expected to significantly improve the economic benefit and safety of oil extraction.
[0129] It has to be noted that, in the present document, the terms "first", "second", etc. merely serve to identify different entities or actions and do not necessarily require or imply any actual relationship or order between these entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. In other words, without further restriction, reference to elements will not, without more limitations, exclude additional, unrecited elements of a process, method, article, or apparatus.
[0130] While embodiments of the application have been shown and described, it is to be understood that the application is not limited to the details of the embodiments described, since numerous modifications and changes can be made to the embodiments without departing from the spirit and scope of the application as 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 are 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-province, when and When the acoustic channel and electrical channel simultaneously exhibit strong divergence relative to their respective baselines, this location is marked as a candidate defect point. Neighborhood consistency is considered, taking into account potential local interference factors in the aluminum-clad steel strip, and the neighborhood around the candidate defect point is considered. 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 a defect 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 This indicates 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 patterns occurring; It is texture entropy, which quantifies the texture complexity of defective regions, used to distinguish erosion from other defects, and forms 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; The L2 norm of the k-th and k1-th detection signals calculated in step S3 reflects 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 its 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 with at least 50 pixel-level labeled images until it converges. The teacher model makes predictions on unlabeled images, and samples with a prediction confidence of 0.9 or higher are considered reliable samples, while those with a confidence of 0.7 or 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=2, 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, Construct 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
Online defect detection system and method for carbon fiber sucker rod
CN118429335A
Pipeline repairing method and system based on defect detection
CN119295042A
Petroleum pipeline inner wall defect detection system
CN120468291A
Joint denoising method and system based on multi-source noise suppression and sparse representation
CN120761518A
Defect identification and positioning method
CN120807633A