Large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection

By combining multimodal data synchronous acquisition and fusion, dynamic inversion and adaptive correction modules, and utilizing dual-flow neural networks and reinforcement learning algorithms, the flow measurement error problem in large-diameter non-uniform fluid scenarios is solved, achieving high-precision and adaptive flow measurement.

CN121475348BActive Publication Date: 2026-04-07BEIJING INST OF METROLOGY & TESTING SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-08
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing ultrasonic flow metering technology cannot achieve dynamic and real-time signal compensation and parameter adjustment in large-diameter non-uniform fluid scenarios, resulting in increased measurement errors and making it difficult to meet the requirements of high-precision metering.

Method used

The system employs a multimodal data synchronous acquisition and fusion module, a dynamic inversion module, a dynamic adaptive correction module, and an online strategy optimization module. Through a dual-flow neural network and reinforcement learning algorithm, it achieves dynamic calculation and nonlinear correction of the fluid homogeneity index, forming a closed-loop optimization.

Benefits of technology

It significantly improves the flow measurement accuracy of large-diameter pipelines under complex fluid conditions, has online self-learning optimization capabilities, maintains measurement accuracy over a long period of time, and adapts to non-uniform fluid conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121475348B_ABST
    Figure CN121475348B_ABST
Patent Text Reader

Abstract

This invention relates to a large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection, specifically in the field of large-diameter hot and cold water flow metering. This system can significantly improve the flow metering accuracy of large-diameter pipelines under complex fluid conditions. By intelligently fusing data from multiple sensors and dynamically sensing the fluid uniformity, it adaptively corrects measurement errors and has online self-learning optimization capabilities. It can maintain metering accuracy over a long period of time, effectively overcoming the limitations of traditional methods in non-uniform flow fields, and providing reliable data support for energy management and resource settlement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large-diameter hot and cold water flow metering, and more specifically, to a large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection. Background Technology

[0002] With the acceleration of urbanization and the increasing demand for energy management, large-scale pipeline systems are increasingly widely used in municipal water supply, district heating, and other fields. These systems typically use pipes with diameters exceeding DN500 for the transportation and distribution of hot and cold water. Their operating environment is complex and variable. For example, during seasonal heating switching, low-temperature cold water in the pipeline may be rapidly replaced by high-temperature hot water, causing significant changes in fluid temperature, density, and viscosity in a short period of time. In daily operation, the fluid may contain trace bubbles, solid impurities, or form local eddies due to sudden changes in flow velocity. In addition, external factors such as ambient temperature fluctuations and pipeline mechanical vibrations further exacerbate the spatiotemporal inhomogeneity of the fluid's physical state. These conditions pose severe challenges to the accuracy and reliability of flow metering systems, especially in high-precision metering and energy settlement scenarios, where any measurement deviation may trigger a chain reaction.

[0003] For flow measurement in large-diameter pipelines, ultrasonic testing technology has become one of the mainstream solutions due to its non-invasiveness and high precision. Dual-channel ultrasonic flow meters calculate flow velocity by measuring the time difference between the downstream and upstream propagation of sound waves in the fluid. Its accuracy depends on the stability of the fluid's physical properties along the sound wave propagation path. However, existing ultrasonic flow measurement technologies are mostly based on the ideal assumption of a homogeneous fluid medium, using fixed calibration coefficients or linear compensation models for sound velocity correction. For example, linear correction of the sound velocity is performed after obtaining the average fluid temperature using an external temperature sensor. These methods are applicable in small-diameter pipelines with uniform fluid distribution, but not in large-diameter pipelines. In non-uniform fluid environments, the sound velocity along the propagation path exhibits non-linear changes due to effects such as temperature stratification and bubble aggregation. This leads to distortion, attenuation, or refraction of the ultrasonic signal waveform, causing the time difference measurement to deviate from the true value. While alternative solutions such as Doppler ultrasonic flowmeters have some adaptability to non-uniform fluids, they are easily affected by the concentration of particulate matter in the fluid, resulting in generally low measurement accuracy and unsuitability for clean fluids. Current technologies lack adaptive data processing capabilities for non-uniform fluid conditions, making it impossible to achieve dynamic, real-time signal compensation and parameter adjustment. This leads to increased measurement errors under complex operating conditions, making it difficult to meet the actual needs of high-precision measurement. Summary of the Invention

[0004] This invention addresses the technical problems existing in the prior art by providing a large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection. The system utilizes a multi-modal data synchronous acquisition and fusion module, a dynamic inversion module, a dynamic adaptive correction module, and an online strategy optimization module to solve the problems mentioned in the background.

[0005] The technical solution of this invention to solve the above-mentioned technical problems is as follows: it specifically includes: a multimodal data synchronous acquisition and fusion module, a dynamic inversion module, a dynamic adaptive correction module, and an online strategy optimization module, wherein;

[0006] Multimodal data synchronous acquisition and fusion module: When the system is powered on and flow metering begins, this multimodal data synchronous acquisition and fusion module synchronously acquires waveform data from the dual-channel ultrasonic transducer and readings from temperature and pressure sensors deployed on the pipeline to obtain raw data tuples. The dynamic time warping algorithm is used to align the data in the raw data tuples in time sequence, and the aligned data is spliced ​​and fused to generate synchronous multimodal data blocks.

[0007] Dynamic inversion module: Receives multimodal data blocks output by the multimodal data synchronous acquisition and fusion module, extracts the temporal features of ultrasonic wave data and the spatial distribution features of temperature data through a dual-stream neural network, fuses the extracted features, and outputs a fluid homogeneity index describing the degree of fluid uniformity through regression calculation based on the feature fusion result;

[0008] Dynamic adaptive correction module: Receives the fluid uniformity index output by the dynamic inversion module, and performs nonlinear correction on the initial flow velocity calculated based on the ultrasonic propagation time difference using a dynamic correction function according to the magnitude of the fluid uniformity index, and outputs the corrected true flow velocity value.

[0009] Online strategy optimization module: The combination of the dynamic inversion module and the dynamic adaptive correction module is used as the agent, and the accuracy of the flow measurement value is used as the reward signal. The internal weight parameters of the dual-stream neural network and the function parameters of the dynamic correction function are adjusted online through the reinforcement learning algorithm to form a closed-loop optimization.

[0010] In a preferred embodiment, the specific process of synchronously acquiring waveform data from the dual-channel ultrasonic transducer and readings from temperature and pressure sensors deployed on the pipeline in the multimodal data synchronous acquisition and fusion module is as follows:

[0011] When the system is powered on and flow metering begins, it acquires in parallel the raw waveform signals from the first ultrasonic channel, the raw waveform signals from the second ultrasonic channel, the readings from the temperature sensor array distributed at different locations in the pipeline, and the readings from the pressure sensor. The temperature sensor array contains multiple temperature measurement points. The multimodal data synchronous acquisition and fusion module associates each acquisition action with a unified time stamp generated by a high-precision clock source and generates a raw data tuple with a unified time stamp. This raw data tuple includes the ultrasonic waveform data from the first ultrasonic channel, the ultrasonic waveform data from the second ultrasonic channel, the temperature sensor array data, and the pressure sensor data.

[0012] In a preferred embodiment, the specific operation of performing time-series alignment of the data in the original data tuple using the dynamic time warping algorithm is as follows:

[0013] First, the multimodal data synchronous acquisition and fusion module designates the ultrasonic wave data with the highest sampling rate as the reference data, while the temperature sensor array data and pressure sensor data are used as the data to be aligned.

[0014] Next, for each piece of data to be aligned, the mutual information between it and the reference data within a sliding time window is calculated, and this mutual information is used as the normalization weight.

[0015] Then, an objective function is constructed as the optimization objective. This objective function simultaneously pursues minimizing the cumulative distance between the baseline data and the data to be aligned after the normalization path adjustment, and maximizing the total weighted mutual information between all the data to be aligned and the baseline data after the normalization path adjustment. By solving this optimization objective, an optimal normalization path is found for each data to be aligned.

[0016] Finally, based on their respective optimal normalization paths, all the data to be aligned are aligned with the reference data on the time axis to generate time-synchronized ultrasonic alignment data, temperature sensor array alignment data, and pressure sensor alignment data.

[0017] In a preferred embodiment, the specific process of splicing and fusing the aligned data to generate a synchronized multimodal data block includes:

[0018] First, from the time-aligned ultrasonic shape alignment data, the sound wave propagation time characteristics, signal energy characteristics, and center frequency offset characteristics are extracted for the first ultrasonic channel and the second ultrasonic channel, respectively.

[0019] Then, a corresponding quality factor is calculated for each extracted sound wave propagation time feature, signal energy feature, and center frequency offset feature. This quality factor is jointly determined by the smoothness of the warping path corresponding to the extracted sound wave propagation time feature, signal energy feature, or center frequency offset feature during the dynamic time warping process and the signal-to-noise ratio of the ultrasonic wave signal from which the feature originates. The smoothness of the warping path is evaluated by calculating the reciprocal of the second derivative of the warping path, and the signal-to-noise ratio of the ultrasonic wave signal is calculated by the ratio of signal power to noise power.

[0020] Next, the temperature sensor array alignment data and the pressure sensor alignment data are used as the overall features;

[0021] Finally, the propagation time characteristics of the first ultrasonic channel with quality factor, the signal energy characteristics of the first ultrasonic channel with quality factor, the center frequency offset characteristics of the first ultrasonic channel with quality factor, the propagation time characteristics of the second ultrasonic channel with quality factor, the signal energy characteristics of the second ultrasonic channel with quality factor, the center frequency offset characteristics of the second ultrasonic channel with quality factor, the alignment data characteristics of the temperature sensor array, and the alignment data characteristics of the pressure sensor are concatenated in a predetermined order into a comprehensive feature vector, and a unified timestamp is added to this feature vector to form a synchronous multimodal data block.

[0022] In a preferred embodiment, the specific operation of extracting the temporal features of the ultrasonic wave data through a dual-stream neural network in the dynamic inversion module is as follows:

[0023] The system receives multimodal data blocks from the multimodal data synchronous acquisition and fusion module, and first constructs a time window data sequence of length NWQ, where NWQ is a preset positive integer window size. This time window data sequence consists of multimodal data blocks of the current timestamp t and the previous NWQ-1 timestamps.

[0024] Then, each multimodal data block in the time window data sequence is parsed to obtain the data content at each time point. The data at each time point includes the ultrasonic shape features of the first ultrasonic channel and the ultrasonic shape features of the second ultrasonic channel. The ultrasonic shape features of each channel include sound wave propagation time features, signal energy features and center frequency offset features, and each ultrasonic shape feature corresponds to a quality factor.

[0025] Meanwhile, the data at each time point also includes temperature sensor array data and pressure sensor data. The temperature sensor array data consists of readings from multiple spatially distributed temperature measurement points, while the pressure sensor data is a single-value reading.

[0026] Then, for each ultrasonic channel, a feature set is constructed based on data from multiple time points within the time window. This feature set includes the sound wave propagation time characteristics, signal energy characteristics, and center frequency shift characteristics at each time point. At the same time, a quality factor set is constructed, which includes the quality factor corresponding to each feature.

[0027] Next, for each channel, each feature in the feature set is multiplied by the corresponding quality factor in the quality factor set to achieve weighted processing, resulting in weighted sound wave propagation time features, weighted signal energy features, and weighted center frequency offset features.

[0028] Then, the weighted sound wave propagation time characteristics, weighted signal energy characteristics, and weighted center frequency offset characteristics of each channel are arranged in chronological order to form the weighted feature matrix of that channel.

[0029] The weighted feature matrix of the first ultrasonic channel is input into the temporal feature extraction subnetwork, which is composed of a one-dimensional convolutional neural network. The local temporal pattern is extracted through the convolutional layer, the feature dimensionality is reduced through the pooling layer, and the fixed-dimensional feature vector is output through the fully connected layer to obtain the temporal feature vector of the first ultrasonic channel.

[0030] Simultaneously, the weighted feature matrix of the second ultrasonic channel is input into another temporal feature extraction subnetwork with the same structure to obtain the temporal feature vector of the second ultrasonic channel; finally, the temporal feature vectors of the first and second ultrasonic channels are concatenated to obtain the joint temporal feature vector of the two channels.

[0031] In a preferred embodiment, the specific operation of fusing the extracted features and outputting the fluid homogeneity index through regression calculation based on the feature fusion result is as follows:

[0032] Extract the temperature sensor array data vector and pressure sensor data scalar at the current time point t from the parsed time window data sequence; input the temperature sensor array data vector into the spatial feature extraction subnetwork, which is composed of fully connected layers. The spatial relationship between temperature measurement points is learned by weighted learning through the fully connected layers, and a spatial distribution feature vector is output.

[0033] The joint temporal feature vector of the two channels is concatenated with the spatial distribution feature vector to form a fused feature vector;

[0034] The fused feature vector is input into the first fully connected layer. The first fully connected layer uses a linear rectified function as the activation function to perform linear transformation and nonlinear activation on the fused feature vector to obtain the intermediate feature vector.

[0035] The intermediate feature vector is input into the regression layer, which includes a second fully connected layer and a sigmoid function. The second fully connected layer maps the intermediate feature vector into a scalar value, and the sigmoid function compresses the scalar value to a value between zero and one, which serves as the fluid homogeneity index.

[0036] In a preferred embodiment, the dynamic adaptive correction module performs nonlinear correction using a dynamic correction function based on the magnitude of the fluid homogeneity index value, including an input data acquisition and verification step and a dynamic correction factor calculation step.

[0037] In the input data acquisition and verification step, the dynamic adaptive correction module receives the fluid homogeneity index and the initial flow velocity calculated based on the ultrasonic propagation time difference from the dynamic inversion module, and performs validity verification on the received fluid homogeneity index, checking whether the index is within the closed interval of zero to one, and performs non-negativity verification on the initial flow velocity.

[0038] If the fluid uniformity index exceeds the effective range, the historical average value is used instead. If the initial flow velocity is negative, the historical average value is used instead, and the abnormal state is recorded and a warning log is triggered. After the verification is passed, the standardized fluid uniformity index and initial flow velocity are output to the dynamic correction factor calculation step.

[0039] In the dynamic correction factor calculation step, the dynamic adaptive correction module uses a dynamic correction function to calculate the dynamic correction factor. This dynamic correction function is a nonlinear function about the fluid homogeneity index. Its function value increases monotonically as the fluid homogeneity index decreases, and the function curve exhibits smooth change characteristics. The dynamic correction function is composed of a hyperbolic tangent function and an exponential function. The hyperbolic tangent function is used to provide smooth and bounded nonlinear response characteristics, while the exponential function is used to adjust the shape characteristics of the function curve.

[0040] The dynamic correction function contains three adjustable parameters: the correction intensity coefficient, the sensitivity parameter, and the attenuation factor. The correction intensity coefficient is used to control the overall correction magnitude, the sensitivity parameter is used to adjust the function's response to changes in the fluid homogeneity index, and the attenuation factor is used to suppress excessive growth of the correction factor when the fluid homogeneity index is small.

[0041] The dynamic correction factor is calculated by adding a value to a correction term, where the correction term is the product of the correction intensity coefficient, the result of the hyperbolic tangent function, and the result of the exponential function. The input of the hyperbolic tangent function is the product of the sensitivity parameter and a factor minus the fluid homogeneity index, and the input of the exponential function is the product of the negative attenuation factor and a factor minus the square of the fluid homogeneity index.

[0042] In a preferred embodiment, the output corrected true flow velocity value includes a flow velocity correction and output step. In the flow velocity correction and output step, the dynamic adaptive correction module multiplies the dynamic correction factor obtained in the dynamic correction factor calculation step with the verified initial flow velocity to obtain the corrected true flow velocity value.

[0043] Meanwhile, the dynamic adaptive correction module also records complete correction process data, including fluid homogeneity index, dynamic correction factor, initial flow velocity and corrected actual flow velocity value, and adds a unified timestamp identifier to these data.

[0044] In addition, the dynamic adaptive correction module also includes an adaptive optimization mechanism. This mechanism dynamically adjusts the values ​​of the three adjustable parameters in the dynamic correction function—the correction intensity coefficient, the sensitivity parameter, and the attenuation factor—based on the evaluation results of long-term operation, so as to achieve continuous self-optimization of correction performance.

[0045] In a preferred embodiment, the online policy optimization module uses a combination of a dynamic inversion module and a dynamic adaptive correction module as the agent, including steps for optimizing state space construction and feature extraction, as well as steps for designing a multi-objective reward function and calculating rewards.

[0046] In the optimization of state space construction and feature extraction steps, the online policy optimization module constructs a comprehensive state vector to describe the complete operating state of the system at a given time. This state vector integrates multi-source information, including the fluid uniformity index sequence at the current time and multiple historical times within a preset historical window length obtained from the dynamic inversion module, the correction factor sequence and flow velocity sequence within the same time window obtained from the dynamic adaptive correction module, and the flow measurement quality index obtained from the system monitoring unit. Feature extraction is performed on these raw data, including calculating statistical features and frequency domain features within the sliding window. The statistical features include trend slope and fluctuation intensity, and the frequency domain features include the energy distribution of the dominant frequency component. After normalizing all extracted features, they are concatenated into a comprehensive feature vector, which serves as the environmental state perceived by the reinforcement learning agent.

[0047] In the design and calculation steps of the multi-objective reward function, the online policy optimization module designs a multi-objective reward function consisting of three weighted components: an accuracy reward component, a stability reward component, and an energy consumption penalty component. The accuracy reward component is calculated based on the deviation between the measured flow velocity value and the reference value, using the Huber loss function. The stability reward component is calculated based on the smoothness of the flow velocity change rate, quantifying the degree of measurement fluctuation by evaluating the second derivative of the flow velocity. The energy consumption penalty component is calculated based on the magnitude of the agent's action vector. The total reward is the weighted sum of the accuracy reward component, the stability reward component, and the energy consumption penalty component, where the weight coefficients of each component are dynamically adjusted according to system requirements, and the sum of the three is equal to one.

[0048] In a preferred embodiment, the online adjustment of the internal weight parameters and function parameters of the dynamic correction function of the two-stream neural network using a reinforcement learning algorithm includes a parameter space exploration and policy update step based on proximal policy optimization, and a parameter update and system reconfiguration step under security constraints. In the parameter space exploration and policy update step based on proximal policy optimization, the online policy optimization module uses a proximal policy optimization algorithm to learn and optimize the policy online. The agent's action is defined as the adjustment amount of the key system parameters, including the weight parameters of the two-stream neural network in the dynamic inversion module and the parameters of the dynamic correction function in the dynamic adaptive correction module. The policy network takes the state vector as input and outputs the probability distribution of the parameter adjustment amount. The value network evaluates the state value and updates the policy network parameters by optimizing the pruning replacement objective function. The pruning replacement objective function calculates the product of the probability ratio and the estimated value of the advantage function and applies the pruning function to limit the range of change of the probability ratio.

[0049] In the parameter update and system reconfiguration steps under security constraints, the online policy optimization module performs multiple security checks before applying the parameter adjustment amount output by the policy network. These checks include whether the adjusted parameters are within the physically feasible range, predicting the impact of parameter changes on system stability through simulation, and if the prediction indicates that the changes will lead to system oscillation or divergence, then the constraint optimization method is used to recalculate the adjustment amount. Finally, the parameter update is applied in a smooth transition manner.

[0050] The beneficial effects of this invention are: the system can significantly improve the flow measurement accuracy of large-diameter pipelines under complex fluid conditions, intelligently integrate multi-sensor data and dynamically sense the fluid uniformity state, adaptively correct measurement errors, and has online self-learning optimization capabilities, which can maintain measurement accuracy for a long time, effectively overcome the limitations of traditional methods in non-uniform flow fields, and provide reliable data support for energy management and resource settlement. Attached Figure Description

[0051] Figure 1 This is a flowchart of the method of the present invention;

[0052] Figure 2 This is a block diagram of the system structure of the present invention. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] In the description of this application, 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. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0055] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0056] Example 1

[0057] This embodiment provides, for example Figure 1-2 The present invention relates to a large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection, which specifically includes: a multi-modal data synchronous acquisition and fusion module, a dynamic inversion module, a dynamic adaptive correction module, and an online strategy optimization module, wherein;

[0058] Multimodal data synchronous acquisition and fusion module: When the system is powered on and flow metering begins, this module synchronously acquires waveform data from the dual-channel ultrasonic transducer and readings from temperature and pressure sensors deployed on the pipeline, thus obtaining raw data tuples. A dynamic time warping algorithm is used to align the data in the raw data tuples in time sequence, and the aligned data is then spliced ​​and fused to generate synchronized multimodal data blocks. This module, through a three-stage processing logic of "time-stamped acquisition → mutual information weighted dynamic warping → quality-aware feature fusion," not only solves the problem of multi-source data synchronization but also quantifies the synchronization quality and embeds it into the final multimodal data block. This provides a more complete and reliable data foundation for subsequent analysis steps, achieving a leap from "simple alignment" to "intelligent fusion." It is the first crucial guarantee for the high precision and robustness of the entire system, and its output multimodal data block serves as the common data foundation for all subsequent processing and optimization steps.

[0059] The dynamic inversion module receives multimodal data blocks output from the multimodal data synchronous acquisition and fusion module. It extracts the temporal features of the ultrasonic waveform data and the spatial distribution features of the temperature data using a dual-stream neural network, then fuses these features. Based on the feature fusion result, it outputs a fluid homogeneity index describing the degree of fluid uniformity through regression calculation. The multimodal data blocks provided by the multimodal data synchronous acquisition and fusion module contain time-aligned multi-sensor data with quality assessment. However, intelligently extracting abstract features reflecting fluid homogeneity from these data is a key problem that the dynamic inversion module needs to solve. Traditional methods may directly use physical models or simple statistics, but this module employs a deep learning-based approach to capture the complex nonlinear relationships in the data. The dynamic inversion module uses a dual-stream neural network architecture to process the temporal features of the ultrasonic waveform data and the spatial distribution features of the temperature data, and introduces a feature weighting mechanism based on a quality factor. Finally, it outputs a fluid homogeneity index through regression calculation. This index quantitatively describes the degree of fluid homogeneity and provides crucial input for subsequent correction steps.

[0060] Dynamic Adaptive Correction Module: Receives the fluid homogeneity index output by the dynamic inversion module. Based on the magnitude of this index, it uses a dynamic correction function to perform nonlinear correction on the initial flow velocity calculated based on the ultrasonic propagation time difference, outputting the corrected true flow velocity value. Through a chained process of "input verification → dynamic correction factor calculation → flow velocity correction," intelligent flow velocity compensation based on the fluid homogeneity index is achieved. The effect of this module is: it introduces a nonlinear correction function combining hyperbolic tangent and exponential decay. This function is not only highly responsive but also optimizes the curve shape through the decay factor, avoiding the shortcomings of conventional functions.

[0061] The online strategy optimization module uses a combination of a dynamic inversion module and a dynamic adaptive correction module as the intelligent agent. It uses the accuracy or stability of flow measurement values ​​as the reward signal and adjusts the internal weight parameters of the dual-stream neural network and the function parameters of the dynamic correction function online through a reinforcement learning algorithm, forming a closed-loop optimization. Through a closed-loop process of "state awareness - reward calculation - strategy update - security application," the system achieves continuous self-optimization. The module's effects are: AD1, multi-source fusion state space construction, comprehensively characterizing the system's operating state; AD2, multi-objective reward function design, balancing accuracy, stability, and efficiency; AD3, PPO-based security constraint strategy optimization, ensuring a stable and reliable learning process. This module is tightly integrated with other parts of the system, intelligently adjusting key parameters to give the entire system long-term adaptability and robustness, significantly improving the intelligence level of large-caliber flow metering.

[0062] In this embodiment, it is specifically necessary to explain the process of synchronously acquiring waveform data from the dual-channel ultrasonic transducer and readings from the temperature and pressure sensors deployed on the pipeline in the multimodal data synchronous acquisition and fusion module as follows:

[0063] When the system is powered on and flow metering begins, it acquires in parallel the raw waveform signals from the first ultrasonic channel, the raw waveform signals from the second ultrasonic channel, the readings from the temperature sensor array distributed at different locations in the pipeline, and the readings from the pressure sensor. The temperature sensor array contains multiple temperature measurement points. The multimodal data synchronous acquisition and fusion module associates each acquisition action with a unified time stamp generated by a high-precision clock source and generates a raw data tuple with a unified time stamp. This raw data tuple includes the ultrasonic waveform data from the first ultrasonic channel, the ultrasonic waveform data from the second ultrasonic channel, the temperature sensor array data, and the pressure sensor data.

[0064] The specific operation of using the dynamic time warping algorithm to perform time-series alignment of data in the original data tuple is as follows:

[0065] First, the multimodal data synchronous acquisition and fusion module designates the ultrasonic wave data with the highest sampling rate as the reference data, while the temperature sensor array data and pressure sensor data are used as the data to be aligned.

[0066] Next, for each piece of data to be aligned, the mutual information between it and the reference data within a sliding time window is calculated, and this mutual information is used as the normalization weight.

[0067] Then, an objective function is constructed as the optimization objective. This objective function simultaneously aims to minimize the cumulative distance between the baseline data and the data to be aligned after normalization path adjustment, and to maximize the total weighted mutual information between all the data to be aligned and the baseline data after normalization path adjustment. By solving this optimization objective, an optimal normalization path is found for each data to be aligned. The expression of the objective function is as follows:

[0068] ;

[0069] in, This represents the objective function, i.e., the function in the regularized path. The overall cost or loss value is determined by adjusting the overall cost or loss value. The goal of the optimization process is to adjust the overall cost or loss value. To minimize this function value, we can find the optimal alignment path. The normalized path is a mapping function used to index the time of the baseline data. Mapping to the time points of the data to be aligned. Indicates a regularized path Below is the time index of the benchmark data. The corresponding time point of the data to be aligned This represents a minimization operation, indicating the normalization of the path. Optimize to find a way to make the objective function The path with the smallest value, Indicates the summation symbol, and provides an index for all time periods of the baseline data. Perform an accumulation operation. These are discrete-time indexes on the baseline data, typically ranging from 1 to the length of the data stream. This represents a distance function used to measure the difference or distance between two data points. For example, using Euclidean distance, i.e. Calculation points and points The distance between them is the Euclidean distance; other common distance metrics include the Manhattan distance, etc. Indicates the index of the benchmark data at discrete time points. The value at that location, This is the reference data, typically selected from sensor data with the highest sampling rate and fastest response (such as ultrasonic waveforms), as the alignment reference. Indicates the first Data to be aligned at regularized path mapping points The value at that location, Indicates the first Data to be aligned (such as temperature sensor array data or pressure sensor data). It is a regular path Time index of the benchmark data Mapped to the corresponding point on this data. The tradeoff parameter is a positive real number used to balance the importance of two parts of the objective function: the cumulative distance term and the weighted mutual information term. The larger the value, the higher the weight of the weighted mutual information term in the optimization. Represents the summation symbol, indexing all data to be aligned. Perform an accumulation operation. Indicates the identifier of the data to be aligned, for example Corresponding temperature sensor array data, Corresponding pressure sensor data, etc. This represents the weight value (ranging from [0, +∞), where a larger value indicates a stronger correlation between the data stream and the baseline stream, and thus greater importance in the normalization process), used for the first... The weight of each data point in the weighted mutual information term. That is, the weight is equal to the benchmark data. data to be aligned The mutual information value within a certain time window reflects the statistical dependence between the two. Represents the mutual information function, used to calculate baseline data. With path Normalized data to be aligned Mutual information measures the statistical correlation between two variables; a higher value indicates a stronger dependency. Indicates the first The data is processed through a regularized path. The adjusted new data;

[0070] Finally, based on their respective optimal regularization paths, all the data to be aligned are aligned with the reference data on the time axis to generate time-synchronized ultrasonic alignment data, temperature sensor array alignment data, and pressure sensor alignment data.

[0071] The specific process of concatenating and fusing the aligned data to generate synchronized multimodal data blocks includes:

[0072] First, from the time-aligned ultrasonic shape alignment data, the sound wave propagation time characteristics, signal energy characteristics, and center frequency offset characteristics are extracted for the first ultrasonic channel and the second ultrasonic channel, respectively.

[0073] Then, a corresponding quality factor (value range [0,1], where 0 represents the lowest quality / unreliable and 1 represents the highest quality / completely reliable) is calculated for each extracted sound wave propagation time feature, signal energy feature, and center frequency offset feature. This quality factor is jointly determined by the smoothness of the warping path corresponding to the extracted sound wave propagation time feature, signal energy feature, or center frequency offset feature during the dynamic time warping process and the signal-to-noise ratio of the ultrasonic wave signal from which the feature originates. The smoothness of the warping path is evaluated by calculating the reciprocal of the second derivative of the warping path, and the signal-to-noise ratio of the ultrasonic wave signal is calculated by the ratio of signal power to noise power.

[0074] Next, the temperature sensor array alignment data and the pressure sensor alignment data are used as the overall features;

[0075] Finally, the propagation time characteristics of the first ultrasonic channel with quality factor, the signal energy characteristics of the first ultrasonic channel with quality factor, the center frequency offset characteristics of the first ultrasonic channel with quality factor, the propagation time characteristics of the second ultrasonic channel with quality factor, the signal energy characteristics of the second ultrasonic channel with quality factor, the center frequency offset characteristics of the second ultrasonic channel with quality factor, the alignment data characteristics of the temperature sensor array, and the alignment data characteristics of the pressure sensor are concatenated in a predetermined order into a comprehensive feature vector, and a unified timestamp is added to this feature vector to form a synchronous multimodal data block.

[0076] In this embodiment, it is specifically necessary to explain that in the dynamic inversion module, the specific operation of extracting the temporal features of the ultrasonic wave data through the dual-stream neural network is as follows:

[0077] The system receives multimodal data blocks from the multimodal data synchronous acquisition and fusion module, and first constructs a time window data sequence of length NWQ, where NWQ is a preset positive integer window size (e.g., NWQ=10). This time window data sequence consists of multimodal data blocks of the current timestamp t and the previous NWQ-1 timestamps, that is, it contains multimodal data blocks of multiple consecutive time points from timestamp t to timestamp t-NWQ+1.

[0078] Then, each multimodal data block in the time window data sequence is parsed to obtain the data content at each time point. The data at each time point includes the ultrasonic shape features of the first ultrasonic channel and the ultrasonic shape features of the second ultrasonic channel. The ultrasonic shape features of each channel include sound wave propagation time features, signal energy features and center frequency offset features, and each ultrasonic shape feature corresponds to a quality factor.

[0079] Meanwhile, the data at each time point also includes temperature sensor array data and pressure sensor data. The temperature sensor array data consists of readings from multiple spatially distributed temperature measurement points, while the pressure sensor data is a single-value reading.

[0080] Then, for each ultrasonic channel, a feature set is constructed based on data from multiple time points within the time window. This feature set includes the sound wave propagation time characteristics, signal energy characteristics, and center frequency shift characteristics at each time point. At the same time, a quality factor set is constructed, which includes the quality factor corresponding to each feature.

[0081] Next, for each channel, each feature in the feature set is multiplied by the corresponding quality factor in the quality factor set to achieve weighted processing, resulting in weighted sound wave propagation time features, weighted signal energy features, and weighted center frequency offset features.

[0082] Then, the weighted sound wave propagation time characteristics, weighted signal energy characteristics, and weighted center frequency offset characteristics of each channel are arranged in chronological order to form the weighted feature matrix of that channel.

[0083] The weighted feature matrix of the first ultrasonic channel is input into the temporal feature extraction subnetwork, which is composed of a one-dimensional convolutional neural network. The local temporal pattern is extracted through the convolutional layer, the feature dimensionality is reduced through the pooling layer, and the fixed-dimensional feature vector is output through the fully connected layer to obtain the temporal feature vector of the first ultrasonic channel.

[0084] Simultaneously, the weighted feature matrix of the second ultrasonic channel is input into another temporal feature extraction subnetwork with the same structure to obtain the temporal feature vector of the second ultrasonic channel; finally, the temporal feature vector of the first ultrasonic channel and the temporal feature vector of the second ultrasonic channel are concatenated to obtain the joint temporal feature vector of the two channels.

[0085] The specific steps for fusing the extracted features and calculating the fluid homogeneity index based on the feature fusion results through regression are as follows:

[0086] Extract the temperature sensor array data vector and pressure sensor data scalar at the current time point t from the parsed time window data sequence; input the temperature sensor array data vector into the spatial feature extraction sub-network, which is composed of fully connected layers or graph convolutional networks. The fully connected layers perform weighted learning of the spatial relationship between temperature measurement points (or the graph convolutional network is configured to learn the spatial relationship between temperature measurement points through distance-weighted interaction) and output a spatial distribution feature vector. The spatial feature extraction sub-network contains non-linear activation functions and normalization layers to enhance feature representation.

[0087] The joint temporal feature vector of the two channels is concatenated with the spatial distribution feature vector to form a fused feature vector, as shown in the formula:

[0088] ;

[0089] in, This represents the fused feature vector, which, as the output of the ReLU activation function, is the final fused feature representation after nonlinear transformation. It contains all the high-level feature information used to determine fluid homogeneity. Represents the linear rectification activation function. This represents the weight matrix of the fusion layer, a parameter matrix that needs to be learned through training and is used for linear transformations. The joint temporal feature vector representing the two channels, extracted by the temporal subnetwork in the two-stream neural network, represents the variation pattern of the ultrasonic wave data in the time dimension. The spatial distribution feature vector, extracted from the spatial subnetwork of the two-stream neural network, represents the differences in the spatial distribution of temperature sensors within the pipeline. This represents the vector concatenation operator, which joins two vectors end-to-end to create a longer vector. This represents the bias vector of the fusion layer, which is also a parameter that needs to be learned to adjust the output;

[0090] The fused feature vector is input into the first fully connected layer. The first fully connected layer uses a linear rectified function as the activation function to perform linear transformation and nonlinear activation on the fused feature vector to obtain the intermediate feature vector.

[0091] The intermediate feature vector is input into a regression layer, which consists of a second fully connected layer and a sigmoid function. The second fully connected layer maps the intermediate feature vector to a scalar value, and the sigmoid function compresses the scalar value to a value between zero and one, which serves as the fluid homogeneity index. The closer the index value is to one, the more homogeneous the fluid; the closer it is to zero, the more heterogeneous the fluid. The regression calculation formula is:

[0092] ;

[0093] in, This represents the fluid homogeneity index, the final output of the system, and is a result specific to time point t. The sigmoid function is an activation function that maps any real number to the open interval (0,1). This represents the dot product operation, which calculates the dot product of the weight vector and the eigenvector, resulting in a scalar. This represents the weight vector of the regression layer. These are key parameters that the regression layer needs to learn. Their dot product operation determines the contribution of each dimension in the fused feature vector to the final output. The superscript "" indicates the weight vector. The "" operator represents the transpose operator, used to transpose the weight vector of the regression layer. Transform from column vector to row vector This represents the bias scalar of the regression layer, a constant parameter that needs to be learned, used to fine-tune the dot product result, and provides the baseline offset. This represents the fused feature vector.

[0094] In this embodiment, it is specifically necessary to explain that in the dynamic adaptive correction module, the nonlinear correction using the dynamic correction function based on the magnitude of the fluid homogeneity index value includes the steps of input data acquisition and verification, as well as the steps of dynamic correction factor calculation.

[0095] In the input data acquisition and verification step, the dynamic adaptive correction module receives the fluid homogeneity index and the initial flow velocity calculated based on the ultrasonic propagation time difference from the dynamic inversion module, and performs validity verification on the received fluid homogeneity index to check whether the index is within the closed interval of zero to one. At the same time, it performs non-negativity verification on the initial flow velocity to ensure that it is a non-negative real number.

[0096] If the fluid uniformity index exceeds the effective range, the historical average or the preset default value will be used instead. If the initial flow velocity is negative, the historical average or the preset default value will be used instead, and the abnormal state will be recorded and a warning log will be triggered. After the verification is passed, the standardized fluid uniformity index and initial flow velocity will be output to the dynamic correction factor calculation step.

[0097] In the dynamic correction factor calculation step, the dynamic adaptive correction module uses a dynamic correction function to calculate the dynamic correction factor. This dynamic correction function is a nonlinear function of the fluid homogeneity index. Its function value increases monotonically as the fluid homogeneity index decreases, and the function curve exhibits smooth change characteristics. The dynamic correction function is composed of a hyperbolic tangent function and an exponential function. The hyperbolic tangent function is used to provide smooth and bounded nonlinear response characteristics, while the exponential function is used to adjust the shape characteristics of the function curve to prevent the correction factor from growing excessively when the fluid homogeneity index approaches zero.

[0098] The dynamic correction function contains three adjustable parameters: the correction intensity coefficient, the sensitivity parameter, and the attenuation factor. The correction intensity coefficient is used to control the overall correction magnitude, the sensitivity parameter is used to adjust the function's response to changes in the fluid homogeneity index, and the attenuation factor is used to suppress excessive growth of the correction factor when the fluid homogeneity index is small.

[0099] The dynamic correction factor is calculated as follows: A numerical value is added to a correction term, where the correction term is the product of the correction intensity coefficient, the result of the hyperbolic tangent function calculation, and the result of the exponential function calculation. The input to the hyperbolic tangent function is the product of the sensitivity parameter and a factor minus the fluid homogeneity index, and the input to the exponential function is the product of the negative attenuation factor and a factor minus the square of the fluid homogeneity index. The formula for the dynamic correction factor is:

[0100] ;

[0101] in, This represents the dynamic correction factor, a dimensionless numerical value used to correct the initial flow velocity. Subsequent steps multiply the initial flow velocity by this factor to obtain a value closer to the true flow velocity. This indicates that it changes over time, and a new correction factor is generated at each calculation time t. Indicates the fluid homogeneity index. This represents the correction strength coefficient, an adjustable parameter used to control the overall correction amplitude. Its value ranges from -0.5 to 0.5, and is a real number. When the value is positive, a positive correction is performed (increasing the flow rate when the fluid is non-uniform); when... When the value is negative, a reverse correction is performed (reducing the flow rate when the fluid is non-uniform). The specific value is determined through system calibration. This represents a sensitivity parameter used to control the dynamic correction factor. For fluid homogeneity index The sensitivity to change, taking values ​​that are positive real numbers between [1, 10]. The larger the value, the more it means Even a tiny decrease will cause the dynamic correction factor to... The dramatic increase in ... The smaller the value, the "smoother" the function response. This represents the attenuation factor when the fluid is highly non-uniform. When very close to 0), it is used to suppress excessive growth of the dynamic correction factor and prevent "overcorrection". Its value is a non-negative real number between [0, 5]. Together, these terms create a "Gaussian decay" effect in the exponential function exp(...), optimizing the shape of the function curve. tanh represents the hyperbolic tangent function, which smoothly compresses an input value of arbitrary size into the interval (-1, 1). In this formula, it ensures that regardless of... Regardless of the changes, the contribution of the correction term is smooth and bounded, avoiding abrupt changes in the results. exp represents the exponential function, and in this formula, it is related to... Combined, they form a decay term, when When the fluid becomes less homogeneous, The exponent increases, but the negative sign causes the exponent term exp(-a large positive number) to decrease, thereby suppressing the growth caused by the tanh function and acting as a "smooth brake".

[0102] The output of the corrected true flow velocity value includes the flow velocity correction and output steps. In the flow velocity correction and output steps, the dynamic adaptive correction module multiplies the dynamic correction factor obtained in the dynamic correction factor calculation step with the verified initial flow velocity to obtain the corrected true flow velocity value.

[0103] Meanwhile, the dynamic adaptive correction module also records complete correction process data, including fluid homogeneity index, dynamic correction factor, initial flow velocity and corrected actual flow velocity value, and adds a unified timestamp to these data for subsequent time series analysis, system diagnosis and performance optimization.

[0104] In addition, the dynamic adaptive correction module also includes an adaptive optimization mechanism. This mechanism dynamically adjusts the values ​​of the three adjustable parameters in the dynamic correction function—the correction intensity coefficient, the sensitivity parameter, and the attenuation factor—based on the evaluation results of long-term operation, so as to achieve continuous self-optimization of correction performance.

[0105] In this embodiment, it is specifically necessary to explain that in the online policy optimization module, the combination of the dynamic inversion module and the dynamic adaptive correction module is used as the intelligent agent, including the optimization state space construction and feature extraction steps as well as the multi-objective reward function design and reward calculation steps;

[0106] In the optimization of state space construction and feature extraction steps, the online policy optimization module constructs a comprehensive state vector to describe the complete operating state of the system at a given time. This state vector integrates multi-source information, including the fluid uniformity index sequence at the current time and multiple historical times within a preset historical window length obtained from the dynamic inversion module, the correction factor sequence and flow velocity sequence within the same time window obtained from the dynamic adaptive correction module, and the flow measurement quality index obtained from the system monitoring unit. Feature extraction is performed on these raw data, including calculating statistical features and frequency domain features within the sliding window. The statistical features include trend slope and fluctuation intensity, and the frequency domain features include the energy distribution of the dominant frequency component. After normalizing all extracted features, they are concatenated into a comprehensive feature vector, which serves as the environmental state perceived by the reinforcement learning agent.

[0107] In the multi-objective reward function design and reward calculation steps, the online policy optimization module designs a multi-objective reward function that simultaneously optimizes measurement accuracy and system stability. This reward function consists of three weighted components: an accuracy reward component, a stability reward component, and an energy consumption penalty component. The accuracy reward component is calculated based on the deviation between the measured flow velocity value and the reference value, and uses the Huber loss function to enhance robustness to outliers. The stability reward component is calculated based on the smoothness of the flow velocity change rate, quantifying the degree of measurement fluctuation by evaluating the second derivative of the flow velocity. The energy consumption penalty component is calculated based on the magnitude of the agent's action vector, encouraging efficient parameter adjustment. The total reward is the weighted sum of the accuracy reward component, the stability reward component, and the energy consumption penalty component, where the weight coefficients of each component are dynamically adjusted according to system requirements, and the sum of the three is equal to one.

[0108] The online adjustment of the internal weight parameters and dynamic correction function parameters of the two-stream neural network through reinforcement learning algorithms includes parameter space exploration and policy update steps based on proximal policy optimization, as well as parameter update and system reconfiguration steps under security constraints. In the parameter space exploration and policy update steps based on proximal policy optimization, the online policy optimization module uses the proximal policy optimization algorithm to learn the optimization policy online. The agent's action is defined as the adjustment amount of key system parameters, including the weight parameters of the two-stream neural network in the dynamic inversion module and the parameters of the dynamic correction function in the dynamic adaptive correction module. The policy network takes the state vector as input and outputs the probability distribution of the parameter adjustment amount. The value network evaluates the state value and updates the policy network parameters by optimizing the pruning replacement objective function. The pruning replacement objective function calculates the product of the probability ratio and the estimated value of the advantage function, and applies the pruning function to limit the range of change of the probability ratio to ensure the stability of the policy update. The formula of the proximal policy optimization algorithm is:

[0109] ;

[0110] in, This refers to the loss function, which in machine learning measures the difference between the model's predictions and the actual values. The goal of the PPO algorithm is to optimize (usually maximize) this specific loss function. To update the strategy, the superscript " This indicates a version of the loss function in the PPO algorithm that uses pruning techniques. Pruning is used to prevent drastic changes in policy parameters with each update, thereby ensuring the stability of the training process. The parameters of the policy network, the policy network It is a neural network, and its parameters are... Its function is: the agent determines the current state based on the current state. and policy network parameters To decide what action to take. The optimization objective is to continuously adjust and optimize using methods such as gradient ascent. This enables the policy network to output actions that yield higher rewards. The expected value represents the loss, meaning the algorithm doesn't calculate the loss based on a single instance of experience, but rather on the average loss across a batch of empirical data. This ensures the stability and effectiveness of parameter updates. `min` represents the minimum value function, which constructs the loss function by comparing two terms and taking the smaller one. Its purpose is to provide a lower bound, ensuring that even if estimates of some experiences are overly optimistic when optimizing the strategy, the actual update magnitude is limited to a reasonable range, thus greatly improving training stability. This represents the probability ratio, calculated as follows: ; This indicates that the new policy (the policy to be updated) is in state. Take action below The probability, Indicates the old strategy (action to be performed) The probability of taking the same action under the same conditions (using the strategy employed at the time). This indicates that the new strategy is more inclined to take action. ;like This indicates that the new strategy is less inclined to take that action. This represents the advantage function estimate, which quantitatively assesses the performance of a given state. Take action below How good it is, its value represents the difference between the expected reward obtained by taking a specific action and the expected reward obtained by taking the average action in that state. , to describe the action Better than average; if This indicates that the action is worse than the average action. This represents the clipping function, used to compare probability ratios. Limited to the range Within, for example, if ,and ,So The result is 1.2, which directly prevents the probability ratio from being too large or too small, thus limiting the update step size of the policy. This represents the pruning parameter, used to define the range of pruning. It directly controls the maximum amount of change the strategy is allowed to make in a single update, and is typically set between 0.1 and 0.3. Smaller values ​​are preferred. This means a more conservative and stable update;

[0111] In the parameter update and system reconfiguration steps under security constraints, the online policy optimization module performs multiple security checks before applying the parameter adjustment amount output by the policy network. These checks include whether the adjusted parameters are within the physically feasible range, predicting the impact of parameter changes on system stability through simulation, and if the prediction indicates that the changes will lead to system oscillation or divergence, then the adjustment amount is recalculated using a constraint optimization method. Finally, the parameter update is applied in a smooth transition manner to avoid system instability caused by sudden changes, and the adjustment decision data is recorded for subsequent policy evaluation.

[0112] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0113] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0117] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0118] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection, characterized in that, Specifically, it includes: The system includes a multimodal data synchronous acquisition and fusion module, a dynamic inversion module, a dynamic adaptive correction module, and an online strategy optimization module; Multimodal data synchronous acquisition and fusion module: When the system is powered on and flow metering begins, this multimodal data synchronous acquisition and fusion module synchronously acquires waveform data from the dual-channel ultrasonic transducer and readings from temperature and pressure sensors deployed on the pipeline to obtain raw data tuples. The dynamic time warping algorithm is used to align the data in the raw data tuples in time sequence, and the aligned data is spliced ​​and fused to generate synchronous multimodal data blocks. Dynamic inversion module: Receives multimodal data blocks output by the multimodal data synchronous acquisition and fusion module, extracts the temporal features of ultrasonic wave data and the spatial distribution features of temperature data through a dual-stream neural network, fuses the extracted features, and outputs a fluid homogeneity index describing the degree of fluid uniformity through regression calculation based on the feature fusion result; Dynamic adaptive correction module: Receives the fluid uniformity index output by the dynamic inversion module, and performs nonlinear correction on the initial flow velocity calculated based on the ultrasonic propagation time difference using a dynamic correction function according to the magnitude of the fluid uniformity index, and outputs the corrected true flow velocity value. Online strategy optimization module: Using the combination of the dynamic inversion module and the dynamic adaptive correction module as the agent, and the accuracy of the flow measurement value as the reward signal, the internal weight parameters of the dual-stream neural network and the function parameters of the dynamic correction function are adjusted online through reinforcement learning algorithm to form closed-loop optimization.

2. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 1, characterized in that: In the multimodal data synchronous acquisition and fusion module, the specific process of synchronously acquiring waveform data from the dual-channel ultrasonic transducer and readings from temperature and pressure sensors deployed on the pipeline is as follows: When the system is powered on and flow metering begins, it acquires in parallel the raw waveform signals from the first ultrasonic channel, the raw waveform signals from the second ultrasonic channel, the readings from the temperature sensor array distributed at different locations in the pipeline, and the readings from the pressure sensor. The temperature sensor array contains multiple temperature measurement points. The multimodal data synchronous acquisition and fusion module associates each acquisition action with a unified time stamp generated by a high-precision clock source and generates a raw data tuple with a unified time stamp. This raw data tuple includes the ultrasonic waveform data from the first ultrasonic channel, the ultrasonic waveform data from the second ultrasonic channel, the temperature sensor array data, and the pressure sensor data.

3. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 2, characterized in that: The specific operation of using the dynamic time warping algorithm to perform time-series alignment of the data in the original data tuple is as follows: First, the multimodal data synchronous acquisition and fusion module designates the ultrasonic wave data with the highest sampling rate as the reference data, while the temperature sensor array data and pressure sensor data are used as the data to be aligned. Next, for each piece of data to be aligned, the mutual information between it and the reference data within a sliding time window is calculated, and this mutual information is used as the normalization weight. Then, an objective function is constructed as the optimization objective. This objective function simultaneously pursues minimizing the cumulative distance between the baseline data and the data to be aligned after the normalization path adjustment, and maximizing the total weighted mutual information between all the data to be aligned and the baseline data after the normalization path adjustment. By solving this optimization objective, an optimal normalization path is found for each data to be aligned. Finally, based on their respective optimal normalization paths, all the data to be aligned are aligned with the reference data on the time axis to generate time-synchronized ultrasonic alignment data, temperature sensor array alignment data, and pressure sensor alignment data.

4. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 3, characterized in that: The specific process of concatenating and fusing the aligned data to generate synchronized multimodal data blocks includes: First, from the time-aligned ultrasonic shape alignment data, the sound wave propagation time characteristics, signal energy characteristics, and center frequency offset characteristics are extracted for the first ultrasonic channel and the second ultrasonic channel, respectively. Then, a corresponding quality factor is calculated for each extracted sound wave propagation time feature, signal energy feature, and center frequency offset feature. This quality factor is jointly determined by the smoothness of the warping path corresponding to the extracted sound wave propagation time feature, signal energy feature, or center frequency offset feature during the dynamic time warping process and the signal-to-noise ratio of the ultrasonic wave signal from which the feature originates. The smoothness of the warping path is evaluated by calculating the reciprocal of the second derivative of the warping path, and the signal-to-noise ratio of the ultrasonic wave signal is calculated by the ratio of signal power to noise power. Next, the temperature sensor array alignment data and the pressure sensor alignment data are used as the overall features; Finally, the propagation time characteristics of the first ultrasonic channel with quality factor, the signal energy characteristics of the first ultrasonic channel with quality factor, the center frequency offset characteristics of the first ultrasonic channel with quality factor, the propagation time characteristics of the second ultrasonic channel with quality factor, the signal energy characteristics of the second ultrasonic channel with quality factor, the center frequency offset characteristics of the second ultrasonic channel with quality factor, the alignment data characteristics of the temperature sensor array, and the alignment data characteristics of the pressure sensor are concatenated in a predetermined order into a comprehensive feature vector, and a unified timestamp is added to this feature vector to form a synchronous multimodal data block.

5. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 4, characterized in that: In the dynamic inversion module, the specific operation of extracting the temporal features of the ultrasonic wave data through a dual-stream neural network is as follows: The system receives multimodal data blocks from the multimodal data synchronous acquisition and fusion module, and first constructs a time window data sequence of length NWQ, where NWQ is a preset positive integer window size. This time window data sequence consists of multimodal data blocks of the current timestamp t and the previous NWQ-1 timestamps. Then, each multimodal data block in the time window data sequence is parsed to obtain the data content at each time point. The data at each time point includes the ultrasonic shape features of the first ultrasonic channel and the ultrasonic shape features of the second ultrasonic channel. The ultrasonic shape features of each channel include sound wave propagation time features, signal energy features and center frequency offset features, and each ultrasonic shape feature corresponds to a quality factor. Meanwhile, the data at each time point also includes temperature sensor array data and pressure sensor data. The temperature sensor array data consists of readings from multiple spatially distributed temperature measurement points, while the pressure sensor data is a single-value reading. Then, for each ultrasonic channel, a feature set is constructed based on data from multiple time points within the time window. This feature set includes the sound wave propagation time characteristics, signal energy characteristics, and center frequency shift characteristics at each time point. At the same time, a quality factor set is constructed, which includes the quality factor corresponding to each feature. Next, for each channel, each feature in the feature set is multiplied by the corresponding quality factor in the quality factor set to achieve weighted processing, resulting in weighted sound wave propagation time features, weighted signal energy features, and weighted center frequency offset features. Then, the weighted sound wave propagation time characteristics, weighted signal energy characteristics, and weighted center frequency offset characteristics of each channel are arranged in chronological order to form the weighted feature matrix of that channel. The weighted feature matrix of the first ultrasonic channel is input into the temporal feature extraction subnetwork, which is composed of a one-dimensional convolutional neural network. The local temporal pattern is extracted through the convolutional layer, the feature dimensionality is reduced through the pooling layer, and the fixed-dimensional feature vector is output through the fully connected layer to obtain the temporal feature vector of the first ultrasonic channel. Simultaneously, the weighted feature matrix of the second ultrasonic channel is input into another temporal feature extraction subnetwork with the same structure to obtain the temporal feature vector of the second ultrasonic channel; finally, the temporal feature vectors of the first and second ultrasonic channels are concatenated to obtain the joint temporal feature vector of the two channels.

6. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 5, characterized in that: The specific operation of fusing the extracted features and outputting the fluid uniformity index through regression calculation based on the feature fusion result is as follows: Extract the temperature sensor array data vector and pressure sensor data scalar at the current time point t from the parsed time window data sequence; input the temperature sensor array data vector into the spatial feature extraction subnetwork, which is composed of fully connected layers. The spatial relationship between temperature measurement points is learned by weighted learning through the fully connected layers, and a spatial distribution feature vector is output. The joint temporal feature vector of the two channels is concatenated with the spatial distribution feature vector to form a fused feature vector; The fused feature vector is input into the first fully connected layer. The first fully connected layer uses a linear rectified function as the activation function to perform linear transformation and nonlinear activation on the fused feature vector to obtain the intermediate feature vector. The intermediate feature vector is input into the regression layer, which includes a second fully connected layer and a sigmoid function. The second fully connected layer maps the intermediate feature vector into a scalar value, and the sigmoid function compresses the scalar value to a value between zero and one, which serves as the fluid homogeneity index.

7. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 6, characterized in that: The dynamic adaptive correction module includes a step of input data acquisition and verification, and a step of dynamic correction factor calculation, which uses a dynamic correction function to perform nonlinear correction based on the magnitude of the fluid homogeneity index value. In the input data acquisition and verification step, the dynamic adaptive correction module receives the fluid homogeneity index and the initial flow velocity calculated based on the ultrasonic propagation time difference from the dynamic inversion module, and performs validity verification on the received fluid homogeneity index, checking whether the index is within the closed interval of zero to one, and performs non-negativity verification on the initial flow velocity. If the fluid uniformity index exceeds the effective range, the historical average value is used instead. If the initial flow velocity is negative, the historical average value is used instead, and the abnormal state is recorded and a warning log is triggered. After the verification is passed, the standardized fluid uniformity index and initial flow velocity are output to the dynamic correction factor calculation step. In the dynamic correction factor calculation step, the dynamic adaptive correction module uses a dynamic correction function to calculate the dynamic correction factor. This dynamic correction function is a nonlinear function about the fluid homogeneity index. Its function value increases monotonically as the fluid homogeneity index decreases, and the function curve exhibits smooth change characteristics. The dynamic correction function is composed of a hyperbolic tangent function and an exponential function. The hyperbolic tangent function is used to provide smooth and bounded nonlinear response characteristics, while the exponential function is used to adjust the shape characteristics of the function curve. The dynamic correction function contains three adjustable parameters: the correction intensity coefficient, the sensitivity parameter, and the attenuation factor. The correction intensity coefficient is used to control the overall correction magnitude, the sensitivity parameter is used to adjust the function's response to changes in the fluid homogeneity index, and the attenuation factor is used to suppress excessive growth of the correction factor when the fluid homogeneity index is small. The dynamic correction factor is calculated by adding a value to a correction term, where the correction term is the product of the correction intensity coefficient, the result of the hyperbolic tangent function, and the result of the exponential function. The input of the hyperbolic tangent function is the product of the sensitivity parameter and a factor minus the fluid homogeneity index, and the input of the exponential function is the product of the negative attenuation factor and a factor minus the square of the fluid homogeneity index.

8. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 7, characterized in that: The output corrected true flow velocity value includes flow velocity correction and output steps. In the flow velocity correction and output steps, the dynamic adaptive correction module multiplies the dynamic correction factor obtained in the dynamic correction factor calculation step with the verified initial flow velocity to obtain the corrected true flow velocity value. Meanwhile, the dynamic adaptive correction module also records complete correction process data, including fluid homogeneity index, dynamic correction factor, initial flow velocity and corrected actual flow velocity value, and adds a unified timestamp identifier to these data. In addition, the dynamic adaptive correction module also includes an adaptive optimization mechanism. This mechanism dynamically adjusts the values ​​of the three adjustable parameters in the dynamic correction function—the correction intensity coefficient, the sensitivity parameter, and the attenuation factor—based on the evaluation results of long-term operation, so as to achieve continuous self-optimization of correction performance.

9. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 8, characterized in that: The online policy optimization module uses a combination of a dynamic inversion module and a dynamic adaptive correction module as the intelligent agent, including steps for optimizing state space construction and feature extraction, as well as steps for designing a multi-objective reward function and calculating rewards. In the optimization of state space construction and feature extraction steps, the online policy optimization module constructs a comprehensive state vector to describe the complete operating state of the system at a given time. This state vector integrates multi-source information, including the fluid uniformity index sequence at the current time and multiple historical times within a preset historical window length obtained from the dynamic inversion module, the correction factor sequence and flow velocity sequence within the same time window obtained from the dynamic adaptive correction module, and the flow measurement quality index obtained from the system monitoring unit. Feature extraction is performed on these raw data, including calculating statistical features and frequency domain features within the sliding window. The statistical features include trend slope and fluctuation intensity, and the frequency domain features include the energy distribution of the dominant frequency component. After normalizing all extracted features, they are concatenated into a comprehensive feature vector, which serves as the environmental state perceived by the reinforcement learning agent. In the design and calculation steps of the multi-objective reward function, the online policy optimization module designs a multi-objective reward function consisting of three weighted components: an accuracy reward component, a stability reward component, and an energy consumption penalty component. The accuracy reward component is calculated based on the deviation between the measured flow velocity value and the reference value, using the Huber loss function. The stability reward component is calculated based on the smoothness of the flow velocity change rate, quantifying the degree of measurement fluctuation by evaluating the second derivative of the flow velocity. The energy consumption penalty component is calculated based on the magnitude of the agent's action vector. The total reward is the weighted sum of the accuracy reward component, the stability reward component, and the energy consumption penalty component, where the weight coefficients of each component are dynamically adjusted according to system requirements, and the sum of the three is equal to one.

10. The large-diameter hot and cold water flow metering system based on dual-channel ultrasonic detection according to claim 9, characterized in that: The online adjustment of the internal weight parameters and function parameters of the dynamic correction function of the two-stream neural network using reinforcement learning algorithms includes a parameter space exploration and policy update step based on proximal policy optimization, and a parameter update and system reconfiguration step under security constraints. In the parameter space exploration and policy update step based on proximal policy optimization, the online policy optimization module uses the proximal policy optimization algorithm to learn the optimization policy online. The agent's action is defined as the adjustment amount of the key system parameters, including the weight parameters of the two-stream neural network in the dynamic inversion module and the parameters of the dynamic correction function in the dynamic adaptive correction module. The policy network takes the state vector as input and outputs the probability distribution of the parameter adjustment amount. The value network evaluates the state value and updates the policy network parameters by optimizing the pruning replacement objective function. The pruning replacement objective function calculates the product of the probability ratio and the estimated value of the advantage function and applies the pruning function to limit the range of change of the probability ratio. In the parameter update and system reconfiguration steps under security constraints, the online policy optimization module performs multiple security checks before applying the parameter adjustment amount output by the policy network. These checks include whether the adjusted parameters are within the physically feasible range, predicting the impact of parameter changes on system stability through simulation, and if the prediction indicates that the changes will lead to system oscillation or divergence, then the constraint optimization method is used to recalculate the adjustment amount. Finally, the parameter update is applied in a smooth transition manner.

Citation Information

Patent Citations

  • Sound channel weight coefficient calculation method of multichannel ultrasound wave gas flowmeter

    CN106895890A

  • Two-phase flow measurement method based on differential pressure capacitance sensing and data knowledge driving

    CN119509630A