A method for analyzing the motion of an oil pump
Through video acquisition and image analysis technology, the problem of pumping engine operation flush analysis is solved, and the accurate analysis of the actual flushing of pumping engine and problem detection during flushing is realized, which improves the efficiency and safety of oil and gas mining.
Patent Information
- Application Number
- CN202210646652.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-09
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-06-09
AI Technical Summary
The prior art is difficult to accurately analyze the problems existing in the actual operation of the oil pump and the flushing process, which affects the efficiency and safety of oil and gas mining.
The video acquisition module is used to collect the oil pump equipped with characteristic marks, and the video analysis module is used to match image templates and analyze motion vectors, calculate the running flush of the oil pump and detect abnormal situations during the flushing process.
It realizes accurate analysis of the actual operation of the oil pump and problem detection during the operation of the oil pump, improving the efficiency and safety of oil and gas mining.
Smart Images

Figure CN115082822B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for analyzing the motion of an oil pumping unit. Background Art
[0002] The oil pump is an important ground driving equipment in the production process of oil and gas wells. Obtaining the operating status of the oil pump is an important part of oil and gas production, and is of great significance for analyzing the operating efficiency and safety of the oil pump and analyzing the downhole working conditions.
[0003] With the long-term development of oil and gas production areas, according to different well conditions, geology, environment and other factors, the types of pumping units used in production are diverse. In actual production, beam pumping units are mainly used. Beam pumping units can be divided into conventional, out-of-phase, front-end and special types. At present, the operating status of the pumping unit is usually controlled and obtained through the remote transmission and remote control module. Generally, the inverter operating frequency is set, and the pumping unit operation stroke is calculated according to the pumping unit transmission ratio. However, it is unknown whether the actual operation stroke of the pumping unit reaches the preset target or whether there are other problems in the process of pumping unit operation stroke. Therefore, a method is needed to analyze the actual operation stroke of the pumping unit and the problems existing in the operation process. Summary of the invention
[0004] In view of the above problems, the object of the present invention is to provide a method for analyzing the actual operating strokes of the pumping unit and analyzing the stroke operation of the pumping unit.
[0005] The technical solution for implementing the present invention is as follows
[0006] A method for analyzing the motion of an oil pumping unit comprises the following steps: Step 1: a video acquisition module performs video acquisition on an oil pumping unit equipped with a characteristic mark;
[0007] Step 2: The video analysis module loads an image from the video frame queue;
[0008] Step 3: The video analysis module searches for an image template identifier on the image. If no image template identifier is found, step 2 is repeated; if an image template identifier is found, step 4 is performed:
[0009] Step 4: The video analysis module performs template matching on the image loaded in step 3 according to the identification template library; the threshold of the matching coefficient is set to R t ;
[0010] Step 5: Calculate the maximum correlation coefficient R according to the normalized correlation coefficient matching formula max ; When R max <R t When R max ≥R t When , go to step 6;
[0011] Step 6: Calculate the current motion vector of the marker point The motion vector data of the marked test point is updated to the historical detection result queue, and the motion vector data of the marked test point, the predicted detection window and the update template are updated to the identification template library;
[0012] Step 7: The video analysis module searches for the timestamp corresponding to the last same motion vector in the historical detection result queue and calculates the time difference;
[0013] Step 8: Calculate the current pumping unit operation strokes;
[0014] Step 9: setting corresponding thresholds according to the motion vector difference and the running stroke difference of each position of the pumping unit in the historical detection result queue;
[0015] Step 10: When the motion vector of the identification point calculated in step 6 and the running impulse calculated in step 8 are greater than the threshold value of step 9, go to step 11; otherwise, go to step 12;
[0016] Step 11: After the alarm sounds, go to step 12;
[0017] Step 12: Repeat step 2 to continue testing.
[0018] The maximum value of the correlation coefficient R in step 5 max The calculation method is: According to the normalized correlation coefficient matching formula After calculation, we get a width and height of (W w -W t , W w -W t ) and find the maximum correlation coefficient R in the matrix. max and the maximum value coordinate (x r ,y r ); where I(x, y) represents the image data of the current video frame, x, y represent the pixel coordinates of the I(x, y) image, T(x′, y′) represents the image data of the identification template, x′, y′ are the pixel coordinates of the T(x′, y′) image, and W w is the detection window width, W t To detect the template width.
[0019] In step 6, the current motion vector of the marker point is calculated The method is as follows: Step a: After detection and analysis, the position of the marking point P (x n ,y n ), the timestamp is the image acquisition time t n ; At the same time, analyze the historical detection result queue, and calculate the position of each frame mark point and P(x n ,yn ) until a position P(x) with a distance less than a preset threshold is found. m ,y m );
[0020] Step b: According to formula 1: Calculate P(x m ,y m ) corresponding to the distance D; if D is less than the preset value D t , it means movement to the same position;
[0021] Step c: Retrieve P(x n ,y n ) position previous data P(x n-1 ,y n-1 ) and combine Formula 2 and Formula 3: V=(x n -x n-1 ,y n -y n-1 ) To calculate the motion direction V and motion speed v of the current detection result position to obtain the motion vector
[0022] The calculation method of the time difference in step 7 is: find the movement direction and movement speed in the historical detection result queue and P(x n ,y n ) The point corresponding to the position, get the timestamp t corresponding to the point m ; According to formula 4: ΔT = t n -t m Calculate the time difference ΔT; where t n is P(x n ,y n ) The timestamp corresponding to the location.
[0023] The calculation method of the running stroke in step 8 is: the running stroke is obtained according to formula 5: SPM=60×1000 / ΔT; wherein ΔT is the time difference.
[0024] The updating template described in step 6 includes executing the detection structure queue update and the detection window update in the continuous video frame queue to obtain a continuous detection result queue and a detection window queue.
[0025] The above technical solution is adopted, combining video acquisition and image analysis methods to analyze the movement of the oil pump. There is no need to touch the oil pump, which is convenient for installation and maintenance. It can be used for various types of oil pump equipment. It can analyze the problems existing in the operation of the oil pump, which is of great significance to the safety and continuous production of the oil pump. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1It is a schematic diagram of the process of the present invention;
[0027] Figure 2 It is a structural schematic diagram of the present invention;
[0028] In the attached figure, 1 is a characteristic mark, 2 is a video acquisition module, and 3 is a video analysis module. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] See also Figure 1 The schematic diagram of the structure of the present application shows a device for analyzing the motion of an oil pump, including a characteristic mark installed on the donkey head or walking beam of the oil pump (the fixed position of the characteristic mark needs to be confirmed in the video acquisition module to be clearly visible and unobstructed), a video acquisition module and a video analysis module installed on the ground near the oil pump; wherein the image analysis mark is used to locate and track the operating position of the oil pump in the video image, and the mark pattern can be any pattern, as long as it is different from the background of the position; the video acquisition module is used to continuously and fixed frame rate image acquisition of the pumping unit's stroke operation process, generally using 25 frames per second and 40ms between frames for image video acquisition (not limited to this parameter, just for example), and using the timestamp of the continuous video image to represent the time of the oil pump movement; the video analysis module is used to analyze and calculate the continuous image data collected by the video acquisition module, extract the strokes of the pumping unit and determine whether there are problems during the stroke operation.
[0031] A method for analyzing the motion of an oil pumping unit, step 1: a video acquisition module acquires video of an oil pumping unit equipped with a characteristic mark;
[0032] Step 2: The video analysis module loads an image I from the video frame queue n , whose corresponding timestamp is t n ,
[0033] Step 3: The video analysis module searches for an image template identifier on the image. If no image template identifier is found, step 2 is repeated; if an image template identifier is found, step 4 is performed:
[0034] Step 4: The video analysis module performs template matching on the image loaded in step 3 according to the identification template library; the threshold of the matching coefficient is set to R t ;
[0035] Step 5: Calculate the maximum correlation coefficient R according to the normalized correlation coefficient matching formula max ; When R max <R t When R max ≥R t When , go to step 6;
[0036] Step 6: Calculate the current motion vector of the marker point The motion vector data of the marked test point is updated to the historical detection result queue, and the motion vector data of the marked test point, the predicted detection window and the update template are updated to the identification template library;
[0037] Step 7: The video analysis module searches for the timestamp corresponding to the last same motion vector in the historical detection result queue and calculates the time difference;
[0038] Step 8: Calculate the current pumping unit's operating strokes; (The current pumping unit's operating strokes are intended to obtain the pumping unit's motion strokes and analyze whether there are problems such as pulley slippage during operation.)
[0039] Step 9: Set corresponding thresholds according to the motion vector difference and running stroke difference of each position of the pumping unit in the historical detection result queue; (The specific method for setting the threshold for the motion vector difference is: Assume that the motion vector that reached the position last time is The current motion vector is if The absolute value of The judgment method is not limited and can be selected according to the actual situation)
[0040] Step 10: When the motion vector of the identification point calculated in step 6 and the running impulse calculated in step 8 are greater than the threshold value of step 9, go to step 12; otherwise, go to step 13;
[0041] Step 11: After the alarm sounds, go to step 12; (setting the alarm is to add a method to display the results)
[0042] Step 12: Repeat step 2 to continue testing.
[0043] The maximum value of the correlation coefficient R in step 5 max The calculation method is: According to the normalized correlation coefficient matching formula After calculation, we get a width and height of (W w -W t , W w -W t ) and find the maximum correlation coefficient R in the matrix. maxand the maximum value coordinate (x r ,y r ); where I(x, y) represents the image data of the current video frame, x, y represent the pixel coordinates of the I(x, y) image, T(x′, y′) represents the image data of the identification template, x′, y′ are the pixel coordinates of the T(x′, y′) image, and W w is the detection window width, W t is the detection template width (the window and template used are both square).
[0044] In step 6, the current motion vector of the marker point is calculated The method (motion vector includes motion direction and speed) is as follows: Step a: After detection and analysis, the position P (x n ,y n ), the timestamp is the image acquisition time t n ; At the same time, analyze the historical detection result queue, and calculate the position of each frame mark point and P(x n ,y n ) until a position P(x) with a distance less than a preset threshold is found. m ,y m );
[0045] Step b: According to formula 1 Calculate P(x m ,y m ) corresponding to the distance D; if D is less than the preset value D t , it means movement to the same position;
[0046] Step c: Retrieve P(x n ,y n ) position previous data P(x n-1 ,y n-1 ) and combine Formula 2 and Formula 3: V=(x n -x n-1 ,y n -y n-1 ), To calculate the motion direction V and motion speed v of the current detection result position to obtain the motion vector
[0047] The calculation method of the time difference in step 7 is: find the movement direction and movement speed in the historical detection result queue and P(x n ,y n ) position, and get the timestamp t corresponding to the point m ; According to formula 4: ΔT = t m -t m , calculate the time difference ΔT; where t n is P(xn ,y n ) The timestamp corresponding to the location.
[0048] The calculation method of the running stroke in step 8 is: according to formula 5: SPM = 60 × 1000 / ΔT, the running stroke is obtained; ΔT is the time difference. The motion vector and running stroke of each position of the pumping unit are calculated. If the motion vector and the stroke have a sudden change and the sudden change is greater than the threshold, it means that the pumping unit is not operating normally, and there may be abnormal conditions such as belt slippage.
[0049] The updating template described in step 6 includes executing the detection structure queue update and the detection window update in the continuous video frame queue to obtain a continuous detection result queue and a detection window queue.
[0050] The following is a description of the pumping unit motion analysis process of the present invention:
[0051] The known information includes continuous image frames I n And the timestamp t corresponding to each frame of image n , preset feature identification template image T m (The width and height of the template image are both W t ), detection window W m , whose starting coordinates are (x w ,y w ), whose width and height are both W w .
[0052] In the first step, the video analysis module loads an image I from the video frame queue n , whose corresponding timestamp is t n ; The second step is to use the preset feature identification template image T0 to detect the image I in the pre-set initial image mark detection window W0 n Perform template matching; the third step is to set the threshold of the matching coefficient to R t , the threshold range is 0.9<R t <1; Step 4, calculate according to the normalized correlation coefficient matching formula to obtain a width and height (W w -W t , W w -W t ) and find the maximum correlation coefficient R in the matrix max and the maximum value coordinate (x r ,y r ), so that the identification image template is located at (x w +x r ,y w +y r ) position and the current timestamp is t n, save all calculation results to the historical detection result queue; if the image template identifier is not found in the image In, the detection fails, load the next image in the video frame queue, and re-execute the first step; according to the maximum template matching correlation coefficient R max , if R max <R t (Threshold value, adjusted according to actual situation 0.9<R t <1), indicating that the current template can no longer meet the calculation requirements due to the movement or rotation of the marker, and the template needs to be updated. Step 5: Assume that the current detection result position P(x n ,y n ), timestamp is t n , analyze and traverse the test result queue, and find out whether it is related to a certain test result P(x m ,y m ), the corresponding timestamp is t m The distance between them is D, find the distance D is less than D t (preset value, for example: 1.0) indicates that the position is the same as the one in the previous step. Step 6: According to formula 2 and combined with the detection result position P(x n ,y n )’s previous data P(x n-1 ,y n-1 ) Calculate the movement direction V and movement speed v of the current detection result position; Step 7, find the movement direction and movement speed that match P(x n ,y n ) position, and get the timestamp t corresponding to the point m ; According to formula 4ΔT=t n -t m Calculate the time difference; where t n is P(x n ,y n ) timestamp corresponding to the position; Step 8, calculate the running strokes according to the formula 5SPM = 60*1000 / ΔT; ΔT is the time difference. Compare the motion vector and running strokes of each position of the pumping unit calculated in Steps 6 and 8 with the threshold. If there is a sudden change in the motion vector and the strokes and the sudden change is greater than the threshold, it means that the pumping unit is not running normally, and there may be abnormal conditions such as belt slippage.
[0053] The following is a description of the detection window update method: search the detection window queue to see if there is an existing identification detection window W in the motion direction. If so, use the detection window W as the detection operation window; if not, update the current frame image with the highest correlation coefficient (x w +x r ,y w +y r ) is the center, with Ww The image as the width is set as the new detection window, with (x w +x r ,y w +y r ) is the center, with W t The image with the width is used as the detection template of the current window, the new detection window is added to the detection window queue, and the new detection window is set as the current running window W. t .
[0054] The following is a method for updating the detection structure queue: load the next frame in the video frame queue, and then update the detection window W in the current setting. n and its adjacent detection window W n-1 , W n+1 In the middle (the number of detection windows is adjustable), template matching is performed to obtain the matching similarity extreme value R of each window max and its position P(x n ,y n ), and store the result in the test result queue;
[0055] The following is a description of the template update method: By performing detection structure queue update and detection window update in a continuous video frame queue, a continuous detection result queue and detection window queue can be obtained.
Claims
1. A method for analyzing the motion of an oil pump, characterized in that: The following steps are involved: Step 1: The video acquisition module acquires video of the oil pumping unit equipped with the characteristic mark; Step 2: The video analysis module loads an image from the video frame queue; Step 3: The video analysis module searches for an image template identifier on the image. If no image template identifier is found, step 2 is repeated; if an image template identifier is found, step 4 is performed: Step 4: The video analysis module performs template matching on the image loaded in step 3 according to the identification template library; the threshold of the matching coefficient is set to R t ; Step 5: Calculate the maximum correlation coefficient R in the detection window image according to the normalized correlation coefficient matching formula max ; When R max <R t When R max ≥R t When , go to step 6; Step 6: Calculate the motion vector of the current motion of the marker point Update the marker point motion vector data to the historical detection result queue, and update the marker point motion vector data, the predicted detection window and the update template to the marker template library; Step 7: The video analysis module searches for the timestamp corresponding to the last same motion vector in the historical detection result queue and calculates the time difference; Step 8: Calculate the current pumping unit operation strokes; Step 9: setting corresponding thresholds according to the motion vector difference and the running stroke difference of each position of the pumping unit in the historical detection result queue; Step 10: When the motion vector of the identification point calculated in step 6 and the running impulse calculated in step 8 are greater than the threshold value of step 9, go to step 11; otherwise, go to step 12; Step 11: After the alarm sounds, go to step 12; Step 12: Repeat step 2 and continue testing; The method for calculating the current motion vector of the marker point in step 6 is as follows: Step a: After detection and analysis, the position P(x n ,y n ), the timestamp is the image acquisition time t n , in milliseconds ms; at the same time, analyze the historical detection result queue, and calculate the position of each frame mark point and P(x n ,y n ) until a position P(x) with a distance less than a preset threshold is found. m ,y m ); Step b: According to formula 1: Calculate P(x m ,y m ) corresponding to the distance D; if D is less than the preset value D t , it means moving to the same position; Step c: Retrieve P(x n ,y n ) position previous data P(x n-1 ,y n-1 ) and combined with Formula 2: V=(x n -x n-1 ,y n -y n-1 ) and formula 3: Calculate the motion direction V and motion speed v of the current detection result position to get the motion vector 2. A method for analyzing the motion of an oil pump according to claim 1, characterized in that: The maximum value of the correlation coefficient R in step 5 max The calculation method is: According to the normalized correlation coefficient matching formula After calculation, we get a width and height of (W w -W t , W w -W t ) and find the maximum correlation coefficient R in the matrix. max and the maximum value coordinate (x r ,y r );in I(x, y) represents the image data of the current video frame, x, y represent the pixel coordinates of the I(x, y) image, T(x′, y′) represents the image data of the identification template, x′, y′ are the pixel coordinates of the T(x′, y′) image, W w is the detection window width, W t To detect the template width.
3. The method for analyzing the motion of an oil pump according to claim 1, characterized in that: The calculation method of the time difference in step 7 is: find the movement direction and movement speed in the historical detection result queue and P(x n ,y n ) position, and get the timestamp t corresponding to the point m , according to formula 4: ΔT = t n -t m Calculate the time difference ΔT; where t n is P(x n ,y n ) The timestamp corresponding to the location.
4. A method for analyzing the motion of an oil pump according to claim 3, characterized in that: The calculation method of the running stroke in step 8 is: the running stroke is obtained according to formula 5: SPM=60×1000 / ΔT; wherein ΔT is the time difference.
5. The method for analyzing the motion of an oil pump according to claim 1, characterized in that: The updating template described in step 6 includes executing the detection structure queue update and the detection window update in the continuous video frame queue to obtain a continuous detection result queue and a detection window queue.
Citation Information
Patent Citations
Rail fastener positioning method based on linear template matching
CN111539436A
Stroke frequency adjusting method for rod-pumped well based on self-learning
CN113266318A