Search

CN-121997160-A - Quality control method for testing gas flow standard device and related products

CN121997160ACN 121997160 ACN121997160 ACN 121997160ACN-121997160-A

Abstract

The invention relates to the field of gas flow measurement, in particular to a gas flow standard device test quality control method and related products, wherein the method comprises the steps of collecting full life cycle data, preprocessing and obtaining an enhanced feature matrix; the method comprises the steps of obtaining an abnormal detection probability output model, obtaining real-time detection data of a gas flow standard device and matched metering equipment thereof, inputting the real-time detection data into the abnormal detection probability output model, obtaining abnormal probability, judging that the state of the device is abnormal if the abnormal probability is larger than a set threshold, suspending the operation of the gas flow standard device if the device is abnormal, continuing to operate and generating an electronic traceability certificate if the device is normal, and improving the accuracy of the gas flow standard device in abnormal detection by combining multi-scale feature reconstruction and a deep learning algorithm, so that the problem of false detection and missing detection caused by simple threshold judgment in the traditional method is solved.

Inventors

  • PENG LIGUO
  • XU SHIPING
  • Wan Yuanzhou

Assignees

  • 中国石油天然气股份有限公司

Dates

Publication Date
20260508
Application Date
20241106

Claims (10)

  1. 1. A method for testing quality control of a gas flow standard device, comprising: Collecting the full life cycle data of the matched metering equipment of the gas flow standard device; preprocessing the full life cycle data, and performing multi-scale feature reconstruction on the preprocessed data to obtain an enhanced feature matrix; Constructing a deep learning model based on time sequence and anomaly detection through the enhanced feature matrix, and updating model parameters by using a weighted binary cross entropy loss function and a back propagation algorithm to obtain an anomaly detection probability output model; Acquiring real-time detection data of the gas flow standard device and the matched metering equipment thereof, inputting the real-time detection data into an abnormal detection probability output model, and acquiring abnormal probability; If the device is abnormal, the operation of the gas flow standard device is stopped, and if the device is normal, the operation is continued and an electronic traceability certificate is generated.
  2. 2. The method for testing quality control of a gas flow standard device according to claim 1, wherein the method for preprocessing full life cycle data comprises: Smoothing data using weighted moving average Wherein X (t) is any characteristic data at time t in the full life cycle data, W k is a weight coefficient, M is the radius of the smooth window, t and k are relative offsets; Normalizing any characteristic data of the smoothed full life cycle data to obtain normalized data X norm (t); The method for multi-scale feature reconstruction of data X norm (t) comprises the following steps: And introducing time difference features and high-order interaction features to obtain an enhanced feature matrix :X enh (t)=[X norm (t),X norm (t-1),X norm (t-2),X norm (t)·X norm (t-1),X norm (t) 2 ],, wherein X norm (t) is a standardized feature at the moment t.
  3. 3. The method for testing quality control of a gas flow standard device according to claim 1, wherein the method for constructing a deep learning model comprises: A label y (t) is distributed for the enhanced feature matrix X enh (t), and a training set and a verification set are constructed; Constructing long-term and short-term memory network, determining forgetting gate f t , input gate i t , output gate o t and cell state c t , and updating equation Wherein X enh (t) is an enhanced feature matrix, W f 、W i 、W o 、W c is an input weight matrix, U f 、U i 、U o 、U c is a hidden weight matrix, b f 、b i 、b o 、b c is a bias term, h t is a hidden state vector at the time t, and sigma is a sigmoid activation function; Calculating the attention weight of the time step based on a multi-head self-attention mechanism, and processing an input feature matrix through a multi-head self-attention layer to obtain the attention weight of each head And combines the attention weight with the output to obtain a multi-head attention output Calculating final attention weights by a multi-layer perceptron By final attention weighting For multi-head attention output Weighting and calculating to obtain abnormal probability at t moment Defining a weighted two-class cross entropy loss function Wherein y (t) is a real label, w + is a positive sample weight, w - is a negative sample weight, and N is the total number of samples in the training set; Initializing model parameters theta, inputting a model parameter weight matrix and bias terms, inputting a training set into a long-short-term memory network, calculating gradients of a loss function on model parameters through a back propagation algorithm, and updating the model parameters theta by using an Adam optimization algorithm Wherein η is the learning rate; And evaluating the performance of the model through the verification set, selecting the model with optimal performance, and taking the model as an abnormality detection probability output model.
  4. 4. A method for testing quality control of a gas flow standard device according to claim 3, wherein the learning rate is dynamically adjusted by an adaptive learning rate optimization method to accelerate convergence, and the learning rate update rule is: where η n is the effective learning rate of the nth iteration, β 1 is the exponential decay rate of the first moment estimate, and β 2 is the exponential decay rate of the second moment estimate.
  5. 5. A gas flow standard device test quality control method according to claim 3, wherein the attention weight of the ith head Wherein, the For the attention score of the i-th head hidden state vector h t over time step t, h t is the hidden state vector of LSTM, v i is the attention weight vector of the i-th head, The attention score of the state vector h a is hidden for the ith head over time step t, For the weight matrix of the i-th head, The bias term for the ith head, T is the number of time steps; combining the attention weights and outputs of all heads to obtain a multi-head attention output Where H is the number of attention heads, For the weighted hidden state of the ith head, W O is the combined weight matrix after multi-head attention, concat is the vector stitching operation.
  6. 6. The method for testing quality control of a gas flow rate calibration device according to claim 5, wherein the output of the multi-layer sensor is determined Wherein W 1 is a first layer weight matrix of the MLP, b 1 is a first layer bias term of the MLP, and ReLU is a rectifying linear unit activation function; obtaining final attention weights Wherein, W 2 is the second layer weight matrix of the MLP, b 2 is the second layer bias term of the MLP, softmax is the normalization function; By final attention weighting For multi-head attention output Weighting to obtain weighted feature vector The weighted feature vector is input to a full-connection layer and layer normalization module, and the feature vector is obtained through residual connection and normalization Feature vector Input to the full connection layer, output abnormal probability Where σ is the activation function, W out is the output weight matrix, and b out is the output bias term.
  7. 7. The method for controlling the testing quality of a gas flow standard device according to claim 1, wherein the method for generating the electronic traceability certificate comprises the following steps: The collected real-time detection data are tidied, and a time sequence matrix S r =[X(t 1 ) X(t 2 ) … X(t r )] T is generated, wherein X (t r ) is any characteristic data obtained by the r-th collection; Generating a feature abstract vector F r =[μ,σ 2 , gamma, kappa of a time sequence matrix S r , wherein mu is the mean value of the time sequence matrix, sigma 2 is the variance of the time sequence matrix, gamma is the skewness of the time sequence matrix, and kappa is the kurtosis of the time sequence matrix; Performing hash operation on the time sequence matrix S r to generate a data digest hash value H r ; Constructing a multiple hash chain H r+1 =Hash(H r ||S r+1 ), wherein i is a join operation; Defining and generating a traceability certificate Wherein, the Historical hash chains for tracing back the data of each acquisition point.
  8. 8. A gas flow standard device test quality control terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the gas flow standard device test quality control method of any one of claims 1-7 when the computer program is executed by the processor.
  9. 9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the gas flow standard device test quality control method of any one of claims 1-7.
  10. 10. A computer program product comprising computer program/instructions which, when executed by a processor, implements a gas flow standard device test quality control method as claimed in any one of claims 1 to 7.

Description

Quality control method for testing gas flow standard device and related products Technical Field The invention relates to the field of gas flow measurement, in particular to a gas flow standard device testing quality control method and related products. Background Gas flow standard devices are widely used in industry for accurate measurement and metering calibration of gas flow to ensure accuracy of gas delivery and flow control during production. The device generally depends on high-precision metering equipment and has high stability and consistency requirements on the working states of the device and the equipment. In the long-term use process, due to the influences of factors such as equipment aging, environmental change and the like, errors and anomalies can be generated in the gas flow standard device, so that the measurement accuracy is influenced. Therefore, effective quality control and real-time detection of the gas flow standard device are important measures for ensuring the working stability and measurement accuracy of the gas flow standard device. The existing quality control method of the gas flow standard device mainly relies on periodic manual calibration and maintenance, and equipment states are judged and adjusted by personnel. However, this method is not only inefficient, but also difficult to discover anomalies in the equipment during operation in time, resulting in uncontrollable errors in the gas flow measurement. In addition, the metering equipment of the gas flow standard device can generate a large amount of real-time data in operation, and the existing control method cannot fully utilize the data to perform real-time analysis and monitoring, so that potential problems of the equipment cannot be detected in time, and the fault risk of the equipment is increased. Conventional anomaly detection methods typically ignore the multi-scale characteristics and non-linear characteristics exhibited by gas flow standard devices and their metering devices during long-term operation. Detection methods based on simple threshold or single-scale analysis are difficult to effectively capture complex time sequence changes, thereby resulting in lower accuracy of detection results. In the prior art, a quality control method of a gas flow standard device capable of simultaneously utilizing full life cycle data, multi-scale feature reconstruction and a deep learning model is not known, so as to solve the technical problems. Disclosure of Invention The invention aims to provide a gas flow standard device testing quality control method and related products, which aims to accurately detect abnormal states in the running of the device and timely generate a tracing certificate through multi-scale feature reconstruction of full life cycle data of the device and real-time analysis of a deep learning model, thereby improving the detection accuracy and running stability of the gas flow standard device. The invention is realized by the following technical scheme: a gas flow standard device test quality control method comprising: Collecting the full life cycle data of the matched metering equipment of the gas flow standard device; preprocessing the full life cycle data, and performing multi-scale feature reconstruction on the preprocessed data to obtain an enhanced feature matrix; Constructing a deep learning model based on time sequence and anomaly detection through the enhanced feature matrix, and updating model parameters by using a weighted binary cross entropy loss function and a back propagation algorithm to obtain an anomaly detection probability output model; Acquiring real-time detection data of the gas flow standard device and the matched metering equipment thereof, inputting the real-time detection data into an abnormal detection probability output model, and acquiring abnormal probability; If the device is abnormal, the operation of the gas flow standard device is stopped, and if the device is normal, the operation is continued and an electronic traceability certificate is generated. Specifically, the method for preprocessing the full life cycle data comprises the following steps: Smoothing data using weighted moving average Wherein X (t) is any characteristic data at time t in the full life cycle data,W k is a weight coefficient, M is the radius of the smooth window, t and k are relative offsets; Normalizing any characteristic data of the smoothed full life cycle data to obtain normalized data X norm (t); The method for multi-scale feature reconstruction of data X norm (t) comprises the following steps: And introducing time difference features and high-order interaction features to obtain an enhanced feature matrix :Xenh(t)=[Xnorm(t),Xnorm(t-1),Xnorm(t-2),Xnorm(t)·Xnorm(t-1),Xnorm(t)2],, wherein X norm (t) is a standardized feature at the moment t. Specifically, the method for constructing the deep learning model comprises the following steps: A label y (t) is distributed to the enhanced feature matrix