A method for analyzing the working condition of oil pumping units based on video monitoring and identification based on posture estimation

Through the video surveillance recognition method based on attitude estimation, the YOLO-Pose model and the reconstruction learning criterion are used to analyze the operating conditions of the pumping unit, which solves the problem that traditional methods cannot directly analyze the operating conditions of the pumping unit through video surveillance, and achieves high efficiency. , low-cost working condition analysis and optimization guidance.

CN118366104BActive Publication Date: 2024-09-13CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410791030.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-13
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

The traditional motion analysis method cannot directly analyze the working conditions of the pumping unit through video surveillance data. It requires additional costs to arrange a dynamometer for detection, and cannot achieve real-time and efficient working condition analysis.

Method used

Using the video surveillance recognition method based on attitude estimation, through the YOLO-Pose model and the reconstruction learning criterion for the key point detection task of the oil pumping unit, the characteristics of the pumping unit's moving pictures are extracted and analyzed, and the key point positions and motion states are identified to achieve Real-time analysis of pumping unit operating conditions.

Benefits of technology

It realizes structured processing of video data, enriches on-site monitoring methods, reduces costs, improves analysis accuracy, and can quickly analyze the movement patterns of pumping unit suspension points, save manpower and time, and guide oilfield production optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118366104B
    Figure CN118366104B
Patent Text Reader

Abstract

The present invention provides a method for analyzing the working condition of an oil pumping unit by video monitoring based on posture estimation, which belongs to the field of petroleum engineering and includes the following steps: Step 1, formulate a key point labeling scheme for the oil pumping unit, collect the working video data of the oil pumping unit, and construct an input sample set; Step 2, construct a posture estimation YOLO-Pose model; Step 3, reconstruct the learning criteria for the key point detection task characteristics of the oil pumping unit, and construct a key point loss function under the reconstructed learning criteria for model training to obtain a trained model; Step 4, use the trained model to perform inference prediction to obtain the specified key point trajectory of the oil pumping unit in the video, calculate the motion parameters of different key points, and analyze a series of working conditions of the on-site oil pumping unit. Compared with the traditional sensor extraction method, the present invention can identify the motion state of the oil pumping unit production from the video data, and improve the economic benefits of obtaining the working condition information of the oil pumping unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of petroleum engineering, and in particular relates to a video monitoring recognition and analysis method for an oil pumping unit operating condition based on posture estimation. Background Art

[0002] The rod pump system is the main tool for oilfield development, and its system working status needs to be analyzed in real time to understand the on-site production status. The motion law of the rod pump system is an important factor in characterizing the working condition of the pumping unit, and it has important guiding significance for formulating production optimization plans and judging whether the equipment needs to be operated and maintained. The traditional motion analysis method relies on the dynamometer to obtain the bare rod motion data. It is impossible to directly analyze the working condition of the pumping unit through video monitoring data, so it costs extra cost to arrange the dynamometer for detection. Summary of the invention

[0003] In order to overcome the defects of the prior art, the present invention provides a method for analyzing the working condition of an oil pump by video monitoring and identifying an oil pump based on posture estimation. First, the operation monitoring video of the oil pump at the oil field site is collected, and then the training and test data sets of the posture estimation algorithm are obtained by slicing the original video data and marking the key points. The YOLO-Pose posture estimation model and the model learning criteria reconstructed for the oil pump key point detection task are used to extract the features of the oil pump motion picture and identify the key point positions, and the working condition of the oil pump is determined by analyzing the motion states of key points such as suspension points.

[0004] The technical solution of the present invention is as follows:

[0005] A method for analyzing the working condition of an oil pumping unit by video monitoring and identifying the working condition of the oil pumping unit based on posture estimation specifically comprises the following steps:

[0006] Step 1: Develop a key point marking scheme for the oil pumping unit, collect working video data of the oil pumping unit, and construct an input sample set;

[0007] Step 2: Build a posture estimation YOLO-Pose model;

[0008] Step 3: Reconstruct the learning criteria according to the key point detection task characteristics of the oil pumping unit, and construct the key point loss function under the reconstructed learning criteria to perform model training, so as to obtain a trained model;

[0009] Step 4: Use the trained model to perform inference and prediction to obtain the specified key point trajectory of the oil pump in the video, calculate the motion parameters of different key points, and analyze the series of working conditions of the oil pump on site.

[0010] Furthermore, the specific process of step 1 is as follows:

[0011] Step 1.1, the pumping unit is a conventional beam pumping unit; the formulated pumping unit key point marking scheme is: according to the four-bar linkage mechanism of the pumping unit, 10 pumping unit key points are determined, which are composed of 1 suspension point, 3 donkey head points, 2 beam points and 4 crank points;

[0012] Step 1.2, collecting working video data of the oil pumping unit through a video monitoring platform or on-site video recording;

[0013] Step 1.3, label the working video data set according to the key point labeling scheme of the pumping unit;

[0014] Step 1.4: Define the labeled data set as the original sample set, convert the format of the original sample set, establish the original label category mapping, and obtain the input sample set that meets the input format requirements after the mapping is completed. , with a ratio of 8:2. Divide into training set and test set .

[0015] Furthermore, in step 2, the constructed posture estimation YOLO-Pose model includes three parts: backbone network, neck network and head network. The specific working process is as follows:

[0016] Step 2.1, input the pumping unit image with a scale of 640×640×3 into the backbone network, use the Focus structure to perform a slicing operation to generate a 320×320×32 feature map, and then generate four feature images of different scales through the CSPDarkNet structure;

[0017] Step 2.2: Input the feature maps of four different scales into the neck network, and use PANet to fuse the multi-scale information to enhance the semantic information and multi-scale receptive field of the feature maps;

[0018] Step 2.3: Send the fused features to the head network for detection. The head network includes two independent detection heads for jointly predicting the prediction vector of the key point detection task of the pumping unit. , The form is as follows:

[0019] ;

[0020] in, The horizontal coordinate of the center point of the prediction frame of the pumping unit; The vertical coordinate of the center point of the prediction frame of the pumping unit; is the width of the prediction box for the pumping unit; The height of the prediction box for the pumping unit; is the confidence score of the prediction box of the pumping unit; is the class confidence score; is the horizontal coordinate of the first key point; is the ordinate of the first key point; is the confidence score of the first key point; For the The horizontal coordinate of the key point; For the The vertical coordinate of the key point; For the The confidence score of each key point.

[0021] Furthermore, the specific process of step 3 is as follows:

[0022] Step 3.1, select the general dataset MS COCO for model pre-training, initialize the training and model hyperparameters, including the batch size of each training data, the number of training epochs, and the initial learning rate;

[0023] Step 3.2: Construct the key point loss function based on the OKS indicator and reconstruction learning criterion;

[0024] The calculation formula of the OKS indicator is as follows:

[0025] ;

[0026] in, For the OKS indicators of each pumping unit; is the key point number of the pumping unit, Indicates the total number of key points; is an exponential function with base e; For the Pumping unit The Euclidean distance between the actual value and the predicted value of each key point; For the The scale factor of each pumping unit; For the Pumping unit The standard deviation of the key points; Indicates The first pumping unit Is the key point visible? is the Kronecker function, and its expression is as follows:

[0027] ;

[0028] Loss function of key points of pumping unit under reconstruction learning criterion The calculation formula is as follows:

[0029] ;

[0030] Step 3.3: Use the training set Perform model training, perform backpropagation to update model parameters and cycle again until the set epoch is reached, and output the trained model.

[0031] Furthermore, the specific process of step 4 is as follows:

[0032] Step 4.1: Test set Input the trained model to obtain the prediction result, which is the posture information of the oil pumping unit. The posture information of the oil pumping unit specifically includes the position information of each key point of the oil pumping unit and the connection lines between the key points;

[0033] Step 4.2, perform a balance analysis of the pumping unit according to the defined principle; the defined principle is: under balanced conditions, the time taken for the upstroke and downstroke is substantially equal; if the upstroke time > the downstroke time, it indicates insufficient balance; if the upstroke time < the downstroke time, it indicates excessive balance;

[0034] Step 4.3: According to the change of each key point over the video time, obtain the motion trajectory curve of each key point, that is, the displacement curve; according to the displacement curve and multi-order difference calculation, realize the working condition diagnosis of the on-site pumping unit.

[0035] Furthermore, the specific process of step 4.3 is as follows:

[0036] Step 4.3.1, convert the actual key point trajectory of the pumping unit by setting the ratio; according to the current frame rate of the video and the ratio of imaging pixels to actual units , calculate the actual displacement of the key points of the current pumping unit Corresponding to actual time , the calculation formula is:

[0037] ;

[0038] ;

[0039] in, represents the original model output displacement, Indicates the frame number;

[0040] Step 4.3.2: Calculate the velocity and acceleration of the key points of the pumping unit by first-order difference and second-order difference. The calculation formula is:

[0041] ;

[0042] ;

[0043] in, Indicates the key point speed; Indicates the acceleration of key points;

[0044] Step 4.3.3: Perform a preliminary diagnosis of the working condition based on the displacement curve characteristics, velocity and acceleration.

[0045] The beneficial technical effects brought about by the present invention are as follows.

[0046] The video monitoring pumping unit working condition analysis method based on the YOLO-Pose model of the present invention structures the video data. Compared with the traditional video monitoring method, it can enrich the on-site monitoring means and realize the in-depth application of video monitoring information. At the same time, it has low cost and high accuracy. At the same time, the network can also be used to detect the balance of the pumping unit and related pump working conditions. For on-site monitoring and evaluation of the pumping unit status in oil fields, the present invention has important guiding significance for optimizing the on-site operation plan of the pumping unit.

[0047] Through the improved learning criteria, the key point detection task of the oil pump can be better targeted and the prediction accuracy of the model for the key point position of the oil pump can be improved.

[0048] Video data can be used to draw the complete motion trajectory of the pumping unit suspension point, and obtain the changes in the pumping unit displacement, speed and acceleration to meet the analysis needs of actual operating conditions.

[0049] The trained YOLO-Pose model can quickly analyze the motion law of the pumping unit suspension point displayed in the monitoring screen, eliminating the manual calculation process of the monitoring personnel, providing important guidance for the analysis of the pumping unit working conditions, greatly saving manpower and time costs, and also has important guiding significance for the deployment of well repair operation plans. At the same time, it can also be used to analyze the motion of other parts of the pumping unit equipment during the oil field production stage, which has great promotion and application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a flow chart of the method for analyzing the working condition of an oil pumping unit by video monitoring and identifying the working condition of the oil pumping unit based on posture estimation of the present invention.

[0051] Figure 2 It is a schematic diagram of the distribution marking scheme for 10 key points of a beam pumping unit according to the present invention.

[0052] Figure 3 It is a network structure diagram of the posture estimation YOLO-Pose model of the present invention.

[0053] Figure 4 It is the prediction result of the posture estimation YOLO-Pose algorithm under the general learning criterion in the embodiment of the present invention.

[0054] Figure 5 It is the prediction result of the posture estimation YOLO-Pose algorithm under the reconstruction learning criterion in the embodiment of the present invention.

[0055] Figure 6 Schematic diagram of actual suspension point displacement obtained based on the posture estimation YOLO-Pose model in an embodiment of the present invention.

[0056] Figure 7 yes Figure 6 Schematic diagram of the actual suspension point displacement obtained by the pose estimation YOLO-Pose model when the scale is set to 1:68 and the acquisition video frame rate is 15fps.

[0057] Figure 8 yes Figure 7 Schematic diagram of the actual suspension point velocity on the foundation.

[0058] Fig. 9 yes Figure 7 Schematic diagram of actual suspension point acceleration on the foundation.

[0059] Fig.10 It is a schematic diagram of the oil pumping unit operating in a balanced state in an embodiment of the present invention.

[0060] Fig.11 It is a schematic diagram of an oil pumping unit operating in an underbalanced state in an embodiment of the present invention.

[0061] Fig.12 It is a schematic diagram of the oil pumping unit operating in an overbalanced state in an embodiment of the present invention.

[0062] Fig.13 It is a schematic diagram of the pump not being fully filled due to insufficient liquid supply to the oil pumping unit in an embodiment of the present invention.

[0063] Fig.14 Schematic diagram of the effect of gas in the oil well pump according to an embodiment of the present invention.

[0064] Fig.15 Schematic diagram of the suction part leakage of the oil pump in the embodiment of the present invention.

[0065] Fig.16 It is a schematic diagram showing leakage in the exclusion part of the oil pump in the embodiment of the present invention. DETAILED DESCRIPTION

[0066] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0067] As one of the tasks of computer vision technology, posture estimation can identify the skeletal structure of people or objects in the video screen and extract key point motion information. The present invention uses computer vision technology to promote the intelligent application of oilfield data. Video monitoring is combined with computer vision technology to make full use of the monitoring data at the oilfield site for intelligent analysis, and can realize digital intelligent management of oilfield security, early warning, production and other aspects. When analyzing the working state of the rod pump system, it is necessary to obtain the motion law of its suspension point, and the posture estimation technology in computer vision can locate the key points of the pump in the video and obtain its motion curve. From the perspective of video monitoring, the task of posture estimation technology is consistent with the analysis of the motion law of the pump.

[0068] A monitoring platform center for oil pumping units is established at the oil field production site to rationally manage oil field production. The working condition of the oil pumping units is an important factor in oil field production efficiency. By analyzing the working condition of the oil field oil pumping units through the video monitoring platform, the state of the oil pumping units can be monitored and evaluated in a timely manner, thereby optimizing the operation strategy and improving production efficiency. By rationally establishing a key node model for the operation of the oil pumping units and using posture estimation technology, the motion law of the oil pumping unit suspension point can be obtained from the image, thereby realizing motion analysis. Therefore, the method of the present invention can be used to analyze the working condition of the on-site oil pumping units through video monitoring and realize intelligent operation monitoring.

[0069] like Figure 1 As shown, the present invention proposes a method for analyzing the working condition of an oil pumping unit by video monitoring based on posture estimation, and the specific steps are as follows:

[0070] Step 1: Develop a key point marking scheme for the oil pumping unit, collect the working video data of the oil pumping unit, and construct an input sample set; the specific process is as follows:

[0071] Step 1.1, the pumping unit is a conventional walking beam pumping unit; the formulated pumping unit key point marking scheme is: according to the four-bar linkage mechanism of the pumping unit, 10 pumping unit key points are determined, which are composed of 1 suspension point, 3 donkey head points, 2 walking beam points and 4 crank points; the pumping unit key points are the key motion nodes of the pumping unit;

[0072] Step 1.2, collecting working video data of the oil pumping unit through a video monitoring platform or on-site video recording;

[0073] Step 1.3, annotate the working video data according to the key point annotation scheme of the oil pumping unit; the 10 key points of the oil pumping unit are represented by vectors: [hang_1, head_2, head_3, head_4, beam_5, beam_6, crank_7, crank_8, crank_9, crank_10], where hang_1 is the hanging point 1; head_2, head_3, head_4 are donkey head point 2, donkey head point 3, donkey head point 4 respectively; beam_5, beam_6 are walking beam point 5, walking beam point 6 respectively; crank_7, crank_8, crank_9, crank_10 are crank point 7, crank point 8, crank point 9, crank point 10 respectively. Figure 2 It is a schematic diagram of the distribution marking scheme for 10 key points of a beam pumping unit according to the present invention. Figure 2 Among them, ① is the suspension point 1; ②, ③, ④ are the donkey head point 2, donkey head point 3, donkey head point 4 respectively; ⑤, ⑥ are the walking beam point 5, walking beam point 6 respectively; ⑦, ⑧, ⑨, ⑩ are the crank point 7, crank point 8, crank point 9, crank point 10 respectively.

[0074] Step 1.4: Define the labeled data set as the original sample set. In order to meet the algorithm input format, perform format conversion and establish the original label category mapping. After the mapping is completed, obtain the input sample set that meets the input format requirements. , with a ratio of 8:2. Divide into training set and test set .

[0075] Step 2: Build a posture estimation YOLO-Pose model;

[0076] The constructed posture estimation YOLO-Pose model consists of three parts: backbone network, neck network and head network. The overall network structure of the model is as follows: Figure 3As shown in the figure. The backbone network is the input layer of the model. The initial image P0 with a pixel size of 640×640 is subjected to three-channel separation and Focus slicing operations to obtain P1. P1 is convolved once to obtain P2. P2 uses the CSPDarkNet (Cross Stage Partial DarkNet) structure to generate feature images of different scales [P3, P4, P5, P6] in sequence. The pixels of P3 are 80×80, the pixels of P4 are 40×40, the pixels of P5 are 20×20, and the pixels of P6 are 10×10. The neck network is the feature extraction layer. Based on the PANet network, two feature extraction strategies, top-down and bottom-up, are used for feature fusion. The feature maps of different layers are first upsampled and fused from top to bottom, and then downsampled and enhanced from bottom to top for each layer. The head network is the output layer, which couples four detection heads, namely detection head 1, detection head 2, detection head 3, and detection head 4. Each head includes two branches, namely the bounding box detection head and the key point detection head. The bounding box detection head is used to output the target position in the image, and the key point detection head is used to output the key point information in the image.

[0077] The working process of the posture estimation YOLO-Pose model is:

[0078] Step 2.1, input the pumping unit image of scale 640×640×3 into the backbone network, where 640×640 is the pixel value and 3 is the number of channels. Use the Focus structure to perform a slicing operation to generate a 320×320×32 feature map, and then use the CSPDarkNet structure to generate four feature images of different scales [P3, P4, P5, P6]; Focus slices the input image using the neighboring downsampling method and finally outputs the feature map through a convolution operation; The CSPDarkNet structure divides the feature map output by the convolution layer into two parts for parallel processing, one part continues to perform the convolution operation, and the other part is fused with the feature map after the convolution operation of the previous part to achieve rapid dimensionality reduction and reduce feature duplication;

[0079] Step 2.2: Input the feature maps of four different scales into the neck network, and use PANet to fuse the multi-scale information to enhance the semantic information and multi-scale receptive field of the feature map; PANet (Path Aggregation Network) is a neural network for feature fusion, which adopts a top-down and bottom-up bidirectional feature fusion strategy to ensure the diversity and integrity of features;

[0080] Step 2.3: Send the fused features to the head network for detection. The head network includes two independent detection heads for jointly predicting the prediction vector of the key point detection task of the pumping unit. , Including the bounding box coordinates, class score and confidence score of the pumping unit; define 10 key points of the pumping unit, each key point has a corresponding position and confidence score , is the horizontal coordinate of the key point, is the vertical coordinate of the key point, is the confidence score, then The form is:

[0081] (1);

[0082] in, The horizontal coordinate of the center point of the prediction frame of the pumping unit; The vertical coordinate of the center point of the prediction frame of the pumping unit; is the width of the prediction box for the pumping unit; The height of the prediction box for the pumping unit; is the confidence score of the prediction box of the pumping unit; is the class confidence score; is the horizontal coordinate of the first key point; is the ordinate of the first key point; is the confidence score of the first key point; For the The horizontal coordinate of the key point; For the The vertical coordinate of the key point; For the The confidence score of each key point; The bounding box detection head is responsible for the prediction, while the remaining parts are predicted by the keypoint detection head.

[0083] Step 3: Reconstruct the learning criteria according to the key point detection task characteristics of the oil pumping unit, and construct the key point loss function under the reconstructed learning criteria to train the model, and obtain the trained model; the specific process is as follows:

[0084] Step 3.1, select the general dataset MS COCO for model pre-training, initialize the training and model hyperparameters, including the batch size of each training data, the number of training epochs, the initial learning rate, etc.;

[0085] Step 3.2: Construct the key point loss function based on the OKS indicator and reconstruction learning criterion;

[0086] According to the OKS indicator, the key point loss function is defined as the training target of the algorithm to reduce the difference between the model prediction value and the true value; the calculation formula of the OKS indicator is as follows:

[0087] (2);

[0088] in, For the OKS indicators of each pumping unit; is the key point number of the pumping unit, Indicates the total number of key points; is an exponential function with base e; For the Pumping unit The Euclidean distance between the actual key point and the predicted key point; For the The scale factor of a pumping unit is the square root of the area occupied by the pumping unit in the labeled image. For the Pumping unit The standard deviation of key points indicates the error of the same key point when annotating different images; Indicates The first pumping unit Is the key point visible? is the Kronecker function, which is used to select the visible key points for Calculation, the expression is as follows:

[0089] (3);

[0090] in, Indicates The first pumping unit The key point is visible, at this time The value is 1; Indicates The first pumping unit The key point is invisible. The value is 0;

[0091] The model learning criteria and loss function are set according to the OKS indicator. The network obtains the optimal prediction model by minimizing the loss and back-propagating. Under the general detection task, the key point prediction loss is calculated according to the following formula:

[0092] (4);

[0093] in, Predict loss values ​​for key points;

[0094] The rigid connection of the pumping unit and the change in the size of the target in the image make the loss result vary greatly when directly using formula (4) for key point detection tasks. This causes the prediction results of some key points of the pumping unit to drift. The normalization calculation method of the Lipschitz condition is used to narrow this gap. To replace the formula (4) The normalized form makes the loss function meet the 1-Lipschitz condition in the positive real number space; at the same time, the coefficient of formula (4) is adjusted to further reduce the influence of the scale factor. Under the reconstruction learning criterion, the calculation formula of the loss function of the key points of the pumping unit is as follows:

[0095] (5);

[0096] Step 3.3: Use the training set Perform model training, perform backpropagation to update model parameters and cycle again until the set epoch is reached, and output the trained model.

[0097] Step 4: Use the trained model to test the set Inference prediction is performed to obtain the specified key point trajectory of the pumping unit in the video, the motion parameters of different key points are calculated, and a series of working conditions of the pumping unit on site are analyzed; the specific steps are:

[0098] Step 4.1: Test set The trained model is input to obtain the prediction result, which is the posture information of the pumping unit. The posture information of the pumping unit specifically includes the position information of each key point of the pumping unit and the connecting lines between the key points. The prediction result is used to analyze the displacement, velocity and acceleration of the pumping unit.

[0099] Step 4.2, perform a balance analysis of the pumping unit according to the defined principle; the defined principle is: under balanced conditions, the time taken for the upstroke and downstroke is substantially equal; if the upstroke time is greater than the downstroke time, it indicates insufficient balance, i.e. underbalance; if the upstroke time is less than the downstroke time, it indicates excessive balance, i.e. overbalance;

[0100] Step 4.3: According to the change of each key point over the video time, obtain the motion trajectory curve of each key point, that is, the displacement curve, which is the relationship curve between the displacement of the key point and time. According to the displacement curve and multi-order difference calculation, the working condition diagnosis of the on-site pumping unit is realized.

[0101] In the present invention, a total of 10 key points of the oil pump are included, so the motion trajectory curves of the 10 key points are obtained, that is, the displacement curves of the 10 key points; the displacement curves of the oil pump under different working conditions are used to realize the pump working condition diagnosis of the on-site oil pump. The motion conditions of the suspension point and other points can reflect the working state of the oil pump system to a certain extent, and can provide a basis for the system working condition analysis. Among them, the suspension point displacement curve is taken as an example to illustrate the diagnostic process: the motion trajectory of the suspension point of the pumping unit will change accordingly under different working conditions. When the sinking degree of the pump is too small and the oil supply is insufficient, the liquid cannot fill the working cylinder, which hinders the reduction of the load of the suspension point downstroke and causes the slope of the second half of the suspension point curve to increase; if there is a gas effect, the slow loading caused by the expansion of the gas in the pump during the upstroke and the slow unloading caused by the compression of the gas during the downstroke cause the slopes of the first and second halves of the curve to increase; when the pump leaks when pumping liquid, due to the supporting effect of the leaking liquid, the suspension point slowly loads and unloads in advance during the upstroke, thereby changing the downstroke curve, otherwise it indicates that the pump leaks when discharging liquid. The motion trajectory of the suspension point of the pumping unit is output through the model to calculate its related motion parameters, which are used for preliminary judgment of certain working conditions of the rod pump system, such as underfilling and leakage.

[0102] The present invention obtains the motion law of the suspension point according to the passage of time of the key point, and calculates the motion parameters of different suspension points through multi-order differences; the specific process is:

[0103] Step 4.3.1, by setting the ratio to convert, obtain the actual suspension point trajectory of the key points of the pumping unit suspension rope, according to the current video imaging frame rate and the ratio of imaging pixels to actual units , calculate the actual displacement of the current pumping unit suspension point Corresponding to actual time , the calculation formula can be expressed as:

[0104] (6);

[0105] (7);

[0106] in, Represents the original model output displacement, in pixels (px); Indicates the frame number.

[0107] Step 4.3.2: Calculate the velocity and acceleration of the pumping unit suspension point by first-order difference and second-order difference. The calculation formula can be expressed as:

[0108] (8);

[0109] (9);

[0110] in, represents the suspension point speed; represents the suspension point acceleration.

[0111] Formula (6) to Formula (9) are general formulas, and other points can be calculated using the same calculation process as above.

[0112] Step 4.3.3: Based on the actual on-site engineering problems of different pumping units and the rules of different points of the pumping units, a preliminary diagnosis of pump leakage, insufficient filling and other working conditions is performed based on the characteristics of the displacement curve, speed and acceleration.

[0113] When applied online, the working video data of the oil field pumping unit in the current production area is obtained in real time, and then the trained posture estimation YOLO-Pose model is input to obtain the specified key point trajectory of the oil field pumping unit in real time. The motion parameters of different key points can be calculated according to formula (8)-formula (9), and then the series of working conditions of the on-site oil field pumping unit can be analyzed.

[0114] In order to demonstrate the feasibility and superiority of the present invention, the following examples are given.

[0115] The data in this embodiment is extracted from an oilfield monitoring platform in a production area. The collected samples are 1,000 pumping unit images, the actual pixel ratio to the image pixel is 1:68, and the collected video frame rate is 15fps, that is, , . In this embodiment, a labeling tool is used to mark the image according to the key point labeling scheme of the oil pump in step 1. The obtained image and the corresponding labeling document are then standardized with reference to the YOLO format, and finally the data set required for model training is formed. The data set is divided into a training set and a test set in a ratio of 8:2, which are used for model training and testing respectively. The pre-trained model used adopts the MS COCO project data set. Based on the above-mentioned initial data to be trained, the specific process of the method for analyzing the working condition of the oil pump from video monitoring based on the posture estimation algorithm of the present invention is as follows:

[0116] First, a training data set was prepared based on the video data of the oil pumping units collected in the production area. Figure 2The labeling rules shown use labeling tools to mark the key points of the pumping unit and map them in a standardized format; then, the MS COCO project dataset is used for model pre-training to obtain the parameters of the pre-trained model for formal training; then, the pixels of all pumping unit images are initialized to 640×640 to balance the training efficiency. In order to adapt to the problem of small batch samples, Stochastic Gradient Descent (SGD) is used as the optimizer of the model, the initial learning rate is set to 0.01, the network training rounds are set to 500, and the network learning criterion is the comprehensive OKS indicator; after the training is completed, the OKS loss is calculated according to the optimized learning criterion, and the network back propagation is performed to optimize the model parameters until the set rounds are reached; then, the trained model is used to perform inference prediction of the pumping unit operation video in a production area to obtain the specified key point trajectory of the pumping unit in the video.

[0117] In this embodiment, some prediction result images using the test set for prediction are as follows: Figure 4 and Figure 5 As shown, Figure 4 and Figure 5 This is a comparison of the key point information of the pumping unit in the image predicted by the YOLO-Pose algorithm based on the posture estimation under different learning criteria in the embodiment of the present invention. Figure 4 is the prediction effect under the general learning criterion; Figure 5 In order to reconstruct the prediction effect under the learning criterion, the black line is used to mark the pumping unit posture information in order to clearly distinguish the two motion trajectories. At the same time, the OKS index result is calculated. Figure 4 The value obtained under the general learning criterion is 0.6612. Figure 5 The value obtained under the reconstruction learning criterion is 0.8959, and the results show that the reconstruction learning criterion is very effective for the key point detection of the oil pump. Figure 5 It can be seen that the model can basically accurately predict the pumping unit posture information.

[0118] Finally, the motion law of the suspension point is obtained according to the change of the key points over time, and the motion parameters of different points are calculated through multi-order differences. Figure 6-Figure 9 The suspension point motion parameter curve of the oil pumping unit in this embodiment is shown; Figure 6 Schematic diagram of the suspension point displacement derived for the image; Figure 7 The diagram is a schematic diagram of the actual suspension point displacement curve of the pumping unit when the ratio is set to 1:68 and the frame rate of the collected video is 15fps; the velocity and acceleration curves obtained by formula (4) are Figure 8 and Fig. 9 .

[0119] In this embodiment, the different motion curves of the suspension point of the pumping unit under different working conditions can be used to analyze the series of working conditions of the on-site pumping unit. Figure 10-12 is the diagnostic diagram of the present invention for different pumping unit balance states, according to Figure 10-12 The balance diagnostic curve can be used to determine that the pumping unit in this example has good operating balance. Fig.10 is the equilibrium curve, Fig.11 is the underbalance curve, Fig.12 is the overbalance curve; Figure 10-12 middle, is the upstroke time, is the down stroke time.

[0120] In this embodiment, the suspension point trajectory under different pump working conditions is derived, and its characteristic diagnosis results are as follows: Figure 13-Figure 16 As shown, Fig.13 The pump cannot be fully filled due to insufficient liquid supply; Fig.14 The gas in the pump affects the pump. Fig.15 Indicates that the suction part of the pump is leaking; Fig.16 Because there is leakage in the exclusion part of the pump, the operating condition of the target oil pump can be analyzed by comparing the displacement curve characteristics extracted from the video.

[0121] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for analyzing the working condition of an oil pump based on video monitoring and identification based on posture estimation. It is characterized in that The specific steps include: Step 1: Develop a key point marking scheme for the oil pumping unit, collect working video data of the oil pumping unit, and construct an input sample set; Step 2: Build a posture estimation YOLO-Pose model; Step 3: Reconstruct the learning criteria according to the key point detection task characteristics of the oil pumping unit, and construct the key point loss function under the reconstructed learning criteria to perform model training to obtain a trained model; the specific process is as follows: Step 3.1, select the general dataset MS COCO for model pre-training, initialize the training and model hyperparameters, including the batch size of each training data, the number of training epochs, and the initial learning rate; Step 3.2: Construct the key point loss function based on the OKS indicator and reconstruction learning criterion; The calculation formula of the OKS indicator is as follows: Among them, OKS p is the OKS index of the pth pumping unit; i is the key point number of the pumping unit, N kpts represents the total number of key points; exp is the exponential function with e as the base; d pi is the Euclidean distance between the actual value and the predicted value of the i-th key point of the p-th pumping unit; S p is the scale factor of the pth pumping unit; σ pi is the standard deviation of the ith key point of the pth pumping unit; v pi Indicates whether the i-th key point of the p-th pumping unit is visible; δ is the Kronecker function, which is expressed as follows: Under the reconstruction learning criterion, the key point loss function L of the pumping unit is kpts The calculation formula is as follows: Step 3.3: Use training set X tr Perform model training, perform backpropagation to update model parameters and cycle again until the set epoch is reached, and output the trained model; Step 4: Use the trained model to perform inference prediction to obtain the specified key point trajectory of the pumping unit in the video, calculate the motion parameters of different key points, and analyze the series of working conditions of the pumping unit on site; the specific process is as follows: Step 4.1: Set the test set X te Input the trained model to obtain the prediction result, which is the posture information of the oil pumping unit. The posture information of the oil pumping unit specifically includes the position information of each key point of the oil pumping unit and the connection lines between the key points; Step 4.2, perform a balance analysis of the pumping unit according to the defined principle; the defined principle is: under balanced conditions, the time taken for the upstroke and downstroke is equal; if the upstroke time > the downstroke time, it indicates insufficient balance; if the upstroke time < the downstroke time, it indicates excessive balance; Step 4.3: According to the change of each key point over the video time, obtain the motion trajectory curve of each key point, that is, the displacement curve; realize the working condition diagnosis of the on-site pumping unit according to the displacement curve and multi-order difference calculation; the specific process is: Step 4.3.1, obtain the actual key point trajectory of the pumping unit by converting it by setting the ratio; calculate the actual displacement X of the key point of the current pumping unit according to the current video imaging frame rate f and the ratio μ of the imaging pixel to the actual unit key _ and the actual corresponding time t, the calculation formula is: Among them, X 0 represents the original model output displacement, t 0 Indicates the frame number; Step 4.3.2: Calculate the velocity and acceleration of the key points of the pumping unit by first-order difference and second-order difference. The calculation formula is: Among them, V key _ represents the key point speed; τ key _ represents the acceleration of the key point; Step 4.3.3: Perform a preliminary diagnosis of the working condition based on the displacement curve characteristics, velocity and acceleration.

2. According to the video monitoring recognition and analysis method of the pumping unit working condition based on posture estimation in claim 1, It is characterized in that The specific process of step 1 is as follows: Step 1.1, the pumping unit is a conventional beam pumping unit; the formulated pumping unit key point marking scheme is: according to the four-bar linkage mechanism of the pumping unit, 10 pumping unit key points are determined, which are composed of 1 suspension point, 3 donkey head points, 2 beam points and 4 crank points; Step 1.2, collecting working video data of the oil pumping unit through a video monitoring platform or on-site video recording; Step 1.3, label the working video data set according to the key point labeling scheme of the pumping unit; Step 1.4: Define the labeled data set as the original sample set, convert the format of the original sample set, establish the original label category mapping, obtain the input sample set X that meets the input format requirements after the mapping is completed, and divide the input sample set X into the training set X at a ratio of 8:

2. tr and the test set X te .

3. According to the video monitoring recognition and analysis method of the pumping unit working condition based on posture estimation in claim 2, It is characterized in that In step 2, the constructed posture estimation YOLO-Pose model includes three parts: backbone network, neck network and head network. The specific working process is as follows: Step 2.1, input the pumping unit image with a scale of 640×640×3 into the backbone network, use the Focus structure to perform a slicing operation to generate a 320×320×32 feature map, and then generate four feature images of different scales through the CSPDarkNet structure; Step 2.2: Input the feature maps of four different scales into the neck network, and use PANet to fuse the multi-scale information to enhance the semantic information and multi-scale receptive field of the feature maps; Step 2.3: Send the fused features to the head network for detection. The head network includes two independent detection heads for jointly predicting the prediction vector P of the key point detection task of the pumping unit. v , P v The form is as follows: Among them, C x is the horizontal coordinate of the center point of the prediction frame of the pumping unit; C y is the ordinate of the center point of the prediction box of the pumping unit; W is the width of the prediction box of the pumping unit; H is the height of the prediction box of the pumping unit; box conf is the confidence score of the prediction box of the pumping unit; class conf is the class confidence score; is the horizontal coordinate of the first key point; is the ordinate of the first key point; is the confidence score of the first key point; is the horizontal coordinate of the nth key point; is the ordinate of the nth key point; is the confidence score of the nth key point.

Citation Information

Patent Citations

  • Method for diagnosing abnormal working conditions of rod-pumped well based on indicator diagram characteristics

    CN112031748A

  • Multi-scale construction equipment robustness identification method in oil field underground operation environment

    CN118172714A

  • Mouse posture estimation method and system based on deep learning

    CN118196885A

  • Method and device for processing motion displacement of pumping unit

    WO2022268227A1