Gas flow standard device test quality control method and related product
By performing multi-scale feature reconstruction and real-time analysis of the full lifecycle data of the gas flow standard device using deep learning models, the problems of low efficiency and insufficient detection accuracy in existing technologies have been solved. This has enabled efficient anomaly detection and traceability certificate generation for the gas flow standard device, improving detection accuracy and operational stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PETROCHINA CO LTD
- Filing Date
- 2024-11-06
- Publication Date
- 2026-05-08
AI Technical Summary
Existing gas flow standard devices suffer from low efficiency, difficulty in timely detection of anomalies, and insufficient detection accuracy during the testing quality control process.
By collecting full lifecycle data from gas flow standard devices and their supporting metering equipment, data preprocessing and multi-scale feature reconstruction are performed to construct a deep learning model based on time series and anomaly detection. The model parameters are updated using a weighted binary classification cross-entropy loss function and a backpropagation algorithm to achieve real-time anomaly detection and generate electronic traceability certificates.
It improves the detection accuracy and operational stability of gas flow standard devices, promptly detects anomalies and generates traceability certificates, and overcomes the problems of false detection and missed detection caused by simple threshold judgment in traditional methods.
Smart Images

Figure CN121997160A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas flow measurement, and specifically to a method for quality control of a gas flow standard device test and related products. Background Technology
[0002] Gas flow rate standards are widely used in industry for the precise measurement and calibration of gas flow rates to ensure the accuracy of gas delivery and flow control during production processes. These devices typically rely on high-precision metering equipment and require high stability and consistency in their operation. During long-term use, factors such as equipment aging and environmental changes can cause errors and malfunctions in gas flow rate standards, affecting measurement accuracy. Therefore, effective quality control and real-time monitoring of gas flow rate standards are crucial for ensuring their operational stability and measurement accuracy.
[0003] Existing quality control methods for gas flow standard devices primarily rely on periodic manual calibration and maintenance, with personnel assessing and adjusting the equipment's condition. However, this method is not only inefficient but also struggles to detect anomalies during operation in a timely manner, leading to uncontrollable errors in gas flow measurement. Furthermore, gas flow standard devices generate a large amount of real-time data during operation, but existing control methods often fail to fully utilize this data for real-time analysis and monitoring, resulting in potential equipment problems going undetected and increasing the risk of equipment failure.
[0004] Traditional anomaly detection methods often overlook the multi-scale characteristics and nonlinear features exhibited by gas flow standards and their metering equipment during long-term operation. Detection methods based on simple thresholds or single-scale analysis struggle to effectively capture complex temporal changes, resulting in low accuracy of detection results. Currently, there is a lack of a gas flow standard quality control method that can simultaneously utilize full lifecycle data, multi-scale feature reconstruction, and deep learning models to address these technical challenges. Summary of the Invention
[0005] The technical problem to be solved by this invention is that existing gas flow standard devices suffer from low efficiency, difficulty in timely detection of anomalies, and insufficient detection accuracy during the testing quality control process. The purpose is to provide a gas flow standard device testing quality control method and related products, which realizes the accurate detection of abnormal states in the operation of the device and timely generation of traceability certificates by real-time analysis of multi-scale feature reconstruction and deep learning model of the device's entire life cycle data, thereby improving the detection accuracy and operational stability of the gas flow standard device.
[0006] This invention is achieved through the following technical solution:
[0007] A test quality control method for a gas flow standard device, comprising:
[0008] Collecting the full life cycle data of the gas flow standard device; collecting the full life cycle data of the supporting measuring equipment of the gas flow standard device;
[0009] Preprocessing the full life cycle data and performing multi-scale feature reconstruction on the preprocessed data to obtain an enhanced feature matrix;
[0010] Constructing a deep learning model based on time series and anomaly detection through the enhanced feature matrix, and using a weighted binary cross-entropy loss function and a backpropagation algorithm to update the model parameters to obtain an anomaly detection probability output model;
[0011] Obtaining the real-time detection data of the gas flow standard device and its supporting measuring equipment, inputting the real-time detection data into the anomaly detection probability output model to obtain an anomaly probability; if the anomaly probability is greater than the set threshold, it is determined that the device state is abnormal;
[0012] If the device is abnormal, suspend the operation of the gas flow standard device; if the device is normal, continue to operate and generate an electronic traceability certificate.
[0013] Specifically, the method for preprocessing the full life cycle data includes:
[0014] Smoothing the data using a weighted moving average method where X(t) is any feature data at time t in the full life cycle data, is any feature data of the smoothed full life cycle data, w k is the weight coefficient, M is the radius size of the smoothing window, and t and k are relative offsets;
[0015] Normalizing any feature data of the smoothed full life cycle data to obtain the normalized data X norm (t);
[0016] The method for performing multi-scale feature reconstruction on the data X norm (t) includes:
[0017] 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 , where X norm(t) represents the standardized feature at time t.
[0018] Specifically, methods for constructing deep learning models include:
[0019] For the enhanced feature matrix X e nh Assign labels y(t) to construct training and validation sets;
[0020] Construct a long short-term memory network and determine the forgetting gate f. t Input gate i t Output gate o t and cell state c t And determine the update equation. Among them, X enh (t) is the enhanced feature matrix, W f W i W o W c For the input weight matrix, U f U i U o U c To hide the weight matrix, b f b i b o b c For the bias term, h t Let be the hidden state vector at time t, and σ be the sigmoid activation function;
[0021] Attention weights at each time step are calculated based on a multi-head self-attention mechanism. The input feature matrix is processed through a multi-head self-attention layer to obtain the attention weights for each head. The attention weights are then combined with the output to obtain multi-head attention output.
[0022] The final attention weights are calculated using a multilayer perceptron. Through final attention weight Multi-head attention output By performing weighted calculations, the anomaly probability at time t is obtained.
[0023] Define the weighted binary classification cross-entropy loss function Where y(t) is the true label, w + For positive sample weights, w - The negative sample weights are used, and N is the total number of samples in the training set.
[0024] Initialize the model parameters θ, the model parameter weight matrix, and the bias terms. Input the training set into the Long Short-Term Memory network, calculate the gradient of the loss function with respect to the model parameters using the backpropagation algorithm, and update the model parameters θ using the Adam optimization algorithm. Where η is the learning rate;
[0025] The model performance is evaluated using a validation set, and the best-performing model is selected as the output model for anomaly detection probability.
[0026] Optionally, an adaptive learning rate optimization method is used to dynamically adjust the learning rate to accelerate convergence. The learning rate update rule is as follows: Where, η n β1 is the effective learning rate for the nth iteration, β2 is the exponential decay rate of the first moment estimate, and β3 is the exponential decay rate of the second moment estimate.
[0027] Specifically, the attention weight of the i-th head in, For the i-th head, hide the state vector h at time step t. t Attention score, h t Let v be the hidden state vector of the LSTM. i Let i be the attention weight vector for the i-th head. For the i-th head, hide the state vector h at time step t. a Attention score Let be the weight matrix for the i-th head. Let T be the bias term for the i-th head, and T be the number of time steps;
[0028] The attention weights and outputs of all heads are combined to obtain the multi-head attention output. Where H represents the number of attention heads. W represents the weighted hidden state of the i-th head. O This is the combined weight matrix after multi-head attention, and Concat is the vector concatenation operation.
[0029] Determine the output of the multilayer perceptron Where W1 is the first layer weight matrix of the MLP, b1 is the first layer bias term of the MLP, and ReLU is the rectified linear unit activation function;
[0030] Obtain the final attention weights Where W2 is the second-layer weight matrix of the MLP, b2 is the second-layer bias term of the MLP, and softmax is the normalization function;
[0031] Through final attention weight Multi-head attention output Perform weighting to obtain weighted feature vectors. The weighted feature vectors are input into the fully connected layer and the layer normalization module, and the feature vectors are obtained through residual connections and normalization.
[0032] eigenvectors Input to a fully connected layer, output anomaly probability. Where σ is the activation function, W out To output the weight matrix, b out This is the output bias term.
[0033] Optionally, the methods for generating electronic traceability certificates include:
[0034] Organize the collected real-time detection data and generate a time series matrix. Where X(t) r () represents any feature data obtained in the r-th acquisition;
[0035] Generate time series matrix S r Feature summary vector F r =[μ,σ 2 ,γ,κ], where μ is the mean of the time series matrix, σ 2 Let be the variance of the time series matrix, γ be the skewness of the time series matrix, and κ be the kurtosis of the time series matrix.
[0036] For time series matrix S r Perform a hash operation to generate a data digest hash value H. r ;
[0037] Constructing a multi-hash chain H r+1 =Hash(H r ||S r+1 ), where || represents the join operation;
[0038] Define and generate traceability certificates in, To trace the historical hash chain of data from each collection point.
[0039] A gas flow standard device test quality control terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the gas flow standard device test quality control method as described above.
[0040] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the gas flow standard device test quality control method as described above.
[0041] A computer program product includes a computer program / instructions that, when executed by a processor, implement the gas flow standard device test quality control method as described above.
[0042] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0043] This invention is based on the full lifecycle data of the gas flow standard device and its supporting metering equipment. Through data preprocessing, multi-scale feature reconstruction and the construction of a deep learning model, it realizes real-time detection and anomaly judgment of the device status. By combining multi-scale feature reconstruction and deep learning algorithms, this invention improves the accuracy of gas flow standard devices in anomaly detection and overcomes the problems of false detection and missed detection caused by simple threshold judgment in traditional methods. Attached Figure Description
[0044] The accompanying drawings illustrate exemplary embodiments of the present invention and, together with the description thereof, serve to explain the principles of the invention. These drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, but do not constitute a limitation on the embodiments of the present invention.
[0045] Figure 1 This is a schematic flowchart of a gas flow standard device testing quality control method according to the present invention. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0047] It should also be noted that, for ease of description, only the parts relevant to the present invention are shown in the accompanying drawings.
[0048] Where there is no conflict, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0049] Example 1
[0050] like Figure 1 As shown, a method for quality control of a gas flow standard device test includes:
[0051] Collect full lifecycle data of the gas flow standard device; collect full lifecycle data of the supporting metering equipment of the gas flow standard device; full lifecycle data refers to the data collected throughout the entire cycle from installation to the end of operation of the equipment, including not only the numerical data of normal and abnormal operation of the device, but also the operating status data under different environments, providing complete data support for subsequent accurate detection and anomaly analysis.
[0052] The entire lifecycle data is preprocessed, and then multi-scale feature reconstruction is performed on the preprocessed data to obtain an enhanced feature matrix. During preprocessing, noise reduction and smoothing are typically performed to standardize the data and reduce errors caused by external interference or noise. Multi-scale feature reconstruction refers to combining data across multiple time scales to extract features that reflect both short-term fluctuations and long-term trends, enabling the data to more comprehensively reflect the equipment's operating status and generating an enhanced feature matrix with stronger temporal characteristics.
[0053] A deep learning model based on time series and anomaly detection is constructed using the enhanced feature matrix. The model parameters are updated using a weighted binary cross-entropy loss function and a backpropagation algorithm to obtain the anomaly detection probability output model. The weighted binary cross-entropy loss function is used to handle the imbalance of positive and negative samples, so that the model still has high detection accuracy when there are few anomaly samples. The backpropagation algorithm is used to update the model parameters step by step so that the model can be continuously optimized in the iteration.
[0054] The system obtains real-time detection data from a gas flow standard device and its associated metering equipment. It then inputs this real-time data into an anomaly detection probability output model to obtain the anomaly probability. When real-time detection data from the gas flow standard device or its associated metering equipment is input into the anomaly detection model, the model calculates the anomaly probability value and compares it with a set threshold. If the anomaly probability exceeds the set threshold, the device is deemed to be in an abnormal state.
[0055] If the device malfunctions, operation of the gas flow standard device will be suspended; if the device is functioning normally, operation will continue and an electronic traceability certificate will be generated. The electronic traceability certificate records important data and status information during equipment operation and testing, ensuring the traceability of measurement results and quality control processes.
[0056] Example 2
[0057] Methods for preprocessing data throughout its entire lifecycle include:
[0058] The weighted moving average method assigns different weights to data points at adjacent times, making the data at the current time more representative and stable, thereby reducing random fluctuations in the data. Therefore, the weighted moving average method is used to smooth data. Where X(t) represents any feature data at time t in the full lifecycle data. For any feature data of the smoothed full lifecycle data, w k t is the weighting coefficient, M is the radius of the smoothing window, and t and k are the relative offsets.
[0059] Standardize any feature data of the smoothed full lifecycle data to obtain standardized data X. norm (t); Standardization is the process of processing different feature values according to a uniform scale. Usually, the data is mapped to a specific numerical range (such as a range with a mean of 0 and a standard deviation of 1) to eliminate the difference in units between features and improve the model's ability to identify data features.
[0060] For data X norm (t) Perform multi-scale feature reconstruction, introducing time difference features and higher-order interaction features into the data. Time difference features refer to the introduction of standardized features from the previous few time steps, such as X. norm (t-1) and X norm (t-2) is used to capture the trend of data changes over time. Higher-order interaction features include the product X of the current feature and the feature from the previous time step. norm (t)·X norm (t-1) and the square of the current feature X norm (t) 2 It is used to capture non-linear relationships between features.
[0061] Finally, the enhanced feature matrix X is obtained. enh (t)=[X norm (t), X norm (t-1), X norm (t-2), X norm (t)·X norm (t-1), X norm (t) 2 ], where X norm (t) represents the standardized feature at time t.
[0062] Example 3
[0063] This embodiment provides a method for constructing a deep learning model, including:
[0064] For the enhanced feature matrix X e nh Assign labels y(t) to construct training and validation sets; labels y(t) are used to indicate the state (normal or abnormal) at each time step t.
[0065] Construct a long short-term memory network to capture temporal features in the enhanced feature matrix and determine the forgetting gate f. t Input gate it Output gate o t and cell state c t And determine the update equation. Among them, X enh (t) is the enhanced feature matrix, W f W i W o W c For the input weight matrix, U f U i U o U c To hide the weight matrix, b f b i b o b c For the bias term, h t Let be the hidden state vector at time t, and σ be the sigmoid activation function.
[0066] The forget gate is used to control the cell state at the previous moment. t-1 In terms of the degree of legacy at the current time step, the input gate is used to determine the amount of new information introduced at the current time step, the output gate is used to control the generation of the output hidden state, the cell state is used to store information from long time steps, the tanh activation function restricts the candidate memory cell values to the range of (-1, 1), and the hidden state is the output of the current time step, which combines the current input and historical information.
[0067] Attention weights at each time step are calculated based on a multi-head self-attention mechanism. The input feature matrix is processed through a multi-head self-attention layer to obtain the attention weights for each head. The attention weights are then combined with the output to obtain multi-head attention output. Specifically, this includes: the attention weight of the i-th head. in, For the i-th head, hide the state vector h at time step t. t Attention score, h t Let v be the hidden state vector of the LSTM. i Let i be the attention weight vector for the i-th head. For the i-th head, hide the state vector h at time step t. a Attention score Let be the weight matrix for the i-th head. Let T be the bias term for the i-th head, and T be the number of time steps. The attention weights and outputs of all heads are combined to obtain the multi-head attention output. Where H represents the number of attention heads. W represents the weighted hidden state of the i-th head. Ois the combined weight matrix after multi-head attention, and Concat is the concatenation of the weighted hidden state vectors of each head to form the final multi-head attention output.
[0068] The final attention weights are calculated using a multilayer perceptron. Through final attention weight Multi-head attention output By performing weighted calculations, the anomaly probability at time t is obtained. Specifically, it includes the following three steps:
[0069] The multi-head attention output is input into the first layer of the multilayer perceptron to determine the output of the multilayer perceptron. Where W1 is the first layer weight matrix of the MLP, b1 is the first layer bias term of the MLP, and ReLU is the rectified linear unit activation function, which converts negative values to 0 and keeps positive values unchanged to increase the nonlinear expressive power of the model.
[0070] Will The input is fed into the second layer of the MLP and normalized using the softmax function to obtain the final attention weights. Where W2 is the second layer weight matrix of the MLP, b2 is the second layer bias term of the MLP, and softmax is the normalization function that transforms each output value into a probability distribution.
[0071] Through final attention weight Multi-head attention output Perform weighting to obtain weighted feature vectors. The importance of the multi-head attention output is adjusted to match the attention weights. The weighted feature vector is input to a fully connected layer and a layer normalization module, and the feature vector is obtained through residual connections and normalization.
[0072] eigenvectors Input to a fully connected layer, output anomaly probability. Where σ is the activation function, and its output value is mapped to the range [0, 1], serving as the probability value for anomaly detection. out To output the weight matrix, b out This is the output bias term.
[0073] Define a weighted binary cross-entropy loss function to measure the deviation between the model's predictions and the true labels. Where y(t) is the true label, with a value of 1 indicating an abnormal sample and a value of 0 indicating a normal sample; w + The positive sample weights are used to adjust the impact of outliers in the loss calculation; w -is the weight of negative samples, used to adjust the weight of normal samples; N is the total number of samples in the training set; log represents the natural logarithm, used to convert the model's predicted values into log probabilities.
[0074] Initialize the model parameters θ, the model parameter weight matrix, and bias terms to give them reasonable initial values at the start of training. Input the training set into the Long Short-Term Memory network, calculate the gradient of the loss function with respect to the model parameters using the backpropagation algorithm, and update the model parameters θ using the Adam optimization algorithm. Where η is the learning rate; the Adam optimization algorithm combines momentum and adaptive learning rate mechanisms, accelerates convergence through first-order and second-order momentum estimation, and adaptively adjusts the learning rate of different parameters.
[0075] The model performance is evaluated using a validation set. Based on the loss value and other performance metrics (such as accuracy and recall), the best-performing model is selected and used as the anomaly detection probability output model.
[0076] Optionally, an adaptive learning rate optimization method is used to dynamically adjust the learning rate to accelerate convergence. The learning rate update rule is as follows: Where, η n β1 is the effective learning rate for the nth iteration, β2 is the exponential decay rate of the first moment estimate, used to control the decay rate of the first moment (i.e., the mean of the gradient) during the update process, and β3 is the exponential decay rate of the second moment estimate, used to control the decay rate of the second moment (i.e., the variance of the gradient) during the update process.
[0077] Example 4
[0078] This embodiment provides a method for generating electronic traceability certificates, including:
[0079] Organize the collected real-time detection data and generate a time series matrix. , where X(t) r () represents any feature data obtained in the r-th acquisition;
[0080] Generate time series matrix S r Feature summary vector F r =[μ,σ 2 , γ, κ], where μ is the mean of the time series matrix, reflecting the central trend of the data; σ 2 γ is the variance of the time series matrix, representing the degree of data fluctuation; γ is the skewness of the time series matrix, used to describe the symmetry of the data distribution; κ is the kurtosis of the time series matrix, reflecting the peak or spurious nature of the data distribution.
[0081] For time series matrix S r Perform a hash operation to generate a data digest hash value H. rHash operations are a data encryption method that maps data to a fixed-length hash value.
[0082] Constructing a multi-hash chain H r+1 =Hash(H r ||S r+1 ), where || is the join operation; the multi-hash chain achieves the tracing and accumulation of all collected data by connecting and hashing the current hash value with the data of the next collection point, ensuring the integrity of historical data.
[0083] Define and generate traceability certificates in, To trace the historical hash chain of data from each collection point.
[0084] Example 5
[0085] A gas flow standard device test quality control terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the gas flow standard device test quality control method as described above.
[0086] Memory is used to store software programs and modules. The processor executes various terminal functions and data processing by running the software programs and modules stored in memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one executable program required for a given function, etc.
[0087] The storage data area can store data created based on the use of the terminal. Furthermore, the memory can include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory, or other volatile solid-state storage devices.
[0088] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the gas flow standard device test quality control method as described above.
[0089] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instruction data structures, program modules, or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storage technologies, CD-ROM, DVD or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The aforementioned system memories and mass storage devices can be collectively referred to as memory.
[0090] A computer program product includes a computer program / instructions that, when executed by a processor, implement the gas flow standard device test quality control method as described above.
[0091] Computer program products include computer programs or instruction sets used to perform specific tasks or achieve specific functions. These programs or instructions are designed to be executed by a processor to implement a series of predefined steps or operations. The program product may be stored in various forms of computer storage media, such as memory, hard disks, solid-state drives, optical discs, or other forms of digital storage devices. It may exist in the form of compiled binary code or in the form of scripts or bytecode that can be executed by an interpreter. Through carefully designed algorithms and logical instructions, the program product enables the processor to process data in a specific order and manner, performing various functions such as data analysis, user interaction, and device control.
[0092] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment / mode or example is included in at least one embodiment / mode or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.
[0093] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0094] Those skilled in the art should understand that the above embodiments are merely for illustrating the present invention and are not intended to limit the scope of the invention. Those skilled in the art can make other changes or modifications based on the above invention, and these changes or modifications still fall within the scope of the present invention.
Claims
1. A method for quality control of a gas flow rate standard device test, characterized in that, Including: Collecting the full life cycle data of the gas flow rate standard device; Collecting the full life cycle data of the supporting metering equipment of the gas flow rate 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 series and anomaly detection through the enhanced feature matrix, and using a weighted binary cross-entropy loss function and a backpropagation algorithm to update the model parameters to obtain an anomaly detection probability output model; Obtaining the real-time detection data of the gas flow rate standard device and its supporting metering equipment, inputting the real-time detection data into the anomaly detection probability output model to obtain an anomaly probability; if the anomaly probability is greater than the set threshold, it is determined that the device state is abnormal; If the device is abnormal, suspend the operation of the gas flow rate standard device; if the device is normal, continue to operate and generate an electronic traceability certificate.
2. The gas flow rate standard device test quality control method according to claim 1, characterized in that, The method for preprocessing the full life cycle data includes: The data was smoothed using a weighted moving average method. Where X(t) represents any feature data at time t in the full lifecycle data. For any feature data of the smoothed full lifecycle data, w k t is the weighting coefficient, M is the radius of the smoothing window, and t and k are the relative offsets. Standardize any feature data of the smoothed full lifecycle data to obtain standardized data X. norm (t); For data X norm (t) Methods for multi-scale feature reconstruction include: By introducing time difference features and higher-order interaction features, the enhanced feature matrix is obtained: 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 ], where X norm (t) represents the standardized feature at time t.
3. The gas flow rate standard device test quality control method according to claim 1, characterized in that, The method for constructing the deep learning model includes: For the enhanced feature matrix X enh Assign labels y(t) to construct training and validation sets; Construct a long short-term memory network and determine the forgetting gate f. t Input gate i t Output gate o t and cell state c t And determine the update equation. Among them, X enh (t) is the enhanced feature matrix, W f W i W o W c For the input weight matrix, U f U i U o U c To hide the weight matrix, b f b i b o b c For the bias term, h t Let be the hidden state vector at time t, and σ be the sigmoid activation function; Attention weights at each time step are calculated based on a multi-head self-attention mechanism. The input feature matrix is processed through a multi-head self-attention layer to obtain the attention weights for each head. The attention weights are then combined with the output to obtain multi-head attention output. The final attention weights are calculated using a multilayer perceptron. Through final attention weight Multi-head attention output By performing weighted calculations, the anomaly probability at time t is obtained. Define the weighted binary classification cross-entropy loss function Where y(t) is the true label, w + For positive sample weights, w - The negative sample weights are used, and N is the total number of samples in the training set. Initialize the model parameters θ, the model parameter weight matrix, and the bias terms. Input the training set into the Long Short-Term Memory network, calculate the gradient of the loss function with respect to the model parameters using the backpropagation algorithm, and update the model parameters θ using the Adam optimization algorithm. Where η is the learning rate; Evaluating the model performance through a validation set, selecting the model with the best performance, and using it as the anomaly detection probability output model.
4. The gas flow rate standard device test quality control method according to claim 3, characterized in that, An adaptive learning rate optimization method is used to dynamically adjust the learning rate to accelerate convergence. The learning rate update rule is as follows: Where, η n β1 is the effective learning rate for the nth iteration, β2 is the exponential decay rate of the first moment estimate, and β3 is the exponential decay rate of the second moment estimate.
5. The gas flow rate standard device test quality control method according to claim 3, characterized in that, Attention weight of the i-th head in, For the i-th head, hide the state vector h at time step t. t Attention score, h t Let υ be the hidden state vector of the LSTM. i Let i be the attention weight vector for the i-th head. For the i-th head, hide the state vector h at time step t. a Attention score Let be the weight matrix for the i-th head. Let T be the bias term for the i-th head, and T be the number of time steps; The attention weights and outputs of all heads are combined to obtain the multi-head attention output. Where H represents the number of attention heads. W represents the weighted hidden state of the i-th head. O This is the combined weight matrix after multi-head attention, and Concat is the vector concatenation operation.
6. The gas flow rate standard device test quality control method according to claim 5, characterized in that, Determine the output of the multilayer perceptron Where W1 is the first layer weight matrix of the MLP, b1 is the first layer bias term of the MLP, and ReLU is the rectified linear unit activation function; Obtain the final attention weights Where W2 is the second-layer weight matrix of the MLP, b2 is the second-layer bias term of the MLP, and softmax is the normalization function; Through final attention weight Multi-head attention output Perform weighting to obtain weighted feature vectors. The weighted feature vectors are input into the fully connected layer and the layer normalization module, and the feature vectors are obtained through residual connections and normalization. eigenvectors Input to a fully connected layer, output anomaly probability. Where σ is the activation function, W out To output the weight matrix, b out This is the output bias term.
7. The gas flow rate standard device test quality control method according to claim 1, characterized in that, The method for generating the electronic traceability certificate includes: The collected real-time detection data is processed and a time series matrix S is generated. r =[X(t1) X(t2) … X(t) r )] T , where X(t) r () represents any feature data obtained in the r-th acquisition; Generate time series matrix S r Feature summary vector F r =[μ,σ 2 ,γ,κ], where μ is the mean of the time series matrix, σ 2 Let be the variance of the time series matrix, γ be the skewness of the time series matrix, and κ be the kurtosis of the time series matrix. For time series matrix S r Perform a hash operation to generate a data digest hash value H. r ; Constructing a multi-hash chain H r+1 =Hash(H r ||S r+1 ), where || represents the join operation; Define and generate traceability certificates in, To trace the historical hash chain of data from each collection point.
8. A gas flow rate standard device test quality control terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the gas flow rate standard device test quality control method described in any one of claims 1-7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the gas flow rate standard device test quality control method described in any one of claims 1-7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, it implements the gas flow rate standard device test quality control method described in any one of claims 1-7.