Cylinder flow monitoring and residual quantity measuring system for cloud platform
Patent Information
- Application Number
- CN202610805365.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2046-06-05
AI Technical Summary
现有云端平台的计算逻辑缺乏对气瓶空间姿态变化与管路振动频率畸变之间物理关联的识别能力,将上述由姿态变化引发的两相流异常振动误判为正常的瞬时流量波动并纳入时间积分计算,导致输出的动态余量估算值偏离气瓶内部真实的物理剩余量,产生不可逆的余量累积误差
1.本发明通过在端侧引入惯性测量组件获取三轴加速度与三轴角速度序列,并经由四元数姿态解算转换为俯仰角与横滚角,将俯仰角、横滚角与管路振动频率序列拼接生成多模态时空矩阵,在云端平台利用姿态补偿图卷积网络,以俯仰角与横滚角作为空间节点特征,以管路振动频率序列作为时间边特征,通过图卷积层提取空间拓扑关联特征,通过时间卷积层提取动态演变特征,最终经由全连接层输出修正流量序列并进行时间积分。上述技术手段在云端构建了气瓶空间姿态几何特征与质量流量计底层物理振动特征的图结构拓扑映射,从测量信号中分离出由气液两相流畸变产生的异常振动分量,消除了因气瓶倾斜或移动导致的异常振动对瞬时流量序列的干扰,使修正后的流量序列逼近单相流状态下的真实流量,抑制了动态余量估算值的累积误差。
Smart Images

Figure CN122384930B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fluid measurement and data processing technology, and specifically to a gas cylinder flow monitoring and balance measurement system for cloud platforms. Background Technology
[0002] Gas cylinder flow monitoring and margin measurement systems for cloud platforms typically install mass flow meters at the gas cylinder outlet pipeline to collect pipeline vibration frequency sequences and instantaneous flow sequences, transmitting the data to the cloud platform. Upon receiving these sequences, the cloud platform directly performs time integration calculations on the instantaneous flow sequence to obtain an estimate of the gas cylinder's dynamic margin. Existing cloud-based margin calculation logic is based on the assumption that the gas cylinder is in a static, upright state; that is, it assumes that a stable, single-phase fluid in a single state always flows inside the mass flow meter's sensing tube, and that the pipeline vibration frequency is linearly related only to the instantaneous mass flow rate of the fluid. Under this conventional architecture, the cloud platform relies solely on the temporal characteristics of the flow data itself for margin accumulation.
[0003] The existing technical solutions described above suffer from distortions in margin calculations when gas cylinders are tilted or subjected to transport vibrations. When a gas cylinder deviates from its stationary, upright position, the liquid gas inside will experience physical sloshing, causing distortion of the fluid flow field inside the outlet pipe. This distorts the flow from a stable single-phase flow to a two-phase flow state, such as slug flow or bubble flow. The introduction of this two-phase flow causes abnormal vibrations in the mass flow meter's sensor tube, not caused by flow rate fluctuations. This manifests as a deviation from the normal linear correspondence in the pipeline vibration frequency sequence. The existing cloud platform's calculation logic lacks the ability to identify the physical correlation between changes in the gas cylinder's spatial attitude and distortions in the pipeline vibration frequency. It misjudges these abnormal two-phase flow vibrations caused by attitude changes as normal instantaneous flow fluctuations and includes them in the time integration calculation. This results in the output dynamic margin estimate deviating from the actual physical margin inside the gas cylinder, leading to irreversible margin accumulation errors. Summary of the Invention
[0004] The purpose of this invention is to provide a gas cylinder flow monitoring and balance measurement system for cloud platforms, which can solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A gas cylinder flow monitoring and margin measurement system for a cloud platform includes an inertial measurement unit fixed to the outside of the gas cylinder, a Coriolis mass flow meter at the outlet pipe, an end-side processor, and a cloud platform. The inertial measurement unit includes a three-axis accelerometer and a three-axis gyroscope. The end-side processor is configured to: synchronously acquire three-axis acceleration and three-axis angular velocity sequences, as well as the pipeline vibration frequency sequence and instantaneous flow sequence output by the Coriolis mass flow meter; convert the three-axis acceleration and three-axis angular velocity into pitch and roll angles through quaternion attitude calculation; and convert the... The pitch angle, roll angle, and pipeline vibration frequency sequence are concatenated according to timestamps to generate a multimodal spatiotemporal matrix and uploaded to the cloud platform. The cloud platform is configured to: use the pitch angle and roll angle in the multimodal spatiotemporal matrix as spatial node features, use the pipeline vibration frequency sequence as temporal edge features as input to an attitude compensation graph convolutional network, extract spatial topological correlation features through graph convolutional layers, extract dynamic evolution features through temporal convolutional layers, output a corrected flow sequence, and perform time integration on the corrected flow sequence to generate a dynamic margin estimation system.
[0006] Preferably, the specific method by which the end-side processor synchronously acquires the triaxial acceleration and triaxial angular velocity sequences includes: when the end-side processor receives the rising edge trigger signal of the pipeline vibration frequency sequence output by the Coriolis mass flow meter, it reads the current register data of the triaxial accelerometer and the triaxial gyroscope; the end-side processor performs static error compensation on the read triaxial acceleration data and zero-bias rejection operation on the read triaxial angular velocity data; and combines the triaxial acceleration that has completed static error compensation and the triaxial angular velocity that has completed zero-bias rejection operation into a synchronous sampling data packet; the specific method by which the end-side processor converts the triaxial acceleration and the triaxial angular velocity into pitch and roll angles through quaternion attitude calculation includes: constructing a rotation matrix to update the quaternion differential equation using the triaxial angular velocity in the synchronous sampling data packet, constructing a Kalman filter state equation using the triaxial acceleration in the synchronous sampling data packet as an observation, and outputting a quaternion attitude vector containing the pitch and roll angles.
[0007] Preferably, the specific method for concatenating the pitch angle, roll angle, and pipeline vibration frequency sequence according to timestamps to generate a multimodal spatiotemporal matrix includes: the end-side processor truncating the quaternion attitude vector and the pipeline vibration frequency sequence with a preset time window length, extracting the pitch angle time sequence, roll angle time sequence, and pipeline vibration frequency time sequence within the preset time window length, concatenating the pitch angle time sequence and the roll angle time sequence in the channel dimension to form an attitude feature tensor, performing a fast Fourier transform on the pipeline vibration frequency time sequence to extract the frequency domain amplitude vector, copying and extending the frequency domain amplitude vector to the same time step dimension as the attitude feature tensor, and concatenating the extended frequency domain amplitude vector with the attitude feature tensor in the feature dimension to generate the multimodal spatiotemporal matrix.
[0008] Preferably, the specific method for extracting spatial topological association features through graph convolutional layers includes: the attitude-compensated graph convolutional network maps the pitch and roll angles corresponding to each time step in the multimodal spatiotemporal matrix to independent nodes in the graph structure, defines the connection between nodes in adjacent time steps as a spatial edge, uses the sum of the absolute values of the pitch and roll angle differences between nodes corresponding to the spatial edge as the initial edge weight of the spatial edge, and for each independent node, uses the extended frequency domain amplitude vector corresponding to the independent node as a node attribute feature. The graph convolutional layer performs neighborhood aggregation operation on the node attribute features according to the initial edge weight, performs residual connection between the aggregated feature vector and the original node attribute features of the independent node, and outputs the spatial topological association features.
[0009] Preferably, the specific method for extracting dynamic evolution features through a temporal convolutional layer includes: using the spatial topological correlation features as the input sequence of the temporal convolutional layer, wherein the temporal convolutional layer contains multiple dilated causal convolutional kernels with different dilation coefficients; the temporal convolutional layer uses the pipeline vibration frequency time series in the multimodal spatiotemporal matrix as the mask condition of the dilated causal convolutional kernels in the time dimension; when the frequency value of the pipeline vibration frequency time series at the corresponding time step is in a preset abnormal frequency range, the convolution operation of the dilated causal convolutional kernels at that time step is masked; when the frequency value of the pipeline vibration frequency time series at the corresponding time step is in a preset normal frequency range, the convolution operation of the dilated causal convolutional kernels at that time step is activated, and the dynamic evolution features are output.
[0010] Preferably, the specific method for outputting the corrected flow sequence includes: the fully connected layer of the attitude compensation graph convolutional network receives the dynamic evolution features, maps the dynamic evolution features to a flow deviation compensation vector of the same length as the pipeline vibration frequency time series, and performs element-wise addition of the instantaneous flow sequence output by the Coriolis mass flow meter and the flow deviation compensation vector at the corresponding time step to generate the corrected flow sequence; the specific method for performing time integration on the corrected flow sequence to generate a dynamic margin estimate includes: extracting the flow difference values of adjacent time steps in the corrected flow sequence, multiplying the flow difference values by the time interval of the corresponding time step to generate a single-step consumption volume, accumulating the single-step consumption volume and deducting it from the initial volume of the gas cylinder to generate the dynamic margin estimate.
[0011] Preferably, the specific method by which the edge processor performs static error compensation on the read triaxial acceleration data includes: the edge processor extracts the triaxial acceleration data in a stationary state, calculates the scaling factor between the magnitude of the triaxial acceleration data and the standard gravitational acceleration, constructs a scaling factor error matrix using the scaling factor, the edge processor extracts the cross-coupling components of the triaxial acceleration data in a three-dimensional spatial coordinate system, constructs an installation error matrix, multiplies the scaling factor error matrix with the installation error matrix to generate a comprehensive error compensation matrix, and the edge processor multiplies the read real-time triaxial acceleration data with the inverse of the comprehensive error compensation matrix to output the triaxial acceleration after static error compensation.
[0012] Preferably, the specific method by which the end-side processor truncates the quaternion attitude vector and the pipeline vibration frequency sequence with a preset time window length includes: the end-side processor calculates the pitch angle change rate in the quaternion attitude vector in real time; when the pitch angle change rate is greater than the attitude change rate threshold, the preset time window length is shortened to generate a first sliding window; when the pitch angle change rate is less than the attitude change rate threshold, the preset time window length is maintained to generate a second sliding window; in the truncation operation corresponding to the first sliding window, the end-side processor increases the sampling point density when the pitch angle time sequence and the roll angle time sequence are spliced in the channel dimension; in the truncation operation corresponding to the second sliding window, the sampling point density is reduced.
[0013] Preferably, the specific method by which the graph convolutional layer performs neighborhood aggregation operation on the node attribute features based on the initial edge weights includes: for the target node in the graph structure, traversing the neighboring nodes that are spatially connected to the target node, obtaining the initial edge weights corresponding to each neighboring node, inputting the initial edge weights into a preset edge weight normalization function to calculate the attention coefficients, multiplying the node attribute features of each neighboring node with the corresponding attention coefficients to obtain weighted neighbor features, summing all the weighted neighbor features to generate an aggregated feature matrix, and inputting the aggregated feature matrix into an activation function for processing and then performing the residual connection with the original node attribute features of the target node.
[0014] Preferably, the fully connected layer of the attitude compensation graph convolutional network receives the dynamic evolution features and maps the dynamic evolution features into a flow deviation compensation vector of the same length as the pipeline vibration frequency time series. Specifically, the fully connected layer includes a flattening layer, a first fully connected layer, a batch normalization layer, a second fully connected layer, and a linear mapping layer connected sequentially. The flattening layer converts the multidimensional tensor of the dynamic evolution features into a one-dimensional feature vector. The first fully connected layer performs dimensionality upscaling on the one-dimensional feature vector. The batch normalization layer performs mean centering and variance scaling operations on the dimensionality-upgraded feature vector. The second fully connected layer performs dimensionality reduction on the normalized feature vector. The linear mapping layer linearly maps the dimensionality-reduced feature vector to the same data dimension as the pipeline vibration frequency time series, outputting the flow deviation compensation vector.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention acquires triaxial acceleration and triaxial angular velocity sequences by introducing an inertial measurement unit at the end, and converts them into pitch and roll angles through quaternion attitude calculation. The pitch and roll angles are then concatenated with the pipeline vibration frequency sequence to generate a multimodal spatiotemporal matrix. On a cloud platform, an attitude-compensated graph convolutional network is used, with pitch and roll angles as spatial node features and the pipeline vibration frequency sequence as temporal edge features. Spatial topological correlation features are extracted through graph convolutional layers, and dynamic evolution features are extracted through temporal convolutional layers. Finally, a corrected flow sequence is output via a fully connected layer and integrated over time. This technique constructs a graph topological mapping between the spatial attitude geometry of the gas cylinder and the underlying physical vibration characteristics of the mass flow meter in the cloud. It separates abnormal vibration components caused by gas-liquid two-phase flow distortion from the measurement signal, eliminating the interference of abnormal vibrations caused by cylinder tilting or movement on the instantaneous flow sequence. This makes the corrected flow sequence approximate the true flow under single-phase flow conditions and suppresses the cumulative error of the dynamic margin estimation.
[0016] 2. This invention reduces the interference of hardware deviations of the inertial measurement unit on the pitch and roll angle calculation results by performing static error compensation on the triaxial acceleration data at the end side and constructing a comprehensive error compensation matrix using the scaling factor error matrix and the installation error matrix. By converting the pipeline vibration frequency time series into a frequency domain amplitude vector and copying and extending it to the same time step dimension as the attitude feature tensor for splicing, the alignment and fusion of the multimodal spatiotemporal matrix in the feature dimension are ensured. By setting dilated causal convolution kernels in the time convolution layer and using the pipeline vibration frequency time series as a mask condition in the time dimension, convolution operations are shielded in the abnormal frequency range and activated in the normal frequency range, thus blocking the interference of extreme distortion frequencies on the dynamic evolution feature extraction process. By calculating the attention coefficient based on the initial edge weights and performing residual connections on the weighted neighbor features through the graph convolution layer, the stability of the correlation feature transmission between adjacent time step nodes is enhanced. Attached Figure Description
[0017] Figure 1 This is a flowchart of the overall system workflow. Figure 2 Flowchart for edge data synchronization and attitude calculation; Figure 3 Flowchart for generating multimodal spatiotemporal matrices; Figure 4 Flowchart for extracting spatial topological correlation features from graph convolutional layers; Figure 5 Flowchart for extracting dynamic evolution features from temporal convolutional layers; Figure 6 A flowchart is generated to correct the flow sequence and dynamic margin estimate. Detailed Implementation
[0018] Please refer to the attached document. Figure 1 This embodiment provides a gas cylinder flow monitoring and margin measurement system for a cloud platform. It includes an inertial measurement unit fixed to the outside of the gas cylinder, a Coriolis mass flow meter at the gas outlet pipe, an end-side processor, and a cloud platform. The inertial measurement unit includes a three-axis accelerometer and a three-axis gyroscope. The inertial measurement unit is rigidly fixed to the gas cylinder body, so that the sensitive axes of the three-axis accelerometer and the three-axis gyroscope are aligned with the coordinate system axis of the gas cylinder body. The Coriolis mass flow meter is coaxially connected to the gas cylinder outlet pipe to collect the pipeline vibration frequency sequence and instantaneous flow sequence in real time. The end-side processor establishes a data transmission channel with the inertial measurement unit and the Coriolis mass flow meter through a wired communication link. The cloud platform establishes a data interaction channel with the end-side processor through a wireless communication link.
[0019] The end-side processor is configured to simultaneously acquire triaxial acceleration and triaxial angular velocity sequences, as well as pipeline vibration frequency sequences and instantaneous flow sequences output from the Coriolis mass flow meter. The synchronous acquisition process uses the built-in clock module of the end-side processor as a unified time reference. Each set of acquired data carries a unique timestamp generated by the corresponding clock, ensuring strict alignment of data from different sources in the time dimension and eliminating time offset. The end-side processor converts the synchronously acquired triaxial acceleration and triaxial angular velocity into pitch and roll angles through quaternion attitude calculation. The pitch angle corresponds to the angle between the cylinder's axial centerline and the direction of gravity, while the roll angle corresponds to the cylinder's rotation angle around its own axial centerline. The quaternion attitude calculation uses the geodetic coordinate system as the reference coordinate system and the cylinder's body coordinate system as the carrier coordinate system. A rotational mapping relationship from the carrier coordinate system to the reference coordinate system is constructed using quaternions to complete the attitude angle calculation and output. The edge processor concatenates the calculated pitch angle, roll angle, and pipeline vibration frequency sequences according to timestamps to generate a multimodal spatiotemporal matrix. During the concatenation process, using the same timestamp as an index, the pitch angle, roll angle, and pipeline vibration frequency values at the same acquisition time are aligned, and invalid data points with mismatched timestamps are removed. This generates a two-dimensional matrix structure with time steps as rows and feature dimensions as columns. Each row of the multimodal spatiotemporal matrix corresponds to multi-source feature data at one acquisition time, and each column corresponds to the time series of a type of feature. The edge processor uploads the generated multimodal spatiotemporal matrix to the cloud platform via a wireless communication link. During the upload process, a lossless compression algorithm is used to compress the matrix data to reduce transmission bandwidth usage while ensuring no information loss during transmission.
[0020] After receiving the multimodal spatiotemporal matrix uploaded by the end-side processor, the cloud platform decompresses the compressed matrix data and verifies its integrity. Once verified, the multimodal spatiotemporal matrix is input into a pre-defined attitude compensation graph convolutional network. This network uses the pitch and roll angles from the multimodal spatiotemporal matrix as spatial node features and the pipeline vibration frequency sequence as temporal edge features. Graph convolutional layers extract spatial topological correlation features, corresponding to the intrinsic correlation features of cylinder attitude changes at different time steps, as well as the mapping correlation features between attitude changes and pipeline vibration frequency changes. Temporal convolutional layers extract dynamic evolution features, corresponding to the dynamic temporal characteristics of cylinder attitude and pipeline vibration frequency changes over time. The network's output layer outputs a corrected flow sequence, which is the flow sequence after eliminating two-phase flow interference caused by attitude changes. The cloud platform performs time integration on the corrected flow sequence to generate a dynamic margin estimate, which corresponds to the physical quantity value of the remaining fluid inside the cylinder.
[0021] Table 1. Correspondence between the dimensions and physical meaning of the multimodal spatiotemporal matrix.
[0022] This table defines the core dimensions of the multimodal spatiotemporal matrix and the physical meaning and data source of each dimension. It clarifies the alignment rules of the matrix in the time dimension and the feature dimension. Based on the parameter definitions in this table, those skilled in the art can complete the construction and parsing of the multimodal spatiotemporal matrix and ensure the unified mapping of multi-source heterogeneous data in the feature dimension.
[0023] In this embodiment, by synchronously collecting cylinder attitude data and flow meter vibration frequency and flow data at the end, attitude calculation and multimodal spatiotemporal matrix construction are completed. In the cloud, attitude compensation graph convolutional network is used to fuse and extract attitude features and vibration frequency features, output corrected flow sequence and complete margin estimation. The correlation mapping between cylinder spatial attitude and flow meter vibration features is constructed, realizing attitude compensation correction of flow data and eliminating the interference of cylinder attitude change on margin calculation.
[0024] refer to Figure 2 In another embodiment, the end-side processor synchronously acquires the triaxial acceleration and triaxial angular velocity sequences as follows: When the end-side processor receives the rising edge trigger signal of the pipeline vibration frequency sequence output by the Coriolis mass flow meter, it triggers an interrupt service routine. It then reads the current register data of the triaxial accelerometer and triaxial gyroscope through the serial peripheral interface. The trigger frequency of the rising edge trigger signal is consistent with the sampling frequency of the Coriolis mass flow meter, ensuring complete synchronization between the sampling time of the inertial measurement unit and the sampling time of the flow meter. During the reading of register data, the end-side processor performs cyclic redundancy check on the register data. Data packets that fail the check are discarded, and a reread operation is triggered to ensure the integrity and accuracy of the acquired data.
[0025] The edge processor performs static error compensation on the read triaxial acceleration data. Specifically, the edge processor extracts the triaxial acceleration data in a stationary state. The stationary state is determined by the output values of the triaxial angular velocities. When the output values of the three axes of angular velocity are all less than a preset static threshold, the gas cylinder is considered stationary. At this time, the collected triaxial acceleration data only contains the gravitational acceleration component and the static error component. The edge processor calculates the scaling factor between the magnitude of the triaxial acceleration data and the standard gravitational acceleration. It averages multiple sets of triaxial acceleration data in the stationary state, calculates the magnitude of the average, and uses the ratio of the standard gravitational acceleration to this magnitude as the scaling factor. A scaling factor error matrix is constructed using this scaling factor. This scaling factor error matrix is a 3×3 diagonal matrix, with the diagonal elements representing the scaling factors for the X, Y, and Z axis accelerometers, respectively. The edge processor extracts the cross-coupling components of the triaxial acceleration data in a three-dimensional coordinate system and constructs an installation error matrix. This matrix is a 3×3 off-diagonal matrix, where off-diagonal elements correspond to the cross-coupling coefficients between different sensitive axes. These coefficients are obtained using a six-position calibration method. This method involves fixing the inertial measurement unit (IMU) sequentially at six orthogonal standard positions, collecting acceleration data at each position, and fitting the data using the least squares method to obtain the cross-coupling coefficients. The edge processor multiplies the scaling factor error matrix with the installation error matrix to generate a comprehensive error compensation matrix. It then multiplies the read real-time triaxial acceleration data with the inverse of the comprehensive error compensation matrix to output the triaxial acceleration after static error compensation. The corresponding mathematical expression is:
[0026] in, To complete the three-axis acceleration vector for static error compensation, This is the comprehensive error compensation matrix. This is the raw triaxial acceleration vector acquired in real time.
[0027] The mathematical expression for the comprehensive error compensation matrix is:
[0028] in, The scaling factor error matrix, This is the installation error matrix.
[0029] The edge processor performs a zero-bias rejection operation on the read triaxial angular velocity data. Specifically, when the gas cylinder is stationary, the edge processor collects triaxial angular velocity data for a preset duration, calculates the average value of the angular velocity data for each axis, and uses this average value as the zero-bias error value for the corresponding axis. The zero-bias error value is stored in the edge processor's non-volatile memory. During real-time acquisition, the zero-bias error value for the corresponding axis is subtracted from the real-time read triaxial angular velocity raw data, and the triaxial angular velocity after the zero-bias rejection operation is output. The corresponding mathematical expression is:
[0030] in, The three-axis angular velocity vector used to perform the zero-bias rejection operation is the raw three-axis angular velocity vector acquired in real time. This is the zero-bias error vector of the triaxial angular velocity.
[0031] The edge processor combines the three-axis acceleration data that has completed static error compensation with the three-axis angular velocity data that has completed zero-bias rejection calculation into a synchronous sampling data packet. The synchronous sampling data packet includes a data frame header, a timestamp field, a three-axis acceleration data field, a three-axis angular velocity data field, a check field, and a frame tail. The length of each field is fixed to ensure the consistency of data transmission and parsing.
[0032] The edge processor converts triaxial acceleration and triaxial angular velocity into pitch and roll angles using quaternion attitude calculation. Specifically, it constructs a rotation matrix using the triaxial angular velocity from the synchronously sampled data packet to update the quaternion differential equation, and constructs a Kalman filter state equation using the triaxial acceleration from the synchronously sampled data packet as an observation. The output is a quaternion attitude vector containing pitch and roll angles. Quaternions are used to describe the rotation of the carrier coordinate system relative to the reference coordinate system; the expression for a quaternion is... ,in Let be the real part of the quaternion. Let be the imaginary part of the quaternion, corresponding to the rotational components along the X, Y, and Z axes, respectively. A quaternion differential equation is constructed using the three-axis angular velocities to achieve the time update of the quaternion. The corresponding mathematical expression is:
[0033] in, The differential of a quaternion, For quaternion multiplication, The three-axis angular velocity vectors used to perform the zero-bias rejection operation are converted into quaternion form as follows: .
[0034] The edge processor uses the four components of the quaternion and the zero bias error of the triaxial angular velocity as state variables to construct a state vector. The corresponding Kalman filter state update equation is:
[0035] in, Let k be the state vector at time k, containing four components of the quaternion and three zero-bias error components of the triaxial angular velocity. Let be the state transition matrix at time k, obtained by discretizing the quaternion differential equation. Let be the process noise vector, which follows a Gaussian distribution with a mean of 0.
[0036] The edge processor uses the triaxial acceleration used for static error compensation as the observation, and constructs the Kalman filter observation equation, the corresponding mathematical expression of which is:
[0037] in, Let be the observation vector at time k, i.e., the three-axis acceleration vector after static error compensation, and let be the observation matrix at time k, constructed from the rotation matrix from the reference coordinate system to the carrier coordinate system. The observed noise vector follows a Gaussian distribution with a mean of 0.
[0038] The edge processor achieves optimal estimation of the quaternion state vector through the prediction and update steps of Kalman filtering. It then converts the optimally estimated quaternion attitude vector into Euler angles and extracts the pitch and roll angles. The conversion formulas for pitch and roll angles are obtained from the conversion relationship between quaternions and Euler angles, ensuring the accuracy and stability of attitude angle calculation.
[0039] Table 2. Static Error Compensation Calibration Parameters for Inertial Measurement Unit
[0040] This table provides the physical meaning of the core calibration parameters of the scaling factor error matrix and the installation error matrix during the static error compensation process of the inertial measurement unit's triaxial acceleration. Those skilled in the art can construct the comprehensive error compensation matrix based on the parameter definitions in this table, thereby achieving static error compensation of the raw triaxial acceleration data and reducing the interference of inertial measurement unit hardware deviations on attitude calculation results.
[0041] In this embodiment, synchronous sampling of the inertial measurement unit and the flow meter is achieved by triggering the rising edge of the flow meter. A comprehensive error compensation matrix is constructed by the scaling factor error matrix and the installation error matrix to complete the static error compensation of the three-axis acceleration. The zero bias error of the three-axis angular velocity is corrected by the zero bias elimination operation. High-precision attitude calculation is achieved based on quaternion differential equations and Kalman filtering, and the pitch angle and roll angle are output, which improves the accuracy and stability of the attitude data and provides a reliable attitude data source for subsequent multimodal feature fusion.
[0042] refer to Figure 3 In another optional embodiment, the end-side processor generates a multimodal spatiotemporal matrix by splicing the pitch angle, roll angle, and pipeline vibration frequency sequence according to timestamps. Specifically, the end-side processor truncates the quaternion attitude vector and pipeline vibration frequency sequence with a preset time window length, and extracts the pitch angle time sequence, roll angle time sequence, and pipeline vibration frequency time sequence within the preset time window length. The initial value of the preset time window length is set according to the sampling frequency to ensure that the window contains sufficient temporal feature information.
[0043] The edge processor calculates the pitch angle change rate in the quaternion attitude vector in real time. The pitch angle change rate is the amount of pitch angle change per unit time, calculated by dividing the pitch angle difference between adjacent time steps by the corresponding time interval. When the pitch angle change rate is greater than the attitude change rate threshold, a first sliding window is generated by shortening the preset time window length. When the pitch angle change rate is less than the attitude change rate threshold, a second sliding window is generated while maintaining the preset time window length. The attitude change rate threshold is set according to the typical usage scenarios of the gas cylinder. When the pitch angle change rate exceeds this threshold, the gas cylinder is determined to be in a state of rapid attitude change, and the window length needs to be shortened to capture rapidly changing attitude features. When the pitch angle change rate is less than this threshold, the gas cylinder is determined to be in a state of stable or slow attitude change, and the original window length is maintained to ensure the smoothness of feature extraction. In the first sliding window's truncation operation, the edge processor increases the sampling point density when splicing the pitch and roll time series in the channel dimension. In the second sliding window's truncation operation, it reduces the sampling point density. The adjustment of the sampling point density is achieved through interpolation and downsampling. In the state of rapid attitude change, linear interpolation is used to increase the sampling point density to ensure that the detailed features of attitude change are not lost. In the stable state, mean downsampling is used to reduce the sampling point density, thereby reducing the amount of data processing and transmission bandwidth usage.
[0044] Table 3. Correspondence Table of Adaptive Sliding Window Parameter Configuration
[0045] This table provides the adaptive sliding window parameter configurations for different pitch angle change rate ranges, clarifying the correspondence between window length and sampling point density adjustment coefficients. Those skilled in the art can use the parameter configurations in this table to complete the adaptive adjustment of the sliding window, achieving accurate capture of attitude features under different dynamic changing states, while balancing the accuracy of feature extraction and the efficiency of data processing.
[0046] The edge processor concatenates the pitch and roll time series along the channel dimension to construct an attitude feature tensor. The dimension of the attitude feature tensor is [number of time steps, 2], where the number of time steps is the number of sampling points within the sliding window, and 2 corresponds to the two feature channels for pitch and roll angles. The edge processor performs a Fast Fourier Transform (FFT) on the pipeline vibration frequency time series to extract the frequency domain amplitude vector. The FFT uses the radix-2 FFT algorithm, padding the pipeline vibration frequency time series with zeros to ensure the sequence length is an integer power of 2, thus ensuring the efficiency of the FFT operation. The corresponding mathematical expression is:
[0047] in, This is a complex frequency domain sequence of the pipeline vibration frequency time series. Given a time series of pipe vibration frequencies of length N, This represents the number of sampling points within the sliding window. It is the imaginary unit.
[0048] The mathematical expression for the frequency domain magnitude vector is:
[0049] in, It is a frequency domain magnitude vector. Modulus operations for complex numbers, This is for floor function.
[0050] The edge processor copies and expands the frequency domain amplitude vector to the same time step dimension as the attitude feature tensor. Specifically, each element of the frequency domain amplitude vector is repeatedly copied along the time step dimension, ensuring that the time step dimension of the expanded frequency domain amplitude vector is completely consistent with that of the attitude feature tensor. The dimension of the expanded frequency domain amplitude vector is [number of time steps, M], where M is the length of the frequency domain amplitude vector. The edge processor then concatenates the expanded frequency domain amplitude vector with the attitude feature tensor along the feature dimension to generate a multimodal spatiotemporal matrix. The dimension of the multimodal spatiotemporal matrix is [number of time steps, 2 + M], where 2 corresponds to the pitch and roll angle attitude feature channels, and M corresponds to the feature channels of the frequency domain amplitude vector. This achieves multimodal fusion of attitude time-domain features and vibration frequency-domain features, ensuring complete alignment of different features along the time and feature dimensions.
[0051] In this embodiment, an adaptive sliding window is used to dynamically extract attitude sequences and vibration frequency sequences. The window length and sampling point density are adjusted according to the pitch angle change rate. The frequency domain amplitude vector of the pipeline vibration frequency sequence is extracted by fast Fourier transform. Multimodal features are fused by dimensional expansion and feature concatenation to generate a dimension-aligned multimodal spatiotemporal matrix, providing standardized multimodal input data for feature extraction and traffic correction in the cloud.
[0052] refer to Figures 4 to 6 In a preferred embodiment, the attitude compensation graph convolutional network of the cloud platform uses the pitch and roll angles in the multimodal spatiotemporal matrix as spatial node features and the pipeline vibration frequency sequence as temporal side features as input to the network structure. The input of the network is the multimodal spatiotemporal matrix, and the input dimension is completely consistent with the dimension of the multimodal spatiotemporal matrix generated by the edge processor.
[0053] The attitude-compensated graph convolutional network extracts spatial topological features through graph convolutional layers as follows: The network maps the pitch and roll angles corresponding to each time step in the multimodal spatiotemporal matrix to independent nodes in a graph structure. The graph structure is a directed acyclic graph, with the number of nodes equal to the number of time steps in the multimodal spatiotemporal matrix. Each node's unique identifier corresponds to the index of its time step. The network defines the connections between nodes in adjacent time steps as spatial edges, with the direction of each edge pointing from a node in the previous time step to a node in the next time step, corresponding to the chronological order of time. Each node is only connected to its adjacent preceding and following nodes by spatial edges, forming a one-dimensional chain-like graph structure. The network uses the sum of the absolute values of the pitch and roll angle differences between nodes corresponding to a spatial edge as the initial edge weight, with the corresponding mathematical expression being:
[0054] in, Let be the initial edge weight of the spatial edge between node i and node j. , These are the pitch angle values corresponding to nodes i and j, respectively. , These are the roll angle values corresponding to nodes i and j, respectively, where nodes i and j are nodes at adjacent time steps.
[0055] For each independent node, the network uses the expanded frequency domain amplitude vector corresponding to the node as the node attribute feature. The dimension of the node attribute feature is the same as the length of the frequency domain amplitude vector, ensuring that each node carries the vibration frequency frequency domain feature of the corresponding time step. The graph convolutional layer performs neighborhood aggregation operation on the node attribute features based on the initial edge weights. Specifically, for the target node in the graph structure, it traverses the neighboring nodes that are spatially connected to the target node, obtains the initial edge weights corresponding to each neighboring node, and inputs the initial edge weights into a preset edge weight normalization function to calculate the attention coefficients. The edge weight normalization function uses the softmax function to ensure that the sum of the attention coefficients of all neighboring nodes is 1. The corresponding mathematical expression is:
[0056] in, Let be the attention coefficient between target node i and its neighbor node j. Let i be the set of all neighboring nodes of the target node i. It is an exponential function.
[0057] The network multiplies the node attribute features of each neighbor node with its corresponding attention coefficient to obtain weighted neighbor features. All weighted neighbor features are summed to generate an aggregated feature matrix. This aggregated feature matrix is then processed by an activation function and residually connected to the original node attribute features of the target node. The ReLU activation function is used to output spatial topological association features, the corresponding mathematical expression of which is:
[0058] in, The spatial topological association feature vector output by target node i. Let i be the original node attribute feature vector of the target node i. Let be the original node attribute feature vector of neighbor node j. The trainable weight matrix of the graph convolutional layer. This is the ReLU activation function.
[0059] The number of graph convolutional layers is set to 2. The first graph convolutional layer extracts the topological association features of local adjacent nodes, and the second graph convolutional layer extracts the global topological association features across nodes, ensuring that the intrinsic relationship between attitude changes and vibration frequency changes at different time steps is fully captured.
[0060] The pose-compensated graph convolutional network extracts dynamic evolution features through temporal convolutional layers by using spatial topological correlation features as the input sequence for the temporal convolutional layers. The dimension of the input sequence is consistent with the output dimension of the graph convolutional layers. The temporal convolutional layers contain multiple dilated causal convolutional kernels with different dilation coefficients. The causal nature of dilated causal convolution ensures that the convolution operation only utilizes feature data from the current time step and previous time steps, without revealing information from future time steps. This aligns with the causal logic of time-series data processing. Different dilation coefficients enable the convolutional kernels to capture dynamic evolution features at different time scales.
[0061] The temporal convolutional layer uses the pipeline vibration frequency time series in the multimodal spatiotemporal matrix as a masking condition for the dilated causal convolution kernel in the time dimension. Specifically, it presets abnormal frequency ranges and normal frequency ranges. The normal frequency range is a preset fluctuation range of the rated natural vibration frequency of the Coriolis mass flow meter sensor tube. Frequency ranges exceeding this range are preset abnormal frequency ranges, corresponding to non-flow abnormal vibrations caused by gas-liquid two-phase flow. When the frequency value of the corresponding time step in the pipeline vibration frequency time series falls within the preset abnormal frequency range, the convolution operation of the dilated causal convolution kernel at that time step is masked; that is, the feature data at that time step does not participate in the convolution operation. When the frequency value of the corresponding time step in the pipeline vibration frequency time series falls within the preset normal frequency range, the convolution operation of the dilated causal convolution kernel at that time step is activated, and the feature data at that time step participates in the convolution operation. The introduction of the masking mechanism blocks the interference of extreme distortion frequencies on the dynamic evolution feature extraction process, ensuring that the convolution operation is based only on normal vibration frequency data.
[0062] The formula for dilated causal convolution is:
[0063] in, Let be the convolution output features at time t. The size of the convolution kernel. is the dilation coefficient of the convolution kernel. For the mask function, when the frequency value at the corresponding time step is within the normal frequency range, A value of 1 activates the convolution operation; when the frequency value at the corresponding time step falls within the abnormal frequency range... A value of 0 disables convolution operations. The k-th weight value of the convolution kernel. This is the input feature sequence for the convolutional layer.
[0064] The temporal convolutional layer concatenates the output features of dilated causal convolution kernels with different dilation coefficients in the channel dimension to output dynamic evolution features. The dynamic evolution features integrate temporal features at different time scales, fully capturing the dynamic laws of the changes in cylinder attitude and vibration frequency over time.
[0065] Table 4. Convolutional Network Layer Structure and Operational Parameters for Pose Compensation Diagram
[0066] This table presents the complete layer structure of the attitude compensation graph convolutional network and the core operational parameters of each layer, clarifying the input and output dimensions and key configurations of each layer. Those skilled in the art can build and implement the attitude compensation graph convolutional network based on the parameter configuration in this table, ensuring that the network can extract spatial topological correlation features and dynamic evolution features, and output a traffic deviation compensation vector that meets the requirements.
[0067] The fully connected layer of the attitude compensation graph convolutional network receives dynamically evolving features and maps these features to a flow deviation compensation vector of the same length as the pipeline vibration frequency time series. The fully connected layer comprises a flattening layer, a first fully connected layer, a batch normalization layer, a second fully connected layer, and a linear mapping layer connected sequentially. The flattening layer converts the multidimensional tensor of the dynamically evolving features into a one-dimensional feature vector, eliminating dimensionality differences and adapting to the input requirements of the fully connected layer. The first fully connected layer performs dimensionality upscaling on the one-dimensional feature vector, enhancing its expressive power and extracting high-dimensional abstract features. The batch normalization layer performs mean centering and variance scaling operations on the dimensionality-upgraded feature vector, mapping the feature data to a standard normal distribution, accelerating the network's convergence speed and improving its stability. The second fully connected layer performs dimensionality reduction on the normalized feature vector, filtering redundant features and retaining the core features related to flow deviation. The linear mapping layer linearly maps the dimensionality-reduced feature vectors to the same data dimension as the pipeline vibration frequency time series, and outputs a flow deviation compensation vector. The length of the flow deviation compensation vector is equal to the length of the pipeline vibration frequency time series. Each element corresponds to the flow deviation compensation value of a time step. The physical meaning of the compensation value is the flow measurement error value caused by the attitude change at that time step.
[0068] The specific method by which the attitude compensation graph convolutional network outputs the corrected flow sequence is as follows: the network performs element-wise addition of the instantaneous flow sequence output by the Coriolis mass flow meter and the flow deviation compensation vector at the corresponding time steps to generate the corrected flow sequence. The corresponding mathematical expression is:
[0069] in, Let be the corrected flow rate value at time t. Let t be the raw instantaneous flow rate value output by the Coriolis mass flow meter at time t. This represents the flow deviation compensation value at time t, which is the element value of the corresponding time step in the flow deviation compensation vector.
[0070] The corrected flow rate values of all time steps are combined in chronological order to generate a corrected flow rate sequence. The corrected flow rate sequence eliminates the interference of gas-liquid two-phase flow caused by changes in the cylinder attitude and approximates the true flow rate value under single-phase flow conditions.
[0071] The cloud platform generates dynamic margin estimates by performing time integration on the corrected flow sequence as follows: It extracts the flow difference between adjacent time steps in the corrected flow sequence, multiplies this flow difference by the time interval of the corresponding time step to generate a single-step consumption volume. This single-step consumption volume corresponds to the volume of fluid flowing out of the gas cylinder within that time interval. The single-step consumption volumes are then accumulated and subtracted from the initial volume of the gas cylinder to generate the dynamic margin estimate. The corresponding mathematical expression is: in, This is a dynamic margin estimate. This represents the initial volume of the gas cylinder. To correct the total number of time steps in the flow sequence, The time interval between adjacent time steps. The initial flow rate is 0.
[0072] The dynamic margin estimate is updated in real time as the corrected flow sequence is updated, corresponding to the actual volume of the remaining fluid inside the gas cylinder, thus suppressing the cumulative error in margin calculation.
[0073] In this embodiment, spatial topological association features are extracted based on the node and edge features of the graph structure through the graph convolutional layer of the attitude-compensated graph convolutional network. The stability of feature propagation is enhanced by neighborhood aggregation and residual connection with attention coefficient weighting. Dynamic evolution features at multiple time scales are extracted through dilated causal convolutional layers with masking mechanism to block the interference of abnormal frequencies. A flow deviation compensation vector is generated by mapping through fully connected layers to complete the correction of instantaneous flow sequence. Dynamic margin estimation value is generated by time integration, which realizes accurate compensation for flow measurement error and eliminates the cumulative error of margin calculation caused by changes in gas cylinder attitude.
Claims
1. A gas cylinder flow monitoring and balance measurement system for cloud platforms, characterized in that, The system includes an inertial measurement unit fixed to the outside of the gas cylinder, a Coriolis mass flow meter at the outlet pipe, an end-side processor, and a cloud platform. The inertial measurement unit includes a three-axis accelerometer and a three-axis gyroscope. The end-side processor is configured to: synchronously acquire the three-axis acceleration and three-axis angular velocity sequences, as well as the pipeline vibration frequency sequence and instantaneous flow sequence output by the Coriolis mass flow meter; convert the three-axis acceleration and the three-axis angular velocity into pitch and roll angles through quaternion attitude calculation; and concatenate the pitch angle, the roll angle, and the pipeline vibration frequency sequence according to timestamps to generate a multimodal spatiotemporal matrix and upload it to the cloud platform. The cloud platform is configured to: use the pitch angle and roll angle in the multimodal spatiotemporal matrix as spatial node features, use the pipeline vibration frequency sequence as temporal edge features as input to the attitude compensation graph convolutional network, extract spatial topological correlation features through graph convolutional layers, extract dynamic evolution features through temporal convolutional layers, output a corrected flow sequence, and perform time integration on the corrected flow sequence to generate a dynamic margin estimation system. The specific method by which the end-side processor synchronously acquires the triaxial acceleration and triaxial angular velocity sequences includes: when the end-side processor receives the rising edge trigger signal of the pipeline vibration frequency sequence output by the Coriolis mass flow meter, it reads the current register data of the triaxial accelerometer and the triaxial gyroscope; the end-side processor performs static error compensation on the read triaxial acceleration data and zero bias rejection operation on the read triaxial angular velocity data; and combines the triaxial acceleration that has completed static error compensation and the triaxial angular velocity that has completed zero bias rejection operation into a synchronous sampling data packet; the specific method by which the end-side processor converts the triaxial acceleration and the triaxial angular velocity into pitch and roll angles through quaternion attitude calculation includes: constructing a rotation matrix to update the quaternion differential equation using the triaxial angular velocity in the synchronous sampling data packet, constructing a Kalman filter state equation using the triaxial acceleration in the synchronous sampling data packet as an observation, and outputting a quaternion attitude vector containing the pitch angle and the roll angle; The specific method for generating a multimodal spatiotemporal matrix by concatenating the roll angle and the pipeline vibration frequency sequence according to the timestamp includes: the end-side processor truncates the quaternion attitude vector and the pipeline vibration frequency sequence with a preset time window length, extracts the pitch angle time sequence, roll angle time sequence and pipeline vibration frequency time sequence within the preset time window length, concatenates the pitch angle time sequence and the roll angle time sequence in the channel dimension to form an attitude feature tensor, performs a fast Fourier transform on the pipeline vibration frequency time sequence to extract the frequency domain amplitude vector, copies and extends the frequency domain amplitude vector to the same time step dimension as the attitude feature tensor, and concatenates the extended frequency domain amplitude vector and the attitude feature tensor in the feature dimension to generate the multimodal spatiotemporal matrix; The specific method for extracting spatial topological association features through graph convolutional layers includes: the attitude-compensated graph convolutional network maps the pitch and roll angles corresponding to each time step in the multimodal spatiotemporal matrix to independent nodes in the graph structure, defines the connection between nodes in adjacent time steps as a spatial edge, uses the sum of the absolute values of the pitch and roll angle differences between nodes corresponding to the spatial edge as the initial edge weight of the spatial edge, and for each independent node, uses the extended frequency domain amplitude vector corresponding to the independent node as the node attribute feature. The graph convolutional layer performs neighborhood aggregation operation on the node attribute features according to the initial edge weight, performs residual connection between the aggregated feature vector and the original node attribute features of the independent node, and outputs the spatial topological association features. The specific method for extracting dynamic evolution features through a temporal convolutional layer includes: using the spatial topological correlation features as the input sequence of the temporal convolutional layer, which contains multiple dilated causal convolutional kernels with different dilation coefficients; using the pipeline vibration frequency time series in the multimodal spatiotemporal matrix as the mask condition of the dilated causal convolutional kernels in the time dimension; when the frequency value of the pipeline vibration frequency time series at the corresponding time step is in a preset abnormal frequency range, the convolution operation of the dilated causal convolutional kernel at that time step is masked; when the frequency value of the pipeline vibration frequency time series at the corresponding time step is in a preset normal frequency range, the convolution operation of the dilated causal convolutional kernel at that time step is activated, and the dynamic evolution features are output. The specific method for the graph convolutional layer to perform neighborhood aggregation operation on the node attribute features based on the initial edge weights includes: for the target node in the graph structure, traversing the neighboring nodes that are spatially connected to the target node, obtaining the initial edge weights corresponding to each neighboring node, inputting the initial edge weights into a preset edge weight normalization function to calculate the attention coefficients, multiplying the node attribute features of each neighboring node with the corresponding attention coefficients to obtain weighted neighbor features, summing all the weighted neighbor features to generate an aggregated feature matrix, and inputting the aggregated feature matrix into an activation function for processing and then performing the residual connection with the original node attribute features of the target node.
2. The system according to claim 1, characterized in that, The specific method for outputting the corrected flow sequence includes: the fully connected layer of the attitude compensation graph convolutional network receives the dynamic evolution features, maps the dynamic evolution features to a flow deviation compensation vector of the same length as the pipeline vibration frequency time series, and performs element-wise addition of the instantaneous flow sequence output by the Coriolis mass flow meter and the flow deviation compensation vector at the corresponding time step to generate the corrected flow sequence; The specific method for generating a dynamic margin estimate by time integration of the corrected flow sequence includes: extracting the flow difference value between adjacent time steps in the corrected flow sequence, multiplying the flow difference value by the time interval of the corresponding time step to generate a single-step consumption volume, accumulating the single-step consumption volume and deducting it from the initial volume of the gas cylinder to generate the dynamic margin estimate.
3. The system according to claim 1, characterized in that, The specific method by which the edge processor performs static error compensation on the read triaxial acceleration data includes: the edge processor extracts the triaxial acceleration data in a stationary state, calculates the scaling factor between the magnitude of the triaxial acceleration data and the standard gravitational acceleration, constructs a scaling factor error matrix using the scaling factor, the edge processor extracts the cross-coupling components of the triaxial acceleration data in the three-dimensional spatial coordinate system, constructs an installation error matrix, multiplies the scaling factor error matrix with the installation error matrix to generate a comprehensive error compensation matrix, and the edge processor multiplies the read real-time triaxial acceleration data with the inverse of the comprehensive error compensation matrix to output the triaxial acceleration after static error compensation.
4. The system according to claim 1, characterized in that, The specific method by which the end-side processor truncates the quaternion attitude vector and the pipeline vibration frequency sequence with a preset time window length includes: the end-side processor calculates the pitch angle change rate in the quaternion attitude vector in real time; when the pitch angle change rate is greater than the attitude change rate threshold, the preset time window length is shortened to generate a first sliding window; when the pitch angle change rate is less than the attitude change rate threshold, the preset time window length is maintained to generate a second sliding window; in the truncation operation corresponding to the first sliding window, the end-side processor increases the sampling point density when the pitch angle time sequence and the roll angle time sequence are spliced in the channel dimension; in the truncation operation corresponding to the second sliding window, the sampling point density is reduced.
5. The system according to claim 2, characterized in that, The fully connected layer of the attitude compensation graph convolutional network receives the dynamic evolution features and maps the dynamic evolution features into a flow deviation compensation vector of the same length as the pipeline vibration frequency time series. Specifically, the fully connected layer includes a flattening layer, a first fully connected layer, a batch normalization layer, a second fully connected layer, and a linear mapping layer connected sequentially. The flattening layer converts the multidimensional tensor of the dynamic evolution features into a one-dimensional feature vector. The first fully connected layer performs dimensionality upscaling on the one-dimensional feature vector. The batch normalization layer performs mean centering and variance scaling operations on the dimensionality-upgraded feature vector. The second fully connected layer performs dimensionality reduction on the normalized feature vector. The linear mapping layer linearly maps the dimensionality-reduced feature vector to the same data dimension as the pipeline vibration frequency time series, outputting the flow deviation compensation vector.
Citation Information
Patent Citations
Container liquid pouring amount measurement method and system
CN107462294A
Solution storage device, residual amount detecting method for stored solution, and solution storage detecting device
CN109060074A