Gas flow meter real-time fault diagnosis method based on edge calculation

By implementing a real-time fault diagnosis method based on edge computing on a gas flow meter, and utilizing lightweight statistics and multidimensional data point cloud analysis, the high energy consumption and complex fault identification challenges of edge computing devices are solved, achieving efficient fault diagnosis and extended equipment life.

CN121655657APending Publication Date: 2026-03-13VEMM TEC INSTR(SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

When existing edge computing is deployed on gas flow meters, high-frequency data processing leads to excessive energy consumption, affecting equipment lifespan, and it cannot effectively identify complex faults.

Method used

A real-time fault diagnosis method based on edge computing is adopted. By collecting data and accumulating lightweight statistics at edge nodes, a multi-dimensional historical state data point cloud is constructed, and system anomalies are identified through state space topology barcode analysis.

Benefits of technology

It optimizes energy consumption, improves the sensitivity and depth of fault diagnosis, and can identify complex and unknown types of faults, while ensuring the device's ultra-long battery life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121655657A_ABST
    Figure CN121655657A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of edge computing, in particular to a gas flowmeter real-time fault diagnosis method based on edge computing, which comprises the following steps: continuously acquiring gas flow, pipeline pressure and medium temperature data at an edge node, updating an exponential weighted moving average value at the previous moment by adopting a preset weight coefficient, and calculating the fault of a gas flowmeter according to the exponential weighted moving average value; and calculating a difference value between the currently acquired data and the updated exponentially weighted moving average value, accumulating the difference value to a preorder accumulated sum to form a statistical control quantity, and carrying out numerical comparison on the statistical control quantity and an early warning line constructed according to a historical data standard deviation. According to the method, the hierarchical calculation and state transition strategy is executed at the edge nodes, energy consumption is optimized, the method operates in a monitoring state with extremely low power consumption in most of time, lightweight statistic accumulation and comparison are only performed on gas flow, pipeline pressure and medium temperature data, and energy consumption is reduced. According to the design, the high-power-consumption deep analysis task is strictly limited at the necessary moment when the statistics deviate from the early warning line in the early stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of edge computing technology, and in particular to a real-time fault diagnosis method for gas flow meters based on edge computing. Background Technology

[0002] Edge computing is a distributed computing architecture whose core idea is to migrate data processing, computing tasks, and storage functions from centralized cloud servers to devices at the data source or network edge.

[0003] Current general-purpose edge computing architectures, when applied to industrial equipment that operates unattended for extended periods, merely emphasize migrating computing tasks from the cloud to the edge. In practical deployments, if complex diagnostic and analysis programs are continuously run indiscriminately on edge devices, it creates a significant energy burden for battery-powered devices like gas flow meters, resulting in a much shorter-than-expected lifespan. For instance, a device continuously performing high-frequency Fourier transforms at the edge to monitor vibration anomalies may consume almost the same amount of power as uploading all the raw data to the cloud for analysis, failing to leverage the energy-saving advantages of edge computing. Therefore, improvements are needed. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a real-time fault diagnosis method for gas flow meters based on edge computing.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a real-time fault diagnosis method for gas flow meters based on edge computing, comprising the following steps: At the edge node, gas flow, pipeline pressure and medium temperature data are continuously collected. The exponentially weighted moving average of the previous moment is updated using a preset weighting coefficient. The difference between the currently collected data and the updated exponentially weighted moving average is calculated. The difference is accumulated above the previous cumulative sum to form a statistical control quantity. The statistical control quantity is compared with the warning line constructed based on the standard deviation of historical data to obtain the monitoring status judgment value. Based on the monitoring status judgment value, it is determined whether the monitoring status judgment value exceeds the warning line. If it does, the system status is switched from the monitoring status to the suspected fault status. The edge node then locks the internal circular data buffer and extracts the time series data of gas flow, pipeline pressure and medium temperature from the most recent N sampling points. The multiple sets of time series data are integrated into N multi-dimensional data points to obtain a multi-dimensional status historical data point cloud.

[0006] Preferably, the method further includes: Based on the multidimensional state history data point cloud, calculate the Euclidean distance for all data point pairs in the multidimensional state history data point cloud, set an initial radius parameter and gradually increase the initial radius parameter, connect data points with a distance smaller than the initial radius parameter under each radius parameter value to form a geometric network, record the generation and merging events of connected branches in the network as well as the formation and disappearance events of ring structures, pair the generation radius and disappearance radius of each type of structural event, and establish a state space topology barcode; Based on the state space topology barcode, multiple barcode segments in the real-time generated state space topology barcode are matched with the corresponding barcode segments in the pre-stored baseline health topology barcode. The cumulative sum of the differences in the endpoint positions of all matched barcode segments is calculated as the topology distance. The topology distance is compared with a preset fault control line threshold. If the topology distance is greater than the fault control line threshold, it is determined to be a fault, and a fault confirmation command is generated.

[0007] Preferably, the step of obtaining the monitoring status determination value is as follows: Based on the gas flow, pipeline pressure and medium temperature data continuously collected by the edge nodes, the preset weighting coefficient is multiplied by the currently collected data to obtain the first product. At the same time, the difference between the first product and the weighting coefficient is multiplied by the exponentially weighted moving average of the previous moment to obtain the second product. The first product and the second product are summed, and the exponentially weighted moving average of the previous moment is updated using the preset weighting coefficient to obtain the weighted moving average benchmark. Based on the weighted moving average benchmark, the instantaneous deviation is generated by subtracting the weighted moving average benchmark from the currently collected data. Then, the instantaneous deviation is algebraically summed with the stored previous cumulative sum, and the calculation result is stored as a new cumulative sum. The difference between the currently collected data and the weighted moving average benchmark is calculated, and the difference is accumulated on the previous cumulative sum to obtain the real-time cumulative deviation sum. Based on the real-time cumulative deviation, extract historical normal operating data to calculate the standard deviation, and multiply the standard deviation by a preset multiple to establish an early warning line. Take the absolute value of the real-time cumulative deviation and compare the absolute value with the early warning line to determine the magnitude. Compare the absolute value of the real-time cumulative deviation with the early warning line constructed based on the standard deviation of historical data to obtain the monitoring status judgment value.

[0008] Preferably, the steps for obtaining the multidimensional state historical data point cloud are as follows: Based on the monitoring status determination value, the monitoring status determination value is compared with the warning line. If the former is greater than the latter, the preset system status flag is set from 0 to 1. It is determined whether the monitoring status determination value exceeds the warning line. If it does, the monitoring status is switched to the suspected fault status, and a status switching signal is generated. According to the state switching signal, a write protection command is sent to the data buffer to lock the content, and according to the preset number of sampling points N, N gas flow rate values, N pipeline pressure values ​​and N medium temperature values ​​are read backward from the end of the buffer. The time series data of gas flow rate, pipeline pressure and medium temperature including the most recent N sampling points are extracted to establish a multi-dimensional time series data segment. Based on the multidimensional time series data segment, create an N-row, 3-column empty data matrix, and traverse the multidimensional time series data segment in chronological order. Fill the i-th time point with the gas flow rate, pipeline pressure, and medium temperature values ​​into the i-th row of the matrix. Combine the sampled values ​​of multiple sets of time series data at the same time to integrate them into N multidimensional data points, and obtain a multidimensional state historical data point cloud.

[0009] Preferably, the steps for obtaining the state space topology barcode are as follows: Based on the multidimensional state history data point cloud, traverse all data point pairs in the multidimensional state history data point cloud. For each pair of data points, calculate the sum of squares of the coordinate differences in the three dimensions of gas flow, pipeline pressure and medium temperature. Then take the square root of the sum. Calculate the Euclidean distance for all data point pairs in the multidimensional state history data point cloud to generate a data point pair distance matrix. Based on the distance matrix of the data points, an initial radius parameter is set and increased by a fixed step size. At each step size, the distance matrix of the data points is traversed. If the distance between two points is less than the current radius parameter, the two points are recorded as connected, forming a set of geometric structures that change with the radius parameter. An initial radius parameter is set and gradually increased. At each radius parameter value, data points with a distance less than the initial radius parameter are connected to construct a multi-scale geometric structure sequence.

[0010] Preferably, the step of obtaining the state space topology barcode further includes: Based on the multi-scale geometric structure sequence, the generation and merging times of independent data point clusters during the process of increasing radius parameters, as well as the appearance and filling times of non-shrinking loops, are tracked. The generation radius parameter and disappearance radius parameter of each topological feature are stored as numerical pairs. The generation and merging events of connected branches in the network and the formation and disappearance events of ring structures are recorded. The generation radius and disappearance radius of each type of structural event are paired to establish a state space topological barcode.

[0011] Preferably, the step of obtaining the fault confirmation command is as follows: Based on the state space topology barcode, the barcode segments in the real-time generated state space topology barcode are traversed to find the barcode segment in the baseline health topology barcode that has the highest overlap with its life cycle and the same dimension, and a one-to-one correspondence is established. Multiple barcode segments in the real-time generated state space topology barcode are matched with the corresponding barcode segments in the pre-stored baseline health topology barcode to obtain topology feature matching pairs. Based on the topological feature matching pairs, all topological feature matching pairs are traversed. For each pair of matched barcode segments, the sum of the square of the difference between the generated radius parameter and the square of the difference between the vanishing radius parameter is calculated. Then, the calculation results of all matching pairs are summed to calculate the cumulative sum of the differences in the endpoint positions of all matched barcode segments, and a topological structure difference metric is generated.

[0012] Preferably, the step of obtaining the fault confirmation command further includes: Based on the topology difference metric value, a preset fault control line threshold is read, and the threshold is compared with the calculated topology difference metric value. If the topology difference metric value is greater than the fault control line threshold, a high-level signal or a specific fault code is output. The topology difference metric value is then compared with the preset fault control line threshold. If the topology difference metric value is greater than the fault control line threshold, a fault is determined, and a fault confirmation command is generated.

[0013] Compared with the prior art, the advantages and positive effects of the present invention are as follows: This invention optimizes energy consumption by executing hierarchical computing and state transition strategies at edge nodes. It operates in a low-power monitoring state for most of the time, accumulating and comparing only lightweight statistics on gas flow, pipeline pressure, and medium temperature data. This design strictly limits high-power deep analysis tasks to the necessary moment when statistics deviate from the warning line in the early stages. Once triggered, the cached multidimensional historical data is used to construct a high-dimensional state point cloud, and its topology is quantified. By calculating and comparing the structural differences between the state space topology barcode and the baseline health barcode, systemic anomalies caused by abnormal coupling relationships between multiple variables can be detected. This ability to capture sudden changes in data geometry enables it to identify complex and unknown types of faults that are not significant in a single dimension but whose overall state has undergone qualitative changes. Thus, while ensuring the device's ultra-long endurance, it improves the sensitivity and depth of fault diagnosis. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the steps of the present invention. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0016] Please see Figure 1 This invention provides a technical solution: a real-time fault diagnosis method for gas flow meters based on edge computing, comprising the following steps: At the edge node, gas flow, pipeline pressure and medium temperature data are continuously collected. The exponentially weighted moving average of the previous moment is updated using a preset weighting coefficient. The difference between the currently collected data and the updated exponentially weighted moving average is calculated. The difference is accumulated above the previous cumulative sum to form a statistical control quantity. The statistical control quantity is compared with the warning line constructed based on the standard deviation of historical data to obtain the monitoring status judgment value. Based on the monitoring status judgment value, it is determined whether the monitoring status judgment value exceeds the warning line. If it exceeds the line, the system status is switched from the monitoring status to the suspected fault status. The edge node then locks the internal loop data buffer and extracts the time series data of gas flow, pipeline pressure and medium temperature from the most recent N sampling points. The multiple sets of time series data are integrated into N multi-dimensional data points to obtain the multi-dimensional status historical data point cloud. Based on the multidimensional state history data point cloud, the Euclidean distance is calculated for all data point pairs in the multidimensional state history data point cloud. An initial radius parameter is set and gradually increased. Under each radius parameter value, data points with a distance smaller than the initial radius parameter are connected to form a geometric network. The generation and merging events of connected branches in the network and the formation and disappearance events of ring structures are recorded. The generation radius and disappearance radius of each type of structural event are paired to establish a state space topology barcode. Based on the state space topology barcode, multiple barcode segments in the real-time generated state space topology barcode are matched with the corresponding barcode segments in the pre-stored baseline health topology barcode. The cumulative sum of the differences in the endpoint positions of all matched barcode segments is calculated as the topology distance. The topology distance is compared with the preset fault control line threshold. If the topology distance is greater than the fault control line threshold, it is determined to be a fault, and a fault confirmation command is generated.

[0017] The steps for obtaining the monitoring status judgment value are as follows: Based on the gas flow, pipeline pressure and medium temperature data continuously collected by the edge nodes, the preset weighting coefficient is multiplied by the currently collected data to obtain the first product. At the same time, the difference between the first product and the weighting coefficient is multiplied by the exponentially weighted moving average of the previous moment to obtain the second product. The first product and the second product are summed, and the exponentially weighted moving average of the previous moment is updated using the preset weighting coefficient to obtain the weighted moving average benchmark. Based on the weighted moving average benchmark, the instantaneous deviation is generated by subtracting the weighted moving average benchmark from the currently collected data. Then, the instantaneous deviation is algebraically summed with the stored previous cumulative sum, and the calculation result is stored as a new cumulative sum. The difference between the currently collected data and the weighted moving average benchmark is calculated, and the difference is accumulated on the previous cumulative sum to obtain the real-time cumulative deviation sum. Based on the real-time cumulative deviation, extract historical normal operating data to calculate the standard deviation, and multiply the standard deviation by a preset multiple to establish an early warning line. Take the absolute value of the real-time cumulative deviation and compare the absolute value with the early warning line to determine the magnitude. Compare the absolute value of the real-time cumulative deviation with the early warning line constructed based on the standard deviation of historical data to obtain the monitoring status judgment value.

[0018] Specifically, based on the continuously collected gas flow, pipeline pressure, and medium temperature data from edge nodes, a preset weighting coefficient is first assigned to each monitoring data point. This weighting coefficient is set based on the volatility of the corresponding data under historical normal operating conditions. For medium temperature data with relatively low volatility, a smaller weight is assigned, such as 0.1, to smooth out short-term noise. For gas flow data with high volatility, a relatively larger weight is assigned, such as 0.3, to respond more quickly to real-time changes. Taking gas flow as an example, its weighting coefficient α is set to 0.2. Then, for the gas flow value collected at the current moment, for example, 105.5... The weighted moving average benchmark is calculated by dividing the weighting factor of 0.2 by the current gas flow rate value of 105.5. Multiplying them together yields the first product, the result of which is: Meanwhile, subtracting the weighting coefficient 0.2 from the value 1 yields a difference of 0.8, which is then weighted and averaged with the gas flow index stored in the system for the previous moment, for example, 102.0. Multiply them to get the second product, the result of which is: Next, the calculated first product 21.1 and the second product 81.6 are algebraically summed to obtain a temporary updated value of 102.7. This value serves as the current time-independent exponentially weighted moving average updated with preset weighting coefficients, and it overwrites the previous time-independent value of 102.0. This record is used to prepare for the next iteration of calculation, and the final updated value is 102.7. As the weighted moving average benchmark for the current gas flow rate, the same method is used for pipeline pressure and medium temperature data, calculating their respective weighted moving average benchmarks using their independent weighting coefficients and the exponential weighted moving average of the previous time.

[0019] Based on the weighted moving average benchmarks calculated for gas flow rate, pipeline pressure, and medium temperature, the instantaneous deviation and cumulative sum are calculated independently for each data point. Taking gas flow rate as an example, its currently collected value is 105.5. The corresponding weighted moving average benchmark calculated in the previous process is 102.7. First, let's start with the currently collected data: 105.5. Subtract the weighted moving average benchmark of 102.7 from the middle. Generate the instantaneous deviation at that moment, the value of which is... Then, the system retrieves the preceding cumulative sum specifically for gas flow data from memory, for example, its value is -5.4. Then, it performs an algebraic summation between the just-calculated instantaneous deviation of 2.8 and this preceding cumulative sum of -5.4. The calculation process is as follows: The calculated new cumulative sum of -2.6 will overwrite the original -5.4 and be stored as the updated cumulative sum for use in the next sampling period. This updated cumulative sum of -2.6 is the real-time cumulative deviation of the gas flow rate at the current moment. Similarly, the same calculation is performed on the currently collected pipeline pressure data, such as 1.52 MPa, and its corresponding weighted moving average benchmark, such as 1.50 MPa, to generate an instantaneous deviation of 0.02 MPa. This deviation is then added to the stored previous pressure cumulative sum, such as 0.15, to obtain a new real-time cumulative deviation of 0.17. The same process is performed on the medium temperature data. By calculating the difference between the currently collected data and the weighted moving average benchmark, and accumulating this difference on the corresponding previous cumulative sum, the independent real-time cumulative deviations are obtained.

[0020] Based on the real-time cumulative deviation, independent early warning lines are established for the three monitoring parameters: gas flow, pipeline pressure, and medium temperature. First, a segment of data marked as "normal operating condition" needs to be extracted from the historical database. For example, 30 consecutive days of data with no alarm records in the past three months and stable equipment load are selected. This data segment contains hundreds of thousands of sampling points. Then, for this historical normal operating condition data, the standard deviation of its deviation value relative to the then-current dynamic baseline is calculated. Taking gas flow as an example, the standard deviation is obtained by calculating the square root of the variance of all flow deviation values ​​within these 30 days. For example, if the calculated standard deviation is 4.5 units, a preset multiplier needs to be set. This multiplier aims to balance detection sensitivity and false alarm rate. According to statistical process control theory, 3 times the standard deviation is usually selected as the control limit. However, for early warning, a more sensitive multiplier is set here, such as 2.5. This value is based on the empirical value determined by retrospective analysis of historical minor fault data, which can detect abnormal trends in 70% of cases. Then, the calculated standard deviation of 4.5 is multiplied by the preset multiplier of 2.5 to establish the early warning line for gas flow. Then, the real-time cumulative deviation of gas flow calculated in the previous process is obtained, for example, -2.6, and its absolute value is taken as 2.6. This absolute value of 2.6 is directly compared with the warning line of 11.25. Since 2.6 is less than 11.25, the comparison result is that it does not exceed the limit. This comparison result itself, that is, a Boolean value of logical judgment or a numerical value representing the status (for example, 0 represents normal and 1 represents exceeding the limit), is defined as the monitoring status judgment value. In this case, the monitoring status judgment value of gas flow is 0.

[0021] The steps for obtaining multidimensional state historical data point clouds are as follows: Based on the monitoring status judgment value, the monitoring status judgment value is compared with the warning line. If the former is greater than the latter, the preset system status flag is set from 0 to 1. It is determined whether the monitoring status judgment value exceeds the warning line. If it does, the monitoring status is switched to the suspected fault status, and a status switching signal is generated. Based on the state switching signal, a write protection command is sent to the data buffer to lock the content. Based on the preset number of sampling points N, N gas flow rate values, N pipeline pressure values ​​and N medium temperature values ​​are read backward from the end of the buffer. The time series data of gas flow rate, pipeline pressure and medium temperature including the most recent N sampling points are extracted to establish a multi-dimensional time series data segment. Based on the multidimensional time series data segment, create an N-row, 3-column empty data matrix, and traverse the multidimensional time series data segment in chronological order. Fill the i-th time point with the gas flow rate, pipeline pressure, and medium temperature values ​​into the i-th row of the matrix. Combine the sampled values ​​of multiple sets of time series data at the same time to integrate them into N multidimensional data points, and obtain a multidimensional state historical data point cloud.

[0022] Specifically, based on the monitoring status judgment value, the system continuously judges this value to determine whether to switch the system status. Internally, the system maintains a system status flag bit with an initial state of 0, where 0 represents "monitoring status" and 1 represents "suspected fault status." In each sampling cycle, the monitoring status judgment values ​​for gas flow, pipeline pressure, and medium temperature are acquired. For example, at a certain moment, the absolute value of the real-time cumulative deviation of the gas flow increases to 12.8, while its warning threshold is 11.25. Therefore, its monitoring status judgment value changes from 0 to 1. At this time, the judgment logic detects that the monitoring status judgment value of 1 has exceeded the normal range represented by the warning threshold, and the system immediately performs a status change operation, setting the preset system status flag bit from its current value of 0 to 1. When this flag is set to 1, the change in the system's operating mode is accompanied by a switch from the normal "monitoring state" to the "suspected fault state." Simultaneously, this state switch triggers an internal event to generate a state switch signal. This signal is a data structure containing multiple fields, such as the event's timestamp (e.g., "2023-10-27 10:30:15.123"), the name of the parameter triggering the switch (e.g., "gas flow"), the absolute value of the real-time cumulative deviation at the time of triggering (e.g., "12.8"), and the corresponding warning threshold (e.g., "11.25"). This structured state switch signal is then pushed to the system's internal message queue for subsequent data freezing and retrieval processes.

[0023] Upon receiving a state transition signal, the system immediately locks a continuously updated data buffer. This data buffer is a first-in, first-out circular queue designed to store all sensor data from the most recent period; for example, its capacity is set to store data from the past 3600 sampling points. After receiving the state transition signal, the system sends a write-protect command to the buffer manager, which suspends all new data write operations, thus freezing the buffer's state at the suspected fault moment. Next, data is retrieved backtrackingly based on a preset number of sampling points N. The value of N is set based on the analysis of typical fault mode evolution and needs to be long enough to encompass the fault. The data should be a complete precursor to the failure, but not too long to avoid introducing too much irrelevant data. Here, N is set to 240, which corresponds to the last 20 minutes of data before the failure, with a sampling frequency of once every 5 seconds. The extraction process starts from the end of the buffer, that is, the latest data point, and reads backward point by point, continuously backtracking 240 points. For each time point, the corresponding gas flow rate, pipeline pressure, and medium temperature values ​​are read simultaneously. Finally, this process will produce three one-dimensional time series arrays, each with a length of 240, representing the changes in gas flow rate, pipeline pressure, and medium temperature in the 20 minutes before the failure. These three arrays together constitute the multi-dimensional time series data segment used for subsequent analysis.

[0024] Based on the multidimensional time series data segment, which consists of three time series arrays of length 240 (gas flow rate, pipeline pressure, and medium temperature), an N-row, 3-column empty data matrix is ​​first created in memory, where N is 240, corresponding to 240 time sampling points, and the three columns correspond to the three dimensions of gas flow rate, pipeline pressure, and medium temperature, respectively. Then, a traversal process is initiated, starting from the earliest time point (i.e., the 1st sampling point) in chronological order and proceeding to the last time point (i.e., the 240th sampling point). In the i-th iteration of the traversal (where i ranges from 1 to 240), the i-th element is retrieved from the gas flow rate time series array, the pipeline pressure time series array, and the medium temperature time series array. These three values ​​are combined and sequentially filled into the i-th row of the previously created N-row, 3-column data matrix. For example, if the gas flow rate at the i-th time point is 102.1... If the pipeline pressure is 1.58 MPa and the medium temperature is 25.3℃, then the i-th row of the matrix will be filled with [102.1, 1.58, 25.3]. This filling process horizontally integrates the three independent time series at each identical timestamp, representing the system state at each moment as a data point in a three-dimensional space. After the traversal process completes the filling of all 240 time points, the resulting 240-row, 3-column numerical matrix is ​​the final multidimensional state historical data point cloud.

[0025] The steps for obtaining a state-space topology barcode are as follows: Based on the multidimensional state historical data point cloud, traverse all data point pairs in the multidimensional state historical data point cloud. For each pair of data points, calculate the sum of squares of the coordinate differences in the three dimensions of gas flow, pipeline pressure and medium temperature. Then take the square root of the sum. Calculate the Euclidean distance for all data point pairs in the multidimensional state historical data point cloud and generate a data point pair distance matrix. Based on the distance matrix of data points, set an initial radius parameter and increase it incrementally with a fixed step size. At each step size, traverse the distance matrix of data points. If the distance between two points is less than the current radius parameter, record that the two points are connected, forming a set of geometric structures that change with the radius parameter. Set an initial radius parameter and gradually increase it. Connect data points with a distance less than the initial radius parameter at each radius parameter value to construct a multi-scale geometric structure sequence. Based on the multi-scale geometric structure sequence, the generation and merging times of independent data point clusters, as well as the appearance and filling times of non-shrinking loops, are tracked during the process of increasing radius parameters. The generation radius parameter and disappearance radius parameter of each topological feature are stored as numerical pairs. The generation and merging events of connected branches in the network and the formation and disappearance events of loop structures are recorded. The generation radius and disappearance radius of each type of structural event are paired to establish a state space topological barcode.

[0026] Specifically, based on the multidimensional state historical data point cloud, which is a three-dimensional array containing 240 data points, each data point consists of three values: gas flow rate, pipeline pressure, and medium temperature. First, an empty matrix of 240 rows and 240 columns is created to store the calculation results. Then, all unique data point pairs are traversed through two nested loops. The outer loop variable i iterates from 1 to 239, and the inner loop variable j iterates from i+1 to 240. For each pair of data points in the loop, for example, the i-th data point... and the j-th data point The coordinates of these coordinates in three dimensions—gas flow rate, pipeline pressure, and medium temperature—are extracted respectively. Then, the square of the coordinate difference in each dimension is calculated, i.e., the result is calculated. , and Add these three squared values ​​together to get a sum. For example, if the data points are... The data points are (105.1, 1.52, 25.4). Given (105.3, 1.51, 25.5), the sum of squares of the differences is... Then, taking the square root of this sum of 0.0501, we obtain the Euclidean distance between the two data points, i.e. The calculated distance value 0.2238 is simultaneously stored in the i-th row and j-th column and the j-th row and i-th column of the result matrix. After all loops are completed, the 240-by-240 matrix is ​​completely filled, generating the data point pair distance matrix.

[0027] Based on the data point pair distance matrix, which is a 240x240 symmetric square matrix storing the distances between all data point pairs, the scanning range and step size of the radius parameter are first determined. By analyzing all non-zero elements in the data point pair distance matrix, the maximum and minimum non-zero distance values ​​are found; for example, the maximum distance is 5.8 and the minimum non-zero distance is 0.15. The initial radius parameter is set to 0, and the fixed step size is set to one-tenth of the minimum non-zero distance, i.e., 0.015, to obtain sufficient resolution when capturing topological evolution. Subsequently, an iterative process is initiated, with the radius parameter starting from 0 and increasing in fixed step sizes of 0.015 until it exceeds the maximum distance of 5.8. At each radius parameter value, for example, when the radius parameter... When the radius parameter is 0.5, the upper triangular part of the distance matrix between data point pairs is traversed, and it is checked whether the distance between any two points (e.g., point i and point j) is less than the current radius parameter of 0.5. If the distance value is less than 0.5, then logically, point i and point j are recorded as connected. This is equivalent to connecting all vertex pairs with a distance less than 0.5 in a graph with 240 data points as vertices, forming a specific geometric structure. As the radius parameter gradually increases from 0, more and more edges are connected, and the structure of the graph also evolves. The geometric structure formed under each radius parameter value is stored as an element in a sequence, and a multi-scale geometric structure sequence composed of a series of geometric graphs that increase with the radius parameter is constructed, which can reflect the evolution process of the intrinsic correlation of the data point cloud.

[0028] Based on the multi-scale geometric structure sequence, the topological features of each geometric structure in the sequence are tracked and recorded as the radius parameter increases from 0. Two types of topological features are primarily focused on: zero-dimensional features (independent clusters of data points, or connected components) and one-dimensional features (non-shrinking loops). Initially, with a radius of 0, each data point constitutes an independent connected component, totaling 240. Therefore, the generation of 240 zero-dimensional features is recorded, with their generation radius parameter all being 0. When the radius parameter increases to a certain value, such as 0.2238, two previously independent data points (e.g., point 1 and point 2) become connected for the first time. At this point, a connected component is merged, and the smaller-numbered connected component can be considered to have disappeared. The disappearance radius parameter of this connected component is recorded as 0.2238, and its corresponding topological feature lifetime is (0, 0.2238). In a sample plot, when the radius parameter increases to a certain value, such as 0.8, causing three or more data points to form a closed loop structure (e.g., points A, B, and C are connected in pairs), the generation of a one-dimensional feature (loop) is recorded, with a generation radius parameter of 0.8. Subsequently, if the radius parameter continues to increase to 1.2, causing a point D inside this loop to become connected to all points on the loop, resulting in the loop being filled by one or more triangles, then the loop is considered to have disappeared, and its disappearance radius parameter is recorded as 1.2, with a lifespan of (0.8, 1.2). By continuously tracking the generation and merging events of all connected branches and the formation and disappearance events of all loop structures within the entire radius parameter increasing interval, and storing the generation radius and disappearance radius of each independent topological feature as a numerical pair, a state space topological barcode is established.

[0029] The steps to obtain the fault confirmation command are as follows: Based on the state space topology barcode, traverse the barcode segments in the real-time generated state space topology barcode, find the barcode segment in the baseline health topology barcode with the highest lifecycle overlap and the same dimension, and establish a one-to-one correspondence. Match multiple barcode segments in the real-time generated state space topology barcode with the corresponding barcode segments in the pre-stored baseline health topology barcode to obtain topology feature matching pairs. Based on the topological feature matching pairs, traverse all topological feature matching pairs. For each pair of matching barcode segments, calculate the sum of the square of the difference between the generated radius parameter and the square of the difference between the vanishing radius parameter. Then, sum the calculation results of all matching pairs and calculate the cumulative sum of the differences in the endpoint positions of all matching barcode segments to generate a topological structure difference metric. Based on the topology difference metric, a preset fault control line threshold is read. The threshold is compared with the calculated topology difference metric. If the topology difference metric is greater than the fault control line threshold, a high-level signal or a specific fault code is output. The topology difference metric is then compared with the preset fault control line threshold. If the topology difference metric is greater than the fault control line threshold, a fault is determined, and a fault confirmation command is generated.

[0030] Specifically, based on the state-space topology barcode, which is a mathematical representation of the topological characteristics of the currently suspected faulty data segment, a baseline healthy topology barcode is retrieved from a pre-stored knowledge base. This baseline healthy topology barcode is constructed by performing the same topology analysis process on a large number of historical multi-dimensional state data point clouds under normal operating conditions, and then statistically averaging or selecting the most representative one from the resulting multiple topology barcodes. Subsequently, for each barcode segment in the real-time generated state-space topology barcode, its best match is sought in the baseline healthy topology barcode. The matching process is first performed dimensionally. That is, zero-dimensional barcode segments match only zero-dimensional barcode segments, and one-dimensional barcode segments match only one-dimensional barcode segments. For a barcode segment in a real-time barcode, such as a one-dimensional barcode segment with a lifecycle of (0.8, 1.2), all one-dimensional barcode segments in the baseline health topology barcode are traversed, and the lifecycle overlap with each baseline barcode segment is calculated. The overlap is calculated by dividing the length of the intersection of the two lifecycle intervals by the length of the union. For example, if there are two one-dimensional barcode segments in the baseline library with lifecycles of (0.7, 1.3) and (1.5, 2.0) respectively, their overlap with (0.8, 1.2) is respectively... The barcode with the highest overlap, i.e. (0.7, 1.3), is selected as the matching object. In this way, a one-to-one correspondence is established between multiple barcode segments in the real-time generated state space topology barcode and the corresponding barcode segments in the pre-stored baseline health topology barcode, thereby obtaining topology feature matching pairs.

[0031] Based on the topological feature matching pairs, which contain a one-to-one correspondence between the topological features of the current state and the topological features of the healthy state, an accumulator variable is initialized to 0. Then, all topological feature matching pairs in the set are traversed, and for each matching barcode segment, for example, the current barcode segment is... The corresponding health benchmark barcode segment is Where b represents the generation radius parameter and d represents the disappearance radius parameter, the squared distance between the two on the two-dimensional plane is calculated. Specifically, the squared difference between the generation radius parameters is calculated, i.e. Then calculate the square of the difference in the vanishing radius parameter, that is... Then, add these two squared values. Taking a specific matching pair as an example, if the current barcode segment is (0.8, 1.2) and the matching health baseline barcode segment is (0.7, 1.3), the calculated result is: The calculation result 0.02 is added to the accumulator. The same calculation and accumulation operation is repeated for all other matching pairs in the set. After traversing all matching pairs, the final sum in the accumulator, that is, the cumulative sum of the differences in the endpoint positions of all matching barcode segments, is used as a quantitative indicator to measure the degree of topological difference between the current state and the health state, and a topological difference metric is generated.

[0032] Based on the topology difference metric, a preset fault control threshold is first read from the system configuration. This threshold is set based on statistical analysis of historical data. Specifically, at least 100 data segments under confirmed fault-free normal operating conditions are collected. For each data segment, its topology difference metric is calculated, forming a normal value sample set. The mean and standard deviation of this sample set are then calculated. For example, if the calculated mean is 3.5 and the standard deviation is 1.2, to achieve effective detection while ensuring a low false alarm rate, the fault control threshold is set to the mean plus three times the standard deviation. Therefore, the preset fault control threshold is 7.1. Then, the currently calculated topology difference metric value, for example 8.9, is compared with this threshold of 7.1 to determine whether 8.9 is greater than 7.1. Since this condition is met, the system state is determined to be faulty. This determination result will trigger subsequent operations to generate a fault confirmation command. This command can be a high-level digital logic signal used to trigger a hardware alarm device, or a structured fault code information packet, such as containing a fault confirmation timestamp, the topology difference metric value of 8.9, the fault control threshold of 7.1, and a preliminary judgment of the fault type, and is sent to the upper-level monitoring system.

[0033] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A real-time fault diagnosis method for gas flow meters based on edge computing, characterized in that, Includes the following steps: At the edge node, gas flow, pipeline pressure and medium temperature data are continuously collected. The exponentially weighted moving average of the previous moment is updated using a preset weighting coefficient. The difference between the currently collected data and the updated exponentially weighted moving average is calculated. The difference is accumulated above the previous cumulative sum to form a statistical control quantity. The statistical control quantity is compared with the warning line constructed based on the standard deviation of historical data to obtain the monitoring status judgment value. Based on the monitoring status judgment value, it is determined whether the monitoring status judgment value exceeds the warning line. If it does, the system status is switched from the monitoring status to the suspected fault status. The edge node then locks the internal circular data buffer and extracts the time series data of gas flow, pipeline pressure and medium temperature from the most recent N sampling points. The multiple sets of time series data are integrated into N multi-dimensional data points to obtain a multi-dimensional status historical data point cloud.

2. The real-time fault diagnosis method for gas flow meters based on edge computing according to claim 1, characterized in that, The method further includes: Based on the multidimensional state history data point cloud, calculate the Euclidean distance for all data point pairs in the multidimensional state history data point cloud, set an initial radius parameter and gradually increase the initial radius parameter, connect data points with a distance smaller than the initial radius parameter under each radius parameter value to form a geometric network, record the generation and merging events of connected branches in the network as well as the formation and disappearance events of ring structures, pair the generation radius and disappearance radius of each type of structural event, and establish a state space topology barcode; Based on the state space topology barcode, multiple barcode segments in the real-time generated state space topology barcode are matched with the corresponding barcode segments in the pre-stored baseline health topology barcode. The cumulative sum of the differences in the endpoint positions of all matched barcode segments is calculated as the topology distance. The topology distance is compared with a preset fault control line threshold. If the topology distance is greater than the fault control line threshold, it is determined to be a fault, and a fault confirmation command is generated.

3. The real-time fault diagnosis method for gas flow meters based on edge computing according to claim 1, characterized in that, The steps for obtaining the monitoring status determination value are as follows: Based on the gas flow, pipeline pressure and medium temperature data continuously collected by the edge nodes, the preset weighting coefficient is multiplied by the currently collected data to obtain the first product. At the same time, the difference between the first product and the weighting coefficient is multiplied by the exponentially weighted moving average of the previous moment to obtain the second product. The first product and the second product are summed, and the exponentially weighted moving average of the previous moment is updated using the preset weighting coefficient to obtain the weighted moving average benchmark. Based on the weighted moving average benchmark, the instantaneous deviation is generated by subtracting the weighted moving average benchmark from the currently collected data. Then, the instantaneous deviation is algebraically summed with the stored previous cumulative sum, and the calculation result is stored as a new cumulative sum. The difference between the currently collected data and the weighted moving average benchmark is calculated, and the difference is accumulated on the previous cumulative sum to obtain the real-time cumulative deviation sum. Based on the real-time cumulative deviation, extract historical normal operating data to calculate the standard deviation, and multiply the standard deviation by a preset multiple to establish an early warning line. Take the absolute value of the real-time cumulative deviation and compare the absolute value with the early warning line to determine the magnitude. Compare the absolute value of the real-time cumulative deviation with the early warning line constructed based on the standard deviation of historical data to obtain the monitoring status judgment value.

4. The real-time fault diagnosis method for gas flow meters based on edge computing according to claim 1, characterized in that, The steps for obtaining the multidimensional state historical data point cloud are as follows: Based on the monitoring status determination value, the monitoring status determination value is compared with the warning line. If the former is greater than the latter, the preset system status flag is set from 0 to 1. It is determined whether the monitoring status determination value exceeds the warning line. If it does, the monitoring status is switched to the suspected fault status, and a status switching signal is generated. According to the state switching signal, a write protection command is sent to the data buffer to lock the content, and according to the preset number of sampling points N, N gas flow rate values, N pipeline pressure values ​​and N medium temperature values ​​are read backward from the end of the buffer. The time series data of gas flow rate, pipeline pressure and medium temperature including the most recent N sampling points are extracted to establish a multi-dimensional time series data segment. Based on the multidimensional time series data segment, create an N-row, 3-column empty data matrix, and traverse the multidimensional time series data segment in chronological order. Fill the i-th time point with the gas flow rate, pipeline pressure, and medium temperature values ​​into the i-th row of the matrix. Combine the sampled values ​​of multiple sets of time series data at the same time to integrate them into N multidimensional data points, and obtain a multidimensional state historical data point cloud.

5. The real-time fault diagnosis method for gas flow meters based on edge computing according to claim 2, characterized in that, The steps for obtaining the state space topology barcode are as follows: Based on the multidimensional state history data point cloud, traverse all data point pairs in the multidimensional state history data point cloud. For each pair of data points, calculate the sum of squares of the coordinate differences in the three dimensions of gas flow, pipeline pressure and medium temperature. Then take the square root of the sum. Calculate the Euclidean distance for all data point pairs in the multidimensional state history data point cloud to generate a data point pair distance matrix. Based on the distance matrix of the data points, an initial radius parameter is set and increased by a fixed step size. At each step size, the distance matrix of the data points is traversed. If the distance between two points is less than the current radius parameter, the two points are recorded as connected, forming a set of geometric structures that change with the radius parameter. An initial radius parameter is set and gradually increased. At each radius parameter value, data points with a distance less than the initial radius parameter are connected to construct a multi-scale geometric structure sequence.

6. The real-time fault diagnosis method for gas flow meters based on edge computing according to claim 5, characterized in that, The steps for obtaining the state space topology barcode also include: Based on the multi-scale geometric structure sequence, the generation and merging times of independent data point clusters during the process of increasing radius parameters, as well as the appearance and filling times of non-shrinking loops, are tracked. The generation radius parameter and disappearance radius parameter of each topological feature are stored as numerical pairs. The generation and merging events of connected branches in the network and the formation and disappearance events of ring structures are recorded. The generation radius and disappearance radius of each type of structural event are paired to establish a state space topological barcode.

7. The real-time fault diagnosis method for gas flow meters based on edge computing according to claim 2, characterized in that, The steps for obtaining the fault confirmation command are as follows: Based on the state space topology barcode, the barcode segments in the real-time generated state space topology barcode are traversed to find the barcode segment in the baseline health topology barcode that has the highest overlap with its life cycle and the same dimension, and a one-to-one correspondence is established. Multiple barcode segments in the real-time generated state space topology barcode are matched with the corresponding barcode segments in the pre-stored baseline health topology barcode to obtain topology feature matching pairs. Based on the topological feature matching pairs, all topological feature matching pairs are traversed. For each pair of matched barcode segments, the sum of the square of the difference between the generated radius parameter and the square of the difference between the vanishing radius parameter is calculated. Then, the calculation results of all matching pairs are summed to calculate the cumulative sum of the differences in the endpoint positions of all matched barcode segments, and a topological structure difference metric is generated.

8. The real-time fault diagnosis method for gas flow meters based on edge computing according to claim 7, characterized in that, The step of obtaining the fault confirmation command also includes: Based on the topology difference metric value, a preset fault control line threshold is read, and the threshold is compared with the calculated topology difference metric value. If the topology difference metric value is greater than the fault control line threshold, a high-level signal or a specific fault code is output. The topology difference metric value is then compared with the preset fault control line threshold. If the topology difference metric value is greater than the fault control line threshold, a fault is determined, and a fault confirmation command is generated.