Flowmeter centering clamping device electrical fault diagnosis method and system

Through the combination of principal component analysis and isolated forest model, the electrical faults of the flowmeter clamping device are automatically diagnosed, solving the problems of fault discovery lag and safety risks in the prior art, and achieving rapid and accurate fault identification and improvement of equipment stability.

CN120448795APending Publication Date: 2025-08-08PIPECHINA SOUTH CHINA CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510512670.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, the electrical fault diagnosis of the central clamping device of the flowmeter relies on manual inspection, and there are lags in fault discovery, limited diagnostic accuracy and safety risks, and the electrical fault cannot be quickly and accurately identified, which affects the metering accuracy and equipment safety of the flowmeter.

Method used

Using a combination of principal component analysis and isolated forest model, the target data of the central clamping device is pre-processed by obtaining the flowmeter, sampling of sliding time windows, extraction of dimensionality reduction feature and isolated forest analysis, to achieve automatic diagnosis of electrical faults.

Benefits of technology

It improves the speed and accuracy of electrical fault diagnosis, reduces maintenance time, improves the operating stability and safety of the flowmeter centering clamping device, and reduces the risk of manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448795A_ABST
    Figure CN120448795A_ABST
Patent Text Reader

Abstract

The invention discloses an electrical fault diagnosis method and system for a flowmeter centering clamping device. The method comprises the steps that target data of the flowmeter centering clamping device during working are obtained, and the target data are preprocessed; sampling the preprocessed target data based on a sliding time window, and constructing a time sequence sample; inputting the time sequence sample into a principal component analysis model for dimension reduction processing and feature extraction, and determining a target feature and a target feature value; and inputting the target features and the target feature values into an isolated forest model for fault analysis so as to carry out electrical fault diagnosis on the flowmeter centering clamping device. According to the scheme, electrical fault diagnosis is carried out on the flowmeter centering clamping device in a mode of combining principal component analysis and isolated forest, the diagnosis speed and accuracy of the electrical fault of the flowmeter centering clamping device are improved, the maintenance time is shortened, and the operation stability and safety of the flowmeter centering clamping device are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of industrial equipment fault diagnosis, and in particular to a method and system for diagnosing electrical faults of a flow meter centering and clamping device. Background Art

[0002] Oil and gas flowmeters play a key role in the oil and gas industry, with their primary function being to accurately measure and monitor the flow of oil and gas media. The flowmeter's centering clamp plays an indispensable role in the installation, calibration, and positioning and securing of oil and gas flowmeters during use. However, due to the complex environment, it often faces various faults during operation. Electrical faults, in particular, can cause the centering clamp to malfunction, resulting in the flowmeter shifting, loosening, or becoming unable to secure, directly affecting the metering accuracy of the flowmeter; this in turn can cause production data errors and impact the stability of the production process. Furthermore, if electrical faults in the centering clamp are not promptly addressed, the equipment may not function properly, forcing system shutdown, causing production interruptions, and even sparks or overheating, leading to major safety incidents such as explosions and fires.

[0003] Currently, electrical fault diagnosis for flowmeter centering and clamping devices is still primarily done manually, relying on operator experience and on-site inspections. This approach has significant drawbacks: first, fault detection is often delayed, often missing the optimal maintenance opportunity; second, diagnostic accuracy is limited by operator skill and can be highly subjective; and third, manual diagnosis poses significant safety risks in complex operating conditions and high-risk environments.

[0004] Therefore, how to quickly and accurately diagnose electrical faults is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0005] The present invention provides a flowmeter centering clamping device electrical fault diagnosis method and system to solve the fault hysteresis and safety risks of relying on operators for detection in the prior art, and to improve the diagnosis speed and accuracy of the flowmeter centering clamping device electrical fault.

[0006] According to one aspect of the present invention, a method for diagnosing electrical faults of a flowmeter centering clamping device is provided, wherein the method comprises:

[0007] Obtaining target data of the flowmeter centering and clamping device when it is in operation, and preprocessing the target data; wherein the flowmeter centering and clamping device is used to position and clamp the flowmeter during the oil and gas flow detection process, and the target data includes any one of voltage data and current data;

[0008] Sample the preprocessed target data based on the sliding time window and construct a time series sample;

[0009] Inputting the time series samples into a principal component analysis model for dimensionality reduction and feature extraction, and determining target features and target feature values;

[0010] The target features and target feature values are input into an isolation forest model for fault analysis, so as to perform electrical fault diagnosis on the flow meter centering clamping device.

[0011] According to another aspect of the present invention, a flowmeter centering clamping device electrical fault diagnosis system is provided, characterized in that the system includes an interface module, a transmission module, a central controller, a fault display module and a power supply module; wherein:

[0012] The interface module is used to collect and transfer target data of the flow meter centering clamping device;

[0013] The transmission module is used to receive the target data transmitted by the interface module and transmit the target data to the central controller;

[0014] The central controller is used to perform data preprocessing, data storage, data diagnosis and data transmission on the target data;

[0015] The fault display module is used to issue a fault alarm to any module in the electrical fault diagnosis system of the flow meter centering and clamping device;

[0016] The power supply module is used to supply power to any module in the electrical fault diagnosis system of the flow meter centering and clamping device.

[0017] The technical solution of the embodiment of the present invention obtains the target data of the flowmeter centering clamping device during operation and preprocesses the target data; samples the preprocessed target data based on a sliding time window and constructs a time series sample; inputs the time series sample into a principal component analysis model for dimensionality reduction and feature extraction, and determines the target features and target feature values; and inputs the target features and target feature values into an isolation forest model for fault analysis to diagnose electrical faults in the flowmeter centering clamping device. This solves the fault hysteresis and safety risk problems of the prior art that rely on operator detection, and achieves the beneficial effects of improving the diagnostic speed and accuracy of electrical faults in the flowmeter centering clamping device, reducing maintenance time, and further improving the stability and safety of the flowmeter centering clamping device.

[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 1 is a flow chart of a method for diagnosing electrical faults of a flow meter centering and clamping device according to a first embodiment of the present invention;

[0021] Figure 2 This is a schematic diagram of a process for constructing a time series sample based on a sliding time window according to the first embodiment of the present invention;

[0022] Figure 3 1 is a flow chart of a method for diagnosing electrical faults of a flow meter centering and clamping device according to a second embodiment of the present invention;

[0023] Figure 4 1 is a flow chart of another method for diagnosing electrical faults of a flow meter centering and clamping device according to a second embodiment of the present invention;

[0024] Figure 5 1 is a schematic diagram of a process for feature extraction based on principal component analysis according to the second embodiment of the present invention;

[0025] Figure 6 This is a schematic diagram of a process for fault diagnosis based on an isolation forest model according to the second embodiment of the present invention;

[0026] Figure 7 This is a schematic diagram of classification results when applied to test group six according to embodiment two of the present invention;

[0027] Figure 8 2 is a schematic structural diagram of an electrical fault diagnosis system for a flow meter centering and clamping device according to a third embodiment of the present invention;

[0028] Figure 9 1 is a structural diagram of another flowmeter centering and clamping device electrical fault diagnosis system provided according to the third embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0030] Among them, the acquisition, storage, use and processing of data in the technical solution of this application are in compliance with the relevant provisions of laws and regulations. It should be noted that the terms "first", "second", "target", "original", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Example 1

[0032] Figure 1 A flow chart of a flow meter centering clamping device electrical fault diagnosis method is provided for the first embodiment of the present invention. This embodiment is applicable to the case where the flow meter centering clamping device is used to monitor the oil and gas flow and the electrical fault diagnosis of the flow meter centering clamping device is performed. The method can be executed by a flow meter centering clamping device electrical fault diagnosis system. The flow meter centering clamping device electrical fault diagnosis system can be implemented in the form of hardware and / or software. The flow meter centering clamping device electrical fault diagnosis system can be configured in any electronic device with network communication function. Figure 1 As shown, the method includes:

[0033] S110 , obtaining target data of the flow meter centering clamping device when it is working, and preprocessing the target data.

[0034] Oil and gas flowmeters play a key role in the oil and gas industry. Their primary function is to accurately measure and monitor the flow of oil and gas media. They are not only a crucial tool for optimizing production and safeguarding economic benefits, but also a core device for precise measurement and scientific management. They are widely used in oil and gas production, transportation, storage, and trade transfer. Oil and gas flowmeters require calibration before use to ensure their metering accuracy. Traditional manual centering and clamping methods are not only time-consuming and labor-intensive, but can also lead to calibration errors and even damage to the equipment due to centering deviations or loose clamping. A centering clamping device uses a mechanical or automated system to precisely align the flowmeter with a standard device, ensuring that the flowmeter remains correctly positioned during calibration, thereby improving the reliability of measurement data. Furthermore, this design significantly simplifies the operational process, reduces errors caused by manual intervention, improves calibration efficiency, and mitigates potential safety hazards during equipment installation. Therefore, a centering clamping device is an indispensable key technology for flowmeter calibration, meeting the requirements of modern metering management for efficiency, accuracy, and safety. Therefore, embodiments of the present invention provide a flowmeter centering clamping device.

[0035] Among them, the flow meter centering and clamping device is used to position and clamp the flow meter during the oil and gas flow detection process; the flow meter centering and clamping device can effectively improve the work efficiency of oil and gas flow detection, ensure measurement accuracy, and reduce the work intensity of operators.

[0036] An electrical fault in the flowmeter centering clamp refers to an event in which abnormal current, voltage, or power flow occurs within the flowmeter centering clamp. These faults can lead to circuit shorts, equipment failures, voltage fluctuations, or power outages. Embodiments of the present invention diagnose electrical faults in the flowmeter centering clamp by acquiring target data from the flowmeter centering clamp during operation. The target data may refer to data from the flowmeter centering clamp during operation, including but not limited to voltage data and current data. For example, the voltage data includes three-phase voltage data: U, V, and W.

[0037] Preprocessing refers to the process of processing the acquired target data to address issues such as missing data, data redundancy, data inconsistency, and data anomalies. Preprocessing the acquired target data can effectively improve the characteristics of the target data, making it easier to process the target data later.

[0038] S120: Sampling the preprocessed target data based on the sliding time window and constructing a time series sample.

[0039] The sliding time window can refer to an algorithm used to track and control traffic and process time series data. It does not have a fixed start and end point for the time window. Instead, it uses the arrival time of each request as the end point of the statistical time window, and the start point is the time point at which the end point is pushed forward by the length of the time window. This time window can slide continuously, thereby enabling dynamic monitoring and management of traffic or data. In the embodiments of the present invention, a sliding time window is used to sample preprocessed target data, avoiding omission of preprocessed target data and enabling dynamic monitoring of the preprocessed target data.

[0040] A time series sample may refer to a sample composed of a data sequence that is arranged in chronological order, changes over time, and is interrelated. In the embodiment of the present invention, the pre-processed target data is sampled through a sliding time window to construct a time series sample.

[0041] Taking the target data as the three-phase voltage data of U, V, and W as an example, a sliding time window is used to sample the three-phase voltage data of U, V, and W in parallel and construct a time series sample. Figure 2 The U, V, and W three-phase voltage data are sampled in parallel using a sliding time window of (100, 1) with a step size of 100 and a duration of 1 second. The constructed time series sample can be obtained by arranging and concatenating the parallel sampled U, V, and W three-phase voltage data in chronological order.

[0042] The embodiment of the present invention adopts a time series sample construction method based on a sliding time window, which greatly reduces the amount of data required for calculation while ensuring the calculation time requirement, and improves the speed of electrical fault diagnosis of the flow meter centering clamping device.

[0043] S130: Input the time series samples into a principal component analysis model to perform dimensionality reduction and feature extraction, and determine target features and target feature values.

[0044] The principal component analysis (PCA) model is a commonly used data dimensionality reduction technique and statistical analysis method. It calculates the covariance matrix of the original data and then performs operations such as eigenvalue decomposition or singular value decomposition to solve the eigenvalues and eigenvectors of the covariance matrix. The eigenvectors corresponding to the eigenvalues with larger variance are selected as the principal components, and the high-dimensional data set is projected onto a low-dimensional subspace to achieve data dimensionality reduction.

[0045] The embodiment of the present invention inputs the time series samples into the principal component analysis model, reduces the high-dimensional data to a low-dimensional space while minimizing the information loss of the target data, performs feature extraction and dimensionality reduction processing on the acquired target data, and determines the target features and target feature values after dimensionality reduction.

[0046] S140: Input the target feature and the target feature value into an isolation forest model for fault analysis, so as to diagnose electrical faults of the flow meter centering clamping device.

[0047] Isolation Forest (iForest) refers to a rapid anomaly detection method based on isolation trees. Abnormal samples are typically "sparse and unique," meaning they are few in number, sparsely distributed, and significantly different from normal samples, making them more easily isolated. In the embodiments of the present invention, the reduced target features and their values are input into the isolation forest model. By randomly partitioning the data space, the sparsely distributed abnormal feature points require fewer cuts to isolate, resulting in a shorter path length, thereby confirming an electrical fault in the flowmeter's centering clamping device.

[0048] For example, in an embodiment of the present invention, taking the acquisition of U, V, and W three-phase voltage data as an example, when an electrical fault occurs in the flow meter centering clamping device, the U, V, and W three-phase voltage data will fluctuate. After the target features and target feature values of the U, V, and W three-phase voltage data are input into the isolation forest model, when feature data with sparse distribution, short path length, and small number appear, it can be determined that an electrical fault occurs in the flow meter centering clamping device.

[0049] An embodiment of the present invention provides a method for diagnosing electrical faults of a flowmeter centering clamping device, which obtains target data of the flowmeter centering clamping device during operation and preprocesses the target data; samples the preprocessed target data based on a sliding time window and constructs a time series sample; inputs the time series sample into a principal component analysis model for dimensionality reduction and feature extraction, and determines target features and target feature values; inputs the target features and target feature values into an isolation forest model for fault analysis, so as to diagnose electrical faults of the flowmeter centering clamping device. By adopting the technical solution of the embodiment of the present invention, a combination of principal component analysis and isolation forest is used to diagnose electrical faults of the flowmeter centering clamping device, thereby improving the diagnostic speed and accuracy of electrical faults of the flowmeter centering clamping device, reducing maintenance time, and further improving the stability and safety of the operation of the flowmeter centering clamping device.

[0050] Example 2

[0051] Figure 3This is a flow chart of a method for diagnosing electrical faults in a flow meter centering clamping device provided by the second embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment. The embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 3 As shown, the method includes:

[0052] S310: Acquire target data of the flowmeter centering clamping device when it is working, and pre-process the target data.

[0053] Among them, the embodiment of the present invention takes the target data to be acquired as U, V, and W three-phase voltage data as an example. When a flow meter is used to measure and monitor the oil and gas flow, a flow meter centering clamping device is required to achieve precise alignment between the flow meter and the liquid pipeline to ensure that the flow meter is always in the correct position during the measurement and monitoring process. The liquid pipeline refers to a pipeline through which the oil and gas medium flows, and at least two flow meters and a flow meter centering clamping device are arranged on the liquid pipeline, so as to use the at least two flow meters to measure and monitor the oil and gas flow flowing through the liquid pipeline, and at the same time use the at least two flow meters centering clamping devices to diagnose electrical faults of the flow meters. When diagnosing the electrical fault of any flow meter centering clamping device, the U, V, and W three-phase voltage data of the flow meter centering clamping device when it is working is obtained and preprocessed.

[0054] As an optional but non-limiting implementation, the acquisition of target data of the flow meter centering clamping device during operation and pre-processing of the target data include but are not limited to steps A1-A2:

[0055] Step A1: Use a sensor to obtain target data of the flow meter centering clamping device when it is working.

[0056] Step A2: Process the target data for missing values, exceptions, duplication removal, and data mapping.

[0057] Among them, see Figure 4 Before diagnosing the electrical fault of the flowmeter centering clamping device, it is necessary to first collect target data. A sensor is configured on the flowmeter centering clamping device to obtain the U, V, and W three-phase voltage data of the flowmeter centering clamping device when it is working. For example, the sensor is used to obtain the U, V, and W three-phase voltage data of the flowmeter centering clamping device when it is working at a preset sampling period. The preset sampling period can be T s ∈[0.1ms, 1ms], that is, in a sampling period T s The sampling is performed every 0.1ms, and the sampling time is 1ms. The U, V, and W three-phase voltage data are collected once each in one sampling period.

[0058] After obtaining the U, V, and W three-phase voltage data, the U, V, and W three-phase voltage data are preprocessed. The preprocessing includes missing value processing, exception processing, duplicate removal processing, and data conversion and mapping processing.

[0059] In addition to conventional preprocessing of the collected target data, the target data also needs to be subjected to data conversion and mapping processing in the embodiment of the present invention. The data mapping processing refers to mapping the target data into unsigned integer data. For example, after obtaining the U, V, and W three-phase voltage data, it is found through statistics that the voltage values of the collected U, V, and W three-phase voltage data are in the range of (-5V, 5V). In order to facilitate analysis and calculation, the voltage values are subjected to data conversion and mapping processing to convert the voltage values into unsigned integer data. Let f(y) be the actual collected voltage value, and y be the mapped value after data conversion and mapping processing, then there is a conversion rule: That is, the voltage values (-5V, 5V) of the U, V, and W three-phase voltage data are mapped to the (0, 65535) interval.

[0060] The target data obtained in the embodiment of the present invention contains positive and negative values, and the machine learning algorithm usually requires the input data to be unsigned numerical values or normalized data, and the target data is subjected to data conversion and mapping processing to eliminate the influence of different dimensions on feature extraction. At the same time, the machine learning algorithm relies on feature extraction and anomaly detection of high-dimensional data. After mapping the target data to continuous unsigned integers, data noise interference can be reduced, such as the jump between negative values and zero points, and the key features in the voltage waveform can be captured more efficiently in the subsequent principal component analysis. Mapping the target data to an unsigned integer range facilitates direct processing by digital systems (such as embedded devices), avoiding the additional computational burden brought by floating-point operations, while retaining the details of the original signal and supporting the subsequent diagnosis of electrical faults.

[0061] S320: Sampling the preprocessed target data based on the sliding time window, and constructing a time series sample.

[0062] S330: Input the time series samples into a principal component analysis model to perform dimensionality reduction and feature extraction, and determine target features and target feature values.

[0063] In the embodiment of the present invention, the principal component analysis model is used to perform dimensionality reduction and feature extraction on the acquired target data. After sampling the target data using a sliding time window and constructing a time series sample, the time series sample is input into the principal component analysis model for dimensionality reduction and feature extraction. The time series sample can be expressed as Y=(Y1, Y2, ..., Y n ,...,Y 300 )(1≤n≤300), where Y nRepresents the target data after preprocessing.

[0064] As an optional but non-limiting implementation, the time series samples are input into a principal component analysis model for dimensionality reduction and feature extraction, and target features and target feature values are determined, including but not limited to steps B1-B4:

[0065] Step B1: Input the time series samples into the principal component analysis model for data centering to obtain data centering data.

[0066] Step B2: constructing a covariance matrix based on the centralized data, and determining the eigenvalues and eigenvectors of the covariance matrix.

[0067] Step B3: Arrange the eigenvalues of the covariance matrix in descending order, determine a preset number of features and eigenvectors, and use the eigenvectors as column vectors to form an eigenvector matrix.

[0068] Step B4: Projecting the original feature data onto the feature vector matrix to obtain the target features and target feature values after dimensionality reduction; wherein the original feature data refers to the feature data included in the time series sample.

[0069] Among them, see Figure 5 , the time series samples are input into the principal component analysis model for data center processing to obtain data center processing data. The data center processing can be expressed as:

[0070]

[0071] Among them, X ij Represents an element in a time series sample, representing the jth feature of the i-th sample, 1≤i; n is the number of samples; Represents the mean of the j-th column data.

[0072] After data centering, the standardized matrix Z is constructed, which can be expressed as:

[0073]

[0074] Among them, Z ij Represents the standardized data, eliminating the dimension effect, making the mean of each dimension 0 and the standard deviation 1; d j Indicates the standard deviation of the data in column j.

[0075] The covariance matrix is constructed based on the obtained data center processing data, and the eigenvalues and eigenvectors of the covariance matrix are determined. The constructed covariance matrix R can be expressed as:

[0076] R=[r ij ] p X p =Z T Z / (n-1)

[0077] r ij =∑a ki ·a kj / (n-1)

[0078] Among them, a ki represents the element in the kth row and ith column of the normalized matrix Z; r ij represents the covariance between variables i and j; p refers to the dimension.

[0079] Find the characteristic root λ of the characteristic equation of the covariance matrix R and determine the principal component, which can be expressed as:

[0080] |R-λI p |=0

[0081]

[0082] Among them, I p represents the p×p identity matrix; λ j represents the eigenvalues arranged from largest to smallest, and m is the number of principal components selected. The principal components refer to the dimensional data corresponding to the preset number of features selected after arranging the eigenvalues of the covariance matrix from largest to smallest.

[0083] For each λ j , j = 1, 2, ..., m, solve the equation Rb = λ j b, the unit eigenvector The standardized eigenvectors are converted into principal components, expressed as:

[0084]

[0085] in, Represents the original feature data of the i-th sample, F ij It represents the projection score of the i-th sample on the j-th principal component, that is, the target feature value of the target feature after dimensionality reduction.

[0086] The embodiment of the present invention uses principal component analysis to reduce the dimension and extract features of the acquired target data, so that the subsequent diagnosis of electrical faults can focus more on more important factors, reduce the interference of irrelevant or weakly related factors on the electrical fault diagnosis, and improve the accuracy of the electrical fault diagnosis of the flow meter centering clamping device.

[0087] S340: Generate at least two isolated trees according to the target feature and the target feature value, and form an isolation forest model with the at least two isolated trees.

[0088] To diagnose electrical faults in the flowmeter's centering clamping device, the extracted data must be fed into an isolation forest model for fault diagnosis. Before feeding the target features and their values, after dimensionality reduction and feature extraction, into the isolation forest model, an isolation tree must be constructed.

[0089] The steps of constructing the isolation tree are as follows:

[0090] (1) Randomly select N data points from the original data set as the extracted sample data set;

[0091] (2) Randomly select a dimension from the sample data set, randomly select a value to obtain the split point a to cut the sample set, and place the cut data in the left and right leaf nodes respectively;

[0092] (3) Repeat step (2) and continue cutting the corresponding data set until the stopping condition is met.

[0093] The stopping conditions include that the isolation tree reaches a maximum depth, where the depth is determined by the subsampling size N, a node contains only one sample, and all samples have the same value in a certain dimension.

[0094] After constructing at least two isolated trees, the at least two isolated trees are combined to form an isolation forest model. In actual applications, a large number of isolated trees may be constructed. For example, 100 isolated trees may be constructed to form an isolation forest model. Alternatively, a larger number of isolated trees may be constructed to form an isolation forest model. In the embodiments of the present invention, there is no specific limitation on the number of isolated trees constructed.

[0095] S350: Input the target feature and the target feature value into an isolation forest model for fault analysis, so as to perform electrical fault diagnosis on the centering clamping device of the flow meter.

[0096] After constructing the isolation forest model, the target features and target feature values are input into the isolation forest model to determine features that address anomalies for electrical fault diagnosis of the flow meter centering and clamping device. For example, any data point is input into the isolation forest model for traversal, and the average depth of the current data point in at least two isolated trees is determined to determine the anomaly score of the current data point. This determines whether the current data point is abnormal, and thus electrical fault diagnosis of the flow meter centering and clamping device is performed.

[0097] As an optional but non-limiting implementation, the target feature and target feature value are input into the isolation forest model for fault analysis to perform electrical fault diagnosis on the flow meter centering clamping device, including but not limited to steps C1-C3:

[0098] Step C1: traverse the isolation forest model based on the target feature and target feature value of the target data point to determine the average depth of the target data point in the isolation forest model; wherein the target data point refers to any data point in the target data.

[0099] Among them, after establishing at least two isolated trees and generating an isolation forest model, the target data point m is traversed through all isolated trees, the number of layers h(m) of m in each isolated tree is recorded, and the average depth of m is calculated.

[0100] As an optional but non-limiting implementation, traversing the isolation forest model based on the target feature and target feature value of the target data point to determine the average depth of the target data point in the isolation forest model includes but is not limited to steps D1-D2:

[0101] Step D1: Based on the target feature and target feature value of the target data point, traverse at least two isolated trees to determine the number of layers of the target data point in each isolated tree; wherein the isolation forest model consists of at least two isolated trees.

[0102] Step D2: Determine the average depth of the target data point in the isolation forest model based on the number of layers of the target data point in each isolation tree; wherein the average depth refers to the average number of layers traversed by the target data point in at least two isolation trees.

[0103] Among them, see Figure 6 Taking the construction of three isolation trees as an example, the target data point is traversed through the three isolation trees based on its target features and target feature values, and the number of layers in each isolation tree is determined. Based on the number of layers in each isolation tree, the average depth of the target data point in the isolation forest model is determined. Because each layer of the isolation tree represents a different feature dimension, the target data point traverses different layers in different isolation trees. For example, based on the target data point's target features and target feature values, the target data point traverses 3 layers in the first isolation tree, 4 layers in the second isolation tree, and 2 layers in the third isolation tree. Then, the average depth of the target data point in the isolation forest model is 3.

[0104] Step C2: Normalize the average depth to obtain an abnormality score of the target data point.

[0105] The average depth is normalized to obtain the abnormal score of the target data point, which can be expressed as:

[0106]

[0107] Where E[·] is the expectation of the data, and E[h(y)] is the average depth; The normalization effect is caused by The average height of the binary tree composed of points. It can be expressed as:

[0108]

[0109] in, ξ is Euler's constant.

[0110] Step C3: determining whether the target data point is abnormal based on the abnormal score, so as to perform electrical fault diagnosis on the centering clamping device of the flow meter.

[0111] After determining the anomaly score of a target data point, the target data point is then determined to be abnormal, thereby performing electrical fault diagnosis on the flowmeter centering clamping device. If the target data point is determined to be abnormal, the isolation forest model outputs a 0; if the target data point is determined to be normal, the isolation forest model outputs a 1.

[0112] Optionally, when constructing each node of the isolated tree, randomly generate τ hyperplanes and select the standard deviation gain (Sd gain ) is the largest hyperplane as the optimal hyperplane. The calculation formula of the hyperplane f (corresponding to the segmentation point p) is:

[0113]

[0114] Where Q is the set of q random attributes of Y, q≥1; y j ′ is the value of the jth attribute in Y. After the hyperplane f is established, the data set Y′ is divided into Y L With Y R .

[0115] Among them, the standard deviation gain is an indicator used to evaluate the effect of hyperplane segmentation. Its core goal is to select a segmentation method that can minimize the discreteness of the data set. gain ) is the largest hyperplane as the optimal hyperplane, and the standard deviation gain can be expressed as:

[0116]

[0117] Among them, D L ∪D R=D, D is the mapping of the sampled data set Y′ on the hyperplane f, and avg[·] is its calculated average value.

[0118] In this embodiment of the present invention, an isolation tree is traversed based on the target features and target feature values of target data points to determine whether the target data points are abnormal, thereby diagnosing electrical faults in the flowmeter centering clamping device. This electrical fault diagnosis based on the isolation forest algorithm in this embodiment of the present invention can accurately and quickly identify abnormal data, enhancing the credibility of the diagnostic results.

[0119] In an optional solution of an embodiment of the present invention, a specific example is used to experimentally verify the effect of the present invention. In this embodiment, millions of sampled record data of the flow meter centering clamping device in the oil and gas transportation link under normal and fault conditions are used for verification. Taking into account the actual needs of the feature extraction and fault diagnosis links of the present invention, four combined models are selected as controls: principal component analysis-singular value decomposition (PCA-SVDD), principal component analysis-one-class support vector machine (PCA-OCSVM), fast independent component analysis-isolation forest (FastICA-iForest), and unified manifold approximation and projection-isolation forest (UMAP-iForest).

[0120] In this test, a total of six test groups were set up to enhance the scientific nature of the results. For example, test group one is to train 500 groups of sampled and recorded data and test 300 groups of sampled and recorded data. Test group two is to train 700 groups of sampled and recorded data and test 300 groups of sampled and recorded data. Test group three is to train 700 groups of sampled and recorded data and test 400 groups of sampled and recorded data. Test group four is to train 1000 groups of sampled and recorded data and test 400 groups of sampled and recorded data. Test group five is to train 1000 groups of sampled and recorded data and test 500 groups of sampled and recorded data. Test group six is to train 1500 groups of sampled and recorded data and test 700 groups of sampled and recorded data. The results are shown in Table 1 below:

[0121] Table 1: Comparison of the accuracy of fault diagnosis by different methods

[0122]

[0123]

[0124] As can be seen from Table 1, compared with other diagnostic methods, the technical solution of the embodiment of the present invention can diagnose the electrical fault of the flow meter centering clamping device more accurately, and the diagnostic accuracy of the embodiment of the present invention is maintained at above 98.6%, with excellent diagnostic effect. Figure 7 It can be seen more intuitively that in test group six, the technical solution of the embodiment of the present invention correctly classified almost all the data.

[0125] An embodiment of the present invention provides a method for diagnosing electrical faults in a flowmeter centering clamping device, which pre-processes the collected target data to solve the problem of data anomalies, maps the target data into unsigned integer data, eliminates the influence of different dimensions on feature extraction, reduces noise interference, and facilitates more efficient capture of key features during principal component analysis. Principal component analysis is used to reduce the dimension of target data and extract features, which reduces the interference of irrelevant or weakly correlated factors on electrical fault diagnosis; at the same time, electrical fault diagnosis based on the isolation forest algorithm can accurately and quickly identify abnormal data, enhance the credibility of the diagnostic results, and improve the accuracy of electrical fault diagnosis in the flowmeter centering clamping device. Through the technical solution of the embodiment of the present invention, faster and more accurate fault location can be achieved, which can significantly shorten maintenance time and reduce downtime losses.

[0126] Example 3

[0127] Figure 8 This is a schematic diagram of the structure of an electrical fault diagnosis system for a flow meter centering and clamping device provided by the third embodiment of the present invention. Figure 8 As shown, the system includes an interface module 810, a transmission module 820, a central controller 830, a fault display module 840 and a power supply module 850; wherein:

[0128] The interface module is used to collect and transfer target data of the flow meter centering clamping device;

[0129] The transmission module is used to receive the target data transmitted by the interface module and transmit the target data to the central controller;

[0130] The central controller is used to perform data preprocessing, data storage, data diagnosis and data transmission on the target data;

[0131] The fault display module is used to issue a fault alarm to any module in the electrical fault diagnosis system of the flow meter centering and clamping device;

[0132] The power supply module is used to supply power to any module in the electrical fault diagnosis system of the flow meter centering and clamping device.

[0133] Among them, see Figure 9 The interface module input is connected to a bus adapter or an external signal module for collecting and transferring target data, text, and image signals from connected industrial equipment, including but not limited to data, text, and image signals, thereby improving acquisition speed, specificity, and stability. The interface module output is communicatively connected to a transmission module.

[0134] The transmission module is connected to the interface module and the central processing unit respectively, and is used for receiving target data transmitted by the interface module and transmitting the target data to the central controller.

[0135] Optionally, the transmission module includes a receiving unit, a control unit, and a conversion unit, which are specifically configured to:

[0136] The receiving unit is used to receive the target data collected from the interface module;

[0137] The control unit is configured to determine whether the target data requires data conversion, and transmit the target data requiring data conversion to the conversion unit;

[0138] The conversion unit is used to receive a data conversion command from the control unit and convert target data requiring data conversion into a data format required by the central controller.

[0139] The receiving unit receives target data, text, and image signals from the interface module. The control unit manages the connection and determines whether the signal has been converted. If conversion is required, it proceeds to the conversion section; otherwise, it re-acquires the signal. The control unit also manages signal segmentation and reassembly. It generates analog signals, implements flow control between the receiving unit and the conversion unit, and performs error control and recovery. The conversion unit receives commands from the control unit and converts the signals into digital signals that can be understood by the central controller's preprocessing module.

[0140] Optionally, the central controller includes a pre-processing unit, a storage unit, a diagnosis unit and a decision unit, which are specifically used to:

[0141] The preprocessing unit is used to preprocess the received target data and transmit the preprocessed target data to the decision unit; wherein the preprocessing includes missing value processing, deduplication processing, exception processing and noise processing;

[0142] The storage unit is used to replace and store abnormal values and normal values of target data;

[0143] The diagnostic unit is used to determine abnormalities in the target data and transmit the determination result, abnormal time, and abnormal point information to the decision unit;

[0144] The decision unit is used to receive the target data from the preprocessing unit, determine whether the target data enters the storage unit and the diagnostic unit, and determine whether to update and store the target data; receive the judgment result of the diagnostic unit, and determine whether to transmit the target data to the external control system and the intelligent terminal.

[0145] Among them, the preprocessing unit is used to deal with the missing, duplication, inconsistency and noise problems in the target data transmitted from the transmission module, and pass the target data to the decision unit first, which then decides whether to transmit the target data to the storage unit and the diagnosis unit.

[0146] The storage unit plays the role of data warehousing, storing and replacing normal values and abnormal values to facilitate the diagnosis unit to make judgments; at the same time, the storage unit can also play the role of updating data to provide guarantees for the model adaptive learning of the diagnosis unit. The storage unit needs to receive instructions from the decision unit to perform operations and feedback results.

[0147] The diagnosis unit receives data signals from the pre-processing unit and storage unit, as well as "commands" from the decision unit, and makes abnormal judgments. The normal output is 1, and the abnormal output is 0. The diagnosis result, fault time, and fault point information are then transmitted to the decision unit.

[0148] The decision-making unit receives signals from the pre-processing unit and decides whether to store and update the data. The decision-making unit receives results from the diagnostic unit and decides to transmit information to the external control system and smart terminal via the internal wireless communication module and the external communication module. It also receives feedback from the external control system and smart terminal and decides whether to update the diagnostic unit. The decision-making unit receives signals from the pre-processing unit, determines the signal quality, and decides whether to enter the storage unit and diagnostic unit.

[0149] Optionally, the system further includes an internal wireless communication module and an external communication module, which use a local area network and wireless communication methods to achieve wireless communication between system modules and between the system and the outside, specifically for:

[0150] The internal wireless communication module is used to realize signal access of the interface module and wireless communication between modules of the system;

[0151] The external communication module is used for wireless communication between the electrical fault diagnosis system of the flow meter centering clamping device and the external control system and intelligent terminal.

[0152] Among them, the electrical fault diagnosis system of the flow meter centering and clamping device also includes a communication module, and the communication module includes an internal wireless communication module and an external communication module. The internal wireless communication module and the external communication module adopt a local area network and wireless communication method to realize wireless communication between the system and between the system and the outside. The wireless communication between the internal systems is mainly used to realize the communication between the interface module and the transmission module, the transmission module and the central controller, the internal wireless communication module and the transmission module, the internal wireless communication module and the central controller, the internal wireless communication module and the fault display module, the fault display module and the interface module, the fault display module and the central controller, and the fault display module and the transmission module; in addition, the signal access of the interface module and the wired communication involved in the fault display module, the central controller, the transmission module, the power supply module, and the communication module can sometimes also be realized by the internal wireless communication module. The external communication module is mainly used to realize the connection between the electrical fault diagnosis system of the flow meter centering and clamping device provided in the embodiment of the present invention and the external control system and the intelligent terminal.

[0153] The fault display module is used to provide fault alarms for the interface module, fault display module, central controller, transmission module, power module, internal wireless communication module, and external communication module. Specifically, it provides alarms for power failures in the power module, voltage failures after diagnosing a problem with the flowmeter's centering clamping device, communication module failures, abnormal interface module connections, internal anomalies in major modules, and the inability of the fault display module to detect and display faults. When the fault display module alarms, an indicator light illuminates, and an alarm is simultaneously sent to the central controller and external control system via the internal wireless communication module and external communication module.

[0154] The power supply module is used to supply power to various modules of the flow meter centering and clamping device electrical fault diagnosis system provided in the embodiment of the present invention. The energy of the power supply module can come from an energy storage battery or an external power supply.

[0155] The electrical fault diagnosis system for the flow meter centering clamping device provided by an embodiment of the present invention supplements new data in real time through the transmission module and the storage module, updates the characteristic mapping matrix of the principal component analysis model and the isolated tree structure of the isolation forest model; the internal wireless communication module and the external communication module can divide the communication subnet, and realize low-latency data interaction between devices across network segments through multiple IP address binding, avoiding the influence of electromagnetic noise on signal transmission, and can also integrate signal filters to suppress high-frequency noise at the physical layer, and improve data reliability through the protocol layer verification mechanism.

[0156] The electrical fault diagnosis system for the flow meter centering clamping device provided in the embodiment of the present invention can execute the electrical fault diagnosis method for the flow meter centering clamping device provided in any of the above-mentioned embodiments of the present invention, and has the corresponding functions and beneficial effects of executing the electrical fault diagnosis method for the flow meter centering clamping device. For detailed process, please refer to the relevant operations of the electrical fault diagnosis method for the flow meter centering clamping device in the above-mentioned embodiment.

Claims

1. A method for diagnosing electrical faults in a flowmeter centering and clamping device, characterized in that: The method comprises: Obtaining target data of the flowmeter centering and clamping device when it is in operation, and preprocessing the target data; wherein the flowmeter centering and clamping device is used to position and clamp the flowmeter during the oil and gas flow detection process, and the target data includes any one of voltage data and current data; Sample the preprocessed target data based on the sliding time window and construct a time series sample; Inputting the time series samples into a principal component analysis model for dimensionality reduction and feature extraction, and determining target features and target feature values; The target features and target feature values are input into an isolation forest model for fault analysis, so as to perform electrical fault diagnosis on the flow meter centering clamping device.

2. The method according to claim 1, characterized in that The step of obtaining target data of the flow meter centering clamping device when the flow meter centering clamping device is in operation and preprocessing the target data includes: A sensor is used to obtain target data of the flow meter centering clamping device during operation; The target data is processed with missing values, exceptions, deduplication and data mapping; wherein the preprocessing includes missing value processing, exceptions, deduplication and data conversion mapping; and the data mapping processing refers to mapping the target data into unsigned integer data.

3. The method according to claim 1, characterized in that Inputting the time series samples into the principal component analysis model for dimensionality reduction and feature extraction, and determining target features and target feature values, includes: Inputting the time series samples into the principal component analysis model for data centering to obtain data centering data; Constructing a covariance matrix based on the centrally processed data, and determining the eigenvalues and eigenvectors of the covariance matrix; Arrange the eigenvalues of the covariance matrix in descending order, determine a preset number of features and eigenvectors, and use the eigenvectors as column vectors to form an eigenvector matrix; The original feature data is projected onto the feature vector matrix to obtain the target features and target feature values after dimensionality reduction; wherein the original feature data refers to the feature data included in the time series sample.

4. The method according to claim 1, wherein Before inputting the target feature and the target feature value into the isolation forest model for fault analysis, the method further includes: At least two isolated trees are generated according to the target feature and the target feature value, and the at least two isolated trees are combined into an isolation forest model.

5. The method according to claim 1, wherein Inputting the target feature and the target feature value into the isolation forest model for fault analysis to perform electrical fault diagnosis on the flow meter centering clamping device includes: Traversing the isolation forest model based on the target feature and target feature value of the target data point to determine the average depth of the target data point in the isolation forest model; wherein the target data point refers to any data point in the target data; Normalizing the average depth to obtain an abnormality score of the target data point; Whether the target data point is abnormal is determined according to the abnormal score, so as to perform electrical fault diagnosis on the flow meter centering clamping device.

6. The method according to claim 5, characterized in that The traversing the isolation forest model according to the target feature and the target feature value of the target data point to determine the average depth of the target data point in the isolation forest model includes: Traversing at least two isolation trees based on the target feature and target feature value of the target data point to determine the number of layers of the target data point in each isolation tree; wherein the isolation forest model is composed of at least two isolation trees; The average depth of the target data point in the isolation forest model is determined based on the number of layers of the target data point in each isolation tree; wherein the average depth refers to the average number of layers traversed by the target data point in at least two isolation trees.

7. A flowmeter centering clamping device electrical fault diagnosis system, characterized in that: The system includes an interface module, a transmission module, a central controller, a fault display module and a power supply module; wherein: The interface module is used to collect and transfer target data of the flow meter centering clamping device; The transmission module is used to receive the target data transmitted by the interface module and transmit the target data to the central controller; The central controller is used to perform data preprocessing, data storage, data diagnosis and data transmission on the target data; The fault display module is used to issue a fault alarm to any module in the electrical fault diagnosis system of the flow meter centering and clamping device; The power supply module is used to supply power to any module in the electrical fault diagnosis system of the flow meter centering and clamping device.

8. The system according to claim 7, characterized in that The transmission module includes a receiving unit, a control unit and a conversion unit, which are specifically used to: The receiving unit is used to receive the target data collected from the interface module; The control unit is configured to determine whether the target data requires data conversion, and transmit the target data requiring data conversion to the conversion unit; The conversion unit is used to receive a data conversion command from the control unit and convert target data requiring data conversion into a data format required by the central controller.

9. The system according to claim 7, wherein: The central controller includes a pre-processing unit, a storage unit, a diagnosis unit and a decision unit, which are specifically used to: The preprocessing unit is used to preprocess the received target data and transmit the preprocessed target data to the decision unit; wherein the preprocessing includes missing value processing, deduplication processing, exception processing and noise processing; The storage unit is used to replace and store abnormal values and normal values of target data; The diagnostic unit is used to determine abnormalities in the target data and transmit the determination result, abnormal time, and abnormal point information to the decision unit; The decision unit is used to receive the target data from the preprocessing unit, determine whether the target data enters the storage unit and the diagnostic unit, and determine whether to update and store the target data; receive the judgment result of the diagnostic unit, and determine whether to transmit the target data to the external control system and the intelligent terminal.

10. The system according to claim 7, wherein: The system also includes an internal wireless communication module and an external communication module, which use local area network and wireless communication methods to achieve wireless communication between system modules and between the system and the outside, specifically for: The internal wireless communication module is used to realize signal access of the interface module and wireless communication between modules of the system; The external communication module is used for wireless communication between the electrical fault diagnosis system of the flow meter centering clamping device and the external control system and intelligent terminal.