A method for fusion inference recognition of pumping unit working conditions based on the fusion similarity of indicator diagrams
By using the fusion similarity method of the power diagram in oil well recognition, combined with the Pearson correlation coefficient and local sensitive hashing algorithm, the problem of identifying multiple oil pumping conditions in the prior art is solved, and more efficient and accurate condition recognition is achieved.
Patent Information
- Application Number
- CN202210091545.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-01-26
AI Technical Summary
The existing oil well identification methods are difficult to effectively identify multiple simultaneous oil pumping conditions, and are affected by factors such as machine aging, geological differences and light changes, so the identification accuracy and efficiency are low.
The fusion similarity method based on the power diagram is adopted, combined with the Pearson correlation coefficient algorithm and the local sensitive hash algorithm, and the feature extraction and similarity fusion are used to accurately identify the oil pumping conditions and comprehensive judgment of multiple conditions.
It improves the accuracy and efficiency of oil pumping conditions identification, can identify a single working condition, and can comprehensively judge multiple simultaneous failures, adapt to different geological conditions and machine aging conditions.
Smart Images

Figure CN114581685B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of oil well production and pumping, and particularly to a method for fusion reasoning and identification of pumping working conditions based on the fusion similarity of dynamometer cards. Background Art
[0002] The pumping dynamometer card is the main means to understand the working conditions of the tubing, rod, and pump in the oil well under the pumping unit. Analyzing and interpreting the dynamometer card is a main means to directly understand the working conditions of the deep well pump. All abnormal phenomena during the operation of the deep well pump can be relatively intuitively reflected on the dynamometer card.
[0003] The pumping unit is the core equipment in the oil extraction process. Judging the working conditions of the pumping unit and operating the pumping unit manually alone has low efficiency and cannot meet the needs of the industry development.
[0004] Under the background of the current artificial intelligence trend, especially using deep learning technology to mine the information expressed by the dynamometer card, it is of great significance to improve the accuracy and efficiency of the identification of the working conditions or faults of the pumping unit and ensure the stable and reliable operation of the pumping unit. At present, traditional identification methods for pumping wells include mechanical model analysis, rod pump well fault diagnosis expert systems, etc. However, due to the geological differences in different regions and the problem of machine aging, if traditional dynamometer card identification methods are used, there will be significant differences in the identification results. Moreover, most of these mainstream methods can only identify one pumping working condition, which has a large deviation from the actual working conditions. There are widespread problems of multiple working conditions occurring simultaneously during the pumping process.
[0005] When measuring the similarity between a to-be-tested dynamometer card reflecting the characteristics of the pumping working condition and a sample card, the similarity based on the Pearson correlation coefficient algorithm has translational invariance and scale invariance compared with other traditional cosine distance calculation methods, and can overcome the influence of picture translation and image scaling. It is very suitable for the situation where the overall load of the pumping unit increases due to long-term use or the displacement amount shifts in a certain direction as a whole, resulting in the overall shift of the dynamometer card. It can avoid the decrease in the recognition rate caused by machine aging to a certain extent. It has good stability for the overall similarity evaluation of the two pictures, but is easily affected by light brightness, contrast, and color, and picture rotation will also have a significant impact on the results.
[0006] If only the similarity calculation based on the local hashing algorithm is used, since it is based on the idea of similar spatial domain conversion, picture magnification or reduction, changing the aspect ratio, or increasing or decreasing brightness, contrast, and color has little impact on the hash value. The locality-sensitive hashing algorithm can effectively ignore the problems brought by translation, scaling, aspect ratio change, rotation, and light in the dynamometer card. However, due to the strong local analysis ability of the locality-sensitive hashing algorithm, it is very sensitive to the picture content. A small content interference can easily cause a large change in the hash value of the picture, resulting in insufficient stability of the overall similarity evaluation.
[0007] The similarity obtained based on the Pearson correlation coefficient algorithm and the local hashing algorithm is fused according to certain steps, giving full play to the advantages of both, so as to obtain a more reasonable similarity between the graph to be measured and the sample graph, and finally effectively improve the recognition rate. This method has not been reported publicly. Summary of the Invention
[0008] The present invention discloses a fusion inference recognition method for pumping unit working conditions based on the fusion similarity of indicator diagrams. Starting from engineering applicability, based on CBIR technology and matching algorithms, and based on the fusion similarity between the indicator diagram to be measured and the sample diagram, fusion inference is carried out to obtain accurate pumping unit working conditions. The specific steps of the method of the present invention are as follows:
[0009] A fusion inference recognition method for pumping unit working conditions based on the fusion similarity of indicator diagrams, which includes the following processes:
[0010] (1) Obtaining, annotating and classifying, and training the indicator diagrams.
[0011] (2) Extracting features from each graph in the sample set using the trained Resnet50 and saving the feature vectors. (Using the trained Resnet50 network to extract features from the labeled training set and saving the feature results of all avgpool layers.)
[0012] (3) Obtaining the load and displacement data collected by the indicator instrument of the pumping well to be detected and drawing the indicator diagram. (Obtaining the load and displacement data collected by the indicator instrument of the pumping well to be detected and using opencv to draw the indicator diagram to be recognized with the load and displacement data.)
[0013] (4) Fusion inference and judgment of the pumping unit working conditions based on the fusion similarity of the indicator diagrams.
[0014] (5) Sending the working condition judgment result to the upper layer for display. Preferably, the steps of obtaining, annotating and classifying, and training the indicator diagrams include obtaining the indicator diagrams, annotating and classifying the existing indicator diagram data set, and training Resnet50 with the labeled indicator diagram data set and saving the training weights; the specific steps are as follows:
[0015] (1-1) Obtaining the load and displacement data collected by the indicator instrument of the pumping well, using the displacement as the abscissa x and the load as the ordinate y, and using the polygon drawing function toolkit in opencv to draw the data into an indicator diagram;
[0016] (1-2) The business expert preprocesses the indicator diagrams, eliminates the indicator diagrams with obvious errors, and forms an indicator diagram data set;
[0017] (1-3) Business experts annotate and classify the dynamometer cards in the dynamometer card dataset, and divide the well-annotated and classified dataset into a training set and a test set according to a ratio of 7:3;
[0018] (1-4) Put the training set into the Resnet50 neural network for training. Among them, the activation function is ReLu, the pooling method uses Max pooling for the input layer, and Avg pooling for the last output layer. The optimization cost function is Cross-entropy, and the batch_size is 16;
[0019] (1-5) After the training is completed, save the weights of the trained Resnet50.
[0020] Preferably, the specific steps of the pumping working condition fusion inference and judgment based on the dynamometer card fusion similarity are as follows:
[0021] (4-1) Use Resnet50 to extract the features of the dynamometer card to be detected
[0022] Put the incoming dynamometer card to be detected into the trained Resnet50, and extract the feature vector T = [t1, t2,..., t 2048 of the graph to be measured in the avgpool layer;
[0023] (4-2) Retrieve the feature vector S of the i-th graph in the sample set i = [si1, si2,... si 2048 , 0 < i ≤ n, where n is the number of sample graphs in the sample set;
[0024] (4-3) Calculate the similarity between the dynamometer card to be detected and the i-th graph in the sample set based on the Pearson correlation coefficient algorithm and the locality-sensitive hashing algorithm respectively;
[0025] (4-4) Based on the two algorithms, calculate the similarities mP i and mH i between the dynamometer card to be measured and the i-th graph in the sample set. After that, fuse the two similarities to obtain the fusion similarity P i (X) of the graph to be measured and the i-th matching graph marked as the X working condition, X = a1, a2... a k , a k is one of all the working conditions in the sample set; the specific fusion method is as follows:
[0026] P i (X) = mP i × mH i + mP i (1 - mH i ) + mH i (1 - mP i )
[0027] where mP i is the similarity value based on the Pearson algorithm; mH i is the similarity value based on the sensitive hashing algorithm;
[0028] (4 - 5)P i (X) is compared with the pre - set similarity threshold Ps,
[0029] (4 - 5 - 1) If P i (X)>Ps, store this figure in the preliminary recommended picture library and proceed to the next step;
[0030] (4 - 5 - 2) If P i (X)≤Ps, skip this matching picture and proceed to the next step;
[0031] (4 - 6) Determine whether all sample pictures in the database have been compared
[0032] (4 - 6 - 1) If not all have been calculated, take the next sample picture to compare with the picture to be tested, then return to step (4 - 2) and repeat the loop;
[0033] (4 - 6 - 2) If all have been calculated, enter the next link;
[0034] (4 - 7) Determine whether there are similar matching photos
[0035] (4 - 7 - 1) If there are recommended matching photos, list all the recommended matching pictures and transfer to the next step;
[0036] (4 - 7 - 2) If there are no recommended matching photos, the system prompts that there are no matching photos, and it can only be judged and classified by process experts, and then marked and put into the training set for the next round of training to update the Resnet neural network.
[0037] (4 - 8) Based on all the recommended matching pictures, conduct working condition fusion reasoning and judgment.
[0038] (4 - 9) Output the judgment result of the current working condition state.
[0039] Preferably, the feature vectors of the picture to be detected and the i - th picture in the sample set are known as: T = [t1, t2,..., t 2048 , S i = [si1, si2,... si 2048 , and the specific steps to calculate the similarity between the picture to be detected and the i - th picture in the sample set are:
[0040] Calculate the similarity mP between the feature vectors of the picture to be detected and the i - th picture in the sample set based on the Pearson correlation coefficient algorithm i as:
[0041]
[0042] where cov is the covariance, is the vector average.
[0043] Calculate the similarity mH between the feature vectors of the graph to be detected and the i-th graph in the sample set based on the locality-sensitive hashing algorithm i The specific steps are as follows:
[0044] 1) First, calculate the average values avg in the feature vectors T and S after feature extraction respectively, and discard the decimals of avg; i
[0045] 2) Compare the feature vectors T and S i with the average value avg. If it is less than avg, take 0, otherwise take 1; Write the numbers from right to left from the updated feature vectors in binary form, and then convert them to decimal as the hash value; Thus, obtain the hash values H i corresponding to the feature vectors T and S X , H Y ;
[0046] 3) Calculate the similarity size mH based on the locality-sensitive hashing algorithm i
[0047]
[0048] where: distance = bin(H X ^H Y ).count('1') is the Hamming distance formula, where, H X ^H Y represents the bitwise XOR operation of the two hash values, bin(H X ^H Y ) converts H X ^H Y to binary, and bin(H X ^H Y ).count('1') counts the number of 1s in bin(H X ^H Y ); max() represents taking the maximum value, len() represents taking the number length, bin() represents converting to binary, and count('1') represents calculating the number of 1s.
[0049] Preferably, based on all the matching graphs recommended, perform the working condition fusion reasoning and judgment steps, which specifically include:
[0050] (4-8-1) Form a matching graph library
[0051] Among all the recommended matching graphs, take the highest fusion similarity for each working condition in the matching graphs and list the top three pictures; thus, a matching graph library is formed. There are n pictures in the library, and the pictures have information on the fusion similarity between the marked working conditions and the pictures to be detected.
[0052] (4-8-2) Extract the evidence of n matching graphs
[0053] Extract the evidence of the n matching graphs in the matching graph library from the previous step. The basic probability assignment (BPA) of the i-th matching graph evidence is expressed as:
[0054]
[0055] Among them:
[0056] m i (A1) is the BPA value when the i-th matching graph proves that the picture to be detected is in working condition A1.
[0057] m i (A2) is the BPA value when the i-th matching graph proves that the picture to be detected is in working condition A2.
[0058] m i (A3) is the BPA value when the i-th matching graph proves that the picture to be detected is in working condition A3.
[0059] m i (Θ) is the BPA value when the i-th matching graph proves that the working condition of the picture to be detected is "unknown".
[0060] P i (A1) is the fusion similarity between the picture to be detected and the i-th matching graph marked with working condition A1.
[0061] P i (A2) is the fusion similarity between the picture to be detected and the i-th matching graph marked with working condition A2.
[0062] P i (A3) is the fusion similarity between the picture to be detected and the i-th matching graph marked with working condition A3.
[0063] The similarity of each working condition picture is used as the probability assignment of this picture to this working condition. Since the working condition of the picture has been calibrated, the probability assignments of the remaining working conditions of this picture must be 0.
[0064] (4-8-3) Fuse the n evidences
[0065] Fuse the basic probability assignments (BPA) of the n pictures to obtain the comprehensive probability assignment value m(A x ), and after calculation, summarize them into a set Q.
[0066] (4-8-4) Comprehensive judgment of the fusion result.
[0067] Preferably, the fusion calculation method of set Q is as follows:
[0068]
[0069] Where A j , j = 1, 2, 3 represent the working conditions of A1, A2, and A3; X i represents one of the three working conditions corresponding to A1, A2, A3 and Θ and one "unknown" situation, i = 1, 2,..., n; m i (X i ) is the BPA value of the i-th graph for the X i situation; where:
[0070]
[0071] ∩X i = X1 ∩ X2 ∩... ∩ X n
[0072]
[0073] Set Q is Q = {m(A1), m(A2), m(A3)}.
[0074] Preferably, the comprehensive judgment of the fusion result includes:
[0075] (4-8-4-1) Count the probability assignment values in Q that are greater than or equal to 0.32 and the corresponding working conditions; list these one or more working conditions as the current working conditions and arrange them according to their probability assignment values.
[0076] (4-8-4-2) Count the probability assignment values in Q that are greater than 0.28 and less than 0.32 and the corresponding working conditions; list these one or more working conditions as the current possible working conditions and arrange them according to their probability assignment values.
[0077] Beneficial effects:
[0078] 1. The entire system uses CBIR technology, matching algorithms, and fusion reasoning means to break through the limitations of traditional recognition methods. Starting from engineering practice, it can accurately identify one working condition when there is indeed only one working condition, and at the same time, it can also comprehensively judge up to three faults occurring simultaneously, which has greater practical application value.
[0079] 2. A fusion similarity calculation method is proposed. The similarities obtained based on the Pearson correlation coefficient algorithm and the local hashing algorithm are fused according to certain steps to give full play to the advantages of both, so as to obtain a more reasonable similarity between the graph to be measured and the sample graph, and finally effectively improve the recognition rate.
[0080] The similarity based on the Pearson correlation coefficient algorithm has translational invariance and scale invariance compared with other methods such as the traditional cosine distance calculation method, and can overcome the influence of image translation and scaling. It is very suitable for the situation where the overall load of the pumping unit increases due to long-term use or the displacement shifts in a certain direction as a whole, resulting in the overall shift of the dynamometer card. It can avoid to a certain extent the decrease in recognition rate caused by machine aging. This method has good stability in evaluating the overall similarity of two images, but is susceptible to light brightness, contrast, and color, and image rotation will also have a significant impact on the results. The similarity based on the local hashing algorithm, based on a similar idea of spatial domain transformation, has little impact on the hash value when the image is enlarged or reduced, the aspect ratio is changed, or the brightness, contrast, and color are increased or decreased. The locality-sensitive hashing algorithm can effectively ignore the problems brought by translation, scaling, aspect ratio change, rotation, and light in the dynamometer card. However, due to its strong local analysis ability, the locality-sensitive hashing algorithm is very sensitive to the image content, and a small content interference can easily cause a large change in the hash value of the image, resulting in insufficient stability in the overall evaluation of similarity.
[0081] 3. A working condition fusion method is proposed. Multiple similar images with working condition information can be fused through the working condition fusion method, and several working condition information evidences can be fused to achieve the function of comprehensively judging up to three faults occurring simultaneously. And this method also has the functions of traditional recognition methods through certain technical methods. When the dynamometer card to be detected actually only has one working condition information, it can also identify one working condition.
[0082] 4. The entire system has a dynamic learning function. After each recognition, the judgment result will be sent to the upper computer, and the images of multiple working conditions will be put into the matching library to upgrade and iterate the matching library. When fusing working conditions in the future, the recognition accuracy will be gradually improved, and it will be more sensitive to the occurrence of multiple working conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 The overall flowchart of the method of the present invention
[0084] Figure 2 The dynamometer card representing valve leakage of the present invention
[0085] Figure 3 The feature map of the valve leakage dynamometer card of the present invention in the avgpool layer
[0086] Figure 4 The standard dynamometer card of the piston hitting the pump during downward movement of the present invention
[0087] Figure 5 The feature map of the standard schematic diagram of the piston hitting the pump during downward movement of the present invention in the avgpool layer
[0088] Figure 6 The indicator diagram acquisition, annotation classification and training diagram of the present invention
[0089] Figure 7 The pumping working condition fusion inference and judgment diagram of the present invention based on the fusion similarity of indicator diagrams
[0090] Figure 8 The indicator diagram to be detected of the present invention
[0091] Figure 9 The feature map of the indicator diagram to be detected of the present invention in the avgpool layer
[0092] Figure 10 The comparison diagram of the sample diagram and the diagram to be detected of the present invention
[0093] Figure 11 The working condition fusion inference and judgment flow chart of the present invention Specific implementation manners
[0094] A pumping working condition fusion inference and recognition method based on the fusion similarity of indicator diagrams, combined with Figure 1 , includes the following processes:
[0095] (1) Indicator diagram acquisition, annotation classification and training.
[0096] (2) Use the trained Resnet50 to extract features from each diagram in the sample set and save the feature vectors.
[0097] Use the trained Resnet50 network to extract features from the labeled training set and save all the feature results of the avgpool layer. An example of the feature extraction process is as follows:
[0098] (2-1) Take an indicator diagram representing valve leakage, such as Figure 2 .
[0099] This indicator diagram is converted into an array with a dimension of 256×256×3.
[0100] After a series of feature extractions, save the data of the avgpool layer and visualize it as Figure 3 .
[0101] At this time, in the avgpool layer, this indicator diagram becomes an array with a dimension of 1×2048, simplifying the original 256×256×3 = 196608 features to 2048 features, and saving this set of feature vectors.
[0102] (2-2) Another example is to take an indicator diagram representing the piston moving downward and hitting the pump, such as Figure 4 .
[0103] This indicator diagram is converted into an array with a dimension of 256×256×3.
[0104] After a series of feature extractions, the data of the avgpool layer is saved and visualized as Figure 5 .
[0105] At this time, in the avgpool layer, this indicator diagram becomes an array with a dimension of 1×2048. The original 256×256×3 = 196608 features are simplified to 2048 features, and this set of feature vectors is saved.
[0106] (3) Obtain the load and displacement data collected by the indicator instrument of the pumping well to be detected, and draw an indicator diagram.
[0107] Obtain the load and displacement data collected by the indicator instrument of the pumping well to be detected, and use opencv to draw the load and displacement data into an indicator diagram to be recognized. (The method of drawing the indicator diagram is to use the displacement as the abscissa x and the load as the abscissa y, and use the polygon drawing function in opencv to draw the data into the form of an indicator diagram.)
[0108] (4) Fusion inference and judgment of pumping conditions based on the fusion similarity of indicator diagrams.
[0109] (5) Send the working condition judgment result to the upper computer for display.
[0110] In the overall process, the acquisition, annotation classification, and training of indicator diagrams mainly include the acquisition of indicator diagrams, the annotation classification of the existing indicator diagram data set, and the training of Resnet50 using the annotated indicator diagram data set, and saving the training weights. Combined with Figure 6 , the specific steps are as follows:
[0111] (1-1) Obtain the load and displacement data collected by the indicator instrument of the pumping well. Use the displacement as the abscissa x and the load as the abscissa y, and use the polygon drawing function toolkit in opencv to draw the data into an indicator diagram.
[0112] (1-2) Business experts preprocess the indicator diagrams, eliminate the indicator diagrams with obvious errors, and form an indicator diagram data set;
[0113] (1-3) Business experts annotate and classify the indicator diagrams in the indicator diagram data set, and divide the well-annotated and classified data set into a training set and a test set according to a ratio of 7:3;
[0114] (1-4) Put the training set into the Resnet50 neural network for training. Among them, the activation function is ReLu, the pooling method uses Max pooling for the input layer, and Avg pooling for the last output layer. The optimization cost function is Cross-entropy cross entropy, and the batch_size is 16.
[0115] After the training is completed, save the weights of the trained Resnet50.
[0116] Combined with Figure 7 , the fusion inference judgment of the pumping unit working conditions based on the similarity of the indicator diagram fusion in the overall process specifically includes:
[0117] (4-1) Use Resnet50 to extract the features of the indicator diagram to be detected
[0118] Put the incoming indicator diagram to be detected (as Figure 8 shown) into the trained Resnet50, and extract the feature vector T = [t1, t2,..., t 2048 (as Figure 9 shown) in the avgpool layer of the diagram to be detected.
[0119] (4-2) Retrieve the feature vector S of the i-th diagram in the sample set i = [si1, si2,... si 2048 , 0 < i ≤ n, where n is the number of sample diagrams in the sample set.
[0120] (4-3) The comparison between the diagram to be detected and the sample diagram is as Figure 10 shown. Calculate the similarity between the diagram to be detected and the i-th diagram in the sample set based on the Pearson correlation coefficient algorithm and the locality-sensitive hashing algorithm respectively. Given that the feature vectors of the diagram to be detected and the i-th diagram in the sample set are: T = [t1, t2,..., t 2048 , S i = [si1, si2,... si 2048 .
[0121] (4-3-1) Pearson correlation coefficient algorithm (Pearson)
[0122] Calculate the similarity mP between the feature vectors of the diagram to be detected and the i-th diagram in the sample set based on the Pearson correlation coefficient algorithm i as:
[0123]
[0124] where cov is the covariance, is the vector average.
[0125] Generally, the Pearson correlation coefficient algorithm judges the correlation strength of variables through the following value range:
[0126] Table 1 Correlation relationship corresponding to the correlation coefficient of the Pearson correlation coefficient algorithm
[0127]
[0128]
[0129] Use Figure 4 Taking the two figures of the standard schematic diagram of the piston hitting the pump when moving downward and Figure 8 the figure to be detected as examples, Figure 4 The eigenvector is S1 = [0.14989834, 0.25044987, 0.01442009,..., 0.04498396, 0....0.13138881], Figure 8 The eigenvector T = [0.14860852, 0.35052535, 0.04173719...0.03383199, 0....0.14634456].
[0130] The correlation coefficient using the Pearson correlation coefficient algorithm:
[0131]
[0132]
[0133]
[0134]
[0135]
[0136] The Pearson correlation coefficient mP i is 0.9595958626455949.
[0137] (4-3-2) Locality-Sensitive Hashing (LSH)
[0138] The process of the locality-sensitive hashing algorithm is to convert the eigenvectors of two pictures into hash values, and then use the Hamming distance to judge the similarity. The specific processing steps are as follows:
[0139] 1) First, calculate the average values avg in the eigenvectors T and S i after feature extraction respectively, and discard the decimals of avg;
[0140] 2) Compare the eigenvectors T and S i with the average value avg. If it is less than avg, take 0, otherwise take 1; write the numbers from right to left from the updated eigenvector in binary form, and then convert it to decimal as the hash value; thus obtain the hash values H i corresponding to the eigenvectors T and S X H Y ;
[0141] Example of calculating hash value:
[0142] ① Take a 1x9 feature vector as an example. The feature vector is:
[0143] [247, 251, 249, 246, 250, 248, 254, 255, 255]
[0144] ② Calculate the average value avg of this feature vector:
[0145] avg = (247 + 251 + 249 + 246 + 250 + 248 + 254 + 255 + 255) / 9 = 250 (discard the decimal part)
[0146] ③ If the number in the feature vector is less than the average value, take 0; otherwise, take 1. The feature vector is updated to
[0147] [0, 1, 0, 0, 1, 0, 1, 1, 1]
[0148] ④ Write the feature vector from right to left as binary 111010010. The decimal value of binary 111010010 is 450
[0149] ⑤ The hash value is 450
[0150] 3) Calculate the similarity size mH based on the locality - sensitive hashing algorithm i
[0151]
[0152] where: distance = bin(H X ^H Y ).count('1') is the Hamming distance formula. Here, H X ^H Y represents the bitwise XOR operation of two hash values. bin(H X ^H Y ) converts H X ^H Y to binary. bin(H X ^H Y ).count('1') counts the number of 1s in bin(H X ^H Y ). max() represents taking the maximum value, len() represents taking the number length, bin() represents converting to binary, and count('1') represents calculating the number of 1s.
[0153] Continue to use Figure 4 the standard schematic diagram of the piston moving downward and hitting the pump and Figure 8 the two pictures to be detected as examples.
[0154] The similarity calculation is as follows:
[0155] Figure 4 The local hash value of 134907394872231459307921595053165966727638211850364403603817576411392320731173461515081931003824103848610395831696351907040851782228041860994642167480938160500881936760088328367755998578385056681263307472397144928353884295331378643730737444091359742116256489605880085183816832815426175848776508902642861101099718331667626993756088571910678548165049562655531040347315192365147004731519463191348029938325536398024923807910995856106628030724706982857657002928153864864676392486921999246267706746163086495545981910815108924723659871375564789477016296800409881711195186298617086596686860594133790662039913834971001258192
[0157] Figure 8 The local hash value of 134909336164677193315098704209033677690447002363625012226134058236907706682825938415330440596553877599573069588765898273219928634772258857712335020535886748323100840672670136928410227415944070798320660373464007207826192880682399295486352378417213368941249609392065322087900294454823171257989969080404957097945954668382504147265751628834405361978471569048472747634698092774719229568280672280314028714700120426807933140494888691468045948960439442940733676982095422331829668218501885620193652448187157640888011104851164295253464255310988804922158495010276988600247673701019379376880658833265386067561510743278490222832
[0159] The similarity mH after local hashing calculation for the two figures i is 0.9084679393049437.
[0160] (4-4) Calculate the similarity mP between the dynamometer diagram to be measured and the i-th diagram in the sample set based on two algorithms respectively i and mH i After obtaining the magnitudes of the two similarities, fuse the two similarities to obtain the fused similarity P between the diagram to be measured and the i-th matching diagram marked with the X condition i (X), X = a1, a2... a k a k (a is one of all the conditions in the sample set), and the specific fusion method is as follows:
[0161] P i (X) = mP i × mH i + mP i (1 - mHi ) + mH i (1 - mP i )
[0162] where mP i is the similarity value based on the Pearson algorithm; mH i is the similarity value based on the sensitive hashing algorithm.
[0163] Example: Use mP of (4 - 3 - 1) and (4 - 3 - 2) i and mH i Continue with an example, as shown in Table 2:
[0164] Table 2 Table form of mPi and mHi
[0165] mPi mHi 0.96 0.91
[0166] Based on the data in the table, it can be solved:
[0167] P i (X) = 0.96 * 0.91 + 0.96 * 0.09 + 0.91 * 0.04 = 0.9964
[0168] So, the fused similarity P i (X) is 0.9964
[0169] (4 - 5) Compare P i (X) with the pre - set similarity threshold Ps,
[0170] (4 - 5 - 1) If P i (X) > Ps, store this figure in the preliminary recommended picture library and proceed to the next step;
[0171] (4 - 5 - 2) If P i (X) > Ps, skip this matching picture and proceed to the next step;
[0172] (4 - 6) Determine whether all sample pictures in the database have been compared
[0173] (4 - 6 - 1) If not all have been calculated, take the next sample picture to compare with the picture to be tested, then return to step 2 and repeat the loop;
[0174] (4 - 6 - 2) If all have been calculated, enter the next link;
[0175] (4 - 7) Determine whether there are similar matching photos
[0176] (4 - 7 - 1) If there are recommended matching photos, list all the recommended matching pictures and move to the next step;
[0177] (4-7-2) If there are no recommended matching photos, the system prompts that there are no matching photos. In this case, only process experts can be relied on to judge the classification, and after marking, it is put into the training set for the next round of training to update the Resnet neural network.
[0178] (4-8) Based on all the recommended matching graphs, perform working condition fusion inference and judgment.
[0179] (4-9) Output the judgment result of the current working condition state.
[0180] Combined with Figure 11 , based on all the pictures in the preliminary recommended picture library, the specific process of performing working condition fusion inference and judgment is as follows:
[0181] (4-8-1) Form a matching picture library
[0182] Among all the matching graphs in the preliminary recommended picture library, take the highest fusion similarity of each working condition in the matching graphs and list the top three pictures. Thus, a matching picture library is formed. There are n pictures in the library, and the pictures have information on the fusion similarity between the marked working conditions and the pictures to be detected.
[0183] (4-8-2) Extract the evidence of n matching graphs
[0184] Extract the evidence of the n matching graphs in the matching picture library from the previous step. The basic probability assignment (BPA) of the i-th matching graph evidence is expressed as:
[0185]
[0186] Where:
[0187] m i (A1) is the BPA value when the i-th matching graph proves that the graph to be detected is in working condition A1,
[0188] m i (A2) is the BPA value when the i-th matching graph proves that the graph to be detected is in working condition A2,
[0189] m i (A3) is the BPA value when the i-th matching graph proves that the graph to be detected is in working condition A3,
[0190] m i (Θ) is the BPA value when the i-th matching graph proves that the working condition of the graph to be detected is "unknown".
[0191] P i (A1) is the fusion similarity between the graph to be detected and the i-th matching graph marked as working condition A1,
[0192] P i (A2) is the fusion similarity between the graph to be detected and the i-th matching graph marked as working condition A2,
[0193] P i (A3) is the fusion similarity between the test graph and the i-th matching graph marked with the A3 working condition.
[0194] The similarity of each working condition picture is used as the probability assignment of this picture to this working condition. Since the picture working condition has been calibrated, the probability assignment of the remaining working conditions of this picture must be 0.
[0195] Illustrate with examples:
[0196] Example 1: Now the first picture is of the A1 working condition, and the fusion similarity between the test difficult graph and the first picture is P1(A1). Then the basic probability assignment (BPA) of the i-th matching graph is expressed as the probability assignment m1(A1) of the first picture to the A1 working condition being P1(A1), and the probability assignments to other working conditions are 0, denoted as In tabular form as shown in Table 3.
[0197] Table 3 Tabular form
[0198]
[0199] Example 2: After the second screening, there are five pictures. The similarity between the first picture and the A1 working condition is P1(A1), the similarity between the second picture and the A2 working condition is P2(A2), the similarity between the third picture and the A1 working condition is P3(A1), the similarity between the fourth picture and the A2 working condition is P4(A2), and the similarity between the fifth picture and the A3 working condition is P5(A3). Then the basic probability assignments (BPA) of these five matching graphs are respectively expressed as
[0200]
[0201]
[0202] In tabular form as shown in Table 4.
[0203] Table 4 of the tabular form
[0204]
[0205] (4 - 8 - 3) Fuse n evidences
[0206] Perform evidence fusion on the basic probability assignments (BPA) of n graphs to obtain the comprehensive probability assignment value m(A j ), and after calculation, summarize them into a set Q. The specific fusion calculation method is as follows:
[0207]
[0208] Among them, A j , j = 1, 2, 3 represent the working conditions of A1, A2, and A3; X i represents one of the three working conditions of A1, A2, A3 and Θ and one "unknown" situation, i = 1, 2,..., n; m i (X i ) is the BPA value of the i-th figure for the X i situation; where:
[0209]
[0210] ∩X i = X1 ∩ X2 ∩... ∩ X n
[0211]
[0212] After assigning values by way of example to Table 4, it is shown in Table 5 as follows:
[0213] Table 5 Table form after value assignment
[0214]
[0215] 1). The probability assignment values after fusing the working conditions A1, A2, and A3 in Table 5 are:
[0216] ① For the working condition A1, the comprehensive probability assignment value of tubing leakage is:
[0217]
[0218] m(A1) = [m1(A1) * m2(Θ) * m3(A1) * m4(Θ) * m5(Θ) + m1(A1) * m2(Θ) * m3(Θ) * m4(Θ) * m5(Θ) + m1(Θ) * m2(Θ) * m3(A1) * m4(Θ) * m5(Θ)] / K = 0.0329 / 0.06005 = 0.5478
[0219] ② For the working condition A2, the comprehensive probability assignment value of sucker rod breakage is:
[0220]
[0221] m(A2) = [m1(Θ) * m2(A2) * m3(Θ) * m4(A2) * m5(Θ) + m1(Θ) * m2(A2) * m3(Θ) * m4(Θ) * m5(Θ) + m1(Θ) * m2(Θ) * m3(Θ) * m4(A2) * m5(Θ)] / K = 0.0219 / 0.06005 = 0.3647
[0222] ③Under condition A3, the comprehensive probability distribution value of heavy oil is:
[0223]
[0224] m(A3) = m1(Θ) * m2(Θ) * m3(Θ) * m4(Θ) * m5(A3) / K = 0.0525
[0225] 2). Among them, the coefficient K in Table 5 is:
[0226]
[0227] K = m1(A1) * m2(Θ) * m3(A1) * m4(Θ) * m5(Θ) + m1(A1) * m2(Θ) * m3(Θ) * m4(Θ) * m5(Θ) + m1(Θ) * m2(A2) * m3(Θ) * m4(A2) * m5(Θ) + m1(Θ) * m2(A2) * m3(Θ) * m4(Θ) * m5(Θ) + m1(Θ) * m2(Θ) * m3(A1) * m4(Θ) * m5(Θ) + m1(Θ) * m2(Θ) * m3(Θ) * m4(A2) * m5(Θ) + m1(Θ) * m2(Θ) * m3(Θ) * m4(Θ) * m5(A3) + m1(Θ) m2 (Θ) * m3(Θ) * m4(Θ) * m5(Θ) = 0.06005
[0228] 3). The set Q is Q = {m(A1), m(A2), m(A3)} = {0.5478, 0.3647, 0.0525}
[0229] (4 - 8 - 4) Comprehensive judgment of fusion result
[0230] (4 - 8 - 4 - 1) Statistically analyze the probability distribution values in Q that are greater than or equal to 0.32 and the corresponding working conditions; list these one or more working conditions as the current working conditions and arrange them according to their probability distribution values.
[0231] (4 - 8 - 4 - 2) Statistically analyze the probability distribution values in Q that are greater than 0.28 and less than 0.32 and the corresponding working conditions; list these one or more working conditions as the current possible working conditions and arrange them according to their probability distribution values.
[0232] For example, according to step (4 - 8 - 3), the set of comprehensive probability distribution values is Q = {0.5478, 0.3647, 0.0525}.
[0233] 1) After statistical analysis of the probability distribution values greater than or equal to 0.32, there are 0.5478 and 0.3647. The working conditions corresponding to these two probability distribution values are tubing leakage and sucker rod breakage. Therefore, the comprehensive working condition is tubing leakage and sucker rod breakage.
[0234] 2) After statistically analyzing the probability distribution values greater than 0.28 and less than 0.32, there is no data in the set that meets the requirements of this step, so there are no other possible working conditions.
[0235] For example, after processing according to the fusion result of step (4-8-4), the comprehensive working conditions are tubing leakage and sucker rod breakage, and there are no other possible working conditions.
Claims
1. A fusion inference recognition method for pumping unit working conditions based on the fusion similarity of indicator diagrams, characterized in that It includes the following processes: (1) Acquisition, labeling, classification and training of dynamometer diagrams; (2) Use the trained Resnet50 to extract features from each image in the sample set and save the feature vector; (3) Obtaining load and displacement data collected by the dynamometer of the pumping well to be tested and drawing a dynamometer diagram; (4) Fusion reasoning and judgment of pumping conditions based on fusion similarity of indicator diagrams; specifically including: (4-1) Use Resnet50 to extract the features of the dynamometer diagram to be tested Put the incoming dynamometer card to be detected into the trained Resnet50, and extract the feature vector T = [t1, t2,..., t 2048 of the graph to be measured at the avgpool layer; (4-2) Retrieve the feature vector S of the i-th image in the sample set i = [si1, si2,... si 2048 , 0 < i ≤ n, where n is the number of sample images in the sample set; (4-3) Calculate the similarity between the image to be detected and the i-th image in the sample set based on the Pearson correlation coefficient algorithm and the local sensitive hashing algorithm respectively; (4-4) Calculate the similarities mP i and mH i between the measured indicator diagram and the i-th diagram in the sample set respectively. After obtaining their magnitudes, fuse the two similarities to get the fused similarity P i (X) of the measured diagram and the i-th matching diagram marked with working condition X, where X = a1, a2... a k , a k is one of all the working conditions in the sample set. The specific fusion method is as follows: P i (X) = mP i × mH i + mP i (1 - mH i ) + mH i (1 - mP i ) where mP i is the similarity value based on the Pearson algorithm; mH i is the similarity value based on the sensitive hashing algorithm; (4 - 5)P i (X) is compared with a pre - set similarity threshold Ps. (4-5-1) If P i (X) > Ps, store this figure in the preliminary recommendation library and proceed to the next step; (4-5-2) If P i (X) ≤ Ps, skip this matched picture and proceed to the next step; (4-6) Determine whether all sample images in the database have been compared (4-6-1) If all calculations are not completed, take the next sample image and compare it with the image to be tested, then return to step (4-2) and repeat the cycle; (4-6-2) After all calculations are completed, proceed to the next step; (4-7) Determine whether there are similar matching photos (4-7-1) If there are recommended matching photos, then list all recommended matching pictures and go to the next step; (4-7-2) If there are no recommended matching photos, the system will prompt that there are no matching photos. The only way is to rely on the process experts to judge the classification, annotate them, and put them into the training set for the next round of training to update the Resnet neural network; (4-8) Based on all the recommended matching graphs, perform working condition fusion reasoning and judgment; (4-9) Output the judgment result of the current working condition; (5) Send the working condition judgment results to the upper level for display.
2. The method according to claim 1, wherein The steps of acquiring, labeling and classifying the dynamometer diagram and training include acquiring the dynamometer diagram, labeling and classifying the existing dynamometer diagram data set, training Resnet50 using the labeled dynamometer diagram data set, and saving the training weights; The specific steps are: (1-1) Obtain the load and displacement data collected by the dynamometer of the pumping well, use the displacement as the horizontal coordinate x and the load as the vertical coordinate y, and use the polygon drawing function toolkit in opencv to draw the data into a dynamometer diagram; (1-2) Business experts pre-process the dynamometer diagrams, remove the dynamometer diagrams with obvious errors, and form a dynamometer diagram data set; (1-3) Business experts annotate and classify the dynamometer diagrams in the dynamometer diagram dataset and divide the annotated and classified dataset into a training set and a test set in a ratio of 7:3; (1-4) Put the training set into the Resnet50 neural network for training; the activation function is ReLu, the pooling method input layer uses Max pooling, the final output layer uses Avg pooling, the optimization cost function is Cross-entropy cross entropy, and the batch_size is 16; (1-5) After the training is completed, save the trained Resnet50 weights.
3. The method according to claim 1, characterized in that The feature vectors of the to-be-detected graph and the i-th graph in the sample set are respectively: T = [t1, t2,..., t 2048 , S i = [si1, si2,... si 2048 . The specific steps for calculating the similarity between the to-be-detected graph and the i-th graph in the sample set are as follows: Calculate the similarity mP between the feature vectors of the graph to be detected and the i-th graph in the sample set based on the Pearson correlation coefficient algorithm i as follows: where cov is the covariance, is the vector mean; Calculate the similarity mH between the feature vectors of the graph to be detected and the i-th graph in the sample set based on the locality-sensitive hashing algorithm i The specific steps are as follows: 1) First, calculate the average values avg of the feature vectors T and S after feature extraction respectively, and discard the decimals of avg; i 2) The feature vectors T and S i By comparing with the average value avg, if it is less than avg, it is 0, otherwise it is 1; take numbers from right to left from the updated feature vector and write them in binary form, and then convert them to decimal as the hash value; thus, the feature vectors T and S are obtained i The corresponding hash value H X , H Y ; 3) Calculate the similarity size mH based on the locality-sensitive hashing algorithm i where: distance = bin(H X ^H Y ).count('1') is the Hamming distance formula, where H X ^H Y means performing an exclusive OR bit operation on two hash values, bin(H X ^H Y ) converts H X ^H Y to binary, and bin(H X ^H Y ).count('1') counts the number of 1s in bin(H X ^H Y ); max() means taking the maximum value, len() means taking the number length, bin() means converting to binary, and count('1') means calculating the number of 1s.
4. The method according to claim 1, wherein Based on all the recommended matching graphs, the working condition fusion reasoning and judgment steps are carried out, including: (4-8-1) Forming a matching library Among all the recommended matching diagrams, take the highest fusion similarity for each working condition in the matching diagrams and list the top three pictures; thus, a matching diagram library is formed. There are n pictures in the library, and the pictures have information on the fusion similarity between the marked working conditions and the pictures to be detected. (4-8-2) Extract the evidence of n matching diagrams Extract the evidence of the n matching diagrams in the matching diagram library in the previous step. The basic probability assignment (BPA) of the i-th matching diagram evidence is expressed as: Where: m i (A1) Prove the BPA value of the test graph when the test graph is in A1 condition for the i-th matching graph. m i (A2) Prove the BPA value of the to-be-tested graph when the to-be-tested graph is in the A2 working condition for the i-th matching graph. m i (A3) Prove the BPA value of the to-be-tested graph when it is in A3 working condition for the i-th matching graph. m i (Θ) is the BPA value when the working condition of the test graph is proved to be "unknown" for the i-th matching graph; P i (A1) is the fusion similarity between the graph to be measured and the i-th matching graph marked with the A1 working condition. P i (A2) is the fusion similarity between the graph to be measured and the i-th matching graph marked with the A2 working condition. P i (A3) is the fusion similarity between the to-be-tested graph and the i-th matching graph marked with the A3 working condition; The similarity of each working condition picture is used as the probability assignment of this picture to this working condition. Since the working condition of the picture has been calibrated, the probability assignment of the remaining working conditions of this picture must be 0. (4-8-3) Fuse the n pieces of evidence Perform evidence fusion on the basic probability assignment (BPA) of n graphs to obtain the comprehensive probability assignment value m(A x ) for each working condition after fusion. After the calculation, summarize them into a set Q; (4-8-4) Comprehensive judgment of the fusion result.
5. The method according to claim 4, wherein The fusion calculation method for set Q is: where A j , j = 1, 2, 3 represent the working conditions of A1, A2, and A3; X i represents one of the three working conditions corresponding to A1, A2, A3 and Θ and one "unknown" situation, i = 1, 2,..., n; m i (X i ) is the BPA value of the i-th graph for the X i situation; where: ∩X i = X1 ∩ X2 ∩... ∩ X n Set Q is Q = {m(A1), m(A2), m(A3)}.
6. The method according to claim 5, wherein The comprehensive judgment of the fusion result includes: (4-8-4-1) Count the probability assignment values in Q that are greater than or equal to 0.32 and the corresponding working conditions; list these one or more working conditions as the current working conditions and arrange them according to their probability assignment values. (4-8-4-2) Count the probability assignment values in Q that are greater than 0.28 and less than 0.32 and the corresponding working conditions; list these one or more working conditions as the current possible working conditions and arrange them according to their probability assignment values.
Citation Information
Patent Citations
Indicator diagram similarity detection method fusing dichotomy and triad
CN112836719A
Oil well indicator diagram displacement measurement method and device based on deep learning
CN113947622A