CN112526959A - Oil well pump fault diagnosis method, device, equipment and storage medium - Google Patents

Oil well pump fault diagnosis method, device, equipment and storage medium Download PDF

Info

Publication number
CN112526959A
CN112526959A CN201910889226.4A CN201910889226A CN112526959A CN 112526959 A CN112526959 A CN 112526959A CN 201910889226 A CN201910889226 A CN 201910889226A CN 112526959 A CN112526959 A CN 112526959A
Authority
CN
China
Prior art keywords
indicator diagram
model
fault diagnosis
well pump
oil well
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910889226.4A
Other languages
Chinese (zh)
Inventor
李志元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201910889226.4A priority Critical patent/CN112526959A/en
Publication of CN112526959A publication Critical patent/CN112526959A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0218Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults
    • G05B23/0243Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults model based detection method, e.g. first-principles knowledge model
    • G05B23/0245Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults model based detection method, e.g. first-principles knowledge model based on a qualitative model, e.g. rule based; if-then decisions
    • G05B23/0248Causal models, e.g. fault tree; digraphs; qualitative physics

Abstract

The embodiment of the application discloses oil-well pump fault diagnosis method, device, equipment and storage medium, wherein the method comprises the following steps: aiming at the oil well pump to be diagnosed, acquiring a indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed, and acquiring the indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram; processing the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram. The method can effectively improve the fault diagnosis accuracy of the oil well pump and avoid the fault false alarm.

Description

Oil well pump fault diagnosis method, device, equipment and storage medium
Technical Field
The application relates to the technical field of computers, in particular to a fault diagnosis method, a fault diagnosis device, fault diagnosis equipment and a storage medium for an oil well pump.
Background
The oil well pump is used as the most commonly used underground lifting pump device for lifting oil well production in various oil fields at home and abroad at present, and the oil well pump is driven by ground oil extraction equipment to reciprocate up and down during working, so that crude oil in a stratum is continuously lifted to the ground through an oil pipe.
The oil well pump is subjected to uninterrupted motion in a complex underground environment of a shaft for a long time, and is influenced by structural components of the oil well pump and shaft environment media, so that abnormal conditions such as valve loss, paraffin precipitation influence, oil viscosity influence, gas influence, shaft sand production influence and the like can often occur, meanwhile, the working state of the oil well pump is changed due to insufficient liquid supply of a reservoir, and the oil well pump cannot work due to the fact that the oil pumping rod is broken and taken off and oil pipe loss directly occurs. In practical application, once the working efficiency of the oil well pump is reduced or the oil well pump stops working, the yield of the oil well is reduced, even the oil well stops working directly, the fault diagnosis is carried out on the oil well pump in time, and corresponding treatment measures are taken, so that the method becomes one of the key points of the oil well exploitation work.
At present, when fault diagnosis is performed on an oil well pump, whether the oil well pump has a fault is generally judged based on a comparison result of an oil well pump indicator diagram and a typical fault indicator diagram, and specifically, the fault of the oil well pump is determined under the condition that the similarity between the oil well pump indicator diagram and the typical fault indicator diagram reaches a preset threshold value. However, the fault diagnosis method often causes false fault, because the indicator diagram of some oil-well pumps in normal production state may present the form of typical fault indicator diagram under the influence of factors such as well deviation, pump depth and different properties of produced fluid, thereby causing the occurrence of false diagnosis.
In summary, how to improve the accuracy of fault diagnosis of the oil pump and avoid the occurrence of fault false alarm is a problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the application provides a fault diagnosis method, a fault diagnosis device, equipment and a storage medium for an oil well pump, which can effectively improve the fault diagnosis accuracy of the oil well pump and avoid the fault false alarm.
In view of this, the first aspect of the present application provides a method for diagnosing a fault of an oil well pump, including:
aiming at an oil well pump to be diagnosed, acquiring a indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed, and acquiring the indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram;
processing the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; and the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram.
Optionally, the method further includes:
determining secondary characteristic data corresponding to the indicator diagram to be diagnosed and the standard indicator diagram respectively; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
then, the processing the indicator diagram to be diagnosed and the standard indicator diagram through the fault diagnosis model to obtain a diagnosis result of the oil well pump includes:
processing the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the indicator diagram to be diagnosed, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram by the fault diagnosis model to obtain a diagnosis result; the fault diagnosis model is specifically used for determining whether the oil well pump is in fault according to a comparison result of the indicator diagram to be diagnosed and the standard indicator diagram and a comparison result of secondary characteristic data corresponding to the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the standard indicator diagram.
Optionally, the method further includes:
calculating the similarity between the indicator diagram to be diagnosed and the typical fault indicator diagram; the typical fault indicator diagram is an indicator diagram of the oil well pump in a typical fault state;
and under the condition that the similarity exceeds a preset threshold, executing the fault diagnosis model to process the indicator diagram to be diagnosed and the standard indicator diagram to obtain a diagnosis result of the oil well pump.
Optionally, the fault diagnosis model is trained by:
obtaining a plurality of historical indicator diagrams and standard indicator diagrams corresponding to the historical indicator diagrams; the historical indicator diagram comprises an indicator diagram with a fault diagnosis result, an indicator diagram with a fault false alarm diagnosis result and an indicator diagram with a normal diagnosis result;
generating a sample data set according to the acquired historical indicator diagrams and the standard indicator diagrams corresponding to the historical indicator diagrams respectively; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram and a diagnosis result of the historical indicator diagram;
and performing iterative training on an initial fault diagnosis model by using the sample data set to obtain the fault diagnosis model through training.
Optionally, the generating a sample data set according to the obtained historical indicator diagrams and their respective corresponding standard indicator diagrams includes:
determining secondary characteristic data corresponding to the historical indicator diagram and the standard indicator diagram respectively; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
generating the sample data set according to the historical indicator diagram and the secondary characteristic data corresponding to the historical indicator diagram, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, secondary characteristic data corresponding to the historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram, secondary characteristic data corresponding to the standard indicator diagram and a diagnosis result of the historical indicator diagram.
Optionally, the initial fault diagnosis model includes a vector machine model, a decision tree model and a random forest model; performing iterative training on an initial fault diagnosis model by using the sample data set to obtain the fault diagnosis model through training, including:
respectively carrying out iterative training on the vector machine model, the decision tree model and the random forest model by using the sample data set to obtain a first model corresponding to the vector machine model, a second model corresponding to the decision tree model and a third model corresponding to the random forest model;
and selecting the fault diagnosis model from the first model, the second model and the third model according to the accuracy rate corresponding to the first model, the second model and the third model respectively and/or according to the recall rate corresponding to the first model, the second model and the third model respectively.
Optionally, the performing iterative training on the initial fault diagnosis model by using the sample data set includes:
circularly executing the following steps N times, wherein N is an integer greater than 1:
dividing the sample data set into a training sample data set and a test sample data set according to a preset proportion;
training the initial fault diagnosis model by using the training sample data set;
determining the accuracy rate and/or the recall rate corresponding to the model obtained by training the initial fault diagnosis model by using the test sample data set;
after completing the N cycles, determining the fault diagnosis model by:
and selecting the fault diagnosis model from the models obtained by training the initial fault diagnosis model each time according to the accuracy and/or recall rate corresponding to the models obtained by training the initial fault diagnosis model each time.
This application second aspect provides an oil-well pump fault diagnosis device, the device includes:
the acquisition module is used for acquiring an indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed and acquiring the indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram;
the diagnosis module is used for processing the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; and the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram.
A third aspect of the application provides an electronic device comprising at least one processor, and at least one memory connected to the processor, a bus;
the processor and the memory complete mutual communication through the bus;
the processor is used for calling the program instructions in the memory so as to execute the oil well pump fault diagnosis method of the first aspect.
A fourth aspect of the present application provides a computer-readable storage medium for storing a computer program for executing the method for diagnosing a fault of an oil well pump according to the first aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
the embodiment of the application provides a fault diagnosis method for an oil well pump, which is characterized in that a fault diagnosis model obtained through machine learning algorithm training is utilized to compare a indicator diagram of the oil well pump in an actual working state with an indicator diagram of the oil well pump in an ideal working state, and therefore whether the oil well pump has faults or not is determined. Specifically, in the fault diagnosis method for the oil well pump provided in the embodiment of the present application, for the oil well pump to be diagnosed, a indicator diagram of the oil well pump in a normal working state is obtained as a to-be-diagnosed indicator diagram, and an indicator diagram of the oil well pump in an ideal working state is obtained as a standard indicator diagram; and then, comparing the indicator diagram to be diagnosed with the standard indicator diagram through the fault diagnosis model, thereby obtaining a fault diagnosis result of the oil well pump to be diagnosed. The method refers to the standard indicator diagram corresponding to the oil well pump to be diagnosed in the process of diagnosing the fault, and the standard indicator diagram is defined based on the characteristics of the actual production environment of the oil well pump to be diagnosed, so that the standard indicator diagram is used as the measurement standard for diagnosing whether the oil well pump has the fault, namely, the standard indicator diagram is equivalent to the actual production environment of the oil well pump in the process of judging whether the oil well pump has the fault, thus the accuracy of fault diagnosis of the oil well pump can be effectively improved, and the fault false alarm condition is avoided.
Drawings
Fig. 1 is a schematic view of an application scenario of a fault diagnosis method for an oil well pump according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a fault diagnosis method for an oil well pump according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart illustrating a method for training a fault diagnosis model according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an oil well pump fault diagnosis device provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the related art, when fault diagnosis is performed on an oil well pump, it is usually required to calculate similarity between a indicator diagram of the oil well pump in an actual working state and various typical fault indicator diagrams, and if the similarity between the indicator diagram of the oil well pump in the actual working state and a certain typical fault indicator diagram exceeds a preset threshold, it is determined that the oil well pump has a fault. However, the diagnosis accuracy of the fault diagnosis method is not high, and fault and false alarm often occur, but the reason is that different oil-well pumps are actually in different production environments and are affected by factors such as well depth, pump depth and different properties of produced fluids in the production environments, and indicator diagrams of some oil-well pumps in normal working states can present the form of typical fault indicator diagrams, so fault and false alarm can occur.
In view of the above technical problems, an embodiment of the present application provides a fault diagnosis method for an oil well pump, in which a fault diagnosis model obtained through machine learning algorithm training is used to compare a indicator diagram of the oil well pump in an actual working state with an indicator diagram of the oil well pump in an ideal working state, so as to accurately determine whether the oil well pump has a fault.
Specifically, in the fault diagnosis method for the oil well pump provided in the embodiment of the present application, for the oil well pump to be diagnosed, a indicator diagram of the oil well pump in an actual working state is first obtained as a to-be-diagnosed indicator diagram, and an indicator diagram of the oil well pump in an ideal working state is obtained as a standard indicator diagram; and then inputting the indicator diagram to be diagnosed and the standard indicator diagram into a fault diagnosis model trained in advance, and analyzing and processing the indicator diagram to be diagnosed and the standard indicator diagram through the fault diagnosis model so as to obtain a diagnosis result of the oil well pump to be diagnosed, wherein the fault diagnosis model is used for determining whether the oil well pump is in fault according to a comparison result between the indicator diagram to be diagnosed and the standard indicator diagram.
Compared with the mode of determining the diagnosis result by comparing the indicator diagram to be diagnosed with the typical fault indicator diagram in the related art, the oil well pump fault diagnosis method provided by the embodiment of the application refers to the standard indicator diagram corresponding to the oil well pump to be diagnosed in the process of diagnosing the fault, and the standard indicator diagram is defined based on the actual production environment of the oil well pump to be diagnosed, so that the standard indicator diagram is used as the measurement standard for diagnosing whether the oil well pump has the fault, namely, the standard indicator diagram is equivalent to the actual production environment of the oil well pump in the process of judging whether the oil well pump has the fault, thus, the condition of fault false alarm can be effectively avoided, and the accuracy of fault diagnosis of the oil well pump is improved.
It should be understood that the oil well pump fault diagnosis method provided by the embodiment of the present application can be applied to electronic devices with data processing capability, such as terminal devices, servers, and the like. The terminal device may be a computer, a Personal Digital Assistant (PDA), a tablet computer, or the like. The server may specifically be an application server or a Web server, and in actual deployment, the server may be an independent server or a cluster server.
In order to facilitate understanding of the technical solutions provided in the embodiments of the present application, the oil well pump fault diagnosis method provided in the embodiments of the present application is described below with reference to practical application scenarios.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a fault diagnosis method for an oil well pump according to an embodiment of the present application. As shown in fig. 1, the application scenario includes a terminal device 110, a server 120, and a database 130; the terminal device 110 is configured to generate a indicator diagram of the oil pump to be diagnosed in an actual working state, that is, generate the indicator diagram to be diagnosed, and transmit the indicator diagram to be diagnosed to the server 120; the database 130 is used for storing indicator diagrams of the plurality of oil pumps in an ideal working state, that is, storing standard indicator diagrams corresponding to the plurality of oil pumps, and is used for providing the server 120 with the standard indicator diagrams required by the server; the server 120 is configured to execute the oil-well pump fault diagnosis method provided in the embodiment of the present application, and determine whether a fault exists in the oil-well pump to be diagnosed according to the indicator diagram to be diagnosed sent by the terminal device 110 and the standard indicator diagram obtained from the database 130.
Specifically, when determining whether a fault exists in the oil pump to be diagnosed, the terminal device 110 correspondingly generates a indicator diagram of the oil pump in an actual working state as a to-be-diagnosed indicator diagram according to an actual working condition of the oil pump, and transmits the to-be-diagnosed indicator diagram to the server 120. After receiving the indicator diagram to be diagnosed transmitted from the terminal device 110, the server 120 determines the oil-well pump corresponding to the indicator diagram to be diagnosed, and then retrieves the indicator diagram of the oil-well pump in an ideal working state from the database 130 as a standard indicator diagram. After obtaining the indicator diagram to be diagnosed and the standard indicator diagram corresponding to the indicator diagram, the server 120 inputs the indicator diagram to be diagnosed and the standard indicator diagram into a fault diagnosis model operating by itself, and the fault diagnosis model performs corresponding analysis processing on the input indicator diagram to be diagnosed and the standard indicator diagram, thereby outputting a corresponding diagnosis result.
It should be noted that, the fault diagnosis model is obtained by the server 120 through training according to a large amount of sample data by using a machine learning algorithm in advance, and can compare the indicator diagram of the oil well pump in the actual working state with the indicator diagram of the oil well pump in the ideal working state, and further determine whether the oil well pump has a fault according to the comparison result of the indicator diagram and the indicator diagram.
It should be understood that the application scenario shown in fig. 1 is only an example, and in actual application, the terminal device 110 may also independently complete fault diagnosis for the oil well pump, that is, the terminal device 110 may support the operation of a fault diagnosis model, and input the indicator diagram to be diagnosed generated by itself and the standard indicator diagram pre-stored by itself into the fault diagnosis model to determine whether the oil well pump actually fails; the application scenario to which the oil well pump fault diagnosis method provided in the embodiment of the present application is applicable is not limited at all.
The oil well pump fault diagnosis method provided by the application is described through the following embodiments.
Referring to fig. 2, fig. 2 is a schematic flow chart of a fault diagnosis method for an oil well pump according to an embodiment of the present disclosure. For convenience of description, the following embodiments are described taking a server as an execution subject as an example. As shown in fig. 2, the fault diagnosis method for the oil well pump comprises the following steps:
step 201: aiming at the oil well pump to be diagnosed, acquiring the indicator diagram of the oil well pump in the actual working state as the indicator diagram to be diagnosed, and acquiring the indicator diagram of the oil well pump in the ideal working state as the standard indicator diagram.
In practical application, the server usually needs to monitor the fault of each running oil pump, so that the server can regard each oil pump in a running state as an oil pump to be diagnosed; of course, the server may also use a certain or some oil-well pumps that need to be monitored in a critical manner as the oil-well pump to be diagnosed according to actual needs, and the application does not limit the oil-well pump to be diagnosed.
When fault diagnosis is performed on an oil well pump to be diagnosed, a server needs to acquire a indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed, wherein the indicator diagram to be diagnosed is usually obtained by drawing a professional indicator diagram drawing instrument according to the working condition of the oil well pump in an actual production environment; in addition, the server also needs to obtain a indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram, the standard indicator diagram is usually generated by fitting a computer with reference to an actual production environment where the oil well pump is located, the indicator diagram of the oil well pump in an ideal normal working state in the actual production environment is the standard indicator diagram, each oil well pump corresponds to one standard indicator diagram, and the standard indicator diagrams corresponding to different oil well pumps are usually different.
During specific implementation, the indicator diagram drawing instrument can draw an indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed according to the actual working condition of the oil well pump to be diagnosed, and transmit the indicator diagram to be diagnosed and an identification of the oil well pump (namely, a unique identification of the oil well pump to be diagnosed) to the server; after the server receives the indicator diagram to be diagnosed and the oil well pump identification, the indicator diagram of the oil well pump in an ideal working state can be called from the database according to the oil well pump identification, namely, the standard indicator diagram corresponding to the oil well pump is called.
It should be understood that, in practical application, the server may also store the standard indicator diagram corresponding to each oil-well pump, and accordingly, the server may directly obtain the corresponding standard indicator diagram according to the received oil-well pump identifier; in addition, in practical application, the oil well pump and the indicator diagram drawing instrument may be in a one-to-one correspondence relationship, and the indicator diagram drawing instrument is dedicated to drawing the indicator diagram of the oil well pump corresponding to the indicator diagram drawing instrument. The method for acquiring the indicator diagram to be diagnosed and the standard indicator diagram by the server is not limited at all.
It should be noted that, when the execution main body of the embodiment of the present application is a terminal device with a function of drawing a indicator diagram, the terminal device may directly use the indicator diagram drawn by the terminal device for the oil-well pump to be diagnosed as the indicator diagram to be diagnosed, and send the identifier of the oil-well pump to the server, so as to obtain the standard indicator diagram corresponding to the oil-well pump from the server; of course, the terminal device may also store the standard indicator diagram corresponding to the oil pump in advance, so that the standard indicator diagram corresponding to the oil pump can be directly retrieved from the data stored in the terminal device. The present application also does not limit any way for the terminal device to obtain the indicator diagram to be diagnosed and the standard indicator diagram.
Optionally, in order to reduce the data amount to be processed by the fault diagnosis model, before the server performs fault diagnosis on the oil well pump to be diagnosed by using the fault diagnosis model, the server may perform preliminary fault diagnosis on the indicator diagram to be diagnosed by using the typical fault indicator diagram, so as to screen out the indicator diagram obviously belonging to the normal working state. Specifically, the server can calculate the similarity between the indicator diagram to be diagnosed and a typical fault indicator diagram, wherein the typical fault indicator diagram is an indicator diagram of the oil well pump in a typical fault state; and under the condition that the similarity exceeds a preset threshold value, the server further executes the subsequent steps.
It should be noted that, the server generally needs to calculate the similarity between the indicator diagram to be diagnosed and a plurality of typical fault indicator diagrams respectively, and different typical fault indicator diagrams generally correspond to different fault types; if the similarity between the indicator diagram to be diagnosed and a certain typical fault indicator diagram exceeds a preset threshold, it indicates that the oil well pump to be diagnosed may have a fault type corresponding to the typical fault indicator diagram, and in such a case, the subsequent steps need to be continuously executed to further determine whether the oil well pump to be diagnosed really has a fault; otherwise, if the similarity between the indicator diagram to be diagnosed and each typical fault indicator diagram does not exceed the preset threshold, the working state of the oil well pump to be diagnosed is normal, and in such a case, the subsequent steps do not need to be executed continuously.
It should be understood that the preset threshold may be set according to actual requirements, and the preset threshold is not specifically limited herein.
It should be understood that, when the execution subject of the embodiment of the present application is a terminal device, the terminal device may obtain each typical fault indicator diagram from the server, and execute the above-mentioned screening operation by using the indicator diagram to be diagnosed drawn by the terminal device itself and each obtained typical fault indicator diagram; of course, the terminal device may also store each typical fault indicator diagram in advance, and perform the above-mentioned screening operation by using the indicator diagram to be diagnosed drawn by itself and each typical fault indicator diagram stored by itself.
Step 202: processing the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; and the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram.
After the server acquires the indicator diagram to be diagnosed and the standard indicator diagram, the acquired indicator diagram to be diagnosed and the standard indicator diagram are input into a fault diagnosis model which operates per se, and the fault diagnosis model carries out comparative analysis on the input indicator diagram to be diagnosed and the standard indicator diagram, so that whether the characteristics presented by the indicator diagram to be diagnosed meet the actual production characteristics of the oil well pump to be diagnosed or not is determined, namely whether the oil well pump to be diagnosed has faults or not is determined.
It should be noted that the raw data used for drawing the indicator diagram generally includes a plurality of (e.g., 144) two-dimensional data points composed of displacement data and payload data, i.e., the indicator diagram is a closed curve drawn based on a plurality of two-dimensional data points composed of displacement data and payload data. Inputting the indicator diagram to be diagnosed and the standard indicator diagram into the fault diagnosis model, which is to actually input the original data of the indicator diagram to be diagnosed and the original data of the standard indicator diagram into the fault diagnosis model, for example, 144 two-dimensional data points composed of displacement data and load data for drawing the indicator diagram to be diagnosed and 144 two-dimensional data points composed of displacement data and load data for drawing the standard indicator diagram are input into the fault diagnosis model.
It should be noted that, the fault diagnosis model is usually obtained by a server using a large amount of sample data in advance and training by using a machine learning algorithm; the indicator diagram of the oil well pump under the actual working state can be intelligently compared with the indicator diagram of the oil well pump under the ideal working state, namely the indicator diagram to be diagnosed and the standard indicator diagram are compared, and then whether the oil well pump really has a fault or not is determined according to the comparison result of the indicator diagram and the standard indicator diagram. The method for training the fault diagnosis model will be described in detail below.
Optionally, in order to further improve the accuracy of fault diagnosis for the oil well pump, the server may increase data dimensions referred to in fault diagnosis, that is, secondary feature data corresponding to the indicator diagram to be diagnosed and the standard indicator diagram may be further increased as reference data for fault diagnosis on the basis that the original data corresponding to the indicator diagram to be diagnosed and the standard indicator diagram are used as reference data for fault diagnosis.
Specifically, after receiving the indicator diagram to be diagnosed and the standard indicator diagram, the server may determine secondary characteristic data corresponding to each of the indicator diagram to be diagnosed and the standard indicator diagram, where the secondary characteristic data specifically includes a maximum load, a minimum load, and an indicator diagram closed area; and further, the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the indicator diagram to be diagnosed are processed through the fault diagnosis model, and the standard indicator diagram and the secondary characteristic data corresponding to the indicator diagram to be diagnosed are processed to obtain a fault diagnosis result of the oil well pump to be diagnosed.
It should be understood that, in this case, the fault diagnosis model can compare the indicator diagram to be diagnosed with the standard indicator diagram, and can also compare the secondary characteristic data corresponding to the indicator diagram to be diagnosed with the secondary characteristic data corresponding to the standard indicator diagram, and further determine whether the oil well pump has a fault according to the comparison result of the indicator diagram and the comparison result of the secondary characteristic data. The method for training the fault diagnosis model will be described in detail below.
Because the indicator diagram is a two-dimensional closed curve taking displacement as an abscissa and load as an ordinate, the server can directly determine the maximum load and the minimum load according to the ordinate of the indicator diagram to be diagnosed, and calculate the closed area corresponding to the indicator diagram to be diagnosed by adopting a corresponding area calculation method such as an area accumulation method and the like, wherein the closed area can represent the work of the oil-well pump to be diagnosed in one reciprocating motion, and further the determined maximum load, minimum load and indicator diagram closed area are used as secondary characteristic data corresponding to the indicator diagram to be diagnosed; similarly, the server may determine, by using the above method, a maximum load, a minimum load, and a indicator diagram closed area corresponding to the standard indicator diagram, and use the maximum load, the minimum load, and the indicator diagram closed area as secondary characteristic data corresponding to the standard indicator diagram.
Furthermore, the server can input the indicator diagram to be diagnosed, the secondary characteristic data corresponding to the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram into the fault diagnosis model, the fault diagnosis model compares the indicator diagram to be diagnosed with the standard indicator diagram, compares the secondary characteristic data corresponding to the indicator diagram to be diagnosed with the secondary characteristic data corresponding to the standard indicator diagram, and finally determines whether the oil well pump has a fault according to the comparison result of the indicator diagram and the comparison result of the secondary characteristic data.
According to the oil well pump fault diagnosis method, the indicator diagram (namely the indicator diagram to be diagnosed) of the oil well pump in the actual working state is compared with the indicator diagram (namely the standard indicator diagram) of the oil well pump in the ideal working state by using the fault diagnosis model obtained through the training of the machine learning algorithm, so that whether the oil well pump has faults or not is determined. According to the method, the standard indicator diagram corresponding to the oil well pump to be diagnosed is referred in the fault diagnosis process, and is defined based on the actual production environment characteristics of the oil well pump to be diagnosed, so that the standard indicator diagram is used as a measurement standard for diagnosing whether the oil well pump has the fault, namely, the actual production environment of the oil well pump is referred in the process of judging whether the oil well pump has the fault, and therefore, the accuracy of fault diagnosis of the oil well pump can be effectively improved, and the fault false alarm condition is avoided.
The following describes the training method of the above fault diagnosis model by an embodiment.
Referring to fig. 3, fig. 3 is a schematic flowchart of a training method of a fault diagnosis model according to an embodiment of the present application. For convenience of description, the following embodiments are described taking a server as an execution subject as an example. As shown in fig. 3, the method for training the fault diagnosis model includes the following steps:
step 301: obtaining a plurality of historical indicator diagrams and standard indicator diagrams corresponding to the historical indicator diagrams; the historical indicator diagram comprises an indicator diagram with a fault diagnosis result, an indicator diagram with a false fault diagnosis result and an indicator diagram with a normal diagnosis result.
When the fault diagnosis model is trained, the server can obtain a large number of historical indicator diagrams from a database for storing the historical indicator diagrams, wherein the historical indicator diagrams specifically refer to indicator diagrams according to fault diagnosis of the oil well pump before the fault diagnosis model is trained; the historical indicator diagram obtained by the server may specifically include an indicator diagram with a failure diagnosis result, an indicator diagram with a false failure diagnosis result, and an indicator diagram with a normal diagnosis result.
It should be noted that the historical indicator diagram obtained by the server is usually associated with an oil pump identifier, so as to represent that the historical indicator diagram is generated based on the actual working condition of the oil pump corresponding to the oil pump identifier; after the server acquires the historical indicator diagram, the server can correspondingly find the standard indicator diagram corresponding to the historical indicator diagram from the database for storing the standard indicator diagram according to the oil pump identification associated with the historical indicator diagram.
Step 302: generating a sample data set according to the acquired historical indicator diagrams and the standard indicator diagrams corresponding to the historical indicator diagrams respectively; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram and a diagnosis result of the historical indicator diagram.
After acquiring a large number of historical indicator diagrams and standard indicator diagrams corresponding to the historical indicator diagrams, the server generates sample data according to the acquired historical indicator diagrams and the standard indicator diagrams corresponding to the historical indicator diagrams, and specifically, the server can combine the historical indicator diagrams, the standard indicator diagrams corresponding to the historical indicator diagrams and diagnosis results of the historical indicator diagrams to serve as the sample data; thus, according to the mode, a plurality of sample data are generated according to the acquired historical indicator diagrams and the standard indicator diagrams corresponding to the historical indicator diagrams respectively, and the generated sample data are used for forming a sample data set.
It should be understood that the sample data included in the sample data set is generally randomly distributed, that is, the sample data in the sample data set whose diagnosis result is a fault, the sample data whose diagnosis result is a false fault, and the sample data whose diagnosis result is a normal sample data are generally irregularly distributed.
It should be noted that, in practical application, the historical indicator diagram included in the sample data is actually the original data corresponding to the historical indicator diagram, that is, a plurality of two-dimensional data points composed of displacement data and load data, which are based on when the historical indicator diagram is drawn, are used as the historical indicator diagram in the sample data; similarly, the standard indicator diagram included in the sample data is actually the original data corresponding to the standard indicator diagram, that is, a plurality of two-dimensional data points composed of displacement data and load data, which are based on when the standard indicator diagram is drawn, are used as the standard indicator diagram in the sample data.
Optionally, in order to further improve the diagnosis accuracy of the fault diagnosis model, the server may increase the data type included in each sample data, that is, on the basis that the sample data includes the historical indicator diagram, the standard indicator diagram corresponding to the historical indicator diagram, and the diagnosis result of the historical indicator diagram, the secondary feature data corresponding to the historical indicator diagram and the secondary feature data corresponding to the standard indicator diagram are further added in the sample data.
Specifically, after the server obtains the historical indicator diagram and the standard indicator diagram corresponding to the historical indicator diagram, secondary characteristic data corresponding to the historical indicator diagram and the standard indicator diagram respectively can be determined, wherein the secondary characteristic data comprises a maximum load, a minimum load and an indicator diagram closed area; furthermore, the server can generate a sample data set according to the historical indicator diagram and the secondary characteristic data corresponding to the historical indicator diagram, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, secondary characteristic data corresponding to the historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram, secondary characteristic data corresponding to the standard indicator diagram and a diagnosis result of the historical indicator diagram.
Because the indicator diagram is a two-dimensional closed curve with displacement as an abscissa and load as an ordinate, the server can directly determine the maximum load and the minimum load according to the ordinate of the historical indicator diagram, and calculate the indicator diagram closed area corresponding to the historical indicator diagram by adopting a corresponding area calculation method such as an area accumulation method and the like, so that the maximum load, the minimum load and the indicator diagram closed area are used as secondary characteristic data corresponding to the historical indicator diagram; similarly, the server may determine the maximum load, the minimum load and the indicator diagram closed area for the standard indicator diagram corresponding to the historical indicator diagram by using the above method, and use the maximum load, the minimum load and the indicator diagram closed area as the secondary characteristic data corresponding to the standard indicator diagram. Finally, the historical indicator diagram, the secondary characteristic data corresponding to the historical indicator diagram, the standard indicator diagram corresponding to the historical indicator diagram, the secondary characteristic data corresponding to the standard indicator diagram and the diagnosis result of the historical indicator diagram are used as sample data.
Step 303: and performing iterative training on an initial fault diagnosis model by using the sample data set to obtain the fault diagnosis model through training.
After the server generates a sample data set comprising a large amount of sample data, iterative training can be performed on the pre-established initial fault diagnosis model by using the sample data in the sample data set so as to continuously adjust model parameters in the initial fault diagnosis model. Specifically, the server may input the historical indicator diagram in the sample data set and the standard indicator diagram corresponding thereto into the initial fault diagnosis model, the initial fault diagnosis model performs a corresponding comparison analysis on the historical indicator diagram and the standard indicator diagram, and then outputs a diagnosis result, a loss function is constructed according to an error between the diagnosis result output by the initial fault diagnosis model and the diagnosis result included in the sample data, and a model parameter in the initial fault diagnosis model is adjusted accordingly based on the loss function.
Optionally, in order to ensure that the fault diagnosis model with the optimal model performance can be finally obtained, the server may perform iterative training on a plurality of different initial fault diagnosis models, respectively, so as to select the fault diagnosis model from the models obtained by training the plurality of initial fault diagnosis models. Specifically, the initial fault diagnosis model may include a vector machine model, a decision tree model and a random forest model, and when the server performs iterative training on the initial fault diagnosis model by using the sample data set, the server needs to perform iterative training on the vector machine model, the decision tree model and the random forest model by using the sample data set, so as to obtain a first model corresponding to the vector machine model, a second model corresponding to the decision tree model and a third model corresponding to the random forest model; and selecting a fault diagnosis model from the first model, the second model and the third model according to the accuracy rates corresponding to the first model, the second model and the third model respectively and/or according to the accuracy rates corresponding to the first model, the second model and the third model respectively.
In specific implementation, the server may first divide the sample data set into a training sample data set and a test sample data set according to a preset ratio, for example, the server may use 80% of the sample data in the sample data set to form the sample data set, and use the remaining 20% of the sample data in the sample data set to form the test sample data set. Respectively carrying out iterative training on the vector machine model, the decision tree model and the random forest model by using the training sample data set to obtain a first model corresponding to the vector machine model, a second model corresponding to the decision tree model and a third model corresponding to the random forest model; and then, respectively determining the accuracy and/or recall ratio corresponding to the first model, the second model and the third model by utilizing the test sample data set.
When the server determines that the accuracy rates of the first model, the second model and the third model respectively correspond to the test sample data set, the server may select a model with the highest corresponding accuracy rate from the first model, the second model and the third model as a fault diagnosis model; when the server determines that the first model, the second model and the third model respectively correspond to the recall rates by using the test sample data set, the server may select a model with the highest recall rate from the first model, the second model and the third model as a fault diagnosis model; when the server determines that the accuracy rate and the recall rate respectively corresponding to the first model, the second model and the third model are respectively determined by using the test sample data, the server can comprehensively consider the accuracy rate and the recall rate respectively corresponding to the first model, the second model and the third model, and the model with higher accuracy rate and recall rate is selected as the fault diagnosis model.
It should be understood that, in practical applications, in addition to the vector machine model, the decision tree model and the random forest model, the server may also select other model structures as the initial fault diagnosis model, and the application does not make any limitation on the model structure of the initial fault diagnosis model.
Optionally, in order to ensure that a fault diagnosis model with optimal model performance can be finally obtained, the server may divide the sample data set multiple times, train the initial fault diagnosis model multiple times by using the training sample data set and the test sample data set obtained through the multiple divisions, and finally select the fault diagnosis model from each model obtained through the multiple training.
Specifically, the server may cyclically execute the following step N (N is an integer greater than 1) times: dividing the sample data set into a training sample data set and a test sample data set according to a preset proportion, training the initial fault diagnosis model by using the training data set, and determining the accuracy and/or the recall rate corresponding to the model obtained by training the initial fault diagnosis model by using the test sample data set. After completing the N cycles, the server may select a fault diagnosis model from the models obtained by training the initial fault diagnosis models each time according to the accuracy and/or recall rate corresponding to each model obtained by training the initial fault diagnosis models each time.
For the convenience of understanding the above embodiment, the following describes the above cyclic training process by taking N equal to 5, and the initial fault diagnosis model includes a vector machine model, a decision tree model and a random forest model as examples:
dividing a sample data set into a training sample data set and a test sample data set according to a ratio of 4:1, respectively training a vector machine model, a decision tree model and a random forest model by using the training sample data set, and respectively determining respective corresponding accuracy rates and/or recall rates of the model obtained by training the vector machine model, the model obtained by training the decision tree model and the model obtained by training the random forest model by using the test sample data set as the accuracy rates and/or the recall rates of the first round of training of the vector machine model, the decision tree model and the random forest model. And then, respectively carrying out 4 rounds of training on the vector machine model, the decision tree model and the random forest model according to the embodiment to obtain the accuracy and/or recall rate of second to fifth rounds of training of the vector machine model, the decision tree model and the random forest model.
And the server compares the accuracy and/or recall ratio of the vector machine model, the decision tree model and the random forest model from the first training round to the fifth training round, so that a model with the optimal model performance is selected as a fault diagnosis model from 15 models obtained by the 5 training rounds according to the comparison result.
It should be understood that the preset ratio and the N value may be set according to actual requirements, and the preset ratio and the N value are not specifically limited herein.
The training method of the fault diagnosis model adopts a machine learning algorithm, and trains the initial fault diagnosis model by using a large amount of sample data comprising the historical indicator diagram, the standard indicator diagram corresponding to the historical indicator diagram and the diagnosis result corresponding to the historical indicator diagram until the fault diagnosis model which can be put into practical application is obtained. The fault diagnosis model obtained by training by the method can refer to a standard indicator diagram corresponding to the oil well pump in the process of diagnosing the fault, and the standard indicator diagram is defined based on the characteristics of the actual production environment of the oil well pump, so that the standard indicator diagram is used as a measurement standard for diagnosing whether the oil well pump has the fault, namely, the standard indicator diagram is equivalent to referring to the actual production environment of the oil well pump in the process of judging whether the oil well pump has the fault, thus the accuracy of the fault diagnosis model on the fault diagnosis of the oil well pump can be ensured, and the fault false alarm condition is avoided.
Aiming at the oil well pump fault diagnosis method described above, the application also provides a corresponding oil well pump fault diagnosis device, so that the method can be applied and realized in practice.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a pump failure diagnosis apparatus 400 corresponding to the method shown in fig. 2, where the pump failure diagnosis apparatus 400 includes:
the acquisition module 401 is configured to acquire, for an oil well pump to be diagnosed, an indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed, and an indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram;
the diagnosis module 402 is configured to process the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; and the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram.
Optionally, the apparatus further comprises:
the secondary characteristic data determining module is used for determining secondary characteristic data corresponding to the indicator diagram to be diagnosed and the standard indicator diagram; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
the diagnostic module 402 is specifically configured to:
processing the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the indicator diagram to be diagnosed, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram by the fault diagnosis model to obtain a diagnosis result; the fault diagnosis model is specifically used for determining whether the oil well pump is in fault according to a comparison result of the indicator diagram to be diagnosed and the standard indicator diagram and a comparison result of secondary characteristic data corresponding to the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the standard indicator diagram.
Optionally, the apparatus further comprises:
the similarity calculation module is used for calculating the similarity between the indicator diagram to be diagnosed and the typical fault indicator diagram; the typical fault indicator diagram is an indicator diagram of the oil well pump in a typical fault state; and triggering the diagnosis module 402 to work when the similarity exceeds a preset threshold.
Optionally, the apparatus further comprises:
the historical data acquisition module is used for acquiring a plurality of historical indicator diagrams and standard indicator diagrams corresponding to the historical indicator diagrams; the historical indicator diagram comprises an indicator diagram with a fault diagnosis result, an indicator diagram with a fault false alarm diagnosis result and an indicator diagram with a normal diagnosis result;
the sample generating module is used for generating a sample data set according to the acquired historical indicator diagrams and the standard indicator diagrams corresponding to the historical indicator diagrams respectively; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram and a diagnosis result of the historical indicator diagram;
and the training module is used for performing iterative training on the initial fault diagnosis model by using the sample data set so as to obtain the fault diagnosis model through training.
Optionally, the sample generation module is specifically configured to:
determining secondary characteristic data corresponding to the historical indicator diagram and the standard indicator diagram respectively; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
generating the sample data set according to the historical indicator diagram and the secondary characteristic data corresponding to the historical indicator diagram, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, secondary characteristic data corresponding to the historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram, secondary characteristic data corresponding to the standard indicator diagram and a diagnosis result of the historical indicator diagram.
Optionally, the initial fault diagnosis model includes a vector machine model, a decision tree model and a random forest model; the training module is specifically configured to:
respectively carrying out iterative training on the vector machine model, the decision tree model and the random forest model by using the sample data set to obtain a first model corresponding to the vector machine model, a second model corresponding to the decision tree model and a third model corresponding to the random forest model;
and selecting the fault diagnosis model from the first model, the second model and the third model according to the accuracy rate corresponding to the first model, the second model and the third model respectively and/or according to the recall rate corresponding to the first model, the second model and the third model respectively.
Optionally, the training module is specifically configured to:
circularly executing the following steps N times, wherein N is an integer greater than 1:
dividing the sample data set into a training sample data set and a test sample data set according to a preset proportion;
training the initial fault diagnosis model by using the training sample data set;
determining the accuracy rate and/or the recall rate corresponding to the model obtained by training the initial fault diagnosis model by using the test sample data set;
after completing the N cycles, determining the fault diagnosis model by:
and selecting the fault diagnosis model from the models obtained by training the initial fault diagnosis model each time according to the accuracy and/or recall rate corresponding to the models obtained by training the initial fault diagnosis model each time.
The oil well pump fault diagnosis device compares the indicator diagram (namely the indicator diagram to be diagnosed) of the oil well pump in the actual working state with the indicator diagram (namely the standard indicator diagram) of the oil well pump in the ideal working state by using the fault diagnosis model obtained by the training of the machine learning algorithm, thereby determining whether the oil well pump has faults or not. Because the device consults the standard indicator diagram corresponding to the oil-well pump to be diagnosed in the process of diagnosing the fault, and the standard indicator diagram is defined based on the characteristics of the actual production environment of the oil-well pump to be diagnosed, the standard indicator diagram is used as the measurement standard for diagnosing whether the oil-well pump has the fault, namely, the standard indicator diagram is equivalent to the actual production environment of the oil-well pump in the process of judging whether the oil-well pump has the fault, so that the accuracy of fault diagnosis of the oil-well pump can be effectively improved, and the fault false alarm condition is avoided.
The oil well pump fault diagnosis device comprises a processor and a memory, wherein the acquisition module, the diagnosis module and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set with one or more than one, and the fault diagnosis accuracy of the oil well pump is improved and the fault false alarm condition is avoided through the fault diagnosis model obtained through the training of the machine learning algorithm.
The embodiment of the invention provides a storage medium, wherein a program is stored on the storage medium, and the program realizes the oil well pump fault diagnosis method when being executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the fault diagnosis method of an oil well pump is executed when the program runs.
An embodiment of the present invention provides an apparatus, and referring to fig. 5, an apparatus 500 includes at least one processor 501, and at least one memory 502 and a bus 503 connected to the processor; the processor 501 and the memory 502 complete communication with each other through the bus 503; the processor 501 is used to call program instructions in the memory 502 to execute the above-described information search method. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
aiming at an oil well pump to be diagnosed, acquiring a indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed, and acquiring the indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram;
processing the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; and the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram.
Optionally, the method further includes:
determining secondary characteristic data corresponding to the indicator diagram to be diagnosed and the standard indicator diagram respectively; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
then, the processing the indicator diagram to be diagnosed and the standard indicator diagram through the fault diagnosis model to obtain a diagnosis result of the oil well pump includes:
processing the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the indicator diagram to be diagnosed, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram by the fault diagnosis model to obtain a diagnosis result; the fault diagnosis model is specifically used for determining whether the oil well pump is in fault according to a comparison result of the indicator diagram to be diagnosed and the standard indicator diagram and a comparison result of secondary characteristic data corresponding to the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the standard indicator diagram.
Optionally, the method further includes:
calculating the similarity between the indicator diagram to be diagnosed and the typical fault indicator diagram; the typical fault indicator diagram is an indicator diagram of the oil well pump in a typical fault state;
and under the condition that the similarity exceeds a preset threshold, executing the fault diagnosis model to process the indicator diagram to be diagnosed and the standard indicator diagram to obtain a diagnosis result of the oil well pump.
Optionally, the fault diagnosis model is trained by:
obtaining a plurality of historical indicator diagrams and standard indicator diagrams corresponding to the historical indicator diagrams; the historical indicator diagram comprises an indicator diagram with a fault diagnosis result, an indicator diagram with a fault false alarm diagnosis result and an indicator diagram with a normal diagnosis result;
generating a sample data set according to the acquired historical indicator diagrams and the standard indicator diagrams corresponding to the historical indicator diagrams respectively; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram and a diagnosis result of the historical indicator diagram;
and performing iterative training on an initial fault diagnosis model by using the sample data set to obtain the fault diagnosis model through training.
Optionally, the generating a sample data set according to the obtained historical indicator diagrams and their respective corresponding standard indicator diagrams includes:
determining secondary characteristic data corresponding to the historical indicator diagram and the standard indicator diagram respectively; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
generating the sample data set according to the historical indicator diagram and the secondary characteristic data corresponding to the historical indicator diagram, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, secondary characteristic data corresponding to the historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram, secondary characteristic data corresponding to the standard indicator diagram and a diagnosis result of the historical indicator diagram.
Optionally, the initial fault diagnosis model includes a vector machine model, a decision tree model and a random forest model; performing iterative training on an initial fault diagnosis model by using the sample data set to obtain the fault diagnosis model through training, including:
respectively carrying out iterative training on the vector machine model, the decision tree model and the random forest model by using the sample data set to obtain a first model corresponding to the vector machine model, a second model corresponding to the decision tree model and a third model corresponding to the random forest model;
and selecting the fault diagnosis model from the first model, the second model and the third model according to the accuracy rate corresponding to the first model, the second model and the third model respectively and/or according to the recall rate corresponding to the first model, the second model and the third model respectively.
Optionally, the performing iterative training on the initial fault diagnosis model by using the sample data set includes:
circularly executing the following steps N times, wherein N is an integer greater than 1:
dividing the sample data set into a training sample data set and a test sample data set according to a preset proportion;
training the initial fault diagnosis model by using the training sample data set;
determining the accuracy rate and/or the recall rate corresponding to the model obtained by training the initial fault diagnosis model by using the test sample data set;
after completing the N cycles, determining the fault diagnosis model by:
and selecting the fault diagnosis model from the models obtained by training the initial fault diagnosis model each time according to the accuracy and/or recall rate corresponding to the models obtained by training the initial fault diagnosis model each time.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A fault diagnosis method for an oil well pump is characterized by comprising the following steps:
aiming at an oil well pump to be diagnosed, acquiring a indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed, and acquiring the indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram;
processing the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; and the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram.
2. The method of claim 1, further comprising:
determining secondary characteristic data corresponding to the indicator diagram to be diagnosed and the standard indicator diagram respectively; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
then, the processing the indicator diagram to be diagnosed and the standard indicator diagram through the fault diagnosis model to obtain a diagnosis result of the oil well pump includes:
processing the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the indicator diagram to be diagnosed, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram by the fault diagnosis model to obtain a diagnosis result; the fault diagnosis model is specifically used for determining whether the oil well pump is in fault according to a comparison result of the indicator diagram to be diagnosed and the standard indicator diagram and a comparison result of secondary characteristic data corresponding to the indicator diagram to be diagnosed and the secondary characteristic data corresponding to the standard indicator diagram.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
calculating the similarity between the indicator diagram to be diagnosed and the typical fault indicator diagram; the typical fault indicator diagram is an indicator diagram of the oil well pump in a typical fault state;
and under the condition that the similarity exceeds a preset threshold, executing the fault diagnosis model to process the indicator diagram to be diagnosed and the standard indicator diagram to obtain a diagnosis result of the oil well pump.
4. The method of claim 1, wherein the fault diagnosis model is trained by:
obtaining a plurality of historical indicator diagrams and standard indicator diagrams corresponding to the historical indicator diagrams; the historical indicator diagram comprises an indicator diagram with a fault diagnosis result, an indicator diagram with a fault false alarm diagnosis result and an indicator diagram with a normal diagnosis result;
generating a sample data set according to the acquired historical indicator diagrams and the standard indicator diagrams corresponding to the historical indicator diagrams respectively; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram and a diagnosis result of the historical indicator diagram;
and performing iterative training on an initial fault diagnosis model by using the sample data set to obtain the fault diagnosis model through training.
5. The method of claim 4, wherein generating a sample data set according to the obtained historical indicator diagrams and their respective corresponding standard indicator diagrams comprises:
determining secondary characteristic data corresponding to the historical indicator diagram and the standard indicator diagram respectively; the secondary characteristic data comprise maximum load, minimum load and indicator diagram closed area;
generating the sample data set according to the historical indicator diagram and the secondary characteristic data corresponding to the historical indicator diagram, the standard indicator diagram and the secondary characteristic data corresponding to the standard indicator diagram; the sample data set comprises a plurality of sample data, and each sample data comprises a historical indicator diagram, secondary characteristic data corresponding to the historical indicator diagram, a standard indicator diagram corresponding to the historical indicator diagram, secondary characteristic data corresponding to the standard indicator diagram and a diagnosis result of the historical indicator diagram.
6. The method of claim 4, wherein the initial fault diagnosis model comprises a vector machine model, a decision tree model, and a random forest model; performing iterative training on an initial fault diagnosis model by using the sample data set to obtain the fault diagnosis model through training, including:
respectively carrying out iterative training on the vector machine model, the decision tree model and the random forest model by using the sample data set to obtain a first model corresponding to the vector machine model, a second model corresponding to the decision tree model and a third model corresponding to the random forest model;
and selecting the fault diagnosis model from the first model, the second model and the third model according to the accuracy rate corresponding to the first model, the second model and the third model respectively and/or according to the recall rate corresponding to the first model, the second model and the third model respectively.
7. The method according to any one of claims 4 to 6, wherein said iteratively training an initial fault diagnosis model using said sample data set comprises:
circularly executing the following steps N times, wherein N is an integer greater than 1:
dividing the sample data set into a training sample data set and a test sample data set according to a preset proportion;
training the initial fault diagnosis model by using the training sample data set;
determining the accuracy rate and/or the recall rate corresponding to the model obtained by training the initial fault diagnosis model by using the test sample data set;
after completing the N cycles, determining the fault diagnosis model by:
and selecting the fault diagnosis model from the models obtained by training the initial fault diagnosis model each time according to the accuracy and/or recall rate corresponding to the models obtained by training the initial fault diagnosis model each time.
8. An oil-well pump fault diagnosis device, characterized in that, the device includes:
the acquisition module is used for acquiring an indicator diagram of the oil well pump in an actual working state as an indicator diagram to be diagnosed and acquiring the indicator diagram of the oil well pump in an ideal working state as a standard indicator diagram;
the diagnosis module is used for processing the indicator diagram to be diagnosed and the standard indicator diagram through a fault diagnosis model to obtain a diagnosis result of the oil well pump; and the fault diagnosis model is used for determining whether the oil well pump is in fault according to the comparison result of the indicator diagram to be diagnosed and the standard indicator diagram.
9. An electronic device, comprising at least one processor, and at least one memory, bus connected to the processor;
the processor and the memory complete mutual communication through the bus;
the processor is used for calling the program instructions in the memory so as to execute the oil well pump fault diagnosis method of any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program for executing the method of diagnosing a fault in an oil well pump according to any one of claims 1 to 7.
CN201910889226.4A 2019-09-19 2019-09-19 Oil well pump fault diagnosis method, device, equipment and storage medium Pending CN112526959A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910889226.4A CN112526959A (en) 2019-09-19 2019-09-19 Oil well pump fault diagnosis method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910889226.4A CN112526959A (en) 2019-09-19 2019-09-19 Oil well pump fault diagnosis method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112526959A true CN112526959A (en) 2021-03-19

Family

ID=74974408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910889226.4A Pending CN112526959A (en) 2019-09-19 2019-09-19 Oil well pump fault diagnosis method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112526959A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114252716A (en) * 2021-12-06 2022-03-29 深圳供电局有限公司 Power grid fault diagnosis method and device and storage medium
CN117173434A (en) * 2023-09-05 2023-12-05 大庆石油管理局有限公司 Comprehensive working condition data processing method and system based on tower electromechanical parameter indicator diagram

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090037772A1 (en) * 2007-08-03 2009-02-05 Wegerich Stephan W Fuzzy classification approach to fault pattern matching
CN104564020A (en) * 2014-04-21 2015-04-29 山东天工石油装备有限公司 Oil well indicator diagram data analysis method
CN107292870A (en) * 2017-06-07 2017-10-24 复旦大学 Track plug pin fault detection method and system based on image alignment with detection network model
CN109460561A (en) * 2018-07-25 2019-03-12 北京国双科技有限公司 Oil production equipment method for diagnosing faults and device
CN109508738A (en) * 2018-10-31 2019-03-22 北京国双科技有限公司 A kind of information processing method and relevant device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090037772A1 (en) * 2007-08-03 2009-02-05 Wegerich Stephan W Fuzzy classification approach to fault pattern matching
CN104564020A (en) * 2014-04-21 2015-04-29 山东天工石油装备有限公司 Oil well indicator diagram data analysis method
CN107292870A (en) * 2017-06-07 2017-10-24 复旦大学 Track plug pin fault detection method and system based on image alignment with detection network model
CN109460561A (en) * 2018-07-25 2019-03-12 北京国双科技有限公司 Oil production equipment method for diagnosing faults and device
CN109508738A (en) * 2018-10-31 2019-03-22 北京国双科技有限公司 A kind of information processing method and relevant device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
檀朝东等: "基于最小二乘法的抽油机井示功图自动分类及故障诊断", 《数据采集与处理》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114252716A (en) * 2021-12-06 2022-03-29 深圳供电局有限公司 Power grid fault diagnosis method and device and storage medium
CN117173434A (en) * 2023-09-05 2023-12-05 大庆石油管理局有限公司 Comprehensive working condition data processing method and system based on tower electromechanical parameter indicator diagram

Similar Documents

Publication Publication Date Title
RU2708303C2 (en) System and method of controlling development of deposit using electric submersible pumps as virtual sensors
CN109460561B (en) Fault diagnosis method and device for oil extraction equipment
US10558207B1 (en) Event monitoring system
CN113048043B (en) Plunger pump parameter threshold setting method and device, electronic equipment and storage medium
US20180314953A1 (en) Cluster model to predict build failure
CN115699037A (en) Predicting performance degradation using non-linear characteristics
US20220179406A1 (en) Method and system for anomaly detection and diagnosis in industrial processes and equipment
CN109508473B (en) Pumping well fault determination method based on case diagram, pumping well fault case diagram establishment method and related device
CN112526959A (en) Oil well pump fault diagnosis method, device, equipment and storage medium
EP3364261B1 (en) Generation of partial plant topology data from plant operations data
CN113502870A (en) Excavator working condition judging method and device
CN105681128A (en) Method and device for monitoring big data system state
CN111199090B (en) Fault identification method and related equipment
CN112577664A (en) Sensor fault detection method and device and related product
CN115115190A (en) Quality monitoring method based on working condition, related device and program medium product
CN114912372B (en) High-precision filling pipeline fault early warning method based on artificial intelligence algorithm
US20230111036A1 (en) Integrated drilling dysfunction prediction
Ragab et al. Remaining useful life prognostics using pattern-based machine learning
US20240054341A1 (en) Training models for target computing devices
CN116416764A (en) Alarm threshold generation method and device, electronic equipment and storage medium
CN111197480B (en) Information processing method and related equipment
CN110991779A (en) Anomaly detection method and device for oil pumping well
CN115422555B (en) Back door program detection method and device, electronic equipment and storage medium
CN114999021A (en) Method, processor, device and storage medium for determining cause of oil temperature abnormality
CN110952973A (en) Oil and gas exploitation monitoring method, service life determination model obtaining method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210319