Gas density meter online detection method
By combining the thermodynamic state model and the empirical regression model, constructing a representative state space, and adopting a multi-scale clustering and weighted distance scoring mechanism, the problem of misjudgment of density values caused by the intervention of buffer air masses in online detection of gas densitometers is solved, and accurate identification and differentiated processing of density data are achieved, thereby improving the robustness and safety of the system.
Patent Information
- Application Number
- CN202510975950.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-07-16
AI Technical Summary
The existing online detection technology of gas density meters cannot accurately judge the representativeness of density values when buffer gas masses intervene, resulting in misjudgment and failure of process control.
By combining the thermodynamic state model and the empirical regression model to identify structurally inconsistent data in real time, a representative state space is constructed, and a multi-scale clustering and weighted distance scoring mechanism is adopted to identify and mark the degree of attribute mismatch of density data and perform differentiated processing.
The reliability control accuracy of gas density data and the fault tolerance of the system have been significantly improved, ensuring that the control system operates based on reliable data and avoiding misjudgments and safety risks.
Smart Images

Figure CN120493209B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gas density meter detection, and in particular to an online detection method for a gas density meter. Background Art
[0002] A gas densitometer is a precision instrument used to measure the mass per unit volume (i.e., density) of a gas. It typically collects and calculates gas parameters such as pressure, temperature, and flow rate to accurately determine density. It has widespread application in industries such as natural gas transmission and distribution, power generation, petrochemicals, and metallurgy, and is particularly indispensable in scenarios requiring strict control of gas composition, delivery conditions, or metering accuracy. Online testing of a gas densitometer involves using sensors, microprocessors, and communication modules to monitor gas density changes in real time during normal system operation, without requiring system downtime or manual sampling. This enables continuous, dynamic, and automated measurement of gas density. The fundamental reason for online testing of gas densitometers is that traditional offline testing methods are not only cumbersome, require long test cycles, and lack real-time performance, but can also lead to data distortion, process control failure, and safety risks in actual industrial processes due to delays in detection. In contrast, online testing can effectively improve the real-time and accuracy of density monitoring, providing data support for energy efficiency optimization, anomaly warnings, and quality control in industrial systems. Therefore, it has high engineering value and widespread application.
[0003] Existing online gas density meter detection technology primarily relies on integrated sensing systems and automatic control systems. Density detection devices are pre-installed in gas pipelines. High-precision pressure and temperature sensors collect key physical parameters of the gas in real time. An embedded computing module then fuses this data and calculates density based on specific thermodynamic models or empirical formulas, ultimately determining the real-time density of the gas under the current environment. The entire online detection process generally includes five steps: signal acquisition, signal conditioning, data calculation, result correction, and display output. The signal acquisition step converts the raw physical quantities captured by the sensor into electrical signals, while the signal conditioning step performs filtering, amplification, and analog-to-digital conversion. The data calculation module rapidly calculates the density value based on a pre-set algorithm and applies environmental compensation logic. Finally, the result is output to a monitoring system via an on-site display or industrial communication interface (such as Modbus, 4-20mA, or RS485), enabling real-time visual monitoring and remote data management. The entire process is highly automated and can operate independently or be integrated into a larger industrial control system to continuously track and dynamically respond to changes in gas density.
[0004] The existing technology has the following deficiencies:
[0005] During the online detection process of the gas density meter, when it is in the pressure regulation condition of the gas source pipeline, if the upstream pressure regulating equipment releases a buffer air mass, the buffer air mass will show a low-density and high-pressure state when entering the detection section due to its compression characteristics different from the main air flow. Since the temperature does not change significantly in this state and the pressure suddenly rises, the physical correspondence between temperature and pressure is mismatched, resulting in an abnormal situation in which the density conversion result appears stable on the surface but is actually distorted. The existing online detection technology of the gas density meter cannot judge whether the current density value is representative of the working condition based on the degree of mismatch of gas properties under the intervention of the buffer air mass, and thus misjudges the density value as normal and reliable data. This will cause subsequent alarm judgment, working condition identification, adjustment and control operations to be triggered based on erroneous data, ultimately leading to serious impacts such as valve malfunction, gas source switching disorder, and energy allocation disorder.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0007] The purpose of the present invention is to provide an online detection method for a gas density meter to solve the problems in the above-mentioned background technology.
[0008] In order to achieve the above object, the present invention provides the following technical solution: a gas density meter online detection method, specifically comprising the following steps:
[0009] Acquire temperature data, pressure data, and density data collected by the gas density meter in real time, and determine whether the density data collected by the gas density meter is structurally inconsistent data by combining a pre-set thermodynamic state model and an empirical regression model;
[0010] For density data determined to be structurally inconsistent data, the temperature data and pressure data in the corresponding time period are combined with the density data to identify whether the detection period corresponding to the density data is in a buffer air mass intervention state;
[0011] In the case of a buffer air mass intervention state, a detection point is constructed based on the temperature, pressure and density data collected in real time by the gas densitometer. This detection point is then compared with the representative state space constructed based on the historical stable state to determine the degree of attribute mismatch of the density data.
[0012] Based on the determined degree of attribute mismatch, the density data is divided into three levels: representative, questionable, and unrepresentative, and differentiated processing is performed accordingly;
[0013] Attach structured labels to density data, including representativeness level, data source type, buffer air mass intervention status flag, and control response path flag.
[0014] Preferably, the method of determining whether the density data collected by the gas densitometer is structurally inconsistent data includes:
[0015] The temperature data and pressure data are respectively input into a pre-set thermodynamic state model and an empirical regression model to obtain two predicted density value intervals. It is then determined whether the density data collected by the gas densitometer falls within the intersection of the two predicted density value intervals at the same time. If not, the density data is determined to be structurally inconsistent data.
[0016] Among them, the pre-set thermodynamic state model is a physical calculation model used to infer the theoretical range of gas density based on temperature data and pressure data; the pre-set empirical regression model is a function model trained based on historical operation data, which is used to fit the empirical range of gas density based on temperature data and pressure data.
[0017] Preferably, for density data determined to be structurally inconsistent data, the temperature data and pressure data in the corresponding time period are combined with the density data to identify whether the detection period corresponding to the density data is in a buffer air mass intervention state, specifically:
[0018] For density data determined to be structurally inconsistent data, compare the change direction of the density data with the pressure data in the corresponding time period. If the change direction of the pressure data is unidirectionally rising within a preset number of consecutive sampling periods, and the change amplitude of the corresponding density data within the preset number of consecutive sampling periods is less than a preset density response fluctuation threshold, it is determined that there is an asynchronous change between the pressure and density.
[0019] Performing a difference operation on the density data and the predicted density value calculated by a preset empirical regression model based on the temperature data and pressure data. If the difference is greater than a preset deviation judgment threshold within a preset number of consecutive sampling periods, it is determined that the density data has an abnormal deviation change;
[0020] A change curve is constructed using the temperature data and pressure data within the preset number of sampling periods as input, and a slope change rate of the change curve within the preset number of sampling periods is calculated. If the sign of the slope change rate changes at the current sampling point and its absolute value exceeds the inflection point identification threshold, then an inflection point of the temperature-pressure relationship is determined to exist;
[0021] If there are asynchronous changes between pressure and density, and the density data has abnormal deviation changes, and there is an inflection point in the temperature-pressure relationship, the detection period corresponding to the density data is identified as being in a buffer air mass intervention state.
[0022] Preferably, in the case of a buffer air mass intervention state, a detection point is constructed based on the temperature data, pressure data, and density data collected in real time by a gas densitometer, and the detection point is compared with a representative state space constructed based on a historical stable state to determine the degree of attribute mismatch of the density data, specifically comprising the following steps:
[0023] The temperature data, pressure data, and density data collected by the gas densitometer during the detection period identified as the buffer air mass intervention state are standardized respectively, and combined according to the same timestamp to form a temperature, pressure, and density triple, which is constructed as the current detection point;
[0024] Based on the temperature, pressure, and density data collected by the gas densitometer under historical stable operating conditions, multiple temperature-pressure-density triplet samples are constructed. Several representative state clusters are extracted in the multidimensional feature space through multi-scale clustering. These representative state clusters together constitute a representative state space.
[0025] Calculate the Euclidean distance and Mahalanobis distance between the current detection point and the center of gravity of each representative state cluster respectively, and fuse the two distance indicators based on the weighted minimum offset principle to obtain the offset score of the detection point relative to each state cluster;
[0026] The obtained minimum deviation score is compared with the preset attribute mismatch threshold interval, and the attribute mismatch degree of the density data is determined according to the comparison result.
[0027] Preferably, the temperature data, pressure data, and density data collected by the gas densitometer during the detection period identified as the buffer air mass intervention state are standardized, and combined according to the same timestamp to form a temperature, pressure, and density triple, which is constructed as the current detection point, specifically:
[0028] The temperature data, pressure data, and density data corresponding to each sampling point within the detection period are linearly normalized according to their respective historical means and standard deviations to obtain temperature normalized values, pressure normalized values, and density normalized values;
[0029] The temperature normalized values, pressure normalized values, and density normalized values corresponding to the same timestamp are merged to form a set of three-dimensional normalized data vectors, with each set of normalized vectors as a detection point;
[0030] All normalized data vectors within the detection period are arranged in time series to form a current detection point set for subsequent representative state comparison.
[0031] Preferably, multiple temperature-pressure-density triplet samples are constructed based on the temperature data, pressure data, and density data collected by the gas densitometer under historical stable operation, and multiple representative state clusters are extracted in the multidimensional feature space through multi-scale clustering. The multiple representative state clusters together constitute a representative state space, specifically:
[0032] The temperature data, pressure data, and density data collected by the gas densitometer under historical stable operating conditions are extracted, and the temperature data, pressure data, and density data collected at the same sampling time point are combined to construct a triplet sample of temperature, pressure, and density to form a historical state sample set;
[0033] Each triplet sample in the historical state sample set is normalized separately so that its numerical range is mapped to a unified feature scale, and the normalized samples are embedded into the three-dimensional feature vector space to form a standardized sample set;
[0034] The hierarchical density peak clustering algorithm is used to cluster the standardized sample set. By setting several feature distance thresholds, the initial cluster cores with different distribution density are extracted to form several candidate state clusters.
[0035] Each candidate state cluster is screened based on the conditions that the average distance between sample points within the cluster is lower than a first clustering density threshold, the distance between cluster centers of gravity is higher than a second inter-cluster difference threshold, and the boundary gradient change rate is lower than a third boundary fuzziness threshold. The candidate state clusters that meet all the conditions are retained as the representative state cluster set. The first clustering density threshold, the second inter-cluster difference threshold, and the third boundary fuzziness threshold are all preset;
[0036] All state clusters in the representative state cluster set are uniformly constructed into a representative state space, which is used for subsequent feature comparison with the detection points and judgment of the degree of attribute mismatch.
[0037] Preferably, the Euclidean distance and Mahalanobis distance between the current detection point and the center of gravity of each representative state cluster are calculated respectively, and the two distance indices are fused according to the weighted minimum offset principle to obtain the offset score of the detection point relative to each state cluster. The specific calculation process is as follows:
[0038] Each three-dimensional normalized vector in the current detection point set is input in sequence, and the Euclidean distance is calculated with the centroid vector of each representative state cluster in the representative state space as the spatial geometric offset measure between the current detection point and each state cluster;
[0039] The covariance matrix of the sample distribution of the current detection point and each state cluster is used as a parameter to calculate the Mahalanobis distance between it and the center of gravity of the state cluster, which reflects the abnormality of the detection point in the statistical distribution structure of each cluster.
[0040] The calculated Euclidean distance and Mahalanobis distance are normalized, and based on a pre-set weighting coefficient, the two types of distances are linearly fused to obtain the offset score of the detection point relative to each state cluster.
[0041] Preferably, the obtained minimum deviation score is compared with a preset attribute mismatch threshold interval, and the attribute mismatch degree of the density data is determined according to the comparison result, as follows:
[0042] Extract the minimum offset score from the offset scores of the detection point relative to each state cluster;
[0043] The minimum offset score is compared with the preset attribute mismatch threshold interval. When the minimum offset score is less than the lower limit of the attribute mismatch threshold interval, the attribute mismatch degree of the density data is judged to be low, that is, the density data is representative; when the minimum offset score is greater than or equal to the lower limit of the attribute mismatch threshold interval and less than or equal to the upper limit, the attribute mismatch degree of the density data is judged to be medium, that is, the representativeness of the density data is questionable; when the minimum offset score is greater than the upper limit of the attribute mismatch threshold interval, the attribute mismatch degree of the density data is judged to be high, that is, the density data is unrepresentative.
[0044] Preferably, in this embodiment, the density data is divided into three levels: representative, questionable, and unrepresentative according to the determined attribute mismatch degree, and differentiated processing is performed accordingly, specifically:
[0045] Density data that are judged to have a low degree of attribute mismatch are classified into representative levels, and the density data are directly input into the subsequent control logic for process adjustment, alarm threshold judgment and metrology correction;
[0046] Density data that are judged to have a moderate degree of attribute mismatch are classified as representativeness questionable. Based on the density distribution trend of the closest sample point in the historical representative state cluster, a revised density estimate is generated to replace the original density data. The revised density estimate is then used in the control logic.
[0047] Density data that is judged to have a high degree of attribute mismatch is classified as a non-representative level, and the density data is excluded from participating in the control logic execution, and the preset safety control operations are triggered, including maintaining the current gas regulation state unchanged, cutting off the density data path, and issuing an abnormal prompt mark.
[0048] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0049] 1. The present invention enhances the ability to identify abnormal gas density data and significantly improves the accuracy of data credibility control. By introducing a dual-model comparison mechanism of a thermodynamic state model and an empirical regression model, it effectively identifies "structurally inconsistent" data that is difficult to find in traditional methods. Although such data appears normal within the numerical range, its physical consistency is destroyed, which is a key hidden danger that leads to subsequent control misjudgment. At the same time, the scheme sets a triple condition combination to judge the intervention state of the buffer air mass, combining multiple dimensions such as the asynchronous response of pressure and density, abnormal density prediction deviation, and inflection point of temperature and pressure changes to achieve accurate state identification, significantly improving the accuracy and robustness of the perception of abnormal data in complex intervention scenarios.
[0050] 2. The present invention establishes a representative state space and performs feature comparison scoring, which effectively solves the problem of the inability to quantify the credibility of abnormal data in the existing technology. The solution constructs a multi-dimensional triplet sample set based on historical stable operation data, uses multi-scale density clustering to extract multiple representative state clusters, and constructs a standardized state space. It then combines the weighted fusion of Euclidean distance and Mahalanobis distance to construct an offset scoring system. This scoring system can accurately determine whether real-time data deviates from the historical credible operating condition distribution. By comparing the minimum offset score with the attribute mismatch threshold interval, it introduces the quantitative indicator of "representativeness" in the online detection of gas density meters for the first time, thereby achieving fine grading and dynamic control of data credibility.
[0051] 3. The present invention realizes the differentiated use and structured labeling of density data, and improves the fault tolerance and operational safety of the control system under abnormal working conditions. The technical solution implements three types of strategies for density data based on the representativeness level: trusted data is directly used for control logic, representative questionable data is replaced by modified valuation, and unrepresentative data is eliminated and triggers a safety protection mechanism to ensure that key functions such as regulation, alarm, and metering are always based on trusted data. At the same time, the structured labeling mechanism records information such as the representativeness level, source type, whether it is interfered with, and control path ownership of each density data, providing comprehensive data context for operation and maintenance tracing, data governance, and AI training, effectively improving the system's data intelligent management level and abnormal response capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction to the drawings required for use in the embodiments will be given below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0053] Figure 1 Schematic diagram of the process of the online detection method of the gas density meter of the present invention. DETAILED DESCRIPTION
[0054] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0055] The present invention provides Figure 1 The gas density meter online detection method shown in the figure specifically includes the following steps:
[0056] Acquire temperature data, pressure data, and density data collected by the gas density meter in real time, and determine whether the density data collected by the gas density meter is structurally inconsistent data by combining a pre-set thermodynamic state model and an empirical regression model;
[0057] Real-time acquisition of temperature data, pressure data and density data of the gas densitometer can be achieved by setting up a multi-channel input interface and a timed trigger acquisition mechanism in the data acquisition system. The specific method is to bind the output ends of the temperature sensor, pressure sensor and density conversion unit connected to the gas densitometer body to the embedded processing unit or edge computing device, set up a unified data reading interface at the software layer, establish a sampling scheduler to perform polling or interrupt-triggered acquisition of various types of sensor data at set time intervals, and write the acquisition results into the data buffer through the cache management logic for subsequent real-time processing and calling; at the same time, set a data timestamp synchronization mechanism in the software to ensure the consistency of the corresponding time points of various types of sensor data, so as to achieve time alignment and data structure unification of the acquisition results; in addition, the status monitoring logic can be set to dynamically determine the working status and signal integrity of the sensor to ensure that the data acquisition process in the industrial site is continuous, accurate and reliable.
[0058] In this embodiment, a method for determining whether the density data collected by the gas densitometer is structurally inconsistent data includes:
[0059] The temperature data and pressure data are respectively input into a pre-set thermodynamic state model and an empirical regression model to obtain two predicted density value intervals. It is then determined whether the density data collected by the gas densitometer falls within the intersection of the two predicted density value intervals at the same time. If not, the density data is determined to be structurally inconsistent data.
[0060] Among them, the pre-set thermodynamic state model is a physical calculation model used to infer the theoretical range of gas density based on temperature data and pressure data; the pre-set empirical regression model is a function model trained based on historical operation data, which is used to fit the empirical range of gas density based on temperature data and pressure data.
[0061] This structural inconsistency identification process can be implemented through an algorithm module deployed in an embedded processing unit or host computer software. It specifically includes three parallel computing tasks: First, the collected temperature and pressure data are input into a set thermodynamic state model module. This module derives the theoretical fluctuation range of density under the current operating conditions based on the temperature-pressure relationship and outputs a predicted density value range. Second, the same set of temperature and pressure data is input into the empirical regression model module, and its historical fitting relationship is used to output an empirical density value range. Finally, the detection module compares the currently collected real-time density data with the above two intervals for interval inclusion judgment. If the density value does not fall into the intersection of the two intervals at the same time, it is identified as structurally inconsistent data. This process is automatically executed through state triggering, without manual intervention, and is suitable for rapid density data screening and preliminary anomaly identification in continuous flow scenarios.
[0062] Thermodynamic state models are derived from a physical computational model based on a set of known state equations and correction parameters from engineering thermodynamics. Their derivation is based on the gas state equation (such as the temperature-pressure-density relationship corrected for the compressibility factor) combined with characteristic gas parameters. The model typically takes the form of a set of closed functions or a lookup table, used to estimate the upper and lower density limits for the current temperature and pressure input conditions in real time. Empirical regression models are derived from statistical analysis of a large amount of steady-state temperature, pressure, and density data collected over long periods of equipment operation. These models are trained using polynomial fitting, surface regression, or machine learning regression algorithms (such as support vector regression (SVR) and gradient boosted tree (GBDT)) to generate a multivariate prediction model tailored to specific operating conditions. This model is used to fit empirical density ranges corresponding to temperature-pressure combinations. These two models complement each other's limitations from the perspectives of "physical principles" and "empirical data," respectively, ensuring robustness and broad adaptability of the final judgment.
[0063] The reason for adopting the dual-interval intersection judgment method of the thermodynamic model and the empirical regression model is to solve the problem that the density judgment of a single model is easily distorted when there is a temporary mismatch in the response of gas properties under complex working conditions. In non-steady-state disturbance scenarios such as buffer air mass intervention, there may be a lag relationship between temperature and pressure, which may cause deviations in judgments based on a single physical model or a single data model, thereby misjudging the data as "normal" or "abnormal". By introducing two models with completely different sources but consistent data inputs, and independently predicting and cross-validating the same set of temperature and pressure data, it is possible to effectively identify density data on the edge of gas property mismatch and achieve accurate identification of "disordered internal structural relationships of the data". This method not only improves the detection sensitivity of atypical intervention states, but also improves the reliability of data credibility screening. It is an abnormal data judgment strategy that is highly automated, soft logic-driven, generalizable, and engineering-practical.
[0064] For density data determined to be structurally inconsistent data, the temperature data and pressure data in the corresponding time period are combined with the density data to identify whether the detection period corresponding to the density data is in a buffer air mass intervention state;
[0065] In this embodiment, for density data determined to be structurally inconsistent data, the temperature data and pressure data within the corresponding time period are combined to identify whether the detection period corresponding to the density data is in a buffer air mass intervention state. Specifically,
[0066] For density data determined to be structurally inconsistent data, compare the change direction of the density data with the pressure data in the corresponding time period. If the change direction of the pressure data is unidirectionally rising within a preset number of consecutive sampling periods, and the change amplitude of the corresponding density data within the preset number of consecutive sampling periods is less than a preset density response fluctuation threshold, it is determined that there is an asynchronous change between the pressure and density.
[0067] In order to achieve "for density data determined to be structurally inconsistent data, compare the change direction of the density data with the pressure data in the corresponding time period; if the change direction of the pressure data is unidirectionally rising within a preset number of consecutive sampling periods, and the change amplitude of the corresponding density data within the preset number of sampling periods is less than the preset density response fluctuation threshold, then it is determined that there is an asynchronous change between pressure and density", this can be achieved through the collaborative work of software sampling control logic and data trend discrimination algorithm. The specific implementation method is as follows: During the real-time data acquisition process of the gas densitometer, the sampling module continuously acquires data on three physical quantities: temperature, pressure, and density, at set time intervals and stores them in frames based on sampling timestamps. Subsequently, upon identifying structurally inconsistent density data at a given moment, the data processing logic automatically backtracks a preset number of consecutive sampling cycles (for example, 5 to 8 cycles, based on historical data statistical analysis). This preset number is typically determined by combining the sampling frequency and the typical duration of buffer air mass intervention and is stable and adjustable. The software logic then performs a directional analysis of the pressure data within this period, determining whether the pressure values within each adjacent period strictly increase, thereby confirming a "unidirectional rise" characteristic. Simultaneously, the amplitude variation range of the density data within the same period is analyzed, namely, whether the difference between the maximum and minimum values is less than a preset density response fluctuation threshold. This threshold is set by statistically analyzing the density fluctuation range under normal operating conditions to ensure that it can identify abnormal conditions where the density does not fluctuate significantly when the pressure increases. If both conditions are met, the software determines that there is asynchronous response between the pressure and density, indicating that the current state may be a mismatch response due to buffer air mass intervention. This method is completely based on rule matching and logical judgment of time series data streams, and is suitable for embedded recognition modules or edge data processing platforms in online monitoring scenarios.
[0068] Performing a difference operation on the density data and the predicted density value calculated by a preset empirical regression model based on the temperature data and pressure data. If the difference is greater than a preset deviation judgment threshold within a preset number of consecutive sampling periods, it is determined that the density data has an abnormal deviation change;
[0069] In order to achieve "performing a difference operation between the density data and the predicted density value calculated by a preset empirical regression model based on the temperature data and pressure data, and if the difference is greater than a preset deviation judgment threshold within a preset number of consecutive sampling cycles, then it is judged that the density data has an abnormal deviation change", this can be accomplished through the collaboration of the data fitting module and the real-time difference judgment algorithm in the software. The specific method is: after collecting real-time temperature, pressure and density data, the temperature data and pressure data in the current sampling period are first input into a pre-trained empirical regression model. The model is usually constructed based on a large amount of sampling data under historical stable operating conditions. A nonlinear fitting relationship between temperature, pressure and density is established through machine learning methods (such as multivariate regression, support vector regression, etc.), and the predicted density value of the current period is output; then, the software calculates the difference between the predicted value and the actual density sampling value, and records the absolute value of the difference; the processing will be cyclically judged within the range of a "preset number of consecutive sampling periods", and the number is usually determined based on the system sampling frequency and the duration of the typical intervention of the buffer air mass to ensure the stability of the deviation trend identification; the judgment logic is: if the absolute values of all differences in these periods are greater than the "preset deviation judgment threshold", the density data is marked as having a persistent abnormal deviation. This threshold isn't a fixed constant. Instead, it's determined by analyzing the average deviation range of density prediction errors in historical normal operation data (for example, using a ±3σ standard deviation band), and adding a margin based on actual project requirements. The goal is to eliminate misjudgments due to minor fluctuations, ensuring that only cases where pressure and temperature remain reasonable but density data consistently deviates from the predicted trend are considered true deviation anomalies. The entire judgment process can be executed in real time on edge computing nodes or cloud platforms through software logic, offering high flexibility and adaptability, making it particularly suitable for dynamic identification scenarios in embedded systems.
[0070] A change curve is constructed using the temperature data and pressure data within the preset number of sampling periods as input, and a slope change rate of the change curve within the preset number of sampling periods is calculated. If the sign of the slope change rate changes at the current sampling point and its absolute value exceeds the inflection point identification threshold, then an inflection point of the temperature-pressure relationship is determined to exist;
[0071] In order to achieve "constructing a change curve with the temperature data and pressure data within the preset number of sampling periods as input, and calculating the slope change rate of the change curve within the preset number of sampling periods, if the sign of the slope change rate changes at the current sampling point and its absolute value exceeds the inflection point recognition threshold, it is determined that there is an inflection point of change in the temperature-pressure relationship", this can be achieved through the curve construction and change trend recognition algorithm module integrated in the software. The specific approach is as follows: after receiving the temperature data and pressure data within a continuous sampling period, the software system will pair the two types of data based on the time axis to form a two-dimensional coordinate sequence, and use smooth interpolation or polynomial fitting algorithms (such as cubic spline or low-order fitting) to generate a temperature-pressure change curve; then, at each sampling point, the local slope of the curve in each period is extracted through differential calculation or sliding window linear regression, and the change between the slope values of two adjacent periods is further calculated to form the "slope change rate" second-order characteristic indicator; when the system detects that the slope change rate of a certain sampling point switches from positive to negative or from negative to positive in sign, and the absolute value of the rate change exceeds the "inflection point recognition threshold", the point can be identified as a structural inflection point in the temperature-pressure change relationship. This "inflection point identification threshold" isn't a manually set constant; rather, it's derived from statistical analysis of the slope variations of a large number of historical temperature-pressure curves under normal operating conditions. The typical rate of change of key turning points is typically extracted from the data using the offset standard deviation method or the local maximum gradient method. This is then determined by adding a safety margin based on the slope mutation characteristics during buffer air mass intervention. This threshold prevents small, normal fluctuations from being mistaken for inflection points, thereby improving identification accuracy and engineering practicality. This entire process is completed in real time by embedded judgment logic or edge algorithm modules, ensuring a highly sensitive response to nonlinear trends in the temperature-pressure relationship in real industrial environments.
[0072] If there are asynchronous changes between pressure and density, and the density data has abnormal deviation changes, and there is an inflection point in the temperature-pressure relationship, the detection period corresponding to the density data is identified as being in a buffer air mass intervention state.
[0073] In order to achieve "if there are asynchronous changes between pressure and density, and there are abnormal deviation changes in the density data, and there is an inflection point in the change of the temperature-pressure relationship, then the detection period corresponding to the density data is identified as being in the buffer air mass intervention state", this can be accomplished through the state judgment engine configured in the software to perform multi-conditional logical fusion judgment. The specific implementation method is: the system first executes three judgment modules for asynchronous response identification, deviation fluctuation detection, and temperature-pressure curve inflection point identification for each continuous sampling period in the preprocessing stage. After running, the three modules will output Boolean flags, such as "asynchronous = True", "deviation abnormality = True", and "inflection point existence = True"; then, the state judgment engine will perform a combinational logical comparison on these flags, and it is usually set to trigger the judgment only when all conditions are met. That is, when the three judgment conditions are all True in the same detection period, the system will automatically mark the time period in which the density data is located as "buffer air mass intervention state" and append the state mark to the result data structure for subsequent use. The entire process uses sampling timestamps as indexes, ensuring that the three sub-judgments are derived from the same data segment, avoiding cross-period interference. It also supports adding confidence factors to status tags, enabling flexible policy adjustments in edge judgment scenarios. This recognition method relies entirely on threshold judgments and logical combination conditions set in the software, requiring no external device intervention. It can run efficiently in edge computing nodes or SCADA system data processing units, offering high real-time, stability, and scalability.
[0074] The purpose of performing a multi-dimensional assessment of density data identified as structurally inconsistent, combined with the corresponding temperature and pressure data for the corresponding time period, is to accurately identify unsteady-state disturbances caused by buffer gas mass interference, thereby avoiding misidentification as normal measurement conditions and erroneous responses. During online gas density meter testing, buffer gas mass interference can cause a sharp increase in local pressure while the density response lags or becomes abnormally stable. Traditional methods based on single-point numerical range assessments fail to detect the physical mismatch between the temperature-pressure relationship and the density response. By simultaneously assessing whether the response relationship between pressure and density is synchronized, whether the density value significantly deviates from the empirical model estimate, and whether the temperature and pressure changes exhibit a sudden slope change, comprehensive identification of the interference condition can be achieved from three perspectives: response trend, model deviation, and dynamic changes. This approach not only enhances the robustness of anomaly detection but also effectively distinguishes buffer gas mass interference from general fluctuations. This allows subsequent control strategies to be based on reliable data, avoiding issues such as valve misoperation, pressure regulation chaos, or abnormal energy consumption caused by data misjudgment, thereby improving the stability of the entire detection system and the safety of industrial operations.
[0075] In the case of a buffer air mass intervention state, a detection point is constructed based on the temperature, pressure and density data collected in real time by the gas densitometer. This detection point is then compared with the representative state space constructed based on the historical stable state to determine the degree of attribute mismatch of the density data.
[0076] In this embodiment, in the case of a buffer air mass intervention state, a detection point is constructed based on the temperature data, pressure data, and density data collected in real time by the gas densitometer, and the detection point is compared with the representative state space constructed based on the historical stable state to determine the degree of attribute mismatch of the density data. Specifically, the following steps are included:
[0077] The temperature data, pressure data, and density data collected by the gas densitometer during the detection period identified as the buffer air mass intervention state are standardized respectively, and combined according to the same timestamp to form a temperature, pressure, and density triple, which is constructed as the current detection point;
[0078] Based on the temperature, pressure, and density data collected by the gas densitometer under historical stable operating conditions, multiple temperature-pressure-density triplet samples are constructed. Several representative state clusters are extracted in the multidimensional feature space through multi-scale clustering. These representative state clusters together constitute a representative state space.
[0079] Calculate the Euclidean distance and Mahalanobis distance between the current detection point and the center of gravity of each representative state cluster respectively, and fuse the two distance indicators based on the weighted minimum offset principle to obtain the offset score of the detection point relative to each state cluster;
[0080] The obtained minimum deviation score is compared with the preset attribute mismatch threshold interval, and the attribute mismatch degree of the density data is determined according to the comparison result.
[0081] In this embodiment, the temperature data, pressure data, and density data collected by the gas densitometer during the detection period identified as the buffer air mass intervention state are standardized and combined according to the same timestamp to form a temperature, pressure, and density triple, which is constructed as the current detection point. Specifically,
[0082] The temperature data, pressure data, and density data corresponding to each sampling point within the detection period are linearly normalized according to their respective historical means and standard deviations to obtain temperature normalized values, pressure normalized values, and density normalized values;
[0083] To achieve standardized processing of temperature, pressure, and density data, the software first performs statistical analysis on the large amount of temperature, pressure, and density data collected by the gas densitometer during historical stable operation, calculating the historical mean and standard deviation of each type of data. Subsequently, the raw temperature, pressure, and density values obtained at each sampling point during the current detection period are converted into dimensionless standardized values using a linear normalization method (i.e., "current value minus mean, then divided by standard deviation"). This process, which can be automatically performed by the data processing module, achieves a unified scale mapping of different physical quantities, eliminating interference caused by dimensional differences in physical quantities. This allows distance measurement and offset judgment of the three types of temperature, pressure, and density data in a unified feature space, thereby improving the accuracy and mathematical operability of subsequent attribute mismatch analysis.
[0084] The temperature normalized values, pressure normalized values, and density normalized values corresponding to the same timestamp are merged to form a set of three-dimensional normalized data vectors, with each set of normalized vectors as a detection point;
[0085] This step can be implemented by software during the data preprocessing phase. Specifically, the system first aligns the three types of raw sampling data (temperature, pressure, and density) according to the timestamp to ensure that each set of data comes from the same sampling time point. The corresponding temperature values, pressure values, and density values are then linearly normalized according to the aforementioned method to obtain temperature-standardized values, pressure-standardized values, and density-standardized values. The software then merges the three types of standardized values with the same timestamp into a set of three-dimensional standardized data vectors, thereby constructing a unified detection point containing three types of physical properties. The purpose of this is to unify the multi-source physical features through vectorized expression, so that each detection point retains the multi-dimensional gas state information at the sampling moment and has the basic format for subsequent spatial clustering analysis, offset calculation, and representative comparison, thereby constructing a feature space expression with a standard data structure and a compact computational structure.
[0086] All normalized data vectors within the detection period are arranged in time series to form a current detection point set for subsequent representative state comparison.
[0087] This step can be achieved through the data structure management mechanism of the software. Specifically, after completing the standardization and three-dimensional vector construction of each set of temperature, pressure and density data, the system sorts all detection points according to the timestamp order corresponding to each standardized data vector, and stores them in a time-ordered vector list in sequence, thereby forming a set of detection points for the current detection period. This operation is achieved by sorting the timestamp field in ascending order and maintaining the sequential storage of data to ensure that the arrangement of the detection points strictly reflects the continuous evolution of the gas state over time. The purpose of this is to provide a coherent and complete sequence input for subsequent comparison with the historical representative state space. It also facilitates the execution of comprehensive offset evaluation, pattern recognition or operating trend analysis based on the sequence structure, thereby improving the system accuracy of density data attribute mismatch judgment and the ability to sensitively capture operating condition changes.
[0088] In this embodiment, multiple temperature-pressure-density triplet samples are constructed based on the temperature data, pressure data, and density data collected by the gas densitometer under historical stable operation. Several representative state clusters are extracted in the multidimensional feature space through multi-scale clustering. The representative state clusters together constitute a representative state space, specifically:
[0089] The temperature data, pressure data, and density data collected by the gas densitometer under historical stable operating conditions are extracted, and the temperature data, pressure data, and density data collected at the same sampling time point are combined to construct a triplet sample of temperature, pressure, and density to form a historical state sample set;
[0090] The data management and feature extraction functions of the software can be used to perform structured processing on the data collected by the gas density meter under historical stable operating conditions. First, by setting stability criteria such as no abnormal alarms and constant operation control, the time periods marked as stable working conditions are screened out from the historical data; then, the three types of original data, temperature, pressure and density, are extracted during these time periods, and the three types of data are aligned one by one based on the timestamp of each sampling time point, and combined into temperature, pressure and density triplets at the same time point. All triplets constitute a historical state sample set in chronological order, which serves as the core input for the subsequent establishment of a representative state space. In this way, it can be ensured that the constructed historical samples are derived from the stage of stable physical state and have cross-parameter consistency, providing a stable and reliable feature reference system for subsequent density attribute judgment.
[0091] Each triplet sample in the historical state sample set is normalized separately so that its numerical range is mapped to a unified feature scale, and the normalized samples are embedded into the three-dimensional feature vector space to form a standardized sample set;
[0092] The software can perform normalization on each temperature, pressure, and density triplet sample in the historical state sample set. Specifically, the overall maximum and minimum values, or mean and standard deviation, of each physical parameter (temperature, pressure, density) in the historical sample set are calculated. Each dimension in the triplet is then converted to a dimensionless, standardized value using linear normalization or Z-score standardization. This maps all sample eigenvalues to a uniform numerical range, eliminating scale differences between parameters. The normalized three values are combined to form a three-dimensional standard vector, which the system embeds into the eigenvector space to construct a uniformly structured and comparable set of standardized samples. This process aims to ensure that different physical quantities have the same evaluation weight in clustering and distance analysis, avoiding model drift or misjudgment due to inconsistent dimensions, and improving the computational stability and judgment accuracy of subsequent representative state identification.
[0093] The hierarchical density peak clustering algorithm is used to cluster the standardized sample set. By setting several feature distance thresholds, the initial cluster cores with different distribution density are extracted to form several candidate state clusters.
[0094] The software can apply a hierarchical density peak clustering algorithm to a standardized sample set for clustering. The algorithm first analyzes the local density distribution and characteristic distances of the samples in a three-dimensional feature vector space. Based on the density estimates within the neighborhood of each sample point and its relative distance to high-density points, it identifies samples with high local density and a large distance from other high-density points as initial cluster cores. Subsequently, multiple characteristic distance thresholds are set to construct a hierarchical clustering scale. Cluster boundaries are gradually extended for samples around the initial core along the density gradient, forming multiple candidate state clusters of varying degrees of density. The "hierarchical density peak clustering algorithm" is an unsupervised clustering method that combines density sensitivity with local structure awareness. It can detect non-spherical clusters and automatically identify cluster centers, making it particularly suitable for multi-scale and unevenly distributed industrial gas state samples. This approach aims to effectively identify multiple stable state clusters that are statistically representative and discriminative of operating conditions within the standardized data, providing a high-quality, well-structured candidate set for constructing a representative state space, thereby enhancing the accuracy and robustness of subsequent abnormal state identification.
[0095] Each candidate state cluster is screened based on the conditions that the average distance between sample points within the cluster is lower than a first clustering density threshold, the distance between cluster centers of gravity is higher than a second inter-cluster difference threshold, and the boundary gradient change rate is lower than a third boundary fuzziness threshold. The candidate state clusters that meet all the conditions are retained as the representative state cluster set. The first clustering density threshold, the second inter-cluster difference threshold, and the third boundary fuzziness threshold are all preset;
[0096] The software automatically screens candidate state clusters through a clustering post-processing module. This is achieved by first calculating the Euclidean distance between each pair of sample points within each candidate state cluster, obtaining the average distance and comparing it with a first cluster closeness threshold. If the average distance is less than this threshold, the sample distribution within the cluster is considered sufficiently concentrated. Second, the distance between the geometric centers of any two candidate clusters is measured. If this distance is greater than a second inter-cluster difference threshold, the inter-cluster difference is significant. Third, the rate of change of the characteristic gradient of sample points at each cluster boundary is estimated. If the boundary changes smoothly and without abrupt changes, the gradient change rate should be less than a third boundary fuzziness threshold. Candidate clusters that meet all three conditions are retained as representative state clusters. These three thresholds can be set empirically based on extensive historical data or obtained through adaptive training to ensure a balance between cluster stability and discriminative performance. This approach effectively eliminates non-ideal clusters with fuzzy cluster boundaries, redundant clusters, or loose clusters within clusters, ensuring that the clusters ultimately included in the representative state space are high-quality, representative, and have clear boundaries, thereby improving the accuracy and reliability of attribute mismatch detection.
[0097] All state clusters in the representative state cluster set are uniformly constructed into a representative state space, which is used for subsequent feature comparison with the detection points and judgment of the degree of attribute mismatch.
[0098] The software's spatial modeling and feature indexing modules can be used to unify and integrate the resulting representative state clusters into a representative state space. This is achieved by spatially mapping the triplet sample vectors within each representative state cluster and parametrically modeling the cluster's boundaries, center of gravity, and typical density distribution to construct a cluster-level feature index. The system then organizes all state clusters into a multi-cluster nested three-dimensional vector space using a unified data structure. A spatial indexing mechanism, such as a KD tree or ball tree, is established for fast query and comparison, supporting the rapid projection and matching of subsequent detection points. The purpose of constructing the representative state space is to provide a comparable "normal state feature set" for subsequent real-time detection points. This allows attribute mismatch determination to be based not on single-point differences but on the overall deviation of the entire sample trajectory from the stable state distribution, thereby enhancing the system's judgment stability, interference resistance, and interpretability under complex operating conditions. This process can be fully implemented in the software using existing clustering analysis and spatial modeling algorithms, without the need for human intervention.
[0099] In this embodiment, the Euclidean distance and Mahalanobis distance between the current detection point and the center of gravity of each representative state cluster are calculated respectively, and the two distance indicators are fused according to the weighted minimum offset principle to obtain the offset score of the detection point relative to each state cluster. The specific calculation process is as follows:
[0100] Each three-dimensional normalized vector in the current detection point set is input in sequence, and the Euclidean distance is calculated with the centroid vector of each representative state cluster in the representative state space as the spatial geometric offset measure between the current detection point and each state cluster;
[0101] This process is implemented using the feature matching and distance calculation module within the software. Specifically, each three-dimensional normalized vector from the current set of detection points is sequentially read and fed into the computation engine as a query sample. The system then iterates through each representative state cluster in the representative state space and extracts its corresponding centroid vector, which is calculated by averaging the three feature dimensions of all sample vectors within that cluster. For each set of detection points compared to the cluster centroid, the system calculates the squared differences between the temperature, pressure, and density dimensions based on the Euclidean distance formula, sums them, and finally takes the square root to obtain the Euclidean distance between the detection point and the corresponding state cluster in the three-dimensional feature space. This distance can be considered the geometric offset of the current detection point relative to the cluster center. By repeating this process for each representative state cluster, the software generates an array of Euclidean distances corresponding to each detection point, providing a foundational metric for subsequent representativeness analysis and offset score fusion. This approach effectively quantifies the spatial proximity of a detection point to a stable state in the normalized feature space and is a crucial foundation for anomaly detection.
[0102] The covariance matrix of the sample distribution of the current detection point and each state cluster is used as a parameter to calculate the Mahalanobis distance between it and the center of gravity of the state cluster, which reflects the abnormality of the detection point in the statistical distribution structure of each cluster.
[0103] This step is implemented using the statistical distance evaluation module within the software. Specifically, the system first calculates the covariance matrix of each representative state cluster based on all three-dimensional standardized sample vectors within the cluster. This matrix describes the cluster's joint distribution structure across the three characteristic dimensions of temperature, pressure, and density. Next, for any three-dimensional standardized vector within the current detection point, the software extracts the corresponding centroid vector from the representative state cluster and performs a vector difference operation with the current detection point to obtain the difference vector from the cluster's centroid. Subsequently, the system uses the cluster's covariance matrix as a metric, calculating the Mahalanobis distance of the detection point relative to the cluster's centroid through matrix inversion and vector multiplication. This distance comprehensively considers the covariance relationships between different features and thus reflects whether the detection point occupies a representative position in the statistical distribution structure of the state cluster. Compared to the Euclidean distance, the Mahalanobis distance is more effective in identifying deviations caused by coupling between features and has higher sensitivity and discriminability for identifying representative anomalies under complex operating conditions. In this way, the software generates a statistical structural deviation indicator for each detection point from each state cluster, providing key input for subsequent fusion analysis.
[0104] The calculated Euclidean distance and Mahalanobis distance are normalized, and based on a pre-set weighting coefficient, the two types of distances are linearly fused to obtain the offset score of the detection point relative to each state cluster.
[0105] This process is implemented through the software's multi-metric fusion scoring module. Specifically, the system first obtains the corresponding Euclidean distance and Mahalanobis distance arrays for each detection point, corresponding to multiple representative state clusters. To ensure comparability between the different metrics, the software normalizes the two distance data sets, using a minimum-maximum normalization method to convert each distance value into a proportional value between 0 and 1. Next, the software performs a linear weighted fusion of the normalized Euclidean and Mahalanobis distances using pre-set weighting coefficients. The calculation formula is: Fusion offset score = α × Euclidean distance + β × Mahalanobis distance, where α and β are weighting coefficients, ensuring α + β = 1, and are set based on experience or training results to balance the weights of geometric and statistical offsets. The smaller the fusion score, the closer the detection point is to the state cluster and the more representative it is. In this way, the system can comprehensively score the similarity of each detection point to each representative state cluster, providing an accurate basis for subsequent determination of the degree of attribute mismatch and classification.
[0106] The main purpose of doing this is to comprehensively evaluate the representativeness of the current detection point in the multidimensional gas property space, so as to achieve accurate identification of the credibility of the gas density data working condition. Traditional methods usually rely only on a single distance indicator (such as Euclidean distance) to measure the degree of deviation of the detection point from the reference state, but in actual complex working conditions, there is a statistical correlation between different characteristics (temperature, pressure, density), and only considering the geometric distance may mask important structural differences. Therefore, the introduction of Mahalanobis distance can reveal whether the detection point deviates from the statistical distribution structure of the state cluster, and the fusion of the two can take into account the two dimensions of spatial position and statistical characteristics, and obtain more accurate and stable similarity judgment results through weighted minimum offset scoring. This fusion score not only improves the ability to identify non-representative data under the intervention of buffer air masses, but also provides a reliable basis for subsequent data classification, correction or elimination. It is a key step in realizing high-precision online density detection methods.
[0107] In this embodiment, the obtained minimum offset score is compared with a preset attribute mismatch threshold interval, and the attribute mismatch degree of the density data is determined according to the comparison result, as follows:
[0108] Extract the minimum offset score from the offset scores of the detection point relative to each state cluster;
[0109] The minimum offset score can be extracted by constructing a fusion offset score vector between the detection point and all representative state clusters in software. Specifically, the following method is used: First, the fusion offset score between the current detection point and each representative state cluster is calculated, and these scores are organized into a one-dimensional score array in an indexed manner. Then, a traversal comparison operation is performed within this score array to identify the score with the smallest numerical value and record its corresponding state cluster index. The resulting minimum score is the lowest offset exhibited by the detection point relative to the closest representative state among all state clusters. This operation can be implemented using a standard minimum value function or vector search algorithm, and the result serves as the basis for subsequent attribute mismatch determination, ensuring accurate identification of the state cluster closest to the current detection point from multiple similar operating conditions. This method not only has clear computational logic but also facilitates real-time execution in embedded or online detection platforms, making it suitable for dynamic analysis and processing of density data.
[0110] The minimum offset score is compared with the preset attribute mismatch threshold interval. When the minimum offset score is less than the lower limit of the attribute mismatch threshold interval, the attribute mismatch degree of the density data is judged to be low, that is, the density data is representative; when the minimum offset score is greater than or equal to the lower limit of the attribute mismatch threshold interval and less than or equal to the upper limit, the attribute mismatch degree of the density data is judged to be medium, that is, the representativeness of the density data is questionable; when the minimum offset score is greater than the upper limit of the attribute mismatch threshold interval, the attribute mismatch degree of the density data is judged to be high, that is, the density data is unrepresentative.
[0111] When the minimum offset score is less than the lower limit of the attribute mismatch threshold interval, it indicates that the current detection point deviates minimally from the representative state cluster in terms of geometric position and statistical structure. The density data highly aligns with the historical stable operating conditions and is highly representative of the operating conditions. Therefore, it can be directly used as trusted data for subsequent monitoring, adjustment, or alarm logic without additional processing. When the minimum offset score is between the upper and lower limits of the attribute mismatch threshold interval, it indicates that the detection point has a certain degree of offset in space or statistical structure, and the representativeness of the density data is uncertain. It may include the influence of buffer air mass intervention, but it is not obvious. Such data is suitable for generating corrected density data through historical trend modeling or interpolation to enhance the robustness of the control logic. When the minimum offset score is higher than the upper limit of the attribute mismatch threshold interval, it indicates that the current detection point has significantly deviated from the representative state space, the density data is obviously anomaly or distorted, and lacks reference value. If such data continues to be used for system control, it may cause misjudgment or misadjustment. It should be immediately eliminated and the corresponding safety policy should be triggered to ensure the reliability and safety of system operation.
[0112] The purpose of comparing the minimum offset score with a preset attribute mismatch threshold range and classifying the attribute mismatch of density data accordingly is to automatically identify and grade the credibility of gas density data during dynamic monitoring, preventing system misresponses caused by non-representative data mistakenly entering the control logic. The minimum offset score essentially reflects the proximity of the current detection point to the historical representative state in feature space. It comprehensively considers the offset of the detection point in two dimensions: geometric distance (Euclidean distance) and statistical distribution difference (Mahalanobis distance). A small offset score indicates that the detection point is highly close to a representative state cluster. That is, its temperature, pressure, and density combination is very consistent with the state during stable system operation, thus being representative. A offset score in the middle of the threshold range indicates that the detection point has some similarity to the representative state but still deviates significantly, indicating low credibility. A offset score significantly above the upper threshold indicates that the detection point is far from any representative state and is likely affected by abnormal factors such as buffer air masses, resulting in a loss of representativeness of the operating conditions. Therefore, this grading mechanism can not only improve the automatic evaluation capability of data quality, but also provide a clear basis for subsequent differentiated control strategies, fundamentally improving the reliability and adaptability of online detection methods under complex working conditions.
[0113] The "preset attribute mismatch threshold interval" can be determined by statistically analyzing the distribution characteristics of offset scores at different levels of representativeness in historical operating data. Specifically, the following approach is used: First, detection points are constructed and their corresponding minimum offset scores are calculated for existing historical stable operating condition data, representative questionable data, and known anomaly samples. Then, the offset score results for these three types of samples are analyzed, for example, using histogram distribution fitting, kernel density estimation, or cluster boundary methods to identify the boundary characteristics of their score sets. Based on this, the maximum value of the stable sample score, the minimum value of the anomaly sample score, and the median offset range of the representative questionable sample score are extracted as reference boundaries. Based on engineering experience, reasonable lower and upper thresholds are set, corresponding to the boundaries between "representative" and "unrepresentative," respectively. This results in a closed interval serving as the attribute mismatch threshold interval. This interval can be generated during the training phase and loaded during system initialization. It can also be dynamically updated based on long-term operation to improve adaptability and judgment accuracy. This method ensures that the threshold interval is data-supported and relevant to the operating conditions, effectively distinguishing data states at different levels of representativeness.
[0114] Based on the determined degree of attribute mismatch, density data is classified into three levels: representative, questionable, and unrepresentative. Differentiated processing is performed accordingly: representative density data is used in control logic, questionable density data is replaced with revised density data generated based on historical data and used in control logic, and unrepresentative density data is eliminated and safety control operations are performed.
[0115] In this embodiment, the density data is divided into three levels according to the determined attribute mismatch degree: representative, questionable representativeness, and unrepresentative. Differentiated processing is performed accordingly, specifically:
[0116] Density data that are judged to have a low degree of attribute mismatch are classified into representative levels, and the density data are directly input into the subsequent control logic for process adjustment, alarm threshold judgment and metrology correction;
[0117] The goal of "classifying density data determined to have a low degree of attribute mismatch as representative and directly feeding this density data into subsequent control logic for process adjustment, alarm threshold determination, and metrological correction" can be achieved through the software system's built-in data labeling mechanism and automated logic flow. Specifically, after the density data passes the attribute mismatch determination, the software assigns it a "representative" data level label. This label is attached to the data object as an identification mark. After the data flow scheduling module recognizes this label, it automatically routes it to downstream control logic modules, including process adjustment units (such as those controlling gas mixing ratios and regulating valve openings), alarm determination units (such as those triggering alarms by comparing with set thresholds), and metrological correction units (such as those used to correct cumulative flow or calorific value calculations in real time). This design ensures that only data that has been dually verified for physical state consistency and predictive model rationality enters the critical control chain. This improves the accuracy of control responses, reduces the risk of system intervention caused by misjudgments, and ensures the stable and efficient operation of the gas transmission and distribution system.
[0118] Density data that are judged to have a moderate degree of attribute mismatch are classified as representativeness questionable. Based on the density distribution trend of the closest sample point in the historical representative state cluster, a revised density estimate is generated to replace the original density data. The revised density estimate is then used in the control logic.
[0119] The software's similarity search and interpolation fitting mechanism can be used to classify density data identified as having a moderate attribute mismatch as questionable representativeness. Based on the density distribution trend of the closest sample point in the historical representative state cluster, a revised density estimate is generated to replace the original density data. This revised density estimate is then used in the control logic. Specifically, when density data is marked as questionable representativeness, the system extracts multiple triplet samples with similar temperature and pressure characteristics from the historical representative state cluster. Based on the density distribution trends of these samples, a density estimate is calculated using local weighted regression (such as LOESS regression) or nearest neighbor interpolation in high-dimensional space to serve as a correction for the current data. This revised density estimate has statistical properties consistent with the historical stable state, effectively compensating for the uncertainty in the attribute consistency of the original density data. After correction, the estimate is assigned a "corrected controllable" flag and passed to the control logic for execution of relevant process control tasks. This approach aims to introduce a repair mechanism based on empirical data without completely discarding potentially useful data, thereby ensuring data credibility while maintaining the continuity and stability of system responses.
[0120] Density data that is judged to have a high degree of attribute mismatch is classified as a non-representative level, and the density data is excluded from participating in the control logic execution, and the preset safety control operations are triggered, including maintaining the current gas regulation state unchanged, cutting off the density data path, and issuing an abnormal prompt mark.
[0121] The system can classify density data identified as having a high degree of attribute mismatch as non-representative, exclude it from participating in control logic execution, and trigger pre-defined safety control actions. This can be achieved through a combination of the software system's abnormal data blocking mechanism and the safety policy scheduling mechanism. Specifically, when a density data point is identified as having a high degree of attribute mismatch, the system first marks it as "non-representative" in the data processing pipeline and triggers the rule engine to perform a disconnection operation, automatically blocking the density data from flowing to the control logic, preventing it from being used to trigger process adjustments or alarm responses. Simultaneously, according to the pre-defined safety control policy, the system immediately invokes a lock command to maintain the current operating conditions, suspending all adjustments driven by the density data to ensure process stability. Furthermore, the system triggers an exception notification process, sending a status alert to higher-level monitoring interfaces or maintenance personnel, marking the data as invalid and requiring further investigation of its source and gas source status. This approach is necessary because a high degree of mismatch means that the density data has completely lost its representative meaning in the current physical environment. Continued use directly leads to the risk of misjudgment and miscontrol. Therefore, by isolating risky data through this step and taking timely steady-state response and prompt mechanisms, the system cascading reactions and safety hazards caused by erroneous data can be minimized.
[0122] Attach structured labels to density data, including representativeness level, data source type, buffer air mass intervention status flag, and control response path flag.
[0123] Attaching structured labels to density data can be achieved through the metadata annotation module integrated into the software system. In specific implementation, after determining the degree of attribute mismatch and performing differentiation processing, the system automatically calls the label generator module to generate a set of structured labels for each piece of density data being processed. This label set is bound to the raw density data in the form of key-value pairs. Fields include: representativeness level (e.g., "representative," "questionable," or "unrepresentative"), which indicates whether the data can be directly used for control decisions; data source type (e.g., "real-time acquisition," "historical interpolation," or "model estimation"), which identifies the data acquisition method; buffer air mass intervention status flag (e.g., "yes" or "no"), which indicates whether the data is subject to buffer air mass interference identification; and control response path flag (e.g., "participating in regulation," "alternative interpolation," or "safety lock"), which specifies the execution strategy path that the data should trigger in the control system. The entire label generation process relies on the judgment results of the preceding data analysis module and is written to the database or message bus when the data is output or stored, ensuring that each business module can clearly perceive the data status attributes when subsequently calling it.
[0124] The reason for adding structured tags to density data is mainly to enhance the contextual transparency and behavioral controllability of data in the collaborative use of multiple processes and modules. Since density data is often used to drive key processes such as valve adjustment, alarm judgment, and load forecasting in gas transmission and distribution systems, it is very easy to cause misuse if its representativeness or source is unclear. Therefore, the introduction of structured tags can not only improve the interpretability of data, enabling operation and maintenance personnel and algorithm modules to clearly understand the current state of data at the physical and processing levels, but also serve as the basis for conditional judgment in decision-making logic, realizing intelligent hierarchical response and refined control based on data credibility, thereby comprehensively improving the system's ability to respond to abnormal conditions and suppress control risks.
[0125] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0126] The above embodiments can be implemented in whole or in part via software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. A computer program product comprises one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the processes or functions according to the embodiments of the present application are fully or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means (e.g., infrared, wireless, microwave, etc.). A computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. Semiconductor media can be solid-state drives.
[0127] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0128] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0129] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the embodiments described above are merely illustrative. For example, the division of units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0130] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0131] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0132] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A gas density meter online detection method, characterized in that: The specific steps include: Acquire temperature data, pressure data, and density data collected by the gas density meter in real time, and determine whether the density data collected by the gas density meter is structurally inconsistent data by combining a pre-set thermodynamic state model and an empirical regression model; For density data determined to be structurally inconsistent data, the temperature data and pressure data in the corresponding time period are combined with the density data to identify whether the detection period corresponding to the density data is in a buffer air mass intervention state; In the case of a buffer air mass intervention state, a detection point is constructed based on the temperature, pressure and density data collected in real time by the gas densitometer. This detection point is then compared with the representative state space constructed based on the historical stable state to determine the degree of attribute mismatch of the density data. Based on the determined degree of attribute mismatch, the density data is divided into three levels: representative, questionable, and unrepresentative, and differentiated processing is performed accordingly; Attach structured labels to density data, including representativeness level, data source type, buffer air mass intervention status flag, and control response path flag.
2. The gas density meter online detection method according to claim 1, characterized in that: Methods for determining whether the density data collected by the gas density meter is structurally inconsistent data include: The temperature data and pressure data are respectively input into a pre-set thermodynamic state model and an empirical regression model to obtain two predicted density value intervals. It is then determined whether the density data collected by the gas densitometer falls within the intersection of the two predicted density value intervals at the same time. If not, the density data is determined to be structurally inconsistent data. Among them, the pre-set thermodynamic state model is a physical calculation model used to infer the theoretical range of gas density based on temperature data and pressure data; the pre-set empirical regression model is a function model trained based on historical operation data, which is used to fit the empirical range of gas density based on temperature data and pressure data.
3. The gas density meter online detection method according to claim 2, characterized in that: For density data that is determined to be structurally inconsistent, the temperature data and pressure data in the corresponding time period are combined with the density data to identify whether the detection period corresponding to the density data is in a buffer air mass intervention state. Specifically: For density data determined to be structurally inconsistent data, compare the change direction of the density data with the pressure data in the corresponding time period. If the change direction of the pressure data is unidirectionally rising within a preset number of consecutive sampling periods, and the change amplitude of the corresponding density data within the preset number of consecutive sampling periods is less than a preset density response fluctuation threshold, it is determined that there is an asynchronous change between the pressure and density. Performing a difference operation on the density data and the predicted density value calculated by a preset empirical regression model based on the temperature data and pressure data. If the difference is greater than a preset deviation judgment threshold within a preset number of consecutive sampling periods, it is determined that the density data has an abnormal deviation change; A change curve is constructed using the temperature data and pressure data within the preset number of consecutive sampling periods as input, and a slope change rate of the change curve within the preset number of consecutive sampling periods is calculated. If the sign of the slope change rate changes at the current sampling point and its absolute value exceeds the inflection point identification threshold, then an inflection point of the temperature-pressure relationship is determined to exist; If there are asynchronous changes between pressure and density, and the density data has abnormal deviation changes, and there is an inflection point in the temperature-pressure relationship, the detection period corresponding to the density data is identified as being in a buffer air mass intervention state.
4. The gas density meter online detection method according to claim 3, characterized in that: In the case of a buffer air mass intervention state, a detection point is constructed based on the temperature, pressure, and density data collected in real time by the gas densitometer. This detection point is then compared with the representative state space constructed based on the historical stable state to determine the degree of attribute mismatch of the density data. The specific steps include the following: The temperature data, pressure data, and density data collected by the gas densitometer during the detection period identified as the buffer air mass intervention state are standardized respectively, and combined according to the same timestamp to form a temperature, pressure, and density triple, which is constructed as the current detection point; Based on the temperature, pressure, and density data collected by the gas densitometer under historical stable operating conditions, multiple temperature-pressure-density triplet samples are constructed. Several representative state clusters are extracted in the multidimensional feature space through multi-scale clustering. These representative state clusters together constitute a representative state space. Calculate the Euclidean distance and Mahalanobis distance between the current detection point and the center of gravity of each representative state cluster respectively, and fuse the two distance indicators based on the weighted minimum offset principle to obtain the offset score of the detection point relative to each state cluster; The obtained minimum deviation score is compared with the preset attribute mismatch threshold interval, and the attribute mismatch degree of the density data is determined according to the comparison result.
5. The gas density meter online detection method according to claim 4, characterized in that: The temperature data, pressure data, and density data collected by the gas densitometer during the detection period identified as the buffer air mass intervention state are standardized respectively, and combined according to the same timestamp to form a temperature, pressure, and density triple, which is constructed as the current detection point, specifically: The temperature data, pressure data, and density data corresponding to each sampling point within the detection period are linearly normalized according to their respective historical means and standard deviations to obtain temperature normalized values, pressure normalized values, and density normalized values; The temperature normalized values, pressure normalized values, and density normalized values corresponding to the same timestamp are merged to form a set of three-dimensional normalized data vectors, with each set of normalized vectors as a detection point; All normalized data vectors within the detection period are arranged in time series to form a current detection point set for subsequent representative state comparison.
6. The gas density meter online detection method according to claim 5, characterized in that: Based on the temperature data, pressure data, and density data collected by the gas densitometer under historical stable operating conditions, multiple temperature-pressure-density triplet samples are constructed. Several representative state clusters are extracted in the multidimensional feature space through multi-scale clustering. Several representative state clusters together constitute the representative state space, specifically: The temperature data, pressure data, and density data collected by the gas densitometer under historical stable operating conditions are extracted, and the temperature data, pressure data, and density data collected at the same sampling time point are combined to construct a triplet sample of temperature, pressure, and density to form a historical state sample set; Each triplet sample in the historical state sample set is normalized separately so that its numerical range is mapped to a unified feature scale, and the normalized samples are embedded into the three-dimensional feature vector space to form a standardized sample set; The hierarchical density peak clustering algorithm is used to cluster the standardized sample set. By setting several feature distance thresholds, the initial cluster cores with different distribution density are extracted to form several candidate state clusters. Each candidate state cluster is screened based on the conditions that the average distance between sample points within the cluster is lower than a first clustering density threshold, the distance between cluster centers of gravity is higher than a second inter-cluster difference threshold, and the boundary gradient change rate is lower than a third boundary fuzziness threshold. The candidate state clusters that meet all the conditions are retained as the representative state cluster set. The first clustering density threshold, the second inter-cluster difference threshold, and the third boundary fuzziness threshold are all preset; All state clusters in the representative state cluster set are uniformly constructed into a representative state space, which is used for subsequent feature comparison with the detection points and judgment of the degree of attribute mismatch.
7. The gas density meter online detection method according to claim 6, characterized in that: The Euclidean distance and Mahalanobis distance between the current detection point and the center of gravity of each representative state cluster are calculated respectively, and the two distance indicators are fused according to the weighted minimum offset principle to obtain the offset score of the detection point relative to each state cluster. The specific calculation process is as follows: Each three-dimensional normalized vector in the current detection point set is input in sequence, and the Euclidean distance is calculated with the centroid vector of each representative state cluster in the representative state space as the spatial geometric offset measure between the current detection point and each state cluster; The covariance matrix of the sample distribution of the current detection point and each state cluster is used as a parameter to calculate the Mahalanobis distance between it and the center of gravity of the state cluster, which reflects the abnormality of the detection point in the statistical distribution structure of each cluster. The calculated Euclidean distance and Mahalanobis distance are normalized, and based on a pre-set weighting coefficient, the two types of distances are linearly fused to obtain the offset score of the detection point relative to each state cluster.
8. The gas density meter online detection method according to claim 7, characterized in that: The obtained minimum offset score is compared with the preset attribute mismatch threshold interval, and the attribute mismatch degree of the density data is determined based on the comparison result, as follows: Extract the minimum offset score from the offset scores of the detection point relative to each state cluster; The minimum offset score is compared with the preset attribute mismatch threshold interval. When the minimum offset score is less than the lower limit of the attribute mismatch threshold interval, the attribute mismatch degree of the density data is judged to be low, that is, the density data is representative; when the minimum offset score is greater than or equal to the lower limit of the attribute mismatch threshold interval and less than or equal to the upper limit, the attribute mismatch degree of the density data is judged to be medium, that is, the representativeness of the density data is questionable; when the minimum offset score is greater than the upper limit of the attribute mismatch threshold interval, the attribute mismatch degree of the density data is judged to be high, that is, the density data is unrepresentative.
9. The gas density meter online detection method according to claim 8, characterized in that: Based on the determined degree of attribute mismatch, the density data is divided into three levels: representative, questionable, and unrepresentative. Differentiated processing is performed accordingly, specifically: Density data that are judged to have a low degree of attribute mismatch are classified into representative levels, and the density data are directly input into the subsequent control logic for process adjustment, alarm threshold judgment and metrology correction; Density data that are judged to have a moderate degree of attribute mismatch are classified as representativeness questionable. Based on the density distribution trend of the closest sample point in the historical representative state cluster, a revised density estimate is generated to replace the original density data. The revised density estimate is then used in the control logic. Density data that is judged to have a high degree of attribute mismatch is classified as a non-representative level, and the density data is excluded from participating in the control logic execution, and the preset safety control operations are triggered, including maintaining the current gas regulation state unchanged, cutting off the density data path, and issuing an abnormal prompt mark.
Citation Information
Patent Citations
Density measurement device
CN109285612A
SF6 density table data abnormity self-diagnosis method, storage medium and equipment
CN119622293A