Ultrasonic flow sensor signal processing method, equipment, medium and product

By dynamically adjusting the filtering and gain parameters of the ultrasonic flow sensor using a machine learning model, the measurement accuracy and stability issues of the ultrasonic flow sensor under varying operating conditions are solved, achieving efficient signal processing and cross-media adaptability.

CN121346922APending Publication Date: 2026-01-16ZHEJIANG RONGXIN GAS METER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511744616.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Existing ultrasonic flow sensors are unable to adapt to changes in ambient temperature and differences in the acoustic impedance of the medium when faced with varying operating conditions, resulting in signal attenuation and noise interference, which affects measurement accuracy and stability.

Method used

Machine learning models are used to predict filtering and gain parameters. By adjusting the center frequency and bandwidth of the signal filter and the signal gain, the system dynamically adapts to environmental changes. Combined with real-time sound velocity, the system adjusts the signal sampling time and duration to achieve adaptive signal processing.

Benefits of technology

It improves the system's measurement accuracy and cross-medium adaptability under complex working conditions, ensures the efficiency and reliability of signal processing, and reduces measurement errors and noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121346922A_ABST
    Figure CN121346922A_ABST
Patent Text Reader

Abstract

The invention provides an ultrasonic flow sensor signal processing method and device, a medium and a product, and relates to the technical field of signal processing.The method comprises the steps that a first ultrasonic signal measured last time and current environment data are input into a machine learning model to obtain a set of control instructions, the instructions include a first control instruction for adjusting a filtering parameter and a second control instruction for adjusting a gain parameter. And then, when the second ultrasonic signal measured this time is processed, the filtering parameter is adjusted according to the first control instruction to carry out band-pass filtering, and phase compensation is carried out on the filtered signal. And adjusting a signal gain parameter according to the second control instruction to perform gain amplification on the phase-compensated signal, and outputting a target signal. And finally, the flight time difference is calculated according to the target signal, and the instantaneous flow is calculated according to the flight time difference. According to the scheme, the technical problem that flow measured by an ultrasonic flow sensor cannot adapt to dynamically changing working conditions is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of signal processing technology, specifically to a signal processing method, device, medium, and product for an ultrasonic flow sensor. Background Technology

[0002] Ultrasonic flow sensors calculate flow rate by measuring the propagation characteristics of ultrasonic waves in fluids and have been widely used in industrial and civilian fields. The core challenge of this technology lies in how to accurately and stably capture weak ultrasonic signals from complex environments filled with interference. In practical applications, electromagnetic noise in industrial settings, sensor temperature drift, and the diversity of measurement media all pose severe challenges to the reliability of signal acquisition.

[0003] To achieve signal extraction and processing, existing technologies generally employ a hardware signal conditioning scheme. This scheme typically includes a bandpass filter constructed from fixed resistors and capacitors and a fixed-gain amplifier. The passband range of the filter is predetermined during design based on the sensor's nominal frequency, while the amplifier's gain is a compromise value selected based on the signal attenuation under typical operating conditions. The hardware parameters of the entire circuit remain unchanged after production.

[0004] However, the limitations of fixed-parameter circuitry become apparent when faced with varying real-world operating conditions. When changes in ambient temperature cause the sensor's center frequency to drift, the fixed filter passband excessively attenuates the useful signal, leading to a decrease in the signal-to-noise ratio. Furthermore, when the measurement medium switches between air and natural gas, the significant difference in acoustic impedance causes drastic changes in signal attenuation. In such cases, a fixed-gain amplifier may either under-amplify, resulting in the signal being overwhelmed by noise, or over-amplify, causing saturation distortion. Both situations severely impact the accuracy of time-of-flight calculations, making such systems unsuitable for a wide range of varying operating conditions. Summary of the Invention

[0005] This application provides a signal processing method, device, medium, and product for an ultrasonic flow sensor to solve the technical problem that existing ultrasonic flow sensors cannot adapt to dynamically changing working conditions when measuring flow.

[0006] In a first aspect, this application provides a signal processing method for an ultrasonic flow sensor, comprising: The first ultrasonic signal from the previous measurement and the current environmental data are input into the machine learning model to obtain a set of control instructions. The set of control instructions includes a first control instruction for adjusting the signal filtering parameters and a second control instruction for adjusting the signal gain parameters. The machine learning model is trained based on historical ultrasonic data and historical environmental data. According to the first control command, the filtering parameters are adjusted, the second ultrasonic signal measured in this measurement is bandpass filtered, and the filtered signal is output. The filtered signal is phase-compensated, and the phase-compensated signal is output. The signal gain parameter is adjusted according to the second control command, the phase-compensated signal is amplified, and the target signal is output.

[0007] The flight time difference is calculated based on the target signal, and the instantaneous flow rate is calculated based on the flight time difference.

[0008] Optionally, the step of inputting the first ultrasonic signal from the previous measurement and the current environmental data into the machine learning model includes, prior to: Calculate the current sound speed based on the first ultrasonic signal; The second ultrasonic signal is acquired based on the sampling start time and duration of the current sound speed adjustment signal sampling.

[0009] Optionally, the step of adjusting the filtering parameters according to the first control command, performing bandpass filtering on the second ultrasonic signal measured in this instance, and outputting the filtered signal specifically includes: The second ultrasonic signal is input to a multi-stage operational amplifier for signal amplification to obtain the amplified signal. The amplified signal is input to a filter circuit composed of a programmable resistor array and a capacitor switching network. According to the first control command, the analog switch is controlled to change the circuit structure of the filter circuit to filter the amplified signal and obtain the filtered signal. Optionally, the step of adjusting the filtering parameters according to the first control command, performing bandpass filtering on the second ultrasonic signal measured in this instance, and outputting the filtered signal further includes: The second ultrasonic signal is sampled by an ADC to obtain the sampled signal; The filtering coefficients of the digital filtering device, which is composed of a digital signal processor or a configurable logic module, are adjusted according to the first control instruction. The sampled signal is input to a digital filtering device that updates the filtering coefficients, and the sampled signal is digitally filtered to obtain the filtered signal.

[0010] Optionally, the step of performing phase compensation on the filtered signal and outputting the phase-compensated signal specifically includes: The filtered signal is input to a phase-locked loop circuit, and the phase difference between the filtered signal and the feedback signal output by the voltage-controlled oscillator in the phase-locked loop circuit is compared by a phase detector in the phase-locked loop circuit. The phase difference signal is converted into a control current by a charge pump in the phase-locked loop circuit. The control current is converted into a stable control voltage through the loop filter in the phase-locked loop circuit; The voltage-controlled oscillator adjusts the output frequency according to the stable control voltage to lock the phase of the feedback signal with the filtered signal, and outputs the phase-compensated signal.

[0011] Optionally, the step of performing phase compensation on the filtered signal and outputting the phase-compensated signal further includes: The filtered signal is subjected to Hilbert transform for phase detection. Based on the results of the phase detection, the instantaneous phase of the filtered signal is calculated; Calculate the average phase error value based on the instantaneous phase; The average phase error value is used as a correction parameter, and the filtered signal is processed by a fractional delay filter to achieve phase correction corresponding to the average phase error value, thereby obtaining the phase-compensated signal.

[0012] Optionally, the step of adjusting the signal gain parameter according to the second control command, amplifying the gain of the phase-compensated signal, and outputting the target signal specifically includes: The upper and lower intensity thresholds are set by the second control command, and the upper and lower intensity thresholds are predicted by the machine learning model based on the first ultrasonic signal and the current environmental data. When the signal strength of the phase-compensated signal is greater than the upper limit threshold, the signal gain value is reduced so that the signal strength of the phase-compensated signal is less than or equal to the upper limit threshold. When the signal strength of the phase-compensated signal is less than the lower limit threshold, the signal gain value is increased so that the signal strength of the phase-compensated signal is greater than or equal to the lower limit threshold.

[0013] In a second aspect, embodiments of this application provide an ultrasonic flow sensor signal processing device, which includes one or more processors and a memory; the memory is coupled to the one or more processors and is used to store computer program code, which includes computer instructions, and the one or more processors call the computer instructions to cause the ultrasonic flow sensor signal processing device to perform the method described in the first aspect and any possible implementation thereof.

[0014] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on an ultrasonic flow sensor signal processing device, cause the ultrasonic flow sensor signal processing device to perform the method described in the first aspect and any possible implementation thereof.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an ultrasonic flow sensor signal processing device, cause the ultrasonic flow sensor signal processing device to perform the method described in the first aspect and any possible implementation thereof.

[0016] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By adopting the above technical solution, a machine learning model is trained using historical ultrasonic data and historical environmental data. Combining the signal from the previous measurement with current environmental data, the trained machine learning model predicts the optimal filtering and gain parameters required for the next measurement. This predictive parameter configuration method replaces the traditional passive feedback mode of adjusting only after problems occur, thus avoiding the accumulation of measurement errors caused by adjustment delays when operating conditions change rapidly. Therefore, this method enables the signal processing system to achieve forward-looking and consistent adaptive adjustment, significantly improving the measurement accuracy of the system under complex and variable operating conditions.

[0017] 2. By adopting the above technical solution, the current sound velocity is calculated through analysis of the first ultrasonic signal. The current sound velocity reflects the influence of environmental factors such as the current medium properties and temperature on the ultrasonic propagation time. Based on the real-time sound velocity, the system can predict the approximate arrival time and waveform duration of the second ultrasonic signal to be measured next, and dynamically adjust the start time and duration of signal sampling accordingly. This adaptive sampling window adjustment ensures that the ultrasonic sensor can always acquire signals at the appropriate time and for the appropriate duration. This avoids acquiring a large amount of useless signals due to sampling too early or too long, and also prevents the truncation of key signal waveforms due to sampling too late or too short. Thus, while improving system operating efficiency, it ensures the integrity and reliability of the original sampled data.

[0018] 3. By adopting the above technical solution, and using the first control command to control the analog switch to change the circuit structure of the programmable resistor array and capacitor switching network, precise dynamic adjustment of the center frequency and bandwidth of the high-order filter is achieved. This structure combines the noise suppression capability of high-order filtering with the flexibility of digital control, ensuring that no matter how the received signal changes, the filter can always perform filtering with a suitable center frequency and bandwidth, thereby continuously obtaining a high signal-to-noise ratio over a wide frequency range.

[0019] 4. By adopting the above technical solution, the second control command sets a dynamic intensity threshold predicted by the machine learning model based on the current operating conditions. This approach elevates the goal of gain control from maintaining a constant amplitude to pursuing an optimal signal strength that matches the current environment. For example, when the model determines that the current medium attenuation is significant based on changes in sound velocity, or predicts a decrease in the sensitivity of the ultrasonic sensor based on temperature changes, it will set a higher intensity threshold accordingly. The gain control logic will automatically increase the gain value to achieve this new, higher target signal strength. This intelligent target setting allows the gain control process to proactively compensate for signal attenuation caused by changes in the medium or environment, thereby achieving a better signal-to-noise ratio under various signal strength conditions and greatly enhancing the system's cross-medium adaptability. Attached Figure Description

[0020] Figure 1 This is a schematic flowchart of an ultrasonic flow sensor signal processing method in an embodiment of this application; Figure 2 This is a schematic diagram of the phase-locked loop circuit in the embodiment of this application; Figure 3 This is a schematic diagram of the physical device structure of an ultrasonic flow sensor signal processing device in the embodiments of this application. Detailed Implementation

[0021] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification 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.

[0022] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.

[0023] In the description of the embodiments of this application, the term "multiple" means two or more. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0024] This application provides a signal processing method for an ultrasonic flow sensor, referencing... Figure 1 , Figure 1 This is a flowchart of an ultrasonic flow sensor signal processing method provided in an embodiment of this application. The method includes: Step S101: Input the first ultrasonic signal from the previous measurement and the current environmental data into the machine learning model to obtain a set of control commands; Here, the first ultrasonic signal refers to the complete digital waveform data representing the ultrasonic echo acquired by the ultrasonic sensor in the previous measurement cycle, including the downstream waveform and the upstream waveform; the current environmental data refers to the set of parameters that can characterize the physical state of the measurement environment, acquired in real time by external physical sensors such as temperature sensors and pressure sensors; the machine learning model refers to a mathematical model that is pre-trained through supervised learning methods and can establish and express the complex nonlinear mapping relationship between historical data input and optimal control parameter output; and the set of control commands refers to a set of specific digital parameters output by the machine learning model for configuring the hardware or software modules of the subsequent signal processing stage.

[0025] Specifically, this step is performed at the beginning of a new measurement cycle, before processing the ultrasonic signal from the current measurement. First, the acquired ultrasonic signal is integrated with current environmental data read from external sensors, such as temperature and pressure values. Then, this integrated set of features is used as input to a pre-trained machine learning model for inference calculations. The machine learning model can be trained using regression algorithms such as gradient boosting decision trees or neural networks, utilizing a dataset containing a large number of historical operating condition features and corresponding known optimal parameter settings that optimize signal quality. Specifically, the training input features of the machine learning model may include signal-to-noise ratio, signal amplitude, waveform broadening, etc., extracted from historical ultrasonic signals, as well as historical environmental data; the output labels are the optimal filter center frequency, bandwidth, and gain value determined experimentally or through simulation under the current operating condition that minimizes the time-of-flight difference measurement error. After model inference, a set of optimal control commands is output, for example, a control command consisting of a digital vector containing parameters such as the target center frequency, bandwidth, and gain value.

[0026] Step S102: Adjust the filtering parameters according to the first control command, perform bandpass filtering on the second ultrasonic signal measured this time, and output the filtered signal; The first control instruction refers to the part of the set of control instructions obtained in step S101 that is specifically used to set the working characteristics of the bandpass filter, such as a parameter pair containing center frequency and bandwidth values; the filter parameter refers to the attribute in the hardware or software module of the bandpass filter that can be externally programmed and determines its frequency response characteristics; the second ultrasonic signal refers to the raw analog signal received by the ultrasonic sensor in the current measurement cycle without any processing.

[0027] Specifically, the specific filtering parameters in the first control command are first parsed out; for example, the target center frequency is 205kHz and the target bandwidth is 8kHz. Then, the bandpass filter is configured based on these parameters. This configuration process can be implemented in two parallel ways: one is an analog filtering scheme, where the microcontroller unit sends the command to an active filter circuit composed of a programmable resistor array and a capacitor switching network via a digital communication bus, adjusting its passband range by changing the RC time constant of the circuit; the other is a digital filtering scheme, where the microcontroller unit recalculates the coefficients of a digital filter (such as an FIR or IIR filter) according to the command, and after the signal is digitized by the analog-to-digital converter, the updated digital filter performs the filtering process.

[0028] Step S103: Perform phase compensation on the filtered signal and output the phase-compensated signal; Here, the filtered signal refers to the signal that has been filtered out of most out-of-band noise after the bandpass filtering process in step S102; phase compensation refers to a process aimed at correcting or offsetting systematic phase shifts unrelated to flow rate, which is the key to suppressing zero drift.

[0029] Specifically, this step follows immediately after the filtering step. The system performs a phase adjustment operation on the filtered signal. The purpose of this phase adjustment operation is to compensate for systematic phase shifts in the filtered signal. The magnitude of the compensated phase angle is determined by the phase shift, and the direction is opposite to the systematic phase shift that needs to be compensated. This operation can be performed either by a controllable analog phase-shifting circuit before signal digitization or by a digital signal processing algorithm after signal digitization. The final result is the output of a phase-compensated signal with the systematic phase shift effectively canceled out.

[0030] Step S104: Adjust the signal gain parameter according to the second control command, amplify the gain of the phase-compensated signal, and output the target signal; The second control instruction refers to the part of the set of control instructions obtained in step S101 that is specifically used to set the working characteristics of the signal amplification stage; the signal gain parameter refers to the amplification factor of the signal amplifier that can be externally programmed; the target signal refers to the final signal whose signal amplitude is adjusted to the level range most suitable for subsequent analog-to-digital converter quantization after gain amplification.

[0031] Specifically, the system adjusts the signal gain parameters according to the second control command to apply precise voltage amplification to the input phase-compensated signal. This adjustment process can be implemented in two parallel ways: one is direct gain setting, where the second control command directly includes a specific target gain value, and the microcontroller unit assigns this value to a programmable gain amplifier; the other is dynamic target setting, where the second control command includes a set of upper and lower threshold values ​​for signal strength predicted by a machine learning model, and an automatic gain control loop automatically increases or decreases the gain based on the comparison between the current signal strength and the set of dynamic thresholds, so that the signal strength converges to the threshold range.

[0032] Step S105: Calculate the flight time difference based on the target signal, and calculate the instantaneous flow rate based on the flight time difference; In this step, the target signal specifically refers to the digitized data sequence representing complete waveform information obtained after passing through an analog-to-digital converter (ADC); the time difference of flight, or ΔT, is the difference between the time taken for ultrasonic waves to propagate downstream and upstream in a fluid; and the instantaneous flow rate refers to the volume of fluid passing through a cross-section of a pipe per unit time.

[0033] Specifically, the system employs a cross-correlation algorithm based on Fast Fourier Transform (FFT). This algorithm utilizes information from the entire waveform for comparison, rather than relying on a single threshold or peak point. The execution process of this algorithm is as follows: First, the cross-correlation function is calculated. According to the correlation theorem, the cross-correlation operation of two signals in the time domain is equivalent to their product operation in the frequency domain. To improve computational efficiency, the system first performs a Fast Fourier Transform (FFT) on the upstream and downstream waveform data of the target signal, respectively, to obtain their respective complex frequency domain representations. Then, one of the frequency domain representations is subjected to a complex conjugate operation, and the two are multiplied element-wise in the frequency domain. Finally, the inverse Fast Fourier Transform (IFFT) is performed on the multiplication result, and the result is the sequence of cross-correlation functions of the two original signals in the time domain.

[0034] Secondly, the system searches for the integer peak position. Each value in the cross-correlation function sequence represents the similarity between two original signals at a corresponding time delay. The system searches for the maximum value in the sequence, and the index of this maximum value is the integer sampling point delay that best aligns the two waveforms macroscopically.

[0035] Secondly, peak accuracy is improved through interpolation. Since the true peak position is highly likely to fall between two discrete sampling points, the system uses an interpolation algorithm to refine the integer peak positions to achieve sub-sampling period level accuracy. For example, parabolic interpolation is used, selecting the integer peak point obtained in the previous step and its two immediately adjacent points, fitting a parabola through these three points, and analytically solving for the vertex position of the parabola. This vertex position is a high-precision peak position with a decimal value.

[0036] Finally, multiplying the precise peak position obtained through interpolation by the ADC sampling period yields a time-of-flight difference ΔT that is far more accurate than the hardware sampling rate. This ΔT is then combined with known channel geometry parameters and fluid dynamics formulas, such as first calculating the flow velocity v based on v≈(c²*ΔT) / (2*L*cos(θ)), and then calculating the instantaneous flow rate Q based on Q=v*A, where c is the speed of sound, L, θ, and A are known channel geometry parameters, L represents the straight-line distance between the two ultrasonic sensors, θ represents the angle between the ultrasonic propagation path and the central axis of the pipe, and A represents the cross-sectional area of ​​the pipe through which the fluid flows.

[0037] The following is a more detailed description of the process of the method provided in this implementation.

[0038] Optionally, steps S106 and S107 may be performed before step S101.

[0039] Step S106: Calculate the current sound speed based on the first ultrasonic signal; The first ultrasonic signal refers to two sets of digital waveform data, including both downstream and upstream measurements, acquired and stored by the analog-to-digital converter in the previous measurement cycle; the current sound velocity refers to the actual speed at which the ultrasonic wave propagates in the current fluid medium, and this physical quantity is closely related to the fluid's temperature, pressure, chemical composition, and other state parameters.

[0040] Specifically, this step is performed during the data processing phase of one measurement cycle, and its calculation results will guide the signal acquisition process of the next measurement cycle. The microcontroller unit first processes the downstream and upstream waveform data contained in the first ultrasonic signal to calculate the downstream flight time (T_down) and upstream flight time (T_up), respectively. Subsequently, based on the principles of fluid mechanics, the current sound velocity c is calculated using the formula c=(L / 2)*[(1 / T_down)+(1 / T_up)], where L is the known linear propagation distance between the ultrasonic transducers. For example, if L is known to be 0.1 meters, and T_down is calculated to be 222.0 microseconds and T_up to be 222.5 microseconds by analyzing the first ultrasonic signal, the current sound velocity c can be calculated to be approximately 450 meters per second. This value can be used to characterize the acoustic properties of the current medium.

[0041] Step S107: Based on the current sound speed, adjust the sampling start time and duration of the signal sampling, and acquire the second ultrasonic signal; Wherein, the current sound velocity refers to the physical quantity that characterizes the current acoustic properties of the medium, calculated by step S106; the sampling start time refers to the time delay between the moment the ultrasonic wave is emitted and the moment the ultrasonic sensor starts the sampling operation; the duration refers to the total duration of the ultrasonic sensor performing one continuous sampling operation, also known as the width of the sampling window; and the second ultrasonic signal refers to the original ultrasonic signal that will be physically acquired in the current measurement cycle.

[0042] Specifically, this step is performed just before the physical signal acquisition action of this measurement occurs. Its purpose is to optimize the operating window of the analog-to-digital converter and ensure that the complete and valid signal is captured with the highest efficiency. First, regarding the sampling start time, the microcontroller unit predicts the approximate flight time of the next ultrasonic signal based on the current sound velocity c and the known propagation distance L using the formula T_pred≈L / c. To ensure that no signal is missed, the system sets the actual sampling start time (T_pred) to be slightly less than this predicted value. For example, if the predicted flight time is 222 microseconds, the sampling start time can be set to 210 microseconds. Second, regarding the duration, the system can infer the medium type and its broadening effect on the signal waveform based on the sound velocity value, thereby setting a sampling duration sufficient to cover the complete signal packet. For example, when the sound velocity value indicates that the medium is air, a shorter duration such as 40 microseconds can be set; when the sound velocity value indicates that the medium is natural gas with greater attenuation, a longer duration such as 60 microseconds can be set.

[0043] Optionally, steps S10201-S10202 are more specific steps than step S102.

[0044] Step S10201: The second ultrasonic signal is input to a multi-stage operational amplifier for signal amplification to obtain the amplified signal; Among them, a multi-stage operational amplifier refers to a circuit composed of two or more operational amplifier units cascaded together. Its design purpose is to provide a higher total gain and a wider gain-bandwidth product than a single-stage operational amplifier, and to provide a structural basis for building high-order filters. The amplified signal refers to an analog signal whose signal amplitude has been increased to a level suitable for subsequent circuit processing after being processed by the multi-stage operational amplifier.

[0045] Specifically, this step is performed as the front end of the analog signal conditioning chain. The second ultrasonic signal attenuates due to propagation in the medium, and its amplitude is typically in the microvolt or millivolt range, resulting in a low signal-to-noise ratio when processed directly. Therefore, this signal is first input to the multi-stage operational amplifier. For example, an amplification task with a total gain of 40dB can be assigned to two operational amplifier stages, each providing 20dB of gain. This allocation not only ensures stable operation of each stage within its effective operating bandwidth but also improves the noise performance of the entire amplification chain by optimizing the noise figure of the first stage, ultimately outputting a significantly enhanced signal with lower distortion.

[0046] Step S10202: The amplified signal is input to a filter circuit composed of a programmable resistor array and a capacitor switching network. The analog switch is controlled to change the circuit structure of the filter circuit according to the first control instruction to filter the amplified signal and obtain the filtered signal. Among them, programmable resistor array and capacitor switching network refer to integrated circuits or discrete component sets whose internal resistance values ​​or capacitor network connections can be controlled by external digital signals; filter circuit refers to an active filter with adjustable frequency response characteristics formed by the programmable components and operational amplifiers; first control instruction refers to a set of digital control codes generated by the microcontroller unit for setting the on and off states of the analog switch; circuit structure refers to a specific circuit topology with different RC time constants formed by changing the closed and open states of the analog switch.

[0047] Specifically, this step is performed after signal amplification and before further processing. The microcontroller unit converts the target filtering parameters (e.g., center frequency 205kHz, bandwidth 8kHz) predicted by the machine learning model into the first control command. This command is sent to the filtering circuit to control multiple analog switches within it. For example, command 0b1011 might disconnect a capacitor branch while simultaneously connecting a tap of a programmable resistor array to the circuit. By altering the RC combination in the feedback network in this way, the center frequency, Q value (quality factor), and bandwidth of the filtering circuit are adjusted in real time and precisely, ensuring that its passband range matches the target specified by the command. Ultimately, this filters the input amplified signal and outputs the filtered signal.

[0048] Optionally, steps S10203-S10205 are another more specific step of step S102; Step S10203: Perform ADC sampling on the second ultrasonic signal to obtain the sampled signal; The second ultrasonic signal refers to the original analog signal received by the sensor; ADC sampling refers to the process by which an analog-to-digital converter (ADC) converts a continuously changing analog signal into a series of discrete digital values ​​at fixed time intervals; the sampled signal refers to a digital data sequence that represents the complete information of the waveform of the original analog signal changing over time, and each value in the sequence corresponds to the signal amplitude at a sampling time.

[0049] Specifically, this step is performed as the entry point for the digital filtering scheme. To process in the digital domain, the analog signal from the physical world must first be digitized. The second ultrasonic signal, with or without pre-amplification, is input to a high-speed, high-precision ADC. The ADC samples at a rate much higher than the signal's Nyquist frequency (e.g., tens of MHz) to ensure that all details of the signal are captured and to avoid spectral aliasing. For example, a 60-microsecond ultrasonic envelope, at a sampling rate of 50 MHz, will be converted into a data array containing 3000 samples. This array, the sampled signal, is stored in the memory of the microcontroller unit for subsequent digital processing.

[0050] Step S10204: Adjust the filtering coefficients of the digital filtering device composed of a digital signal processor or a configurable logic module according to the first control instruction; The first control instruction refers to a set of digital parameters, such as the target center frequency and bandwidth, predicted by a machine learning model and containing the target filtering characteristics. The digital filtering device refers to a hardware computing unit capable of executing digital filtering algorithms, such as the extended instruction set of a digital signal processor (DSP) integrated in a central processing unit (CPU) core, or a logic unit configured in a field-programmable gate array (FPGA). The filter coefficients refer to a set of numerical constants used to define the frequency response characteristics of a digital filter (such as a finite-length unit impulse response (FIR) filter or an infinite-length unit impulse response (IIR) filter).

[0051] Specifically, this step is performed before the actual digital filtering operation, and its purpose is to "prepare" the filter. The microcontroller unit first parses the first control instruction to obtain parameters such as the target center frequency and bandwidth. Then, it calls a coefficient calculation subroutine; for example, for an FIR filter, a window function method (such as a Hamming window or Blackman window) or a frequency sampling method can be used to calculate a completely new set of filter coefficients in real time based on the target parameters. For example, to implement a bandpass filter with a center frequency of 205 kHz, the algorithm generates a set of coefficients that produce maximum gain at that frequency and attenuation at other frequencies. This newly calculated set of coefficients is then loaded into the corresponding registers or memory areas of the digital filtering device.

[0052] Step S10205: Input the sampled signal into the digital filtering device after updating the filtering coefficients, and perform digital filtering on the sampled signal to obtain the filtered signal; Here, the sampled signal refers to the unfiltered raw digitized waveform data obtained in step S10203; the updated state of the filtering coefficients means that the internal parameters of the digital filtering device have been replaced by the newly calculated coefficients in step S10204; digital filtering refers to the process of changing the signal spectral components through mathematical operations in the digital domain; the filtered signal refers to a new digitized data sequence after digital filtering, in which out-of-band noise components are suppressed and only the signal components within the target frequency band are retained.

[0053] Specifically, this step performs the actual filtering operation. The microcontroller unit feeds the sampled signal data stream stored in memory into the digital filtering device point by point or in blocks. The digital filtering device performs mathematical operations on the input data stream using updated filter coefficients. For an FIR filter, this operation is convolution, meaning each output point is obtained by a weighted sum of the current and several past input points and their corresponding filter coefficients. For an IIR filter, this operation is recursion, meaning the calculation of each output point depends not only on the input points but also on previously calculated output points. Through these operations, components in the signal whose frequency does not match the filter passband are attenuated, ultimately resulting in a filtered signal containing only the target frequency band signal.

[0054] Optional, see reference Figure 2 Steps S10301-S10304 are more specific steps than step S103. Step S10301: The filtered signal is input to the phase-locked loop circuit, and the phase difference between the filtered signal and the feedback signal output by the voltage-controlled oscillator in the phase-locked loop circuit is compared by the phase detector in the phase-locked loop circuit. Among them, a phase-locked loop (PLL) circuit is an electronic system that keeps the phase of its output signal synchronized with the phase of an external reference signal through an internal negative feedback mechanism; a phase detector (PD) is a circuit module used to compare the phase difference between two input signals; a voltage-controlled oscillator (VCO) is an oscillator module whose output signal frequency is determined by the input control voltage; a feedback signal is a signal generated by the VCO and sent back to the input of the phase detector; and the phase difference is used to represent the relative lead or lag of the filtered signal and the feedback signal on the time axis.

[0055] Specifically, this step serves as the starting point for the phase-locked loop (PLL) closed-loop control and is executed continuously throughout the signal processing. One input of the phase detector receives the filtered signal, while the other input receives the feedback signal from the voltage-controlled oscillator (VCO). The phase detector determines the phase relationship between the two signals by comparing the occurrence times of their rising or falling edges. It outputs a set of digital logic signals, typically called UP (up) and DOWN (down) pulses. For example, when the phase of the feedback signal lags behind the phase of the filtered signal, the phase detector will generate a series of pulses at its UP output, with the pulse width proportional to the phase difference.

[0056] Step S10302: The phase difference signal is converted into a control current by the charge pump in the phase-locked loop circuit; In this step, the phase difference signal refers to the UP / DOWN pulse signal output by the phase detector in step S10301, which can characterize the direction and magnitude of the phase difference; the control current refers to the pulsed current generated by the charge pump and used to charge and discharge the subsequent loop filter.

[0057] Specifically, this step follows phase detection and converts the UP / DOWN pulse signal output by the phase detector into an analog current signal. The charge pump contains two controlled current sources: one for charging (source current) and the other for discharging (absorb current). When the charge pump receives an UP pulse signal from the phase detector, its charging current source is activated, providing a positive control current to the output. Conversely, when it receives a DOWN pulse signal, its discharging current source is activated, absorbing current from the output to form a reverse control current. The amplitude and duration of this control current are determined by the width of the UP or DOWN pulse, thus linearly converting the phase error information into charge, i.e., the control current.

[0058] Step S10303: The control current is converted into a stable control voltage through the loop filter in the phase-locked loop circuit; Among them, the loop filter (LF) usually refers to a low-pass filter composed of resistors (R) and capacitors (C), which plays the role of integration and smoothing in the phase-locked loop; the control current refers to the pulsed current output by the charge pump in step S10302; the stable control voltage refers to the DC or slowly changing voltage that has been smoothed by the loop filter, removing high-frequency pulsation components and being able to stably drive the voltage-controlled oscillator.

[0059] Specifically, this step is performed after the charge pump and before the voltage-controlled oscillator (VCO), and its core function is to convert discrete current pulses into a continuous voltage signal. The control current output by the charge pump is injected into the loop filter. When the control current is forward (charging), the capacitor in the loop filter is charged, and its voltage rises; when the control current is reverse (discharging), the capacitor is discharged, and the voltage drops. Due to the energy storage effect of the capacitor, this charging and discharging process integrates and smooths a series of rapid current pulses into a continuously varying voltage. This voltage is the stable control voltage, and its value accurately reflects the cumulative effect of phase error over a period of time, thus providing a jitter-free control basis for subsequent frequency adjustment.

[0060] Step S10304: The voltage-controlled oscillator adjusts the output frequency according to the stable control voltage to make the feedback signal phase-locked with the filtered signal, and outputs the phase-compensated signal. Among them, a voltage-controlled oscillator (VCO) is an oscillation circuit whose output signal frequency is proportional to the input control voltage; the output frequency is the oscillation frequency of the signal generated by the VCO; phase locking means that the phase-locked loop has reached a stable state, at which time the frequency of its output signal is strictly equal to the frequency of the input reference signal, and the phase difference between the two is constant at zero or a preset value; the phase-compensated signal is the final output signal generated by the VCO whose systematic phase offset has been canceled.

[0061] Specifically, this step is where the phase-locked loop (VCO) executes control and generates the final output. The voltage-controlled oscillator (VCO) receives the stabilizing control voltage from the loop filter. When this voltage increases, the VCO's output frequency increases accordingly; when the voltage decreases, the output frequency decreases. The VCO output signal has two paths: one is sent back to the phase detector as a feedback signal, and the other is output as the phase-compensated signal. Adjusting the frequency changes the phase of the feedback signal, thus affecting the phase comparison result in the next round. Through this negative feedback mechanism, the loop continuously adjusts the control voltage until the VCO's output frequency and phase are completely synchronized with the input filtered signal, achieving the phase-locked state. At this point, the VCO output is a signal with a stable frequency and corrected phase.

[0062] Optionally, steps S10305-S10308 are another more specific step of step S103; Step S10305: Perform Hilbert transform on the filtered signal to perform phase detection; Here, the filtered signal refers to the analog signal output from the preceding steps, which is still in a continuously changing form; acquisition refers to the process of converting the filtered signal into a discrete digital data sequence by an analog-to-digital converter (ADC); Hilbert transform refers to a specific mathematical linear operator that, when applied to a real signal, can generate another real signal, the spectral components of which have a phase shift of -90 degrees relative to the original signal; phase detection refers to the process of determining the phase information of a signal using mathematical methods, and in this step, Hilbert transform is the basic tool for realizing phase detection.

[0063] Specifically, this step, serving as the entry point for the digital phase compensation process, is executed after analog signal processing is complete. First, the filtered signal is input to a high-speed analog-to-digital converter for acquisition, obtaining a digitized data array, denoted as x(n), that fully represents its waveform information. Subsequently, the Hilbert transform algorithm is applied to this array x(n), which is typically implemented using a finite-length unit impulse response (FIR) filter with specific antisymmetric coefficients. The output of this transform is another array of the same length as x(n), denoted as y(n). These two arrays, x(n) and y(n), together constitute the analytic signal, providing complete information for subsequent calculations of the instantaneous phase.

[0064] Step S10306: Based on the result of the phase detection, calculate the instantaneous phase of the filtered signal; The phase detection result refers to the analytical signal generated in step S10305, which is composed of the original digitized signal x(n) and its Hilbert transform y(n); the filtered signal in this step specifically refers to its digitized representation x(n); the instantaneous phase refers to the phase angle of the analytical signal at each discrete sampling time n, which is a quantity that changes with time and can characterize the oscillation state of the signal at any time.

[0065] Specifically, this step follows the Hilbert transform and aims to extract point-by-point phase information from the analytic signal. The microcontroller unit uses the original digitized signal x(n) as the real part of the analytic signal and its Hilbert transform y(n) as the imaginary part. For each sampling point index n in the data sequence, the system calculates the instantaneous phase at that point by performing the four-quadrant arctangent function operation φ(n) = atan2(y(n), x(n)). The result of the operation is a new array φ(n), with the same length as the original data. Each element in the array represents the instantaneous phase angle at the corresponding sampling time, usually in radians. For example, if at a certain time n, x(n) = 0.5 and y(n) = -0.866, the calculated instantaneous phase φ(n) is approximately -60 degrees.

[0066] Step S10307: Calculate the average phase error value based on the instantaneous phase; The instantaneous phase refers to a series of phase angle data that change with time, calculated by step S10306; the average phase error value refers to a single scalar value that can represent the systematic phase shift caused by slowly changing factors such as temperature drift contained in the entire signal packet.

[0067] Specifically, this step is performed after obtaining the instantaneous phase sequence. Its purpose is to separate the average phase error value from the mixed phase information, which includes linear growth of the carrier frequency and systematic shifts. Due to the periodicity of the arctangent function, the directly calculated instantaneous phase sequence will contain ±π jumps. Therefore, a "phase unwrapping" algorithm is first performed to eliminate these jumps and form a continuous phase change curve. Subsequently, a linear regression method can be used to fit this continuous phase curve, and the intercept of the fitted line corresponds to the average phase error value. For example, the radians obtained by performing a least-squares linear fit on the instantaneous phase points within an ultrasonic envelope are determined as the average phase error value of this measurement.

[0068] Step S10308: The average phase error value is used as a correction parameter, and the filtered signal is processed by a fractional delay filter to achieve phase correction corresponding to the average phase error value, thereby obtaining the phase-compensated signal. Wherein, the average phase error value refers to the value representing the systematic phase shift calculated in step S10307; the correction parameter refers to the input value used to configure the digital processing module to perform a specific operation; the fractional delay filter (FDF) refers to a special digital filter that can achieve a time delay of a non-integer multiple of the sampling period; the filtered signal in this step specifically refers to the original digitized data acquired in step S10305 without any phase correction; the phase-compensated signal refers to the new digitized data sequence whose systematic phase shift has been canceled after phase correction processing.

[0069] Specifically, this step is the final execution stage of digital phase compensation. First, the average phase error value (e.g., +0.021 radians) is inversely represented (-0.021 radians) and used as the correction parameter. Then, this correction parameter is used to configure the fractional delay filter. The fractional delay filter achieves precise time shift of the input signal through specific filter coefficients (e.g., FIR coefficients designed using the window function method), and this time shift is equivalent to a linear phase shift in the frequency domain. Finally, the digitized data stream of the original filtered signal is input into this configured fractional delay filter for filtering operations (e.g., convolution). The filter output is a new data sequence whose phase has been precisely shifted by -0.021 radians, i.e., the phase-compensated signal.

[0070] Optionally, steps S10401-S10403 are more specific steps than step S104. Step S10401: Set an upper limit threshold and a lower limit threshold for intensity through the second control command. The upper limit threshold and the lower limit threshold for intensity are obtained by the machine learning model based on the first ultrasonic signal and the current environmental data. The upper and lower threshold values ​​of intensity refer to two voltage or digital quantities that together define a range of desired signal amplitude, also known as the "target window".

[0071] Specifically, this step is performed at the start of a new measurement cycle, before the signal from the current measurement is amplified. The system first integrates a set of input features for model inference, which includes the first ultrasonic signal combined with the current environmental data (such as temperature and pressure). This set of features is then input to the machine learning model. Based on patterns learned from historical data, the model predicts the optimal signal strength target window for the current operating conditions. For example, when the model determines that the current medium acoustic attenuation is severe based on the input features, it may predict and set a threshold window that is generally low but still ensures signal quality (e.g., 0.4V to 1.5V), and use this threshold as the second control command to update the comparison benchmark of the automatic gain control loop.

[0072] Step S10402: When the signal strength of the phase-compensated signal is greater than the upper limit threshold, reduce the signal gain value so that the signal strength of the phase-compensated signal is less than or equal to the upper limit threshold. Specifically, this step is part of the automatic gain control (AGC) loop during real-time operation to prevent signal overload. A hardware comparator or a fast comparison program within the microcontroller continuously compares the real-time measured signal strength of the phase-compensated signal with a strength upper limit threshold. Once the signal strength is detected to exceed this upper limit threshold, the comparison result immediately triggers a control action. For example, if the currently set upper limit threshold corresponds to 2.5V, and a peak detection circuit measures a signal peak of 2.6V, this event will prompt the system to send a command to the programmable gain amplifier to reduce its gain setting from the current 60dB to the next available level, such as 54dB. This aims to bring the signal amplitude back within the allowable range.

[0073] Step S10403: When the signal strength of the phase-compensated signal is less than the lower limit threshold, increase the signal gain value so that the signal strength of the phase-compensated signal is greater than or equal to the lower limit threshold. Specifically, during the continuous comparison of signal strength, the hardware comparator or software comparison program will immediately trigger a reverse control action once it detects that the signal strength is below the lower strength threshold. For example, if the currently set lower strength threshold corresponds to 0.5V, and the peak detection circuit measures a signal peak of only 0.4V, this event will prompt the microcontroller unit to send a command to the programmable gain amplifier to increase its gain setting from the current 40dB to the next available level, such as 46dB. This aims to sufficiently amplify the weak signal to ensure that its amplitude is much higher than the quantization noise floor of the subsequent analog-to-digital converter, thereby ensuring the integrity of signal details and the accuracy of measurement.

[0074] The ultrasonic flow sensor signal processing device in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 3 This is a schematic diagram of the physical device structure of an ultrasonic flow sensor signal processing device in the embodiments of this application.

[0075] It should be noted that, Figure 3 The structure of the ultrasonic flow sensor signal processing device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0076] like Figure 3 As shown, the ultrasonic flow sensor signal processing device includes a CPU 301, which can perform various appropriate actions and processes according to a program stored in the read-only memory ROM 302 or a program loaded from the storage section 308 into the random access memory RAM 303, such as performing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An I / O interface 305 is also connected to the bus 304.

[0077] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0078] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by CPU 301, it performs the various functions defined in the present invention.

[0079] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0080] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0081] Specifically, the ultrasonic flow sensor signal processing device of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the ultrasonic flow sensor signal processing method provided in the above embodiment.

[0082] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the ultrasonic flow sensor signal processing device described in the above embodiments; or it may exist independently and not assembled into the ultrasonic flow sensor signal processing device. The storage medium carries one or more computer programs that, when executed by a processor of the ultrasonic flow sensor signal processing device, cause the ultrasonic flow sensor signal processing device to implement the ultrasonic flow sensor signal processing method provided in the above embodiments.

[0083] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. An ultrasonic flow sensor signal processing method, characterized by, The method comprises the following steps: inputting the first ultrasonic signal of the previous measurement and the current environment data into a machine learning model to obtain a set of control instructions, the set of control instructions comprising: a first control instruction for adjusting a signal filtering parameter and a second control instruction for adjusting a signal gain parameter, the machine learning model being trained according to historical ultrasonic data and historical environment data; adjusting the filtering parameter according to the first control instruction, performing band-pass filtering on the second ultrasonic signal of the current measurement, and outputting a filtered signal; performing phase compensation on the filtered signal and outputting a phase-compensated signal; adjusting the signal gain parameter according to the second control instruction, performing gain amplification on the phase-compensated signal, and outputting a target signal; calculating a time-of-flight difference according to the target signal, and calculating an instantaneous flow rate according to the time-of-flight difference.

2. The method of claim 1, wherein, The step of inputting the first ultrasonic signal of the previous measurement and the current environment data into a machine learning model comprises the following steps: calculating a current sound speed according to the first ultrasonic signal; adjusting the sampling start time and the duration of signal sampling according to the current sound speed, and collecting the second ultrasonic signal based on the sampling start time and the duration.

3. The method of claim 1, wherein, The step of adjusting the filtering parameter according to the first control instruction, performing band-pass filtering on the second ultrasonic signal of the current measurement, and outputting a filtered signal specifically comprises the following steps: inputting the second ultrasonic signal into a multi-stage operational amplifier for signal amplification to obtain an amplified signal; inputting the amplified signal into a filter circuit composed of a programmable resistance array and a capacitance switching network, controlling the analog switch to change the circuit structure of the filter circuit according to the first control instruction, filtering the amplified signal to obtain the filtered signal.

4. The method of claim 1, wherein, The step of adjusting the filtering parameter according to the first control instruction, performing band-pass filtering on the second ultrasonic signal of the current measurement, and outputting a filtered signal specifically further comprises the following steps: performing ADC sampling on the second ultrasonic signal to obtain a sampled signal; adjusting the filtering coefficient of a digital filter device composed of a digital signal processor or a configurable logic module according to the first control instruction; inputting the sampled signal into the digital filter device with the updated filtering coefficient, performing digital filtering on the sampled signal to obtain the filtered signal.

5. The method of claim 1, wherein, The step of performing phase compensation on the filtered signal and outputting a phase-compensated signal specifically comprises the following steps: inputting the filtered signal into a phase-locked loop circuit, comparing the phase difference between the filtered signal and the feedback signal output by a voltage-controlled oscillator in the phase-locked loop circuit through a phase detector in the phase-locked loop circuit; converting the phase difference signal into a control current through a charge pump in the phase-locked loop circuit; converting the control current into a stable control voltage through a loop filter in the phase-locked loop circuit; adjusting the output frequency of the voltage-controlled oscillator according to the stable control voltage, so that the feedback signal and the filtered signal are phase-locked, and the phase-compensated signal is output.

6. The method of claim 1, wherein, The step of performing phase compensation on the filtered signal and outputting a phase-compensated signal specifically further comprises the following steps: performing Hilbert transform on the filtered signal to perform phase detection; calculating an instantaneous phase of the filtered signal based on a result of the phase detection; calculating an average phase error value according to the instantaneous phase; processing the filtered signal through a fractional delay filter with the average phase error value as a correction parameter to achieve phase correction corresponding to the average phase error value to obtain the phase-compensated signal.

7. The method of claim 1, wherein, The step of adjusting a signal gain parameter according to the second control instruction, gain amplifying the phase-compensated signal, and outputting a target signal specifically includes: setting an intensity upper threshold and an intensity lower threshold by the second control instruction, the intensity upper threshold and the intensity lower threshold being obtained by the machine learning model according to the first ultrasonic signal and the current environment data; when the signal intensity of the phase-compensated signal is greater than the intensity upper threshold, reducing the signal gain value so that the signal intensity of the phase-compensated signal is less than or equal to the intensity upper threshold; when the signal intensity of the phase-compensated signal is less than the intensity lower threshold, increasing the signal gain value so that the signal intensity of the phase-compensated signal is greater than or equal to the intensity lower threshold.

8. An ultrasonic flow sensor signal processing device, characterized by The ultrasonic flow sensor signal processing device includes one or more processors and a memory; the memory is coupled with the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors invoke the computer instructions to enable the ultrasonic flow sensor signal processing device to perform the method of any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions run on the ultrasonic flow sensor signal processing device, the ultrasonic flow sensor signal processing device performs the method of any one of claims 1-7.

10. A computer program product, characterised in that, When the computer program product runs on the ultrasonic flow sensor signal processing device, the ultrasonic flow sensor signal processing device performs the method of any one of claims 1-7.