Judgment method of working condition of pumping unit based on the law of polished rod load data

At present, oil companies are committed to applying the theory and means of mathematics or data science to the research of oilfield data rules. However, for some old oil wells, aging equipment, complex environment and backward management, cause the authenticity and accuracy of the data collected by the equipment cannot be determined. According to the actual engineering demand of the old wells, this paper proposes a method based on principal component analysis, cluster analysis and regression analysis to mine and analyze the data of polished rod load of old oil wells, so as to judge the working conditions of the oil wells. Combined with the application of this study in several operation areas of some oilfields, the findings of this study can help for better understanding of the working condition information hidden in "big data" of oilfield. Meanwhile, the PCA method can reduce the complexity of the original data, the regression equation can calculate the size of the polished rod load more accurately, and the prediction model can effectively judge the working conditions of the old oil wells on site.


List of symbols Xp
Data set of p-th original indexes.

Fm
Data set of m-th principal component indexes. Emp Data set of mp-th contribution rate. λ i Data set of i-th principal component eigenvalue.

x k
The k-th independent variable of regression equation. y i The i-th dependent variable of regression equation. β k The k-th coefficient of a linear function.

F 1
The ratio of static load sample in the regression equation of upstroke.

F 2
The ratio of dynamic load sample in the regression equation of upstroke.

F 3
The ratio of friction load sample in the regression equation of upstroke.

F 4
The ratio of static load sample in the regression equation of downstroke.

F 5
The ratio of dynamic load sample in the regression equation of downstroke. F 6 The ratio of friction load sample in the regression equation of downstroke. F 7 The ratio of the sample value of the downstroke static load to the predicted value of the maximum polished rod load on the upper stroke. P 1 The confidence interval of F1. P 2 The confidence interval of F2. P 3 The confidence interval of F3. P 4 The confidence interval of F4.

Introduction
The digitalization of the oil production process and the timely understanding of the operating conditions of the pumping units not only ensure the safety of oil production,
* Chuanjun Han hanchuanjun@126.com Yang Yue yueyangswpu@foxmail.com 1 but also accumulate a large number of complex original data for the oil field data information database. Therefore, how to extract useful rule information from massive data through data analysis is one of the main research directions of each oilfield (Chaodong et al. 2015). Since the 1990s, other domestic oilfields began to use the theories and methods of mathematics, economics, system theory and other disciplines to study the optimization of rational production and utilization of old oil wells and established corresponding evaluation and optimization models, such as gray system prediction model, fuzzy theory model and neural network model (Yuling and Jianping 2014;Canelon and Morles 2008). Xinjiang oilfield has invested in digital oilfield for a long time, but the research effect of condition evaluation and efficiency optimization model is not ideal (Xiang 2007). After in-depth study of this problem, it is found that part of the reason is that the old oil wells which after decades of development, the production equipment of them has become less adaptable, resulting in the system's operating conditions are far more complex than the newly developed oil wells. As shown in Fig. 1, these old wells, which account for about 30-40 percent of the total number of wellheads in Xinjiang, are characterized by long development time, complex operation conditions, harsh environment and easy failure of digital equipment, high energy consumption and they produce a certain amount of oil but are not worthy of secondary investment. Due to the special geographical environment and limited management methods, some of the original data from these old oil wells transported to the oil field data information database are missing and inaccurate, which also makes the theoretical model of data science unable to be used well in this kind of oil wells (Gibbs and Neely 1966;Karmawijaya et al. 2009;Khakimyanov et al. 2015;Xuanyi et al. 2020).
For the newly developed oil wells, thanks to the highquality information equipment, the measurable and perceived parameters are accurately collected and stored in the production process. These complete, reliable and valid data can easily find the underlying laws and information, and the processing methods even evolve from digital analysis to intelligent analysis. This is what researchers are more interested in. Difference from the above performed studies, it is clearly know that incomplete, unreliable data cannot be analyzed in the same way for older wells. Therefore, this study proposed a judgment method of pumping unit working condition obtained by means of statistical analysis such as PCA-cluster analysis and regression analysis, which provided a novel exploration idea for working condition evaluation and efficiency optimization model establishment of old oil wells (Jain et al. 2000;Stamatatos 2008;Wei et al. 2020).
The content of this paper includes two parts: the theoretical research process and the practical application of the research methods. First, the introduction presents the principles behind the problem under study. Then, "Principal component-cluster analysis of pumping units", "Establish the regression equation of polished rod load", "Working condition prediction model based on statistics" sections introduce the steps of the study work: 1. using the PCA-cluster analysis to cluster different working conditions to obtain the data set under normal working conditions; 2. using regression equation to get the most accurate calculation formula of polished rod load; 3. using statistical results to get the working condition prediction model. Finally, in the "Test" section, the theoretical method is applied to some operation areas of Xinjiang oilfield, and the experimental results are obtained.

Evaluation index of dimension reduction function
Principal component analysis (PCA) is a statistical method that transforms a group of variables that may have correlation into a group of linearly uncorrelated variables through orthogonal transformation. The transformed variables are called principal components. It replaces the original index by recombining the original index into a new group of independent comprehensive indicators and takes a few less comprehensive indicators from it to reflect the information of the original index as much as possible. Through principal component analysis, the weight of each index can be determined objectively, and the deviation caused by subjective randomness can be avoided, and the multi-index variables can be scientifically evaluated (Xiaodong et al. 2011). In this part, the principal component analysis method is used to analyze the factors affecting the working conditions of Fig. 1 Oil well exploitation length and the situation of energy consumption/output pumping units, and the results of principal component analysis provide reasonable guidance information for the classification of pumping unit working conditions. Suppose the original index variables are X 1 ,X 2 , …, X p , after principal component analysis, a set of principal component indexes F m (m < p) formed by linear combination of the original indexes was obtained. Among them, the first principal component F 1 is the direction corresponding to the largest data variation (contribution rate e 1 ) and contains the largest amount of information. If the first principal component is not enough to represent the information of the original p indicators, then consider selecting the second principal component index F 2 and so on to get the remaining principal component indicators. The expression formula of principal component analysis is as follows: According to the theoretical analysis, select p indexes that have influence on the working condition change of pumping unit, and m principal component indexes are obtained according to principal component analysis, and the comprehensive evaluation value F of pumping unit working condition is calculated by the weighted method of principal component eigenvalue λ i [formula (2)].
By using principal component analysis, many original indexes affecting working conditions can be reduced to several principal components. The factors influencing each other should be studied as a whole (principal component), rather than puzzled by the interaction between the original indicators. The higher the values of comprehensive evaluation value (f), the more highly correlated factors are contained in the principal component with the largest proportion of weight. Therefore, the determination of the comprehensive evaluation value (f) can show the complex situation of the mutual influence and weight proportion of the factors affecting the working condition of the pumping unit.

Determination method of abnormal working condition of pumping unit
In the actual production of oil field, the main basis for judging whether the working condition is normal or not is the graphic characteristics of indicator diagram. The transverse axis of the indicator diagram is the displacement of (1) the polished rod, and the longitudinal axis is the load on the polished rod, and the lowest end of the polished rod is defined as the starting position. In a stroke of pumping unit, that is, the closed curve reflecting the load and displacement on the polished rod is the indicator diagram curve during the process of lifting the polished rod from the lowest end to the uppermost end and then descending to the lowest end.
When the oil well pump is supposed to work normally, all kinds of friction resistance and inertia force in the system are 0, and the supply capacity of oil fluid is sufficient, the indicator diagram of pumping unit can be expressed as a parallelogram. However, in actual production, due to the influence of friction, vibration and inertia in the system, the indicator diagram under different working conditions will show different trends with that under normal working conditions. It can be seen from the above figure (Fig. 2) that the better working condition of the pumping unit is, the more the indicator diagram tends to be "parallelogram" of the theoretical indicator diagram. Therefore, in the early oil well production, the area of indicator diagram is often used to determine the abnormal condition of working condition (Zhengqin and Hongsheng 2008).
According to the theoretical derivation of the condition evaluation function, the smaller the F value is, the more stable the working condition is, and is less affected by the change of the evaluation index parameters. At the same time, the value of actual power diagram area/theoretical work diagram area is less than 1 and tends to 1, which indicates that the working condition of pumping unit is closer to the normal working condition derived from theory.

Clustering various working conditions
The above evaluation function 1 and indicator map area change parameter 2 adopt cluster analysis to optimize the division of different working conditions and divide all working conditions into several classes, so that each class of working conditions tends to its own characteristic attributes, so as to reduce the error of the prediction model of working conditions. The working condition cluster analysis of pumping unit is to distinguish and classify the working condition of pumping unit according to the working condition index characteristics and the situation reflected by the indicator diagram. Oriented to the engineering application of pumping unit, it mainly follows the following two principles (Zhengqin and Hongsheng 2008; Li et al. 2020): a. The selected index characteristics must reflect the operating characteristics of the pumping unit under different working conditions and can be used to identify different working conditions; b. Under the condition of ensuring the cumulative contribution rate of condition characteristics, the calculation amount of condition clustering should be as small as possible, which is feasible in engineering.
Let the working condition sample data set before classification be x and the corresponding characteristic matrix be W o used the k-means clustering method to cluster the working condition samples, the condition samples are divided into k groups in advance, and the initial clustering center of each group is a matrix m b (b = 1,2,3,…K), then the Euclidean distance from each object x b (characteristic matrix of corresponding working condition samples W o,b ) in different group subsets to the initial cluster center m b .
Taking Euclidean distance as the standard, the working condition sample data are divided into the categories closest to the cluster center by iteration, and the clustering performance evaluation function, the sum of squares criterion function E, is constructed. When e reaches the minimum, it can make each class working condition sample compact and independent between each class.
In the formula, W (b) o is the feature set of the class b working condition sample.
The steps of k-means clustering algorithm are as follows: a. K initial clustering center mi is selected for all working condition sample data. b. Euclidean distances from the clustering center of sample characteristics in different working conditions were calculated. According to the principle of minimum dis- tance, any sample was assigned to the cluster center nearest to it. c. The sample mean in each cluster was recalculated and used as the new cluster center. d. Repeat steps b and c until the cluster center no longer changes. e. K clusters are obtained. End.

Establish the regression equation of polished rod load
The second step of the judgment method of pumping unit working condition based on the law of polished rod load data is to select the theoretical calculation formula or empirical formula of polished rod load with the highest matching degree in the oilfield after obtaining the oil wells with normal working conditions through principal component clustering analysis.
Because there are some errors in the calculation formula of polished rod load, these errors make it easy to misjudge when using the polished rod load to judge the working condition. According to the composition and variation law of polished rod load of pumping unit, this paper puts forward a calculation method of polished rod load, which takes static load, dynamic load and friction load as independent variables and establishes multiple regression equation. The accuracy between the theoretical formula and regression equation and the actual polished rod load is calculated and verified.

Comparison of theoretical calculation formulas of common polished rod load
In the middle and later period of the last century, due to the low degree of automation of pumping units, the sensors are not widely used, and the polished rod load is mostly obtained by the empirical formula accumulated by foreign scholars for a long time. Later, some scholars simplified the pumping unit model as mass spring damping system and obtained the corresponding mechanical calculation formula. Due to the late start of oil exploitation in China, the calculation methods of polished rod load are introduced from abroad, including API formula, Wilnofsky formula and Mills formula (Yijiong 1984;Xin-fu and Yao-guang 2010).
The known data are brought into several commonly used polished rod load calculation formulas, and the calculated results of each formula are compared with the actual polished rod load. The results obtained are shown in Fig. 3, and the matching result of formula III (Wilnovsky formula) is better than that of other formulas. This shows that the Wilnovsky formula is suitable for the reservoir characteristics and production mode of Xinjiang oil field and can calculate the polished rod load more accurately.
Wilnofsky formula avoids the appearance of empirical formula when calculating the polished rod load. It not only considers the weight of the sucker rod string, the buoyancy of the liquid column on the sucker rod string and the static load acting on the plunger area of the sucker rod, but also considers the vibration load of the system. When calculating the dynamic load, the influence of the elasticity of the sucker rod string is taken into account, as well as the influence of the dynamic load of the liquid column on the vibration are considered.

Composition of polished rod load
The polished rod load is a dynamic parameter in the operation of the pumping unit, and its maximum and minimum values occur in the up-and downstroke of the pumping unit, respectively. The load is not only composed of the weight of sucker rod string and liquid column, but also affected by inertia load, friction load (including friction force between rod string and tubing, friction force between plunger and bushing, friction force between liquid column and tubing, etc.), wellhead back pressure (increasing load) and submergence pressure (reducing load) and other factors.
Therefore, when the beam pumping unit drives the plunger of downhole oil pump, the load acting on the Horsehead suspension point is divided into the following three categories: (1) Static load is mainly the weight of sucker rod string in liquid and the weight of oil column on plunger in tubing. The static load in the upstroke is equal to the sum of the weight of the sucker rod and the liquid column; the static load in the downstroke is only equal to the mass of the sucker rod.
(2) Dynamic load is related to the motion acceleration of the Horsehead suspension point of the pumping unit. The dynamic load includes the dynamic load generated by the movement of the sucker rod string and the oil column. In the calculation method of this study, the dynamic load of up-and downstroke is regarded as the same size.
(3) Various friction loads include friction resistance between plunger and pump barrel, friction resistance between sucker rod string and oil string, flow resistance between sucker rod string and tubing and relative movement between oil column and tubing, resistance when well fluid flows through the traveling valve of oil well pump and friction resistance between polished rod and wellhead polished rod sealer. Due to the existence of liquid column in the upstroke, the friction load in the upstroke is more than that in the downstroke.

Multiple linear regression equation
In production, there are many factors affecting the polished rod load of the pumping unit. These mechanical influencing factors are divided into static load, dynamic load and friction load. The correlation between the three types of load and the polished rod load can be calculated by regression analysis, so as to obtain the influence degree of multiple factors on the polished rod load (Xiaotao et al. 2013).
Multiple linear regression describes the linear relationship between multiple independent variables and dependent variables, such as assuming that the independent variables are x 1 , x 2 , … , x k . Then, there is a linear relationship between the independent variable and the dependent variable.
where y i is the actual value of the i th sample in the up-and downstroke; x 1i , x 2i , … , x ki are the sampling data of the ith sample; 0 is a constant; 1 , 2 , … , k are the coefficient of a linear function.
Write the above expression into a matrix in the form of: In order to get the value of partial regression coefficient ̂k ×1 , the least square method is introduced: The derivation of ̂ on both sides of the above formula: Thus, the multiple linear regression equation can be calculated. According to the theory of multiple linear regression, three kinds of loads in up-and downstroke of pumping unit are taken as independent variables, and X is used, respectively, x 1 , x 2 , x 3 and x 6 represent the static load, dynamic load and friction load acting on the polished rod during the upand downstroke. Then, the regression equation of polished rod load of pumping unit is as follows: Upstroke: Downstroke: where y u and y d are the actual polished rod load value in up-and downstroke; x i is the ith load sample; a is a constant; b j (j = 1 ∼ 6) is the partial regression coefficient. The above regression equation can be used to calculate the polished rod load under the assumption that the working condition is normal.

Statistical distribution of loads in upand downstrokes
Set the parameter F 1 , … , F 6 is the ratio of each load sample in the regression equation of up-and downstroke to the predicted value of polished rod load of that stroke, especially F 7 is the ratio of the sample value of the downstroke static load to the predicted value of the maximum polished rod load on the upper stroke. Calculate the parameter f in the well to be tested F 1 , … , F 7 and the normal distribution N X j , j of F j is obtained by testing the normal distribution of a single sample of F j . At the same time, through the parameter F j .The mean value X and standard deviation of J data set were estimated with 95% confidence: The confidence interval is P 1 , … , P 7 , indicating the value of the parameter F 1 , … , F 7 has a 95% probability in this interval.

Common working conditions and corresponding threshold range of pumping units
Through the above statistical analysis, the confidence interval of each load in the upstroke and downstroke is P 1 , … , P 7 . According to the following methods, the threshold limit is obtained by conversion, and the load change in different working conditions is transformed from qualitative analysis to the threshold range of quantitative solution with different thresholds (Rui et al. 2012;He Yanfeng and Xiaodong 2008;Zhiguo 2018;Zhangqi et al. 2014;Lea 1988). Threshold limit 1: x line1 = P 7 min ; Threshold limit 2: x line2 = P 1 + P 2 − P 3 min ; Threshold limit 3: x line3 = P 1 + P 2 − P 3 max ; Threshold limit 4: y line4 = P 4 + P 5 − P 6 min ; Threshold limit 5: y line5 = P 4 + P 5 − P 6 max ; Let the ratio between the calculated value and the measured value of the maximum polished rod load in the upstroke as the parameter 1 . The ratio of the calculated and measured minimum polished rod load in downstroke is 2 . By comparing and analyzing the relationship between the load of 1 and 2 and the threshold limits of the upstroke and downstroke under normal conditions, the common working conditions can be divided into the following categories.
(1) Normal condition: the change of polished rod load of oil well to be measured is similar to that under normal working condition, that is, 1 is between the limits of F 1 + F 2 + F 3 , 2 is between the limits of F 4 − F 5 − F 6 . Then, the expression of the threshold range under this condition is as follows: (2) Tubing leakage: during the upstroke, the liquid is lost from the tubing, resulting in the static load between the rod weight and the sum of the rod weight and the liquid column weight, while the downstroke load is unchanged. Threshold range: 1 < x line2 , y line4 < 2 < y line5 . (3) Breaking off of sucker rod: the static load in the upstroke is less than the self-weight of the sucker rod, and the load of the downstroke decreases. Threshold range: 1 < x line1 , 2 < y line4 . (4) Insufficient pump charging: due to insufficient liquid supply or gas influence, the upstroke gas expands in the pump barrel, resulting in the decrease in polished rod load, and the compression of downstroke gas in the pump barrel leads to the decrease of polished rod load. Threshold range: x line1 < 1 < x line2 , 2 < y line4 . (5) Bump pump: at the end of upstroke, the maximum load increases due to the collision between plunger and pump body. Threshold range: 1 > x line3 , y line4 < 2 < y line5 . (6) At the end of downstroke, the minimum load decreases due to the collision between plunger and pump body.T. hreshold range: x line2 < 1 < x line3 , 2 < y line4 (7) Heavy oil: the viscosity of crude oil increases, resulting in the increase in additional resistance of sucker rod, which increases the friction of sucker rod upstroke and downstroke, increases the upstroke load and decreases the downstroke load. Threshold range: 1 > x line3 , 2 < y line4 . (8) Friction increase: the additional resistance increases the load of polished rod in the upstroke and downstroke. The working conditions of this kind of situation include wax scaling, sand production, eccentric wear or sucker rod bending. Threshold range: 1 > x line3 , 2 > y line5 . (9) Floating valve or fixed valve leakage: the valve leakage of oil well pump, the load changes with the change of leakage in the upstroke, and the liquid column load cannot be removed in time during the downstroke. Threshold range: x line2 < 1 < x line3 , 2 > y line5 . (10) Unknown condition: the threshold range of this part is: Indicates that the load decreases in the upstroke and increases in the downstroke. The load variation relationship cannot find its mapping condition, and it may be the data acquisition error in the field.

Working condition prediction model
According to the threshold diagnosis range under the above working conditions, the ratio 1 and 2 of the maximum value of the measured polished rod load and the maximum value predicted by the regression equation in the up-and downstroke are used as the horizontal and vertical coordinates, and the working condition prediction diagram as shown in the figure below is drawn in combination with the threshold limit, and the obtained working condition prediction model is graphically processed (Liangyu 2019).
Then, the characteristic parameters and working condition prediction model under normal working conditions are obtained by analyzing the previous working condition data of the oil well to be tested, and then the current working condition characteristics are calculated according to the realtime data, and the working condition prediction model is brought in for comparison, so as to judge whether the working condition of the oil well to be tested is normal and point out the attribution of abnormal working conditions.

Data preparation
In the process of oil production, the oil well data acquisition system stores a large amount of production parameter data, which contains the information of corresponding well conditions. Obviously, the number of parameter variables (10 production parameters) and high dimension of oil well production data are obtained in the process of oilfield production. The production parameters are analyzed to reduce the data dimension of the original data space, and then the parameters with large amount of information are extracted from the original data space, which not only reduces the analysis complexity, but also eliminates part of the noise interference.
According to the above analysis, 10 indexes which affect the pumping efficiency of pumping wells are selected as follows: the maximum load of polished rod on the upstroke ( P u ), minimum load of polished rod in downstroke ( P d ), maximum current of upstroke ( I um ), maximum downstroke current ( I dm ), stroke (S), stroke (n), oil pressure ( P t ), casing pressure ( P c ), submergence (H) and pump efficiency ( p ) The production and basic data of 772 wells in a month were selected randomly. Due to the large amount of data, only the statistical values of these data are given, as shown in Table 1.

Main component cluster working condition results
The whole calculation process of principal component is realized in SPSS software. The correlation coefficient and eigenvalue i of the 10 indexes are shown in Figs. 4, 5, respectively.
According to the correlation coefficient matrix in Fig. 4, the original index P u , P d , S, n, I um , I dm have a strong correlation, which reflects that the operating conditions of the pumping unit have a great correlation with these indicators, among which P u , P d , S are the most strong correlation, which shows that the load and displacement changes at the polished rod of the pumping unit can reflect the operation condition of the pumping unit to the greatest extent, which is consistent with the theory of the working condition diagnosed by indicator diagram on the oil field. However, the correlation between submergence H and pump efficiency p is very poor, which reflects that submergence is basically independent of specific well conditions. According to Fig. 5b, when the evaluation index is selected according to the variance contribution rate of principal components, the number of principal components determined by the cumulative contribution rate of eigenvalue variance is 3, and the cumulative contribution rate reaches 73.143. Although it is less than 85% specified in the principal component method, the eigenvalues of the three indicators are greater than 1. Meanwhile, the results show that KMO is 0.846 > 0.6, indicating that the data are suitable for factor score The significant p value of Bartlett's spherical test was 0.000 < 0.05, which indicated that the data were suitable for factor analysis.
At the same time, the initial factor load matrix can be directly obtained by using SPSS, and each load represents the correlation coefficient between the principal component and the corresponding variable. For the principal component load matrix, the data in the initial factor load matrix are divided by the eigenvalue corresponding to the principal component, and then the square root is calculated to obtain the corresponding coefficient of each index in the seven principal components, so as to obtain the corresponding principal component load value.
According to the principal component load, the maximum load ( P u ), the minimum load of polished rod ( P d ), the measured stroke (S) and the maximum current of motor upstroke ( I um ) and the maximum downstroke current ( I dm ), The absolute values of the correlation coefficients between them and the first principal component all exceed 0.8. Because these five indexes reflect the mechanical and displacement changes at the polished rod, the first principal component represents the mechanical state of the polished rod and the running state of the motor. The load on the polished rod can directly  reflect the mechanical situation of the pumping unit in the well, and different mechanical conditions in the well correspond to different working conditions. Therefore, it is the most direct and important to determine the downhole working condition and pumping unit running state according to the load of polished rod. Submergence and pump efficiency are closely related to the second principal component, and the correlation coefficient between them and the second principal component is greater than 0.7, which indicates that the abnormal working condition of the pumping unit is closely related to the filling degree and working efficiency of the pump.
Tubing pressure and casing pressure are closely related to the third principal component. Their correlation coefficient with the third principal component is about 0.6, which reflects the formation energy. The smaller the tubing pressure is than the casing pressure, the greater the formation capacity and the better the fluid supply capacity.
According to the load value of principal component and the standardized data of each original index, the corresponding principal component expression and comprehensive evaluation function can be obtained: The f irst pr incipal component expression: .
The second principal component is as follows: .
The third principal component is as follows: .where F i represents the i th principal component, and Z represents the value of each index after standardization. According to the weighted method of principal component eigenvalues, the comprehensive evaluation function of pumping units can be calculated: According to the comprehensive evaluation function of pumping unit working condition and the above judgment method for normal working condition of pumping unit, cluster analysis is carried out on the tested oil wells, and the clustering results as shown in Fig. 6 are obtained. According to the above abnormal condition judgment method, condition III in Fig. 6 is selected as normal condition.

Comparison results of calculation methods of polished rod load
The data of 187 oil wells under normal working conditions were analyzed by multiple linear regression, and the regression equation was obtained as follows: Upstroke: Downstroke: Figure 7 shows the comparison between the actual polished rod load value of 187 oil wells under normal working condition and the polished rod load value calculated by formula and regression equation.
It is not difficult to see from Fig. 7 that the difference between the polished rod load value calculated by regression equation and the actual polished rod load value is obviously smaller than the polished rod load value calculated by using the formula.

Working condition prediction model
SPSS was used to make descriptive statistics on the samples of each load in the up-and downstroke, and the statistical distribution results as shown in the figure below were obtained.
(12) y u = 0.067 According to the confidence interval obtained in Fig. 8, the threshold range and prediction model are calculated and transformed.

Working condition prediction results
The production data of the old oil wells in each operation area of the oilfield are collected, and the theoretical maximum and minimum values of the polished rod load, as well as the corresponding static load, dynamic load and friction load, are calculated according to the regression optimization calculation method described in this paper.
Then, the ratio of the measured maximum value and the theoretical maximum value of the polished rod load 1 and the ratio of the measured minimum value and the theoretical minimum value of the polished rod load 2 are calculated in Fig. 10 Judgment results of oil well condition to be tested in some oil production area turn. And the values of 1 and 2 are brought into the working condition diagnosis diagram, and the following judgment results are obtained.
There are 86 old oil wells in Fig. 9, including 11 wells judged as normal working condition, 1 oil well affected by insufficient liquid supply or gas, 10 oil wells bumped by pumps and 72 wells with excessive downhole friction load. Combined with the above analysis, it can be concluded that the oil reservoir in this operation block has good liquid supply capacity and the pumping unit works normally, but the friction load of most oil wells is too large.
In Fig. 10, through the statistics of the diagnosis results of the old oil wells in the test operation area, it is found that the main low efficiency reasons of the old oil wells are the excessive friction of the sucker rod in the up-and downstroke, the leakage of the tubing and valve and the problem of the up and down hitting the pump. Therefore, in the next step of production management of old oil wells, targeted treatment measures should be adopted to save energy and improve efficiency, such as appropriately reducing the stroke to reduce the collision of oil well pumps and stopping the oil wells with serious leakage or severe friction for maintenance.
By comparing the detection results of pumping unit working condition on site with the prediction results obtained by this research method, it is found that the accuracy rate of this research method is very considerable, which can effectively reflect the working condition problems encountered by old oil wells. This test result shows that the study is more suitable than other statistical analysis models for old wells with complex operating conditions and low quality data. At the same time, this study also has the disadvantages and limitations, for example, when two or more working conditions have little difference in the influence law and influence degree on the polished rod load, the method provided in this study can only predict this kind of working condition, but cannot accurately distinguish which one is.

Summary and conclusions
(1) For research viewpoint, this research enlarges the application scope and scenario of statistical model in oilfield data processing. And in the process of research, it is not difficult to find that there is a large amount of available information in the oilfield production data, which is worthy of more researchers and explorations.
(2) The results of principal component analysis show that the load of polished rod and the running current of pumping unit motor have the highest correlation with the running state of pumping unit, which can directly reflect the working condition of pumping unit.
(3) The results show that the calculation method of polished rod load optimized by regression analysis is more accurate than various theoretical calculation formulas commonly used in oilfield.
(4) In this paper, the working condition judgment method based on the change law of polished rod load can quickly and effectively judge the operation conditions of the old oil wells that meet the conditions in a certain operation block. However, how to further judge and identify similar working conditions, such as gas influence, insufficient liquid supply and pipeline leakage, needs to be further studied.
Funding Sichuan Youth Science and Technology Foundation (19JCQN0081).

Compliance with ethical standards
Conflict of interest No conflict of interest exits in the submission of this manuscript, and all authors have approved the manuscript and agreed to submit it to" Journal of Petroleum Exploration and Production Technology ". I would like to declare on behalf of my co-authors that the work described was original research that has not been published previously, and not under consideration for publication elsewhere, in whole or in parts. All the authors listed have approved the manuscript that is enclosed. We deeply appreciate your consideration of our manuscript, and we look forward to receiving comments from the reviewers. If you have any queries, please don't hesitate to contact me at the address below.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.