Head wave threshold value adjusting method, control unit and flow meter
By dynamically adjusting the first wave threshold and parameter set of the ultrasonic flowmeter, the problem of inaccurate first wave identification of the ultrasonic flowmeter under interference factors is solved, and the robustness and stability of the measurement system are improved.
Patent Information
- Application Number
- CN202510704619.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-05
AI Technical Summary
In practical applications, ultrasonic flowmeters suffer from signal amplitude variations due to interference factors such as bubbles, solid particles, and temperature changes in the fluid, leading to inaccurate first-wave identification and affecting the robustness of the measurement system.
By dynamically adjusting the first wave threshold and parameter set of the ultrasonic flowmeter, the first wave threshold and parameter set are updated according to the steady-state and non-steady-state signal changes of the current round to adapt to the working environment and signal changes.
The robustness of the ultrasonic flowmeter measurement system is improved, enabling it to continuously work at an accurate first wave threshold, ensuring the stability and accuracy of the flowmeter.
Smart Images

Figure CN120593846A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to ultrasonic flowmeter signal processing technology, and in particular to a first wave threshold adjustment method, a control unit, and a flowmeter. Background Art
[0002] Ultrasonic flowmeters are increasingly used in the field of industrial detection due to their advantages such as low pressure loss, wide range and bidirectional measurement. At present, ultrasonic flowmeters usually use the time difference method to calculate the flow rate. Specifically, based on the time difference between the ultrasonic signal propagating from the fluid inlet end to the fluid outlet end (i.e., downstream) and from the fluid outlet end to the fluid inlet end (i.e., upstream) in the measured fluid, the flow velocity of the fluid can be calculated, and then the flow rate can be calculated based on the flow velocity of the fluid and the cross-sectional area of the pipe in which the fluid is located. In the time difference method, the zero-crossing comparison method is usually used to determine the first wave. If the amplitude of the detected signal is greater than a certain threshold, it is considered that the first wave appears, and then the time information of the ultrasonic signal arriving at the ultrasonic transducer is determined.
[0003] In practical applications, ultrasonic signals propagating within pipelines may encounter various interference factors, such as bubbles, solid particles, and temperature fluctuations. These interference factors can cause the amplitude of the ultrasonic signal to vary. However, the zero-crossing comparison method typically uses a fixed threshold to determine the first wave, which cannot adapt to the variability of ultrasonic signals in practical applications. This leads to inaccurate first wave identification and the inability to accurately determine the time when the ultrasonic signal arrives at the ultrasonic transducer, resulting in poor robustness of the ultrasonic flowmeter measurement system. Summary of the Invention
[0004] The present application provides a first-wave threshold adjustment method, a control unit, and a flowmeter, for improving the robustness of an ultrasonic flowmeter measurement system.
[0005] In a first aspect, the present application provides a first-wave threshold adjustment method, comprising:
[0006] In the current round of sampling, the signal of the ultrasonic flowmeter is sampled according to the first wave threshold in the parameter set to obtain multiple sampling signals of the current round; wherein the multiple sampling signals include steady-state signals and non-steady-state signals;
[0007] If the threshold update condition is met, the first wave threshold is updated according to the steady-state signal of the current round and the relative coefficient in the parameter set; wherein the relative coefficient is used to represent the relative relationship between the first wave threshold and the steady-state signal;
[0008] If the parameter update condition is met, updating the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round;
[0009] Among them, the threshold update condition and the parameter update condition are both formulated based on the degree of change of the multiple sampling signals of the current round compared with the sampling signals of the historical rounds, and the degree of change corresponding to the threshold update condition is smaller than the degree of change corresponding to the parameter update condition.
[0010] In a second aspect, the present application provides an ultrasonic flow meter control unit, comprising: a memory, a processor, and a transceiver;
[0011] The memory stores computer-executable instructions;
[0012] The processor executes the computer-executable instructions stored in the memory to implement the method according to the first aspect.
[0013] In a third aspect, the present application provides an ultrasonic flow meter, comprising: an ultrasonic flow meter control unit, a first ultrasonic sensor, and a second ultrasonic sensor;
[0014] The ultrasonic flowmeter control unit is used to implement the method according to the first aspect;
[0015] The first ultrasonic sensor is used to transmit or receive ultrasonic signals, and the second ultrasonic sensor is used to receive or transmit ultrasonic signals.
[0016] The present application provides a first wave threshold adjustment method, a control unit and a flowmeter, which samples the signal of the ultrasonic flowmeter according to the first wave threshold in the parameter set to obtain multiple sampling signals of the current round (including steady-state signals and non-steady-state signals). If the threshold update condition is met, it means that the multiple sampling signals of the current round have changed compared with the sampling signals of the historical round, and the degree of change is small, indicating that the current first wave threshold is no longer accurate, then the first wave threshold is updated according to the steady-state signal of the current round and the relative coefficient used to represent the relative relationship between the first wave threshold and the steady-state signal in the parameter set to ensure that the ultrasonic flowmeter can work under the accurate first wave threshold. If the parameter update condition is met, it means that the multiple sampling signals of the current round have changed compared with the sampling signals of the historical round, and the degree of change is large, indicating that the values of each parameter in the parameter set can no longer adapt to the current working environment or sampling environment, and the parameter set needs to be updated, then the parameter set (including the first wave threshold) is updated according to the steady-state signal and non-steady-state signal of the current round. This method dynamically updates the first-wave threshold of ultrasonic flow according to the signal changes of ultrasonic flow, so that the ultrasonic flowmeter can adapt to the changes in the working environment and signals and continue to operate at an accurate first-wave threshold, thereby improving the robustness of the ultrasonic flowmeter measurement system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] Figure 1 A flowchart of a first-wave threshold adjustment method provided in an embodiment of the present application;
[0019] Figure 2 A flow chart of a parameter determination strategy provided in an embodiment of the present application;
[0020] Figure 3 A flowchart of a threshold updating method provided in an embodiment of the present application;
[0021] Figure 4 A flowchart of another threshold updating method provided in an embodiment of the present application;
[0022] Figure 5 A flow chart of a channel switching sampling method provided in an embodiment of the present application;
[0023] Figure 6 A flowchart of another first-wave threshold adjustment method provided in an embodiment of the present application;
[0024] Figure 7 A schematic structural diagram of a first-wave threshold adjustment device provided in an embodiment of the present application;
[0025] Figure 8 A schematic structural diagram of an ultrasonic flow meter control unit provided in an embodiment of the present application.
[0026] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and corresponding operation entrances must be provided for users to choose to authorize or refuse.
[0029] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0030] Ultrasonic flowmeters are increasingly used in the field of industrial detection due to their advantages such as low pressure loss, wide range and bidirectional measurement. At present, ultrasonic flowmeters usually use the time difference method to calculate the flow rate. Specifically, based on the time difference between the ultrasonic signal propagating from the fluid inlet end to the fluid outlet end (i.e., downstream) and from the fluid outlet end to the fluid inlet end (i.e., upstream) in the measured fluid, the flow velocity of the fluid can be calculated, and then the flow rate can be calculated based on the flow velocity of the fluid and the cross-sectional area of the pipe in which the fluid is located. In the time difference method, the zero-crossing comparison method is usually used to determine the first wave. If the amplitude of the detected signal is greater than a certain threshold, it is considered that the first wave appears, and then the time information of the ultrasonic signal arriving at the ultrasonic transducer is determined.
[0031] Specifically, an ultrasonic signal is emitted from an ultrasonic transmitter and propagates through a pipe to an ultrasonic receiver. During this propagation process, the waveform of the ultrasonic signal may be deformed or delayed due to factors such as fluid flow. The zero-crossing comparison method sets a fixed threshold. When the waveform crosses the threshold, the point in the waveform corresponding to the threshold is marked as the zero-crossing point. The first wave refers to the first waveform after the zero-crossing point and represents the first valid signal received by the ultrasonic receiver. Based on the time information of the first wave, the time difference method can be used to calculate the fluid's flow rate and flow rate.
[0032] In practical applications, ultrasonic signals propagating within pipelines may encounter various interference factors, such as bubbles, solid particles, and temperature fluctuations. These interference factors can cause the amplitude of the ultrasonic signal to vary. However, the zero-crossing comparison method typically uses a fixed threshold to determine the first wave, which cannot adapt to the variability of ultrasonic signals in practical applications. This leads to inaccurate first wave identification and the inability to accurately determine the time when the ultrasonic signal arrives at the ultrasonic transducer, resulting in poor robustness of the ultrasonic flowmeter measurement system.
[0033] In order to solve the above technical problems, an embodiment of the present application proposes a first wave threshold adjustment method, which samples the signal of the ultrasonic flowmeter according to the first wave threshold in the parameter set to obtain multiple sampling signals of the current round (including steady-state signals and non-steady-state signals). If the threshold update condition is met, it means that the multiple sampling signals of the current round have changed compared with the sampling signals of the historical round, and the degree of change is small, indicating that the current first wave threshold is no longer accurate, then the first wave threshold is updated according to the steady-state signal of the current round and the relative coefficient used to represent the relative relationship between the first wave threshold and the steady-state signal in the parameter set, to ensure that the ultrasonic flowmeter can work under the accurate first wave threshold. If the parameter update condition is met, it means that the multiple sampling signals of the current round have changed compared with the sampling signals of the historical round, and the degree of change is large, indicating that the values of each parameter in the parameter set can no longer adapt to the current working environment or sampling environment, and the parameter set needs to be updated, then the parameter set (including the first wave threshold) is updated according to the steady-state signal and non-steady-state signal of the current round. This method dynamically updates the first-wave threshold of ultrasonic flow according to the signal changes of ultrasonic flow, so that the ultrasonic flowmeter can adapt to the changes in the working environment and signals and continue to operate at an accurate first-wave threshold, thereby improving the robustness of the ultrasonic flowmeter measurement system.
[0034] In this embodiment, the ultrasonic flowmeter may include multiple sound channels. Within each sound channel, ultrasonic sensors are installed at two different locations within the channel. Each ultrasonic sensor can function as both a receiver and a transmitter. Within each sound channel, when one ultrasonic sensor transmits signals as a transmitter, another ultrasonic sensor receives signals as a receiver. Different ultrasonic sensors receive signals as receivers with different corresponding first-wave thresholds.
[0035] In the practical application of ultrasonic flowmeters, each ultrasonic sensor in the ultrasonic flowmeter is usually sampled in real time, either in parallel or serially, at a certain sampling frequency. Based on the time information of the sampled signals and the time difference method, the flow velocity and flow rate of the fluid are calculated in real time to monitor the flow rate. A sampling cycle is a sampling round, which includes sampling each ultrasonic sensor once.
[0036] This embodiment aims to adjust the first wave threshold or the parameter set including the first wave threshold of each ultrasonic sensor in the ultrasonic flowmeter according to multiple sampling signals of each ultrasonic sensor in the current round, so that each ultrasonic sensor in the ultrasonic flowmeter can operate at an accurate first wave threshold, thereby improving the stability and robustness of the ultrasonic flowmeter measurement system.
[0037] The adjustment process for the first-wave threshold of each ultrasonic sensor in an ultrasonic flowmeter is independent. Therefore, this embodiment only describes the adjustment principle for the first-wave threshold of a single ultrasonic sensor based on its sampling signal. The adjustment principle for the first-wave thresholds of other ultrasonic sensors is similar to the adjustment process for this single ultrasonic sensor and is not further described in this embodiment.
[0038] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0039] Figure 1 This is a flow chart of a method for adjusting the first wave threshold provided in an embodiment of the present application. The execution subject of this method can be an electronic device for implementing the method, which is implemented through software and hardware, and can specifically be a server deployed locally or in the cloud. The specific steps of this method are as follows:
[0040] S101. In a current round of sampling, the signal of the ultrasonic flowmeter is sampled according to the first wave threshold in the parameter set to obtain multiple sampling signals of the current round; wherein the multiple sampling signals include steady-state signals and non-steady-state signals.
[0041] The current round of sampling refers to the process of sampling the ultrasonic flowmeter signal at the most recent time during the actual application of the ultrasonic flowmeter. The current round of multiple sampling signals refers to the multiple sampling signals obtained by sampling any ultrasonic sensor at the most recent time.
[0042] In this step, when any ultrasonic sensor receives a signal, when the amplitude of the received signal is greater than or equal to the first wave threshold, sampling of the received signal is started to obtain multiple sampling signals of the current round.
[0043] Furthermore, the sampling signal is distinguished as a steady-state signal or an unstable signal, which is used to represent a signal in a stable state or an unstable state respectively. Specifically, the following methods can be used to achieve this:
[0044] For any of the multiple sampling signals, if the sampling signal satisfies a steady-state condition, the sampling signal is considered a steady-state signal. If the sampling signal does not satisfy the steady-state condition, the sampling signal is considered a non-steady-state signal. The steady-state condition can be set according to actual application needs and is not limited in this embodiment.
[0045] For example, a steady-state condition may be: the amplitude of the signal is greater than or equal to a minimum value and less than or equal to a maximum value, wherein the minimum value and the maximum value can be set according to the needs of the actual application and are not limited in this embodiment. Specifically, for any sampling signal among the multiple sampling signals, if the amplitude of the signal is greater than or equal to the minimum value and less than or equal to the maximum value, it indicates that the amplitude of the sampling signal is within the steady-state allowable range, and the sampling signal is then treated as a steady-state signal. If the amplitude of the signal is less than the minimum value or greater than the maximum value, it indicates that the amplitude of the sampling signal is not within the steady-state allowable range, and the sampling signal is then treated as a non-steady-state signal.
[0046] For example, the steady-state condition may also be: the amplitude change rate of the signal is less than or equal to a preset value, wherein the preset value can be set according to the needs of the actual application and is not limited in this embodiment. Specifically, multiple sampling signals are sorted from front to back according to the sampling time, and for any sampling signal among the multiple sampling signals, the ratio between the amplitude of the sampling signal and the amplitude of the previous sampling signal (i.e., the threshold change rate) is calculated. If the ratio is less than or equal to the preset value, it indicates that the change of the sampling signal is small, and the sampling signal is regarded as a steady-state signal. If the ratio is greater than the preset value, it indicates that the change of the sampling signal is large, and the sampling signal is regarded as a non-steady-state signal.
[0047] In this embodiment, the received signal is sampled according to the first wave threshold, and sampling is performed only after the first wave appears, to ensure that the sampled signal is a valid signal, to avoid being affected by noise, interference or invalid signals during the sampling process, and to provide a more reliable analysis basis for the subsequent analysis process, so that it can more accurately determine whether the first wave threshold or parameter set needs to be updated.
[0048] It should be noted that different ultrasonic sensors in an ultrasonic flowmeter correspond to different parameter sets. Specifically, different parameter sets store the first-wave thresholds and relative coefficients corresponding to different ultrasonic sensors. Subsequent steps to update the first-wave thresholds or parameter sets are performed for a single ultrasonic sensor in the ultrasonic flowmeter. In this embodiment, the first-wave thresholds or parameter sets corresponding to multiple ultrasonic sensors in the ultrasonic flowmeter can be dynamically adjusted serially or in parallel.
[0049] S102. If the threshold update condition is met, the first-wave threshold is updated according to the steady-state signal of the current round and the relative coefficient in the parameter set; wherein the relative coefficient is used to represent the relative relationship between the first-wave threshold and the steady-state signal, and the threshold update condition is formulated according to the degree of change of the multiple sampling signals of the current round compared with the sampling signals of the historical rounds.
[0050] Among them, the relative coefficient can be the ratio of the first wave threshold to the average amplitude of the steady-state signal, or it can be a function by taking the amplitude of the steady-state signal as the independent variable and the first wave threshold as the dependent variable, or it can be other forms that can express the relative coefficient calculated by the amplitude of the steady-state signal and the relative coefficient. This embodiment does not limit this.
[0051] In this step, if the threshold update condition is met, it indicates that the multiple sampling signals of the current round have changed compared to the sampling signals of the previous round, and the degree of change is small, indicating that the first wave threshold needs to be updated to ensure that the ultrasonic flowmeter operates at the accurate first wave threshold. In this case, the first wave threshold is updated. The threshold update condition can be set according to the needs of the actual application and is not limited in this embodiment.
[0052] In this step, when the first-wave threshold needs to be updated, the first-wave threshold can be updated based on the amplitude of the steady-state signal in the current round and the relative coefficient in the parameter set. Alternatively, the first-wave threshold can be updated based on the amplitude of the steady-state signal in the current round, the amplitudes of the steady-state signals in multiple rounds before the current round, and the relative coefficient in the parameter set. Alternatively, the first-wave threshold can be updated based on the amplitude of the steady-state signal in the current round, the amplitudes of the steady-state signals in multiple rounds after the current round, and the relative coefficient in the parameter set.
[0053] Optionally, the product of the amplitude average or weighted average of the steady-state signal of the current round, and / or the steady-state signals of multiple rounds before the current round, and / or the steady-state signals of multiple rounds after the current round, and the relative coefficient can be used as the updated first-wave threshold.
[0054] S103. If the parameter update condition is met, the parameter set is updated according to the steady-state signal of the current round and the non-steady-state signal of the current round; wherein the parameter update condition is formulated according to the degree of change of the multiple sampling signals of the current round compared with the sampling signals of the historical rounds, and the degree of change corresponding to the threshold update condition is less than the degree of change corresponding to the parameter update condition.
[0055] The sampling signal of the historical round refers to the sampling signal used for the last adjustment of the first wave threshold or parameter set.
[0056] The degree of change can be measured using any method that can measure the degree of signal change, and this embodiment does not limit this. For example, the degree of change can be measured using the number of steady-state signals. If the number of steady-state signals in the current round is equal to the average number of steady-state signals in each round in the past, the degree of change is considered to be small. If the number of steady-state signals in the current round is not equal to the average number of steady-state signals in each round in the past, the degree of change is considered to be large.
[0057] For example, the degree of change can also be measured by the average amplitude value of the sampling signal. The greater the difference between the average amplitude value of the sampling signal in the current round and the average amplitude value of the sampling signal in the historical round, the greater the degree of change; the smaller the difference between the average amplitude value of the sampling signal in the current round and the average amplitude value of the sampling signal in the historical round, the smaller the degree of change.
[0058] In this step, if the parameter update condition is met, it means that the multiple sampling signals of the current round have changed compared with the sampling signals of the historical round, and the degree of change is large, which further indicates that the relative coefficient used in the parameter set to represent the relative relationship between the first wave threshold and the steady-state signal is likely no longer accurate. Then, the first wave threshold obtained by updating the relative coefficient may also no longer be accurate. In this case, the entire parameter set including the first wave threshold and the relative coefficient can be updated to ensure that the first wave threshold can be accurately updated in subsequent sampling rounds, so that the ultrasonic flowmeter operates under the accurate first wave threshold. Among them, the parameter update condition can be set according to the needs of the actual application, and this embodiment does not limit this.
[0059] In this step, when the parameter set needs to be updated, the parameter set can be updated based on the steady-state signal and the non-steady-state signal of the current round. The parameter set can also be updated based on the steady-state signal and the non-steady-state signal of the current round, the steady-state signal and the non-steady-state signal of multiple rounds before the current round, or the steady-state signal and the non-steady-state signal of multiple rounds after the current round.
[0060] Specifically, the steady-state amplitude can be calculated based on the amplitude of the sampling signal of the current round (i.e., the steady-state signal and the non-steady-state signal), and the steady-state condition can be determined; the signal received by the ultrasonic sensor is resampled to obtain at least one round of sampling signals; based on the steady-state condition, the non-steady-state signal in the sampling signal of at least one round is determined; the updated first-wave threshold is calculated using the amplitude of the non-steady-state signal in the sampling signal of at least one round; and the ratio of the updated first-wave threshold to the steady-state amplitude is used as the updated relative coefficient.
[0061] Optionally, the steady-state amplitude can be calculated and the steady-state condition can be determined based on the amplitude of the sampling signal of the current round and the sampling signals of multiple rounds before the current round; the signal received by the ultrasonic sensor is resampled, and the first wave threshold and relative coefficient are updated.
[0062] Optionally, the steady-state amplitude can be calculated and the steady-state condition can be determined based on the amplitude of the sampling signal of the current round and the sampling signals of multiple rounds before the current round; the sampling signal of the current round and the sampling signals of multiple rounds before the current round are used as the resampled sampling signals, and then the first wave threshold and relative coefficient are updated.
[0063] It should be noted that updating the parameter set is the process of reinitializing the parameter set. When the parameter update conditions are met, it indicates that the parameter values in the current parameter set are not suitable for the current ultrasonic sensor operating or sampling environment, and the parameter set needs to be updated, that is, reinitialized. Updating or reinitializing the parameter set is done to obtain a more accurate first-wave threshold.
[0064] It should be noted that for any ultrasonic sensor in the ultrasonic flowmeter, the above-mentioned S101-S103 methods can be used to update the first wave threshold, so that any ultrasonic sensor can operate under its own accurate first wave threshold, thereby enabling the ultrasonic flowmeter to operate under the accurate first wave threshold.
[0065] In an embodiment of the present application, the signal of the ultrasonic flowmeter is sampled according to the first wave threshold in the parameter set to obtain multiple sampling signals of the current round (including steady-state signals and non-steady-state signals). If the threshold update condition is met, it means that the multiple sampling signals of the current round have changed compared with the sampling signals of the historical round, and the degree of change is small, indicating that the current first wave threshold is no longer accurate, then the first wave threshold is updated according to the steady-state signal of the current round and the relative coefficient used to represent the relative relationship between the first wave threshold and the steady-state signal in the parameter set to ensure that the ultrasonic flowmeter can operate under the accurate first wave threshold. If the parameter update condition is met, it means that the multiple sampling signals of the current round have changed compared with the sampling signals of the historical round, and the degree of change is large, indicating that the values of each parameter in the parameter set can no longer adapt to the current working environment or sampling environment, and the parameter set needs to be updated, then the parameter set (including the first wave threshold) is updated according to the steady-state signal and non-steady-state signal of the current round. This method dynamically updates the first-wave threshold of ultrasonic flow according to the signal changes of ultrasonic flow, so that the ultrasonic flowmeter can adapt to the changes in the working environment and signals and continue to operate at an accurate first-wave threshold, thereby improving the robustness of the ultrasonic flowmeter measurement system.
[0066] In an optional implementation, the parameter set further includes the number of reference steady-state signals. In the aforementioned S103, if the parameter update condition is met, the parameter set is updated based on the steady-state signal of the current round and the non-steady-state signal of the current round. This can be specifically implemented as follows:
[0067] Determine the number of real-time steady-state signals corresponding to the current round. If the number of real-time steady-state signals corresponding to the current round is not equal to the number of reference steady-state signals, increase the third state count and use the second increased sampling frequency as the sampling frequency for sampling the signal of the ultrasonic flowmeter. When the third state count reaches the third state count threshold, update the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round.
[0068] The third state count is used to record the number of rounds in which the number of real-time steady-state signals is not equal to the number of reference steady-state signals.
[0069] Specifically, for any round, if the number of real-time steady-state signals corresponding to the round is not equal to the number of reference steady-state signals, the third state count is increased. If the number of real-time steady-state signals corresponding to the current round is equal to the number of reference steady-state signals, the third state count is cleared.
[0070] It should be noted that the increase in the third state count is cumulative, and the step size of each accumulation is consistent, for example, 1 is accumulated each time.
[0071] If the third state count reaches the third state threshold, it means that the number of real-time steady-state signals corresponding to each round in multiple consecutive rounds is not equal to the number of benchmark steady-state signals, then it can be considered that the parameter update condition is met, that is, the parameter update condition is considered to be met only when the number of real-time steady-state signals corresponding to each round in multiple consecutive rounds is not equal to the number of benchmark steady-state signals, that is, the signal has changed to a large extent compared with the signal of the historical round, then the parameter set is updated.
[0072] The second increased sampling frequency is greater than the original sampling frequency. When the number of real-time steady-state signals corresponding to the current round is equal to the number of reference steady-state signals, the sampling frequency is increased to expedite verification of whether the number of real-time steady-state signals corresponding to each of multiple rounds is not equal to the number of reference steady-state signals. This, in turn, speeds up verification of whether parameter update conditions are met. If the parameter update conditions are met, signal changes can be detected more quickly, allowing for faster parameter set updates, ensuring that the ultrasonic flowmeter operates under accurate parameters.
[0073] The number of reference steady-state signals, the third state counting threshold, and the second upward sampling frequency can be set according to actual application requirements, and are not limited in this embodiment.
[0074] It should be noted that the number of benchmark steady-state signals is used to measure the degree of change of the sampling signal of the current round compared with the sampling signal of the historical round. It can be determined based on the number of steady-state signals in each round in the historical round, and represents the overall or average number of steady-state signals in the historical round.
[0075] In this embodiment, a significant signal change is considered to have occurred only when the number of real-time steady-state signals corresponding to each of multiple rounds differs from the reference steady-state signal. This improves reliability and reduces false alarms compared to relying solely on signal changes in a single round, thereby enhancing the robustness of the ultrasonic flowmeter measurement system. Furthermore, when the number of real-time steady-state signals corresponding to the current round differs from the reference steady-state signal, the sampling frequency is increased, accelerating verification of parameter update conditions, improving the system's response to signal changes, and enhancing the system's real-time performance.
[0076] In another optional implementation, the parameter set further includes a reference steady-state signal ratio. In the aforementioned S103, if the parameter update condition is met, the first wave threshold and the relative coefficient are updated according to the steady-state signal of the current round and the non-steady-state signal of the current round. Specifically, this can be implemented as follows:
[0077] Determine the number of real-time steady-state signals corresponding to the current round. If the ratio of the number of real-time steady-state signals to the total number of sampling signals in the current round is not equal to the ratio of the reference signal, increase the third state count and use the second increased sampling frequency as the sampling frequency for sampling the signal of the ultrasonic flowmeter. When the third state count reaches the third state count threshold, update the first wave threshold and relative coefficient according to the steady-state signal of the current round and the non-steady-state signal of the current round.
[0078] In this method, whether the parameter update condition is met is determined based on the ratio of the reference steady-state signal. The specific implementation principle is the same as that of determining whether the parameter update condition is met based on the number of reference steady-state signals, and will not be repeated here.
[0079] Figure 2 A flow chart of a parameter determination strategy provided in an embodiment of the present application. In an optional implementation, in the aforementioned S103, updating the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round can be implemented as follows:
[0080] The parameter set is updated based on the parameter determination strategy according to the steady-state signal of the current round, the non-steady-state signal of the current round, and the sampling signals of the M rounds before the current round.
[0081] Wherein, M is a positive integer, and its specific value can be set according to the needs of actual application. For example, M can be less than or equal to the third state counting threshold in the above embodiment.
[0082] Specifically, if Figure 2 As shown, the parameter determination strategy can be implemented using the following steps:
[0083] S201. In the current round and the previous M rounds, for each round, select a preset number of amplitudes from the amplitudes of multiple sampling signals corresponding to the round in descending order, and calculate the average of the preset number of amplitudes.
[0084] In this step, for the current round and any of the previous M rounds, a preset number of amplitudes are selected from the amplitudes of the sampled signals corresponding to that round, in descending order of amplitude, and the average of the preset number of amplitudes is taken as the average value corresponding to that round. In this way, average values corresponding to different rounds can be calculated. The preset number can be set based on actual application needs and is not limited in this embodiment.
[0085] S202: Perform weighted averaging on the average values corresponding to the current round and each of the previous M rounds to obtain stable amplitudes corresponding to the current round and the previous M rounds.
[0086] The weights may be set according to actual application requirements, and this embodiment does not limit this.
[0087] For example, the stable amplitude can be calculated using the following formula (1):
[0088] C=[w1(C ave )1+w2(C ave )2+...+w i (C ave ) i ] / (w1+w2+...+w i ) (1)
[0089] Where C represents the stable amplitude. Sort the current round and the previous M rounds in chronological order, (C ave )1 represents the average value corresponding to the first round, (C ave )2 represents the average value corresponding to the second round, and so on, (C ave ) i represents the average value corresponding to the last round. w1 represents the weight corresponding to the first round, w2 represents the weight corresponding to the second round, and so on. i Indicates the weight corresponding to the last round.
[0090] Optionally, in formula (1), i can be 10, w1 to w i It can be 0.1.
[0091] S203 , re-sample the signal of the ultrasonic flowmeter for multiple rounds to obtain a first sampling signal, and determine a steady-state signal and a non-steady-state signal in the first sampling signal based on the stable amplitudes corresponding to the current round and the previous M rounds.
[0092] Based on the stable amplitudes corresponding to the current round and the previous M rounds, the steady-state signal and the non-steady-state signal in the first sampling signal are determined, which can be specifically implemented in the following manner:
[0093] The product of the stable amplitude and the lowest coefficient corresponding to the current round and the previous M rounds is taken as the minimum value, and the product of the stable amplitude and the highest coefficient corresponding to the current round and the previous M rounds is taken as the maximum value; the signal in the first sampling signal whose amplitude is greater than or equal to the minimum value and less than or equal to the maximum value is determined as the steady-state signal in the first sampling signal; the signal in the first sampling signal whose amplitude is less than the minimum value and greater than the maximum value is determined as the non-steady-state signal in the first sampling signal.
[0094] Specifically, the maximum and minimum values can be determined using the following formula (2):
[0095]
[0096] Wherein, am represents the amplitude of a certain sampling signal in the first sampling signal. l Indicates the lowest coefficient, coeff h Indicates the highest coefficient, and C indicates the stable amplitude. l *C represents the minimum value, coeff h *C indicates the maximum value.
[0097] The specific values of the minimum coefficient and the maximum coefficient can be set according to the needs of actual application, and this embodiment does not limit this. For example, the minimum coefficient can be 1.1 and the maximum coefficient can be 0.9.
[0098] Based on the stable amplitudes corresponding to the current round and the previous M rounds, the steady-state signal and the unstable signal in the first sampling signal are determined, which can be specifically implemented in the following manner:
[0099] The difference between the stable amplitudes corresponding to the current round and the previous M rounds minus the preset increment is taken as the minimum value, and the sum of the stable amplitudes corresponding to the current round and the previous M rounds plus the preset increment is taken as the maximum value; the signal in the first sampling signal with an amplitude greater than or equal to the minimum value and less than or equal to the maximum value is determined as the steady-state signal in the first sampling signal; the signal in the first sampling signal with an amplitude less than the minimum value and greater than the maximum value is determined as the non-steady-state signal in the first sampling signal.
[0100] The specific value of the preset increment can be set according to the needs of actual application, and this embodiment does not limit this.
[0101] In this embodiment, the minimum and maximum values are determined based on the stable amplitude values corresponding to the current round and the previous M rounds. Signals with amplitudes greater than or equal to the minimum value and less than or equal to the maximum value are identified as steady-state signals, while signals with amplitudes less than the minimum value or greater than the maximum value are identified as non-steady-state signals. By setting clear minimum and maximum values, it is possible to clearly define which signals are steady-state and which are non-steady-state. Furthermore, distinguishing signals based on amplitude ranges can simplify signal processing and improve system efficiency.
[0102] S204: Update a parameter set according to the steady-state signal and the non-steady-state signal in the first sampling signal.
[0103] The parameter set includes the first wave threshold and the relative coefficient. This step can be implemented in the following way:
[0104] The non-steady-state signals in the first sampled signal are arranged from front to back according to the sampling time sequence. The amplitudes of any two adjacent signals are added to obtain multiple new amplitudes. The multiple new amplitudes are sorted from largest to smallest. The product of the first new amplitude and the preset coefficient is used as the updated first-wave threshold. The ratio of the first-wave threshold to the stable amplitude is used as the updated relative coefficient.
[0105] The preset coefficient can be set according to actual application needs, and this embodiment does not limit this. For example, in this method, the preset coefficient is 1 / 2.
[0106] Alternatively, the amplitudes of any three adjacent signals may be added together to obtain multiple new amplitudes, which are sorted from largest to smallest, and the product of the first new amplitude and a preset coefficient is used as the updated first-wave threshold. The preset coefficient may be set to 1 / 3.
[0107] Similarly, you can also add the amplitudes of any specified number of adjacent signals to obtain multiple new amplitudes, sort them from largest to smallest, and multiply the first new amplitude by a preset coefficient as the updated first-wave threshold. The preset coefficient can be set to 1 / the specified number.
[0108] In an optional implementation, the parameter set also includes the number of reference steady-state signals. This step can be implemented as follows:
[0109] The average value of the number of steady-state signals in each round in the first sampling signal is determined as the updated reference steady-state signal number.
[0110] The number of reference steady-state signals is used to determine whether the parameter update condition is met.
[0111] For any round of non-steady-state signals in the first sampling signal, the amplitude of any non-steady-state signal in the round is added to the amplitude of the next non-steady-state signal to obtain multiple new amplitudes. The multiple new amplitudes are sorted from large to small, and the product of the first new amplitude and the preset coefficient is used as the sub-first wave threshold corresponding to the round.
[0112] Specifically, for any round of non-steady-state signals in the first sampling signal, multiple non-steady-state signals of the round are arranged in order of sampling time; for any non-steady-state signal, the amplitude of the non-steady-state signal is added to the amplitude of the next non-steady-state signal after the steady-state signal to obtain a new amplitude; the above operation is repeated for each non-steady-state signal to obtain multiple new amplitudes; the multiple new amplitudes are sorted from large to small according to the amplitude, and the largest new amplitude among them is multiplied by the preset coefficient to obtain the sub-first wave threshold corresponding to the round.
[0113] For the non-steady-state signals of each round in the first sampling signal, the above operation of determining the sub-first wave threshold is repeated to obtain the self-first wave threshold corresponding to each round.
[0114] The preset coefficient can be set according to actual application needs, which is not limited in this embodiment. For example, the preset coefficient can be 1 / 2.
[0115] The sub-first wave thresholds corresponding to each round in the first sampling signal are weighted and averaged to obtain an updated first wave threshold.
[0116] The weights can be set based on actual application needs and are not limited in this embodiment. For example, the sub-first wave threshold corresponding to a round closer to the current round can be assigned a larger weight, while the sub-first wave threshold corresponding to a round farther from the current round can be assigned a smaller weight.
[0117] Specifically, the sub-first wave thresholds corresponding to each round are weighted and summed, and then averaged to obtain the updated first wave threshold.
[0118] The ratio of the updated first wave threshold to the stable amplitude is used as the updated relative coefficient.
[0119] In this embodiment, the parameter set is updated according to multiple rounds of sampling signals. The parameter set is updated with reference to multiple rounds of sampling signals rather than a single round of sampling signals, thereby improving the reliability and accuracy of the update result.
[0120] It should be noted that the parameter determination strategy is also used to initialize the parameter set.
[0121] Specifically, for any ultrasonic sensor in the ultrasonic flowmeter, the signal of the ultrasonic sensor is sampled multiple times to obtain a second sampling signal; a preset number of amplitudes are selected from the signal corresponding to any round in the second sampling signal in descending order of amplitude, and the average value of the preset number of amplitudes is calculated; the average values corresponding to each round in the second sampling signal are weighted and averaged to obtain a stable amplitude corresponding to each round in the second sampling signal; the signal of the ultrasonic flowmeter is sampled multiple times again to obtain a third sampling signal, and based on the stable amplitude, the steady-state signal and the non-steady-state signal in the third sampling signal are determined; and the parameter set is initialized based on the steady-state signal and the non-steady-state signal in the third sampling signal. The specific implementation principle of initializing the parameter set based on the parameter determination strategy is the same as that of S201-S204 above and will not be repeated here.
[0122] It should be noted that when the steady-state condition in S101 is that the amplitude of the signal is greater than or equal to the minimum value and less than or equal to the maximum value, the parameter set may also store the minimum value and the maximum value.
[0123] Furthermore, the minimum value and the maximum value may be initialized or updated based on the stable amplitude corresponding to each round in the second sampling signal. The specific implementation principle is the same as the method for determining the minimum value and the maximum value in the aforementioned S203 and will not be repeated here.
[0124] In this embodiment, a parameter set is updated based on a parameter determination strategy, according to the steady-state signal of the current round, the non-steady-state signal of the current round, and the sampled signals of the M rounds before the current round. When updating the parameter set, information from the sampled signals of multiple rounds that meet the parameter update conditions is fully incorporated, allowing the updated parameter set to accurately adapt to signal changes, thereby improving the robustness and accuracy of the ultrasonic flowmeter measurement system.
[0125] Furthermore, an ultrasonic flowmeter includes multiple ultrasonic sensors, each with different characteristics, and their consistency may be poor. In this embodiment, different first-wave thresholds and parameter sets are set for different ultrasonic sensors. This self-learning process improves the stability of the ultrasonic flowmeter measurement system.
[0126] Figure 3 A flowchart of a threshold updating method provided in an embodiment of the present application. In an optional implementation, the parameter set also includes the number of reference steady-state signals. In the aforementioned S102, if the threshold update condition is met, the first wave threshold is updated based on the current round of steady-state signals and the relative coefficient in the parameter set, such as Figure 3 As shown, this can be achieved by taking the following steps:
[0127] S301: Determine the number of real-time steady-state signals corresponding to the current round. If the number of real-time steady-state signals is equal to the number of reference steady-state signals, calculate the reference threshold corresponding to the current round based on the non-steady-state signals of the current round.
[0128] The number of steady-state signals in the multiple sampling signals of the current round is the number of real-time steady-state signals corresponding to the current round. The number of reference steady-state signals can be set according to actual application needs and is not limited in this embodiment. For example, the number of reference steady-state signals can be determined according to the method for determining the number of reference steady-state signals in the aforementioned embodiment.
[0129] In this step, if the number of real-time steady-state signals is equal to the number of reference steady-state signals, the amplitudes of any two adjacent signals in the current round of non-steady-state signals are added together to obtain multiple new amplitudes. The multiple new amplitudes are sorted from largest to smallest according to the new amplitudes, and the product of the first new amplitude and the set coefficient is used as the reference threshold corresponding to the current round. The set coefficient can be set according to actual application needs and is not limited in this embodiment. For example, the preset coefficient can be 1 / 2.
[0130] Alternatively, the amplitudes of any three adjacent signals may be added together to obtain multiple new amplitudes, which are sorted from largest to smallest, and the product of the first new amplitude and a set coefficient is used as the updated first-wave threshold. The set coefficient may be set to 1 / 3.
[0131] Similarly, the amplitudes of any set number of adjacent signals can be added together to obtain multiple new amplitudes, which are sorted from largest to smallest. The product of the first new amplitude and the set coefficient is used as the updated first-wave threshold. The set coefficient can be set to 1 / the set number.
[0132] S302: Calculate the threshold change rate according to the first-wave threshold and the reference threshold.
[0133] In this step, the ratio of the first wave threshold to the base threshold, or the ratio of the base threshold to the first wave threshold, can be used as the threshold change rate, where the threshold change rate is used to measure the degree of change of the base threshold relative to the first wave threshold.
[0134] S303: Determine whether the threshold change rate is within a first range.
[0135] In this step, if the threshold change rate is within the first range, it means that the benchmark threshold has changed less than the first wave threshold, that is, the first wave threshold can still accurately identify the first wave, then continue to execute S305, clear the first state count, and keep the first wave threshold unchanged.
[0136] If the threshold change rate is not within the first range, it indicates that the baseline threshold has significantly changed relative to the first-wave threshold, meaning that the first-wave threshold may no longer accurately identify the first wave. Therefore, the process proceeds to S304, incrementing the first-state count to determine whether the first-state count reaches the first-state count threshold. The first range can be set based on actual application needs and is not limited in this embodiment.
[0137] S304: If the threshold change rate is not within the first range, increase the first state count. When the first state count reaches the first state count threshold, update the first wave threshold according to the steady-state signal and relative coefficient of the current round, and end this adjustment.
[0138] In this step, if the threshold change rate corresponding to the current round is not within the first range, the first state count is incremented, and a determination is made as to whether the first state count reaches the first state count threshold. If the first state count reaches the first state count threshold, this indicates that the threshold change rates corresponding to each of the consecutive rounds are not within the first range. In other words, the baseline thresholds of each of the consecutive rounds have varied significantly relative to the first-wave threshold, i.e., the signal change can be determined to be normal. In this case, the threshold update condition is considered satisfied, and the first-wave threshold is updated.
[0139] It should be noted that the increase in the first state count is cumulative, and the step size of each accumulation is consistent, for example, 1 is accumulated each time.
[0140] If the first state count does not reach the first state count threshold, it means that it has not yet been determined that the signal change may be accidental rather than normal. It can be considered that the threshold update condition is not met, and there is no need to update the first wave threshold. Then continue to execute S306, keep the first wave threshold unchanged, and end this adjustment.
[0141] Optionally, in this step, if the threshold change rate is not within the first range, the first-wave threshold may be directly updated according to the steady-state signal and relative coefficient of the current round.
[0142] S305: If the threshold change rate is within the first range, clear the first state count, keep the first wave threshold unchanged, and end this adjustment.
[0143] The first state count is cleared to ensure that the first wave threshold is updated only when the threshold change rate corresponding to each round in multiple consecutive rounds is not within the first range.
[0144] S306: If the first state count does not reach the first state count threshold, the first wave threshold is kept unchanged, and the adjustment is ended.
[0145] In this embodiment, the threshold update condition is considered to be met and the first-wave threshold is updated only when the number of real-time steady-state signals corresponding to the current round is equal to the number of reference steady-state signals and the threshold change rate corresponding to each round in multiple consecutive rounds is not within the first range. This accurately determines whether the first-wave threshold needs to be updated, avoids useless updates, and thus improves the stability of the ultrasonic flowmeter measurement system.
[0146] Figure 4 A flowchart of another threshold updating method provided in an embodiment of the present application. In an optional implementation, the parameter set also includes the number of reference steady-state signals. In the aforementioned S102, if the threshold update condition is met, the first wave threshold is updated based on the current round of steady-state signals and the relative coefficient in the parameter set, such as Figure 4 As shown, this can be achieved by taking the following steps:
[0147] S401: Determine the number of real-time steady-state signals corresponding to the current round. If the number of real-time steady-state signals is equal to the number of reference steady-state signals, calculate the reference threshold corresponding to the current round based on the non-steady-state signals of the current round.
[0148] S402: Calculate the threshold change rate according to the first-wave threshold and the reference threshold.
[0149] Among them, the implementation principle of S401-S402 is the same as the implementation principle of the aforementioned S301-S302, and will not be repeated here.
[0150] S403: Determine whether the threshold change rate is within a second range.
[0151] The second range includes the first range, that is, the second range is wider than the first range. The second range can be set according to actual application needs, and this embodiment does not limit this.
[0152] In this step, if the threshold change rate is not within the second range, the process proceeds to S04, incrementing the second state count and increasing the sampling frequency to expedite verification of whether the first wave threshold needs to be updated. If the threshold change rate is within the second range, the process proceeds to S405, clearing the second state count and restoring the sampling frequency for sampling the ultrasonic flowmeter signal.
[0153] S404. If the threshold change rate is not within the second range, the second state count is increased, and the first increased sampling frequency is used as the sampling frequency for sampling the signal of the ultrasonic flowmeter. When the second state count reaches the second state count threshold, the first wave threshold is updated according to the steady-state signal and relative coefficient of the current round, and this adjustment is ended; wherein, the first increased sampling frequency is greater than the sampling frequency corresponding to the current round.
[0154] In this step, if the threshold change rate corresponding to the current round is not within the second range, the second state count is increased, the sampling frequency is increased, and a determination is made as to whether the second state count reaches the second state count threshold. If the second state count reaches the second state count threshold, this indicates that the threshold change rate corresponding to each of the consecutive rounds is not within the second range. In other words, the degree of change of the baseline threshold relative to the first-wave threshold in each of the consecutive rounds is large, i.e., the change in the signal can be determined to be normal. In this case, the threshold update condition is considered to be met, and the first-wave threshold is updated.
[0155] It should be noted that the increase in the second state count is cumulative, and the step size of each accumulation is consistent, for example, 1 is accumulated each time.
[0156] If the second state count does not reach the second state count threshold, it means that it has not yet been determined that the signal change may be accidental rather than normal. It can be considered that the threshold update condition is not met, and there is no need to update the first wave threshold. Then continue to execute S409, keep the first wave threshold unchanged, and end this adjustment.
[0157] Among them, the sampling frequency is increased in order to speed up the verification of whether the threshold update conditions are met, thereby updating the first-wave threshold more quickly.
[0158] S405: If the threshold change rate is within the second range, clear the second state count and restore the sampling frequency for sampling the signal of the ultrasonic flowmeter.
[0159] The second state count is cleared to ensure that the first-wave threshold is updated only when the threshold change rate corresponding to each round in multiple consecutive rounds is not within the second range.
[0160] In this step, after clearing the second state count and restoring the sampling frequency of the ultrasonic flow meter signal, S406 is continued to be executed to determine whether the threshold change rate corresponding to the current round is within the first range.
[0161] In this embodiment, when the threshold change rate corresponding to the current round is not within the second range, that is, the benchmark threshold corresponding to the current round changes greatly relative to the first-wave threshold, the sampling frequency can be increased to speed up the verification of whether the threshold update conditions are met, thereby updating the first-wave threshold more quickly and improving the response speed and stability of the ultrasonic flowmeter measurement system.
[0162] S406: Determine whether the threshold change rate is within a first range.
[0163] S407: If the threshold change rate is not within the first range, increase the first state count. When the first state count reaches the first state count threshold, update the first wave threshold according to the steady-state signal and relative coefficient of the current round, and end this adjustment.
[0164] S408: If the threshold change rate is within the first range, clear the first state count, keep the first wave threshold unchanged, and end this adjustment.
[0165] S409: If the first state count does not reach the first state count threshold, the first wave threshold remains unchanged, and the adjustment ends.
[0166] Among them, the implementation principles of S406-S409 are the same as the implementation principles of the aforementioned S303-S306, and will not be repeated here.
[0167] In an optional implementation, in the aforementioned S102, the first wave threshold is updated according to the steady-state signal of the current round and the relative coefficient in the parameter set, which can be specifically implemented by sampling as follows:
[0168] Calculate the amplitude mean of the steady-state signal of the current round and the steady-state signals of the N rounds before the current round, and use the product of the amplitude mean and the relative coefficient as the updated first-wave threshold.
[0169] Wherein, N is a positive integer, and its specific size is related to the first state counting threshold or the second state counting threshold. Specifically, N is less than or equal to the first state counting threshold, or N is less than or equal to the second state counting threshold.
[0170] In this embodiment, the first wave threshold is updated based on the steady-state signal of the current round, the amplitude of the steady-state signal of the previous N rounds before the current round, and the relative coefficient in the parameter set. The amplitudes of the signals of multiple rounds are fully combined, so that the updated first wave threshold can adapt to the changes in the signal, thereby improving the robustness of the ultrasonic flowmeter measurement system.
[0171] In an optional implementation, in the aforementioned embodiment, the ultrasonic flowmeter includes multiple sound channels, any sound channel includes a first ultrasonic sensor and a second ultrasonic sensor, the first ultrasonic sensor is arranged at the fluid inflow end, and the second ultrasonic sensor is arranged at the fluid outflow end, and the multiple sound channels perform the sampling process in sequence.
[0172] Among them, the execution order of multiple channels is: sort the channels, first sample each channel in sequence from front to back for a round, and then sample each channel in sequence from back to front for a round; wherein, when sampling any channel, the first ultrasonic sensor sends a signal first, and the second ultrasonic sensor sends a signal later; first sample each channel in sequence from back to front for a round, and then sample each channel in sequence from front to back for a round; wherein, when sampling any channel, the second ultrasonic sensor sends a signal first, and the first ultrasonic sensor sends a signal later.
[0173] Specifically, Figure 5 This is a flow chart of a channel switching sampling method provided in an embodiment of the present application. Figure 5 As shown, the specific implementation steps of this method are as follows:
[0174] S501. Sort the sound channels in the ultrasonic flow meter.
[0175] S502 , switching to the first channel, first having the first ultrasonic sensor in the channel send a signal, and the second ultrasonic sensor receive the signal; then having the second ultrasonic sensor send a signal, and the first ultrasonic sensor receive the signal.
[0176] S503, switching to the next channel, first the first ultrasonic sensor in the channel sends a signal, and the second ultrasonic sensor receives the signal; then the second ultrasonic sensor sends a signal, and the first ultrasonic sensor receives the signal; and so on, until switching to the last channel.
[0177] S504 , switching to the last channel, first the first ultrasonic sensor in the channel sends a signal, and the second ultrasonic sensor receives the signal; then the second ultrasonic sensor sends a signal, and the first ultrasonic sensor receives the signal.
[0178] At this point, the first single multi-channel sampling is completed, and the sampling order is reversed. The sampling order refers to the sorting order of each channel.
[0179] S505 , switching to the last channel, first the first ultrasonic sensor in the channel sends a signal, and the second ultrasonic sensor receives the signal; then the second ultrasonic sensor sends a signal, and the first ultrasonic sensor receives the signal.
[0180] S506 , switching to the previous channel, first the first ultrasonic sensor in the channel sends a signal, and the second ultrasonic sensor receives the signal; then the second ultrasonic sensor sends a signal, and the first ultrasonic sensor receives the signal; and so on, until switching to the first channel.
[0181] S507 , switching to the first channel, first having the first ultrasonic sensor in the channel send a signal, and the second ultrasonic sensor receive the signal; then having the second ultrasonic sensor send a signal, and the first ultrasonic sensor receive the signal.
[0182] At this point, the second sampling of a single multi-channel is complete, and the sampling direction is reversed. The forward sampling direction is when the first ultrasonic sensor in the channel sends a signal first, followed by the second ultrasonic sensor. The reverse sampling direction is when the second ultrasonic sensor in the channel sends a signal first, followed by the third ultrasonic sensor. In other words, S502-S507 are performed in the forward sampling direction, and the following sampling is performed in the reverse sampling direction.
[0183] S508 , switching to the last channel, first the second ultrasonic sensor in the channel sends a signal, and the first ultrasonic sensor receives the signal; then the first ultrasonic sensor sends a signal, and the second ultrasonic sensor receives the signal.
[0184] S509 , switching to the previous channel, first the second ultrasonic sensor in the channel sends a signal, and the first ultrasonic sensor receives the signal; then the first ultrasonic sensor sends a signal, and the second ultrasonic sensor receives the signal; and so on, until switching to the first channel.
[0185] S510 , switching to the first channel, first having the second ultrasonic sensor in the channel send a signal, and the first ultrasonic sensor receive the signal; then having the first ultrasonic sensor send a signal, and the second ultrasonic sensor receive the signal.
[0186] At this point, the single multi-channel sampling is completed for the third time, and the sampling order is reversed again.
[0187] S511 , switching to the first channel, first having the second ultrasonic sensor in the channel send a signal, and the first ultrasonic sensor receive the signal; then having the first ultrasonic sensor send a signal, and the second ultrasonic sensor receive the signal.
[0188] S512: Switch to the next channel. First, the second ultrasonic sensor in the channel sends a signal, and the first ultrasonic sensor receives the signal. Then, the first ultrasonic sensor sends a signal, and the second ultrasonic sensor receives the signal. This process is repeated in this way until the last channel is switched to.
[0189] S513 , switching to the last channel, first the second ultrasonic sensor in the channel sends a signal, and the first ultrasonic sensor receives the signal; then the first ultrasonic sensor sends a signal, and the second ultrasonic sensor receives the signal.
[0190] At this point, the fourth single multi-channel sampling is completed.
[0191] It should be noted that S502-S503 constitutes a sampling cycle, which includes four sampling cycles, or four rounds of sampling. Each round of sampling includes sampling the signal received by each ultrasonic sensor in each channel. During one round of sampling, one ultrasonic sensor receives multiple sampled signals.
[0192] It should be noted that, in the actual application of the multi-channel ultrasonic flowmeter, the signal of the multi-channel ultrasonic flowmeter may be periodically sampled according to the above period.
[0193] In this embodiment, by sorting the channels and switching the channels in turn in forward and reverse order, the sampling process is performed on different channels in different time periods. This method of time-sharing channel switching for sampling can reduce interference between signals, thereby improving the stability of the ultrasonic flow meter measurement system.
[0194] It should be noted that the aforementioned embodiments can be combined with each other. For example, Figure 6 A flow chart of another method for adjusting the first wave threshold provided in an embodiment of the present application is shown as follows: Figure 6 As shown, the specific steps of this method are as follows:
[0195] S601. In the current round of sampling, the signal of the ultrasonic flowmeter is sampled according to the first wave threshold in the parameter set to obtain multiple sampling signals of the current round; wherein the multiple sampling signals include steady-state signals and non-steady-state signals.
[0196] S602: Determine the number of real-time steady-state signals corresponding to the current round, and judge whether the number of real-time steady-state signals of the current round is equal to the number of reference steady-state signals.
[0197] If the number of steady-state signals is equal to the number of reference steady-state signals, it means that the degree of change of the sampling signal in the current round relative to the historical round is small, then only the first-wave threshold is considered to be updated, and S603 is continued to be executed to calculate the threshold change rate to further determine whether the first-wave threshold needs to be updated.
[0198] If the number of steady-state signals is not equal to the number of reference steady-state signals, it means that the degree of change in the sampling signal of the current round relative to the historical round is large, then it is necessary to consider updating the parameter set including the first wave threshold, continue to execute S616, increase the sampling frequency, and speed up the verification of whether the parameter set needs to be updated.
[0199] S603: If the number of real-time steady-state signals is equal to the number of reference steady-state signals, calculate the reference threshold corresponding to the current round according to the non-steady-state signal of the current round, and calculate the threshold change rate according to the first wave threshold and the reference threshold.
[0200] S604: Determine whether the threshold change rate is within a second range.
[0201] If the threshold change rate is not within the second range, it means that the amplitude of the current round of sampling signals has changed significantly compared with the sampling signals of the previous rounds, and then S605 is executed to increase the sampling frequency and speed up the verification to see whether this change is normal.
[0202] If the threshold change rate is within the second range, it means that the amplitude of the current round of sampling signals has changed less than that of the historical rounds of sampling signals, and then S609 is executed to restore the sampling frequency and verify whether the first wave threshold needs to be updated normally.
[0203] S605. If the threshold change rate is not within the second range, increase the second state count and use the first increased sampling frequency as the sampling frequency for sampling the signal of the ultrasonic flowmeter, wherein the first increased sampling frequency is greater than the sampling frequency corresponding to the current round.
[0204] S606: Determine whether the second state count reaches a second state count threshold.
[0205] If the second state count reaches the second state count threshold, it means that the amplitude of the sampling signal has changed significantly compared with the sampling signal in the previous rounds for many consecutive rounds, and this change has become a normal state. Then, S607 is executed to update the first wave threshold.
[0206] If the second state count reaches the second state count threshold, then continue to execute S608 and keep the first wave threshold unchanged.
[0207] S607: If the second state count reaches the second state count threshold, update the first wave threshold according to the steady-state signal and relative coefficient of the current round.
[0208] In this step, after the first wave threshold is updated, S620 is continued to be executed to end this adjustment.
[0209] S608: If the second state count does not reach the second state count threshold, keep the first wave threshold unchanged.
[0210] In this step, after determining that the parameter set does not need to be updated, the process continues with S620 to end this adjustment.
[0211] S609: If the threshold change rate is within the second range, clear the second state count and restore the sampling frequency for sampling the signal of the ultrasonic flowmeter.
[0212] In this step, after the sampling frequency is restored, the process continues with S610 to determine whether the threshold change rate is within the first range.
[0213] S610: Determine whether the threshold change rate is within a first range.
[0214] The second range includes the first range, that is, the first range is narrower than the second range, and it is only necessary to verify whether the first wave threshold needs to be updated according to the normal frequency corresponding to the current round.
[0215] If the threshold change rate is not within the first range, it means that the amplitude of the current round of sampling signals has changed significantly compared with the sampling signals of the historical rounds, then continue to execute S611 to verify whether this change is normal. Only if it is normal, the first wave threshold needs to be updated.
[0216] If the threshold change rate is within the first range, it means that the amplitude of the current round of sampling signals has changed less than that of the historical rounds of sampling signals, and then S615 is executed without updating the first wave threshold.
[0217] S611: If the threshold change rate is not within the first range, increase the first state count.
[0218] S612: Determine whether the first state count reaches a first state count threshold.
[0219] If the first state count reaches the first state end threshold, it means that the amplitude of the sampling signal has changed significantly compared with the sampling signal in the historical rounds for many consecutive rounds, and this change has become a normal state. Then, continue to execute S613 to update the first wave threshold.
[0220] If the first state count does not reach the first state count threshold, it indicates that the change is not a normal state, and then the process continues with S614 without updating the first wave threshold.
[0221] S613: If the first state count reaches the first state count threshold, update the first wave threshold according to the steady-state signal and relative coefficient of the current round.
[0222] After the first wave threshold is updated, the process continues with S620 to end this adjustment.
[0223] S614: If the first state count does not reach the first state count threshold, keep the first wave threshold unchanged.
[0224] In this step, after determining that there is no need to update the first-wave threshold, the process continues with S620 to end this adjustment.
[0225] S615: If the threshold change rate is within the first range, keep the first-wave threshold unchanged.
[0226] In this step, after determining that there is no need to update the first-wave threshold, the process continues with S620 to end this adjustment.
[0227] S616: If the number of real-time steady-state signals is not equal to the number of reference steady-state signals, increase the third state count, and use the second increased sampling frequency as the sampling frequency for sampling the signal of the ultrasonic flowmeter.
[0228] S617: Determine whether the third state count reaches a third state count threshold.
[0229] If the third state count reaches the third state count threshold, then continue to execute S618 to update the parameter set. If the third state count does not reach the third state count threshold, then continue to execute S619 without updating the parameter set.
[0230] S618: If the third state count reaches the third state count threshold, update the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round.
[0231] In this step, after the parameter set is updated, S620 is continued to be executed to end this adjustment.
[0232] S619: If the third state count does not reach the third state count threshold, keep the parameter set unchanged.
[0233] In this step, after determining that the parameter set does not need to be updated, the process continues with S620 to end this adjustment.
[0234] S620: End this adjustment.
[0235] It should be noted that the specific implementation principles of S601-S620 can refer to the specific implementation principles of the aforementioned embodiments and will not be repeated here.
[0236] Figure 7 This is a structural diagram of a first wave threshold adjustment device provided in an embodiment of the present application. Figure 7 As shown, the first-wave threshold adjustment device 700 includes: a sampling module 701 , a threshold updating module 702 and a parameter updating module 703 .
[0237] Among them, the sampling module 701 is used to sample the signal of the ultrasonic flowmeter according to the first wave threshold in the parameter set during the current round of sampling to obtain multiple sampling signals of the current round; wherein the multiple sampling signals include steady-state signals and non-steady-state signals.
[0238] The threshold updating module 702 is used to update the first wave threshold according to the steady-state signal of the current round and the relative coefficient in the parameter set if the threshold update condition is met; wherein the relative coefficient is used to represent the relative relationship between the first wave threshold and the steady-state signal.
[0239] The parameter update module 703 is used to update the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round if the parameter update condition is met; wherein the threshold update condition and the parameter update condition are both formulated based on the degree of change of the multiple sampling signals of the current round compared with the sampling signals of the historical rounds, and the degree of change corresponding to the threshold update condition is less than the degree of change corresponding to the parameter update condition.
[0240] In an optional implementation, the parameter set further includes the number of reference steady-state signals. If the threshold update condition is met, when updating the first-wave threshold based on the steady-state signal of the current round and the relative coefficient in the parameter set, the threshold updating module 702 is specifically configured to:
[0241] Determine the number of real-time steady-state signals corresponding to the current round. If the number of real-time steady-state signals is equal to the number of reference steady-state signals, calculate the reference threshold corresponding to the current round based on the non-steady-state signal of the current round; calculate the threshold change rate based on the first-wave threshold and the reference threshold; if the threshold change rate is not within the first range, increase the first state count. When the first state count reaches the first state count threshold, update the first wave threshold based on the steady-state signal and the relative coefficient of the current round; if the threshold change rate is within the first range, clear the first state count and keep the first wave threshold unchanged.
[0242] In an optional implementation, if the threshold change rate is not within the first range, the first state count is increased. When the first state count reaches the first state count threshold, before updating the first wave threshold based on the steady-state signal and the relative coefficient of the current round, the threshold updating module 702 is further configured to:
[0243] If the threshold change rate is not within the second range, the second state count is increased, and the first increased sampling frequency is used as the sampling frequency for sampling the signal of the ultrasonic flowmeter. When the second state count reaches the second state count threshold, the first wave threshold is updated according to the steady-state signal and the relative coefficient of the current round; wherein, the first increased sampling frequency is greater than the sampling frequency corresponding to the current round, and the second range includes the first range; if the threshold change rate is within the second range, the second state count is cleared, and the sampling frequency for sampling the signal of the ultrasonic flowmeter is restored.
[0244] In an optional implementation, when updating the first-wave threshold according to the current round of steady-state signals and the relative coefficient in the parameter set, the threshold updating module 702 is specifically configured to:
[0245] Calculate the amplitude mean of the steady-state signal of the current round and the steady-state signals of the N rounds before the current round, and use the product of the amplitude mean and the relative coefficient as the first-wave threshold.
[0246] In an optional implementation, the parameter set further includes the number of reference steady-state signals. If the parameter update condition is met, when updating the parameter set based on the steady-state signal of the current round and the non-steady-state signal of the current round, the parameter updating module 703 is specifically configured to:
[0247] Determine the number of real-time steady-state signals corresponding to the current round. If the number of real-time steady-state signals is not equal to the number of reference steady-state signals, increase the third state count and use the second increased sampling frequency as the sampling frequency for sampling the signal of the ultrasonic flowmeter. When the third state count reaches the third state count threshold, update the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round.
[0248] In an optional implementation, when updating the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round, the parameter updating module 703 is specifically configured to:
[0249] According to the steady-state signal of the current round, the non-steady-state signal of the current round and the sampling signals of the previous M rounds before the current round, the parameter set is updated based on the parameter determination strategy; wherein the parameter determination strategy is used to initialize the parameter set, and the parameter determination strategy includes: in the current round and the previous M rounds, for each round, from the amplitudes of multiple sampling signals corresponding to the round, in order from large to small, selecting a preset number of amplitudes, and calculating the average value of the preset number of amplitudes; performing weighted averaging on the average values corresponding to each round in the current round and the previous M rounds to obtain the stable amplitude corresponding to the current round and the previous M rounds; re-sampling the signal of the ultrasonic flowmeter for multiple rounds to obtain a first sampling signal, and determining the steady-state signal and the non-steady-state signal in the first sampling signal based on the stable amplitude; updating the parameter set according to the steady-state signal and the non-steady-state signal in the first sampling signal.
[0250] In an optional implementation, when determining the steady-state signal and the non-steady-state signal in the first sampled signal based on the stable amplitude, the parameter updating module 703 is specifically configured to:
[0251] The product of the stable amplitude and the lowest coefficient is taken as the minimum value, and the product of the stable amplitude and the highest coefficient is taken as the maximum value; the signal in the first sampling signal whose amplitude is greater than or equal to the minimum value and less than or equal to the maximum value is determined as the steady-state signal in the first sampling signal; the signal in the first sampling signal whose amplitude is less than the minimum value and greater than the maximum value is determined as the non-steady-state signal in the first sampling signal.
[0252] In an optional implementation, the parameter set further includes the number of reference steady-state signals, and the number of reference steady-state signals is used to determine whether the parameter update condition is met. When updating the parameter set based on the steady-state signal and the non-steady-state signal in the first sampled signal, the parameter updating module 703 is specifically configured to:
[0253] The average value of the number of steady-state signals in each round of the first sampling signal is determined as the updated reference steady-state signal number; for the non-steady-state signal in any round of the first sampling signal, the amplitude of any non-steady-state signal in the round is added to the amplitude of the next non-steady-state signal to obtain multiple new amplitudes, the multiple new amplitudes are sorted from large to small, and the product of the first new amplitude and the preset coefficient is used as the sub-first wave threshold corresponding to the round; the sub-first wave thresholds corresponding to each round of the first sampling signal are weighted and averaged to obtain the updated first wave threshold; the ratio of the updated first wave threshold to the stable amplitude is used as the updated relative coefficient.
[0254] In an optional implementation, the ultrasonic flowmeter includes multiple sound channels, each of which includes a first ultrasonic sensor and a second ultrasonic sensor, the first ultrasonic sensor is arranged at the fluid inflow end, and the second ultrasonic sensor is arranged at the fluid outflow end, and the multiple sound channels perform the sampling process sequentially; the parameter updating module 703 is further used to:
[0255] The execution order of multiple channels is: sort the channels, first sample each channel in sequence from front to back for a round, and then sample each channel in sequence from back to front for a round; wherein, when sampling any channel, the first ultrasonic sensor sends a signal first, and the second ultrasonic sensor sends a signal later; first sample each channel in sequence from back to front for a round, and then sample each channel in sequence from front to back for a round; wherein, when sampling any channel, the second ultrasonic sensor sends a signal first, and the first ultrasonic sensor sends a signal later.
[0256] The first-wave threshold adjustment device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar, and are not described in detail in this embodiment.
[0257] Figure 8 This is a schematic diagram of the structure of an ultrasonic flow meter control unit provided in an embodiment of the present application. Figure 8 As shown, the ultrasonic flow meter control unit 800 includes a memory 801 and a processor 802. The memory 801 is used to store a computer program, and the processor 802 implements the method of any of the above embodiments when executing the computer program. A communication link is provided between the memory 801 and the processor 802. For example, the memory 801 and the processor 802 can communicate via a communication bus 803.
[0258] Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), or application-specific integrated circuits (ASIC). A general-purpose processor may be a microprocessor or any conventional processor. The steps in the method embodiments disclosed in this application may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0259] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, a method in any of the above method embodiments is implemented.
[0260] An embodiment of the present application further provides a computer program product, including a computer program, which implements the method in any of the above method embodiments when the computer program is executed by a processor.
[0261] The embodiment of the present application further provides an ultrasonic flow meter, comprising: an ultrasonic flow meter control unit, a first ultrasonic sensor and a second ultrasonic sensor;
[0262] The ultrasonic flow meter control unit is used to implement the method in any of the above embodiments;
[0263] The first ultrasonic sensor is used to transmit or receive ultrasonic signals, and the second ultrasonic sensor is used to receive or transmit ultrasonic signals.
[0264] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0265] The order of the above-mentioned embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. In addition, in some of the processes described in the above-mentioned embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or in parallel. They are only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. The meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0266] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be regarded as exemplary only; the true scope and spirit of the present application are indicated by the following claims. It should be understood that the present application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and variations can be made without departing from the scope thereof. The scope of the present application is limited solely by the appended claims. Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art will understand that they may modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some or all of the technical features therein; and such modifications or substitutions do not deviate from the essence of the corresponding technical solutions within the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for adjusting the first wave threshold, characterized in that: include: In the current round of sampling, the signal of the ultrasonic flowmeter is sampled according to the first wave threshold in the parameter set to obtain multiple sampling signals of the current round; wherein the multiple sampling signals include steady-state signals and non-steady-state signals; If the threshold update condition is met, the first wave threshold is updated according to the steady-state signal of the current round and the relative coefficient in the parameter set; wherein the relative coefficient is used to represent the relative relationship between the first wave threshold and the steady-state signal; If the parameter update condition is met, updating the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round; Among them, the threshold update condition and the parameter update condition are both formulated based on the degree of change of the multiple sampling signals of the current round compared with the sampling signals of the historical rounds, and the degree of change corresponding to the threshold update condition is smaller than the degree of change corresponding to the parameter update condition.
2. The method according to claim 1, characterized in that The parameter set also includes the number of reference steady-state signals, If the threshold update condition is met, updating the first wave threshold according to the steady-state signal of the current round and the relative coefficient in the parameter set includes: Determining the number of real-time steady-state signals corresponding to the current round, and if the number of real-time steady-state signals is equal to the number of reference steady-state signals, calculating the reference threshold corresponding to the current round based on the non-steady-state signals of the current round; Calculating a threshold change rate according to the first-wave threshold and the reference threshold; If the threshold change rate is not within the first range, increasing the first state count, and when the first state count reaches the first state count threshold, updating the first wave threshold according to the steady-state signal of the current round and the relative coefficient; The method further includes: if the threshold change rate is within the first range, clearing the first state count and keeping the first wave threshold unchanged.
3. The method according to claim 2, characterized in that If the threshold change rate is not within the first range, increasing the first state count; when the first state count reaches the first state count threshold, updating the first wave threshold according to the steady-state signal of the current round and the relative coefficient, the method further includes: If the threshold change rate is not within the second range, the second state count is increased, and the first increased sampling frequency is used as the sampling frequency for sampling the signal of the ultrasonic flowmeter. When the second state count reaches the second state count threshold, the first wave threshold is updated according to the steady-state signal of the current round and the relative coefficient; wherein the first increased sampling frequency is greater than the sampling frequency corresponding to the current round, and the second range includes the first range; If the threshold change rate is within the second range, the second state count is cleared and the sampling frequency of the signal of the ultrasonic flow meter is restored.
4. The method according to claim 1, wherein The updating of the first-wave threshold according to the steady-state signal of the current round and the relative coefficient in the parameter set includes: The amplitude mean of the steady-state signal of the current round and the steady-state signals of the N rounds before the current round is calculated, and the product of the amplitude mean and the relative coefficient is used as the first-wave threshold.
5. The method according to claim 1, wherein The parameter set also includes the number of reference steady-state signals, If the parameter update condition is met, updating the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round includes: Determine the number of real-time steady-state signals corresponding to the current round; if the number of real-time steady-state signals is not equal to the number of reference steady-state signals, increase the third state count, and use the second increased sampling frequency as the sampling frequency for sampling the signal of the ultrasonic flowmeter; when the third state count reaches the third state count threshold, update the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round.
6. The method according to claim 1, wherein The updating of the parameter set according to the steady-state signal of the current round and the non-steady-state signal of the current round includes: updating the parameter set based on a parameter determination strategy according to the steady-state signal of the current round, the non-steady-state signal of the current round, and the sampled signals of the M rounds before the current round; The parameter determination strategy is used to initialize the parameter set, and the parameter determination strategy includes: In the current round and the previous M rounds, for each round, from the amplitudes of the multiple sampled signals corresponding to the round, in descending order, select a preset number of the amplitudes, and calculate an average of the preset number of amplitudes; Taking a weighted average of the average values corresponding to the current round and each of the previous M rounds to obtain the stable amplitude values corresponding to the current round and the previous M rounds; re-sampling the signal of the ultrasonic flowmeter for multiple rounds to obtain a first sampling signal, and determining a steady-state signal and an unstable-state signal in the first sampling signal based on the stable amplitude; The parameter set is updated according to the steady-state signal and the non-steady-state signal in the first sampling signal.
7. The method according to claim 6, characterized in that The determining, based on the stable amplitude, the steady-state signal and the non-steady-state signal in the first sampling signal includes: The product of the stable amplitude and the lowest coefficient is taken as the minimum value, and the product of the stable amplitude and the highest coefficient is taken as the maximum value; A signal in the first sampling signal having an amplitude greater than or equal to the minimum value and less than or equal to the maximum value is determined as a steady-state signal in the first sampling signal; and a signal in the first sampling signal having an amplitude less than the minimum value and greater than the maximum value is determined as a non-steady-state signal in the first sampling signal.
8. The method according to claim 6, characterized in that The parameter set also includes the number of reference steady-state signals, and the number of reference steady-state signals is used to determine whether the parameter update condition is met. The updating of the parameter set according to the steady-state signal and the non-steady-state signal in the first sampling signal includes: Determine the average value of the number of steady-state signals in each round in the first sampling signal as the updated reference steady-state signal number; For any round of non-steady-state signals in the first sampling signal, add the amplitude of any non-steady-state signal in the round to the amplitude of the next non-steady-state signal to obtain multiple new amplitudes, sort the multiple new amplitudes from large to small, and multiply the first new amplitude by a preset coefficient as the sub-first wave threshold corresponding to the round; Taking a weighted average of the sub-first wave thresholds corresponding to each round in the first sampling signal to obtain an updated first wave threshold; The ratio of the updated first-wave threshold to the stable amplitude is used as the updated relative coefficient.
9. The method according to any one of claims 1 to 8, characterized in that The ultrasonic flowmeter includes a plurality of sound channels, each of which includes a first ultrasonic sensor and a second ultrasonic sensor, wherein the first ultrasonic sensor is arranged at the fluid inflow end and the second ultrasonic sensor is arranged at the fluid outflow end, and the plurality of sound channels perform the sampling process in sequence; The execution order of the multiple channels is: Arrange the channels, first sampling each channel in sequence from front to back, and then sampling each channel in sequence from back to front; wherein, when sampling any channel, the first ultrasonic sensor sends a signal first, and the second ultrasonic sensor sends a signal later; First, each of the sound channels is sampled in sequence from back to front, and then each of the sound channels is sampled in sequence from front to back; wherein, when sampling any of the sound channels, the second ultrasonic sensor sends a signal first, and the first ultrasonic sensor sends a signal later.
10. An ultrasonic flow meter control unit, characterized in that: include: memory and processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 9.
11. An ultrasonic flow meter, characterized in that: include: an ultrasonic flow meter control unit, a first ultrasonic sensor and a second ultrasonic sensor; The ultrasonic flow meter control unit is used to implement the method according to any one of claims 1 to 9; The first ultrasonic sensor is used to transmit or receive ultrasonic signals, and the second ultrasonic sensor is used to receive or transmit ultrasonic signals.