A working condition diagnosis method of a pumping unit well

By generating dynamometer diagrams and utilizing geometric features and pre-trained neural network models, the problem of low accuracy in diagnosing the operating conditions of pumping wells was solved, achieving efficient operating condition identification and improved accuracy.

CN122169799APending Publication Date: 2026-06-09BEIJING ANKONG OIL & GAS TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ANKONG OIL & GAS TECH CO LTD
Filing Date
2026-03-06
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in diagnosing the operating conditions of pumping wells. Traditional methods are time-consuming and have low accuracy, and the accuracy is also low when relying solely on neural network classification and identification.

Method used

By acquiring displacement and load data of the polished rod in a pumping unit well during one working cycle, a dynamometer diagram is generated. The working conditions are identified using geometric features, and a pre-trained neural network model is used for secondary identification and confirmation, thereby improving the diagnostic accuracy.

Benefits of technology

It effectively saves computing resources, improves the accuracy of operating condition diagnosis, reduces the amount of training models and identification data, and improves the accuracy of operating condition diagnosis for pumping wells.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122169799A_ABST
    Figure CN122169799A_ABST
Patent Text Reader

Abstract

This invention relates to a method for diagnosing the operating conditions of pumping wells, belonging to the technical field of pumping well operating condition diagnosis. The method includes: acquiring multiple displacement data of the polished rod in the pumping well within one working cycle and the load data corresponding to each displacement data; obtaining a dynamometer diagram based on the displacement and load data; obtaining load-displacement data based on the dynamometer diagram; obtaining geometric features based on the load-displacement data; obtaining a diagnostic operating condition based on the geometric features; and obtaining a target operating condition by re-identifying and confirming the diagnostic operating condition through a neural network model corresponding to the diagnostic operating condition. This invention, after identifying the diagnostic operating condition through geometric features, utilizes a pre-trained neural network model specifically for the diagnostic operating condition for targeted identification and diagnosis. This reduces the amount of data required for training the model and for model identification, effectively saving storage and computing resources. Furthermore, by conducting two diagnostic checks, the accuracy of the operating condition diagnosis can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of autonomous driving technology, specifically relating to a method for diagnosing the operating conditions of an oil pumping well. Background Technology

[0002] In oilfield development, oil extraction equipment such as pumping units mostly operate in the field, are numerous, and geographically dispersed, facing harsh environments and making manual inspection difficult. Furthermore, the complex downhole conditions of pumping units lead to frequent malfunctions, impacting oilfield production and profitability. Therefore, intelligent diagnostics of pumping unit operating conditions is of great significance. Firstly, pumping unit malfunctions can severely affect production, even causing production interruptions. Secondly, by diagnosing pumping unit operating conditions, potential faults and problems can be identified and resolved promptly, improving equipment reliability and effectiveness, and reducing maintenance costs and losses. In addition, pumping unit operating condition diagnostics provides scientific data support for operation management, helping to formulate scientific production plans and management decisions, thereby improving the oilfield's economic efficiency and market competitiveness.

[0003] Traditional dynamometer card-based operational condition diagnosis mainly relies on manual identification based on experience using dynamometer cards drawn from displacement and load data. This method is time-consuming and has relatively low accuracy. With the development of artificial intelligence, the use of neural networks for classification and identification of operational conditions has become mainstream. However, oil well operational conditions are diverse, and dynamometer card shapes vary. Relying solely on neural networks for classification and diagnosis will result in low accuracy. Summary of the Invention

[0004] To address this issue, the present invention provides a method for diagnosing the operating conditions of pumping wells, thereby solving the problem of low accuracy in existing operating condition diagnoses for pumping wells.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for diagnosing the operating conditions of a pumping unit well, comprising: Acquire multiple displacement data of the polished rod in the pumping well during one working cycle, as well as the load data corresponding to each displacement data; A dynamometer diagram is obtained based on the displacement and load data. The load displacement data are obtained based on the dynamometer diagram. Geometric features are obtained based on the load displacement data; The diagnostic conditions are obtained based on the aforementioned geometric features; The target condition is obtained by re-identifying and confirming the diagnostic condition through the neural network model corresponding to the diagnostic condition.

[0006] Furthermore, the background of the indicator diagram is white, one working cycle includes an upper stroke and a lower stroke, and obtaining the load displacement data based on the indicator diagram includes: The pixels in the indicator image are classified and labeled according to the upper and lower strokes; Obtain the RGB value of each pixel in the indicator image; Pixels that meet preset conditions are retained based on their RGB values, and the coordinate values ​​of these pixels are used as load displacement data. The preset conditions are to retain pixels with RGB values ​​of R<255, G<255, or B<255. The load displacement data is key-value pair data with the horizontal coordinate as the key and the vertical coordinate as the value, where the key represents the displacement value and the value represents the load. The load displacement data also includes an upper or lower stroke classification identifier for the corresponding pixel.

[0007] Furthermore, obtaining the geometric features based on the load displacement data includes: The load displacement data is divided into load displacement data corresponding to the upper stroke and the lower stroke according to the classification identifier, and the geometric features are calculated for each. The calculation of the geometric features includes obtaining the smoothing interval, the variation interval, the maximum load, the minimum load, the maximum displacement, and the minimum displacement based on the load displacement data.

[0008] Furthermore, obtaining the smoothing interval and the variation interval based on the load displacement data includes: The key set f(x) = {x1, x2, ..., xu} is used to obtain the load displacement data; After cutting the key set once using a first preset number of intervals as the cutting interval, a unit interval is obtained. The unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is greater than the first preset angle and less than the second preset angle, the unit interval is stored as a unit smoothing interval in the smoothing interval set. The cutting starts again from the key after the last key of the previous cutting, using the first preset number of intervals as the cutting interval. If the unit angle of the unit interval is less than or equal to the first preset angle or greater than or equal to the second preset angle, the first key of the previous cutting is shifted two key positions backward, and the cutting continues with the first preset number of intervals as the cutting interval. After each subsequent cutting, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. Based on the unit angle, the first preset angle, and the second preset angle, the units determined as unit smoothing intervals are stored in the smoothing interval set until the key set is completely cut. After cutting the key set once using a first preset number of intervals as the cutting interval, a unit interval is obtained. The unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is less than or equal to the first preset angle, the unit interval is stored in the change interval set as a unit reduction interval. The cutting starts again with the key after the last key of the previous cutting as the starting position, and the cutting continues with the first preset number of intervals as the cutting interval. If the unit angle of the unit interval is greater than the first preset angle, the first key of the previous cutting is shifted two key positions backward, and the cutting continues with the first preset number of intervals as the cutting interval. After each subsequent cutting, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. The unit angles and the first preset angles are used to store the units determined as unit reduction intervals in the change interval set until the key set is completely cut. After cutting the key set once using a first preset number of intervals as the cutting interval, a unit interval is obtained. The unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is greater than or equal to a second preset angle, the unit interval is stored as a unit loading interval in the change interval set, and the cutting continues backward using the first preset number of intervals as the starting position of the cutting after the key at the end of the last cutting. If the unit angle of the unit interval is less than the second preset angle, the key at the beginning of the last cutting is shifted two key positions backward, and the cutting continues backward using the first preset number of intervals. After each subsequent cutting, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas, and the unit intervals determined as unit loading intervals are stored in the change interval set according to the unit angle and the second preset angle, until the key set is completely cut. Merging consecutive cell intervals in the set of smooth intervals yields multiple smooth intervals; merging consecutive cell intervals in the set of variable intervals yields multiple variable intervals.

[0009] Furthermore, after determining the smoothing interval, a second smoothing interval confirmation is required, including: Obtain two adjacent smooth intervals and, according to the order, designate the two smooth intervals as the first interval and the second interval, respectively. Get the endpoint key value (xa, ya) of the first interval, and get the starting key value (xb, yb) of the second interval. If xa-xb is less than the first preset value and ya-yb is less than the second preset value, then the first interval and the second interval are determined to be smooth intervals.

[0010] Furthermore, obtaining the diagnostic condition based on the geometric features includes: The standard maximum load value and standard minimum load value are obtained based on the standard indicator diagram; The first ratio is obtained based on the maximum load value, minimum load value, standard maximum load value, and standard minimum load value. The calculation formula is as follows: Ra = (ymax-ymin) / (ynmax-ynmin); Where Ra is the first ratio; ymax is the maximum load value; ymin is the minimum load value; ynmax is the standard maximum load value; and ynmin is the standard minimum load value. The second ratio is obtained based on the maximum load value, the standard maximum load value, and the standard minimum load value. The calculation formula is as follows: Ru = (ynmax-ymax) / (ynmax-ynmin); Where Ru is the second ratio; The third ratio is obtained based on the minimum load value, the standard maximum load value, and the standard minimum load value. The calculation formula is as follows: Rd= (ymin-ynmin) / (ynmax-ynmin); Where Rd is the third ratio; If Ra is less than the third preset value but greater than the fourth preset value, and Ru is greater than the fourth preset value and Rd is less than the fifth preset value, then the diagnostic condition is tubing leakage; if Ra is less than the fourth preset value, Ru is greater than the third preset value, and Rd is greater than the sixth preset value, then the diagnostic condition is floating valve failure; if Ru is greater than the seventh preset value and Rd is less than 0, then the diagnostic condition is tubing breakage; if Ru is less than the fifth preset value and Rd is greater than the eighth preset value, then the diagnostic condition is fixed valve failure; if Ra is greater than the ninth preset value, ymax > ynmax and ynmin > ymin, then the diagnostic condition is oil viscosity in the pumping well; if ymax - ymin = 0, then the diagnostic condition is pump impact; if the geometric characteristics of the upper stroke include two adjacent smooth intervals, and the average load value corresponding to the earlier smooth interval is greater than the average load value corresponding to the later smooth interval, then the diagnostic condition is plunger dislodging from the working barrel.

[0011] Furthermore, the method also includes: taking the point where the change interval in the upper stroke is transformed into a smooth interval as the fixed valve open point, and taking the point corresponding to the maximum displacement in the upper stroke as the fixed valve closed point; The point corresponding to the minimum displacement in the next stroke is taken as the closed point of the moving valve, and the point where the smooth interval in the next stroke is transformed into the changing interval is taken as the open point of the moving valve. If there are two smoothing intervals in the above stroke, and the distance from the first smoothing interval to the minimum load is less than the distance from the second smoothing interval to the minimum load, and the distance from the second smoothing interval to the maximum load is less than the distance from the first smoothing interval to the maximum load, then the diagnostic condition is hysteresis of the moving valve closing. If there is only one smooth interval in the upper stroke and only one smooth interval in the lower stroke, the diagnostic condition is determined again by the fourth ratio. The formula for calculating the fourth ratio is: Rs=Xad / Xbc; where the distance between the closed point and the open point of the moving valve is Xad, and the distance between the closed point and the open point of the fixed valve is Xbc; if Rs is less than the tenth preset value, the diagnostic condition changes to moving valve leakage; if Rs is greater than the eleventh preset value, the diagnostic condition changes to fixed valve leakage.

[0012] Furthermore, obtaining the indicator diagram based on the displacement data and load data includes: The target load data is obtained by filtering and preprocessing the load data using a moving average filtering algorithm. The dynamometer diagram is obtained using a drawing tool based on the displacement data and the target load data.

[0013] Further, the step of obtaining the target working condition by re-identifying and confirming the diagnostic working condition through the neural network model corresponding to the diagnostic working condition includes: Pre-train corresponding neural network models for different diagnostic conditions; Once the diagnostic working condition is determined through geometric features, the corresponding neural network model for the diagnostic working condition is used for identification. If the identification result is consistent with the diagnostic working condition, the diagnostic working condition is determined as the target working condition; if the identification result is inconsistent with the diagnostic working condition, the working condition diagnosis for the next working cycle of the pumping unit well will begin immediately.

[0014] Furthermore, it also includes comprehensive operating conditions, which include normal operating conditions, slight fluid insufficiency, insufficient fluid supply, and severe fluid insufficiency. The operating condition diagnosis method further includes: Based on the geometric features, a vector Q is generated, Q=[ V1,V2,V3,V4], where V1,V2,V3 and V4 respectively represent the probability of normal operation, slight fluid insufficiency, fluid insufficiency and severe fluid insufficiency determined by the geometric features. The dynamometer used for training is taken as input and processed by a neural network with the ResNet50 architecture to obtain a classification matrix, P=[W1,W2,W3,W4], where P is the classification matrix and W1, W2, W3 and W4 respectively represent the probability of normal dynamometer, slight fluid insufficiency, fluid insufficiency and severe fluid insufficiency output by the model. After performing a cross operation on Q and P, we obtain the cross matrix H = [W1×V1, W2×V2, W3×V3, W4×V4], where H is the cross matrix; The probability dataset N = {p1, p2, p3, p4} is calculated using the softmax function based on the cross matrix. Here, N is the probability dataset, and p1, p2, p3, and p4 represent the probabilities of normal dynamometer, slight fluid insufficiency, fluid insufficiency, and severe fluid insufficiency, respectively. The comprehensive working condition corresponding to the highest probability among p1, p2, p3, and p4 is taken as the target comprehensive working condition.

[0015] The present invention, by adopting the above technical solution, has at least the following beneficial effects: This invention provides a method for diagnosing the operating conditions of a pumping unit well. The method involves acquiring multiple displacement data points of the polished rod within one working cycle and the corresponding load data for each displacement. A dynamometer diagram is then generated based on the displacement and load data. Load-displacement data is obtained from the dynamometer diagram. Geometric features are derived from the load-displacement data. A diagnostic operating condition is obtained based on the geometric features. The diagnostic operating condition is then re-identified and confirmed using a neural network model corresponding to the diagnostic operating condition to obtain the target operating condition. This invention, by identifying the diagnostic operating condition through geometric features and then utilizing a pre-trained neural network model specifically designed for the diagnostic operating condition, can reduce the amount of data required for training the model and for model identification. This not only effectively saves storage and computing resources but also significantly improves the accuracy of the operating condition diagnosis through two diagnostic steps.

[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating an exemplary embodiment of the present invention of a method for diagnosing the operating conditions of a pumping well; Figure 2 This is an exemplary embodiment of the present invention illustrating the indicator diagram corresponding to the secondary smoothing interval confirmation; Figure 3 This is an exemplary embodiment of the present invention illustrating the indicator diagram corresponding to leakage of a moving valve; Figure 4 This is an exemplary embodiment of the present invention illustrating the indicator diagram corresponding to the leakage of a fixed valve; Figure 5 This is an indicator diagram of the upper impact pump shown in an exemplary embodiment of the present invention; Figure 6 This is an indicator diagram showing the plunger disengaging from the working cylinder, as illustrated in an exemplary embodiment of the present invention. Figure 7 This is an exemplary embodiment of the present invention showing the indicator diagram corresponding to the hysteresis of the moving valve closing; Figure 8 This is an exemplary embodiment of the present invention showing the indicator diagram corresponding to sand resistance identification; Figure 9 This is an exemplary embodiment of the present invention illustrating an indicator diagram used for determining comprehensive operating conditions.

[0019] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0021] Traditional dynamometer diagram diagnosis mainly relies on manual identification based on experience using dynamometer diagrams drawn from displacement and load data. This method is time-consuming and has low accuracy. With the advancement of technology, neural network classification has become the mainstream method for identifying operating conditions. However, there are many types of oil well operating conditions and diverse shapes of dynamometer diagrams. Relying on a single neural network classification method would result in low accuracy.

[0022] This invention provides a method for diagnosing the operating conditions of pumping wells. After identifying and diagnosing the operating conditions through geometric features, a neural network model pre-trained for the diagnosed operating conditions is used for targeted identification and diagnosis. This not only saves computing resources but also effectively improves the accuracy of operating condition diagnosis through two diagnostic steps.

[0023] The method of the present invention will be described below through specific embodiments.

[0024] Please see Figure 1 , Figure 1 This is a flowchart illustrating an exemplary embodiment of the present invention of a method for diagnosing the operating conditions of a pumping unit well. See also: Figure 1 The method includes: Step S11: Obtain multiple displacement data of the polished rod in the pumping unit well within one working cycle and the load data corresponding to each displacement data; Step S12: Obtain the indicator diagram based on the displacement data and load data; Step S13: Obtain load displacement data based on the indicator diagram; Step S14: Obtain geometric features based on load displacement data; Step S15: Obtain the diagnostic working condition based on geometric features; Step S16: After re-identifying and confirming the diagnostic working condition through the neural network model corresponding to the diagnostic working condition, the target working condition is obtained.

[0025] It should be noted that the technical solution provided in this embodiment can be used in practice as a mini-program or a plugin in existing pumping unit systems or applications, or as a standalone application that implements operational condition diagnosis functions through external interfaces. Applicable scenarios include, but are not limited to, pumping unit operational condition diagnosis.

[0026] Specifically, raw, real displacement data and corresponding load data are collected, and each dynamometer diagram represents the working condition of the pumping unit well within one working cycle.

[0027] It is understood that the method provided in this embodiment acquires multiple displacement data of the polished rod in the pumping unit well within one working cycle and the load data corresponding to each displacement data; obtains a dynamometer diagram based on the displacement data and load data; obtains load-displacement data based on the dynamometer diagram; obtains geometric features based on the load-displacement data; obtains the diagnostic working condition based on the geometric features; and obtains the target working condition after re-identifying and confirming the diagnostic working condition through the neural network model corresponding to the diagnostic working condition. After identifying and diagnosing the working condition through geometric features, this invention utilizes a neural network model pre-trained for the diagnostic working condition for targeted identification and diagnosis, which can reduce the amount of data used to train the model and identify the model. This not only effectively saves storage and computing resources, but also effectively improves the accuracy of working condition diagnosis through two diagnoses.

[0028] In practice, step S11, "acquiring multiple displacement data of the polished rod in the pumping well within one working cycle and the load data corresponding to each displacement data", includes: fixing the displacement sensor near the polished rod or the donkey head to ensure that the measuring axis is consistent with the direction of movement of the polished rod; installing the load sensor at the connection between the polished rod and the suspension rope to avoid eccentricity or lateral force interference; connecting the sensor to the data acquisition system (such as a dynamometer, RTU, or PLC); and setting the sampling frequency to one working cycle, that is, the polished rod completing one up stroke and one down stroke.

[0029] In practice, step S12, "obtaining the dynamometer diagram based on displacement data and load data", includes: obtaining target load data after filtering and preprocessing the load data using a moving average filtering algorithm; and obtaining the dynamometer diagram based on the displacement data and target load data using a drawing tool.

[0030] Specifically, 1. Raw, real displacement and load data are collected. Each dynamometer card data point represents one cycle (T points), with 200 points collected per cycle. 2. A moving average filtering algorithm is used to preprocess the load data. The window size for the 200 load points in one cycle is set to m=5. The calculation formula is as follows: , where y n For the point load to be filtered, y n-1 and y n-2 For the loads at the two points preceding this point, y n+1 and y n+2 3. Based on the displacement data and the filtered load data, use matplotlib to draw a dynamometer image with a completely white background, i.e., RGB=[255,255,255].

[0031] In practice, step S13, "obtaining load displacement data based on the indicator diagram," includes: classifying and labeling pixels in the indicator diagram according to the upper and lower strokes; obtaining the RGB value of each pixel in the indicator diagram; retaining pixels that meet preset conditions based on the RGB values, and using the coordinate values ​​of the pixels as load displacement data; the preset conditions are to retain pixels with RGB values ​​of R<255, G<255, or B<255; the load displacement data is key-value pair data with the horizontal axis as the key and the vertical axis as the value, where the key represents the displacement value and the value represents the load, and the load displacement data also includes the upper or lower stroke classification label of the corresponding pixel.

[0032] It should be noted that the background of the dynamometer is white. One working cycle includes the upper stroke and the lower stroke. After drawing a completely white background using matplotlib, the RGB value of each pixel is queried from left to right and from top to bottom. If the R, G, or B of a pixel is less than 255, the pixel coordinates of that pixel are saved. Finally, a dictionary is generated with the horizontal coordinate as the key and the vertical coordinate as the value, where the key represents the displacement and the value represents the load. This forms a load-displacement data for calculating the geometric features of the dynamometer.

[0033] In practice, step S14, "obtaining geometric features based on load displacement data", includes: dividing the load displacement data into load displacement data corresponding to the upper stroke and lower stroke according to the classification identifier and calculating the geometric features respectively; the calculation of geometric features includes: obtaining the smoothing interval, the variation interval, the maximum load, the minimum load, the maximum displacement, and the minimum displacement based on the load displacement data.

[0034] It should be noted that the geometric feature algorithms for the upper and lower strokes are the same, but they need to be calculated separately to distinguish which are upper strokes and which are lower strokes. The load displacement data of the upper and lower strokes cannot be mixed and calculated separately. The calculation results will be used for subsequent working condition diagnosis based on geometric features.

[0035] Specifically, the smoothing interval and the variation interval are obtained based on the load displacement data, including: obtaining the key set f(x) = {x1, x2…xu} of the load displacement data; cutting the key set once with a first preset number of keys as the cutting interval to obtain the unit interval, and obtaining the unit angle of the unit interval through the forward and reverse tangent function formulas; if the unit angle is greater than the first preset angle and less than the second preset angle, the unit interval is stored as a unit smoothing interval in the smoothing interval set, and the cutting continues backward with the first preset number of keys as the cutting start position, using the key after the last key of the previous cutting as the cutting start position; if the unit angle of the unit interval is less than or equal to the first preset angle or greater than or equal to the second preset angle, the cutting continues backward with the first key after the last key of the previous cutting as the cutting start position; if the unit angle of the unit interval is less than or equal to the first preset angle or greater than or equal to the second preset angle, the cutting continues backward with the first key after the last cutting as the cutting start position. After shifting the key two key positions backward, the cutting continues with a first preset number of key positions as the cutting interval. After each subsequent cutting, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. Based on the unit angle, the first preset angle, and the second preset angle, the units determined as smooth intervals are stored in the smooth interval set until the key set is completely cut. After cutting the key set once with the first preset number of key positions as the cutting interval, unit intervals are obtained. The unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is less than or equal to the first preset angle, the unit interval is stored as a unit unloading interval in the change interval set, and the cutting starts again with the key after the last key of the previous cutting as the starting position, using the first preset number of key positions as the cutting interval. The number of units is used as the cutting interval to continue cutting. If the unit angle of the unit interval is greater than the first preset angle, the first key from the previous cut is shifted two key positions backward, and the cutting continues with the first preset number of units as the cutting interval. After each subsequent cut, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas, and the units determined as unit unloading intervals are stored in the variable interval set based on the unit angle and the first preset angle, until the key set is completely cut. After cutting the key set once with the first preset number of units as the cutting interval, the unit interval is obtained, and the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is greater than or equal to the second preset angle, the unit interval is stored as a unit loading interval in the variable interval set. In the set of intervals, starting from the key after the last key of the previous cut, cut again with a first preset number of intervals. If the unit angle of the interval is less than the second preset angle, shift the first key of the previous cut two key positions backward and continue cutting with the first preset number of intervals. After each cut, the unit angle of the interval is obtained by using the forward and reverse tangent function formulas. Based on the unit angle and the second preset angle, the intervals determined as unit loading intervals are stored in the set of changing intervals until the key set is cut. Continuous unit intervals in the set of smooth intervals are merged to obtain multiple smooth intervals. Continuous unit intervals in the set of changing intervals are merged to obtain multiple changing intervals.

[0036] It should be noted that, taking the geometric feature calculation of the above stroke as an example, during the load process of the upper stroke, the displacement dataset f(x) = {x1, x2… xu} is obtained, and the corresponding load dataset f(y) = {y1, y2… yu} is obtained. Taking the above stroke process as an example, the smooth interval set of the indicator diagram is obtained. During the upper stroke process, the displacement is divided into a unit interval of 30 points. In a unit interval, the initial point is assumed to be f(x1, y1) and the ending point is f(x2, y2). The arctangent function formula is as follows: Calculate the unit angle of each segmented unit interval. If the angle value is greater than the first preset angle and less than the second preset angle, record it. Then, calculate again after moving 30 displacements forward. If the unit angle value is less than or equal to the first preset angle or greater than or equal to the second preset angle, calculate again after moving 2 displacements forward. This process continues until a set of displacements C1={S0,S1,S2…Sl} with unit angle values ​​greater than the first preset angle and less than the second preset angle is obtained, which is the smooth interval set. Taking the above stroke process as an example, obtain the unit unloading interval of the change interval set of the indicator diagram. During the above stroke process, the displacement is divided into 30 points as a unit interval. Assume the initial point of a unit interval is f(x1,y1) and the ending point is f(x2,y2). The arctangent function formula is as follows: The unit angle of each segmented unit interval is calculated. If the angle value is less than or equal to the first preset angle, it is recorded, and the calculation is repeated after shifting 30 displacements. If the unit angle value is greater than the first preset angle, the calculation is repeated after shifting 2 displacements, and so on. This yields a set of displacements C2={B0,B1,B2…Bi} where the unit angle value is less than or equal to the first preset angle. This is the set of unit load reduction intervals, which belongs to the set of change intervals. Taking the above stroke process as an example, the unit load increase interval of the change interval set of the indicator diagram is obtained. In the above stroke process, the displacement is divided into a unit interval of 30 points. In a unit interval, the initial point is assumed to be f(x1,y1), and the ending point is f(x2,y2). The arctangent function formula is as follows: The process involves calculating the unit angle for each segmented interval. If the angle value is greater than or equal to the second preset angle, it is recorded, and the calculation is repeated after shifting the displacement by 30 units. If the unit angle value is less than the second preset angle, the calculation is repeated after shifting the displacement by 2 units, and so on. This yields a set of displacements C3={D0,D1,D2…Di} where the unit angle value is greater than or equal to the second preset angle. This set represents the unit load increase interval and belongs to the change interval set. In set C1, the load difference and displacement difference are calculated between the end of the previous segment and the beginning of the next segment. If the difference is 0, it indicates that the two segments are in the same change interval, and they are merged. The same method is used in set C2 to obtain the change trend of the upper stroke. The same method is used for the lower stroke. The first and second preset angles are set based on the experience of the staff. The first preset angle is generally set to -20 degrees, and the second preset angle is generally set to 20 degrees. Unit angles less than or equal to -20 degrees indicate a load reduction interval. The unit angle is between -20° and 20°, which is the smooth interval. The unit angle is greater than or equal to 20°, which is the load-increasing interval. Both the load-reducing interval and the load-increasing interval are variable intervals.

[0037] Specifically, please see Figure 2 , Figure 2 This is an exemplary embodiment of the present invention illustrating the dynamometer diagram corresponding to the secondary smoothing interval confirmation. After determining the smoothing interval, a secondary smoothing interval confirmation is required, including: obtaining two adjacent smoothing intervals and sequentially using the two smoothing intervals as the first interval and the second interval respectively; obtaining the endpoint key value (xa, ya) of the first interval and obtaining the starting point key value (xb, yb) of the second interval; if xa-xb is less than a first preset value and ya-yb is less than a second preset value, then the first interval and the second interval are determined to be smoothing intervals.

[0038] It should be noted that some dynamometer diagrams may have load fluctuations that cause adjacent cutting units to be in a variable region, i.e., calculated as two smooth or variable intervals. In such cases, noise reduction processing is required. Let's assume that the end coordinates of interval one are f(xa,ya) and the starting coordinates of interval two are f(xb,yb). Both interval one and interval two are smooth intervals, but the area between interval two and interval one may be calculated as a load variation region due to fluctuations. To eliminate this error, we calculate the displacement difference between interval one and interval two as dx=f(xa-xb) and the load difference as dy=f(ya-yb). If dx<120 and dy<5, it means that interval one and interval two are still smooth intervals.

[0039] Specifically, the maximum and minimum loads of the dynamometer card are obtained. The formula for calculating the maximum load is as follows: The formula for calculating the minimum load is: The formula for calculating the maximum displacement is: The formula for calculating the minimum displacement is: .

[0040] Specifically, the diagnostic working condition is obtained based on geometric characteristics, including: obtaining the standard maximum load value and standard minimum load value based on the standard indicator diagram; obtaining a first ratio based on the maximum load value, minimum load value, standard maximum load value, and standard minimum load value, calculated using the formula: Ra = (ymax-ymin) / (ynmax-ynmin); where Ra is the first ratio; ymax is the maximum load value; ymin is the minimum load value; ynmax is the standard maximum load value; ynmin is the standard minimum load value; obtaining a second ratio based on the maximum load value, standard maximum load value, and standard minimum load value, calculated using the formula: Ru = (ynmax-ymax) / (ynmax-ynmin); where Ru is the second ratio; obtaining a third ratio based on the minimum load value, standard maximum load value, and standard minimum load value, calculated using the formula: Rd = (ymin-ynmin) / (ynmax-ynmin); where Rd is the third ratio; if Ra is less than the third preset value but greater than the fourth preset value, and Ru is greater than the fourth preset value and Rd is less than the fifth preset value, then the diagnostic condition is tubing leakage; if Ra is less than the fourth preset value, Ru is greater than the third preset value, and Rd is greater than the sixth preset value, then the diagnostic condition is floating valve failure; if Ru is greater than the seventh preset value and Rd is less than 0, then the diagnostic condition is tubing breakage; if Ru is less than the fifth preset value and Rd is greater than the eighth preset value, then the diagnostic condition is fixed valve failure; if Ra is greater than the ninth preset value, ymax>ynmax and ynmin>ymin, then the diagnostic condition is oil viscosity in the pumping well; if ymax-ymin=0, then the diagnostic condition is pump impact; if the geometric characteristics of the upper stroke include two adjacent smooth intervals, and the average load value corresponding to the earlier smooth interval is greater than the average load value corresponding to the later smooth interval, then the diagnostic condition is plunger dislodging from the working barrel.

[0041] It should be noted that the standard indicator diagram is the indicator diagram under normal operation of the same model of equipment.

[0042] It should be noted that the preset number, preset value, first preset angle, and second preset angle in the above embodiments are all set based on the experience of the operators. The first preset angle is generally set to -20 degrees by default, and the second preset angle is generally set to 20 degrees by default. If the value of Ra is less than 0.7 and greater than 0.3, and Ru is greater than 0.3 and Rd is less than 0.2, then the diagnostic condition is tubing leakage; if the value of Ra is less than 0.3, and Ru is greater than 0.7 and Rd is greater than 0.1, then the diagnostic condition is floating valve failure; if the value of Ru is greater than 0.95 and Rd is less than 0, then the diagnostic condition is tubing breakage; if Ru is less than 0.2 and Rd is greater than 0.6, then the diagnostic condition is fixed valve failure; if the value of Ra is greater than 1.3, ymax > ynmax and ynmin > ymin, then the diagnostic condition is oil viscosity in the pumping well; see also Figure 5 , Figure 5 This is an exemplary embodiment of the present invention showing the indicator diagram corresponding to the top-impact pump. If ymax - ymin = 0, the diagnostic condition is top-impact pump; see also Figure 6 , Figure 6 This is an exemplary embodiment of the present invention showing the indicator diagram corresponding to the plunger disengaging from the working cylinder. If the geometric features of the upper stroke include two adjacent smooth intervals, and the average load value corresponding to the earlier smooth interval is greater than the average load value corresponding to the later smooth interval, then the diagnosed working condition is plunger disengaging from the working cylinder.

[0043] In practice, the method also includes: taking the point where the change interval in the upper stroke is transformed into a smooth interval as the fixed valve open point, and taking the point corresponding to the maximum displacement in the upper stroke as the fixed valve closed point; taking the point corresponding to the minimum displacement in the lower stroke as the moving valve closed point, and taking the point where the smooth interval in the lower stroke is transformed into a change interval as the moving valve open point.

[0044] It should be noted that when the load changes from a variable range to a smooth range during the upper stroke, the point of change is considered the fixed valve open point, and the point of maximum displacement is considered the fixed valve closed point. During the lower stroke, the point of minimum displacement is the floating valve closed point, and when the load changes from a smooth range to a variable range, the floating valve open point is considered the floating valve open point.

[0045] In practical application, see Figure 3 , 4 , Figure 3 This is an exemplary embodiment of the present invention illustrating the indicator diagram corresponding to leakage of a moving valve. Figure 4This is an exemplary embodiment of the present invention illustrating a dynamometer diagram corresponding to a fixed valve leakage. Before obtaining the target operating condition after re-identifying and confirming the diagnostic operating condition through a neural network model corresponding to the diagnostic operating condition, the method further includes: if there is a smooth interval in the upper stroke and only one smooth interval in the lower stroke, the diagnostic operating condition is determined again by a fourth ratio. The formula for calculating the fourth ratio is: Rs = Xad / Xbc; where the distance between the closed point and the open point of the moving valve is Xad, and the distance between the closed point and the open point of the fixed valve is Xbc; if Rs is less than a tenth preset value, the diagnostic operating condition is changed to moving valve leakage; if Rs is greater than an eleventh preset value, the diagnostic operating condition is changed to fixed valve leakage.

[0046] It should be noted that the load gradually decreases as the sucker rod moves upward and approaches its maximum displacement. The load change trend at the beginning of the upward movement is smoother than that of the standard dynamometer card. The calculation method is to calculate the load by the distance between the fixed valve opening and closing points and the floating valve opening and closing points. If the distance between the floating valve closing points is Xad and the distance between the fixed valve opening and closing points is Xbc, and there is only one smooth interval in the downward stroke, then the calculation formula is: Rs = Xad / Xbc. If the Rs value is less than 0.8, it can be considered that this dynamometer card may be due to floating valve leakage.

[0047] It should be noted that during the initial stage of the sucker rod's downward movement, an arc will appear, causing a delay in the closing of the traveling valve. Near the end of the movement, the load value will increase. If the distance between the traveling valve's closing point and the fixed valve's opening and closing point is Xad, and there is only one smooth interval in the downward stroke, then the calculation formula is: Rs = Xad / Xbc. If the Rs value is greater than 1.2, this dynamometer reading may indicate a leak in the fixed valve.

[0048] In practical application, see Figure 7 , Figure 7 This is an exemplary embodiment of the present invention showing the indicator diagram corresponding to the hysteresis of the moving valve closing. If there are two smoothing intervals in the upper stroke, and the distance from the first smoothing interval to the minimum load is less than the distance from the second smoothing interval to the minimum load, and the distance from the second smoothing interval to the maximum load is less than the distance from the first smoothing interval to the maximum load, then the diagnosed working condition is hysteresis of the moving valve closing.

[0049] It should be noted that, based on the characteristics of the hysteresis closing condition of the moving valve, because the hysteresis closing of the moving valve will cause a smooth interval to appear in the indicator diagram at the beginning of the upward movement, and two smooth intervals will appear in the upper stroke, if this trend of change occurs, it can be considered that there is hysteresis closing of the moving valve.

[0050] In practice, step S16, "obtaining the target working condition after re-identifying and confirming the diagnostic working condition through the neural network model corresponding to the diagnostic working condition," includes: pre-training the corresponding neural network model for different diagnostic working conditions; after screening the diagnostic working condition through geometric features, using the neural network model of the corresponding diagnostic working condition for identification; if the identification result is consistent with the diagnostic working condition, then the diagnostic working condition is determined as the target working condition; if the identification result is inconsistent with the diagnostic working condition, then the working condition diagnosis for the next working cycle of the pumping unit well is started immediately.

[0051] It should be noted that after determining the diagnostic working condition through geometric features, conditions that do not belong to the diagnostic working condition can be filtered out first. Then, after secondary identification based on the corresponding neural network model, the target working condition can be determined.

[0052] Specifically, the construction of the neural network includes: The neural network uses the ResNet50 architecture, which has the following structure: Input layer: The image is the collected feature map to be trained. The original image undergoes data augmentation, normalization, and size standardization preprocessing to finally generate a matrix A(H,W,C), where H represents the height of the feature map, W represents the width of the feature map, and C represents the number of channels of the feature map. Initial convolutional layer: The feature matrix A(H,W,C) is put into the initial convolutional layer, which has a 7×7 convolutional kernel and a stride of 2 for feature extraction; normalization improves training stability; ReLU activation layer introduces non-linearity; 3×3 pooling kernel and a stride of 2 pooling layer reduce the size of the feature map. Residual Blocks: ResNet50 contains 16 residual blocks divided into four stages. The first stage contains 3 residual blocks, the second stage contains 4, the third stage contains 6, and the fourth stage contains 3. Each residual block contains 1×1, 3×3, and 1×1 convolutional kernels for feature extraction. Normalization is performed after each convolutional kernel operation, and a ReLU activation layer is applied after three convolutional operations. Skip Connections: After a residual block is processed, its input is directly added to its output to ensure gradients can flow during backpropagation. Global Average Pooling: Global average pooling is used after the residual block is processed. Fully Connected Layers: The fully connected layers map the global feature vectors to the number of classes for the final classification task. Softmax Layers: The Softmax function is used to calculate the probability of each class. If the probability is greater than the preset probability of a given condition, it is considered to be that condition.

[0053] In practical application, see Figure 8 , Figure 8This is an exemplary embodiment of the present invention illustrating the dynamometer diagram corresponding to sand resistance identification. In sand resistance identification, the dynamometer diagram is split into two parts: a smooth straight line from the fixed valve opening point to the fixed valve closing point during the upward stroke, and a smooth straight line from the floating valve opening point to the floating valve closing point during the downward stroke. This transforms the complex dynamometer diagram vibration identification into a straight-line vibration identification, increasing the accuracy of the identification. The specific steps involve calculating the coordinates of four points: f(xa,ya), f(xb,yb), f(xc,yc), and f(xd,yd). Images of straight lines are drawn using the displacement loads between f(xa,ya) and f(xd,yd) and between f(xb,yb) and f(xc,yc). A neural network is then used to train the recognition on these images.

[0054] In practice, this also includes determining the comprehensive operating condition, which includes normal dynamometer, slight fluid insufficiency, fluid insufficiency, and severe fluid insufficiency. The operating condition diagnosis method further includes generating a vector Q based on the geometric features, where Q = [ V1, V2, V3, V4], where V1, V2, V3, and V4 respectively represent the probabilities of normal dynamometer, slight fluid insufficiency, fluid insufficiency, and severe fluid insufficiency determined by geometric features; the dynamometer used for training is taken as input and processed by a ResNet50 neural network to obtain a classification matrix, P=[W1, W2, W3, W4], where P is the classification matrix, and W1, W2, W3, and W4 respectively represent the probabilities of normal dynamometer, slight fluid insufficiency, fluid insufficiency, and severe fluid insufficiency output by the model; Q and P are cross-operated to obtain a cross matrix, H=[W1×V1, W2×V2, W3×V3, W4×V4], where H is the cross matrix; based on the cross matrix, the softmax function is used to calculate the probability dataset, N={p1, p2, p3, p4}, where N Given a probability dataset, p1, p2, p3, and p4 represent the probabilities of the calculated normal working condition, slight fluid insufficiency, insufficient fluid supply, and severe fluid insufficiency, respectively. The comprehensive working condition corresponding to the highest probability among p1, p2, p3, and p4 is taken as the target comprehensive working condition.

[0055] It should be noted that, see Figure 9 , Figure 9It is the indicator diagram for judging the comprehensive working condition shown in an exemplary embodiment of the present invention. There is a smooth interval and a variable interval in the upward stroke, and a smooth interval and a variable interval in the downward stroke. The values of V3 and V4 are set to 0. The smooth interval in the upward stroke is from point B f(xb, yb) to point C f(xc, yc), and the smooth interval in the downward stroke is from point A f(xa, ya) to point D f(xd, yd). Calculate Lbc = xc - xb and Lad = xd - xa, and then calculate Ra = Lbc / Lad. When 0.97 < Ra < 1.03, Q = [0.98, 0.02, 0, 0]; when 0.95 <= Ra < 0.97, Q = [0.95, 0.05, 0, 0]; when 0.93 <= Ra < 0.95, Q = [0.90, 0.1, 0, 0]; when 0.91 <= Ra < 0.93, Q = [0.85, 0.14, 0.1, 0]; when 0.89 <= Ra < 0.91, Q = [0.70, 0.24, 0.06, 0]; when 0.87 <= Ra < 0.89, Q = [0.60, 0.30, 0.10, 0]; when 0.85 <= Ra < 0.87, Q = [0.55, 0.35, 0.10, 0]; when Ra < 0.85, Q = [0, 0, 0, 0]. If there is one smooth interval in the upward stroke and two smooth intervals in the downward stroke, when calculating Ra, Lad in the downward stroke is calculated using the first and last points of the first smooth interval. When 0.87 <= Ra < 0.91, Q = [0.45, 0.55, 0, 0]; when 0.82 <= Ra < 0.87, Q = [0.35, 0.65, 0, 0]; when 0.82 <= Ra < 0.87, Q = [0.19, 0.75, 0.06, 0]; when 0.75 <= Ra < 0.82, Q = [0.10, 0.80, 0.10, 0]; when 0.70 <= Ra < 0.75, Q = [0.05, 0.82, 0.13, 0]; when 0.65 <= Ra < 0.70, Q = [0, 0.85, 0.15, 0]; when 0.60 <= Ra < 0.65, Q = [0, 0.70, 0.29, 0.01]; when 0.55 <= Ra < 0.60, Q = [0, 0.44, 0.55, 0.01]; when 0.50 <= Ra < 0.55, Q = [0, 0.20, 0.75, 0.05]; when 0.45 <= Ra < 0.50, Q = [0, 0.08, 0.85, 0.05]; when 0.35 <= Ra < 0.45, Q = [0, 0.01, 0.90, 0.09]; when 0.30 <= Ra < 0.35, Q = [0, 0, 0.55, 0.45]; when 0.25 <= Ra < 0.30, Q = [0, 0, 0.2, 0.8]; when 0.1 <= Ra < 0.25, Q = [0, 0, 0.1, 0.9]; when 0 < Ra < 0.1, Q = [0, 0, 0.05, 0.95].

[0056] It should be noted that the construction of the neural network includes: The neural network uses the ResNet50 architecture, the structure of which is as follows: Input layer: The images are feature maps collected for training. The original images undergo data augmentation, normalization, and size standardization preprocessing to finally generate a matrix A(H,W,C), where H represents the height of the feature map, W represents the width of the feature map, and C represents the number of channels of the feature map. Initial convolutional layer: The feature matrix A(H,W,C) is put into the initial convolutional layer, which has a 7×7 convolutional kernel and a stride of 2 for feature extraction; normalization improves training stability; ReLU activation layer introduces non-linearity; 3×3 pooling kernel and a stride of 2 pooling layer reduce the size of the feature map. Residual Blocks: ResNet50 contains 16 residual blocks divided into four stages. The first stage contains 3 residual blocks, the second stage contains 4, the third stage contains 6, and the fourth stage contains 3. Each residual block contains 1×1, 3×3, and 1×1 convolutional kernels for feature extraction. Normalization is performed after each convolutional kernel operation, and a ReLU activation layer is applied after three convolutional operations. Skip Connections: After a residual block is processed, its input is directly added to its output to ensure gradients can flow during backpropagation. Global Average Pooling: Global average pooling is used after the residual block is processed. Fully Connected Layers: The fully connected layers map the global feature vectors to the number of classes for the final classification task. Softmax Layers: The Softmax function is used to calculate the probability of each class. If the probability is greater than the preset probability of a given condition, it is considered to be that condition.

[0057] It should be noted that the Softmax function is... Where e is a mathematical constant that maps the data of H to a probability distribution that sums to 1, and x i When representing a probability that needs to be calculated in H, such as the first x i The first is W1×V1, the second is W2×V2, the third is W3×V3, and the fourth is W4×V4, ∑ j e xj It is the sum of four data points, x j It means that each W1×V1 is substituted into it and added together.

[0058] It should be noted that each number in the probability dataset corresponds to the probability of a certain comprehensive working condition mentioned above. If p1 is the largest, it is a normal working condition; if p2 is the largest, it is a slight fluid shortage; if p3 is the largest, it is a fluid shortage; and if p4 is the largest, it is a severe fluid shortage.

[0059] It should be noted that the collection and preprocessing of load and displacement data used for training the model includes: constructing a working condition identification training set, including pipe leakage, floating valve failure, tubing breakage, fixed valve failure, oil well viscous oil, and pump collision, etc.; filtering the collected load data through an average value filtering algorithm to filter out fluctuations in the dynamometer card data, reducing interference caused by fluctuations in the training network model; and plotting the filtered load and displacement data into a dynamometer card.

[0060] It should be noted that the annotation of the training data includes: obtaining the stable load intervals of the upper and lower strokes based on the operating conditions, plotting the data of the two intervals as two straight lines, and creating datasets labeled with two categories: data fluctuation and no fluctuation; using the maximum displacement load of the dynamometer card as the base point, extracting information from the upper right corner of the dynamometer card and plotting it as a line curve, creating datasets labeled with two categories: pumps with and without upper impact, based on the presence of a circular ring; creating datasets with two smooth intervals in the upper stroke, where the second smooth interval is smaller than the first, creating datasets with two categories: non-piston ejection from the working cylinder and piston ejection from the working cylinder; creating datasets with one smooth interval in the upper stroke and one smooth interval in the lower stroke, where the upper stroke smooth interval is smaller than the lower stroke smooth interval, creating datasets with two categories: floating valve leakage and non-floating valve leakage; and creating datasets with one smooth interval in the upper stroke and one smooth interval in the lower stroke, where the upper stroke smooth interval is larger than the lower stroke smooth interval, creating datasets with two categories: fixed valve leakage and non-fixed valve leakage. The annotated data is input into the model for training, and the parameters are saved to complete the training.

[0061] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0062] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0063] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0064] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0065] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0066] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for diagnosing the operating conditions of a pumping unit well, characterized in that, The method includes: Acquire multiple displacement data of the polished rod in the pumping well during one working cycle, as well as the load data corresponding to each displacement data; A dynamometer diagram is obtained based on the displacement and load data. The load displacement data are obtained based on the dynamometer diagram. Geometric features are obtained based on the load displacement data; The diagnostic conditions are obtained based on the aforementioned geometric features; The target condition is obtained by re-identifying and confirming the diagnostic condition through the neural network model corresponding to the diagnostic condition.

2. The working condition diagnosis method according to claim 1, characterized in that, The background of the indicator diagram is white. One working cycle includes an upper stroke and a lower stroke. Obtaining load displacement data based on the indicator diagram includes: The pixels in the indicator image are classified and labeled according to the upper and lower strokes; Obtain the RGB value of each pixel in the indicator image; Pixels that meet preset conditions are retained based on their RGB values, and the coordinate values ​​of these pixels are used as load displacement data. The preset conditions are to retain pixels with RGB values ​​of R<255, G<255, or B<255. The load displacement data is key-value pair data with the horizontal coordinate as the key and the vertical coordinate as the value, where the key represents the displacement value and the value represents the load. The load displacement data also includes an upper or lower stroke classification identifier for the corresponding pixel.

3. The working condition diagnosis method according to claim 2, characterized in that, The process of obtaining geometric features based on the load displacement data includes: The load displacement data is divided into load displacement data corresponding to the upper stroke and the lower stroke according to the classification identifier, and the geometric features are calculated for each. The calculation of the geometric features includes obtaining the smoothing interval, the variation interval, the maximum load, the minimum load, the maximum displacement, and the minimum displacement based on the load displacement data.

4. The working condition diagnosis method according to claim 3, characterized in that, The process of obtaining the smoothing interval and the variation interval based on the load displacement data includes: The key set f(x) = {x1, x2, ..., xu} is used to obtain the load displacement data; After cutting the key set once using a first preset number of intervals as the cutting interval, a unit interval is obtained. The unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is greater than the first preset angle and less than the second preset angle, the unit interval is stored as a unit smoothing interval in the smoothing interval set. The cutting starts again from the key after the last key of the previous cutting, using the first preset number of intervals as the cutting interval. If the unit angle of the unit interval is less than or equal to the first preset angle or greater than or equal to the second preset angle, the first key of the previous cutting is shifted two key positions backward, and the cutting continues with the first preset number of intervals as the cutting interval. After each subsequent cutting, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. Based on the unit angle, the first preset angle, and the second preset angle, the units determined as unit smoothing intervals are stored in the smoothing interval set until the key set is completely cut. After cutting the key set once using a first preset number of intervals as the cutting interval, a unit interval is obtained. The unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is less than or equal to the first preset angle, the unit interval is stored in the change interval set as a unit reduction interval. The cutting starts again with the key after the last key of the previous cutting as the starting position, and the cutting continues with the first preset number of intervals as the cutting interval. If the unit angle of the unit interval is greater than the first preset angle, the first key of the previous cutting is shifted two key positions backward, and the cutting continues with the first preset number of intervals as the cutting interval. After each subsequent cutting, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. The unit angles and the first preset angles are used to store the units determined as unit reduction intervals in the change interval set until the key set is completely cut. After cutting the key set once using a first preset number of intervals as the cutting interval, a unit interval is obtained. The unit angle of the unit interval is obtained using the forward and reverse tangent function formulas. If the unit angle is greater than or equal to a second preset angle, the unit interval is stored as a unit loading interval in the change interval set, and the cutting continues backward using the first preset number of intervals as the starting position of the cutting after the key at the end of the last cutting. If the unit angle of the unit interval is less than the second preset angle, the key at the beginning of the last cutting is shifted two key positions backward, and the cutting continues backward using the first preset number of intervals. After each subsequent cutting, the unit angle of the unit interval is obtained using the forward and reverse tangent function formulas, and the unit intervals determined as unit loading intervals are stored in the change interval set according to the unit angle and the second preset angle, until the key set is completely cut. Merging consecutive cell intervals in the set of smooth intervals yields multiple smooth intervals; merging consecutive cell intervals in the set of variable intervals yields multiple variable intervals.

5. The working condition diagnosis method according to claim 4, characterized in that, After determining the smoothing interval, a second smoothing interval confirmation is required, including: Obtain two adjacent smooth intervals and, according to the order, designate the two smooth intervals as the first interval and the second interval, respectively. Get the endpoint key value (xa, ya) of the first interval, and get the starting key value (xb, yb) of the second interval. If xa-xb is less than the first preset value and ya-yb is less than the second preset value, then the first interval and the second interval are determined to be smooth intervals.

6. The working condition diagnosis method according to any one of claims 4, characterized in that, The process of obtaining the diagnostic condition based on the geometric features includes: The standard maximum load value and standard minimum load value are obtained based on the standard indicator diagram; The first ratio is obtained based on the maximum load value, minimum load value, standard maximum load value, and standard minimum load value. The calculation formula is as follows: Ra = (ymax-ymin) / (ynmax-ynmin); Where Ra is the first ratio; ymax is the maximum load value; ymin is the minimum load value; ynmax is the standard maximum load value; and ynmin is the standard minimum load value. The second ratio is obtained based on the maximum load value, the standard maximum load value, and the standard minimum load value. The calculation formula is as follows: Ru = (ynmax-ymax) / (ynmax-ynmin); Where Ru is the second ratio; The third ratio is obtained based on the minimum load value, the standard maximum load value, and the standard minimum load value. The calculation formula is as follows: Rd= (ymin-ynmin) / (ynmax-ynmin); Where Rd is the third ratio; If Ra is less than the third preset value but greater than the fourth preset value, and Ru is greater than the fourth preset value and Rd is less than the fifth preset value, the diagnostic condition is tubing leakage; if Ra is less than the fourth preset value, Ru is greater than the third preset value, and Rd is greater than the sixth preset value, the diagnostic condition is floating valve failure; if Ru is greater than the seventh preset value and Rd is less than 0, the diagnostic condition is tubing breakage; if Ru is less than the fifth preset value and Rd is greater than the eighth preset value, the diagnostic condition is fixed valve failure; if Ra is greater than the ninth preset value, ymax > ynmax and ynmin > ymin, the diagnostic condition is oil viscosity in the pumping well; if ymax - ymin = 0, the diagnostic condition is pump impact; if the geometric characteristics of the upper stroke include two adjacent smooth intervals, and the average load value corresponding to the earlier smooth interval is greater than the average load value corresponding to the later smooth interval, the diagnostic condition is plunger dislodging from the working barrel.

7. The working condition diagnosis method according to claim 6, characterized in that, The method further includes: The point where the change interval in the upper stroke is transformed into a smooth interval is taken as the fixed valve open point, and the point corresponding to the maximum displacement in the upper stroke is taken as the fixed valve closed point. The point corresponding to the minimum displacement in the next stroke is taken as the closed point of the moving valve, and the point where the smooth interval in the next stroke is transformed into the changing interval is taken as the open point of the moving valve. If there are two smoothing intervals in the above stroke, and the distance from the first smoothing interval to the minimum load is less than the distance from the second smoothing interval to the minimum load, and the distance from the second smoothing interval to the maximum load is less than the distance from the first smoothing interval to the maximum load, then the diagnostic condition is hysteresis of the moving valve closing. If there is only one smooth interval in the upper stroke and only one smooth interval in the lower stroke, the diagnostic condition is determined again by the fourth ratio. The formula for calculating the fourth ratio is: Rs=Xad / Xbc; where the distance between the closed point and the open point of the moving valve is Xad, and the distance between the closed point and the open point of the fixed valve is Xbc; if Rs is less than the tenth preset value, the diagnostic condition changes to moving valve leakage; if Rs is greater than the eleventh preset value, the diagnostic condition changes to fixed valve leakage.

8. The working condition diagnosis method according to claim 1, characterized in that, The process of obtaining the dynamometer diagram based on the displacement data and load data includes: The target load data is obtained by filtering and preprocessing the load data using a moving average filtering algorithm. The dynamometer diagram is obtained using a drawing tool based on the displacement data and the target load data.

9. The working condition diagnosis method according to claim 1, characterized in that, The step of obtaining the target operating condition by re-identifying and confirming the diagnostic operating condition through the neural network model corresponding to the diagnostic operating condition includes: Pre-train corresponding neural network models for different diagnostic conditions; Once the diagnostic working condition is determined through geometric features, the corresponding neural network model for the diagnostic working condition is used for identification. If the identification result is consistent with the diagnostic working condition, the diagnostic working condition is determined as the target working condition; if the identification result is inconsistent with the diagnostic working condition, the working condition diagnosis for the next working cycle of the pumping unit well will begin immediately.

10. The working condition diagnosis method according to claim 7, characterized in that, It also includes comprehensive operating conditions, which are normal operating conditions, slight fluid insufficiency, insufficient fluid supply, and severe fluid insufficiency. The operating condition diagnosis method further includes: Based on the geometric features, a vector Q is generated, Q=[ V1,V2,V3,V4], where V1,V2,V3 and V4 respectively represent the probability of normal operation, slight fluid insufficiency, fluid insufficiency and severe fluid insufficiency determined by the geometric features. The dynamometer used for training is taken as input and processed by a neural network with the ResNet50 architecture to obtain a classification matrix, P=[W1,W2,W3,W4], where P is the classification matrix and W1, W2, W3 and W4 respectively represent the probability of normal dynamometer, slight fluid insufficiency, fluid insufficiency and severe fluid insufficiency output by the model. After performing a cross operation on Q and P, we obtain the cross matrix H = [W1×V1, W2×V2, W3×V3, W4×V4], where H is the cross matrix; The probability dataset N = {p1, p2, p3, p4} is calculated using the softmax function based on the cross matrix. Here, N is the probability dataset, and p1, p2, p3, and p4 represent the probabilities of normal dynamometer, slight fluid insufficiency, fluid insufficiency, and severe fluid insufficiency, respectively. The comprehensive working condition corresponding to the highest probability among p1, p2, p3, and p4 is taken as the target comprehensive working condition.