Ultrasonic threshold determination method and device, electronic equipment and computer storage medium

By dividing the envelope of the ultrasonic echo signal into a detection window and sub-windows, dynamically determining the local threshold and combining it with mathematical morphology processing, the problems of poor adaptability and anti-interference of the fixed threshold detection method are solved, and the high robustness and accurate obstacle detection of ultrasonic radar are achieved.

CN121721618APending Publication Date: 2026-03-24辅易航智能科技(苏州)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing ultrasonic radar obstacle detection, the fixed threshold peak detection method is easily affected by factors such as ambient temperature, humidity, individual sensor differences, obstacle material and angle, etc., resulting in poor adaptability and anti-interference ability, and problems of missed detection and false alarm.

Method used

By dividing the target signal envelope of the ultrasonic echo signal into multiple detection windows and sub-windows, determining the local threshold based on the reference signal of each detection window, and combining mathematical morphology processing, the system dynamically adapts to changes in different background noise levels and signal strengths, thereby improving anti-interference capabilities.

Benefits of technology

It enables accurate identification of echo peaks in complex application scenarios, improves the robustness and accuracy of detection, and reduces missed detections and false alarms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121721618A_ABST
    Figure CN121721618A_ABST
Patent Text Reader

Abstract

The invention relates to an ultrasonic radar technology, and provides an ultrasonic threshold determination method and device, electronic equipment and a computer storage medium, and the method comprises the steps: obtaining a target signal envelope obtained through an ultrasonic echo signal; dividing the target signal envelope into a plurality of detection windows and dividing each detection window into a plurality of sub-windows, wherein each sub-window comprises a plurality of signal points in the target signal envelope; according to the reference signal of each detection window, a local threshold value of each detection window is determined, the reference signal of each detection window is a minimum value of reference signals of a plurality of sub-windows of the detection window, and the reference signal of each sub-window is a maximum value of a plurality of signal points of the sub-window; and determining a threshold curve of the ultrasonic echo signal according to all the local thresholds. According to the invention, peak value detection is carried out by using the dynamic threshold value curve generated by the local threshold value of the detection window, so that the adaptability and the anti-interference performance are improved, and the detection accuracy is also improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ultrasonic radar technology, and more specifically, to a method, apparatus, electronic device, and computer storage medium for determining ultrasonic thresholds. Background Technology

[0002] In obstacle detection using ultrasonic radar, the core step is to extract the echo pulse (i.e., envelope) representing the obstacle from the original time-domain echo signal, accurately locate its peak position, and then calculate the distance to the obstacle based on the peak position.

[0003] In existing technologies, the most common and typical approach is envelope detection combined with fixed threshold peak detection. This involves extracting the envelope of the ultrasonic echo signal to obtain an envelope line, and then setting a fixed amplitude threshold on that envelope line. The envelope line is then iterated through, and all local maxima exceeding the fixed threshold are identified as valid echo peaks; the corresponding time points are the round-trip times of the ultrasonic waves.

[0004] This fixed-threshold peak detection method is easily affected by factors such as ambient temperature, humidity, individual sensor differences, obstacle material and angle, etc., and has poor adaptability and anti-interference ability, resulting in missed detection and false alarm problems. Summary of the Invention

[0005] The purpose of this invention is to provide a method, apparatus, electronic device, and computer storage medium for determining ultrasonic thresholds.

[0006] The embodiments of the present invention can be implemented as follows: In a first aspect, the present invention provides a method for determining an ultrasonic threshold, the method comprising: Obtain the target signal envelope obtained from the ultrasonic echo signal; The target signal envelope is divided into multiple detection windows, and each detection window is further divided into multiple sub-windows, each sub-window including multiple signal points in the target signal envelope; Based on the reference signal of each detection window, a local threshold of each detection window is determined. The reference signal of each detection window is the minimum value of the reference signals of multiple sub-windows of the detection window, and the reference signal of each sub-window is the maximum value among multiple signal points of the sub-window. The threshold curve of the ultrasonic echo signal is determined based on all the local thresholds.

[0007] In an optional implementation, the step of determining the local threshold of each detection window based on the reference signal of each detection window includes: Based on the echo distance range corresponding to each detection window, determine the offset and scaling factor of each detection window; The reference signal of each detection window is scaled according to the scaling factor of each detection window to obtain the scaling value; The local threshold of each detection window is determined based on the scaling value and offset of each detection window.

[0008] In an optional implementation, the step of obtaining the target signal envelope from the ultrasonic echo signal includes: Acquire ultrasonic echo signals, wherein the ultrasonic echo signals include multiple sampling points; The ultrasonic echo signal is subjected to Hilbert transform to obtain an initial signal envelope characterizing the instantaneous amplitude change of the ultrasonic echo signal. The initial signal envelope includes an initial signal corresponding to each sampling point. Based on the length of the structuring element of each signal to be smoothed, smoothing is performed on each signal to be smoothed to obtain the target signal of each signal to be smoothed. Finally, the target signal envelope including all the target signals is obtained. The signal to be smoothed is an initial signal among a plurality of initial signals that contains other initial signals within a preset range. The length of the structuring element of the signal to be smoothed is determined based on the local signal characteristics of the signal within the preset range of the corresponding signal to be smoothed.

[0009] In an optional implementation, before smoothing each signal according to the length of its structuring element, the process includes: The upper and lower limits are determined based on the pre-set ultrasonic center frequency, pulse cycle number, sampling frequency, and extreme value factor. Calculate the local signal characteristics of each of the signals to be smoothed; The length of the structuring element of each signal to be smoothed is calculated based on the upper limit value, the lower limit value, and the local signal characteristics of each signal to be smoothed.

[0010] In an optional implementation, the signals within the preset range include the signal to be smoothed and an initial signal located before the signal to be smoothed and at a distance less than a preset distance from the signal to be smoothed. Each signal to be smoothed has a local variance, which is obtained by calculating the variance of the signals within the preset range corresponding to the signal to be smoothed. The step of calculating the local signal features of each of the signals to be smoothed includes: The local signal characteristics of each signal to be smoothed are calculated based on the local variance of each signal and the maximum value of all local variances.

[0011] In an optional implementation, the signals within the preset range include the signal to be smoothed and the next initial signal adjacent to the signal to be smoothed. Each signal to be smoothed has a gradient, which is calculated based on the gradient of the corresponding signal to be smoothed and the next initial signal adjacent to it. The step of calculating the local signal features of each of the signals to be smoothed includes: The local signal characteristics of each signal to be smoothed are calculated based on the gradient of each signal to be smoothed and the maximum value of all the gradients.

[0012] In an optional implementation, the step of smoothing each signal to be smoothed according to the length of the structuring element of each signal to be smoothed, to obtain the target signal of each signal to be smoothed, includes: Determine a smoothing threshold for each of the signals to be smoothed, the smoothing threshold including an opening threshold and a closing threshold, the smoothing threshold being obtained by quantizing the intensity of local signal changes in the signal to be smoothed; Based on the opening threshold and structuring element length of each signal to be smoothed, an opening operation is performed on each signal to be smoothed to obtain the opening operation result of each signal to be smoothed. Based on the closing threshold and structuring element length of each signal to be smoothed, a closing operation is performed on the opening operation result of each signal to be smoothed to obtain the target signal of each signal to be smoothed.

[0013] In an optional implementation, the target signal envelope includes multiple signal points, the threshold curve includes reference points corresponding one-to-one with the signal points, and the method further includes: For any reference peak point among multiple reference points, multiple target signal points in the target signal envelope are determined based on the reference peak point; The points corresponding to the multiple target signal points in the ultrasonic echo signal are curve fitted, and the peak position of the fitted curve is taken as the target peak point corresponding to the reference peak point, thus obtaining the target peak point corresponding to each reference peak point.

[0014] In an optional implementation, the step of determining multiple target signal points in the target signal envelope based on the reference peak point includes: Determine the reference position in the target signal envelope corresponding to the reference peak point; Each signal point that is greater than the reference peak point and is continuous within a preset neighborhood of the reference position is determined as a candidate signal point; The peak point among the multiple candidate signal points is taken as the candidate peak point, and the candidate peak point and a predetermined number of candidate signal points before and after it are taken as the target signal point.

[0015] In a second aspect, the present invention provides an ultrasonic threshold determining device, the device comprising: The acquisition module is used to acquire the target signal envelope obtained from the ultrasonic echo signal; The segmentation module is used to divide the target signal envelope into multiple detection windows and each detection window into multiple sub-windows, each sub-window including multiple signal points in the target signal envelope; The determining module is used to determine a local threshold for each detection window based on the reference signal of each detection window, wherein the reference signal of each detection window is the minimum value of the reference signals of multiple sub-windows of the detection window, and the reference signal of each sub-window is the maximum value among multiple signal points of the sub-window. The determining module is further configured to determine the threshold curve of the ultrasonic echo signal based on all the local thresholds.

[0016] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory being used to store a program, and the processor being used to implement the ultrasonic threshold determination method as described in any of the foregoing embodiments when executing the program.

[0017] Fourthly, the present invention provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the ultrasonic threshold determination method as described in any of the foregoing embodiments.

[0018] Compared with the prior art, the present invention has the following beneficial effects: This invention targets the target signal envelope obtained from ultrasonic echo signals. It divides the target signal envelope into multiple detection windows, and each detection window into multiple sub-windows. Based on the reference signal of each detection window, a local threshold is determined for each detection window. Finally, based on all local thresholds, a threshold curve for the ultrasonic echo signal is determined. By determining a corresponding local threshold for each detection window, the threshold in the threshold curve can dynamically adapt to changes in background noise levels and signal strength, improving anti-interference capability. Since the reference signal of a detection window is the minimum value among the reference signals of its multiple sub-windows, and the reference signal of each sub-window is the maximum value among the multiple signal points of that sub-window, the reference signal of the detection window can accurately reflect the basic signal level within the detection window, while avoiding false alarms and missed detections caused by inaccurate final threshold curves due to the dominance of individual strong signal points. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A flowchart of the ultrasonic threshold determination method provided in this embodiment.

[0021] Figure 2 This is an example diagram of the detection window and sub-windows provided in this embodiment.

[0022] Figure 3 This is an example diagram illustrating the target peak point determination process provided in this embodiment.

[0023] Figure 4 This is a comparison example of the threshold curve and ultrasonic echo signal provided in this embodiment.

[0024] Figure 5 This is an example diagram illustrating the entire peak detection process provided in this embodiment.

[0025] Figure 6 This is a block diagram illustrating the ultrasonic threshold determination device provided in this embodiment.

[0026] Figure 7 This is a block diagram of the electronic device provided in this embodiment.

[0027] Icons: 10-Electronic device; 11-Processor; 12-Memory; 13-Bus; 100-Ultrasonic threshold determination device; 110-Acquisition module; 120-Division module; 130-Determination module; 140-Detection module. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0029] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0030] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0031] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0032] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0033] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.

[0034] While peak detection using a fixed threshold is simple to implement, its performance often falls short of expectations in complex application scenarios. Specifically, it typically suffers from the following drawbacks: (1) Poor adaptability: Due to factors such as ambient temperature, humidity, individual sensor differences, obstacle material and angle, the echo amplitude can change drastically. When the echo is weak (such as at a distance or with absorbing material), the effective echo peak value may be lower than the fixed threshold, resulting in missed detection. In environments with high noise or multiple reflection paths, the small peak values ​​of noise or multiple reflections may exceed the fixed threshold, resulting in false alarms.

[0035] (2) Limited noise resistance: The envelope extracted by Hilbert transform is relatively sensitive to noise, and the envelope curve itself may not be smooth enough and has many spikes. This will make subsequent peak detection difficult and may easily misjudge noise spikes as peaks.

[0036] (3) Insufficient ability to distinguish overlapping echoes: When there are multiple obstacles that are close to each other, the echoes of different obstacles will overlap in the time domain. Fixed threshold and simple peak detection are difficult to effectively separate these overlapping echo envelopes, which may lead to multiple obstacles being misclassified as one, or secondary echoes that are covered by the main echo being undetected.

[0037] In view of this, this embodiment provides an ultrasonic threshold determination method, device, electronic device, and computer storage medium, which, by combining adaptive thresholding and mathematical morphology processing, can effectively suppress noise, smooth the envelope curve, and accurately identify the true echo peak value, and has high robustness and accuracy. It will be described in detail below.

[0038] Please refer to Figure 1 , Figure 1 A flowchart of the ultrasonic threshold determination method provided in this embodiment is shown. The method includes the following steps: Step S101: Obtain the target signal envelope obtained from the ultrasonic echo signal.

[0039] In this embodiment, the ultrasonic echo signal is obtained by preprocessing the acquired raw echo signal according to a preset acquisition frequency. Since the raw echo signal usually contains DC offset and broadband noise, the preprocessing typically includes two steps: First, the mean of the raw echo signal is calculated, and the DC component in the raw echo signal is removed by subtracting the mean signal. Then, the signal is filtered by a pre-designed bandpass filter to retain the effective echo components and suppress out-of-band noise. The passband frequency of the bandpass filter is typically ±20% of the ultrasonic center frequency.

[0040] In this embodiment, the target signal envelope is obtained by extracting the envelope of the ultrasonic echo signal and then smoothing the extracted envelope. By extracting the envelope and smoothing the envelope, local fluctuations can be suppressed and key feature peaks can be preserved, so that the shape of the target signal envelope can reflect the change law of the ultrasonic echo signal energy with time or distance, and thus characterize the instantaneous amplitude change trend of the ultrasonic echo signal.

[0041] Step S102: Divide the target signal envelope into multiple detection windows and divide each detection window into multiple sub-windows. Each sub-window includes multiple signal points in the target signal envelope.

[0042] In this embodiment, the parameters for dividing the detection window and sub-windows can be configured based on the sampling frequency, ultrasonic propagation speed, and characteristics of the medium under test, thereby ensuring that the signals within each window have reasonable statistical representativeness. The detection windows can overlap or not overlap. For relatively stable signals with fluctuation amplitudes less than the lower limit of a preset threshold, non-overlapping windows are selected for division; while for signals with large fluctuation amplitudes greater than the upper limit of a preset threshold, partially overlapping windows can provide higher signal response capability. As a specific implementation, the detection window size can be the same, and the sub-window size can also be the same.

[0043] Step S103: Determine the local threshold of each detection window based on the reference signal of each detection window. The reference signal of each detection window is the minimum value of the reference signals of multiple sub-windows of the detection window, and the reference signal of each sub-window is the maximum value among multiple signal points of the sub-window.

[0044] In this embodiment, each detection window covers a portion of the signal points among multiple signal points in the target signal envelope. Each detection window is divided into multiple sub-windows, and each sub-window covers a portion of the signal points within the detection window. The maximum signal value of a signal point within a sub-window is the reference signal of that sub-window, and the minimum reference signal value of a sub-window within the detection window is the reference signal of that detection window. Please refer to... Figure 2 , Figure 2 This is an example diagram of the detection window and sub-windows provided in this embodiment. Figure 2 In the diagram, the detection window is divided into m sub-windows, each sub-window containing n signal points, and the reference signals for sub-windows 1 to m are respectively... Figure 2 In the formula, max_1, max_2, ..., max_m, max_1 represents the maximum value of signal points 1 to n in the first sub-window, max_2 represents the maximum value of signal points n+1 to 2n in the second sub-window, and the reference signals for the remaining sub-windows are similar. The reference signal for the detection window is the minimum value among max_1 to max_m.

[0045] In this embodiment, the purpose of determining the reference signal for the detection window is as follows: If there is a very strong target within a detection window, the maximum values ​​of some sub-windows within that window will be very high. This embodiment takes the minimum value among these maximum values, so the strong target will not directly push up the entire threshold (because the minimum value is taken, the maximum value of the sub-window containing the strong target is avoided, unless every sub-window contains a strong target). Thus, the threshold will not become excessively high due to a strong target, thereby avoiding missing weak targets nearby. If there is no strong target within a detection window, the maximum value of each sub-window will be relatively low, and the reference signal of the detection window obtained after taking the minimum value will also be low, resulting in a lower threshold and enabling the detection of weak targets. However, if the signal within a detection window is very weak, the reference signal of the detection window will be very small, possibly even approaching noise levels. By taking the maximum value of a sub-window and then the minimum value within that sub-window, the influence of strong targets or noise spikes on the threshold is avoided, while also adapting to overall signal variations.

[0046] Step S104: Determine the threshold curve of the ultrasonic echo signal based on all local thresholds.

[0047] In this embodiment, the local thresholds of all detection windows are integrated to form a continuous or segmented continuous curve, namely the threshold curve of the ultrasonic echo signal. The threshold curve extends along the time axis of the target signal envelope, and the value at each position represents the decision boundary for determining whether the signal is valid at the corresponding point. Since each local threshold is calculated based on local statistical characteristics within its own independent detection window, the entire threshold curve can dynamically respond to spatial changes in signal intensity, making it particularly suitable for application scenarios where there are significant differences in echo energy between near and far targets. As a specific implementation method, adjacent local thresholds can be connected by linear interpolation or other smoothing algorithms to eliminate abrupt changes and ensure the continuity of the curve.

[0048] The method provided in this embodiment, since the reference signal of the detection window is the minimum value among the reference signals of its multiple sub-windows, and the reference signal of each sub-window is the maximum value among the multiple signal points of that sub-window, enables the reference signal of the detection window to accurately reflect the basic level of the signal within the detection window, while avoiding false alarms and missed detections caused by the inaccuracy of the final threshold curve due to the dominance of individual strong signal points. By determining a corresponding local threshold for each detection window, the threshold in the threshold curve can dynamically adapt to changes in different background noise levels and signal strengths, thereby improving the anti-interference capability.

[0049] In an optional implementation, as the propagation distance increases, the energy of the ultrasonic echo signal gradually weakens due to factors such as medium attenuation and diffusion loss, resulting in a significantly lower echo amplitude in the far-distance region compared to the near-distance region. If a uniform threshold generation mechanism is applied to all detection windows without considering this distance-dependent energy distribution characteristic, excessive false alarms may occur in the near field, while missed detections may occur in the far field. Therefore, this embodiment provides a method for calculating the local threshold of the detection window: First, based on the echo distance range corresponding to each detection window, determine the offset and scaling factor of each detection window; In this embodiment, the scaling factor determines the ratio of the local threshold of the detection window to its reference signal. A scaling factor greater than 1 results in a local threshold higher than the reference signal, thereby avoiding the detection of noise or small fluctuations near the reference signal as targets. A larger scaling factor leads to a higher local threshold, more stringent detection, which increases the false alarm rate and decreases the false alarm rate.

[0050] In this embodiment, the offset determines the minimum value of the local threshold of the detection window. This ensures that even if the local threshold of the detection window is very small (e.g., in a region with a weak signal), the local threshold will not fall below the offset, thereby preventing noise from being detected due to excessively low local thresholds in the low-signal detection window. The offset can be set according to the noise level.

[0051] In this embodiment, the farther the ultrasonic signal propagates, the weaker its echo signal strength, and the noise may become relatively more significant. Therefore, for targets at greater distances, the echo signal strength is weaker, requiring an increased scaling factor to enhance the echo signal response, while the offset needs to be appropriately adjusted based on the attenuation characteristics of the echo signal. To set reasonable scaling factors and offsets for each detection window, this embodiment analyzed the relationship between scaling factor and distance, and the relationship between offset and distance, respectively. It was found that the relationship between scaling factor and distance mainly affects echo signal attenuation. Ultrasonic signals are attenuated when propagating in air, and the degree of attenuation is usually inversely proportional to the square of the distance. The greater the distance, the more severe the signal attenuation, and the weaker the echo signal strength. To compensate for this attenuation, the scaling factor can be dynamically adjusted according to the distance. For targets at close range, due to the higher signal strength, the scaling factor can be appropriately reduced. For targets at greater distances, the scaling factor can be increased to enhance the signal response to weak echoes. The relationship between offset and distance primarily affects the noise level. As the target distance increases, the intensity of the echo signal attenuates, and background noise (including environmental noise or noise from the ultrasonic radar itself) may become more prominent. To avoid noise affecting the detection results, the offset can be dynamically adjusted according to the distance. For close-range targets, the noise is relatively small, so the offset can be set appropriately small. For distant targets, the noise may be more significant, and the offset needs to be increased to ensure that the noise does not interfere with peak detection.

[0052] One approach is to divide the target distance into different ranges (e.g., near, medium, and far), using different scaling factors and offsets within each range. For example: near distance (0-40cm): smaller scaling factor, smaller offset; medium distance (40-100cm): moderate scaling factor, moderate offset; far distance (above 100cm): larger scaling factor, larger offset. By dividing the distance into different ranges and applying the appropriate offset and scaling factor to each detection window's corresponding range, more accurate peak detection can be achieved.

[0053] Secondly, the reference signal of each detection window is scaled according to the scaling factor of each detection window to obtain the scaling value; Finally, the local threshold for each detection window is determined based on the scaling value and offset of each detection window.

[0054] In this embodiment, for any detection window, its local threshold can be calculated using the formula Threshold=max(offset, min_val×scale), where Threshold is the local threshold of the detection window, max is the maximum value function, offset, min_val and scale are the offset of the detection window, the reference signal and the scaling factor, respectively.

[0055] In an optional implementation, in order to achieve more accurate envelope reconstruction of the ultrasonic echo signal and obtain a more representative target signal envelope, this embodiment provides a method for obtaining the target signal envelope: First, the ultrasonic echo signal is acquired, which includes multiple sampling points; In this embodiment, each sampling point corresponds to a voltage amplitude, reflecting the change in reflection intensity when the ultrasonic wave encounters different medium interfaces along the propagation path.

[0056] Secondly, a Hilbert transform is performed on the ultrasonic echo signal to obtain an initial signal envelope characterizing the instantaneous amplitude change of the ultrasonic echo signal. The initial signal envelope includes an initial signal corresponding to each sampling point. In this embodiment, the Hilbert transform is a classic signal analysis tool that can convert a time-domain signal in the real number domain into its corresponding analytic signal, thereby extracting instantaneous amplitude information. Using the Hilbert transform, an initial signal envelope that better reflects the envelope shape of the echo energy of the ultrasonic echo signal can be obtained.

[0057] Finally, based on the length of the structuring element of each signal to be smoothed, smoothing is performed on each signal to be smoothed to obtain the target signal of each signal to be smoothed. Finally, the target signal envelope including all target signals is obtained. The signal to be smoothed is an initial signal among multiple initial signals that contains other initial signals within a preset range. The length of the structuring element of the signal to be smoothed is determined based on the local signal characteristics of the signal within the preset range of the corresponding signal to be smoothed, which determines the range and intensity of the smoothing process.

[0058] In this embodiment, although the initial signal envelope can reflect the overall contour of the signal well, in practical applications, due to system noise, stray reflections, or electronic interference, some areas may exhibit local spikes or abnormal peaks, resulting in an insufficiently smooth envelope and affecting the accuracy of subsequent feature extraction. To simplify implementation and avoid significantly impacting the final detection results, it is not necessary to smooth all initial signals; only the signals to be smoothed can be processed. To ensure that the smoothing process for each signal to be smoothed considers the characteristics of the signal within its preset range, making the smoothing process more reasonable and targeted, each signal to be smoothed has a preset structuring element length. This structuring element length is determined based on the local signal characteristics of the signal within its preset range. For example, a smaller structuring element length is used in edge regions where the signal changes drastically to preserve details, while a larger structuring element length is used in flat or high-frequency oscillating regions to enhance the denoising effect, thereby achieving spatially adaptive nonlinear filtering.

[0059] In an optional implementation, to make the length of the structuring element of each signal to be smoothed more reasonable and improve the smoothing effect, this embodiment provides a method for determining the length of the structuring element of the signal to be smoothed: First, the upper and lower limits are determined based on the pre-set ultrasonic center frequency, pulse cycle number, sampling frequency, and extreme value factor. In this embodiment, the ultrasonic center frequency, pulse cycle count, and sampling frequency can be preset according to the actual application scenario. The extreme value factors include a maximum factor and a minimum factor, which can be empirical values ​​determined based on historical data or engineer experience. For example, the maximum factor is set to 0.8, and the minimum factor is set to 0.2. As one implementation method, the upper and lower limits can be calculated using the following formula: ,

[0060] in, This is the lower limit value. The upper limit is 0.2, the minimum factor is 0.2, and the maximum factor is 0.8. , The number of pulse cycles. Sampling frequency, The center frequency of the ultrasound wave is defined. The lower limit is used to prevent over-processing from causing the loss of edge details, while the upper limit is used to prevent the processing from being too weak to effectively suppress dense noise. Together, they constitute the reasonable boundary for the length of the structural element.

[0061] Secondly, calculate the local signal characteristics of each signal to be smoothed; In this embodiment, the local signal feature is a quantitative representation of the signal fluctuation characteristics within a preset range of the signal to be smoothed, reflecting whether the preset range is in different states such as a flat region, a transition edge, or a high-frequency oscillation region.

[0062] In this embodiment, local signal features can be calculated using the variance or gradient of the signal within a preset range. This embodiment provides two implementation methods for calculating local feature signals: Method 1: Variance Method In the variance-based method, the signals within the preset range include the signal to be smoothed and all initial signals located before the signal to be smoothed and at a distance less than the preset distance. Each signal to be smoothed has a local variance, which is calculated by performing variance calculations on the signals within the preset range corresponding to the signal to be smoothed. For example, if the initial signals include 10 signals: s1~s10, and the preset distance is 6, then for s1, there are no signals within its preset range, so s1 is not a signal to be smoothed and does not require smoothing. For s2, the signal within its preset range is s1, so the local variance of s2 is obtained by performing variance calculations on s1 and s2. For s3, the signals within its preset range are s1 and s2, so the local variance of s3 is obtained by performing variance calculations on s1~s3. For s6, the signals within its preset range are s2~s6, so the local variance of s6 is obtained by performing variance calculations on s2~s6. The calculation method for the local variances of the other initial signals is similar.

[0063] The variance-based method for calculating the local signal characteristics of each signal to be smoothed is as follows: The local signal characteristics of each signal to be smoothed are calculated based on the local variance of each signal and the maximum value of all local variances.

[0064] As one implementation method, the local signal characteristics of the signal to be smoothed can be calculated using the following formula: Where x represents the x-th signal to be smoothed. For the local signal characteristics of x, Let x be the local variance. This represents the maximum value of all local variances.

[0065] Method 2: Gradient Approach In the gradient method, the signals within the preset range include the signal to be smoothed and the next initial signal adjacent to it. Each signal to be smoothed has a gradient, which is calculated based on the corresponding signal to be smoothed and its next adjacent initial signal. For example, the initial signals include 10 signals: s1~s10. The gradient of s1 is calculated based on the gradients of s1 and s2, the gradient of s2 is calculated based on the gradients of s2 and s3, and s10 does not have a next initial signal. Therefore, as one implementation, s10 is not considered as the signal to be smoothed and does not require smoothing. Another implementation is to add a preset value to s10 and use the preset value and s10 to calculate the gradient of s10. The calculation method for the local variance of the other initial signals is similar.

[0066] The gradient approach calculates the local signal features of each signal to be smoothed as follows: Based on the gradient of each signal to be smoothed and the maximum value of all gradients, calculate the local signal characteristics of each signal to be smoothed.

[0067] As one implementation method, the local signal characteristics of the signal to be smoothed can be calculated using the following formula: ,in, This represents the gradient of the x-th signal to be smoothed. For the local signal characteristics of x, This is the maximum value of all gradients. To simplify the calculation, it can also be calculated as follows: : ,in, Let x be the signal value of the x-th signal to be smoothed. Let x be the signal value of the (x+1)th signal to be smoothed.

[0068] Finally, based on the upper limit, lower limit, and local signal characteristics of each signal to be smoothed, the length of the structuring element of each signal to be smoothed is calculated.

[0069] In this embodiment, the local signal features can be either variance or gradient. For variance, the formula for calculating the length of the structuring element of the signal x to be smoothed can be:

[0070] in, Let x be the length of the structuring element of the signal to be smoothed. and These are the lower limit and the upper limit, respectively. Let x be the local signal characteristics of the signal to be smoothed.

[0071] For gradients, the formula for calculating the length of the structuring element of the signal x to be smoothed can be: ,in, Let x be the length of the structuring element of the signal to be smoothed. and These are the lower limit and the upper limit, respectively. Let x be the local signal characteristics of the signal to be smoothed.

[0072] In optional implementations, spike noise and fine glitches on the initial signal envelope are precisely filtered out, preventing noise from being misjudged as peaks and maintaining the macroscopic shape of the initial signal envelope. This avoids peak position shifts or envelope distortion that may be caused by traditional low-pass filtering. This embodiment also utilizes morphological filtering for smoothing, and a specific implementation method is as follows: First, determine the smoothing threshold for each signal to be smoothed. The smoothing threshold includes an opening threshold and a closing threshold. The smoothing threshold is obtained by quantizing the intensity of local signal changes in the signal to be smoothed. In this embodiment, the opening threshold can be determined based on the local standard deviation or positive curvature of the signal to be smoothed and its neighboring signals. The opening threshold is applied to the opening operation. The opening threshold can be determined based on the minimum value or negative curvature of the signal to be smoothed and its neighboring signals. The closing threshold is applied to the closing operation.

[0073] Secondly, based on the opening threshold and the length of the structuring element of each signal to be smoothed, an opening operation is performed on each signal to be smoothed to obtain the opening operation result of each signal to be smoothed. In this embodiment, opening is a fundamental operation in mathematical morphology, typically defined as a process of erosion followed by dilation, aimed at eliminating glitches while avoiding excessive peak clipping. For the signal x to be smoothed, the specific steps of the adaptive opening operation include: Step 1: Adaptive Erosion ,in, As a result of corrosion, The signal value of the signal x to be smoothed Let x be the length of the structuring element of the signal to be smoothed. This indicates a corrosion operation.

[0074] Step 2: Calculate corrosion depth and determine conditions The corrosion depth of x is calculated, which reflects the likelihood that point x is an "isolated burr". ,in, Let x be the corrosion depth.

[0075] The conditional judgment rules are set as follows: , in, Let x be the opening threshold. The conditional judgment rule for x.

[0076] Step 3: Generate conditional output

[0077] if Then keep ,if Then keep .

[0078] Step 4: Adaptive dilation to restore shape ,in, Let x be the expanded value. This indicates an expansion operation.

[0079] Step 5: Output of adaptive opening operation for: .

[0080] Finally, based on the closing threshold and structuring element length of each signal to be smoothed, the opening operation result of each signal to be smoothed is subjected to a closing operation to obtain the target signal of each signal to be smoothed.

[0081] In this embodiment, the purpose of the closing operation is to fill holes and avoid over-filling valleys. For the signal x to be smoothed, the specific steps of the adaptive closing operation include: Step 1: Adaptively expand the result of the opening operation. ,in, It is the result of adaptive expansion of the result of the opening operation.

[0082] Step 2: Calculate the expansion height and determine the conditions. Calculate the expansion height of x, which reflects the likelihood of that point being an isolated void.

[0083]

[0084] in, Let x be the expansion height.

[0085] The conditional judgment rules are set as follows: , in, Let x be the closing threshold. The conditional judgment rule for x.

[0086] Step 3: Generate conditional output

[0087] if Then keep ,if Then keep .

[0088] Step 4: Adaptive erosion to restore shape ,in, Let x be the eroded area. Erosion is used to restore the shape of those areas that were identified as signals but were over-lifted during expansion.

[0089] Step 5: Output of adaptive closing operation for: .

[0090] In an optional implementation, the target signal envelope includes multiple signal points, and the threshold curve includes reference points corresponding one-to-one with each signal point. The peak value of the signal point and the peak value of the reference point may be offset. To effectively mitigate the peak offset problem caused by noise interference and sampling discretization, thereby improving the stability and accuracy of ultrasonic signal processing, this embodiment also provides a method for detecting peak points based on the threshold curve: First, for any reference peak point among multiple reference points, multiple target signal points in the target signal envelope are determined based on the reference peak point; In this embodiment, the reference peak point, as a reference point with local maxima on the threshold curve, represents the dynamic discrimination benchmark strength set by the system at a specific time or distance. Specifically, by identifying the coordinate position of a reference peak point on the time axis and defining a preset neighborhood centered on it, continuous signal points located within the target signal envelope and with amplitudes greater than the reference peak point are selected within this neighborhood; these continuous signal points are then used as target signal points.

[0091] In this embodiment, the target signal envelope can be compared point by point with the threshold curve. Therefore, for each reference point, signal points on the target signal envelope that satisfy the condition of being greater than the reference point constitute a potential peak region. For each potential peak region, the position of the maximum value within the potential peak region is found as a candidate signal point. The target signal point is determined near the candidate peak point. Specifically, this can be implemented as follows: (1) Determine the reference position in the envelope of the target signal corresponding to the reference peak point; (2) Each signal point that is greater than the reference peak point and is continuous within a preset neighborhood of the reference position is determined as a candidate signal point; (3) Take the peak point among multiple candidate signal points as the candidate peak point, and take the candidate peak point and the preset number of candidate signal points before and after it as the target signal point.

[0092] Secondly, curve fitting is performed on the points corresponding to multiple target signal points in the ultrasonic echo signal, and the peak position of the fitted curve in the ultrasonic echo signal is taken as the target peak point corresponding to the reference peak point, thus obtaining the target peak point corresponding to each reference peak point.

[0093] In this embodiment, the signal value of a point corresponding to any time point near a sampling point in the ultrasonic echo signal can be obtained through difference calculation based on the sampling points in the ultrasonic echo signal. Using the points corresponding to multiple target signal points in the ultrasonic echo signal as input data, a continuous and smooth function curve is constructed using a curve fitting algorithm. This curve approximates the variation trend of the ultrasonic echo signal within a local region. Common fitting methods include, but are not limited to, quadratic polynomial fitting, Gaussian function fitting, or other regression methods suitable for pulse signals. Subsequently, by determining the location of the extreme points of the fitted curve, the signal point on the ultrasonic echo signal corresponding to the location of the extreme point is taken as the target peak point. For example, taking the quadratic polynomial fitting of the parabola equation as an example, the fitted parabola equation is: The precise location corresponding to the peak value for: ,in, As candidate peak points, The target peak point is the reference peak point.

[0094] In this embodiment, to more clearly illustrate the process of determining the location of the target peak point, please refer to... Figure 3 , Figure 3 This is an example diagram illustrating the target peak point determination process provided in this embodiment. Figure 3 In the diagram, the horizontal axis represents time, the vertical axis represents signal energy, the blue line represents the ultrasonic echo signal, the red line represents the target signal envelope, the green dashed line represents the threshold curve, the gray area represents the potential peak area (the preset area mentioned above), "×" represents candidate peak points (different colors of "×" indicate different locations), solid circles represent target signal points (different colors of solid circles indicate different locations), and pentagrams represent target peak points (different colors of pentagrams indicate different locations). Figure 3 As can be seen, there is a deviation between the peak point of the threshold curve and the peak point of the ultrasonic echo signal. The method provided in this embodiment can find a more accurate target peak point. Please refer to... Figure 4 , Figure 4 This is a comparison example of the threshold curve and ultrasonic echo signal provided in this embodiment. Figure 4 In the diagram, the horizontal axis represents the time axis in milliseconds (ms), the vertical axis represents the energy axis in units of energy (µs), the blue line represents the ultrasonic echo signal, the orange line represents the threshold curve, and the red dots represent the target peak points.

[0095] In this embodiment, to illustrate the entire process of peak detection from a holistic perspective, please refer to [reference needed]. Figure 5 , Figure 5 This is an example diagram illustrating the entire peak detection process provided in this embodiment. Figure 5 In this context, the processing of any original echo signal includes the following stages: (1) Pretreatment stage This includes, but is not limited to, removing the DC component from the original echo signal and performing filtering.

[0096] (2) Envelope extraction stage The preprocessed original echo signal is subjected to Hilbert transform to obtain its analytic signal, and the modulus of the analytic signal is calculated to obtain the initial envelope.

[0097] (3) Morphological filtering stage This involves first performing an opening operation on the initial envelope using a pre-determined structuring element length, and then performing a closing operation on the result of the opening operation to obtain a smoothed envelope after smoothing.

[0098] (4) Adaptive threshold extraction stage This involves dividing the smooth envelope into multiple detection windows, each detection window into multiple sub-windows, determining the local threshold for each detection window, and finally obtaining the threshold curve.

[0099] (5) Peak detection and verification stage This includes identifying the target peak point in the preprocessed original echo signal and verifying the reasonableness of the target peak point.

[0100] (6) Output Results Stage The target peak point after successful verification is output as the detection result, and target detection is performed based on the target peak point in the detection result.

[0101] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation of the ultrasonic threshold determination device 100 is given below. Please refer to... Figure 6 , Figure 6 This is a block diagram of the ultrasonic threshold determination device provided in this embodiment. It should be noted that the ultrasonic threshold determination device 100 provided by the present invention has the same basic principle and technical effect as the corresponding embodiment described above. For the sake of brevity, it is not mentioned in this embodiment.

[0102] The ultrasonic threshold determination device 100 includes an acquisition module 110, a division module 120, and a determination module 130.

[0103] The acquisition module 110 is used to acquire the target signal envelope obtained from the ultrasonic echo signal; The segmentation module 120 is used to divide the target signal envelope into multiple detection windows and each detection window into multiple sub-windows, each sub-window including multiple signal points in the target signal envelope; The determining module 130 is used to determine the local threshold of each detection window based on the reference signal of each detection window. The reference signal of each detection window is the minimum value of the reference signals of multiple sub-windows of the detection window, and the reference signal of each sub-window is the maximum value among multiple signal points of the sub-window. The determination module 130 is also used to determine the threshold curve of the ultrasonic echo signal based on all local thresholds.

[0104] In an optional implementation, the determining module 130 is specifically used for: Based on the echo distance range corresponding to each detection window, determine the offset and scaling factor of each detection window; The reference signal of each detection window is scaled according to the scaling factor of each detection window to obtain the scaling value; The local threshold for each detection window is determined based on the scaling value and offset of each detection window.

[0105] In an optional implementation, the acquisition module 110 is specifically used for: Acquire ultrasonic echo signals, which include multiple sampling points; Perform a Hilbert transform on the ultrasonic echo signal to obtain an initial signal envelope characterizing the instantaneous amplitude change of the ultrasonic echo signal. The initial signal envelope includes an initial signal corresponding to each sampling point. Based on the length of the structuring element of each signal to be smoothed, smoothing is performed on each signal to be smoothed to obtain the target signal of each signal to be smoothed. Finally, the target signal envelope including all target signals is obtained. The signal to be smoothed is an initial signal among multiple initial signals that contains other initial signals within a preset range. The length of the structuring element of the signal to be smoothed is determined based on the local signal characteristics of the signal within the preset range of the corresponding signal to be smoothed.

[0106] In an optional implementation, the acquisition module 110 is further configured to: The upper and lower limits are determined based on the pre-set ultrasonic center frequency, pulse cycle number, sampling frequency, and extreme value factor. Calculate the local signal characteristics of each signal to be smoothed; Calculate the length of the structuring element for each signal to be smoothed based on the upper limit, lower limit, and local signal characteristics of each signal.

[0107] In an optional implementation, the signals within the preset range include the signal to be smoothed and an initial signal located before the signal to be smoothed and at a distance less than the preset distance from the signal to be smoothed. Each signal to be smoothed has a local variance, which is obtained by calculating the variance of the signals within the preset range corresponding to the signal to be smoothed. The acquisition module 110 is specifically used to calculate the local signal characteristics of each signal to be smoothed in the following ways: The local signal characteristics of each signal to be smoothed are calculated based on the local variance of each signal and the maximum value of all local variances.

[0108] In an optional implementation, the signals within the preset range include the signal to be smoothed and the next initial signal adjacent to the signal to be smoothed. Each signal to be smoothed has a gradient, which is calculated based on the gradient of the corresponding signal to be smoothed and the next initial signal adjacent to it. The acquisition module 110 is specifically used to calculate the local signal characteristics of each signal to be smoothed in the following ways: Based on the gradient of each signal to be smoothed and the maximum value of all gradients, calculate the local signal characteristics of each signal to be smoothed.

[0109] In an optional implementation, when the acquisition module 110 is specifically used to smooth each signal to be smoothed according to the length of the structural element of each signal to be smoothed, and to obtain the target signal of each signal to be smoothed, it is further used to: Determine the smoothing threshold for each signal to be smoothed. The smoothing threshold includes an opening threshold and a closing threshold. The smoothing threshold is obtained by quantizing the intensity of local signal changes in the signal to be smoothed. Based on the opening threshold and structuring element length of each signal to be smoothed, an opening operation is performed on each signal to be smoothed to obtain the opening operation result of each signal to be smoothed. Based on the closing threshold and structuring element length of each signal to be smoothed, the closing operation is performed on the opening operation result of each signal to be smoothed to obtain the target signal of each signal to be smoothed.

[0110] In an optional implementation, the target signal envelope includes multiple signal points, the threshold curve includes reference points corresponding one-to-one with the signal points, and the ultrasonic threshold determination device 100 further includes a detection module 140, which is used for: For any reference peak point among multiple reference points, multiple target signal points in the target signal envelope are determined based on the reference peak point; Curve fitting is performed on the points corresponding to multiple target signal points in the ultrasonic echo signal, and the peak position of the fitted curve is taken as the target peak point corresponding to the reference peak point in the ultrasonic echo signal. Finally, the target peak point corresponding to each reference peak point is obtained.

[0111] In an optional implementation, the detection module 140, when determining multiple target signal points in the target signal envelope based on the reference peak point, is further configured to: Determine the reference position in the target signal envelope corresponding to the reference peak point; Each signal point that is greater than the reference peak point and is continuous within a preset neighborhood of the reference position is identified as a candidate signal point. The peak point among multiple candidate signal points is taken as the candidate peak point, and the candidate peak point and a preset number of candidate signal points before and after it are taken as the target signal point.

[0112] This invention also provides a block diagram of an electronic device 10, which implements the ultrasonic threshold determination method described in the foregoing embodiments. Please refer to... Figure 7 , Figure 7 This is a block diagram of the electronic device 10 provided in this embodiment. The electronic device 10 includes a processor 11, a memory 12 and a bus 13. The processor 11 and the memory 12 are connected through the bus 13.

[0113] The processor 11 can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the ultrasonic threshold determination method described in the above embodiments can be completed by the integrated logic circuitry in the hardware of the processor 11 or by software instructions. The processor 11 can be a general-purpose processor, including a CPU (Central Processing Unit), NP (Network Processor), GPU (Graphics Processing Unit), etc.; it can also be a DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Logic Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0114] The memory 12 is used to store the program for implementing the ultrasonic threshold determination method. The program may be a software function module stored in the memory 12 in the form of software or firmware or embedded in the OS (Operating System) of the electronic device 10.

[0115] After receiving the execution instruction, the processor 11 executes the program to implement the ultrasonic threshold determination method of the aforementioned embodiment.

[0116] This embodiment provides a computer storage medium storing a computer program that, when executed by a processor, implements the ultrasonic threshold determination method as described in this embodiment.

[0117] In summary, embodiments of the present invention provide an ultrasonic threshold determination method, apparatus, electronic device, and computer storage medium. The method includes: acquiring a target signal envelope obtained from an ultrasonic echo signal; dividing the target signal envelope into multiple detection windows and further dividing each detection window into multiple sub-windows, each sub-window including multiple signal points in the target signal envelope; determining a local threshold for each detection window based on a reference signal of each detection window, wherein the reference signal of each detection window is the minimum value of the reference signals of the multiple sub-windows of that detection window, and the reference signal of each sub-window is the maximum value among the multiple signal points of that sub-window; and determining a threshold curve of the ultrasonic echo signal based on all local thresholds. Compared with the prior art, this embodiment has at least the following advantages: (1) By determining the corresponding local threshold for each detection window, the threshold in the threshold curve can dynamically adapt to changes in different background noise levels and signal strengths, thus improving anti-interference capability; (2) Since the reference signal of the detection window is the minimum value among the reference signals of its multiple sub-windows, and the reference signal of each sub-window is the maximum value among the multiple signal points of that sub-window, the reference signal of the detection window can accurately reflect the basic level of the signal within the detection window, and avoids the false alarms and missed detections caused by the inaccuracy of the final threshold curve due to the dominance of individual strong signal points; (3) Through the opening operation, isolated noise spikes can be effectively eliminated and the contour of the target can be smoothed, which is particularly effective in eliminating high-frequency oscillations caused by transducer residual vibration. Then, through the closing operation, small holes in the envelope can be filled and disconnected neighboring regions can be connected. It can make the broken envelope caused by multipath effect or interference continuous, effectively reduce the influence of noise and significantly reduce the false alarm rate; (4) Set the offset and attenuation factor according to different intervals of distance to reduce the influence of noise on the peak detection result; (5) It is not only applicable to single target detection, but also can separate the peak values ​​of complex echo signals with multiple nearby targets, and has strong universality.

[0118] The above descriptions are merely various embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for determining an ultrasonic threshold, characterized in that, The method includes: Obtain the target signal envelope obtained from the ultrasonic echo signal; The target signal envelope is divided into multiple detection windows, and each detection window is further divided into multiple sub-windows, each sub-window including multiple signal points in the target signal envelope; Based on the reference signal of each detection window, a local threshold of each detection window is determined. The reference signal of each detection window is the minimum value of the reference signals of multiple sub-windows of the detection window, and the reference signal of each sub-window is the maximum value among multiple signal points of the sub-window. The threshold curve of the ultrasonic echo signal is determined based on all the local thresholds.

2. The method according to claim 1, characterized in that, The step of determining the local threshold of each detection window based on the reference signal of each detection window includes: Based on the echo distance range corresponding to each detection window, determine the offset and scaling factor of each detection window; The reference signal of each detection window is scaled according to the scaling factor of each detection window to obtain the scaling value; The local threshold of each detection window is determined based on the scaling value and offset of each detection window.

3. The method according to claim 1, characterized in that, The step of obtaining the target signal envelope from the ultrasonic echo signal includes: Acquire ultrasonic echo signals, wherein the ultrasonic echo signals include multiple sampling points; The ultrasonic echo signal is subjected to Hilbert transform to obtain an initial signal envelope characterizing the instantaneous amplitude change of the ultrasonic echo signal. The initial signal envelope includes an initial signal corresponding to each sampling point. Based on the length of the structuring element of each signal to be smoothed, smoothing is performed on each signal to be smoothed to obtain the target signal of each signal to be smoothed. Finally, the target signal envelope including all the target signals is obtained. The signal to be smoothed is an initial signal among a plurality of initial signals that contains other initial signals within a preset range. The length of the structuring element of the signal to be smoothed is determined based on the local signal characteristics of the signal within the preset range of the corresponding signal to be smoothed.

4. The method according to claim 3, characterized in that, Before performing smoothing processing on each signal to be smoothed according to the length of the structure element of each signal to be smoothed, the process includes: The upper and lower limits are determined based on the pre-set ultrasonic center frequency, pulse cycle number, sampling frequency, and extreme value factor. Calculate the local signal characteristics of each of the signals to be smoothed; The length of the structuring element of each signal to be smoothed is calculated based on the upper limit value, the lower limit value, and the local signal characteristics of each signal to be smoothed.

5. The method according to claim 4, characterized in that, The signals within the preset range include the signal to be smoothed and an initial signal located before the signal to be smoothed and at a distance less than a preset distance from the signal to be smoothed. Each signal to be smoothed has a local variance, which is obtained by calculating the variance of the signals within the preset range corresponding to the signal to be smoothed. The step of calculating the local signal features of each of the signals to be smoothed includes: The local signal characteristics of each signal to be smoothed are calculated based on the local variance of each signal and the maximum value of all local variances.

6. The method according to claim 4, characterized in that, The signals within the preset range include the signal to be smoothed and the next initial signal adjacent to the signal to be smoothed. Each signal to be smoothed has a gradient, which is calculated based on the gradient of the corresponding signal to be smoothed and the next initial signal adjacent to it. The step of calculating the local signal features of each of the signals to be smoothed includes: The local signal characteristics of each signal to be smoothed are calculated based on the gradient of each signal to be smoothed and the maximum value of all the gradients.

7. The method according to claim 3, characterized in that, The step of smoothing each signal to be smoothed according to the length of the structure element of each signal to be smoothed, to obtain the target signal of each signal to be smoothed, includes: Determine a smoothing threshold for each of the signals to be smoothed, the smoothing threshold including an opening threshold and a closing threshold, the smoothing threshold being obtained by quantizing the intensity of local signal changes in the signal to be smoothed; Based on the opening threshold and structuring element length of each signal to be smoothed, an opening operation is performed on each signal to be smoothed to obtain the opening operation result of each signal to be smoothed. Based on the closing threshold and structuring element length of each signal to be smoothed, a closing operation is performed on the opening operation result of each signal to be smoothed to obtain the target signal of each signal to be smoothed.

8. The method according to claim 1, characterized in that, The target signal envelope includes multiple signal points, the threshold curve includes reference points corresponding one-to-one with the signal points, and the method further includes: For any reference peak point among multiple reference points, multiple target signal points in the target signal envelope are determined based on the reference peak point; The points corresponding to the multiple target signal points in the ultrasonic echo signal are curve fitted, and the peak position of the fitted curve is taken as the target peak point corresponding to the reference peak point, thus obtaining the target peak point corresponding to each reference peak point.

9. The method according to claim 8, characterized in that, The step of determining multiple target signal points in the target signal envelope based on the reference peak point includes: Determine the reference position in the target signal envelope corresponding to the reference peak point; Each signal point that is greater than the reference peak point and is continuous within a preset neighborhood of the reference position is determined as a candidate signal point; The peak point among the multiple candidate signal points is taken as the candidate peak point, and the candidate peak point and a predetermined number of candidate signal points before and after it are taken as the target signal point.

10. An ultrasonic threshold determining device, characterized in that, The device includes: The acquisition module is used to acquire the target signal envelope obtained from the ultrasonic echo signal; The segmentation module is used to divide the target signal envelope into multiple detection windows and each detection window into multiple sub-windows, each sub-window including multiple signal points in the target signal envelope; The determining module is used to determine a local threshold for each detection window based on the reference signal of each detection window, wherein the reference signal of each detection window is the minimum value of the reference signals of multiple sub-windows of the detection window, and the reference signal of each sub-window is the maximum value among multiple signal points of the sub-window. The determining module is further configured to determine the threshold curve of the ultrasonic echo signal based on all the local thresholds.

11. An electronic device, characterized in that, It includes a processor and a memory, the memory being used to store a program, and the processor being used to implement the ultrasonic threshold determination method as described in any one of claims 1-9 when executing the program.

12. A computer storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the ultrasonic threshold determination method as described in any one of claims 1-9.