An ultrasonic flowmeter echo signal detection method and related equipment
By detecting the echo signal of the ultrasonic flowmeter in layers and utilizing envelope detection value and partition detection technology, the problems of poor adaptability and low accuracy of the detection method in the existing technology are solved, and more efficient abnormal signal recognition is achieved.
Patent Information
- Application Number
- CN202510949505.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-10
AI Technical Summary
The echo signal detection method of the existing ultrasonic flowmeter is difficult to adapt to the complex and changeable actual application scenarios, resulting in poor adaptability of the detection method and low accuracy of the detection results.
By obtaining the echo signal envelope of the ultrasonic flowmeter, the envelope detection value is determined using multiple preset ratios of the maximum envelope value, the time interval between signal nodes is calculated, and partition detection is performed based on the change trend and position of the envelope value. The extreme value sequence and signal fluctuation characteristics are extracted to achieve hierarchical detection.
It improves the adaptability and accuracy of the detection method, reduces the probability of missed detection and misjudgment, expands the detection range, and improves the recognition rate of abnormal signals.
Smart Images

Figure CN120446924B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of ultrasonic signal detection, and in particular to an echo signal detection method of an ultrasonic flowmeter and related equipment. Background Art
[0002] Ultrasonic flowmeters (such as ultrasonic gas meters and ultrasonic water meters) are widely used in liquid and gas flow measurement due to their advantages, such as low pressure drop and non-contact measurement. These meters typically estimate instantaneous flow rate by calculating the difference in the time of flight of an ultrasonic signal traveling downstream and upstream. However, in practice, ultrasonic echo signals are susceptible to factors such as gas disturbances, impurity reflections, and transducer structural defects, resulting in deformation and distortion of the echo waveform or the presence of spurious signals. This can severely impact time-of-flight calculations and flow measurement accuracy.
[0003] Related technologies generally use static thresholds or single characteristic indicators to detect abnormal echo signals, which is difficult to adapt to actual application scenarios where ultrasonic signal morphology is complex and changeable. There are problems such as poor adaptability of detection methods and low accuracy of detection results.
[0004] Currently, no effective solution has been proposed to the above-mentioned problems existing in the related technologies. Summary of the Invention
[0005] An embodiment of the present invention provides an echo signal detection method and related equipment for an ultrasonic flow meter, which at least solves the problem that the detection methods in related technologies are difficult to adapt to actual application scenarios with complex and changeable ultrasonic signal morphologies, and there are problems such as poor adaptability of the detection methods and low accuracy of the detection results.
[0006] In order to solve the above problem, one aspect of an embodiment of the present invention provides an echo signal detection method for an ultrasonic flowmeter, comprising:
[0007] Obtaining an envelope of an echo signal corresponding to the ultrasonic flowmeter, determining multiple envelope detection values based on multiple preset ratios corresponding to a maximum envelope value in the envelope, calculating a first time interval between signal nodes corresponding to each envelope detection value, and determining whether an overall shape of the envelope is abnormal based on the first time interval to obtain a first detection result;
[0008] If the first detection result is normal, based on the change trend of the envelope value and the position of the maximum envelope value in the envelope, the envelope is divided into a main envelope section and an auxiliary envelope section;
[0009] For the main envelope segment, extract the extreme value sequence in the main envelope segment to determine whether there is an amplitude anomaly in the main envelope segment based on the amplitude change characteristics corresponding to the extreme value sequence, and determine whether there is a periodic anomaly in the main envelope segment based on the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, thereby obtaining a second detection result;
[0010] For the auxiliary envelope section, the signal fluctuation characteristics in the auxiliary envelope section are extracted to determine whether there is abnormal fluctuation in the auxiliary envelope section according to the signal fluctuation characteristics, thereby obtaining a third detection result.
[0011] In some embodiments, the step of obtaining the envelope of the echo signal corresponding to the ultrasonic flowmeter includes:
[0012] The echo signal is collected by an analog-to-digital converter; wherein the echo signal is composed of a plurality of discrete sampling signal points;
[0013] For any sampling signal point, a target sliding window containing the current sampling signal point is determined, the amplitudes of all sampling signal points within the target sliding window are integrated, and the amplitude of the integrated operation result is adjusted according to a preset amplitude adjustment coefficient to obtain the envelope value of the current sampling signal point; wherein the length of the target sliding window is the length corresponding to one or more integer wave periods;
[0014] All sampling signal points in the echo signal are traversed, and the envelope value calculation step corresponding to the sampling signal points is performed to obtain the envelope of the echo signal.
[0015] In some embodiments, the step of determining a plurality of envelope detection values based on a plurality of preset ratios corresponding to the maximum envelope value in the envelope, calculating a first time interval between signal nodes corresponding to each envelope detection value, and determining whether the overall shape of the envelope is abnormal based on the first time interval includes:
[0016] Select at least two preset ratios and corresponding preset time intervals; wherein the preset ratio is the amplitude ratio of the envelope value of the key characteristic wave node in the envelope relative to the maximum envelope value; the preset time interval range is the time interval range between the key characteristic wave nodes;
[0017] Multiplying the maximum envelope value by each preset ratio to obtain at least a first envelope detection value and a second envelope detection value, and calculating a first time interval between signal nodes corresponding to the first envelope detection value and the second envelope detection value respectively;
[0018] It is determined whether the first time interval is within a preset time interval range. If so, the overall shape of the envelope is determined to be normal; if not, the overall shape of the envelope is determined to be abnormal.
[0019] In some embodiments, the step of dividing the envelope into the main envelope segment and the auxiliary envelope segment based on the change trend of the envelope value and the location of the maximum envelope value in the envelope includes:
[0020] Taking the position of the maximum envelope value as a reference and based on the change trend of the envelope value in the envelope, searching forward and / or backward along the time axis for the position where the envelope value continuously decreases to a preset envelope value threshold, so as to obtain the main envelope segment;
[0021] The section from the signal start point to the start point of the main envelope section is divided into the front auxiliary envelope section, and the section from the end point of the main envelope section to the signal end point is divided into the rear auxiliary envelope section.
[0022] In some embodiments, for a main envelope segment, extracting an extreme value sequence in the main envelope segment, determining whether an amplitude anomaly exists in the main envelope segment based on amplitude variation characteristics corresponding to the extreme value sequence, and determining whether a periodic anomaly exists in the main envelope segment based on a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence include:
[0023] Construct an amplitude ratio sequence of adjacent extreme values in the main envelope segment and extract the amplitude change trend corresponding to the amplitude ratio sequence of adjacent extreme values. If the amplitude growth between a pair of adjacent extreme values deviates from the overall amplitude change trend of the previous and next cycles, it is determined that there is an amplitude anomaly.
[0024] The time intervals between adjacent extreme values are periodically fitted. If the time interval between adjacent extreme values deviates from the periodic distribution of the main envelope segment, it is determined that there is a periodic anomaly.
[0025] In some embodiments, for a main envelope segment, the steps of determining whether there is an amplitude anomaly in the main envelope segment based on amplitude variation characteristics corresponding to an extreme value sequence, and determining whether there is a periodic anomaly in the main envelope segment based on a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence, include:
[0026] Determining whether there is an amplitude anomaly in the main envelope segment based on a first comparison result of the amplitude variation characteristics corresponding to the extreme value sequence and a preset amplitude condition; wherein the preset amplitude condition is that the amplitude ratio of adjacent extreme values is within an amplitude ratio threshold range; adjacent extreme values include adjacent peak-to-peak values, adjacent peak-to-valley values, or adjacent valley-to-valley values;
[0027] Based on a second comparison result between a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence and a preset periodic condition, it is determined whether there is a periodic anomaly in the main envelope segment; wherein the preset periodic condition is that the time interval between adjacent extreme values is within a time interval threshold range.
[0028] In some embodiments, the step of determining whether there is abnormal fluctuation in the auxiliary envelope segment according to the signal fluctuation characteristics includes:
[0029] The envelope difference value between the signal nodes at corresponding positions in adjacent detection cycles is calculated to determine whether there is abnormal fluctuation in the auxiliary envelope segment based on the envelope difference value and a preset difference value threshold.
[0030] In order to solve the above problem, one aspect of an embodiment of the present invention further provides an echo signal detection system for an ultrasonic flowmeter, comprising:
[0031] a first detection unit, configured to obtain an envelope of an echo signal corresponding to the ultrasonic flowmeter, determine a plurality of envelope detection values based on a plurality of preset ratios corresponding to a maximum envelope value in the envelope, calculate a first time interval between signal nodes corresponding to each envelope detection value, determine whether an overall shape of the envelope is abnormal based on the first time interval, and obtain a first detection result;
[0032] a segment division unit, configured to, if the first detection result is normal, divide the envelope into a main envelope segment and an auxiliary envelope segment based on a change trend of the envelope value and a position of a maximum envelope value in the envelope;
[0033] a second detection unit configured to extract an extreme value sequence from the main envelope segment, determine whether an amplitude anomaly exists in the main envelope segment based on an amplitude variation characteristic corresponding to the extreme value sequence, and determine whether a periodic anomaly exists in the main envelope segment based on a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence, thereby obtaining a second detection result;
[0034] The third detection unit is used to extract the signal fluctuation characteristics in the auxiliary envelope segment, so as to determine whether there is abnormal fluctuation in the auxiliary envelope segment according to the signal fluctuation characteristics, and obtain a third detection result.
[0035] In order to solve the above problems, one aspect of an embodiment of the present invention further provides an electronic device, including: a processor, and a memory for storing a program, the program including instructions, which, when executed by the processor, enable the processor to execute any of the above-mentioned echo signal detection methods for ultrasonic flow meters.
[0036] In order to solve the above problems, one aspect of an embodiment of the present invention further provides a non-transitory machine-readable medium storing computer instructions, where the computer instructions are used to enable a computer to execute any of the above-mentioned echo signal detection methods for an ultrasonic flowmeter.
[0037] The beneficial effects of the embodiments of the present invention are as follows: by obtaining the envelope of the echo signal corresponding to the ultrasonic flowmeter, determining multiple envelope detection values through multiple preset ratios corresponding to the maximum envelope value in the envelope, calculating the first time interval between the signal nodes corresponding to each envelope detection value, and judging whether the overall shape of the envelope is abnormal based on the first time interval to obtain a first detection result; if the first detection result is normal, based on the change trend of the envelope value in the envelope and the location of the maximum envelope value, the envelope is divided into a main envelope segment and an auxiliary envelope segment; for the main envelope segment, the extreme value sequence in the main envelope segment is extracted , to judge whether there is an amplitude anomaly in the main envelope segment according to the amplitude change characteristics corresponding to the extreme value sequence, and to judge whether there is a periodic anomaly in the main envelope segment according to the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, and obtain a second detection result; for the auxiliary envelope segment, the signal fluctuation characteristics in the auxiliary envelope segment are extracted to judge whether there is an abnormal fluctuation in the auxiliary envelope segment according to the signal fluctuation characteristics, and obtain a technical means of obtaining a third detection result, which overcomes the problem that the detection method in the related art is difficult to adapt to ultrasonic signals due to the use of static thresholds or single feature indicators to detect abnormal echo signals In practical application scenarios with complex and changeable morphologies, detection methods suffer from poor adaptability and low detection accuracy. This approach implements a hierarchical detection scheme that first detects the entire envelope and then detects the individual segments. Detection based on the overall envelope morphology can quickly detect and identify signal anomalies caused by obvious abnormal interference or abnormal reflections, improving detection efficiency. During the overall detection process, envelope detection values are determined by multiple preset ratios corresponding to the maximum envelope value. The time interval between envelope detection values is used as an indicator for abnormal signal detection. This allows accurate identification of echo morphological distortion caused by gas disturbances, reducing the probability of missed detections and false positives. Furthermore, the echo signal envelope is partitioned based on the changing trend of the envelope value and the location of the maximum envelope value. Independent partition detection schemes are used for different envelope segments, effectively isolating interference between signals within different segments and improving the accuracy of feature extraction within the corresponding segments. Even in scenarios with noise interference, targeted partition detection ensures high detection accuracy. This achieves the technical benefits of improving the adaptability of the detection method, enhancing the accuracy of detection results, expanding the detection range of the detection method, improving the recognition rate of abnormal signals, and expanding the application scenarios of the detection scheme.
[0038] The details of one or more embodiments of the invention are set forth in the accompanying drawings and the description below so that other features, objects, and advantages of the invention are more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be derived from these drawings without inventive effort.
[0040] Figure 1 It is a schematic diagram of the main flow of an echo signal detection method of an ultrasonic flow meter provided by an exemplary embodiment of the present invention;
[0041] Figure 2 is a schematic diagram of an envelope of an ultrasonic echo signal provided by an exemplary embodiment of the present invention;
[0042] Figure 3 is a schematic diagram of a main envelope section of an ultrasonic echo signal provided by an exemplary embodiment of the present invention;
[0043] Figure 4 is a schematic diagram of an auxiliary envelope section of an ultrasonic echo signal provided by an exemplary embodiment of the present invention;
[0044] Figure 5 1 is a schematic diagram of a framework of an echo signal detection system for an ultrasonic flowmeter provided by an exemplary embodiment of the present invention;
[0045] Figure 6 FIG. 1 is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0046] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0047] Static threshold detection methods include: (1) Amplitude threshold method, which usually sets a fixed amplitude threshold. When the amplitude of the echo signal exceeds the amplitude threshold, it is judged as a normal signal, otherwise it is judged as an abnormal signal. This method cannot adapt to scenarios where signal attenuation occurs, such as energy loss caused by long pipelines, and amplitude fluctuations caused by gas disturbances are easily misjudged. (2) Signal-to-noise ratio threshold method, which calculates the SNR (Signal-to-Noise Ratio) of the entire signal segment and uses the SNR as a fixed threshold. If it is lower than the fixed threshold, the echo signal is judged to be abnormal. This scheme is prone to missed detection. For example, local distortion may be ignored because the overall SNR meets the standard. For example, high-frequency noise may be concentrated in a specific frequency band, but the broadband SNR still meets the requirements and may be misjudged as a normal signal.
[0048] Single characteristic indicator detection methods include: (a) zero-crossing detection, which detects the interval time between signal zero crossings. If the interval time deviates from the nominal period, the period is judged to be abnormal. In this method, since amplitude distortion does not affect the zero-crossing time, missed detection is prone to occur; symmetrical noise increases the zero-crossing time, which can easily lead to misjudgment. (b) Envelope peak detection, which extracts the maximum peak of the envelope and determines whether the position corresponding to the maximum peak deviates from the expected time or whether the amplitude exceeds the range. This method cannot achieve correct detection in situations such as multipath reflection causing the envelope to have double peaks (the main peak position is correct but the amplitude is dispersed by the secondary peak), and the transducer resonant frequency offset causing the envelope to broaden, but the peak position is not offset (actual morphological distortion exists).
[0049] Based on the above analysis, the related methods that use static thresholds or single characteristic indicators to detect abnormal echo signals are difficult to adapt to actual application scenarios where the ultrasonic signal morphology is complex and changeable. There are problems such as poor adaptability of the detection method and low accuracy of the detection results.
[0050] In order to solve the above problems, an embodiment of the present invention provides an echo signal detection method for an ultrasonic flow meter, such as Figure 1 As shown, the echo signal detection method of the ultrasonic flowmeter mainly includes:
[0051] Step S101: Obtain the envelope of the echo signal corresponding to the ultrasonic flowmeter, determine multiple envelope detection values through multiple preset ratios corresponding to the maximum envelope value in the envelope, calculate the first time interval between the signal nodes corresponding to each envelope detection value, and determine whether the overall shape of the envelope is abnormal based on the first time interval to obtain a first detection result.
[0052] The above steps provide a solution for overall detection of the overall envelope shape of the echo signal. Specifically, the envelope detection value is determined based on multiple preset ratios of the maximum envelope value, rather than using a fixed threshold, so that the envelope detection value can be dynamically and adaptively adjusted at least with the signal strength. At the same time, the first time interval between the signal nodes corresponding to the envelope detection value is calculated, and the amplitude anomaly can be converted into anomaly in the time dimension. Based on this, waveform distortion anomalies that cannot be identified by the static amplitude threshold detection scheme in the related technology can be accurately identified, thereby improving the adaptability and accuracy of echo signal detection.
[0053] Among them, the maximum envelope value reflects the strongest feature of the echo signal. The envelope detection value can be quickly determined by using a preset ratio corresponding to the maximum envelope value (a certain ratio of the maximum envelope value, which can be an empirical value obtained in various experimental test environments).
[0054] By using the first time interval between envelope detection values corresponding to multiple preset ratios (at least two preset ratios) as the basis for judgment, cross-validation between multiple signal nodes is achieved, avoiding the susceptibility to noise interference when using a single ratio, thereby effectively reducing the misjudgment rate.
[0055] It is understandable that the first detection scheme for the overall envelope shape can quickly identify more severely distorted signals and directly discard abnormal signals. This not only prevents invalid (abnormal) data from entering the subsequent partition detection process and improves detection efficiency, but also allows for the rapid identification of serious anomalies using fewer computing resources.
[0056] In some embodiments, the above-mentioned step of obtaining the envelope of the echo signal corresponding to the ultrasonic flowmeter includes: collecting the echo signal through an analog-to-digital converter; wherein the echo signal is composed of multiple discrete sampling signal points; for any sampling signal point, determining a target sliding window including the current sampling signal point, integrating the amplitudes of all sampling signal points in the target sliding window, and adjusting the amplitude of the integration operation result according to a preset amplitude adjustment coefficient to obtain the envelope value of the current sampling signal point; wherein the length of the target sliding window is the length corresponding to one or more integer wave periods; traversing all sampling signal points in the echo signal, and executing the envelope value calculation step of the corresponding sampling signal point to obtain the envelope of the echo signal.
[0057] Specifically, the echo signals provided in the embodiments of the present application may include an uplink echo signal and a downlink echo signal. Ultrasonic transducers are used to transmit and receive excitation wave signals in the downstream (downstream) and upstream (upstream) directions, respectively. These signals are then acquired using an analog-to-digital converter (ADC). The echo signal waveform is actually composed of multiple discrete sampling signal points, each of which represents the amplitude of the ultrasonic signal at a specific moment.
[0058] According to a specific implementation of an embodiment of the present invention, the step of integrating the amplitudes of all sampled signal points within the target sliding window may include: performing weighted accumulation on the amplitude moduli of all sampled signal points within the target sliding window to obtain a first integrated operation result; or performing weighted accumulation on the squares of the amplitudes of all sampled signal points within the target sliding window, and then performing a square root operation on the weighted accumulation result to obtain a second integrated operation result. By using different preset amplitude adjustment coefficients to perform amplitude adjustment on the first integrated operation result and the second integrated operation result, a relatively accurate envelope value can be obtained, thereby obtaining a smooth envelope curve.
[0059] Based on the above configuration, setting the target sliding window length to an integer multiple of the wave period (e.g., 1-2 periods) ensures that the window always covers the entire waveform unit, helping to eliminate envelope aliasing caused by variable windows. By summing the modulo values of all sampling points within the target sliding window (a form of integration), combined with a preset amplitude adjustment coefficient, the calculated envelope value and the extracted echo signal envelope are highly adaptable to echo signals of varying frequencies and amplitude characteristics. This not only avoids the computational complexity and high computational effort associated with traditional Hilbert transforms or frequency-domain filtering, but also facilitates implementation. The preset amplitude adjustment coefficient is used to adjust the response amplitude of the extracted envelope and can be flexibly set based on varying signal strengths and noise levels to produce a smoother, more realistic envelope curve. Through integer-period window constraints and dynamic modulo aggregation, the above embodiment achieves a balance between noise suppression and envelope morphology fidelity, providing highly reliable envelope data for subsequent layered detection.
[0060] It is understandable that since the envelope value calculation of each sampling signal point only depends on its corresponding current window data, there is no need to wait for the end of the complete signal cycle. Therefore, ultra-low latency echo signal envelope extraction can be achieved, which improves detection efficiency and helps support real-time flight time calculation, such as meeting the fast flow response requirements of ultrasonic water meters and ultrasonic gas meters.
[0061] According to a specific implementation of an embodiment of the present invention, a target sliding window with a window length of an integer wave period can be selected with the current sampling point as the center, and the sum of the modulus values of all sampling points in the target sliding window is calculated and multiplied by the preset amplitude adjustment coefficient to obtain the envelope value at the corresponding moment of the sampling point. The preset amplitude adjustment coefficient is used to adjust the response amplitude of the envelope extraction and can be flexibly set according to different signal strengths and noise levels to obtain a smoother or more sensitive envelope curve. The above process is then repeated for each sampling point to eventually form a complete envelope sequence. Figure 2 As shown, the echo signal ( Figure 2 The solid line in the middle shows a periodic fluctuation structure, and the envelope corresponding to the echo signal is obtained by using a periodic sliding window ( Figure 2 (shown by the dashed line).
[0062] In some embodiments, the above-mentioned step of determining multiple envelope detection values through multiple preset ratios corresponding to the maximum envelope value in the envelope, calculating the first time interval between the signal nodes corresponding to each envelope detection value, and judging whether the overall shape of the envelope is abnormal based on the first time interval includes: selecting at least two preset ratios and corresponding preset time intervals; wherein the preset ratio is the amplitude ratio of the envelope value of the key characteristic wave node in the envelope relative to the maximum envelope value; the preset time interval range is the time interval range between the key characteristic wave nodes; multiplying the maximum envelope value by each preset ratio respectively to obtain at least the first envelope detection value and the second envelope detection value, and calculating the first time interval between the signal nodes corresponding to the first envelope detection value and the second envelope detection value respectively; judging whether the first time interval is within the preset time interval range, and if so, determining that the overall shape of the envelope is normal; if not, determining that the overall shape of the envelope is abnormal.
[0063] Based on the above-described embodiments, the preset ratios and corresponding preset time intervals provided in this application are based on empirical values in different application scenarios, which can be referenced by historical data of normal echo signals. Because the preset ratios and corresponding preset time intervals dynamically adapt to different application scenarios, they can effectively reduce misjudgments caused by using fixed ratio settings. In some specific embodiments, a larger ratio value can be selected for high-frequency transducers to capture steep waveforms, while a smaller ratio value can be selected for low-frequency transducers to identify bandwidth distortion. The preset ratios selected based on actual application scenarios improve the accuracy of the extracted echo signal envelope and are applicable to a variety of scenarios.
[0064] In the embodiments of this application, the number of ultrasonic signal excitation waves is pre-set, so the corresponding echo signal should exhibit energy concentration within a specific time window. That is, the maximum envelope value and a certain proportion of key characteristic wave nodes should be distributed within a certain time range. If the time intervals between these key characteristic wave nodes deviate from the pre-set time interval range, it often indicates interference or abnormal reflection in the signal.
[0065] According to a specific implementation of an embodiment of the present invention, taking a certain actual scenario as an example, the maximum envelope value itself corresponds to the position of a key characteristic wave node, which can be used as a preset ratio selection, that is, 100% is selected as the first target ratio. It can also be based on the position of another key characteristic wave node. If the envelope value corresponding to the peak value of the other key characteristic wave node is 30% of the maximum envelope value, 30% can be selected as the second target ratio, and then the time interval corresponding to the peak position of the two key characteristic wave nodes is the target time interval range. The actual time interval between the first envelope detection value corresponding to the first target ratio and the second envelope detection value corresponding to the second target ratio can be directly calculated from the envelope to determine whether the actual time interval is within the above-mentioned target time interval range. If not, it is determined that the echo signal segment has an envelope anomaly and may be affected by an abnormal interference signal. It should be noted that the above-mentioned numerical values are only examples and are not intended to limit the present application. For example, the above-mentioned target time interval range can be flexibly set according to the number of excitation waves, the echo signal bandwidth and the actual system response time.
[0066] Step S102 : If the first detection result is normal, based on the change trend of the envelope value and the position of the maximum envelope value in the envelope, the envelope is divided into a main envelope section and an auxiliary envelope section.
[0067] Based on the above settings, a partitioning logic consistent with the physical nature of ultrasonic propagation was constructed by taking into account the location of the maximum envelope value (a measurable physical parameter) and the envelope value variation trend (energy distribution pattern). By basing the partitioning on the continuous variation trend of the envelope value (such as the monotonic decreasing / increasing slope) rather than a fixed threshold, the system automatically adapts to the differences in attenuation rates caused by different media, accurately capturing the characteristic differences between the energy-concentrated and energy-dispersed regions of the echo signal. This allows for the partitioning of the system into a key segment (the main envelope segment) for time-of-flight calculation; a front auxiliary segment for transmitting circuit interference detection and early warning of medium anomalies; and a rear auxiliary segment for pipeline structure diagnosis and medium condition monitoring.
[0068] Taking the main envelope segment used for flight time calculation as an example, based on the above segment division operation, the influence of background stray interference on the signal characteristics of the main envelope segment is effectively isolated, and abnormal waveforms are avoided from participating in the flight time calculation process, thereby improving the measurement stability and accuracy of the ultrasonic flowmeter.
[0069] In some embodiments, the step of dividing the envelope into the main envelope segment and the auxiliary envelope segment based on the changing trend of the envelope value and the position of the maximum envelope value in the envelope includes: taking the position of the maximum envelope value as a reference, and based on the changing trend of the envelope value in the envelope, searching forward and / or backward along the time axis for a position where the envelope value continuously decreases to a preset envelope value threshold, thereby dividing the main envelope segment; dividing the segment from the signal starting point to the starting point of the main envelope segment into a front auxiliary envelope segment, and dividing the segment from the end point of the main envelope segment to the signal ending point into a rear auxiliary envelope segment.
[0070] The above steps provide a specific implementation method for segmentation. Based on the maximum envelope value, it accurately captures the starting point of the rising edge of the transmitted wave and completely includes the attenuation process of the reflected wave, ensuring the integrity of the key area used to calculate the flight time (i.e., the main envelope segment).
[0071] Among them, the above-mentioned preset envelope value threshold can be dynamically adjusted according to the medium type. For example, a higher preset envelope value threshold (such as 30% of the maximum envelope value) is used for gas medium to cope with the rapid attenuation of the echo signal in the gas medium; a lower preset envelope value threshold (such as 10% of the maximum envelope value) can be used for liquid medium to match the slow attenuation of the echo signal in the liquid medium.
[0072] The present invention provides a specific implementation method for dividing the main envelope segment: using the maximum position of the echo envelope as a reference, the amplitude change trend of the envelope value is analyzed forward along the time axis. When the envelope value continuously decreases and falls below a preset amplitude (set by the reference maximum value * preset ratio) for the first time, this position is recorded as the starting point of the main envelope segment. The time interval between this starting point and the maximum position is set as the main envelope segment for subsequent analysis of periodic characteristics and amplitude ratios. Figure 3 Schematic diagram of a main envelope section of an ultrasonic echo signal according to an embodiment of the present invention.
[0073] According to another specific implementation of the present invention, the main envelope segment can be divided using other methods. For example, a fixed time window approach can be used to select a certain range (e.g., a certain number of microseconds or a certain number of sampling points) before and after the envelope maximum as the main envelope segment. Alternatively, the main area of signal energy concentration can be dynamically determined by combining indicators such as local envelope curvature and envelope energy density. Alternatively, a search can be performed on both sides of the envelope maximum, forward and backward, for locations below a certain envelope threshold. A symmetrical segment centered around the envelope maximum is then extracted as the main envelope region. Through these various methods, the main envelope region can be flexibly extracted in different scenarios to accommodate signal differences under different fluid conditions or transducer characteristics.
[0074] According to another specific implementation of the embodiment of the present invention, Figure 4It is a schematic diagram showing that the remaining area is divided into multiple auxiliary analysis segments (also known as auxiliary envelope segments). Figure 4 The first auxiliary analysis section (also known as the front auxiliary envelope section) is the interval from the signal starting point to the starting point of the main envelope section, which is mainly used to detect abnormal fluctuations before the arrival of the main signal. The second auxiliary analysis section (also known as the rear auxiliary envelope section) takes the end point of the main envelope section as the starting point of the second auxiliary analysis section. The interval between this starting point and the end of the sampling sequence is set as the second auxiliary analysis section, which is used to identify abnormal fluctuations such as coda wave disturbances or background noise.
[0075] Another method for creating auxiliary envelope segments is to, outside the primary envelope segment, select a time interval of a certain length from the echo signal's starting point backward as the front auxiliary envelope segment; and simultaneously select a time interval of a certain length from the signal's tail forward as the back auxiliary envelope segment. This method is suitable for scenarios with stable sampling time and known waveform structure, allowing for rapid delineation of auxiliary analysis areas. It is important to note that different auxiliary envelope segments can be independently tested for abnormal jitter, enhancing the ability to detect front and back non-primary component interference.
[0076] Step S103: For the main envelope segment, extract the extreme value sequence in the main envelope segment to determine whether there is an amplitude anomaly in the main envelope segment based on the amplitude change characteristics corresponding to the extreme value sequence, and determine whether there is a periodic anomaly in the main envelope segment based on the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, to obtain a second detection result.
[0077] Based on the above setup, the amplitude variation characteristics corresponding to the extreme value sequence are used to determine whether there are amplitude anomalies within the main envelope segment. This system can automatically adapt to amplitude fluctuations caused by flow changes and accurately identify amplitude anomalies such as those caused by bubble interference. The distribution characteristics of the second time interval between adjacent extreme values corresponding to the extreme value sequence are used to determine whether there are periodic anomalies within the main envelope segment. This system can identify periodic anomalies such as those caused by transducer resonant frequency offset.
[0078] In some of the embodiments, for the main envelope segment, the above-mentioned steps of extracting the extreme value sequence in the main envelope segment to judge whether there is an amplitude anomaly in the main envelope segment based on the amplitude change characteristics corresponding to the extreme value sequence, and judging whether there is a periodic anomaly in the main envelope segment based on the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, include: constructing an amplitude ratio sequence of adjacent extreme values in the main envelope segment, extracting the amplitude change trend corresponding to the amplitude ratio sequence of adjacent extreme values, and if the amplitude growth between a pair of adjacent extreme values deviates from the overall amplitude change trend of the previous and subsequent multiple periods, it is judged that there is an amplitude anomaly; performing periodic fitting on the time intervals between each adjacent extreme value, and if the time interval between a certain adjacent extreme values deviates from the periodic distribution of the main envelope segment, it is judged that there is a periodic anomaly.
[0079] Based on the above embodiments, a comprehensive trend analysis solution for the main envelope section is provided, which helps to improve the detection accuracy of the main envelope section and provides a signal basis for ensuring the measurement accuracy of the flight time.
[0080] It can be understood that after constructing the modulus ratio sequence of adjacent extreme values, an amplitude trend consistency test is performed. If the modulus ratio of any adjacent extreme value exceeds the tolerance threshold of the overall amplitude change trend, it is determined that there is an amplitude anomaly; the time interval between adjacent peaks is fitted for periodic consistency. If the residual of the time interval between any adjacent peaks exceeds the periodic distribution residual threshold of the main envelope segment, it is determined that there is a periodic anomaly.
[0081] In some embodiments, the above-mentioned steps of judging whether there is an amplitude anomaly in the main envelope segment according to the amplitude change characteristics corresponding to the extreme value sequence, and judging whether there is a periodic anomaly in the main envelope segment according to the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, include: judging whether there is an amplitude anomaly in the main envelope segment according to a first comparison result of the amplitude change characteristics corresponding to the extreme value sequence and a preset amplitude condition; wherein the preset amplitude condition is that the amplitude ratio of adjacent extreme values is within an amplitude ratio threshold range; adjacent extreme values include adjacent peak-peak values, adjacent peak-valley values, or adjacent valley-valley values; judging whether there is a periodic anomaly in the main envelope segment according to a second comparison result of the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence and the preset period condition; wherein the preset period condition is that the time interval between adjacent extreme values is within the time interval threshold range.
[0082] The above steps provide a specific implementation for detecting amplitude anomalies in the main envelope segment. This method uses the amplitude ratio of adjacent extreme values (peak-to-valley / peak-to-peak / valley-to-valley) (rather than a fixed amplitude threshold) as the basis for determining whether an amplitude anomaly exists in the main envelope segment. This method exhibits strong interference resistance and adaptability. The method also uses the distribution of the second time intervals between adjacent extreme values (rather than a single point judgment) as the basis for determining whether a periodic anomaly exists in the main envelope segment. This method maintains high detection accuracy even in the presence of noise.
[0083] According to a specific implementation of an embodiment of the present invention, a method for detecting amplitude and period anomalies in the main envelope segment may include: extracting multiple local peaks within the main envelope segment (this can reduce the impact of discrete sampling, and further, nonlinear fitting can be used to accurately extract the peak positions and amplitudes), calculating the modulus ratio and time interval of adjacent peak pairs; when the modulus ratio is not within a preset range, it is determined to be an amplitude anomaly; when the time interval is not within a preset period range, it is determined to be a period anomaly. This method is based on the relatively stable common characteristics that the main envelope segment typically exhibits under normal operating conditions. Such characteristics can be manifested as: gradually increasing peak amplitude, decreasing peak-to-valley / peak-to-peak ratio, relatively uniform time intervals between adjacent peaks, and the frequency distribution of the echo signal.
[0084] According to another specific implementation of the embodiment of the present invention, it is also possible to: (1) calculate the amplitude ratio of the waveform unit composed of the peak value and the adjacent valley value (for evaluating whether the energy fluctuation in a single cycle is balanced), and judge whether the calculated amplitude ratio is within the preset ratio range; (2) based on the time interval between adjacent extreme value points (to evaluate the periodic consistency and local periodic stability of the signal), including the time interval between peak-peak, valley-valley or peak-valley, when the time interval between adjacent extreme value points is not within the preset period range, it indicates that the signal period is abnormal; (3) by analyzing the amplitude change trend of adjacent peak values and tracking the amplitude evolution of adjacent valley values, it is judged whether the signal conforms to gradual enhancement or attenuation. In the main envelope section of this embodiment, the amplitude change trend of adjacent peak values and adjacent valley values should be gradually rising. If this condition is not met, it indicates that the amplitude of the echo signal is abnormal.
[0085] Step S104 : extracting the signal fluctuation characteristics in the auxiliary envelope segment, so as to determine whether there is abnormal fluctuation in the auxiliary envelope segment according to the signal fluctuation characteristics, and obtain a third detection result.
[0086] Because the auxiliary envelope segment is located outside the main echo energy region, its envelope should normally exhibit smooth, low-amplitude variations. However, when interference or abnormal reflection signals are superimposed, the envelope value can experience sudden changes within a local period, manifesting as abnormal jitter amplitude.
[0087] Two strategies are provided for detecting the auxiliary envelope segment: time-domain detection and frequency detection. Time-domain detection utilizes cross-cycle envelope differential detection, as reflected in the time-domain fluctuation characteristics, rather than single-cycle threshold judgment. This eliminates steady-state noise and captures only true abnormal fluctuations. Frequency-domain detection focuses on high-frequency energy characteristics, detecting abnormal fluctuations such as sudden high-frequency energy surges, frequency offsets, and bandwidth expansion. It should be noted that frequency-domain detection is applicable not only to signal detection in the auxiliary envelope segment but also to the entire echo signal.
[0088] In some embodiments, the step of determining whether abnormal fluctuations exist within the auxiliary envelope segment based on signal fluctuation characteristics includes calculating envelope differential values between signal nodes at corresponding positions within adjacent detection cycles, and determining whether abnormal fluctuations exist within the auxiliary envelope segment based on the envelope differential value and a preset differential value threshold. In some embodiments, frequency characteristic parameters, bandwidth characteristic parameters, and energy distribution characteristic parameters from the spectrum corresponding to the auxiliary envelope segment may also be extracted. If the proportion of high-frequency energy exceeds a preset proportion threshold, the signal bandwidth exceeds a preset bandwidth threshold, or the offset of the energy concentration frequency point exceeds a preset frequency deviation threshold, then abnormal fluctuations are determined to exist.
[0089] The above steps provide a specific implementation method for detecting the auxiliary envelope section. Regarding time-domain fluctuation characteristics, the envelope value differences of nodes at the same location within adjacent cycles are compared and calculated. This offsets baseline fluctuations caused by fixed-frequency interference and ambient temperature, improving detection accuracy by reducing false positives. The preset differential value threshold is dynamically adapted to flow conditions (such as temperature and medium). A lower differential value threshold is selected for low flow rates, and a higher differential value threshold is selected for high flow rates to enable interference identification under various complex conditions. Regarding frequency-domain fluctuation characteristics, in addition to identifying abnormal fluctuations, this method can also provide reference information for fault maintenance. If a sudden increase in high-frequency energy is detected with an unchanged bandwidth, it may indicate a crack in the transducer. If a frequency offset and high-frequency energy attenuation are detected, it may indicate adhesion to the pipe wall.
[0090] The echo signal detection method for an ultrasonic flowmeter provided in an embodiment of the present invention obtains the envelope of the echo signal corresponding to the ultrasonic flowmeter, determines multiple envelope detection values based on multiple preset ratios corresponding to the maximum envelope value in the envelope, calculates the first time interval between signal nodes corresponding to each envelope detection value, and determines whether the overall shape of the envelope is abnormal based on the first time interval to obtain a first detection result. If the first detection result is normal, the envelope is divided into a main envelope segment and an auxiliary envelope segment based on the changing trend of the envelope values and the location of the maximum envelope value in the envelope. For the main envelope segment, an extreme value sequence is extracted to determine whether there is an amplitude abnormality within the main envelope segment based on the amplitude change characteristics corresponding to the extreme value sequence. A second detection result is obtained by determining whether there is a periodic abnormality within the main envelope segment based on the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence. For the auxiliary envelope segment, signal fluctuation characteristics are extracted to determine whether there is abnormal fluctuation within the auxiliary envelope segment based on the signal fluctuation characteristics, thereby obtaining a third detection result. A layered detection scheme is implemented through overall detection first and then partition detection. Detection based on the overall shape of the envelope can quickly detect and identify signal anomalies caused by more obvious abnormal interference or abnormal reflection, thereby improving detection efficiency. At the same time, in the overall detection process, the envelope detection value is determined by multiple preset ratios corresponding to the maximum envelope value, and the time interval between the envelope detection values is used as the abnormal signal detection indicator. This can accurately identify the echo morphological distortion caused by gas disturbances and reduce the probability of missed detection and misjudgment detection; the echo signal envelope is then partitioned according to the changing trend of the envelope value in the envelope and the position of the maximum envelope value. Independent partition detection schemes are adopted for different envelope sections, which effectively isolates the interference between signals in different sections and improves the feature extraction accuracy in the corresponding sections. Even in scenarios with noise interference, high detection accuracy can be guaranteed through targeted partition detection, achieving the technical effects of improving the adaptability of the detection method, improving the accuracy of the detection results, and expanding the applicable scenarios of the detection scheme.
[0091] Based on the above-mentioned ultrasonic flowmeter echo signal detection method provided in the embodiment of the present invention, the embodiment of the present invention also provides an ultrasonic flowmeter echo signal detection system, such as Figure 5 As shown, the echo signal detection system 500 of the ultrasonic flow meter includes:
[0092] The first detection unit 501 is used to obtain the envelope of the echo signal corresponding to the ultrasonic flowmeter, determine multiple envelope detection values through multiple preset ratios corresponding to the maximum envelope value in the envelope, calculate the first time interval between the signal nodes corresponding to each envelope detection value, and determine whether the overall shape of the envelope is abnormal based on the first time interval to obtain a first detection result.
[0093] The above provides a solution for overall detection of the overall envelope shape of the echo signal. Specifically, the envelope detection value is determined based on multiple preset ratios of the maximum envelope value, rather than using a fixed threshold, so that the detection value can be dynamically and adaptively adjusted with the signal strength. At the same time, the first time interval between the detection signal nodes corresponding to the envelope detection value is calculated, and the amplitude anomaly can be converted into anomaly in the time dimension. Based on this, the waveform distortion anomaly that cannot be identified by the static amplitude threshold detection scheme in the related technology can be accurately identified, thereby improving the adaptability and accuracy of echo signal detection.
[0094] In some embodiments, the first detection unit 501 is further used to: collect an echo signal through an analog-to-digital converter; wherein the echo signal is composed of multiple discrete sampling signal points; for any sampling signal point, determine a target sliding window including the current sampling signal point, perform an integration operation on the amplitudes of all sampling signal points in the target sliding window, and perform amplitude adjustment on the integration operation result according to a preset amplitude adjustment coefficient to obtain an envelope value of the current sampling signal point; wherein the length of the target sliding window is the length corresponding to one or more integer wave periods; traverse all sampling signal points in the echo signal, and execute the envelope value calculation step of the corresponding sampling signal point to obtain the envelope of the echo signal.
[0095] Based on the above settings, the length of the target sliding window is set to an integer multiple of the wave period, which can ensure that the window always covers the complete waveform unit, which helps to eliminate the envelope sawtooth phenomenon caused by the variable window; by summing the modulus values of all sampling points in the target sliding window (a form of integration operation), combined with the adjustment mechanism of the preset amplitude adjustment coefficient, the process of calculating the envelope value and extracting the echo signal envelope has good adaptability to echo signals with different frequencies and amplitude characteristics. It not only avoids the problems of complex and large calculations caused by traditional Hilbert transform or frequency domain filtering, but also is easy to implement.
[0096] In some embodiments, the first detection unit 501 is further configured to: select at least two preset ratios and corresponding preset time intervals; wherein the preset ratio is the amplitude ratio of the envelope value of the key characteristic wave node in the envelope relative to the maximum envelope value; and the preset time interval range is the time interval range between the key characteristic wave nodes; multiplying the maximum envelope value by each preset ratio to obtain at least the first envelope detection value and the second envelope detection value, and calculating the first time interval between the signal nodes corresponding to the first envelope detection value and the second envelope detection value, respectively; and determining whether the first time interval is within the preset time interval range. If so, determining that the overall shape of the envelope is normal; if not, determining that the overall shape of the envelope is abnormal.
[0097] The preset ratios and corresponding preset time intervals provided in this application are based on empirical values in different application scenarios, which can be referenced by historical data on normal echo signals. Because the preset ratios and corresponding preset time intervals dynamically adapt to different application scenarios, they can effectively reduce misjudgments caused by using fixed ratio settings. In some specific embodiments, a larger ratio value can be selected for high-frequency transducers to capture steep waveforms, while a smaller ratio value can be selected for low-frequency transducers to identify bandwidth distortion. The preset ratios selected based on actual application scenarios improve the accuracy of the extracted echo signal envelope and are applicable to a variety of scenarios.
[0098] The segment division unit 502 is configured to, if the first detection result is normal, divide the envelope into a main envelope segment and an auxiliary envelope segment based on a change trend of the envelope value and a position of a maximum envelope value in the envelope.
[0099] Based on the above settings, a partitioning logic consistent with the physical nature of ultrasonic propagation was constructed by taking into account the location of the maximum envelope value (a measurable physical parameter) and the envelope value variation trend (energy distribution pattern). By basing the partitioning on the continuous variation trend of the envelope value (such as the monotonic decreasing / increasing slope) rather than a fixed threshold, the system automatically adapts to the differences in attenuation rates caused by different media, accurately capturing the characteristic differences between the energy-concentrated and energy-dispersed regions of the echo signal. This allows for the partitioning of the system into a key segment (the main envelope segment) for time-of-flight calculation; a front auxiliary segment for transmitting circuit interference detection and early warning of medium anomalies; and a rear auxiliary segment for pipeline structure diagnosis and medium condition monitoring.
[0100] In some embodiments, the segment division unit 502 is further configured to: take the position of the maximum envelope value as a reference, and based on the changing trend of the envelope value in the envelope, search forward and / or backward along the time axis for a position where the envelope value continuously decreases to a preset envelope value threshold, thereby dividing the main envelope segment; divide the segment from the signal starting point to the starting point of the main envelope segment into a front auxiliary envelope segment, and divide the segment from the end point of the main envelope segment to the signal end point into a rear auxiliary envelope segment.
[0101] Based on the maximum envelope value, the starting point of the rising edge of the transmitted wave is accurately captured forward and the attenuation process of the reflected wave is completely included backward, ensuring the integrity of the key area used to calculate the flight time (i.e., the main envelope section).
[0102] The second detection unit 503 is used to extract the extreme value sequence in the main envelope segment, determine whether there is an amplitude anomaly in the main envelope segment based on the amplitude change characteristics corresponding to the extreme value sequence, and determine whether there is a periodic anomaly in the main envelope segment based on the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, to obtain a second detection result.
[0103] Based on the above setup, the amplitude variation characteristics corresponding to the extreme value sequence are used to determine whether there are amplitude anomalies within the main envelope segment. This system can automatically adapt to amplitude fluctuations caused by flow changes and accurately identify amplitude anomalies such as those caused by bubble interference. The distribution characteristics of the second time interval between adjacent extreme values corresponding to the extreme value sequence are used to determine whether there are periodic anomalies within the main envelope segment. This system can identify periodic anomalies such as those caused by transducer resonant frequency offset.
[0104] In some embodiments, the second detection unit 503 is further configured to: construct an amplitude ratio sequence of adjacent extreme values in the main envelope segment, extract the amplitude variation trend corresponding to the amplitude ratio sequence of adjacent extreme values, and determine that an amplitude anomaly exists if the amplitude growth between a pair of adjacent extreme values deviates from the overall amplitude variation trend of the preceding and succeeding multiple periods; and perform periodic fitting on the time intervals between adjacent extreme values, and determine that a periodic anomaly exists if the time interval between a certain pair of adjacent extreme values deviates from the periodic distribution of the main envelope segment.
[0105] Based on the above embodiments, a comprehensive trend analysis solution for the main envelope section is provided, which helps to improve the detection accuracy of the main envelope section and provides a signal basis for ensuring the measurement accuracy of the flight time.
[0106] In some embodiments, the second detection unit 503 is further configured to: determine whether there is an amplitude anomaly in the main envelope segment based on a first comparison result of the amplitude change characteristics corresponding to the extreme value sequence and a preset amplitude condition; wherein the preset amplitude condition is that the amplitude ratio of adjacent extreme values is within an amplitude ratio threshold range; adjacent extreme values include adjacent peak-peak values, adjacent peak-valley values, or adjacent valley-valley values; determine whether there is a periodic anomaly in the main envelope segment based on a second comparison result of the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence and a preset period condition; wherein the preset period condition is that the time interval between adjacent extreme values is within a time interval threshold range.
[0107] The system uses the amplitude ratio of adjacent extreme values (peak-to-valley / peak-to-peak / valley-to-valley) (rather than a fixed amplitude threshold) as the basis for determining whether the main envelope segment contains amplitude anomalies, resulting in strong interference resistance and adaptability. It also uses the distribution characteristics of the second time interval between adjacent extreme values (rather than a single point judgment) as the basis for determining whether the main envelope segment contains periodic anomalies, maintaining high detection accuracy even in noisy environments.
[0108] The third detection unit 504 is configured to extract the signal fluctuation characteristics in the auxiliary envelope segment, so as to determine whether there is abnormal fluctuation in the auxiliary envelope segment according to the signal fluctuation characteristics, and obtain a third detection result.
[0109] Two strategies are provided for the detection of auxiliary envelope segments: time domain detection and frequency detection. Time domain detection uses the cross-cycle envelope differential detection reflected in the time domain fluctuation characteristics, rather than single-cycle threshold judgment. This can eliminate steady-state noise and only capture real abnormal fluctuations. Frequency domain detection focuses on the energy characteristics of the high-frequency band and detects abnormal fluctuations such as sudden increase in high-frequency energy, frequency offset, and bandwidth expansion.
[0110] In some embodiments, the third detection unit 504 is further configured to calculate the envelope difference value between signal nodes at corresponding positions within adjacent detection cycles, so as to determine whether there is abnormal fluctuation in the auxiliary envelope segment based on the envelope difference value and a preset differential value threshold. In other embodiments, the third detection unit 504 is further configured to extract the frequency characteristic parameters, bandwidth characteristic parameters, and energy distribution characteristic parameters from the spectrum corresponding to the auxiliary envelope segment, and determine the presence of abnormal fluctuation if the proportion of high-frequency energy exceeds a preset proportion threshold, the signal bandwidth exceeds a preset bandwidth threshold, or the offset of the energy concentration frequency point exceeds a preset frequency deviation threshold. It should be noted that frequency domain detection is not only applicable to signal detection in the auxiliary envelope segment, but can also be applied to detection of the entire echo signal.
[0111] To address time-domain fluctuations, the system compares and calculates the envelope value differences of nodes at the same location within adjacent cycles. This offsets baseline fluctuations caused by fixed-frequency interference and ambient temperature, improving detection accuracy by reducing false positives. The preset differential threshold dynamically adapts to flow conditions (such as temperature and medium), selecting a lower differential threshold for low flow rates and a higher differential threshold for high flow rates to identify interference under various complex conditions. Regarding frequency-domain fluctuations, this system not only identifies abnormal fluctuations but also provides reference information for troubleshooting.
[0112] The echo signal detection system of the ultrasonic flowmeter provided in the embodiment of the present invention is configured to obtain the envelope of the echo signal corresponding to the ultrasonic flowmeter through a first detection unit, determine multiple envelope detection values through multiple preset ratios corresponding to the maximum envelope value in the envelope, calculate the first time interval between the signal nodes corresponding to each envelope detection value, and determine whether the overall shape of the envelope is abnormal based on the first time interval to obtain a first detection result; and the segment division unit is configured to, if the first detection result is normal, divide the envelope into segments based on the change trend of the envelope value in the envelope and the position of the maximum envelope value, and obtain the segments from the envelope. A main envelope segment and an auxiliary envelope segment; a second detection unit, used to extract the extreme value sequence in the main envelope segment, so as to judge whether there is an amplitude anomaly in the main envelope segment according to the amplitude change characteristics corresponding to the extreme value sequence, and to judge whether there is a periodic anomaly in the main envelope segment according to the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, to obtain a second detection result; a third detection unit, used to extract the signal fluctuation characteristics in the auxiliary envelope segment, so as to judge whether there is an abnormal fluctuation in the auxiliary envelope segment according to the signal fluctuation characteristics, to obtain a third detection result. A layered detection scheme is implemented by first performing overall detection and then performing partitioned detection. Detection based on the overall shape of the envelope can quickly detect and identify signal anomalies caused by more obvious abnormal interference or abnormal reflection, thereby improving detection efficiency. At the same time, in the overall detection process, the envelope detection value is determined by multiple preset ratios corresponding to the maximum envelope value, and the time interval between the envelope detection values is used as the abnormal feature detection indicator, which can accurately identify the echo morphological distortion caused by gas disturbances and reduce the probability of missed detection and misjudgment detection; the echo signal envelope is then partitioned according to the changing trend of the envelope value in the envelope and the position of the maximum envelope value. Independent partitioned detection schemes are adopted for different envelope sections, which effectively isolates the interference between signals in different sections and improves the feature extraction accuracy in the corresponding sections. Even in scenarios with noise interference, high detection accuracy can be guaranteed through targeted partitioned detection, achieving the technical effects of improving the adaptability of the detection method, improving the accuracy of the detection results, and expanding the applicable scenarios of the detection scheme.
[0113] An embodiment of the present invention further provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to enable the computer to execute the method of the present application.
[0114] An embodiment of the present invention further provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform the above-mentioned method of the present application. The computer program product should be understood as a software product that primarily implements the above-mentioned method of the present application through a computer program.
[0115] An embodiment of the present invention also provides an electronic device, comprising: at least one processor, and a memory storing a computer program that can be executed by the at least one processor, wherein the computer program includes instructions that, when executed by the processor, enable the processor to execute any of the above-mentioned echo signal detection methods for ultrasonic flow meters.
[0116] refer to Figure 6 , a block diagram of an electronic device that can serve as a server or client of an embodiment of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0117] like Figure 6 As shown, the electronic device includes a processor unit 601, which can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of processor unit 601 include, but are not limited to, an MCU, a CPU, a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing units, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. Processor unit 601 is used to perform the various methods and processes described above. For example, in some embodiments, method embodiments of the present invention may be implemented as a computer program tangibly embodied in a machine-readable medium, such as an external storage unit 607. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device via local storage unit 602 and / or communication unit 608. In some embodiments, processor unit 601 may be configured to perform the methods of the above embodiments by any other suitable means (e.g., via firmware).
[0118] Specifically, the processor unit 601 can perform various appropriate actions and processes based on a computer program stored in a local storage unit 602 (which can be a ROM storage unit or other device with storage capabilities) or a computer program loaded from an external storage unit 607 into the local storage unit 602 (such as random access memory (RAM)). The local storage unit 602 can also store various programs and data required for the operation of the electronic device. The processor unit 601 and the local storage unit 602 are connected to each other via a bus 603. An input / output (I / O) interface 604 is also connected to the bus 603.
[0119] Multiple components within the electronic device are connected to the I / O interface 604, including an input unit 605, an output unit 606, an external storage unit 607, and a communication unit 608. The input unit 605 can be any type of device capable of inputting information into the electronic device. The input unit 605 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 606 can be any type of device capable of presenting information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The external storage unit 607 may include, but is not limited to, a magnetic disk or an optical disk. The communication unit 608 allows the electronic device to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, and / or a wireless communication transceiver, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0120] The computer programs for implementing the methods of the embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0121] In the context of embodiments of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, or infrared system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0122] It should be noted that the term "including" and its variations used in the embodiments of the present invention are open-ended, i.e., "including but not limited to." The term "based on" means "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; and the term "some embodiments" means "at least some embodiments." The modifications of "one" and "a plurality of" mentioned in the embodiments of the present invention are illustrative and non-restrictive. Those skilled in the art should understand that, unless the context clearly indicates otherwise, they should be understood as "one or more."
[0123] The information and data involved in the embodiments of the present invention (including but not limited to information and data used for analysis, information and data stored, information and data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant information and data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0124] The various steps described in the method implementation scheme provided in the embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method implementation scheme may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.
[0125] The term "embodiment" in this specification refers to specific features, structures, or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments are referenced to each other. In particular, for the embodiments of the device, equipment, and system, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts are referred to the partial description of the method embodiment.
[0126] The above-described embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for detecting an echo signal of an ultrasonic flowmeter, characterized in that: include: Obtaining an envelope of an echo signal corresponding to the ultrasonic flowmeter, determining a plurality of envelope detection values based on a plurality of preset ratios corresponding to a maximum envelope value in the envelope, calculating a first time interval between signal nodes corresponding to each of the envelope detection values, and determining whether an overall shape of the envelope is abnormal based on the first time interval, thereby obtaining a first detection result; If the first detection result is normal, dividing the envelope into a main envelope section and an auxiliary envelope section based on a change trend of the envelope value and a position of a maximum envelope value in the envelope; Extracting an extreme value sequence from the main envelope segment, determining whether an amplitude anomaly exists in the main envelope segment based on amplitude variation characteristics corresponding to the extreme value sequence, and determining whether a periodic anomaly exists in the main envelope segment based on a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence, thereby obtaining a second detection result; For the auxiliary envelope section, a signal fluctuation feature in the auxiliary envelope section is extracted to determine whether abnormal fluctuation exists in the auxiliary envelope section according to the signal fluctuation feature, thereby obtaining a third detection result.
2. The method according to claim 1, characterized in that The step of obtaining the envelope of the echo signal corresponding to the ultrasonic flowmeter includes: The echo signal is collected by an analog-to-digital converter; wherein the echo signal is composed of a plurality of discrete sampling signal points; For any of the sampled signal points, a target sliding window including the current sampled signal point is determined, an integration operation is performed on the amplitudes of all the sampled signal points within the target sliding window, and an amplitude adjustment is performed on the integration operation result according to a preset amplitude adjustment coefficient to obtain an envelope value of the current sampled signal point; wherein the length of the target sliding window is a length corresponding to one or more integer wave periods; All sampling signal points in the echo signal are traversed, and an envelope value calculation step corresponding to the sampling signal points is performed to obtain the envelope of the echo signal.
3. The method according to claim 1, characterized in that The step of determining a plurality of envelope detection values by using a plurality of preset ratios corresponding to the maximum envelope value in the envelope, calculating a first time interval between signal nodes corresponding to each of the envelope detection values, and determining whether the overall shape of the envelope is abnormal based on the first time interval includes: Select at least two preset ratios and corresponding preset time intervals; wherein the preset ratio is the amplitude ratio of the envelope value of the key characteristic wave node in the envelope relative to the maximum envelope value; the preset time interval range is the time interval range between the key characteristic wave nodes; Multiplying the maximum envelope value by respective preset ratios to obtain at least a first envelope detection value and a second envelope detection value, and calculating a first time interval between signal nodes corresponding to the first envelope detection value and the second envelope detection value, respectively; It is determined whether the first time interval is within the preset time interval range. If so, it is determined that the overall shape of the envelope is normal; if not, it is determined that the overall shape of the envelope is abnormal.
4. The method according to claim 1, wherein The step of dividing the envelope into a main envelope section and an auxiliary envelope section based on a change trend of the envelope value and a position of a maximum envelope value in the envelope comprises: Taking the position of the maximum envelope value as a reference and based on the change trend of the envelope value in the envelope, searching forward and / or backward along the time axis for a position where the envelope value continuously decreases to a preset envelope value threshold, so as to obtain the main envelope segment; The section from the signal starting point to the starting point of the main envelope section is divided into a front auxiliary envelope section, and the section from the end point of the main envelope section to the signal ending point is divided into a rear auxiliary envelope section.
5. The method according to claim 1, wherein For the main envelope segment, the steps of extracting an extreme value sequence in the main envelope segment, judging whether an amplitude anomaly exists in the main envelope segment based on amplitude variation characteristics corresponding to the extreme value sequence, and judging whether a periodic anomaly exists in the main envelope segment based on a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence, include: Constructing an amplitude ratio sequence of adjacent extreme values in the main envelope segment, extracting the amplitude variation trend corresponding to the amplitude ratio sequence of adjacent extreme values, and determining that an amplitude anomaly exists if the amplitude growth between a pair of adjacent extreme values deviates from the overall amplitude variation trend of the preceding and following cycles; The time intervals between adjacent extreme values are periodically fitted. If the time interval between adjacent extreme values deviates from the periodic distribution of the main envelope segment, it is determined that there is a periodic anomaly.
6. The method according to claim 1, wherein For the main envelope segment, the step of determining whether there is an amplitude anomaly in the main envelope segment based on the amplitude change characteristics corresponding to the extreme value sequence, and determining whether there is a periodic anomaly in the main envelope segment based on the second time interval distribution characteristics between adjacent extreme values corresponding to the extreme value sequence, includes: Determining whether there is an amplitude anomaly in the main envelope segment based on a first comparison result of the amplitude variation characteristics corresponding to the extreme value sequence and a preset amplitude condition; wherein the preset amplitude condition is that the amplitude ratio of adjacent extreme values is within an amplitude ratio threshold range; the adjacent extreme values include adjacent peak-to-peak values, adjacent peak-to-valley values, or adjacent valley-to-valley values; Based on a second comparison result of a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence and a preset periodic condition, it is determined whether there is a periodic anomaly in the main envelope segment; wherein the preset periodic condition is that the time interval between adjacent extreme values is within a time interval threshold range.
7. The method according to claim 1, characterized in that The step of judging whether there is abnormal fluctuation in the auxiliary envelope section according to the signal fluctuation characteristics includes: The envelope difference value between the signal nodes at corresponding positions in adjacent detection cycles is calculated, so as to determine whether there is abnormal fluctuation in the auxiliary envelope section according to the envelope difference value and a preset difference value threshold.
8. An echo signal detection system for an ultrasonic flowmeter, characterized in that: include: a first detection unit, configured to obtain an envelope of an echo signal corresponding to the ultrasonic flowmeter, determine a plurality of envelope detection values based on a plurality of preset ratios corresponding to a maximum envelope value in the envelope, calculate a first time interval between signal nodes corresponding to each of the envelope detection values, determine whether an overall shape of the envelope is abnormal based on the first time interval, and obtain a first detection result; a segment division unit, configured to, if the first detection result is normal, divide the envelope into a main envelope segment and an auxiliary envelope segment based on a change trend of the envelope value and a position of a maximum envelope value in the envelope; a second detection unit configured to extract, for the main envelope segment, an extreme value sequence in the main envelope segment, determine whether an amplitude anomaly exists in the main envelope segment based on an amplitude variation characteristic corresponding to the extreme value sequence, and determine whether a periodic anomaly exists in the main envelope segment based on a second time interval distribution characteristic between adjacent extreme values corresponding to the extreme value sequence, thereby obtaining a second detection result; The third detection unit is used to extract the signal fluctuation characteristics in the auxiliary envelope segment, so as to determine whether there is abnormal fluctuation in the auxiliary envelope segment according to the signal fluctuation characteristics, and obtain a third detection result.
9. An electronic device comprising: A processor and a memory storing a program, wherein the program comprises instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory machine-readable medium storing computer instructions, characterized in that The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Ultrasonic flowmeter time difference stable measurement method based on envelope threshold-peak value method
CN113758543A
Ultrasonic flowmeter propagation time measuring method for moisture measurement
CN114252115A