A method for downhole fault diagnosis of rod pumping units based on machine learning
Real-time detection of the pumping unit dynamometer diagram using a machine learning-based method solves the problem of inaccurate judgment in the existing technology, enables timely discovery and accurate diagnosis of pumping unit faults, and reduces energy waste.
Patent Information
- Application Number
- CN202210739084.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-06-28
AI Technical Summary
The existing pumping unit dynamometer identification method lacks real-time performance and accuracy, resulting in failure to detect pumping unit faults in time, resulting in energy waste and error judgment.
Using a method based on machine learning, the original data space is constructed by collecting and preprocessing dynamometer data, and local linear embedding and support vector machine classification are performed to achieve real-time detection of pumping unit faults. Specific steps include data vectorization, cross-sectional space construction, weak nonlinear projection and dimensionality reduction to improve diagnostic accuracy.
It realizes real-time monitoring and fault detection of the operating status of the pumping unit, reduces wasted work, reduces energy consumption, and improves diagnostic accuracy.
Smart Images

Figure CN115059455B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of oil well fault diagnosis, and in particular to a method for downhole fault diagnosis of a rod pumping unit based on machine learning. Background Art
[0002] Rod pumping wells are the main production method of oil fields at home and abroad. To achieve its continuous, stable and efficient operation is an important measure to improve the production efficiency of oil wells, reduce production costs and reduce production safety hazards. At the same time, the pumping unit indicator diagram is the main method to judge the operating status of the pumping unit, and it is also the main basis for diagnosis when the pumping unit fails. It plays a vital role in the adjustment of the operating status of the pumping unit and the maintenance and repair of the pumping unit.
[0003] At present, in the actual application of oil fields, the judgment and identification of the pumping unit indicator diagram are mainly realized manually. However, the manual identification method is not real-time and cannot detect the failure of the pumping unit in time. The useless work done by the faulty pumping unit leads to a huge waste of energy. At the same time, the manual identification method is prone to human error, and wrong judgment will also affect the oil field production.
[0004] With the development of computer information technology, the use of computers to diagnose downhole faults in pumping wells can improve data processing efficiency. However, the existing computer methods cannot give real-time and accurate results when judging the state of the pumping well by using the indicator diagram. Summary of the invention
[0005] The technical problems to be solved by the present invention are:
[0006] In order to solve the problem that the existing methods lack real-time and accuracy in judging the pumping unit indicator diagram.
[0007] The present invention adopts the following technical solutions to solve the above technical problems:
[0008] The present invention provides a method for downhole fault diagnosis of a rod pumping unit based on machine learning, comprising the following steps:
[0009] Step 1: Collect the pumping unit indicator diagram under different operating conditions, pre-process the pumping unit indicator diagram, cut the pre-processed pumping unit indicator diagram into four partial curves according to the average stroke and average load, mark each partial curve, and then divide the four partial curves into multiple curve segments, solve the torque of each curve segment and combine them in order, vectorize the indicator diagram curve, generate the original data set, and construct the original data space of the pumping unit indicator diagram vector under different operating conditions;
[0010] Step 2: Project the dynamometer vector samples of the original data space to the tangent bundle, and construct the cross-sectional space through the first principal component of each sample fiber;
[0011] Step 3: construct two 1-ring neighborhoods of the cross-sectional space samples in turn, and then construct a weakly nonlinear cross-sectional space under the framework of minimizing the mean and variance simultaneously;
[0012] Step 4: using a local linear embedding algorithm to reduce the dimensionality of the samples in the weakly nonlinear cross-sectional space to extract significant features and obtain a low-dimensional feature set of the samples;
[0013] Step 5: Input the obtained low-dimensional feature set into the support vector machine, and detect the downhole fault of the rod pumping unit according to the classification result of the support vector machine.
[0014] Furthermore, the specific process of step one is:
[0015] Step 11: collecting n pumping unit indicator diagram data under different operating conditions, and performing maximum value normalization processing on each pumping unit indicator diagram data;
[0016] Step 12: using the average stroke and average load to divide the processed pumping unit indicator diagram data into four curve parts: lower left, upper left, upper right and lower right, and marking each curve part;
[0017] Step 13: Divide the marked dynamometer diagram into M curve segments, each of which consists of N discrete points (x i ,y i ), i = 1, 2, ... N, calculate the p + q rank geometric moment m of each curve segment pq and central moment μ pq , the specific calculation process is:
[0018]
[0019]
[0020] Among them, m pq is the geometric moment, μ pq is the geometric center moment, p,q=0,1,2,…,Δl i is (x i ,y i ) and the distance between adjacent discrete points,
[0021] And the torque of all curve segments is combined in order to obtain the vectorized pumping unit indicator diagram:
[0022] Where D is the vector feature dimension;
[0023] Step 14: Construct the original data space sample set based on the dynamometer diagrams of the pumping unit under different vectorized operating states
[0024] Furthermore, the calculation formula for the minimum-maximum normalization is as follows:
[0025]
[0026]
[0027] where and represent displacement and load data; x i and y i represent the standardized data.
[0028] Furthermore, the specific process of Step 2 is as follows:
[0029] Step 21: Use the k-means algorithm (0 < k < n) to determine the n central blocks of the original space sample set of the original space sample set
[0030] The central block contains itself and the k groups of samples with the smallest distance from the original space sample That is
[0031] Step 22: Use the local principal component analysis method to calculate the covariance matrix of each central block where e is a column matrix of all 1s Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvector Θ i =[θ 1 , θ 2 , …, θ d , that is the corresponding fiber in the tangent bundle;
[0032] Step 23: Take the first principal component of each sample fiber to form the matrix Z = [z 1 , z 2 , …, z n ∈ R D×n where That is, the cross-sectional space is obtained.
[0033] Furthermore, the specific process of Step 3 is as follows:
[0034] Step 31: Use the k-means algorithm (0 < k < n) to calculate the distance between samples in the cross-sectional space, and divide the k 1 samples closest to each sample into the first-level 1-ring neighborhood The nearest neighbor indicator vector is si,1 ∈R n×1 ;
[0035] Step 3-2: Calculate the centroid sample of the first 1-ring neighborhood of sample z i of the first 1-ring neighborhood
[0036]
[0037] The near neighbor indication vector s i,1 ∈R n×1 used to identify the position of the first 1-ring neighborhood samples of sample z i i.e., s i,1 is an n-dimensional binary vector, which only marks 1 at the position of the first 1-ring neighborhood samples and marks 0 at the rest positions; then the centroid sample can be expressed as:
[0038]
[0039] Using the k-means algorithm (0 < k < n), calculate the distances between the centroid samples, and divide the k centroid samples closest to each centroid sample into the second 1-ring neighborhood, 1 whose near neighbor indication vector is s ∈R i,2 ; n×1 ;
[0040] Step 3-3: Solve the projection matrix P ∈ R that projects the samples in the cross-section space to a new cross-section space, D×D using the framework of minimizing both the mean and variance, so that this space has the property of weak nonlinearity. The specific calculation formula is:
[0041]
[0042] where λ is the adjustment operator for the mean and variance, and 0 ≤ λ ≤ 1. When λ = 0, the formula is a single mean minimization objective function; when λ = 1, the formula is a single variance minimization objective function;
[0043] Step 3-4: According to the solved projection matrix P, obtain the new weak nonlinear cross-section space sample set G ∈ R D×n , G = PZ = [g 1 , g 2 , …, g n .
[0044] Furthermore, the specific process of the said Step 4 is:
[0045] Step 4-1: Divide the sample neighborhood: Using the k-means algorithm (0 < k < n), divide the new weak nonlinear cross-section space sample set G ∈ R D×nThe k closest to each sample 2 The samples are divided into sample neighborhoods;
[0046] Step 4.2: Calculate the local reconstruction weight W: Linearly reconstruct each sample in the sample neighborhood and obtain W∈R by minimizing the reconstruction error n×n , the specific calculation formula is:
[0047]
[0048] in, g i Neighborhood, w ij For sample x i With x j The reconstruction weight between When ij =0;
[0049] Step 43: Calculate the low-dimensional embedding result Y: Minimize the linear reconstruction error ε(Y) in the low-dimensional space by keeping the original reconstruction weight structure unchanged;
[0050]
[0051] Further matrixing equation (9) yields:
[0052]
[0053] Among them, I i , W i are the i-th column vectors of I and W respectively, M=(IW)(IW) T .
[0054] Applying the Lagrange multiplier method to equation (10) yields Y, which is the eigenvector corresponding to the k smallest non-zero eigenvalues of M.
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] The invention discloses a method for downhole fault diagnosis of a rod pumping unit based on machine learning. The geometric characteristics of a surface indicator diagram of the pumping unit under various working conditions are manifested as changes in the opening and closing positions of a floating valve and a fixed valve in a plunger, thereby reflecting the operating state of the pumping unit. The indicator diagram is divided into four parts, which is conducive to respectively judging the opening and closing moments of the floating valve and the fixed valve, thereby improving the accuracy of diagnosis. The double 1-ring neighborhood considers the information supplement of the cross-sectional space to the original data. The multiple neighborhood and mean square error framework project the original data to the weakly nonlinear cross-sectional space, thereby improving the dimensionality reduction effect of the local linear embedding algorithm, further restoring the operating characteristics of the pumping unit, and being more conducive to the computer to perform online monitoring and real-time discrimination on the indicator diagram of the pumping unit, thereby being able to timely issue an early warning to the pumping unit with abnormal operating state or fault, reducing the situation where the pumping unit generates useless work, reducing energy consumption, and achieving energy-saving effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flow chart of a method for downhole fault diagnosis of a rod pumping unit based on machine learning in an embodiment of the present invention;
[0058] Figure 2 A schematic diagram of a vectorized pumping unit indicator diagram according to an embodiment of the present invention;
[0059] Figure 3 It is a curve diagram of the final pumping unit indicator diagram data obtained after processing in an embodiment of the present invention;
[0060] Figure 4 The following are classification results of different types of pumping unit states obtained by the support vector machine in the embodiment of the present invention. DETAILED DESCRIPTION
[0061] In the description of the present invention, it should be noted that the terminology nouns in the various embodiments, such as "up", "down", "front", "back", "left", "right", etc., which indicate directions, are only for simplifying the description of the positional relationship based on the drawings in the specification, and do not mean that the referred elements and devices must be operated according to the specific directions and defined operations and methods and structures in the specification. Such directional nouns do not constitute a limitation on the present invention.
[0062] In the description of the present invention, it should be noted that the terms "first", "second", and "third" mentioned in the embodiments of the present invention are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0063] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0064] Combination Figures 1 to 3 As shown, the present invention provides a method for downhole fault diagnosis of a rod pumping unit based on machine learning, comprising the following steps:
[0065] Step 1: Collect the pumping unit indicator diagram under different operating conditions, pre-process the pumping unit indicator diagram, cut the pre-processed pumping unit indicator diagram into four partial curves according to the average stroke and average load, mark each partial curve, and then divide the four partial curves into multiple curve segments, solve the torque of each curve segment and combine them in order, vectorize the indicator diagram curve, generate the original data set, and construct the original data space of the pumping unit indicator diagram vector under different operating conditions;
[0066] Step 2: Project the dynamometer vector samples of the original data space to the tangent bundle, and construct the cross-sectional space through the first principal component of each sample fiber;
[0067] Step 3: construct two 1-ring neighborhoods of the cross-sectional space samples in turn, and then construct a weakly nonlinear cross-sectional space under the framework of minimizing the mean and variance simultaneously;
[0068] Step 4: using a local linear embedding algorithm to reduce the dimensionality of the samples in the weakly nonlinear cross-sectional space to extract significant features and obtain a low-dimensional feature set of the samples;
[0069] Step 5: Input the obtained low-dimensional feature set into the support vector machine, and detect the downhole fault of the rod pumping unit according to the classification result of the support vector machine.
[0070] The specific process is as follows: collect n pumping unit indicator diagram data under different operating conditions, and perform maximum value normalization processing on each pumping unit indicator diagram data according to formula (1) and formula (2).
[0071]
[0072]
[0073] in, and Represents displacement and load data; x i and i Represents the normalized data.
[0074] The processed pumping unit dynamometer data is divided into four curves: lower left, upper left, upper right and lower right, using the average stroke and average load, and marked as points A, B, C and D; the marked dynamometer is divided into M curve segments, each of which consists of N discrete points (x i ,y iComposed of, i = 1, 2, … N, calculate the p+q rank geometric moment m of each curve segment according to formula (3) and formula (4) pq and the central moment μ pq , and the specific calculation process is as follows:
[0075]
[0076]
[0077] where, m pq is the geometric moment, μ pq is the geometric central moment, p, q = 0, 1, 2, …, Δl i is the distance between (x i , y i ) and the adjacent discrete points,
[0078] As Figure 2 shown, perform an ordered combination of the moments of all curve segments to obtain the vectorized dynamometer card of the pumping unit: where, D is the vector feature dimension;
[0079] Construct the original data space sample set according to the vectorized dynamometer cards of the pumping unit under different operating states
[0080]
[0081] Use the k-means algorithm (0 < k < n) to determine the n central blocks of the original space sample set The central block contains itself and the k groups of samples with the smallest distance from the original space sample , that is Use the local principal component analysis method to calculate the covariance matrix of each central block where, e is a column matrix of all 1s, Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvector Θ i =[θ 1 , θ 2 , …, θ d , that is The corresponding fiber in the tangent bundle;
[0082] Take the first principal component of each sample fiber to form the matrix Z = [z 1 , z 2 , …, z n ∈ R D×n , where, That is, the cross-sectional space is obtained.
[0083] Using the k-means algorithm (0 < k < n), calculate the distance between samples in the cross-sectional space, and divide the k samples closest to each sample into the first-layer 1-ring neighborhood. 1 The first-layer 1-ring neighborhood The nearest neighbor indicator vector is s i,1 ∈R n×1 ;
[0084] Calculate the centroid sample of the first-layer 1-ring neighborhood of sample z according to formula (5). i The centroid sample of the first-layer 1-ring neighborhood
[0085]
[0086] The nearest neighbor indicator vector s i,1 ∈R n×1 is used to identify the positions of the samples in the first-layer 1-ring neighborhood of sample z, that is, s i is an n-dimensional binary vector, which only marks 1 at the positions of the samples in the first-layer 1-ring neighborhood and 0 at the rest positions; then the centroid sample i,1 can be expressed by formula (6): can be expressed as:
[0087]
[0088] Using the k-means algorithm (0 < k < n), calculate the distance between centroid samples, and divide the k centroid samples closest to each centroid sample into the second-layer 1-ring neighborhood. 1 The second-layer 1-ring neighborhood Its nearest neighbor indicator vector is s i,2 ∈R n×1 ;
[0089] Solve the projection matrix P ∈ R that projects the samples in the cross-sectional space onto a new cross-sectional space, and use the framework of minimizing both the mean and variance to make this space have the property of weak nonlinearity. The specific calculation formula is shown in formula (7): D×D where λ is the adjustment operator for the mean and variance, and 0 ≤ λ ≤ 1. When λ = 0, the formula is a single mean minimization objective function, and when λ = 1, the formula is a single variance minimization objective function;
[0090]
[0091] Among them, λ is the adjustment operator for the mean and variance, and 0 ≤ λ ≤ 1. When λ = 0, the formula is a single mean minimization objective function, and when λ = 1, the formula is a single variance minimization objective function;
[0092] According to the obtained projection matrix P, obtain the new weak nonlinear cross-sectional space sample set G ∈ R D×n , G = PZ = [g 1 , g 2 , …, g n .
[0093] Partition the sample neighborhood: Using the k-means algorithm (0 < k < n), partition the sample set G of the new weak non-linear cross-section space in R D×n into the k samples that are closest to each sample, and partition them into the sample neighborhood; 2
[0094] Calculate the local reconstruction weight W: Linearly reconstruct each sample in the sample neighborhood, and obtain W ∈ R by minimizing the reconstruction error n×n , and the specific calculation formula is shown in formula (8):
[0095]
[0096] where is the neighborhood of g i , w ij is the reconstruction weight between the sample x i and x j , and when , w ij = 0;
[0097] Calculate the low-dimensional embedding result Y: By keeping the original reconstruction weight structure unchanged, minimize the linear reconstruction error ε(Y) in the low-dimensional space;
[0098]
[0099] Further matrixize formula (9) to get:
[0100]
[0101] where I i , W i are the i-th column vectors of I and W respectively, and M = (I - W)(I - W) T .
[0102] Using the Lagrange multiplier method on equation (10) can obtain Y, that is, the eigenvectors corresponding to the k smallest non-zero eigenvalues of M. As Figure 3 shown is the curve schematic diagram of the final dynamometer card data of the pumping unit obtained.
[0103] Input the obtained low-dimensional feature set into the trained support vector machine to obtain the state classification result of the pumping unit.
[0104] As Figure 4 shown, it is the classification result of the states of different types of pumping units obtained by the support vector machine. The obtained classification result is consistent with the pumping unit state result obtained through dynamometer card analysis, and the clustering effect of each classification result is good. The distance between different classification results is far, achieving a good classification effect.
[0105] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A method for downhole fault diagnosis of a rod pumping unit based on machine learning, characterized in that The steps include: Step 1: Collect the pumping unit indicator diagram under different operating conditions, pre-process the pumping unit indicator diagram, cut the pre-processed pumping unit indicator diagram into four partial curves according to the average stroke and average load, mark each partial curve, and then divide the four partial curves into multiple curve segments, solve the torque of each curve segment and combine them in order, vectorize the indicator diagram curve, generate the original data set, and construct the original data space of the pumping unit indicator diagram vector under different operating conditions; The specific process is: Step 11: collecting n pumping unit indicator diagram data under different operating conditions, and performing maximum value normalization processing on each pumping unit indicator diagram data; Step 12: using the average stroke and average load to divide the processed pumping unit indicator diagram data into four curve parts: lower left, upper left, upper right and lower right, and marking each curve part; Step 13: Divide the marked dynamometer diagram into M curve segments, each of which consists of N discrete points (x i ,y i ), i = 1, 2, ... N, calculate the p + q rank geometric moment m of each curve segment pq and central moment μ pq , the specific calculation process is: Among them, m pq is the geometric moment, μ pq is the geometric center moment, p,q=0,1,2,…,Δl i is (x i ,y i ) and the distance between adjacent discrete points, And the torque of all curve segments is combined in order to obtain the vectorized pumping unit indicator diagram: Where D is the vector feature dimension; Step 14: Construct the original data space sample set based on the vectorized pumping unit indicator diagram under different operating conditions Step 2: Project the dynamometer vector samples of the original data space to the tangent bundle, and construct the cross-sectional space through the first principal component of each sample fiber; the specific process is: Step 2-1: Use the k-means algorithm (0 < k < n) to determine the n central blocks of the original space sample set of the original space sample set The center block contains itself and the distance to the original space sample The smallest k groups of samples, that is Step 2: Use the local principal component analysis method to calculate the covariance matrix of each central block Among them, e is a column matrix of all 1s, Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvector Θ i =[θ1,θ2,…,θ d ],Right now corresponding fibers in the tangent bundle; Step 23: Take the first principal component matrix of each sample fiber Z = [z1, z2, ..., z n ]∈R D×n ,in, That is, we get the cross-sectional space; Step 3: construct two 1-ring neighborhoods of the cross-sectional space samples in turn, and then construct a weakly nonlinear cross-sectional space under the framework of minimizing the mean and variance simultaneously; Step 4: using a local linear embedding algorithm to reduce the dimensionality of the samples in the weakly nonlinear cross-sectional space to extract significant features and obtain a low-dimensional feature set of the samples; Step 5: Input the obtained low-dimensional feature set into the support vector machine, and detect the downhole fault of the rod pumping unit according to the classification result of the support vector machine.
2. A method for downhole fault diagnosis of a rod pumping unit based on machine learning according to claim 1, characterized in that The calculation formula for the maximum value normalization is: in, and Represents displacement and load data; x i and i Represents the normalized data.
3. A method for downhole fault diagnosis of a rod pumping unit based on machine learning according to claim 2, characterized in that The specific process of step three is: Step 3.1: Using the k-means algorithm (0 < k < n), calculate the distance between samples in the cross-sectional space, and divide the k1 samples closest to each sample into the first-level 1-ring neighborhood The nearest neighbor indication vector is s i,1 ∈R n×1 ; Step 32: Calculate sample z i The first 1-ring neighborhood centroid sample Neighbor indicator vector s i,1 ∈R n×1 Used to identify sample z i The position of the first 1-ring neighborhood sample, that is, s i,1 is an n-dimensional binary vector, with 1 marked only at the location of the first 1-ring neighborhood sample and 0 marked at the rest; then the centroid sample It can be expressed as: Using the k-means algorithm (0 < k < n), calculate the distances between the centroid samples, and divide the k1 centroid samples closest to each centroid sample into the second-level 1-ring neighborhood. Its neighbor indication vector is s i,2 ∈R n×1 ; Step 3. Solve the projection matrix P∈R that projects the sample in the cross-sectional space to a new cross-sectional space D×D , using the framework of minimum mean and variance at the same time, the space has weak nonlinear properties. The specific calculation formula is: Among them, λ is the adjustment operator of mean and variance, and 0≤λ≤1. When λ=0, the formula is a single mean minimization objective function, and when λ=1, the formula is a single variance minimization objective function; Step 3 and 4: According to the solved projection matrix P, obtain the new weak nonlinear cross-section space sample set G∈R D×n , G=PZ=[g1,g2,…,g n ].
4. A method for downhole fault diagnosis of a rod pumping unit based on machine learning according to claim 3, characterized in that The specific process of step 4 is as follows: Step 4-1. Divide the sample neighborhood: Using the k-means algorithm (0 < k < n), divide the k2 samples closest to each sample in the new weak non-linear cross-section space sample set G ∈ R D ×n into the sample neighborhood; Step 4.2: Calculate the local reconstruction weight W: Linearly reconstruct each sample in the sample neighborhood and obtain W∈R by minimizing the reconstruction error n×n , the specific calculation formula is: in, g i Neighborhood, w ij For sample x i With x j The reconstruction weight between When ij =0; Step 43: Calculate the low-dimensional embedding result Y: Minimize the linear reconstruction error ε(Y) in the low-dimensional space by keeping the original reconstruction weight structure unchanged; Further matrixing equation (9) yields: Among them, I i , W i are the i-th column vectors of I and W respectively, M=(IW)(IW) T Applying the Lagrange multiplier method to equation (10) yields Y, which is the eigenvector corresponding to the k smallest non-zero eigenvalues of M.
Citation Information
Cited By
Oil pumping unit indicator diagram fault diagnosis method based on deep learning
CN117094370A
Method for monitoring working condition of rod-pumped well based on load data symbol representation
CN119163399A
