Fault classification method, device and equipment for oil pumping unit and storage medium

The improved auxiliary classification generative adversarial network is used to amplify the pumping unit fault data, which solves the problem of imbalanced fault data, improves the recognition accuracy of the fault classification network, and achieves accurate classification of pumping unit faults.

CN118779779APending Publication Date: 2024-10-15PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310378019.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing pumping unit fault diagnosis methods are inefficient and have low classification accuracy. Especially under actual working conditions, fault data are unbalanced, resulting in the classification network being unable to accurately classify.

Method used

An improved auxiliary classification generative adversarial network is used to amplify the pumping unit fault data and generate data similar to the original sample feature distribution. By combining the generative adversarial network and the fault classification network, a hybrid data set is constructed for iterative training to improve fault classification. Recognition accuracy of the network.

Benefits of technology

By balancing the data of different fault categories after data amplification, the fault classification network's ability to accurately classify pumping unit faults is improved, and the classification accuracy is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779779A_ABST
    Figure CN118779779A_ABST
Patent Text Reader

Abstract

The invention discloses a fault classification method, device and equipment of an oil pumping unit and a storage medium, and belongs to the field of oil field automation. According to the method, the oil pumping unit serves as a research object, fault data of the oil pumping unit is expanded based on a generative adversarial network, and meanwhile the operation state of the oil pumping unit is judged through a fault classification network so as to diagnose the fault of the oil pumping unit. In detail, data similar to original sample feature distribution can be generated based on the generative adversarial network, which is an effective strategy for solving the problem of insufficient fault data of the oil pumping unit. Namely, the fault data of the oil pumping unit is amplified by using the generative adversarial network, so that the problem of insufficient fault data of the oil pumping unit is solved, and the recognition precision of the fault classification network on the fault of the oil pumping unit is improved. Namely, after the fault data of the oil pumping unit are amplified, the fault data of the oil pumping unit of different fault categories can be balanced, and the trained fault classification network can accurately classify the faults of the oil pumping unit by performing model training based on the fault data of the oil pumping unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of oilfield automation, and in particular to a method, device, equipment and storage medium for fault classification of an oil pump. Background Art

[0002] The oil pump plays a very important role in the oil production system and is widely used in the process of oil field development. Usually, the working environment of the oil pump is relatively harsh and the operation cycle is long, so it is easy to fail. If the oil pump fails, it will not only affect the output and economic benefits of the oil field, but also may cause safety accidents in serious cases. Therefore, studying advanced oil pump fault diagnosis methods and real-time monitoring of the operating status of the oil pump are important means to ensure the safe and reliable operation of the oil pump, which has very important engineering application value and theoretical research significance.

[0003] At present, the mainstream method of pumping unit fault diagnosis is that engineers and technicians use their experience and knowledge to identify the pumping unit's indicator diagram and classify the pumping unit fault. However, this method is not only labor-intensive but also inefficient, and cannot meet the large-scale production needs of modern oil fields.

[0004] Considering the above problems, great progress has been made in fault diagnosis of oil pumping units based on artificial intelligence technology in recent years. However, the current research on artificial intelligence algorithms in the field of oil pumping unit fault diagnosis is mainly based on artificially divided balanced data sets. However, under actual working conditions, the oil pumping unit fault data is not balanced, which will lead to the failure of the trained fault classification network to accurately classify the oil pumping unit fault, that is, the classification accuracy is low. Summary of the invention

[0005] The present application provides a method, device, equipment and storage medium for fault classification of an oil pump. The technical solution is as follows:

[0006] On the one hand, a method for fault classification of an oil pumping unit is provided, the method comprising:

[0007] Acquire an original data set; wherein the original data set includes real indicator diagram samples of the oil pumping unit and a fault category label of each real indicator diagram sample;

[0008] Constructing a generative adversarial network; wherein the generative adversarial network includes a generator and a discriminator;

[0009] Iteratively training the generative adversarial network by inputting random noise, the real dynamometer diagram sample and the specified fault category into the generator, and inputting the real dynamometer diagram sample, the false dynamometer diagram sample generated by the generator and the corresponding fault category label into the discriminator;

[0010] When the generative adversarial network reaches a Nash equilibrium, the iterative training is stopped; based on the trained generative adversarial network, the dynamometer diagram samples are augmented to obtain a mixed data set; wherein the mixed data set includes the real dynamometer diagram samples and the dynamometer diagram samples generated by the augmentation process;

[0011] Based on the mixed data set, iteratively train the fault classification network until a training termination condition is met;

[0012] The dynamometer diagram to be classified of the oil pump is obtained; the dynamometer diagram to be classified is input into a trained fault classification network to obtain a fault category matching the dynamometer diagram to be classified.

[0013] In a possible implementation, the random noise, the real dynamometer sample and the specified fault category are input into the generator, the real dynamometer sample, the false dynamometer sample generated by the generator and the corresponding fault category label are input into the discriminator, and the generative adversarial network is iteratively trained, including:

[0014] Inputting the random noise, the real dynamometer sample and the specified fault category into the generator; generating a false dynamometer sample with the specified fault category through the convolution layer and the attention layer of the generator, and updating the network parameters of the generator by using the forward propagation algorithm and the back propagation algorithm until the number of iterations reaches a first preset number, thereby obtaining a trained generator;

[0015] Input the true dynamometer sample, the false dynamometer sample and the corresponding fault category label into the discriminator; perform true and false discrimination on the input dynamometer sample through the convolution layer and the attention layer of the discriminator, and use the forward propagation algorithm and the back propagation algorithm to update the network parameters of the discriminator until the number of iterations reaches a second preset number, thereby obtaining a trained discriminator;

[0016] In the process of updating network parameters, the discriminator uses a focused loss function to calculate the loss value.

[0017] In a possible implementation, the amplification process of the dynamometer diagram sample based on the trained generative adversarial network includes:

[0018] Based on the trained generative adversarial network, the dynamometer diagram samples under the specified fault category are amplified to obtain dynamometer diagram sample data of different categories generated by the amplification process.

[0019] In a possible implementation, the method further includes:

[0020] Obtain the number of dynamometer diagram samples under each fault category in the original data set; sort the number of dynamometer diagram samples under each fault category in order from small to large; take the N fault categories with the first N dynamometer diagram sample numbers as the designated fault categories; N is a positive integer;

[0021] Or, the number of dynamometer diagram samples under each fault category in the original data set is obtained; and the fault category for which the number of dynamometer diagram samples is less than a quantity threshold is used as the designated fault category.

[0022] In a possible implementation, the iterative training of the fault classification network based on the mixed data set until a training termination condition is met includes:

[0023] Inputting the dynamometer diagram samples and corresponding fault classification labels included in the mixed data set into the fault classification network according to a preset batch size;

[0024] Through the convolution layer, attention layer, activation function layer and full connection layer of the fault classification network, feature extraction and fault classification are performed on the input dynamometer diagram sample, and the learning rate is optimized by cosine annealing and the network parameters of the fault classification network are optimized by Ranger optimizer until the training termination condition is met, thereby obtaining a trained fault classification network;

[0025] Wherein, the activation function layer uses the Mish activation function;

[0026] The training termination condition is that the number of iterations reaches a third preset number or the focus loss function used by the fault classification network reaches model convergence.

[0027] In a possible implementation, obtaining the original data set includes:

[0028] Acquire the indicator diagram data of the oil pumping unit under different fault conditions, and obtain the indicator diagram data corresponding to different fault categories;

[0029] Preprocess the indicator diagram data under different fault categories;

[0030] According to the set multiple fault categories, label information for marking the fault categories of the preprocessed indicator diagram data is obtained to obtain the original data set.

[0031] In a possible implementation, the method further includes:

[0032] Based on the Shuffle Net network, construct the fault classification network;

[0033] Acquire a test data set; wherein the number of dynamometer diagram samples included in the test data set is less than the number of dynamometer diagram samples included in the original data set;

[0034] Based on the trained fault classification network, fault classification is performed on the dynamometer diagram samples included in the test data set;

[0035] A test report is generated based on the fault category output by the fault classification network and the fault category label of each dynamometer diagram sample in the test data set.

[0036] On the other hand, a fault classification device for an oil pump is provided, the device comprising:

[0037] The first acquisition module is configured to acquire an original data set; wherein the original data set includes real dynamometer diagram samples of the oil pumping unit and a fault category label of each real dynamometer diagram sample;

[0038] A construction module is configured to construct a generative adversarial network; wherein the generative adversarial network includes a generator and a discriminator;

[0039] A first training module is configured to iteratively train the generative adversarial network by inputting random noise, the real dynamometer diagram sample and a specified fault category into the generator, and inputting the real dynamometer diagram sample, the fake dynamometer diagram sample generated by the generator and the corresponding fault category label into the discriminator;

[0040] A generation module is configured to stop iterative training when the generative adversarial network reaches a Nash equilibrium; perform an amplification process on the dynamometer diagram samples based on the trained generative adversarial network to obtain a mixed data set; wherein the mixed data set includes the real dynamometer diagram samples and the dynamometer diagram samples generated by the amplification process;

[0041] A second training module is configured to iteratively train the fault classification network based on the mixed data set until a training termination condition is met;

[0042] The classification module is configured to obtain the to-be-classified indicator diagram of the oil pumping unit; input the to-be-classified indicator diagram into a trained fault classification network to obtain a fault category matching the to-be-classified indicator diagram.

[0043] In a possible implementation, the first training module is configured as follows:

[0044] Inputting the random noise, the real dynamometer sample and the specified fault category into the generator; generating a false dynamometer sample with the specified fault category through the convolution layer and the attention layer of the generator, and updating the network parameters of the generator by using the forward propagation algorithm and the back propagation algorithm until the number of iterations reaches a first preset number, thereby obtaining a trained generator;

[0045] Input the true dynamometer sample, the false dynamometer sample and the corresponding fault category label into the discriminator; perform true and false discrimination on the input dynamometer sample through the convolution layer and the attention layer of the discriminator, and use the forward propagation algorithm and the back propagation algorithm to update the network parameters of the discriminator until the number of iterations reaches a second preset number, thereby obtaining a trained discriminator;

[0046] In the process of updating network parameters, the discriminator uses a focused loss function to calculate the loss value.

[0047] In a possible implementation, the generating module is configured to:

[0048] Based on the trained generative adversarial network, the dynamometer diagram samples under the specified fault category are amplified to obtain dynamometer diagram sample data of different categories generated by the amplification process.

[0049] In a possible implementation manner, the apparatus further includes: a second acquisition module; wherein the second acquisition module is configured to:

[0050] Obtain the number of dynamometer diagram samples under each fault category in the original data set; sort the number of dynamometer diagram samples under each fault category in order from small to large; take the N fault categories with the first N dynamometer diagram sample numbers as the designated fault categories; N is a positive integer;

[0051] Or, the number of dynamometer diagram samples under each fault category in the original data set is obtained; and the fault category for which the number of dynamometer diagram samples is less than a quantity threshold is used as the designated fault category.

[0052] In a possible implementation, the second training module is configured as follows:

[0053] Inputting the dynamometer diagram samples and corresponding fault classification labels included in the mixed data set into the fault classification network according to a preset batch size;

[0054] Through the convolution layer, attention layer, activation function layer and full connection layer of the fault classification network, feature extraction and fault classification are performed on the input dynamometer diagram sample, and the learning rate is optimized by cosine annealing and the network parameters of the fault classification network are optimized by Ranger optimizer until the training termination condition is met, thereby obtaining a trained fault classification network;

[0055] Wherein, the activation function layer uses the Mish activation function;

[0056] The training termination condition is that the number of iterations reaches a third preset number or the focus loss function used by the fault classification network reaches model convergence.

[0057] In a possible implementation, the first acquisition module is configured to:

[0058] Acquire the indicator diagram data of the oil pumping unit under different fault conditions, and obtain the indicator diagram data corresponding to different fault categories;

[0059] Preprocess the dynamometer data under different fault categories;

[0060] According to the set multiple fault categories, label information for marking the fault categories of the preprocessed indicator diagram data is obtained to obtain the original data set.

[0061] In a possible implementation, the device further includes: a testing module;

[0062] The construction module is configured to construct the fault classification network based on the Shuffle Net network;

[0063] The test module is configured to obtain a test data set; wherein the number of dynamometer diagram samples included in the test data set is less than the number of dynamometer diagram samples included in the original data set; based on a trained fault classification network, fault classification is performed on the dynamometer diagram samples included in the test data set; and a test report is generated based on the fault category output by the fault classification network and the fault category labels of each dynamometer diagram sample in the test data set.

[0064] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the above-mentioned method for classifying faults of oil pumping units.

[0065] On the other hand, a computer-readable storage medium is provided, wherein at least one program code is stored in the storage medium, and the at least one program code is loaded and executed by a processor to implement the above-mentioned method for classifying faults of an oil pumping unit.

[0066] On the other hand, a computer program product or a computer program is provided, which includes a computer program code, which is stored in a computer-readable storage medium, and a processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the above-mentioned method for classifying faults of oil pumps.

[0067] The embodiment of the present application proposes a method for classifying oil pump faults based on an improved auxiliary classification generative adversarial network. The method takes the oil pump as the research object, expands the oil pump fault data based on the improved auxiliary classification generative adversarial network, and uses the fault classification network to judge the operation status of the oil pump to diagnose the oil pump fault. In detail, the embodiment of the present application proposes an improved auxiliary classification generative adversarial network, which can generate data similar to the feature distribution of the original sample, which is an effective strategy to solve the problem of insufficient oil pump fault data. In other words, by using the improved auxiliary classification generative adversarial network to amplify the oil pump fault data, the problem of insufficient oil pump fault data is solved, and the recognition accuracy of the fault classification network for the oil pump fault is improved. That is, after the oil pump fault data is amplified, the oil pump fault data of different fault categories can be balanced, and the model training is performed based on such oil pump fault data, and the trained fault classification network can accurately classify the oil pump fault, that is, the classification accuracy is high. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0069] Figure 1 It is a structural schematic diagram of a beam pumping unit provided in an embodiment of the present application;

[0070] Figure 2 It is a structural diagram of a GAN network provided in an embodiment of the present application;

[0071] Figure 3 It is a flow chart of a method for classifying faults of an oil pump provided in an embodiment of the present application;

[0072] Figure 4 It is a flow chart of a pumping unit fault diagnosis based on a generative adversarial network provided in an embodiment of the present application;

[0073] Figure 5This is a data augmentation flow chart based on a generative adversarial network provided in an embodiment of the present application;

[0074] Figure 6 It is a flow chart of oil pump fault diagnosis based on a generative adversarial network and a fault classification network provided by an embodiment of the present application;

[0075] Figure 7 It is a structural schematic diagram of a fault classification device for an oil pumping unit provided in an embodiment of the present application;

[0076] Figure 8 is a structural schematic diagram of a computer device provided in an embodiment of the present application;

[0077] Fig. 9 It is a structural diagram of another computer device provided in an embodiment of the present application.

[0078] exist Figure 1 Among them, 1-fixed valve; 2-moving valve; 3-sucker rod; 4-oil pipe; 5-donkey head; 6-crossbeam; 7-connecting rod; 8-crank; 9-reduction box; 10-motor. DETAILED DESCRIPTION

[0079] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0080] In this application, the terms "first", "second", etc. are used to distinguish the same or similar items with substantially the same role and function. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms.

[0081] These terms are only used to distinguish one element from another element. For example, without departing from the scope of various examples, a first element can be referred to as a second element, and similarly, a second element can also be referred to as a first element. Both the first element and the second element can be elements, and in some cases, can be separate and different elements.

[0082] Here, at least one means one or more than one, for example, at least one element can be one element, two elements, three elements, or any other integer greater than or equal to one. And multiple means two or more than two, for example, multiple elements can be two elements, three elements, or any other integer greater than or equal to two.

[0083] The "and / or" mentioned in this article indicates that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship.

[0084] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0085] As mentioned in the background technology section above, studying advanced pumping unit fault diagnosis methods, developing intelligent pumping unit fault diagnosis platforms, and real-time monitoring of the pumping unit operating status are important means to ensure the safe and reliable operation of the pumping unit, and have very important engineering application value and theoretical research significance.

[0086] In recent years, great progress has been made in fault diagnosis of oil pumping units based on artificial intelligence technology. For example, BP neural network, support vector machine and particle swarm algorithm have been applied to fault diagnosis of oil pumping units.

[0087] For example, Figure 1 A structural schematic diagram of a beam pumping unit is given. Figure 1 As shown, the beam pumping unit includes: a fixed valve 1, a movable valve 2, a sucker rod 3, an oil pipe 4, a pumping head 5, a crossbeam 6, a connecting rod 7, a crank 8, a reduction gear box 9 and an electric motor 10.

[0088] In an embodiment of the present application, in order to solve the problems of insufficient oil pump fault data and uneven sample distribution, a method for classifying oil pump faults based on an improved auxiliary classification generative adversarial network is proposed. The method takes the oil pump as the research object, expands the oil pump fault data based on the improved auxiliary classification generative adversarial network, and uses the fault classification network to determine the operating status of the oil pump to diagnose the oil pump fault.

[0089] in, Figure 2 A schematic diagram of the structure of a generative adversarial network (GAN) is given. Figure 2 In the example, the real data is the collected pumping unit fault data, and the random noise Z is input into the generator to make the generator generate false data. The real data and false data are input into the discriminator for true and false discrimination. Figure 2The generative adversarial network shown has problems such as model instability and easy collapse during the training process. The embodiment of the present application proposes an improved auxiliary classification generative adversarial network, which can generate data similar to the feature distribution of the original sample, which is an effective strategy to solve the problem of insufficient pumping unit fault data. In other words, by using the improved auxiliary classification generative adversarial network to amplify the pumping unit fault data, the problem of insufficient pumping unit fault data is solved, and the recognition accuracy of the fault classification network for the pumping unit fault is improved.

[0090] In addition, based on the improved auxiliary classification generative adversarial network, the embodiment of the present application introduces an attention module (such as a SEnet module) and a focused loss function (FLoss) to enhance the pumping unit fault data. Exemplarily, the pumping unit fault data in this article refers to the dynamometer diagram sample of the pumping unit, and this application does not limit this. In addition, for the fault classification network, in order to improve the ability of deep learning methods to extract pumping unit fault features, on the basis of the convolutional neural network, an attention module is also introduced, and improvements are made to the learning rate, activation function, loss function and optimizer, etc., as described below.

[0091] In summary, in view of the limited pumping unit fault data (such as indicator diagram samples), the generalization ability of the fault classification network trained based on a small number of pumping unit fault data is weak, and the low model recognition accuracy caused by the difference between the sample data used for training and the actual data, the embodiment of the present application proposes a new pumping unit fault classification scheme, which is briefly described as follows:

[0092] According to the fault conditions that are prone to occur in the pumping unit, the dynamometer diagram samples of the corresponding fault categories are collected, and after data preprocessing (such as data cleaning and normalization, etc.), a training set is constructed. After that, the dynamometer diagram samples included in the training set are input into the improved auxiliary classification generative adversarial network according to a certain batch size. After iterative training, the trained generative adversarial network is saved. After that, the dynamometer diagram samples are amplified using the trained generative adversarial network, and a mixed data set is constructed based on the newly generated dynamometer diagram samples and the source data. After that, a fault classification network is constructed based on the improved convolutional neural network, and the mixed data set is input into the fault classification network according to a certain batch size. After iterative training, a trained fault classification network is obtained. Based on the trained fault classification network, the pumping unit fault can be diagnosed and identified.

[0093] In the embodiment of the present application, the work diagram is used to reflect the working condition of the oil pump, which can be measured by a special instrument and drawn on a coordinate diagram. Among them, the area enclosed by the closed line segment represents the work done by the oil pump in one reciprocating motion.

[0094] The fault classification scheme of the oil pump provided in the embodiment of the present application is explained in detail through the following implementation method.

[0095] Figure 3 1 is a flow chart of a method for classifying a fault of an oil pump provided in an embodiment of the present application. The method is performed by a computer device. Figure 3 , the method comprising:

[0096] 301. A computer device obtains an original data set, wherein the original data set includes real dynamometer diagram samples of the oil pump and a fault category label of each real dynamometer diagram sample.

[0097] See also Figure 4 and Figure 5 This step is used to collect and produce sample data. The above original data set is also called a training set; the real dynamometer sample refers to the dynamometer data collected when the pumping unit is running under different fault conditions.

[0098] In the embodiment of the present application, the fault data of the oil pumping unit under different fault conditions are collected to obtain the dynamometer diagram samples corresponding to different fault categories. Figure 4 and Figure 5 As shown, the collected dynamometer diagram samples are preprocessed (also called normalization processing), such as data cleaning, deletion of redundant or invalid data, etc., which is not limited in the present application.

[0099] In addition, the collected dynamometer samples are of known categories, that is, the dynamometer samples of the pumping unit have known labels. In other words, the embodiment of the present application will manually label the pre-processed dynamometer samples. For example, positive integers from 0 to N are used to represent N+1 different operating conditions, corresponding to N+1 fault categories. For example, Figure 6 C1, C2, ..., Cm in the figure correspond to the above N+1 fault categories.

[0100] In addition, for the collected dynamometer diagram samples, a training set, a test set, and a validation set may be prepared in a ratio of 7:2:1, and this application does not impose any limitation on this.

[0101] In summary, the embodiment of the present application is based on the improved auxiliary classification generative adversarial network. In order to improve the authenticity and diversity of the generated dynamometer sample, the generative adversarial network not only introduces the SEnet module, but also adds the focus loss. Figure 4 and Figure 5It can be seen that the training of the generative adversarial network and the augmentation of the indicator diagram samples include: collecting the indicator diagram data of the pumping unit under various fault conditions, such as collecting 10 types of indicator diagram data of the pumping unit; then, preprocessing the collected indicator diagram data, such as deleting irrelevant data, performing standardization processing, etc. After that, the preprocessed indicator diagram data is enhanced using the trained generative adversarial network.

[0102] In one possible implementation, see Figure 6 , obtain the original data set, including but not limited to the following methods:

[0103] The data acquisition system is used to obtain the indicator diagram data of the pumping unit under different fault conditions, and the indicator diagram data corresponding to different fault categories are obtained; the indicator diagram data under different fault categories are preprocessed; according to the pre-set multiple fault categories, the label information of the labeling personnel for labeling the preprocessed indicator diagram data with the fault category is obtained to obtain the original data set. Among them, the original data set includes the indicator pictures with known labels.

[0104] 302. The computer device constructs a generative adversarial network; wherein the generative adversarial network includes a generator and a discriminator; random noise, real dynamometer diagram samples and specified fault categories are input into the generator, and real dynamometer diagram samples, fake dynamometer diagram samples generated by the generator and corresponding fault category labels are input into the discriminator to iteratively train the generative adversarial network; when the generative adversarial network reaches a Nash equilibrium, the iterative training is stopped.

[0105] like Figure 4-6 As shown, this step is used to construct an improved auxiliary classification generative adversarial network, and the preprocessed dynamometer diagram data is input into the generative adversarial network to train the generative adversarial network.

[0106] In an embodiment of the present application, the real dynamometer sample and the corresponding fault category label will be input into the discriminator of the generative adversarial network, and the random noise Z, the real dynamometer sample and the specified fault category will also be input into the generator of the generative adversarial network at the same time, wherein the generator is responsible for generating dynamometer data belonging to the specified fault category, and the discriminator is responsible for distinguishing the true and false of the input dynamometer data, and the two will compete against each other and eventually reach a Nash equilibrium. In other words, the embodiment of the present application will determine whether the generative adversarial network has reached Nash equilibrium; if not, iterative training will continue; if Nash equilibrium is reached, iterative training will be stopped, and the trained generative adversarial network will be used to perform data enhancement on the dynamometer sample. The newly generated dynamometer sample and the original real dynamometer sample together constitute a mixed data set.

[0107] The first point that needs to be explained is that the dynamometer data newly generated by the generator is called a fake dynamometer sample because the dynamometer data generated by the generator is not collected under real working conditions. In addition, the above-mentioned specified fault categories are fault categories with a small number of samples. Accordingly, the dynamometer data generated by data augmentation processing is consistent with the characteristics of minority category samples.

[0108] In a possible implementation, the method provided in the embodiment of the present application further includes:

[0109] Obtain the number of dynamometer diagram samples under each fault category in the original data set; sort the number of dynamometer diagram samples under each fault category in order from small to large; take the N fault categories with the first N dynamometer diagram sample numbers as the designated fault categories; N is a positive integer;

[0110] Or, the number of dynamometer diagram samples under each fault category in the original data set is obtained; the fault category whose number of dynamometer diagram samples is less than a quantity threshold is taken as the designated fault category.

[0111] In summary, combined with Figure 4 and Figure 5 It can be seen that the training of the generative adversarial network and the amplification processing of the dynamometer diagram samples also include: sending the pre-processed dynamometer diagram samples and the corresponding fault category labels into the generative adversarial network for iterative training and feature extraction. Among them, the generator uses the real dynamometer diagram samples and the corresponding fault category labels and then uses random noise Z to generate fake dynamometer diagram samples corresponding to the specified fault category; and the discriminator uses the fake dynamometer diagram samples, the real dynamometer diagram samples and the corresponding fault category labels as inputs to make true and false judgments until the true and false data cannot be distinguished. Exemplarily, the iteration is stopped after the corresponding number of trainings, and a trained generative adversarial network is obtained.

[0112] In another possible implementation, Figure 5 As shown, the above-mentioned random noise, real dynamometer sample and specified fault category are input into the generator, and the real dynamometer sample, the fake dynamometer sample generated by the generator and the corresponding fault category label are input into the discriminator, and the generative adversarial network is iteratively trained, including but not limited to the following methods:

[0113] Random noise, real dynamometer diagram samples and specified fault categories are input into the generator; false dynamometer diagram samples with specified fault categories are generated through the convolution layer and attention layer of the generator, and the network parameters of the generator are updated by the forward propagation algorithm and the back propagation algorithm until the number of iterations reaches a first preset number, thereby obtaining a trained generator; real dynamometer diagram samples, false dynamometer diagram samples and corresponding fault category labels are input into the discriminator; true and false discrimination is performed on the input dynamometer diagram samples through the convolution layer and attention layer of the discriminator, and the network parameters of the discriminator are updated by the forward propagation algorithm and the back propagation algorithm until the number of iterations reaches a second preset number, thereby obtaining a trained discriminator; wherein, during the network parameter updating process, the discriminator uses the focusing loss function to calculate the loss value.

[0114] The second point that needs to be explained is that Figure 6 As shown, the above generator and discriminator may include a normalization (BN) layer in addition to the convolution layer and the attention layer, and this application does not limit this.

[0115] 303. The computer device performs an amplification process on the dynamometer diagram samples based on the trained generative adversarial network to obtain a mixed data set; wherein the mixed data set includes real dynamometer diagram samples and dynamometer diagram samples generated by the amplification process.

[0116] In the embodiment of the present application, after the training is completed, the network parameters (also called weights) of the generative adversarial network are also updated, and different categories of dynamometer data can be generated based on the weights of the generative adversarial network at this time. In other words, the dynamometer sample is amplified based on the trained generative adversarial network, including but not limited to the following methods: based on the trained generative adversarial network, the dynamometer sample under the specified fault category is amplified to obtain different categories of dynamometer sample data generated by the amplification process.

[0117] 304. The computer device constructs a fault classification network; based on the mixed data set, the fault classification network is iteratively trained until the training termination condition is met.

[0118] like Figure 4 As shown, this step is used to construct and iteratively train a fault classification network, and to diagnose and identify pumping unit faults based on the trained fault classification network.

[0119] In the embodiment of the present application, the fault classification network is an improved convolutional neural network. That is, the embodiment of the present application takes the convolutional neural network as the research basis, introduces the attention module into the convolutional neural network, and improves the learning rate, activation function, loss function and optimizer, so as to realize the construction of the fault classification network. In detail, firstly, the cosine annealing method is used to optimize the learning rate, and the learning rate is adaptively adjusted during the training process so that the model can reach the optimal value more easily; secondly, the Ranger optimizer is used to replace the traditional optimizer so that the model can be trained stably, the convergence of the network is improved, and the generalization performance is improved; thirdly, the Mish activation function is used to directly cut off the negative situation of the network, and the gradient descent is smoother; finally, by introducing the attention module and the focus loss function, the network can pay more attention to the relationship between channels and can extract more sample features with high similarity.

[0120] Among them, when the gradient descent method is used to optimize the loss function, when approaching the global minimum of the loss function, the learning rate should become smaller so that the model is as close to this point as possible, so the learning rate needs to be decayed. The characteristic of the cosine function is that as the independent variable x increases, the cosine function value first decreases slowly, then accelerates, and then decelerates, so the cosine function is often used to reduce the learning rate. This method is called cosine annealing. The Ranger optimizer is a combination of RAdam and LookAhead. Among them, RAdam uses a dynamic rectifier to adjust the adaptive momentum of Adam according to the changes. For the current data set, an automatic warm-up is effectively provided, which allows training to have a good start. In other words, it can stabilize the initial training. LookAhead reduces the need for a large number of hyperparameter tuning, while achieving faster convergence between different deep learning tasks with minimal computational overhead. In addition, the main goal of focusing on the loss function is to solve problems such as imbalanced sample categories and imbalanced sample classification difficulty.

[0121] Next, if Figure 4 As shown, the fault classification network is iteratively trained by inputting a mixed data set, and it is determined whether the loss function of the fault classification network converges; if the loss function has not reached the convergence state, the iterative training continues; if it has reached the convergence state, the iterative training is stopped, and the trained fault classification network is used to diagnose and identify the oil pumping unit fault.

[0122] In one possible implementation, considering that the fault classification network may need to be transplanted to old equipment with weak computing power in the actual production process, it is also necessary to solve the problem of weak computing power caused by old equipment. Therefore, the embodiment of the present application also proposes a method for constructing a lightweight fault classification network based on the Shuffle Net network. In other words, the Shuffle Net network can also be used to construct a fault classification network. For the Shuffle Net network, by introducing a grouped convolution kernel for channel-by-channel convolution, it is possible to reduce the complexity of feature extraction while reducing the amount of parameters and calculations; in addition, the channel rearrangement operation can fuse information of different dimensions and improve the recognition accuracy of the fault classification network.

[0123] In summary, combined with Figure 6 , training the fault classification network includes: taking the mixed data set as the input of the fault classification network; exemplarily, the fault classification network is composed of a convolutional layer, a SEnet layer, a fully connected layer, and a Mish activation function, and the fault classification network is trained by changing the learning rate, the optimizer, and the loss function to extract the pumping unit fault features, so that the classification accuracy of the fault classification network is higher; finally, the extracted features are input into the fully connected layer for classification processing. Exemplarily, during the training process, the iterative training can be stopped after reaching a certain number of times, thereby obtaining a trained fault classification network.

[0124] In another possible implementation, Figure 6 As shown, the fault classification network is iteratively trained based on the mixed data set until the training termination condition is met, including but not limited to the following methods:

[0125] The dynamometer diagram samples and corresponding fault classification labels included in the mixed data set are input into the fault classification network according to the preset batch size; the convolution layer, attention layer, activation function layer and fully connected layer of the fault classification network are used to extract features and classify faults of the input dynamometer diagram samples, and the cosine annealing method is used to optimize the learning rate and the Ranger optimizer is used to optimize the network parameters of the fault classification network until the training termination conditions are met, thereby obtaining a trained fault classification network.

[0126] Exemplarily, the activation function layer uses the Mish activation function; the training termination condition is that the number of iterations reaches a third preset number or the focus loss function used by the fault classification network reaches model convergence.

[0127] In another possible implementation, the trained fault classification network can be used to test the test set and output the test results to perform a performance test on the trained fault classification network. That is, the method provided in the embodiment of the present application also includes:

[0128] A test data set is obtained; wherein the number of dynamometer diagram samples included in the test data set is less than the number of dynamometer diagram samples included in the original data set; based on a trained fault classification network, fault classification is performed on the dynamometer diagram samples included in the test data set; based on the fault category output by the fault classification network and the fault category label of each dynamometer diagram sample in the test data set, a test report is generated and output.

[0129] 305. The computer device obtains the to-be-classified dynamometer diagram of the oil pump; the to-be-classified dynamometer diagram is input into the trained fault classification network to obtain a fault category matching the to-be-classified dynamometer diagram.

[0130] It should be noted that the computer device of the aforementioned steps 301-304 is a model training device, and the computer device of this step 305 is a fault classification device. In the embodiment of the present application, the above-mentioned model training device and the above-mentioned fault classification device can be the same device or different devices, and the present application does not limit this. Taking the above-mentioned model training device and the above-mentioned model training device as different devices as an example, the above-mentioned model training device is used to train and save the improved auxiliary classification generative adversarial network and the fault classification network, and the above-mentioned model training device is used to diagnose and identify the pumping unit fault after the trained fault classification network is implanted.

[0131] The embodiment of the present application proposes a method for classifying oil pump faults based on an improved auxiliary classification generative adversarial network. The method takes the oil pump as the research object, expands the oil pump fault data based on the improved auxiliary classification generative adversarial network, and uses the fault classification network to judge the operation status of the oil pump to diagnose the oil pump fault. In detail, the embodiment of the present application proposes an improved auxiliary classification generative adversarial network, which can generate data similar to the feature distribution of the original sample, which is an effective strategy to solve the problem of insufficient oil pump fault data. In other words, by using the improved auxiliary classification generative adversarial network to amplify the oil pump fault data, the problem of insufficient oil pump fault data is solved, and the recognition accuracy of the fault classification network constructed based on the improved convolutional neural network for the oil pump fault is improved. That is, after the oil pump fault data is amplified, the oil pump fault data of different fault categories can be balanced, and the model training is performed based on such oil pump fault data, and the trained fault classification network can accurately classify the oil pump fault, that is, the classification accuracy is high.

[0132] In addition, by introducing the attention module in the generator and the discriminator, not only can more effective features of the dynamometer sample be extracted, but also the extraction of invalid or ineffective features can be minimized, thus achieving the best data generation effect.

[0133] In addition, by introducing the focus loss function in the discriminator, the network can focus on samples with high similarity for training, so as to balance the degree of sample training and prevent overfitting.

[0134] In addition, for the improved convolutional neural network, the embodiment of the present application adopts a cosine annealing method to optimize the learning rate, and adaptively adjusts the learning rate during the training process, so that the model can more easily reach the optimal value.

[0135] In addition, the embodiment of the present application uses the Ranger optimizer during the training process, so that the model can be trained stably, the convergence of the model is improved, and the generalization ability of the model is enhanced.

[0136] In addition, by using the Mish activation function, the negative case of the network can be directly truncated, and the gradient descent is smoother.

[0137] In addition, by introducing the attention module and the focus loss function, the network can not only pay more attention to the relationship between channels, but also extract more sample features with high similarity.

[0138] Figure 7 Schematic diagram of a fault classification device for an oil pump provided in an embodiment of the present application. Figure 7 , the device comprises:

[0139] The first acquisition module 701 is configured to acquire an original data set; wherein the original data set includes a real dynamometer diagram sample of the oil pumping unit and a fault category label of each real dynamometer diagram sample;

[0140] A construction module 702 is configured to construct a generative adversarial network; wherein the generative adversarial network includes a generator and a discriminator;

[0141] The first training module 703 is configured to iteratively train the generative adversarial network by inputting random noise, the real dynamometer sample and the specified fault category into the generator, and inputting the real dynamometer sample, the false dynamometer sample generated by the generator and the corresponding fault category label into the discriminator;

[0142] The generating module 704 is configured to stop iterative training when the generative adversarial network reaches a Nash equilibrium; perform an amplification process on the dynamometer diagram samples based on the trained generative adversarial network to obtain a mixed data set; wherein the mixed data set includes the real dynamometer diagram samples and the dynamometer diagram samples generated by the amplification process;

[0143] A second training module 705 is configured to iteratively train the fault classification network based on the mixed data set until a training termination condition is met;

[0144] The classification module 706 is configured to obtain the dynamometer diagram to be classified of the oil pumping unit; input the dynamometer diagram to be classified into the trained fault classification network to obtain a fault category matching the dynamometer diagram to be classified.

[0145] The embodiment of the present application proposes a method for classifying oil pump faults based on an improved auxiliary classification generative adversarial network. The method takes the oil pump as the research object, expands the oil pump fault data based on the improved auxiliary classification generative adversarial network, and uses the fault classification network to judge the operation status of the oil pump to diagnose the oil pump fault. In detail, the embodiment of the present application proposes an improved auxiliary classification generative adversarial network, which can generate data similar to the feature distribution of the original sample, which is an effective strategy to solve the problem of insufficient oil pump fault data. In other words, by using the improved auxiliary classification generative adversarial network to amplify the oil pump fault data, the problem of insufficient oil pump fault data is solved, and the recognition accuracy of the fault classification network for the oil pump fault is improved. That is, after the oil pump fault data is amplified, the oil pump fault data of different fault categories can be balanced, and the model training is performed based on such oil pump fault data, and the trained fault classification network can accurately classify the oil pump fault, that is, the classification accuracy is high.

[0146] In a possible implementation, the first training module is configured as follows:

[0147] Inputting the random noise, the real dynamometer sample and the specified fault category into the generator; generating a false dynamometer sample with the specified fault category through the convolution layer and the attention layer of the generator, and updating the network parameters of the generator by using the forward propagation algorithm and the back propagation algorithm until the number of iterations reaches a first preset number, thereby obtaining a trained generator;

[0148] Input the true dynamometer sample, the false dynamometer sample and the corresponding fault category label into the discriminator; perform true and false discrimination on the input dynamometer sample through the convolution layer and the attention layer of the discriminator, and use the forward propagation algorithm and the back propagation algorithm to update the network parameters of the discriminator until the number of iterations reaches a second preset number, thereby obtaining a trained discriminator;

[0149] In the process of updating network parameters, the discriminator uses a focused loss function to calculate the loss value.

[0150] In a possible implementation, the generating module is configured to:

[0151] Based on the trained generative adversarial network, the dynamometer diagram samples under the specified fault category are amplified to obtain dynamometer diagram sample data of different categories generated by the amplification process.

[0152] In a possible implementation, the device further includes: a second acquisition module; wherein the second acquisition module is configured to:

[0153] Obtain the number of dynamometer diagram samples under each fault category in the original data set; sort the number of dynamometer diagram samples under each fault category in order from small to large; take the N fault categories with the first N dynamometer diagram sample numbers as the designated fault categories; N is a positive integer;

[0154] Or, the number of dynamometer diagram samples under each fault category in the original data set is obtained; and the fault category for which the number of dynamometer diagram samples is less than a quantity threshold is used as the designated fault category.

[0155] In a possible implementation, the second training module is configured as follows:

[0156] Inputting the dynamometer diagram samples and corresponding fault classification labels included in the mixed data set into the fault classification network according to a preset batch size;

[0157] Through the convolution layer, attention layer, activation function layer and full connection layer of the fault classification network, feature extraction and fault classification are performed on the input dynamometer diagram sample, and the learning rate is optimized by cosine annealing and the network parameters of the fault classification network are optimized by Ranger optimizer until the training termination condition is met, thereby obtaining a trained fault classification network;

[0158] Wherein, the activation function layer uses the Mish activation function;

[0159] The training termination condition is that the number of iterations reaches a third preset number or the focus loss function used by the fault classification network reaches model convergence.

[0160] In a possible implementation, the first acquisition module is configured to:

[0161] Acquire the indicator diagram data of the oil pumping unit under different fault conditions, and obtain the indicator diagram data corresponding to different fault categories;

[0162] Preprocess the indicator diagram data under different fault categories;

[0163] According to the set multiple fault categories, label information for marking the fault categories of the preprocessed indicator diagram data is obtained to obtain the original data set.

[0164] In a possible implementation, the device further includes: a testing module;

[0165] The construction module is configured to construct the fault classification network based on the Shuffle Net network;

[0166] The test module is configured to obtain a test data set; wherein the number of dynamometer diagram samples included in the test data set is less than the number of dynamometer diagram samples included in the original data set; based on a trained fault classification network, fault classification is performed on the dynamometer diagram samples included in the test data set; and a test report is generated based on the fault category output by the fault classification network and the fault category labels of each dynamometer diagram sample in the test data set.

[0167] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0168] It should be noted that: the pumping unit fault classification device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when classifying the pumping unit faults. In actual applications, the above functional distribution can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the pumping unit fault classification device provided in the above embodiment and the pumping unit fault classification method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0169] Figure 8 It is a structural diagram of a computer device 800 provided in an embodiment of the present application.

[0170] Typically, the computer device 800 includes a processor 801 and a memory 802 .

[0171] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In one possible implementation, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In one possible implementation, the processor 801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0172] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In a possible implementation, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one program code, which is used to be executed by the processor 801 to implement the fault classification method of the oil pump provided in the method embodiment of the present application.

[0173] In a possible implementation, the computer device 800 further includes: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802 and the peripheral device interface 803 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 803 via a bus, a signal line or a circuit board. The peripheral device includes: at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, a positioning assembly 808 and a power supply 809.

[0174] The peripheral device interface 803 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 801 and the memory 802. In one possible implementation, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in another possible implementation, any one or two of the processor 801, the memory 802, and the peripheral device interface 803 may be implemented on a separate chip or circuit board, which is not limited in the present application.

[0175] The radio frequency circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. In one possible implementation, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In one possible implementation, the radio frequency circuit 804 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0176] The display screen 805 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 also has the ability to collect touch signals on the surface or above the surface of the display screen 805. The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 805 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In one possible implementation, the display screen 805 can be one, arranged on the front panel of the computer device 800; in another possible implementation, the display screen 805 can be at least two, respectively arranged on different surfaces of the computer device 800 or in a folding design; in another possible implementation, the display screen 805 can be a flexible display screen, arranged on a curved surface or a folding surface of the computer device 800. Even, the display screen 805 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 805 can be prepared using materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like.

[0177] The camera assembly 806 is used to capture images or videos. In one possible implementation, the camera assembly 806 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In one possible implementation, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and the VR (Virtual Reality) shooting function or other fusion shooting functions. In another possible implementation, the camera assembly 806 may also include a flash. The flash may be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0178] The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 801 for processing, or input them into the radio frequency circuit 804 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the computer device 800. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In a possible implementation, the audio circuit 807 may also include a headphone jack.

[0179] The positioning component 808 is used to locate the current geographical location of the computer device 800 to implement navigation or LBS (Location Based Service). The positioning component 808 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Greiner system, or the European Union's Galileo system.

[0180] The power supply 809 is used to power various components in the computer device 800. The power supply 809 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 809 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0181] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the computer device 800, and the computer device 800 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.

[0182] Fig. 9 It is a structural diagram of another computer device 900 provided in an embodiment of the present application.

[0183] The computer device 900 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 901 and one or more memories 902, wherein the memory 902 stores at least one program code, and the at least one program code is loaded and executed by the processor 901 to implement the pumping unit fault classification method provided by the above-mentioned various method embodiments. Of course, the computer device 900 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the computer device 900 may also include other components for implementing device functions, which will not be described in detail here.

[0184] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including a program code, and the program code can be executed by a processor in a computer device to complete the fault classification method of the pumping unit in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0185] In an exemplary embodiment, a computer program product or a computer program is also provided, which includes a computer program code, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the above-mentioned oil pump fault classification method.

[0186] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0187] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for classifying faults of an oil pump, characterized in that: The method comprises: Acquire an original data set; wherein the original data set includes real indicator diagram samples of the oil pumping unit and a fault category label of each real indicator diagram sample; Constructing a generative adversarial network; wherein the generative adversarial network includes a generator and a discriminator; Iteratively training the generative adversarial network by inputting random noise, the real dynamometer diagram sample and the specified fault category into the generator, and inputting the real dynamometer diagram sample, the false dynamometer diagram sample generated by the generator and the corresponding fault category label into the discriminator; When the generative adversarial network reaches a Nash equilibrium, the iterative training is stopped; based on the trained generative adversarial network, the dynamometer diagram samples are augmented to obtain a mixed data set; wherein the mixed data set includes the real dynamometer diagram samples and the dynamometer diagram samples generated by the augmentation process; Based on the mixed data set, iteratively train the fault classification network until a training termination condition is met; The dynamometer diagram to be classified of the oil pump is obtained; the dynamometer diagram to be classified is input into a trained fault classification network to obtain a fault category matching the dynamometer diagram to be classified.

2. The method according to claim 1, characterized in that: The method of iteratively training the generative adversarial network by inputting random noise, the real dynamometer diagram sample and the specified fault category into the generator, and inputting the real dynamometer diagram sample, the false dynamometer diagram sample generated by the generator and the corresponding fault category label into the discriminator comprises: Inputting the random noise, the real dynamometer sample and the specified fault category into the generator; generating a false dynamometer sample with the specified fault category through the convolution layer and the attention layer of the generator, and updating the network parameters of the generator by using the forward propagation algorithm and the back propagation algorithm until the number of iterations reaches a first preset number, thereby obtaining a trained generator; Input the true dynamometer sample, the false dynamometer sample and the corresponding fault category label into the discriminator; perform true and false discrimination on the input dynamometer sample through the convolution layer and the attention layer of the discriminator, and use the forward propagation algorithm and the back propagation algorithm to update the network parameters of the discriminator until the number of iterations reaches a second preset number, thereby obtaining a trained discriminator; In the process of updating network parameters, the discriminator uses a focused loss function to calculate the loss value.

3. The method according to claim 1, characterized in that The amplification process of the dynamometer diagram samples based on the trained generative adversarial network includes: Based on the trained generative adversarial network, the dynamometer diagram samples under the specified fault category are amplified to obtain dynamometer diagram sample data of different categories generated by the amplification process.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Obtain the number of dynamometer diagram samples under each fault category in the original data set; sort the number of dynamometer diagram samples under each fault category in order from small to large; take the N fault categories with the first N dynamometer diagram sample numbers as the designated fault categories; N is a positive integer; Or, the number of dynamometer diagram samples under each fault category in the original data set is obtained; and the fault category for which the number of dynamometer diagram samples is less than a quantity threshold is used as the designated fault category.

5. The method according to claim 1, characterized in that The iterative training of the fault classification network based on the mixed data set until a training termination condition is met includes: Inputting the dynamometer diagram samples and corresponding fault classification labels included in the mixed data set into the fault classification network according to a preset batch size; Through the convolution layer, attention layer, activation function layer and full connection layer of the fault classification network, feature extraction and fault classification are performed on the input dynamometer diagram sample, and the learning rate is optimized by cosine annealing and the network parameters of the fault classification network are optimized by Ranger optimizer until the training termination condition is met, thereby obtaining a trained fault classification network; Wherein, the activation function layer uses the Mish activation function; The training termination condition is that the number of iterations reaches a third preset number or the focus loss function used by the fault classification network reaches model convergence.

6. The method according to claim 1, characterized in that The obtaining of the original data set comprises: Acquire the indicator diagram data of the oil pumping unit under different fault conditions, and obtain the indicator diagram data corresponding to different fault categories; Preprocess the dynamometer data under different fault categories; According to the set multiple fault categories, label information for marking the fault categories of the preprocessed indicator diagram data is obtained to obtain the original data set.

7. The method according to claim 1, characterized in that The method further comprises: Based on the Shuffle Net network, construct the fault classification network; Acquire a test data set; wherein the number of dynamometer diagram samples included in the test data set is less than the number of dynamometer diagram samples included in the original data set; Based on the trained fault classification network, fault classification is performed on the dynamometer diagram samples included in the test data set; A test report is generated based on the fault category output by the fault classification network and the fault category label of each dynamometer diagram sample in the test data set.

8. A fault classification device for an oil pump, characterized in that: The device comprises: The first acquisition module is configured to acquire an original data set; wherein the original data set includes real dynamometer diagram samples of the oil pumping unit and a fault category label of each real dynamometer diagram sample; A construction module is configured to construct a generative adversarial network; wherein the generative adversarial network includes a generator and a discriminator; A first training module is configured to iteratively train the generative adversarial network by inputting random noise, the real dynamometer diagram sample and a specified fault category into the generator, and inputting the real dynamometer diagram sample, the fake dynamometer diagram sample generated by the generator and the corresponding fault category label into the discriminator; A generation module is configured to stop iterative training when the generative adversarial network reaches a Nash equilibrium; perform an amplification process on the dynamometer diagram samples based on the trained generative adversarial network to obtain a mixed data set; wherein the mixed data set includes the real dynamometer diagram samples and the dynamometer diagram samples generated by the amplification process; A second training module is configured to iteratively train the fault classification network based on the mixed data set until a training termination condition is met; The classification module is configured to obtain the to-be-classified indicator diagram of the oil pumping unit; input the to-be-classified indicator diagram into a trained fault classification network to obtain a fault category matching the to-be-classified indicator diagram.

9. A computer device, characterized in that: The device comprises a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the fault classification method for the oil pumping unit as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: At least one program code is stored in the storage medium, and the at least one program code is loaded and executed by the processor to implement the fault classification method for the oil pumping unit according to any one of claims 1 to 7.