Method and device for detecting working condition of oil pumping unit
By using the residual network model to detect the working conditions of the pumping machine in the fault diagnosis of the pumping machine, the problems of cumbersome and low efficiency in the existing technology are solved, and more efficient fault diagnosis and working condition monitoring are achieved.
Patent Information
- Application Number
- CN202111336196.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-11-11
AI Technical Summary
In the prior art, the fault diagnosis process of oil pumping engines is cumbersome and inefficient, which makes it difficult to grasp the real-time working conditions of the oil pumping engine in a timely manner, affecting production efficiency and economic benefits.
By obtaining the first electrical parameter data from the oil pump condition database, performing data preprocessing, the oil pump condition model is trained using the residual network model, learning and saving the correspondence between the data and the working condition results, and then detecting the working condition of the oil pump.
It improves the efficiency of oil pump fault diagnosis, simplifies the diagnosis process, and can grasp the working conditions of oil pump more quickly, thereby improving production efficiency and economic benefits.
Smart Images

Figure CN116104477B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of oil production technology, and in particular to a method and device for detecting the working condition of an oil pump. Background Art
[0002] In oilfield production, the pumping unit is prone to damage due to its harsh working environment and complex conditions. Therefore, timely grasping the real-time working conditions of the pumping unit well is of great significance to improving production efficiency and economic benefits.
[0003] Traditional fault diagnosis technology for oil pumping units mainly identifies working conditions by analyzing the dynamometer diagram, but the measurement of the dynamometer diagram is cumbersome and requires the collection of signals such as the suspension point displacement and load of each oil well. The drawing of the dynamometer diagram requires the determination of the relationship between displacement and load, and the image inflection point needs to be identified through scientific calculation methods. Secondly, load sensors are used for signal collection, but such sensors are in the tensile process of alternating loads for a long time, which can easily cause changes in the elastic coefficient or even failure. Displacement and load sensors need to be installed on the frame and the light rod, and are connected to the main control instrument through long-distance leads, which are prone to failure, resulting in reduced reliability, increased maintenance workload, and increased costs.
[0004] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following technical problems in the related art: when diagnosing the failure of the oil pump, the diagnosis process is cumbersome and inefficient. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present invention provide a method and device for detecting the working condition of an oil pump, so as to at least solve the problems in the prior art of diagnosing oil pump faults, such as complicated diagnostic process and low efficiency.
[0006] The purpose of this disclosure is achieved through the following technical solutions:
[0007] In a first aspect, an embodiment of the present disclosure provides a method for detecting the working condition of an oil pump, which is applied to the field of oil production technology, comprising: acquiring first electrical parameter data of the oil pump from an oil pump working condition database, and performing data preprocessing on the first electrical parameter data; using the first electrical parameter data that has undergone the data preprocessing to train an oil pump working condition model, so that the oil pump working condition model learns and saves the correspondence between the first electrical parameter data and the working condition results of the oil pump, wherein the oil pump working condition model is a residual network model; and using the trained oil pump working condition model to detect the working condition of the oil pump.
[0008] In an exemplary embodiment, the data preprocessing of the first electrical parameter data includes at least one of the following: deleting outlier data, deleting missing point data, deleting duplicate data, and resampling the fault category of the oil pump with a small amount of data; wherein the outlier data is point data in the first electrical parameter data that exceeds a preset range; and the missing point data is the first electrical parameter data whose dimension is not equal to the first preset dimension.
[0009] In an exemplary embodiment, the use of the trained pumping unit operating condition model to detect the working condition of the pumping unit includes: deploying the trained pumping unit operating condition model on an algorithm server; obtaining second electrical parameter data of the pumping unit through a software server, and sending the second electrical parameter data to the algorithm server; and using the trained pumping unit operating condition model to detect the working condition of the pumping unit based on the second electrical parameter data received by the algorithm server.
[0010] In an exemplary embodiment, obtaining the second electrical parameter data of the oil pump through the software server includes: storing the second electrical parameter data in a real-time database of the oil pump by automatically collecting the second electrical parameter data of the oil pump or obtaining the second electrical parameter data of the oil pump from an Internet of Things system; and obtaining the second electrical parameter data of the oil pump from the real-time database of the oil pump through the software server.
[0011] In an exemplary embodiment, before obtaining the second electrical parameter data of the oil pump through the software server, the method also includes: setting the first input parameter and the first output parameter of the software server; setting the second input parameter and the second output parameter of the algorithm server; wherein the software server obtains the second electrical parameter data through the first input parameter, the software server and the algorithm server establish a connection through the first output parameter and the second input parameter, the algorithm server outputs the detection result of the oil pump working condition model on the working condition of the oil pump through the second output parameter, the software server and the algorithm server.
[0012] In an exemplary embodiment, the first electrical parameter data that has been preprocessed with the data is used to train the oil pumping unit operating model, so that the oil pumping unit operating model learns and saves the corresponding relationship between the first electrical parameter data and the operating result of the oil pumping unit, wherein before the oil pumping unit operating model is a residual network model, the method also includes: using bottleneck design to optimize the oil pumping unit operating model, including: in the first convolution layer of the oil pumping unit operating model, reducing the dimension of the first electrical parameter data to a second preset dimension; using the intermediate convolution layer between the first convolution layer and the last convolution layer of the oil pumping unit operating model to process the first electrical parameter data with reduced dimension; in the last convolution layer of the oil pumping unit operating model, restoring the dimension of the first electrical parameter data processed by the intermediate convolution layer to the original dimension, wherein the original dimension is the dimension of the first electrical parameter data before the first convolution layer reduces the dimension of the first electrical parameter data.
[0013] In an exemplary embodiment, the method includes: determining the number of batches of the pumping unit operating condition model when training the pumping unit operating condition model, wherein the batch number of the batches of the first electrical parameter data of the pumping unit is used to indicate the number of the first electrical parameter data of the pumping unit obtained from the pumping unit operating condition database each time the pumping unit operating condition model is trained; looping through the following steps to perform self-supervised training on the pumping unit operating condition model: step 1, determining the batch number of the first electrical parameter data from the pumping unit operating condition database; step 2, performing data preprocessing on the batch number of the first electrical parameter data; step 3, inputting the batch number of the first electrical parameter data after the data preprocessing into the pumping unit operating condition model in sequence to obtain the batch number of the third electrical parameter data; step 4, performing self-supervised training on the pumping unit operating condition model through focal plane. loss loss function calculates the error value between each of the first electrical parameter data and the third electrical parameter data corresponding to each of the first electrical parameter data; step five, training the oil pumping unit operating condition model according to the error value; step six, in the current batch training, when the error value between the last of the first electrical parameter data input into the oil pumping unit operating condition model and the third electrical parameter data corresponding to the last of the first electrical parameter data input into the oil pumping unit operating condition model is less than a preset threshold, the loop is ended.
[0014] In a second aspect, an embodiment of the present disclosure provides a device for detecting the working condition of an oil pump, which is applied to the field of oil production technology, and includes: an acquisition module, used to acquire first electrical parameter data of the oil pump from an oil pump working condition database, and perform data preprocessing on the first electrical parameter data; a training module, used to train an oil pump working condition model using the first electrical parameter data that has undergone the data preprocessing, so that the oil pump working condition model learns and saves the correspondence between the first electrical parameter data and the working condition results of the oil pump, wherein the oil pump working condition model is a residual network model; a detection module, used to detect the working condition of the oil pump using the trained oil pump working condition model.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device. The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor is used to implement the above-mentioned method for detecting the working condition of the oil pump or the method for image processing when executing the program stored in the memory.
[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for detecting the working condition of an oil pump or the method for image processing.
[0017] The above technical solution provided by the embodiment of the present disclosure has at least some or all of the following advantages compared with the prior art: obtaining the first electrical parameter data of the oil pump from the oil pump operating condition database, and performing data preprocessing on the first electrical parameter data; using the first electrical parameter data after the data preprocessing to train the oil pump operating condition model, so that the oil pump operating condition model learns and saves the corresponding relationship between the first electrical parameter data and the operating condition results of the oil pump, wherein the oil pump operating condition model is a residual network model; using the trained oil pump operating condition model to detect the working condition of the oil pump. Because the working condition of the oil pump is detected with the help of a neural network model, the above technical means can solve the problems of the prior art in diagnosing the fault of the oil pump, such as the cumbersome diagnosis process and low efficiency, thereby improving the efficiency of diagnosing the fault of the oil pump. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 A hardware structure block diagram of a computer terminal for detecting a working condition of an oil pumping unit according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 2 A flow chart schematically shows a method for detecting the working condition of an oil pumping unit according to an embodiment of the present disclosure;
[0022] Figure 3 A structural block diagram schematically shows a device for detecting the working condition of an oil pumping unit according to an embodiment of the present disclosure;
[0023] Figure 4 The structural block diagram of an electronic device provided by an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0024] The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present disclosure may be combined with each other without conflict.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0026] The method embodiments provided in the embodiments of the present disclosure can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 The hardware structure block diagram of a computer terminal of a method for detecting the working condition of an oil pumping unit according to an embodiment of the present disclosure is schematically shown. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (the processor 102 may include but is not limited to a microprocessor (Microprocessor Unit, referred to as MPU) or a programmable logic device (Programmable logic device, referred to as PLD) and other processing devices and a memory 104 for storing data. Optionally, the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for detecting the working condition of the oil pump in the embodiment of the present disclosure. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] In an embodiment of the present disclosure, a method for detecting the working condition of an oil pump is provided. Figure 2 The flowchart of a method for detecting the working condition of an oil pumping unit according to an embodiment of the present disclosure is schematically shown. Figure 2 As shown, the process includes the following steps:
[0030] Step S202, obtaining first electrical parameter data of the oil pumping unit from an oil pumping unit operating condition database, and performing data preprocessing on the first electrical parameter data;
[0031] Step S204, using the first electrical parameter data that has undergone the data preprocessing to train the pumping unit operating model, so that the pumping unit operating model learns and stores the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein the pumping unit operating model is a residual network model;
[0032] Step S206: Use the trained pumping unit operating condition model to detect the operating condition of the pumping unit.
[0033] Working condition is the abbreviation of working condition. The working condition database of the oil pump is actually a database about the working condition of the oil pump. The working condition model of the oil pump is a neural network model for identifying the working condition of the oil pump. The first electrical parameter data includes three-phase current, three-phase voltage, three-phase active power, total active power, three-phase reactive power, total reactive power, apparent power, three-phase power factor, total active electric energy and total reactive electric energy of three-phase power equipment, etc. The first electrical parameter data can be an active power sequence, which can include: A-phase active power sequence, B-phase active power sequence and C-phase active power sequence. Because the working condition model of the oil pump identifies the A-phase active power sequence, B-phase active power sequence and C-phase active power sequence respectively, or uses the A-phase active power sequence, B-phase active power sequence and C-phase active power sequence to train the working condition model of the oil pump respectively, the effect is the same, so the present disclosure only takes the A-phase active power sequence as an example for explanation.
[0034] Because the present invention uses a neural network model to detect the working condition of the oil pump, the above-mentioned technical means can solve the problems in the prior art of diagnosing the faults of the oil pump, such as the complicated diagnosis process and low efficiency, thereby improving the efficiency of diagnosing the faults of the oil pump.
[0035] In step S204, data preprocessing is performed on the first electrical parameter data, including at least one of the following: deleting outlier data, deleting missing point data, deleting duplicate data, and resampling the fault category of the oil pump with a small amount of data; wherein the outlier data is point data in the first electrical parameter data that exceeds a preset range; and the missing point data is the first electrical parameter data whose dimension is not equal to the first preset dimension.
[0036] If the first electrical parameter data used to train the pumping unit operating model contains outlier data, it will cause large errors and poor training results, because outlier data is data that is greatly different from most of the data in the first electrical parameter data. The outlier data is not representative. When training the pumping unit operating model, the outlier data must be removed from the first electrical parameter data. Missing point data cannot be used to train the pumping unit operating model, because training the pumping unit operating model requires that the dimension of the data used must be equal to the first preset dimension. The pumping unit has multiple fault categories. If the amount of data for a certain fault category is small, the ultimately trained pumping unit operating model cannot identify the fault category well.
[0037] Table 1 is the corresponding relationship between the A-phase active power sequence of the pumping unit input into the pumping unit operating model and the operating result of the pumping unit output, as shown in the following table:
[0038]
[0039] The pumping unit operating result is the test result of the working condition of the pumping unit. The working condition of the pumping unit includes whether the pumping unit has any faults and the specific fault type. The numbers under the pumping unit operating result in Table 1 represent a working condition of the pumping unit. For example, when the active power sequence of phase A is 3.78, 5.09, 4.90..., the pumping unit operating result is 6, which means that the pumping unit is insufficiently supplied with liquid.
[0040] In step S206, the working condition of the oil pump is detected using the trained oil pump operating condition model, including: deploying the trained oil pump operating condition model on the algorithm server; obtaining second electrical parameter data of the oil pump through the software server, and sending the second electrical parameter data to the algorithm server; and detecting the working condition of the oil pump using the trained oil pump operating condition model based on the second electrical parameter data received by the algorithm server.
[0041] The algorithm server can be a python algorithm server, and the software server can be a java server. The java server is actually deployed at the back end of the software, and the python algorithm server can be deployed at the front end of the software. The front-end and back-end interaction of the software mainly adopts the AJAX communication mechanism. The trained pumping unit operating condition model detects the working condition of the pumping unit to obtain the operating condition result of the pumping unit, and the algorithm server displays the operating condition result of the pumping unit to the user through the GUI interface. The embodiment of the present disclosure is different from the field of neural network model detection, which only uses the neural network model to detect the target object. Instead, the trained pumping unit operating condition model is deployed on the algorithm server, and the second electrical parameter data of the pumping unit is obtained through the software server. The operating condition result of the pumping unit is obtained through the interaction between the algorithm server and the software server, which can greatly improve the detection efficiency.
[0042] In step S206, the second electrical parameter data of the oil pump is obtained through the software server, including: storing the second electrical parameter data in the real-time database of the oil pump by automatically collecting the second electrical parameter data of the oil pump or obtaining the second electrical parameter data of the oil pump from the Internet of Things system; and obtaining the second electrical parameter data of the oil pump from the real-time database of the oil pump through the software server.
[0043] The second electrical parameter data of the oil pump is actually the real-time electrical parameter data of the oil pump. The disclosed embodiment can collect the second electrical parameter data of the oil pump automatically or obtain the second electrical parameter data of the oil pump from the Internet of Things system.
[0044] In step S204, before obtaining the second electrical parameter data of the oil pump through the software server, the method also includes: setting the first input parameter and the first output parameter of the software server; setting the second input parameter and the second output parameter of the algorithm server; wherein the software server obtains the second electrical parameter data through the first input parameter, the software server and the algorithm server establish a connection through the first output parameter and the second input parameter, the algorithm server outputs the detection result of the oil pump working condition model on the working condition of the oil pump through the second output parameter, the software server and the algorithm server.
[0045] In order to facilitate the interaction between the algorithm server and the software server, the embodiment of the present disclosure respectively sets the input parameters and output parameters of the software server and the algorithm server, and realizes the interaction between the algorithm server and the software server through the input parameters and output parameters of the software server and the algorithm server, thereby improving the efficiency of diagnosing oil pump faults.
[0046] In step S204, the first electrical parameter data that has been preprocessed with the data is used to train the oil pumping unit operating model, so that the oil pumping unit operating model learns and saves the corresponding relationship between the first electrical parameter data and the operating result of the oil pumping unit, wherein, before the oil pumping unit operating model is a residual network model, the method also includes: using bottleneck design to optimize the oil pumping unit operating model, including: in the first convolution layer of the oil pumping unit operating model, reducing the dimension of the first electrical parameter data to a second preset dimension; using the intermediate convolution layer between the first convolution layer and the last convolution layer of the oil pumping unit operating model to process the first electrical parameter data with reduced dimension; in the last convolution layer of the oil pumping unit operating model, restoring the dimension of the first electrical parameter data processed by the intermediate convolution layer to the original dimension, wherein the original dimension is the dimension of the first electrical parameter data before the first convolution layer reduces the dimension of the first electrical parameter data.
[0047] The middle convolution layer includes one or more convolution layers. Bottleneck design is also called bottleneck design, that is, the bottleneck technology is used to optimize the pumping unit operating model. Bottleneck technology can first reduce the dimension of the model input, and finally increase the dimension of the model output to the original dimension, because the model receives data with reduced dimensions from each layer of the network from input to output, so the model has a fast calculation speed. Integrating bottleneck into the pumping unit operating model improves the speed of training convergence and result calculation of the pumping unit operating model. The pumping unit operating model is a residual network model. The overall work of the pumping unit operating model can be divided into feature extraction and classification. In the feature extraction stage, in order to extract the high-dimensional feature vector of the full-stroke active power sequence, a convolutional neural network with a deeper network structure is required; however, as the dimension of the feature vector and the number of network layers increase, the convolutional neural network model will have gradient diffusion / explosion problems during the training process. The embodiment of the present disclosure adopts a residual network to adopt a residual mechanism to solve this problem.
[0048] In an optional embodiment, the method comprises: determining the number of batch processing items when training the pumping unit operating condition model, wherein the batch processing item number is used to indicate the number of first electrical parameter data items of the pumping unit obtained from the pumping unit operating condition database each time the pumping unit operating condition model is trained; looping through the following steps to perform self-supervised training on the pumping unit operating condition model: step one, determining the batch processing item number of first electrical parameter data items from the pumping unit operating condition database; step two, performing data preprocessing on the batch processing item number of first electrical parameter data items; step three, respectively performing the data preprocessing on the batch processing item number of first electrical parameter data items Parameter data are sequentially input into the oil pumping unit operating model to obtain the batch processing number of third electrical parameter data; step four, the error value between each first electrical parameter data and the third electrical parameter data corresponding to each first electrical parameter data is calculated through the focalbss loss function; step five, the oil pumping unit operating model is trained according to the error value; step six, in the current batch training, when the error value between the last first electrical parameter data input into the oil pumping unit operating model and the third electrical parameter data corresponding to the last first electrical parameter data input into the oil pumping unit operating model is less than a preset threshold, the loop is ended.
[0049] The disclosed embodiment adopts a 5-fold cross-validation method, which can be used to prevent overfitting caused by overly complex models. This method is a statistical method for evaluating the generalization ability of training data sets. The basic idea is to divide the original data into a training set and a test set. The training set is used to train the model, and the test set is used to test the trained model. This is used as an evaluation index for the model. The data after electrical parameter processing is randomly divided into 5 parts, 4 parts are selected as training sets each time, and the remaining 1 part is used as a test set. The cross-validation is repeated 5 times, and the average of the 5 accuracy rates is taken as the evaluation index of the final model.
[0050] Table 2 is the training set, test set and label table divided according to the pumping unit operating condition database, as shown in the following table:
[0051]
[0052]
[0053] The disclosed embodiment divides each fault category of the oil pump into a training set and a test set. Each training set may have m first electrical parameter data, each test set may have n first electrical parameter data, and the oil pump has 9 fault categories, so the total training set may have 9m first electrical parameter data, and the total test set may have 9n first electrical parameter data. The fault categories of the oil pump include: continuous pumping and spraying, gas lock or severe liquid hammer, gas influence, insufficient liquid supply, fixed valve leakage, floating valve leakage, pump hanging, pump collision and normal pump operation. The above-mentioned fault categories of the oil pump are common categories in this field, so they will not be explained.
[0054] Table 3 is a table showing the results of the pumping unit working condition model detecting the working condition of the pumping unit, as shown in the following table:
[0055] Working condition type (working condition code) Accuracy 1. Pump and spray 92.2% 2. Gas lock or severe liquid shock 89.7% 5 Gas Effect 90.7% 6. Insufficient fluid supply 90.2% 7 Fixed Valve Leakage 92.4% 8 Swimming Valer Missing 91.7% 9 Pump hanging 89.6% 10 Pump down 82.4% 13 Pump is working properly 95.2%
[0056] In the disclosed embodiment, the pumping unit operating condition model uses the ResNets model, specifically a 50-layer ResNets model, denoted as ResNets50. Experimental results show that under the current data volume, ResNets50 has the best performance in terms of operating condition recognition accuracy and training time. Compared with the three model structures of ResNets101, 152, and 200, ResNets50 has the highest average accuracy of 92.4% under the same data volume. With the increase in the number of network layers, the accuracy of the residual network model is not significantly improved, but the training time is greatly increased, so we use a 50-layer network. At the same time, due to the different data volume of each operating condition, the diagnostic effect is also different, but the accuracy can basically reach about 90%.
[0057] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk), including a number of instructions for a terminal device (which can be a mobile phone, a computer, a component server, or a network device, etc.) to execute the methods of each embodiment of the present disclosure.
[0058] In this embodiment, a device for detecting the working condition of an oil pumping unit is also provided, and the device for detecting the working condition of the oil pumping unit is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0059] Figure 3 A structural block diagram of a device for detecting the working condition of an oil pumping unit according to an optional embodiment of the present disclosure is schematically shown. Figure 3 As shown, the device comprises:
[0060] An acquisition module 302 is used to acquire first electrical parameter data of the oil pumping unit from an oil pumping unit operating condition database, and perform data preprocessing on the first electrical parameter data;
[0061] A training module 304 is used to train a pumping unit operating model using the first electrical parameter data that has undergone the data preprocessing, so that the pumping unit operating model learns and stores the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein the pumping unit operating model is a residual network model;
[0062] The detection module 306 is used to detect the working condition of the oil pump using the trained oil pump working condition model.
[0063] Because the present invention uses a neural network model to detect the working condition of the oil pump, the above-mentioned technical means can solve the problems in the prior art of diagnosing the faults of the oil pump, such as the complicated diagnosis process and low efficiency, thereby improving the efficiency of diagnosing the faults of the oil pump.
[0064] Optionally, the training module 304 is also used to delete outlier data, delete missing point data, delete duplicate data and resample the fault category of the oil pump with a small amount of data; wherein the outlier data is point data in the first electrical parameter data that exceeds a preset range; the missing point data is the first electrical parameter data whose dimension is not equal to the first preset dimension.
[0065] If the first electrical parameter data used to train the pumping unit operating model contains outlier data, it will cause large errors and poor training results, because outlier data is data that is greatly different from most of the data in the first electrical parameter data. The outlier data is not representative. When training the pumping unit operating model, the outlier data must be removed from the first electrical parameter data. Missing point data cannot be used to train the pumping unit operating model, because training the pumping unit operating model requires that the dimension of the data used must be equal to the first preset dimension. The pumping unit has multiple fault categories. If the amount of data for a certain fault category is small, the ultimately trained pumping unit operating model cannot identify the fault category well.
[0066] Table 1 is the corresponding relationship between the A-phase active power sequence of the pumping unit input into the pumping unit operating model and the operating result of the pumping unit output, as shown in the following table:
[0067]
[0068] The pumping unit working condition result is the test result of the working condition of the pumping unit. The working condition of the pumping unit includes whether the pumping unit has any faults and the specific fault type. The numbers under the pumping unit working condition result in Table 1 represent a working condition of the pumping unit. For example, if the pumping unit working condition result is 6, it means that the pumping unit is insufficiently supplied with liquid.
[0069] Optionally, the detection module 306 is also used to deploy the trained pumping unit operating condition model on the algorithm server; obtain the second electrical parameter data of the pumping unit through the software server, and send the second electrical parameter data to the algorithm server; and use the trained pumping unit operating condition model to detect the working condition of the pumping unit based on the second electrical parameter data received by the algorithm server.
[0070] The algorithm server can be a python algorithm server, and the software server can be a java server. The java server is actually deployed at the back end of the software, and the python algorithm server can be deployed at the front end of the software. The front-end and back-end interaction of the software mainly adopts the AJAX communication mechanism. The trained pumping unit operating condition model detects the working condition of the pumping unit to obtain the operating condition result of the pumping unit, and the algorithm server displays the operating condition result of the pumping unit to the user through the GUI interface. The embodiment of the present disclosure is different from the field of neural network model detection, which only uses the neural network model to detect the target object. Instead, the trained pumping unit operating condition model is deployed on the algorithm server, and the second electrical parameter data of the pumping unit is obtained through the software server. The operating condition result of the pumping unit is obtained through the interaction between the algorithm server and the software server, which can greatly improve the detection efficiency.
[0071] Optionally, the detection module 306 is also used to store the second electrical parameter data in a real-time database of the oil pump by automatically collecting the second electrical parameter data of the oil pump or obtaining the second electrical parameter data of the oil pump from an Internet of Things system; and obtain the second electrical parameter data of the oil pump from the real-time database of the oil pump through a software server.
[0072] The second electrical parameter data of the oil pump is actually the real-time electrical parameter data of the oil pump. The disclosed embodiment can collect the second electrical parameter data of the oil pump automatically or obtain the second electrical parameter data of the oil pump from the Internet of Things system.
[0073] Optionally, the training module 304 is also used to set the first input parameter and the first output parameter of the software server; set the second input parameter and the second output parameter of the algorithm server; wherein the software server obtains the second electrical parameter data through the first input parameter, the software server and the algorithm server establish a connection through the first output parameter and the second input parameter, and the algorithm server outputs the detection result of the pumping unit working condition model on the pumping unit through the second output parameter, the software server and the algorithm server.
[0074] In order to facilitate the interaction between the algorithm server and the software server, the embodiment of the present disclosure respectively sets the input parameters and output parameters of the software server and the algorithm server, and realizes the interaction between the algorithm server and the software server through the input parameters and output parameters of the software server and the algorithm server, thereby improving the efficiency of diagnosing oil pump faults.
[0075] Optionally, the training module 304 is also used to use bottleneck design to optimize the model of the pumping unit operating condition model, including: in the first convolution layer of the pumping unit operating condition model, reducing the dimension of the first electrical parameter data to a second preset dimension; using the intermediate convolution layer between the first convolution layer and the last convolution layer of the pumping unit operating condition model to process the first electrical parameter data with reduced dimension; in the last convolution layer of the pumping unit operating condition model, restoring the dimension of the first electrical parameter data processed by the intermediate convolution layer to the original dimension, wherein the original dimension is the dimension of the first electrical parameter data before the first convolution layer reduces the dimension of the first electrical parameter data.
[0076] The middle convolution layer includes one or more convolution layers. Bottleneck design is also called bottleneck design, that is, the use of bottleneck technology to optimize the pumping unit operating model. Integrating bottleneck into the pumping unit operating model improves the speed of training convergence and result calculation of the pumping unit operating model. The pumping unit operating model is a residual network model. The overall work of the pumping unit operating model can be divided into feature extraction and classification. In the feature extraction stage, in order to extract the high-dimensional feature vector of the full-stroke active power sequence, a convolutional neural network with a deeper network structure is required; however, as the dimension of the feature vector and the number of network layers increase, the convolutional neural network model will have a gradient diffusion / explosion problem during the training process. The embodiment of the present disclosure adopts a residual network and a residual mechanism to solve this problem.
[0077] Optionally, the training module 304 is further used to determine the number of batch processing items when training the pumping unit operating condition model, wherein the batch processing item number is used to indicate the number of first electrical parameter data of the pumping unit obtained from the pumping unit operating condition database each time the pumping unit operating condition model is trained; the following steps are looped to perform self-supervised training on the pumping unit operating condition model: step 1, determining the batch processing item number of first electrical parameter data from the pumping unit operating condition database; step 2, performing data preprocessing on the batch processing item number of first electrical parameter data; step 3, respectively performing the data preprocessing on the batch processing item number of first electrical parameter data Parameter data are sequentially input into the oil pumping unit operating model to obtain the batch processing number of third electrical parameter data; step four, the error value between each first electrical parameter data and the third electrical parameter data corresponding to each first electrical parameter data is calculated through the focalloss loss function; step five, the oil pumping unit operating model is trained according to the error value; step six, in the current batch training, when the error value between the last first electrical parameter data input into the oil pumping unit operating model and the third electrical parameter data corresponding to the last first electrical parameter data input into the oil pumping unit operating model is less than a preset threshold, the loop is ended.
[0078] The disclosed embodiment adopts a 5-fold cross-validation method, which can be used to prevent overfitting caused by overly complex models. This method is a statistical method for evaluating the generalization ability of training data sets. The basic idea is to divide the original data into a training set and a test set. The training set is used to train the model, and the test set is used to test the trained model. This is used as an evaluation index for the model. The data after electrical parameter processing is randomly divided into 5 parts, 4 parts are selected as training sets each time, and the remaining 1 part is used as a test set. The cross-validation is repeated 5 times, and the average of the 5 accuracy rates is taken as the evaluation index of the final model.
[0079] Table 2 is the training set, test set and label table divided according to the pumping unit operating condition database, as shown in the following table:
[0080]
[0081] The disclosed embodiment divides each fault category of the oil pump into a training set and a test set. Each training set may have m first electrical parameter data, each test set may have n first electrical parameter data, and the oil pump has 9 fault categories, so the total training set may have 9m first electrical parameter data, and the total test set may have 9n first electrical parameter data. The fault categories of the oil pump include: continuous pumping and spraying, gas lock or severe liquid hammer, gas influence, insufficient liquid supply, fixed valve leakage, floating valve leakage, pump hanging, pump collision and normal pump operation. The above-mentioned fault categories of the oil pump are common categories in this field, so they will not be explained.
[0082] Table 3 is a table showing the results of the pumping unit working condition model detecting the working condition of the pumping unit, as shown in the following table:
[0083]
[0084]
[0085] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0086] An embodiment of the present disclosure provides an electronic device.
[0087] Figure 4 The structural block diagram of an electronic device provided by an embodiment of the present disclosure is schematically shown.
[0088] Reference Figure 4 As shown, the electronic device 400 provided by the embodiment of the present disclosure includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 communicate with each other through the communication bus 404; the memory 403 is used to store computer programs; the processor 401 is used to implement the steps in any of the above method embodiments when executing the program stored in the memory.
[0089] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the input / output device is connected to the processor.
[0090] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0091] S1, acquiring first electrical parameter data of the oil pumping unit from an oil pumping unit operating condition database, and performing data preprocessing on the first electrical parameter data;
[0092] S2, using the first electrical parameter data that has been preprocessed by the data to train a pumping unit operating model, so that the pumping unit operating model learns and stores the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein the pumping unit operating model is a residual network model;
[0093] S3, using the trained pumping unit operating condition model to detect the operating condition of the pumping unit.
[0094] The embodiments of the present disclosure further provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0095] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0096] S1, acquiring first electrical parameter data of the oil pumping unit from an oil pumping unit operating condition database, and performing data preprocessing on the first electrical parameter data;
[0097] S2, using the first electrical parameter data that has been preprocessed by the data to train a pumping unit operating model, so that the pumping unit operating model learns and stores the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein the pumping unit operating model is a residual network model;
[0098] S3, using the trained pumping unit operating condition model to detect the operating condition of the pumping unit.
[0099] The computer-readable storage medium may be included in the device / apparatus described in the above embodiment; or it may exist independently without being assembled into the device / apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0100] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0101] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0102] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present disclosure can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present disclosure is not limited to any specific combination of hardware and software.
[0103] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for detecting the working condition of an oil pump, characterized in that: include: Acquire first electrical parameter data of the oil pumping unit from an oil pumping unit operating condition database, and perform data preprocessing on the first electrical parameter data; Using the first electrical parameter data that has undergone the data preprocessing to train the pumping unit operating model, so that the pumping unit operating model learns and stores the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein the pumping unit operating model is a residual network model; The trained pumping unit operating condition model is used to detect the working condition of the pumping unit. Wherein, the first electrical parameter data after the data preprocessing is used to train the pumping unit operating model, so that the pumping unit operating model learns and saves the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein, before the pumping unit operating model is a residual network model, the method further includes: The bottleneck design is used to optimize the pumping unit operating model, including: In the first convolution layer of the oil pumping unit operating model, the dimension of the first electrical parameter data is reduced to a second preset dimension; Using an intermediate convolution layer between the first convolution layer and the last convolution layer of the oil pumping unit operating condition model to process the first electrical parameter data after dimension reduction; In the last convolution layer of the oil pumping unit operating condition model, the dimension of the first electrical parameter data processed by the intermediate convolution layer is restored to the original dimension, wherein the original dimension is the dimension of the first electrical parameter data before the first convolution layer reduces the dimension of the first electrical parameter data. wherein the number of batch processing items when training the pumping unit operating condition model is determined, wherein the number of batch processing items is used to indicate the number of first electrical parameter data items of the pumping unit obtained from the pumping unit operating condition database each time the pumping unit operating condition model is trained; The following steps are executed cyclically to perform self-supervisory training on the pumping unit operating condition model: Step 1, determining a batch processing number of the first electrical parameter data from the oil pumping unit operating condition database; Step 2: performing data preprocessing on the batch processing number of the first electrical parameter data; Step 3, inputting the batch processed pieces of first electrical parameter data that have undergone the data preprocessing into the pumping unit operating model in sequence to obtain the batch processed pieces of third electrical parameter data; Step 4: Calculate the error value between each piece of the first electrical parameter data and the third electrical parameter data corresponding to each piece of the first electrical parameter data by using a focal loss function; Step 5, training the pumping unit operating model according to the error value; Step six, in the current batch training, when the error value between the first electrical parameter data of the last input of the pumping unit operating model and the third electrical parameter data corresponding to the first electrical parameter data of the last input of the pumping unit operating model is less than a preset threshold, the loop ends.
2. The method according to claim 1, characterized in that The performing data preprocessing on the first electrical parameter data includes at least one of the following: Deleting outlier data, deleting lost point data, deleting duplicate data, and resampling the fault categories of the oil pumping unit with a small amount of data; Among them, the outlier point data is point data in the first electrical parameter data that exceeds a preset range; the missing point data is the first electrical parameter data whose dimension is not equal to the first preset dimension.
3. The method according to claim 1, characterized in that The method of using the trained pumping unit operating condition model to detect the operating condition of the pumping unit includes: Deploy the trained pumping unit operating condition model on the algorithm server; Acquire the second electrical parameter data of the oil pumping unit through the software server, and send the second electrical parameter data to the algorithm server; According to the second electrical parameter data received by the algorithm server, the working condition of the oil pump is detected using the trained oil pump working condition model.
4. The method according to claim 3, characterized in that The obtaining of the second electrical parameter data of the oil pumping unit through the software server comprises: The second electrical parameter data of the oil pumping unit is stored in a real-time database of the oil pumping unit by automatically collecting the second electrical parameter data of the oil pumping unit or obtaining the second electrical parameter data of the oil pumping unit from an Internet of Things system; The second electrical parameter data of the oil pump is obtained from the real-time database of the oil pump through the software server.
5. The method according to claim 3, characterized in that: Before obtaining the second electrical parameter data of the oil pumping unit through the software server, the method further includes: Setting a first input parameter and a first output parameter of the software server; Setting a second input parameter and a second output parameter of the algorithm server; Among them, the software server obtains the second electrical parameter data through the first input parameter, the software server and the algorithm server establish a connection through the first output parameter and the second input parameter, the algorithm server outputs the detection result of the pumping unit working condition model on the pumping unit through the second output parameter, the software server and the algorithm server.
6. A device for detecting the working condition of an oil pump, characterized in that: Applied in the field of oil production technology, the detection method of the working condition of the oil pump according to any one of claims 1 to 5 is implemented, comprising: An acquisition module, used for acquiring first electrical parameter data of the oil pumping unit from an oil pumping unit operating condition database, and performing data preprocessing on the first electrical parameter data; A training module, used for training a pumping unit operating model using the first electrical parameter data preprocessed by the data, so that the pumping unit operating model learns and stores the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein the pumping unit operating model is a residual network model; A detection module is used to detect the working condition of the oil pumping unit using the trained oil pumping unit working condition model. Wherein, the first electrical parameter data after the data preprocessing is used to train the pumping unit operating model, so that the pumping unit operating model learns and saves the corresponding relationship between the first electrical parameter data and the operating result of the pumping unit, wherein, before the pumping unit operating model is a residual network model, the method further includes: The bottleneck design is used to optimize the pumping unit operating model, including: In the first convolution layer of the oil pumping unit operating model, the dimension of the first electrical parameter data is reduced to a second preset dimension; Using an intermediate convolution layer between the first convolution layer and the last convolution layer of the oil pumping unit operating condition model to process the first electrical parameter data after dimension reduction; In the last convolution layer of the oil pumping unit operating condition model, the dimension of the first electrical parameter data processed by the intermediate convolution layer is restored to the original dimension, wherein the original dimension is the dimension of the first electrical parameter data before the first convolution layer reduces the dimension of the first electrical parameter data. wherein the number of batch processing items when training the pumping unit operating condition model is determined, wherein the number of batch processing items is used to indicate the number of first electrical parameter data items of the pumping unit obtained from the pumping unit operating condition database each time the pumping unit operating condition model is trained; The following steps are executed cyclically to perform self-supervisory training on the pumping unit operating condition model: Step 1, determining a batch processing number of the first electrical parameter data from the oil pumping unit operating condition database; Step 2: performing data preprocessing on the batch processing number of the first electrical parameter data; Step 3, inputting the batch processed pieces of first electrical parameter data that have undergone the data preprocessing into the pumping unit operating model in sequence to obtain the batch processed pieces of third electrical parameter data; Step 4: Calculate the error value between each piece of the first electrical parameter data and the third electrical parameter data corresponding to each piece of the first electrical parameter data by using a focal loss function; Step 5, training the pumping unit operating model according to the error value; Step six, in the current batch training, when the error value between the first electrical parameter data of the last input of the pumping unit operating model and the third electrical parameter data corresponding to the first electrical parameter data of the last input of the pumping unit operating model is less than a preset threshold, the loop ends.
7. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 5 when executing a program stored in a memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Fault diagnosis method and device of pumping well
CN111379555A
Rod-pumped well fault diagnosis method based on feature recalibration residual convolutional neural network model
CN111810124A