Mechanical production well fault prediction method and system based on big data analysis and storage medium

Through the combination of big data mining and analysis and long-term memory neural network model, the shortcomings of oil well condition prediction in the existing technology are solved, accurate prediction of machine-recovery well fault conditions are achieved, and prediction capabilities and efficiency of oil well production are improved.

CN119848498APending Publication Date: 2025-04-18PETROCHINA CO LTD

Patent Information

Application Number
CN202311343747.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively use big data intelligent analysis methods to predict oil well conditions, and there is a lack of accurate prediction methods for machine-recovery well failures.

Method used

The big data mining analysis method is used to collect massive data of the machine-recorded wells, and the long-term memory neural network (LSTM) model is used to predict the change trends of oil wells' grinding, corrosion and scaling fault conditions.

Benefits of technology

It realizes accurate prediction of the working conditions of oil wells with abrasive, corrosion and scale failures, and can quickly and accurately analyze the possible faults and trends in oil well production, improving the prediction capacity and efficiency of oil well production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848498A_ABST
    Figure CN119848498A_ABST
Patent Text Reader

Abstract

The invention discloses a mechanical production well fault prediction method and system based on big data analysis and a storage medium. The method comprises the steps of collecting oil well working condition related data; characteristic parameters having potential relations with oil well eccentric wear, corrosion and scaling fault working conditions are counted; finding out master control influence factors from the characteristic parameters through correlation analysis; the weight of each master control influence factor is obtained, and oil well eccentric wear, corrosion and scaling fault working condition indexes are obtained through calculation; selecting data from the collected oil well working condition related data according to the oil well eccentric wear, corrosion and scaling fault working condition indexes to create a training set and a test set, and training a pre-established long-short term memory neural network model; using the trained long-short-term memory neural network model to predict oil well fault working conditions according to the oil well working condition related data, and analyzing faults and trends of oil well production according to the fault working conditions. According to the method, the mass data of the mechanical production well is acquired by utilizing a big data mining analysis method, and the faults and trends which can occur in oil well production can be accurately predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of oil well production, and specifically relates to a machine-produced well fault prediction method, system and storage medium based on big data analysis. Background Art

[0002] Oil well operating condition diagnosis technology mainly uses geometric feature algorithms to analyze and calculate the vector chain of the pump power diagram in real time, and compares it with various standard operating condition vector chain libraries to achieve oil well operating condition diagnosis.

[0003] Research on oil well condition diagnosis based on machine learning algorithms falls into three main categories: one uses power diagrams for diagnosis, such as graph-based training using convolutional neural network algorithms; another uses power diagram feature data to implement real-time diagnosis of oil well conditions using algorithms such as BP neural networks, extreme learning machines, and support vector machines. The third category uses electrical parameter data for big data analysis. For example, the China National Petroleum Exploration and Development Institute and Changqing Oilfield have jointly conducted research on oil well condition diagnosis and production calculation technology based on big data analysis of electrical parameters of pumping wells. This is a preliminary exploration and attempt at intelligent big data in pumping systems.

[0004] Related existing technologies, such as the "Intelligent Diagnosis Method for Downhole Working Conditions Based on Big Data Analysis" (application number 202211184297.2), propose to obtain real-time vibration acceleration data of the pumping unit's bare rod, label the acceleration data of different working conditions, draw a map and store it in the sample library for training, so as to identify the downhole working conditions.

[0005] With the development of digital information technology in oil fields, a large amount of real-time data is generated during oil well production, such as dynamic and static data, dynamometer diagrams, dynamic liquid levels, three-phase electrical parameters, and casing pressure. These data can reflect the production status of the oil well and are important parameters for monitoring and predicting oil well conditions. Big data intelligent analysis technology is characterized by its ability to efficiently process complex data, unlock the potential value of data, and implement data mining algorithms and predictive analysis. The applicant's literature research has not yet found any relevant research on the use of big data intelligent analysis methods to predict oil well conditions. Summary of the Invention

[0006] The purpose of the present invention is to address the problems in the above-mentioned prior art and provide a method, system and storage medium for predicting faults in machine-produced wells based on big data analysis. The method uses big data mining and analysis methods to collect massive data on machine-produced wells, and applies a long short-term memory neural network (LSTM) model to accurately predict the changing trends in the degree of eccentric wear, corrosion and scaling fault conditions in oil wells.

[0007] In order to achieve the above object, the present invention has the following technical solutions:

[0008] In a first aspect, a method for predicting failures of pumped wells based on big data analysis is provided, comprising the following steps:

[0009] Collect data related to oil well operating conditions;

[0010] Collect statistics on characteristic parameters potentially related to oil well eccentric wear, corrosion, and scaling failure conditions;

[0011] Find out the main controlling factors from the characteristic parameters through correlation analysis;

[0012] Obtain the weights of each major control factor and calculate the oil well eccentric wear, corrosion, and scaling fault condition indexes;

[0013] According to the oil well eccentric wear, corrosion, and scaling fault condition indexes, data is selected from the collected oil well operating data to create training and test sets, and the pre-established long-short-term memory neural network model is trained;

[0014] The trained long short-term memory neural network model is used to predict the oil well eccentric wear, corrosion, and scaling failure conditions based on the relevant data of the oil well operating conditions. The failures and trends that may occur in oil well production are analyzed based on the oil well eccentric wear, corrosion, and scaling failure conditions.

[0015] As a preferred solution, the step of collecting data related to oil well operating conditions includes indicator diagrams, electrical parameters, start and stop status data collected from the oil well, as well as liquid production, pump efficiency, pump fullness, well opening rate data, and also includes fault type and fault time.

[0016] As a preferred solution, the step of counting characteristic parameters that have a potential relationship with the oil well eccentric wear, corrosion, and scaling fault conditions, the characteristic parameters that have a potential relationship with the oil well eccentric wear, corrosion, and scaling fault conditions include maximum load line value, minimum load line value, average load difference, upper and lower end point load difference, downstroke effective stroke, upstroke maximum power, downstroke maximum power, upstroke average power, downstroke average power, power balance, average power balance, power consumption per stroke, average active power, root mean square power, maximum load line value / maximum load, minimum load line value / minimum load, average load difference / maximum load line value, average load difference / minimum load line value, bandwidth, stroke, and stroke frequency; and statistics are performed on the maximum value, minimum value, and average value of the above characteristic parameters.

[0017] As a preferred solution, data preprocessing is also included for the characteristic parameters obtained by statistics. Data preprocessing includes using pandas to perform statistics on the collected oil well working condition data and using describe() to observe the statistical description of the data. The statistical data is continuous and includes:

[0018] count: the number of elements in a column;

[0019] mean: the average value of a column of data;

[0020] std: mean square deviation of a column of data;

[0021] min: the minimum value in a column of data;

[0022] max: the maximum value in a column;

[0023] 25%: The average value of the first 25% of the data in a column;

[0024] 50%: The average value of the first 50% of the data in a column;

[0025] 75%: The average of the first 75% of the data in a column of data;

[0026] For data columns whose values ​​are always 0 or whose changes are less than the limit, they are processed by elimination.

[0027] As a preferred solution, the step of finding the main influencing factors from the characteristic parameters through correlation analysis includes using the Pearson correlation coefficient to reflect the degree of correlation between two continuous variables X and Y. The Pearson correlation coefficient of two n-dimensional vectors x and y is calculated as follows:

[0028]

[0029] Where, Represents the average value of the elements in x and y;

[0030] r xy represents the Pearson correlation coefficient, which is a real number in [-1, 1];

[0031] When r xy When >0, it means the two variables are positively correlated; otherwise, they are negatively correlated; |r xy The larger | is, the higher the correlation between x and y is;

[0032] And use Spearman correlation coefficient to evaluate the monotonic relationship between two continuous or ordinal variables; for a sample size of n, n original data X i ,Y i is converted into level data x i ,y i , the Spearman correlation coefficient ρ is calculated as follows:

[0033]

[0034] According to the Pearson correlation coefficient and the Spearman correlation coefficient, when the correlation between two features is greater than 0.8, one of the features is removed.

[0035] As a preferred solution, the step of obtaining the weights of each main control influencing factor and calculating the oil well eccentric wear, corrosion, and scaling fault condition index adopts the principal component analysis method to calculate the parameter covariance matrix of the main control influencing factors, diagonalizes the covariance matrix to obtain the eigenvalues ​​of the covariance matrix, that is, the weights of each main control influencing factor, multiplies the weights of the main control influencing factors with the corresponding parameters and then adds them to obtain a comprehensive index, and normalizes the comprehensive index to obtain the oil well eccentric wear, corrosion, and scaling fault condition index.

[0036] As a preferred solution, the principal component analysis method uses variance to measure the amount of information, and the sample set is {X=[X 1j ,X 2j ,…,X nj ] T 0≤j≤m-1}, n is the number of master control parameters, m is a certain moment, X nj =[x n1 ,x n2 ,…,x nj ]; construct all samples into an n×m matrix, which is the covariance matrix. Let the covariance matrix be A, then:

[0037]

[0038] Where: x nj Indicates the sample attribute value corresponding to the parameter of the nth main controlling factor in the data set at time j;

[0039] Indicates the average value of all parameter values ​​of the nth master control factor:

[0040]

[0041] Let the set of eigenvectors of matrix A be υ, and the eigenvalue corresponding to the eigenvector υ is λ i (i=1,2,…,n);

[0042] The relationship between matrix, eigenvalue and eigenvector is:

[0043] Av=λ i υ

[0044] Construct the eigenvalue formula for solving the characteristic matrix:

[0045] |λ i EA|=0

[0046] Where: E represents the identity matrix;

[0047] Assume that the main control parameter value input at a certain time t is X t=(x 1t ,x 2t ,…,x nt ), then the comprehensive index CI t The calculation formula is:

[0048] CI t =λX t T

[0049] Where: λ is the eigenvalue vector composed of the eigenvalues ​​of matrix A, λ=(λ1,λ2,…λ n );

[0050] The comprehensive index at each moment within time t is calculated as:

[0051] CI=(CI0,CI1,…,CI t )

[0052] The obtained comprehensive index is normalized to obtain the oil well eccentric wear, corrosion, scaling fault condition index, which is the oil well eccentric wear, corrosion, scaling index, and the eccentric wear, corrosion, scaling index at time t is HI t The calculation formula is:

[0053]

[0054] The eccentric wear, corrosion, and scaling indexes at each moment within time t are:

[0055] HI=(HI0,HI1,…,HI t ).

[0056] As a preferred solution, the step of selecting data from the collected oil well operating condition-related data to create a training set and a test set according to the oil well eccentric wear, corrosion, and scaling fault operating condition index, and training the pre-established long short-term memory neural network model, the nodes of the long short-term memory neural network model include an input gate, an output gate, a forget gate, and a cell, wherein the cell is the core of the long short-term memory neural network model calculation node, which is used to record the current state. The calculation formula is as follows:

[0057]

[0058] Where: a c is the forget gate; t is the time; i is the input gate sample number; x t is the input gate sample; w ic is the input gate weight; is the input of the input gate at time t; H is the number of forget gate samples; h is the sequence number of forget gate samples; b h is the forget gate sample; w hcis the forget gate weight: Input to the forget gate at time t-1;

[0059] The cell state output s at time t c (t) is calculated as follows:

[0060] s c (t) = b φ (t)s c (t-1)+b l (t)g[a c (t)]

[0061] Where: b l (t)g[a c (t)] is the forget gate and a at time t c (t) product of mappings; b φ (t)s c (t-1) is the product of the forget gate at time t and the cell state output at time t-1; g() represents the mapping function;

[0062] The model is trained based on the XGBoost model algorithm, and the grid search method is used to optimize the model hyperparameters.

[0063] Secondly, a system for predicting the working conditions of mechanically-produced wells based on big data analysis is provided, including:

[0064] Data collection module, used to collect data related to oil well operating conditions;

[0065] Characteristic parameter statistics module, used to count characteristic parameters potentially related to oil well eccentric wear, corrosion, and scaling fault conditions;

[0066] The main control influencing factor analysis module is used to find the main control influencing factors from the characteristic parameters through correlation analysis;

[0067] The oil well eccentric wear, corrosion, and scaling fault condition index calculation module is used to obtain the weight of each main control influencing factor and calculate the oil well eccentric wear, corrosion, and scaling fault condition index;

[0068] The model training module is used to select data from the collected oil well operating condition data according to the oil well eccentric wear, corrosion, and scaling fault condition index to create training sets and test sets, and train the pre-established long-short-term memory neural network model;

[0069] The oil well eccentric wear, corrosion, and scaling fault condition prediction module is used to use the trained long-short term memory neural network model to predict the oil well eccentric wear, corrosion, and scaling fault conditions based on the oil well operating condition related data, and analyze the faults and trends that may occur in oil well production based on the oil well eccentric wear, corrosion, and scaling fault conditions.

[0070] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the machine-produced well fault prediction method based on big data analysis is implemented.

[0071] Compared with the prior art, the present invention has at least the following beneficial effects:

[0072] The data related to the oil well working condition is collected and sorted on the existing data platform, and the characteristic parameters with potential relationship with the oil well eccentric wear, corrosion and scaling fault conditions are statistically analyzed. The oil well eccentric wear, corrosion and scaling fault conditions include oil well eccentric wear, scaling, corrosion, etc. The main control influencing factors are found from the characteristic parameters through correlation analysis, and then the weights of each main control influencing factor are obtained, and the oil well eccentric wear, corrosion and scaling fault condition index is obtained by merging. The long and short time memory neural network model is trained. The present invention can find the real reasons for the broken rod, pipe leakage, stuck pump, etc. through the oil well pump inspection records, such as the rod caused by eccentric wear. Breaks or pipe leaks, as well as pump sticking caused by scaling, take the fault time as the node, collect the previous oil well power diagrams and electrical parameters and other production data, carry out the prediction of the changing trend of the characteristics of the oil well eccentric wear, corrosion, and scaling fault working conditions, establish the sample data of the oil well eccentric wear, corrosion, and scaling fault working condition index, and train the long short-term memory neural network model. The trained long short-term memory neural network model can be used to quickly and accurately predict the changing trend of the degree of the oil well eccentric wear, corrosion, and scaling fault working conditions based on the currently collected oil well working condition related data, and then analyze the faults and trends that may occur in oil well production. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0074] Figure 1 Flowchart of a method for predicting failures of mechanically-produced wells based on big data analysis according to an embodiment of the present invention;

[0075] Figure 2 The embodiment of the present invention uses the Pearson correlation coefficient to obtain a correlation heat map for oil well eccentric wear;

[0076] Figure 3 The embodiment of the present invention uses the Spearman correlation coefficient to obtain a correlation heat map for oil well eccentric wear;

[0077] Figure 4 A curve diagram showing changes in the oil well eccentric wear, corrosion, and scaling fault operating condition indices obtained in an embodiment of the present invention. DETAILED DESCRIPTION

[0078] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, ordinary technicians in this field can also derive other embodiments without making any creative work.

[0079] See also Figure 1 The method for predicting failures of mechanically-produced wells based on big data analysis in an embodiment of the present invention includes the following steps:

[0080] Step 1: Data collection and organization

[0081] The dynamometer diagrams, electrical parameters, and start-stop status data collected from oil wells are derived from the Changqing Oilfield Industrial Internet data collection platform. Data such as liquid production, pump efficiency, pump fullness, and well opening rate are derived from the Changqing Oilfield intelligent oil well system. The fault type and fault time are derived from the well repair and pump inspection report.

[0082] Step 2: Data feature analysis

[0083] The statistical information of various production characteristics that are potentially related to oil well eccentric wear, corrosion, and scaling failures is shown in Table 1.

[0084] Table 1

[0085] Serial number name unit Minimum Maximum average value 1 Maximum load line value KN 6.56 83.11 36.19 2 Minimum load line value KN 0.65 58.32 21.65 3 Average load difference KN 0.58 70.91 14.54 4 Load difference between upper and lower endpoints KN 0.72 77.11 15.99 5 Downstroke effective stroke m 0 2.92 0.92 6 Maximum uplink power KW -7.01 32.57 4.14 7 Maximum downlink power KW -6.96 15.71 3.83 8 Uplink average power KW -7.76 9 2.25 9 Downlink average power KW -8.14 8.53 1.52 10 Power balance -7.5 9.75 1.28 11 Average power balance -437 493 0.97 12 Power consumption per stroke Wh 0 568.31 127.62 13 Average active power KW -7.92 5.54 1.90 14 RMS power KW 0 23.27 2.64 15 Maximum load line value / maximum load 0.01 1 0.98 16 Minimum load line value / minimum load 1 1.90 1.03 17 Average load difference / maximum load line value 0.13 0.91 0.39 18 Average load difference / minimum load line value 0.02 9.54 0.75 19 bandwidth 0.09 9.64 2.00 20 stroke m 1.81 2.97 2.57 21 rush / min-1 2.16 3.87 2.94

[0086] Step 3: Data preprocessing

[0087] Data preprocessing was performed, using statistical methods to examine the numerical distribution characteristics of each attribute, and attributes irrelevant to oil well conditions, duplicate attributes, and empty attributes were deleted. Simple statistics were performed on the collected machine mining system big data using pandas, and describe() was used directly to observe the statistical description of the data. The statistical data is continuous, as shown below:

[0088] count: the number of elements in a column;

[0089] mean: the average value of a column of data;

[0090] std: the mean square error of a column of data; (the arithmetic square root of the variance, reflecting the degree of dispersion of a data set: the larger the value, the greater the difference between the data, and the higher the degree of dispersion of the data in the data set; the smaller the value, the smaller the difference between the data, and the lower the degree of dispersion of the data in the data set)

[0091] min: the minimum value in a column of data;

[0092] max: the maximum value in a column;

[0093] 25%: The average value of the first 25% of the data in a column;

[0094] 50%: The average value of the first 50% of the data in a column;

[0095] 75%: The average of the first 75% of the data in a column of data;

[0096] Data column values ​​that are always 0 or have very small changes are processed by elimination.

[0097] Step 4: Correlation Analysis

[0098] Through correlation analysis, the importance of influencing factors is ranked.

[0099] The Pearson and Spearman correlation algorithms are used to analyze the correlation strength between the 21 features in Table 1. Considering the results of the two algorithms, the features with strong correlation with other features are deleted to achieve the effect of reducing redundant information.

[0100] The Pearson correlation coefficient is a linear correlation coefficient, denoted as r, which is used to reflect the degree of correlation between two continuous variables X and Y. The r value ranges from -1 to 1. The larger the absolute value, the stronger the correlation.

[0101] The formula for calculating the Pearson correlation coefficient of two n-dimensional vectors x and y is as follows:

[0102]

[0103] Where, ——the average value of the elements in x and y;

[0104] r xy ——Pearson correlation coefficient, a real number in [-1, 1].

[0105] When r xy When >0, the two variables are positively correlated; otherwise, they are negatively correlated. xy The larger | is, the higher the correlation between x and y is.

[0106] The Spearman correlation coefficient is defined as the Pearson correlation coefficient between ordinal variables. It is also used to reflect the degree of correlation between two variables, X and Y. It is often represented by the Greek letter ρ, and its value ranges from -1 to 1. The larger the absolute value, the stronger the correlation. However, the Spearman correlation coefficient assesses the monotonic relationship between two continuous or ordinal variables.

[0107] For a sample with a sample size of n, n original data X i ,Y iis converted into level data x i ,y i , the correlation coefficient ρ is:

[0108]

[0109] It is generally believed that when |correlation coefficient|>0.8, there is an extremely strong correlation. Therefore, this embodiment stipulates that when the correlation between two features is>0.8, one of the features can be removed based on field experience and the difficulty of data collection.

[0110] Step 5: Establish the wear, corrosion, and scaling index (HI) for machine-recovered wells

[0111] The main control parameters collected from all pumping unit eccentric wear wells were combined, and principal component analysis (PCA) was used to calculate the covariance matrix of these main control parameters, including average upstroke load, average load difference, average upstroke power, average power balance, power consumption per stroke, square root power, maximum load line value / maximum load, average load difference / maximum load line value, and effective stroke. The covariance matrix was diagonalized to obtain its eigenvalues, which are the weights of each main control parameter. The weights of the main control parameters were multiplied by their respective parameters and then added together to obtain a comprehensive index that reflects the eccentric wear status of the pumping unit. This comprehensive index was then normalized to obtain the pumping unit eccentric wear, corrosion, and scaling index (HI).

[0112] Assume that the constructed dataset is shown in Table 2.

[0113] Table 2

[0114]

[0115] The PCA method uses variance to measure the amount of information, and the sample set is {X=[X 1j ,X 2j ,…,X nj ] T 0≤j≤m-1}, n is the number of master control parameters, m is a certain moment, X nj =[x n1 ,x n2 ,…,x nj ]. All samples are constructed into an n×m matrix, which is the covariance matrix. Let the covariance matrix be A, then:

[0116]

[0117] Where: x nj ——The sample attribute value corresponding to the nth master control parameter in the data set at time t=j;

[0118] ——The average value of all sample attribute values ​​of the nth master control parameter,

[0119] Let the set of eigenvectors of matrix A be υ, and the eigenvalue corresponding to the eigenvector υ is λ i (i=1,2,…,n), so the relationship between matrix, eigenvalue and eigenvector can be obtained as follows:

[0120] Aυ=λ i υ

[0121] Construct the eigenvalue formula for solving the characteristic matrix:

[0122] |λ i EA|=0

[0123] Where: E is the unit matrix.

[0124] Assume that the main control parameter value input at a certain time t is X t =(x 1t ,x 2t ,…,x nt ), then the comprehensive index (CI t ) is calculated as:

[0125] CI t =λX t T

[0126] Where: λ is the eigenvalue vector composed of the eigenvalues ​​of matrix A, λ=(λ1,λ2,…λ n ).

[0127] The comprehensive index at each moment within time t is calculated as:

[0128] CI=(CI0,CI1,…,CI t )

[0129] The obtained comprehensive index is normalized to obtain the pumping unit eccentric wear, corrosion and scaling index (HI).

[0130] The calculation formula for the eccentric wear, corrosion and scaling index at time t is:

[0131]

[0132] The eccentric wear, corrosion and scaling indexes at each moment within time t are obtained as follows:

[0133] HI=(HI0,HI1,…,HI t )

[0134] Step 6: Create training and test sets for the wear, corrosion, and scaling index (HI) of machine-wound wells

[0135] According to the LSTM model structure, the pumping unit eccentric wear index data was extracted, the time series was set, and the sample data was segmented according to the set input time length to create the pumping unit eccentric wear well HI training set and test set. Among them, 80% of the data of each sample well was used for model training, and 20% of the data was used for model testing.

[0136] Step 7: Establish a deep learning model for eccentric wear, corrosion, and scaling in machine-recovered wells

[0137] Based on the production data of pumping wells and the time-varying characteristics of eccentric wear, scaling, and corrosion, a long short-term memory (LSTM) neural network was selected to build an HI machine learning model. LSTM, based on the general recurrent neural network (RNN), adds memory units to each hidden layer's neural units to achieve controllable memory information over time series. It is suitable for processing and predicting important events in time series with relatively long intervals and delays. It is an artificial intelligence prediction algorithm based on deep learning.

[0138] The nodes of the LSTM algorithm include input gate, output gate, forget gate and cell. The cell is the core of the LSTM calculation node, mainly used to record the current state. The calculation formula is:

[0139]

[0140] Among them: a c ——Forget Gate;

[0141] t——time;

[0142] i——input gate sample number;

[0143] x t ——Input gate sample;

[0144] w ic ——Input gate weight;

[0145] ——The input of the input gate at time t;

[0146] H——Number of forget gate samples;

[0147] h——forget gate sample number;

[0148] b h ——Forget gate sample;

[0149] w hc ——Forget gate weight:

[0150] ——Forget gate input at time t-1.

[0151] In addition, there are:

[0152] s c (t) = b φ (t)s c (t-1)+b l (t)g[a c (t)]

[0153] Where: b l (t)g[a c (t)]——the forget gate and a at time t c (t) product of mappings;

[0154] b φ (t)s c (t-1)——the product of the forget gate at time t and the cell state output at time t-1;

[0155] g() – mapping function;

[0156] s c (t)——The state output of the cell at time t.

[0157] The model is trained based on the XGBoost model algorithm, and the grid search method is used to optimize the model hyperparameters.

[0158] The test set data is used to verify and analyze the accuracy of the constructed long short-term memory neural network model.

[0159] The following describes the specific implementation of the present invention for prediction of eccentric wear in machine-drilled wells through actual cases.

[0160] Data collection and collation:

[0161] By collecting the oil well repair and pump inspection records of 719 wells in the Qiaohe operating area of ​​Oil Production Plant No. 10 from June to November 2022, a total of 24 wells whose failure causes were pipe leakage and rod breakage caused by eccentric wear were screened out, and about 200,000 production data for the two months before the measures were sorted out.

[0162] Data feature analysis:

[0163] Maximum load line value, minimum load line value, average load difference, load difference between upper and lower endpoints, effective stroke of downstroke, maximum power in upstroke, maximum power in downstroke, average power in upstroke, average power in downstroke, power balance, average power balance, power consumption per stroke, square root power, maximum load line value / maximum load, minimum load line value / minimum load, average load difference / maximum load line value, average load difference / minimum load line value, bandwidth, strokes, effective stroke, a total of 21 related parameters.

[0164] Data preprocessing:

[0165] Statistical methods were used to examine the numerical distribution characteristics of each attribute, deleting attributes that were irrelevant to the well operating conditions, duplicated, or with empty values. Data with obvious errors or values ​​outside the normal range were also deleted. The data preprocessing table is as follows:

[0166] Table 3

[0167]

[0168] Correlation analysis:

[0169] like Figure 2 and Figure 3 As shown in the figure, the Pearson correlation coefficient and Spearman correlation coefficient algorithms are used to calculate the heat map of the strength of the correlation. The lighter the color, the stronger the positive correlation between the variables, and the darker the color, the stronger the negative correlation between the variables. Figure 2 and Figure 3 It can be found that after eccentric wear occurs in an oil well, the correlation between the average load of the upstroke and the average load of the downstroke, the average power of the downstroke, the power balance, the average power balance, and the average power and root mean square power are all greater than 0.9, indicating a strong correlation between any two data points. One of these data points is selected as a eccentric wear-related feature. The following nine items are preferably used as the main evaluation parameters: average load of the upstroke, average load difference, average power of the upstroke, average power balance, power consumption per stroke, root mean square power, maximum load line value / maximum load, average load difference / maximum load line value, and effective stroke.

[0170] The covariance matrix of the eccentric wear sample wells was calculated using the nine parameters of 24 eccentric wear wells. After diagonalization of the covariance matrix, the weights of the nine parameters were obtained as follows: average upstroke load 0.0124, average load difference 0.2581, average upstroke power -0.1252, average power balance 0.0648, power consumption per stroke 0.4562, square root power 0.0521, maximum load line value / maximum load 0.0346, average load difference / maximum load line value 0.0320, and effective stroke 0.8652.

[0171] Draw the relationship between the HI curve of the eccentric wear, corrosion and scaling fault condition index of the pumping unit and the time, such as Figure 4 shown.

[0172] The HI index variation range of 24 pumping wells when abnormal eccentric wear occurred was counted and divided into regions:

[0173] When the HI index is 0.6-1, it is working normally;

[0174] When the HI index is 0.4-0.6, it is the first level of eccentric wear;

[0175] When the HI index is 0.2-0.4, it is secondary eccentric wear;

[0176] When the HI index is 0-0.2, it is the third level of eccentric wear.

[0177] The classification of oil well eccentric wear index is shown in Table 4:

[0178] Table 4

[0179]

[0180] Create HI training and test sets for wells with eccentric wear of pumping units: According to the LSTM model structure, extract the eccentric wear index data of the pumping units, set the time series, and segment the sample data according to the set input time length to create the HI training and test sets for wells with eccentric wear of pumping units. 80% of the data from each sample well is used for model training, and 20% of the data is used for model testing.

[0181] Oil well eccentric wear deep learning model establishment and training optimization:

[0182] When designing the LSTM neural network structure, we first initialized the LSTM model parameters, including the number of LSTM layers to 1, the number of neurons to 64, the time series step size to 4320, the batch size to 16, and the number of iterations to 2000. We then trained the model using the training set. After training, we used grid search to optimize the model on the validation set, obtaining the optimal LSTM model structural parameters: the number of iterations to 300, the batch size to 100, the time series step size to 3, and the number of neurons to 1024.

[0183] Application of the model: The model was applied to 25 oil wells in a certain operating area on site. The eccentric wear of the wells after 30 days was predicted, as shown in Table 5. Among them, three wells showed third-level eccentric wear, which required special attention due to risks such as rod breakage and pipe leakage.

[0184] Table 5

[0185]

[0186] Another embodiment of the present invention further provides a system for predicting the working condition of a pumped well based on big data analysis, comprising:

[0187] Data collection module, used to collect data related to oil well operating conditions;

[0188] Characteristic parameter statistics module, used to count characteristic parameters potentially related to oil well eccentric wear, corrosion, and scaling fault conditions;

[0189] The main control influencing factor analysis module is used to find the main control influencing factors from the characteristic parameters through correlation analysis;

[0190] The oil well eccentric wear, corrosion, and scaling fault condition index calculation module is used to obtain the weight of each main control influencing factor and calculate the oil well eccentric wear, corrosion, and scaling fault condition index;

[0191] The model training module is used to select data from the collected oil well operating condition data according to the oil well eccentric wear, corrosion, and scaling fault condition index to create training sets and test sets, and train the pre-established long-short-term memory neural network model;

[0192] The oil well eccentric wear, corrosion, and scaling fault condition prediction module is used to use the trained long-short term memory neural network model to predict the oil well eccentric wear, corrosion, and scaling fault conditions based on the oil well operating condition related data, and analyze the faults and trends that may occur in oil well production based on the oil well eccentric wear, corrosion, and scaling fault conditions.

[0193] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for predicting machine-produced well failures based on big data analysis is implemented.

[0194] For example, the instructions stored in the memory can be divided into one or more modules / units, which are stored in a computer-readable storage medium and executed by the processor to implement the machine-recovery well failure prediction method based on big data analysis of the present invention. The one or more modules / units can be a series of computer-readable instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the server.

[0195] The electronic device may be a computing device such as a smartphone, laptop, PDA, or cloud server. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will appreciate that the electronic device may include more or fewer components, or a combination of certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, and the like.

[0196] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0197] The memory may be an internal storage unit of the server, such as a hard disk or memory of the server. The memory may also be an external storage device of the server, such as a plug-in hard disk equipped on the server, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Furthermore, the memory may include both an internal storage unit of the server and an external storage device. The memory is used to store the computer-readable instructions and other programs and data required by the server. The memory may also be used to temporarily store data that has been output or is about to be output.

[0198] It should be noted that the information interaction, execution process, etc. between the above-mentioned module units are based on the same concept as the method embodiment. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0199] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0200] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.

[0201] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0202] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A method for predicting failures of mechanically-produced wells based on big data analysis, characterized in that: The following steps are involved: Collect data related to oil well conditions; Statistical analysis of characteristic parameters potentially related to oil well eccentric wear, corrosion, and scaling failure conditions; Find out the main controlling factors from the characteristic parameters through correlation analysis; Obtain the weights of each main control influencing factor and calculate the oil well eccentric wear, corrosion, and scaling fault condition index; According to the oil well eccentric wear, corrosion, and scaling fault condition indexes, data is selected from the collected oil well condition-related data to create training sets and test sets, and the pre-established long short-term memory neural network model is trained; The trained long short-term memory neural network model is used to predict the oil well eccentric wear, corrosion, and scaling failure conditions based on the relevant data of oil well conditions. The failures and trends that may occur in oil well production are analyzed based on the oil well eccentric wear, corrosion, and scaling failure conditions.

2. The method for predicting failure of a well by machine production based on big data analysis according to claim 1, characterized in that: The step of collecting data related to oil well operating conditions includes the dynamometer diagram, electrical parameters, start-stop status data, liquid production, pump efficiency, pump fullness, well opening rate data collected from the oil well, and also includes fault type and fault time.

3. The method for predicting failure of mechanically-produced wells based on big data analysis according to claim 1, characterized in that: The step of counting characteristic parameters that are potentially related to the oil well eccentric wear, corrosion, and scaling fault conditions, the characteristic parameters that are potentially related to the oil well eccentric wear, corrosion, and scaling fault conditions include maximum load line value, minimum load line value, average load difference, upper and lower end point load difference, downstroke effective stroke, upstroke maximum power, downstroke maximum power, upstroke average power, downstroke average power, power balance, average power balance, power consumption per stroke, average active power, root mean square power, maximum load line value / maximum load, minimum load line value / minimum load, average load difference / maximum load line value, average load difference / minimum load line value, bandwidth, stroke, and stroke frequency; the maximum value, minimum value, and average value of the above characteristic parameters are counted.

4. The method for predicting failures of mechanically-produced wells based on big data analysis according to claim 3 is characterized in that: It also includes data preprocessing of the statistically obtained characteristic parameters. Data preprocessing includes using pandas to perform statistics on the collected oil well operating condition-related data and using describe() to observe the statistical description of the data. The statistical data is continuous and includes: count: the number of elements in a column; mean: the average value of a column of data; std: mean square deviation of a column of data; min: the minimum value in a column of data; max: the maximum value in a column; 25%: The average value of the first 25% of the data in a column; 50%: The average value of the first 50% of the data in a column; 75%: The average value of the first 75% of the data in a column; For data columns whose values ​​are always 0 or whose changes are less than the limit, they are processed by elimination.

5. The method for predicting failure of mechanically-produced wells based on big data analysis according to claim 1, characterized in that: The step of finding the main controlling influencing factors from the characteristic parameters through correlation analysis includes using the Pearson correlation coefficient to reflect the correlation between two continuous variables X and Y. The Pearson correlation coefficient of two n-dimensional vectors x and y is calculated as follows: In the formula, Represents the average value of the elements in x and y; r xy Represents the Pearson correlation coefficient, which is a real number in [-1, 1]; When xy When >0, it means the two variables are positively correlated; otherwise, they are negatively correlated; |r xy The larger | is, the higher the correlation between x and y is; And use Spearman correlation coefficient to evaluate the monotonic relationship between two continuous or ordinal variables; for a sample size of n, n original data X i ,Y i is converted into level data x i ,y i , the Spearman correlation coefficient ρ is calculated as follows: According to the Pearson correlation coefficient and the Spearman correlation coefficient, when the correlation between two features is greater than 0.8, one of the features is removed.

6. The method for predicting failures of mechanically-produced wells based on big data analysis according to claim 1, characterized in that: The steps of obtaining the weight of each main control influencing factor and calculating the oil well eccentric wear, corrosion, and scaling fault condition index are as follows: the parameter covariance matrix of the main control influencing factors is calculated by the principal component analysis method, the covariance matrix is ​​diagonalized to obtain the eigenvalues ​​of the covariance matrix, that is, the weights of each main control influencing factor, the weights of the main control influencing factors are multiplied by the corresponding parameters and then added to obtain a comprehensive index, and the comprehensive index is normalized to obtain the oil well eccentric wear, corrosion, and scaling fault condition index.

7. The method for predicting failures of mechanically-produced wells based on big data analysis according to claim 6 is characterized in that: The principal component analysis method uses variance to measure the amount of information, and the sample set is {X=[X 1j ,X 2j ,…,X nj ] T 0≤j≤m-1}, n is the number of master control parameters, m is a certain moment, X nj =[x n1 ,x n2 ,…,x nj ]; construct all samples into an n×m matrix, which is the covariance matrix. Let the covariance matrix be A, then: Where: x nj Indicates the sample attribute value corresponding to the parameter of the nth main controlling factor in the data set at time j; Indicates the average value of all parameter values ​​of the nth master control factor: Let the set of eigenvectors of matrix A be υ, and the eigenvalue corresponding to the eigenvector υ is λ i (i=1,2,…,n); The relationship between the matrix, eigenvalues ​​and eigenvectors is obtained as follows: Off=λ i υ Construct the eigenvalue formula for solving the characteristic matrix: |l i EA|=0 Where: E represents the unit matrix; Suppose the main control parameter value input at a certain time t is X t =(x 1t ,x 2t ,…,x nt ), then the comprehensive index CI t The calculation formula is: CI t =λX t T Where: λ is the eigenvalue vector composed of the eigenvalues ​​of matrix A, λ=(λ1,λ2,…λ n ); The comprehensive index at each moment within time t is calculated as: CI=(CI0,CI1,…,CI t ) The obtained comprehensive index is normalized to obtain the oil well eccentric wear, corrosion, scaling fault condition index, which is the eccentric wear, corrosion, scaling index of the pumping unit, and the eccentric wear, corrosion, scaling index HI at time t t The calculation formula is: The eccentric wear, corrosion and scaling index at each moment within time t is: HI=(HI0,HI1,…,HI t )。 8. The method for predicting failures of mechanically-produced wells based on big data analysis according to claim 1, characterized in that: The step of selecting data from the collected oil well operating condition related data to create a training set and a test set according to the oil well eccentric wear, corrosion, and scaling fault operating condition indexes, and training the pre-established long short-term memory neural network model. The nodes of the long short-term memory neural network model include an input gate, an output gate, a forget gate, and a cell, wherein the cell is the core of the long short-term memory neural network model calculation node, and is used to record the current state. The calculation formula is as follows: Where: a c is the forget gate; t is the time; i is the input gate sample number; x t is the input gate sample; w ic is the input gate weight; is the input of the input gate at time t; H is the number of forget gate samples; h is the sequence number of forget gate samples; b h is the forget gate sample; w hc is the forget gate weight: The input of the forget gate at time t-1; The state output s of the cell at time t c (t) is calculated as follows: s c (t)=b φ (t)s c (t-1)+b l (t)g[a c (t)] Where: b l (t)g[a c (t)] is the forget gate and a at time t c (t) product of mappings; b φ (t)s c (t-1) is the product of the forget gate at time t and the cell state output at time t-1; g() represents the mapping function; The model is trained based on the XGBoost model algorithm, and the grid search method is used to optimize the model hyperparameters.

9. A machine-produced well working condition prediction system based on big data analysis, characterized in that: include: A data collection module, used to collect data related to oil well operating conditions; Characteristic parameter statistics module, used to count characteristic parameters potentially related to oil well eccentric wear, corrosion, and scaling fault conditions; The main control influencing factor analysis module is used to find the main control influencing factors from the characteristic parameters through correlation analysis; The oil well eccentric wear, corrosion, and scaling fault condition index calculation module is used to obtain the weights of each main control influencing factor and calculate the oil well eccentric wear, corrosion, and scaling fault condition index; The model training module is used to select data from the collected oil well operating condition related data to create training sets and test sets according to the oil well eccentric wear, corrosion, and scaling fault operating condition indexes, and train the pre-established long short-term memory neural network model; The oil well eccentric wear, corrosion, and scaling fault condition prediction module is used to use the trained long short-term memory neural network model to predict the oil well eccentric wear, corrosion, and scaling fault conditions based on the oil well condition-related data, and analyze the faults and trends that may occur in oil well production based on the oil well eccentric wear, corrosion, and scaling fault conditions.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for predicting failure of a machine-produced well based on big data analysis as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Downhole working condition intelligent diagnosis method based on big data analysis

    CN115573701A

Cited By

  • Oil extraction system fault diagnosis method and system based on artificial intelligence

    CN121637101A