Method and device for constructing paraffin precipitation prediction model of oil well equipment, equipment and storage medium

By extracting nonlinear features in the oil pump well working condition data and combining with the random forest algorithm, a model that can efficiently predict the wax of the pump well was constructed, solving the problems of inaccurate prediction results and poor model interpretability in the prior art, and achieving more accurate and interpretable wax prediction.

CN120235019APending Publication Date: 2025-07-01CHINA NAT PETROLEUM CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311827139.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The prior art has problems with insufficient accuracy in predicting pump well waxes and poor model interpretability, especially the lack of effectiveness of machine learning and neural network methods in processing nonlinear data.

Method used

By obtaining the working condition data of the pumping well, the trained neural network model is used to extract nonlinear features and merge them with the linear features to build a prediction model based on the random forest algorithm to achieve efficient prediction of equipment wax.

Benefits of technology

The prediction model's processing ability of higher-order nonlinear data is improved, and the model's interpretability is enhanced, timely and accurate prediction results are ensured, and the problem of wax identification and prediction is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235019A_ABST
    Figure CN120235019A_ABST
Patent Text Reader

Abstract

The invention discloses an oil well equipment wax precipitation prediction model construction method and device, equipment and a storage medium. The method comprises the following steps: acquiring working condition data of a rod-pumped well in a paraffin precipitation state and a non-paraffin precipitation state, wherein the working condition data comprises a plurality of pieces of linear characteristic data; inputting each piece of sample data of the working condition data into the trained neural network model, and extracting a first specified number of nonlinear features from a middle specified layer of the neural network model; the neural network model is obtained by using working condition data as training data; combining the non-linear features of each piece of sample data with the piece of sample data to obtain combined sample data comprising linear features and non-linear features; and training a prediction model based on a random forest algorithm by using the combined sample data to obtain an equipment paraffin precipitation prediction model. According to the method, the problem of processing high-order nonlinear data by the model for predicting the paraffin precipitation of the oil well equipment is solved, the interpretability problem of the model is also solved, and the working condition of the paraffin precipitation of the oil well equipment can be predicted timely and accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of oil extraction, and particularly relates to a method and device for constructing a wax deposition prediction model for oil well equipment, equipment and a storage medium. Background Art

[0002] In the field of oil extraction, the pumping unit well is one of the key equipment for oil extraction. The function of the pumping unit well is to extract the crude oil at the bottom of the well from the oil well and then send it to the ground for processing. The importance of the pumping unit well in the field of oil extraction is reflected in many aspects such as improving the extraction efficiency, reducing energy waste, ensuring safety and improving the return on investment. The pumping unit well is of great significance for the efficient development and utilization of oil resources.

[0003] During the oil extraction process, wax deposition in the pumping unit well is an inevitable problem. Wax deposition mainly occurs on the oil transmission pipeline of the pumping unit well, the sucker rod, the oil pump, etc. There will be different degrees of wax deposition during the operation of the pumping unit well. The main reason for wax deposition is that the crude oil contains a certain proportion of paraffin components, which mainly appear in the form of crystal molecules. Under the influence of factors such as the properties of the crude oil, production conditions, oil production geology and technology, the chemical properties of the paraffin in the crude oil will change, resulting in wax deposition problems on the pumping unit well. Once wax deposition occurs, it will lead to an expansion of the wax deposition range at the wax deposition position, which will affect normal production operations.

[0004] In the field of oil extraction, it is very important to predict in time whether the pumping unit will have wax deposition. There are mainly the following reasons:

[0005] Affect production efficiency: Wax deposition in the pumping unit well will cause blockage of the oil production layer and reduce the oil well output, which will have a serious impact on both production efficiency and economic benefits.

[0006] Increase maintenance costs: Wax deposition in the pumping unit well may cause damage to the pumping unit equipment, which will not only increase the equipment maintenance cost, but may also lead to equipment shutdown.

[0007] Affect equipment life: Wax deposition in the pumping unit well will increase the working load of the equipment, may lead to a shortening of the equipment life, and increase the frequency of equipment replacement and maintenance.

[0008] Therefore, efficiently and accurately identifying whether the pumping unit well has wax deposition is an indispensable part of the industrial Internet of Things in the field of oil extraction. It plays a directional decisive role in the real-time monitoring and fault repair of the pumping unit well. For example, by real-time monitoring and identifying whether the pumping unit well has wax deposition and taking corresponding control measures in time, the safe operation of the pumping unit well can be guaranteed, and thus the sustainable development of oil production can be realized.

[0009] With the development of computer technology and artificial intelligence, the real-time wax deposition prediction of pumping wells mainly goes through the following four stages: manual diagnosis and analysis method, expert system, machine learning method, and neural network method. The manual diagnosis and analysis method is easily restricted by subjective and objective factors such as the situation at the oil production site, manual experience, and technical level; the expert system relies too much on the knowledge base and has poor versatility, and no longer meets the requirements of the current mainstream business scenarios; the machine learning method and the neural network method are currently widely used. Summary of the Invention

[0010] In a sense, the current stage of the machine learning method is a statistical learning method. The algorithms in the machine learning method are based on probability theory and mathematical statistics. It does not perform non-linear calculations on data, relies on statistical knowledge to complete classification and regression tasks, and uses the prediction model constructed by the current stage of the machine learning method. The prediction results also rely on statistical knowledge to complete classification and regression tasks to obtain the prediction results, and the prediction results need to be improved; the neural network method loses the interpretability of the model by introducing activation functions and non-linear layers. The prediction model constructed by the current stage of the neural network method by introducing activation functions and non-linear layers lacks interpretability, and the results predicted by this model need to be improved.

[0011] In view of the above problems, the present invention is proposed to provide a method, device, equipment and storage medium for constructing a wax deposition prediction model of oil well equipment to overcome or at least partially solve the above problems.

[0012] An embodiment of the present invention provides a method for constructing a wax deposition prediction model of oil well equipment, including:

[0013] Obtain the working condition data of the wax deposition state and non-wax deposition state of the pumping well, and the working condition data of the pumping well includes multiple linear feature data;

[0014] Input each sample data of the working condition data of the pumping well into the trained neural network model respectively, and extract the first specified number of non-linear features from the specified middle layer of the neural network model; the neural network model is trained using the working condition data of the pumping well as training data.

[0015] Combine the non-linear features of each sample data with the sample data to obtain combined sample data including linear features and non-linear features;

[0016] Use the combined sample data to train a prediction model based on the random forest algorithm to obtain a wax deposition prediction model for equipment.

[0017] Preferably, the neural network model includes an input layer, four hidden layers and an output layer;

[0018] Extract a specified number of non - linear features from a specified intermediate layer of a neural network model, including: extracting a first specified number of non - linear features from the last hidden layer of the neural network model.

[0019] Preferably, the process of using the working condition data of the pumping unit well to train the neural network model includes:

[0020] Input the linear feature data in the working condition data of the pumping unit into the neural network model. If it is determined that the specified model parameters do not converge according to the wax - forming state prediction result output by the neural network model and the wax - forming state in the working condition data of the pumping unit well, after adjusting the model parameters, continue to train the neural network model using the working condition data of the pumping unit well. After multiple iterative trainings until the specified model parameters converge, a trained neural network model is obtained.

[0021] Preferably, obtaining the working condition data of the wax - forming state and non - wax - forming state of the pumping unit well includes:

[0022] Obtain the dynamometer card data of the wax - forming state and non - wax - forming state of the pumping unit well through a crank position sensor and a polished rod load sensor;

[0023] Pre - process the dynamometer card data according to a specified rule to obtain the working condition data of the pumping unit well including multiple linear feature data of the wax - forming state and non - wax - forming state.

[0024] Preferably, pre - processing the dynamometer card data according to a specified rule to obtain the working condition data of the pumping unit well including multiple linear feature data of the wax - forming state and non - wax - forming state includes:

[0025] Split the dynamometer card data into displacement data and load data, and construct multiple linear feature data of the wax - forming state and non - wax - forming state. The linear feature data includes stroke frequency + stroke + load points + displacement points;

[0026] Arrange the load points and displacement points in chronological order to obtain the working condition data of the pumping unit well including multiple linear feature data.

[0027] Preferably, combining the non - linear features of each sample data with the sample data to obtain combined sample data including linear and non - linear features, including:

[0028] Combine the first specified number of non - linear features of each sample data with the second specified number of linear features of the sample data. The second specified number of linear features includes: 1 stroke frequency, 1 stroke, a third specified number of load points, and a fourth specified number of displacement points.

[0029] Preferably, using the combined sample data to train a prediction model based on the random forest algorithm to obtain an equipment wax - forming prediction model, including:

[0030] Divide the combined sample data into a training set and a validation set;

[0031] Input the training set into a prediction model constructed based on the random forest algorithm to construct random forest decision trees;

[0032] Match the features of the validation set with the nodes on the decision tree to obtain the prediction result of equipment wax deposition;

[0033] Determine the parameters of the prediction model based on the prediction results of equipment wax deposition status obtained through multiple iterative trainings and validations to obtain a trained equipment wax deposition prediction model; the parameters of the prediction model include at least one of the number of decision trees, the number of nodes in the decision tree, the depth of the decision tree, and the criterion for feature splitting.

[0034] An embodiment of the present invention provides a method for predicting equipment wax deposition in oil wells, including:

[0035] Obtain the real-time working condition data of the pumping well to be predicted;

[0036] Input the real-time working condition data into the trained equipment wax deposition prediction model to output the prediction result of whether wax deposition occurs;

[0037] The equipment wax deposition prediction model is constructed using the method for constructing an equipment wax deposition prediction model in an oil well as described above.

[0038] An embodiment of the present invention provides a device for constructing an equipment wax deposition prediction model in an oil well, including:

[0039] A first data acquisition module, configured to acquire the working condition data of the wax deposition state and non-wax deposition state of the pumping well, and the working condition data of the pumping well includes multiple linear feature data;

[0040] A non-linear feature acquisition module, configured to input each sample data of the working condition data of the pumping well into a trained neural network model respectively, and extract a first specified number of non-linear features from a specified middle layer of the neural network model; the neural network model is trained using the working condition data of the pumping well as training data;

[0041] A feature combination module, configured to combine the non-linear features of each sample data with the sample data to obtain combined sample data including linear features and non-linear features;

[0042] A training module, configured to train a prediction model based on the random forest algorithm using the combined sample data to obtain an equipment wax deposition prediction model.

[0043] An embodiment of the present invention provides a device for predicting equipment wax deposition in an oil well, including:

[0044] A second data module, configured to obtain real-time working condition data of a pumping unit well to be predicted;

[0045] A prediction module, configured to input the real-time working condition data into a trained equipment wax deposition prediction model, and output a prediction result of whether wax deposition occurs;

[0046] The equipment wax deposition prediction model is obtained by using the oil well equipment wax deposition prediction model construction device as described above.

[0047] An embodiment of the present invention provides a computer storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the above-mentioned oil well equipment wax deposition prediction model construction method and / or the above-mentioned oil well equipment wax deposition prediction method are implemented.

[0048] An embodiment of the present invention provides a data processing device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the above-mentioned oil well equipment wax deposition prediction model construction method and / or the above-mentioned oil well equipment wax deposition prediction method are implemented.

[0049] The beneficial effects of the above technical solutions provided by the embodiments of the present invention at least include:

[0050] By introducing a non-linear layer into the neural network, the neural network model is enabled to have the ability of non-linear operation, and high-order non-linear features are extracted by using the trained neural network model; the high-order non-linear features are fused with wax deposition-related data to obtain fused features; based on the fused features, a prediction model constructed by the random forest algorithm is trained, and the prediction model has the ability to process high-order non-linear data; the prediction model constructed by the random forest algorithm itself has interpretability, and the oil well equipment wax deposition prediction model also has interpretability; this method solves the problem that the oil well equipment wax deposition prediction model can process high-order non-linear data, and at the same time solves the interpretability problem of the model, ensuring timely and accurate prediction of the working condition of oil well equipment wax deposition.

[0051] Other features and advantages of the present invention will be described in the following description, and some of them will become obvious from the description, or be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in the written description, claims, and drawings.

[0052] Next, through the drawings and embodiments, the technical solutions of the present invention will be further described in detail. Description of the Drawings

[0053] The accompanying drawings are used to provide a further understanding of the present invention and form a part of the specification. They are used together with the embodiments of the present invention to explain the present invention and do not constitute a limitation to the present invention. In the drawings:

[0054] Figure 1 It is a flowchart of a method for constructing a wax deposition prediction model of oil well equipment in Embodiment 1 of the present invention;

[0055] Figure 2 It is a specific implementation flowchart of a method for constructing a wax deposition prediction model of oil well equipment in Embodiment 2 of the present invention;

[0056] Figure 3a It is a schematic diagram of the effect of a neural network trained with a training set in Embodiment 2 of the present invention;

[0057] Figure 3b It is a schematic diagram of the loss result of a neural network trained with a training set in Embodiment 2 of the present invention;

[0058] Figure 3c It is a schematic diagram of the effect of a neural network tested with a test set in Embodiment 2 of the present invention;

[0059] Figure 3d It is a schematic diagram of the loss result of a neural network tested with a test set in Embodiment 2 of the present invention;

[0060] Figure 4 It is a flowchart of a method for predicting wax deposition of oil well equipment in Embodiment 3 of the present invention;

[0061] Figure 5 It is a schematic structural diagram of a device for constructing a wax deposition prediction model of oil well equipment in an embodiment of the present invention;

[0062] Figure 6 It is a schematic structural diagram of a device for predicting wax deposition of oil well equipment in an embodiment of the present invention. Detailed implementation manners

[0063] Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.

[0064] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a method and device for constructing and predicting a wax deposition prediction model of oil well equipment.

[0065] Embodiment 1

[0066] Embodiment 1 of the present invention provides a method for constructing a wax deposition prediction model for oil well equipment, and its process is as follows Figure 1 shown, including the following steps:

[0067] Step S101: Obtain the working condition data of the pumping well in the wax deposition state and the non-wax deposition state. The working condition data of the pumping well includes multiple linear feature data.

[0068] Obtain the dynamometer card data of the pumping well in the wax deposition state and the non-wax deposition state through the crank position sensor and the polished rod load sensor; preprocess the dynamometer card data according to the specified rules to obtain the working condition data of the pumping well including multiple linear feature data in the wax deposition state and the non-wax deposition state.

[0069] During the preprocessing process of the dynamometer card data, the dynamometer card data is split into displacement data and load data, and multiple linear feature data in the wax deposition state and the non-wax deposition state are constructed. The linear feature data includes the stroke frequency + stroke + load point + displacement point; the load point and the displacement point are arranged in chronological order to obtain the working condition data of the pumping well including multiple linear feature data.

[0070] Step S102: Input each sample data of the working condition data of the pumping well into the trained neural network model respectively, and extract the first specified number of non-linear features from the specified middle layer of the neural network model.

[0071] The neural network model can be constructed in advance. The constructed neural network model includes an input layer, four hidden layers, and an output layer, and the trained neural network model is obtained by using the working condition data of the pumping well as training data.

[0072] During the process of using the working condition data of the pumping well as training data to train the neural network model, it includes: inputting the linear feature data in the working condition data of the pumping well into the neural network model. If it is determined that the specified model parameters do not converge according to the wax deposition state prediction result output by the neural network model and the wax deposition state in the working condition data of the pumping well, after adjusting the model parameters, use the working condition data of the pumping well to continue training the neural network model. After multiple iterative trainings, until the specified model parameters converge, the trained neural network model is obtained.

[0073] Input each sample data of the working condition data of the pumping well into the trained neural network model respectively, and extract the first specified number of non-linear features from the specified middle layer of the neural network model, including: extracting the first specified number of non-linear features from the last hidden layer of the neural network model.

[0074] Step S103: Combine the non-linear features of each sample data with the sample data to obtain the combined sample data including linear features and non-linear features.

[0075] The process of merging the non - linear features of each sample data with the sample data includes: merging the first specified number of non - linear features of each sample data with the second specified number of linear features of the sample data. The second specified number of linear features includes: 1 stroke frequency, 1 stroke, the third specified number of load points, and the fourth specified number of displacement points.

[0076] Step S104: Use the combined sample data to train a prediction model based on the random forest algorithm to obtain a wax - deposition prediction model for the equipment.

[0077] Divide the combined sample data into a training set and a validation set; input the training set into the prediction model constructed based on the random forest algorithm to construct a random forest decision tree; match the features of the validation set with the nodes on the decision tree to obtain the wax - deposition prediction result of the equipment; determine the parameters of the prediction model according to the wax - deposition state prediction results obtained from multiple iterative trainings and validations to obtain a trained wax - deposition prediction model for the equipment; the parameters of the prediction model include at least one of the number of decision trees, the number of nodes in the decision tree, the depth of the decision tree, and the criterion for feature splitting.

[0078] This method introduces a non - linear layer into the neural network, enabling the neural network model to have non - linear operation capabilities, and extracting high - order non - linear features using the trained neural network model; fusing the high - order non - linear features with the wax - deposition - related data to obtain fusion features; training the prediction model constructed based on the random forest algorithm using the fusion features, so that the prediction model has the ability to process high - order non - linear data; the prediction model constructed based on the random forest algorithm itself has interpretability, and the wax - deposition prediction model for oil well equipment also has interpretability; this method solves the problem that the wax - deposition prediction model for oil well equipment can process high - order non - linear data, and at the same time solves the problem of model interpretability, ensuring timely and accurate prediction of the wax - deposition condition of oil well equipment.

[0079] Embodiment 2

[0080] Embodiment 2 of the present invention provides a specific implementation process of the method for constructing a wax - deposition prediction model for oil well equipment, and its process is as Figure 2 shown, including the following steps:

[0081] Step S201: Obtain the indicator diagram data of the wax - deposition state and non - wax - deposition state of the pumping unit well through a crank - position sensor and a polished - rod load sensor.

[0082] The implementation process of obtaining dynamometer card data is as follows: at the oil production site, the dynamometer card data of the pumping unit well is obtained through a crank position sensor and a polished rod load sensor. The measured data is uploaded to the database through a remote communication module, specifically a remote RTU module. The data format is a displacement-load data pair of 200 acquisition points, and two types of working conditions, wax deposition and non-wax deposition, are selected. Affected by the number of data sets, it is determined that 1378 pieces of data are taken for the wax deposition working condition and 2000 pieces of data are taken for the non-wax deposition working condition, which can basically ensure the class average of the data set. When the class average of the data set is basically ensured, the specific number of class data can be set relatively freely.

[0083] Step S202: Split the dynamometer card data into displacement data and load data, and construct multiple linear feature data in the wax deposition state and non-wax deposition state. The linear feature data includes strokes per minute + stroke length + load points + displacement points; arrange the load points and displacement points in chronological order to obtain the working condition data of the pumping unit well including multiple linear feature data.

[0084] Implementation process: It is known that the dynamometer card is a representation of the change of the displacement-load sequence in the time dimension. To emphasize the importance of the time dimension in the processing process, the dynamometer card data collected by the sensor can be split into two parts, displacement and load; among them, it can include strokes per minute, stroke length, load points, displacement points, and each of strokes per minute, stroke length, load points, and displacement points occupies a certain number of columns. For example, strokes per minute is a 1-column feature set, stroke length is a 1-column feature set, load points is a 200-column feature set, and displacement points is a 200-column feature set, to construct a 402-column feature set including strokes per minute + stroke length + load points + displacement points; among them, the load points and displacement points are arranged in chronological order, and data cleaning and normalization are performed on the data set.

[0085] Step S203: Construct a neural network model.

[0086] A neural network model can be pre-constructed, based on a deep neural network (DNN) with four hidden layers, and a neural network constructed by introducing a non-linear layer using an activation function (ReLU). The constructed neural network model includes an input layer, four hidden layers, and an output layer; non-linear features can be extracted in the intermediate specified layer of the neural network model. Specifically, the first specified number of non-linear features can be allowed to be extracted in the last hidden layer of the neural network model.

[0087] Step S204: Use the working condition data of the pumping unit well as training data to train the neural network model.

[0088] In this embodiment, in the input data, the proportion of the training set is set to 0.8, the proportion of the test set is set to 0.1, and the proportion of the validation set is set to 0.1. The features of the input data are mapped to 2 classes; the working condition data of the pumping unit well is passed into the neural network for training to obtain a trained neural network.

[0089] Step S205: Input each sample data of the pumping well working condition data into the trained neural network model respectively, and extract the first specified number of non-linear features from the specified intermediate layer of the neural network model.

[0090] Obtain non-linear features in the trained neural network model. The pumping well working condition data contains 402 columns of features, and for the neural network model trained with the pumping well working condition data, extract the output result of the second-to-last layer of the model, that is, the output result of the last hidden layer, as the first specified number of non-linear features. Here, the first specified number of non-linear features is specifically 32 columns of non-linear features.

[0091] Step S206: Combine the first specified number of non-linear features of each sample data with the second specified number of linear features of this sample data. The second specified number of linear features includes: 1 stroke frequency, 1 stroke length, the third specified number of load points, and the fourth specified number of displacement points.

[0092] For the specific process of dataset splicing, combine the 402 columns of features of each sample data and the 32 columns of non-linear features extracted, to construct a 434-column linear and non-linear features, and obtain the linear and non-linear features of all sample data based on the linear and non-linear features of each sample data.

[0093] Step S207: Use the combined sample data to train a prediction model based on the random forest algorithm to obtain a prediction model for equipment wax deposition.

[0094] Machine learning training: Use the random forest for machine learning training to obtain the final model; in the machine learning process, some hyperparameters adopted by the random forest algorithm in this embodiment are the optimal results of searching within a certain range. Among them, the number of decision trees (n_estimators) is the optimal result of hyperparameter search within the interval [50, 80, 100, 120, 150]; the depth of the decision tree (max_depth) is the optimal result of hyperparameter search within the interval [5, 10, 15, 20, 25]; the number of nodes in the decision tree (min_samples_split) is the optimal result of hyperparameter search within the interval [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]. Hyperparameter search can improve the model effect to a certain extent and can be selectively executed.

[0095] Divide the combined sample data into a training set and a validation set; input the training set into a prediction model constructed based on the random forest algorithm to construct a random forest decision tree; match the features of the validation set with the nodes on the decision tree to obtain the prediction result of equipment wax deposition; determine the parameters of the prediction model according to the prediction results of equipment wax deposition status obtained through multiple iterative trainings and validations to obtain a trained equipment wax deposition prediction model; the parameters of the prediction model include at least one of the number of decision trees, the number of nodes in the decision tree, the depth of the decision tree, and the criterion for feature splitting.

[0096] The following respectively describes the comparison results of the prediction effects of the random forest algorithm, the deep neural network algorithm, and the DNN + random forest prediction model provided by the present invention.

[0097] 1) The effects of specific traditional machine learning models (such as the random forest algorithm) are as shown in the following table.

[0098] Type Precision Recall Robustness Support Wax Deposition 0.79 0.71 0.75 275 Non-Wax Deposition 0.84 0.89 0.86 400 Accuracy 0.83 675 Macro Average 0.82 0.80 0.81 675 Weighted Average 0.83 0.83 0.83 675

[0099] From the classification report of the random forest in the table, it can be seen that the prediction accuracy rate is 0.83, and there is still room for optimization in the prediction and discrimination of whether the pumping unit well is waxed.

[0100] 2) The prediction effect based on the neural network.

[0101] The training effect (expressed by accuracy) of the training set is shown in Figure 3a as shown, and the loss curve of the training set is shown in Figure 3b as shown; the validation effect (expressed by accuracy) of the validation set is shown in Figure 3c as shown, and the loss curve of the validation set is shown in Figure 3d as shown. From Figure 3a - 3d it can be seen that the prediction effects of the training set and the test set of the neural network are stable at an accuracy rate of 0.91, and the final results of the loss curves of the training set and the test set of the neural network are small, and the model has not overfitted.

[0102] 3) Using the DNN + random forest algorithm provided by the present invention, the prediction results are as shown in the following table

[0103] Type Precision Recall Robustness Support Wax Deposition 0.92 0.88 0.90 275 Non-Wax Deposition 0.90 0.88 0.90 400 Accuracy 0.92 675 Macro Average 0.91 0.90 0.91 675 Weighted Average 0.91 0.91 0.91 675

[0104] It can be seen from the above table that the prediction accuracy rate of the method of the present invention is 0.92, and the performance of the precision rate, recall rate, and robustness in the prediction results of wax deposition and non - wax deposition has been improved.

[0105] In the present invention, traditional machine learning algorithms are still used to solve the wax deposition recognition problem. The model is concise, with a fast response speed and high interpretability. The positive role of neural networks in solving nonlinear problems is fully affirmed. The original data set is input into the neural network to extract the output high-order nonlinear features of the last hidden layer. The high-order nonlinear features are combined with each sample of the working condition data to construct a comprehensive feature set with nonlinear and linear features, improving the problem that machine learning cannot perform high-order nonlinear operations while retaining the interpretability of machine learning.

[0106] The present invention has good experimental results, improving the disadvantages of traditional neural networks lacking interpretability and traditional machine learning algorithms being unable to perform nonlinear operations: rapid response, and the wax deposition recognition for a single reciprocating motion of a pumping well can control the model to be concise, meeting the accuracy requirements of the production site.

[0107] Embodiment III

[0108] Embodiment III of the present invention provides a method for predicting wax deposition in oil well equipment, and its process is as Figure 4 shown, including the following steps:

[0109] Step S301: Obtain the real-time working condition data of the pumping well to be predicted.

[0110] Step S302: Input the real-time working condition data into the trained equipment wax deposition prediction model, and output the prediction result of whether wax deposition occurs.

[0111] The equipment wax deposition prediction model is constructed using the method for constructing an oil well equipment wax deposition prediction model as described above.

[0112] Based on the same inventive concept, the embodiment of the present invention provides a device for constructing an oil well equipment wax deposition prediction model, and its structure is as Figure 5 shown, including: a first data acquisition module 111, a non-linear feature acquisition module 112, a feature combination module 113, and a training module 114;

[0113] The first data acquisition module 111 is used to obtain the working condition data of the wax deposition state and non-wax deposition state of the pumping well, and the pumping well working condition data includes multiple linear feature data;

[0114] The non-linear feature acquisition module 112 is used to input each sample data of the pumping well working condition data into the trained neural network model respectively, and extract the first specified number of non-linear features from the specified middle layer of the neural network model; the neural network model is trained using the pumping well working condition data as training data;

[0115] A feature combination module 113, configured to combine the non - linear features of each sample data with the sample data, so as to obtain combined sample data including linear features and non - linear features;

[0116] A training module 114, configured to use the combined sample data to train a prediction model based on a random forest algorithm, so as to obtain a wax deposition prediction model for equipment.

[0117] Based on the same inventive concept, an embodiment of the present invention provides a wax deposition prediction device for oil well equipment, the structure of which is as Figure 6 shown, including: a second data acquisition module 211, a prediction module 212;

[0118] The second data acquisition module 211 is configured to acquire real - time working condition data of a pumping well to be predicted;

[0119] The prediction module 212 is configured to input the real - time working condition data into the trained wax deposition prediction model for equipment, and output a prediction result of whether wax deposition occurs;

[0120] Wherein the wax deposition prediction model for equipment is obtained by using the wax deposition prediction model construction device for oil well equipment as described above.

[0121] Based on the same inventive concept, an embodiment of the present invention provides a computer storage medium, in which computer - executable instructions are stored, and the computer - executable instructions are executed by a processor to perform the above - mentioned method for constructing a wax deposition prediction model for oil well equipment and / or the above - mentioned method for predicting wax deposition in oil well equipment.

[0122] Based on the same inventive concept, a data processing device, characterized by including: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the above - mentioned method for constructing a wax deposition prediction model for oil well equipment and / or the above - mentioned method for predicting wax deposition in oil well equipment.

[0123] Regarding the device in the above - mentioned embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0124] Unless otherwise specifically stated, terms such as processing, computing, calculating, determining, displaying, etc. can refer to the actions and / or processes of one or more processing or computing systems, or similar devices, which operate on and transform data represented as a physical (such as electronic) quantity within the registers or memories of the processing system into other data similarly represented as a physical quantity within the memories, registers, or other such information storage, transmission, or display devices of the processing system. Information and signals can be represented using any of a variety of different technologies and methods. For example, the data, instructions, commands, information, signals, bits, symbols, and chips referred to throughout the above description can be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.

[0125] It should be understood that the specific order or hierarchy of steps in the disclosed processes is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in a process can be rearranged without departing from the scope of the present disclosure. The appended method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy recited.

[0126] In the above detailed description, various features are combined in a single embodiment to simplify the present disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are expressly recited in each claim. On the contrary, as reflected in the appended claims, the invention lies in less than the full scope of the features of the single disclosed embodiment. Accordingly, the appended claims are hereby expressly incorporated into the detailed description, where each claim stands on its own as a separate preferred embodiment of the invention.

[0127] Those skilled in the art should also understand that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments herein can be implemented as electronic hardware, computer software, or a combination thereof. To clearly illustrate the interchangeability of hardware and software, the above description of various illustrative components, blocks, modules, circuits, and steps has been generally described in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and the design constraints imposed on the overall system. Skilled artisans may implement the described functionality in a flexible manner for each particular application, but such implementation decisions should not be construed as departing from the scope of the present disclosure.

[0128] The steps of the methods or algorithms described in connection with the embodiments of this specification may be embodied directly as hardware, software modules executed by a processor, or a combination thereof. The software modules may be located in a RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may be located in a user terminal. Of course, the processor and the storage medium may also exist as discrete components in the user terminal.

[0129] For a software implementation, the techniques described in this application can be implemented using modules (e.g., procedures, functions, etc.) that perform the functions described in this application. These software codes can be stored in a memory unit and executed by a processor. The memory unit can be implemented within the processor or outside the processor. In the latter case, it is communicatively coupled to the processor by various means, which are well known in the art.

[0130] The above description includes examples of one or more embodiments. Of course, it is not possible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but those of ordinary skill in the art should recognize that the various embodiments can be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications, and variations that fall within the scope of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, this term is covered in a manner similar to the term "including" as interpreted when "including" is used as a transitional word in a claim. Further, any use of the term "or" in the claims or specification is intended to mean "non-exclusive or".

Claims

1. A method for constructing a wax deposition prediction model for oil well equipment, characterized in that, Including: Obtaining the working condition data of the wax - deposition state and non - wax - deposition state of the pumping unit well, where the working condition data of the pumping unit well includes multiple linear feature data; Inputting each sample data of the working condition data of the pumping unit well into the trained neural network model respectively, and extracting the first specified number of non - linear features from the specified middle layer of the neural network model; the neural network model is trained using the working condition data of the pumping unit well as the training data; Combining the non - linear features of each sample data with the corresponding sample data to obtain combined sample data including both linear and non - linear features; Using the combined sample data to train a prediction model based on the random forest algorithm to obtain an equipment wax - deposition prediction model.

2. The method according to claim 1, characterized in that, The neural network model includes an input layer, four hidden layers, and an output layer; Extracting the first specified number of non - linear features from the specified middle layer of the neural network model includes: extracting the first specified number of non - linear features from the last hidden layer of the neural network model.

3. The method according to claim 1, wherein The process of training the neural network model using the working condition data of the pumping unit well as the training data includes: Inputting the linear feature data in the working condition data of the pumping unit into the neural network model. If it is determined that the specified model parameters do not converge according to the wax - deposition state prediction result output by the neural network model and the wax - deposition state in the working condition data of the pumping unit well, after adjusting the model parameters, continue to train the neural network model using the working condition data of the pumping unit well. After multiple iterative trainings, until the specified model parameters converge, a trained neural network model is obtained.

4. The method according to claim 1, characterized in that The obtaining of the working condition data of the wax - deposition state and non - wax - deposition state of the pumping unit well includes: Obtaining the dynamometer card data of the wax - deposition state and non - wax - deposition state of the pumping unit well through a crank position sensor and a polished rod load sensor; Pre - processing the dynamometer card data according to specified rules to obtain the working condition data of the pumping unit well including multiple linear feature data of the wax - deposition state and non - wax - deposition state.

5. The method according to claim 4, wherein Pre - processing the dynamometer card data according to specified rules to obtain the working condition data of the pumping unit well including multiple linear feature data of the wax - deposition state and non - wax - deposition state, including: Splitting the dynamometer card data into displacement data and load data, constructing multiple linear feature data of the wax - deposition state and non - wax - deposition state, where the linear feature data includes the stroke frequency + stroke + load point + displacement point; Arranging the load points and displacement points in chronological order to obtain the working condition data of the pumping unit well including multiple linear feature data.

6. The method according to claim 1, wherein The combining of the non - linear features of each sample data with the corresponding sample data to obtain combined sample data including both linear and non - linear features includes: Combining the first specified number of non - linear features of each sample data with the second specified number of linear features of the corresponding sample data, where the second specified number of linear features includes: 1 stroke frequency, 1 stroke, the third specified number of load points, and the fourth specified number of displacement points.

7. The method according to any one of claims 1-6, characterized in that Using the combined sample data to train a prediction model based on the random forest algorithm to obtain an equipment wax - deposition prediction model, including: Dividing the combined sample data into a training set and a validation set; Inputting the training set into a prediction model constructed based on the random forest algorithm to construct a random forest decision tree; Match the verification set with the nodes on the decision tree to obtain the prediction result of equipment wax deposition; Determine the parameters of the prediction model based on the prediction results of equipment wax deposition status obtained through multiple iterative trainings and validations, and obtain a trained equipment wax deposition prediction model; the parameters of the prediction model include at least one of the number of decision trees, the number of nodes in the decision tree, the depth of the decision tree, and the criterion for feature splitting.

8. A wax deposition prediction method for oil well equipment, characterized in that, Include: Obtain the real-time working condition data of the pumping well to be predicted; Input the real-time working condition data into the trained equipment wax deposition prediction model, and output the prediction result of whether wax deposition occurs; The equipment wax deposition prediction model is constructed using the oil well equipment wax deposition prediction model construction method described in any one of claims 1-7.

9. A device for constructing a wax deposition prediction model of oil well equipment, characterized in that, Include: A first data acquisition module for acquiring the working condition data of the pumping well in the wax deposition state and the non-wax deposition state, where the pumping well working condition data includes multiple linear feature data; A non-linear feature acquisition module for respectively inputting each sample data of the pumping well working condition data into a trained neural network model, and extracting a first specified number of non-linear features from a specified middle layer of the neural network model; the neural network model is trained using the pumping well working condition data as training data; A feature combination module for combining the non-linear features of each sample data with the sample data to obtain combined sample data including linear features and non-linear features; A training module for training a prediction model based on the random forest algorithm using the combined sample data to obtain an equipment wax deposition prediction model.

10. A wax deposition prediction device for oil well equipment, characterized in that, Include: A second data acquisition module for acquiring the real-time working condition data of the pumping well to be predicted; A prediction module for inputting the real-time working condition data into the trained equipment wax deposition prediction model and outputting the prediction result of whether wax deposition occurs; The equipment wax deposition prediction model is obtained using the oil well equipment wax deposition prediction model construction device described in claim 9.

11. A computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they implement the oil well equipment wax deposition prediction model construction method described in any one of claims 1-7 and / or the oil well equipment wax deposition prediction method described in claim 8.

12. A data processing device, characterized in that, Include: A memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the oil well equipment wax deposition prediction model construction method described in any one of claims 1-7 and / or the oil well equipment wax deposition prediction method described in claim 8.