The system efficiency of pumping units in the middle and late stages of oil recovery is characterized by several factors, complex data and poor regulation. Further, the main control factors that affect system efficiency in different blocks vary greatly; therefore, it is necessary to obtain the block characteristics to effectively improve system efficiency. The k-means algorithm is simple and efficient, but it assumes that all factors have the same amount of influence on the output value. This cannot reflect the obvious difference in the influence of several factors in the block on the efficiency. Moreover, the algorithm is sensitive to the selection of the initial cluster centre point, so each calculation result that reflects the efficiency characteristics of the block system cannot be unified. To solve the aforementioned problems affecting the k-means algorithm, the correlation coefficient of all the factors was first calculated, followed by extracting the system efficiency of the positive and negative indicators of standardization. Next, the moisture value was calculated to obtain the weight of each factor used as a coefficient to calculate the Euclidean distance. Finally, the initial centre point selection of the k-means algorithm problem was solved by combining the dbscan and weighted k-means algorithm. Taking an oil production block in the Daqing Oilfield as the research object, the k-means and improved algorithm are used to analyse the main control factors influencing mechanical production efficiency. The clustering results of the two algorithms have the characteristics of overlapping blocks, but the improved algorithm’s clustering findings are as follows: this block features motor utilization, pump efficiency and daily fluid production, which are positively correlated with system efficiency. Further, low-efficiency wells are characterized by the fact that the pump diameter, power consumption, water content, daily fluid production, oil pressure and casing pressure are significantly lower than the block average; high-efficiency wells are characterized by pump depths lower than the block average. For this block, it is possible to reduce the depth of the lower pump and increase the water-injection effect to increase the output under conditions of meeting the submergence degree, which can effectively improve the system efficiency.