Obstacle distance detection method, device and medium based on ultrasonic radar
Through the comprehensive analysis of multiple ultrasonic probes and environmental parameter considerations, the problem of inaccuracy of obstacle distance detection caused by echo signal interference and probe abnormalities in ultrasonic radar is solved, and the accuracy and reliability of detection are improved.
Patent Information
- Application Number
- CN202411354034.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Ultrasonic radar may be disturbed when receiving echo signals, resulting in inaccuracy in the detection of obstacle distances. Especially when the ultrasonic probe is abnormal, normal echo may be judged as an interfering signal, affecting the detection accuracy.
Multiple ultrasonic probes are used to receive the echo signal of the detection signal, and to determine whether the target probe is abnormal by comprehensively analyzing the echo results of each probe, determine the distance between obstacles, including determining the target probe in sequence, corrected distance calculation and the number of effective probes. To improve detection accuracy.
Through comprehensive analysis of multiple probes and environmental parameter considerations, the accuracy of obstacle distance detection is improved, the error of abnormal judgment is reduced, and the reliability of detection is enhanced.
Smart Images

Figure CN118859219B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of ultrasonic radar signal processing, and in particular to an obstacle distance detection method, device and medium based on ultrasonic radar. Background Art
[0002] Ultrasonic radar is a device that uses ultrasonic signals for target detection and ranging. It transmits ultrasonic pulses through an ultrasonic probe, then receives the echo reflected from the object, and calculates the distance by measuring the time difference between transmission and reception.
[0003] However, when receiving echo signals, the ultrasonic probe may also receive ultrasonic signals emitted by other devices, as well as interference signals of the same frequency generated by other devices. At this time, the received signal cannot accurately calculate the actual distance of the obstacle, resulting in misjudgment of the obstacle distance.
[0004] In the related art, an ultrasonic probe sends ultrasonic signals multiple times, calculates the absolute value of the distance difference of multiple echo signals, compares the absolute value with the set distance threshold to determine whether it is an interference signal or a valid signal, and discards the interference data.
[0005] However, when an abnormality occurs in the ultrasonic probe, errors may occur in the signal collection of the ultrasonic probe. At this time, the solution in the related art may judge the normal echo signal as an interference signal, thereby affecting the accuracy of obstacle distance detection. Summary of the invention
[0006] In order to help improve the accuracy of obstacle distance detection, the present application provides an obstacle distance detection method, device and medium based on ultrasonic radar.
[0007] In the first aspect, an obstacle distance detection method based on ultrasonic radar is provided, which is used in a freight management platform and adopts the following technical solution:
[0008] An obstacle distance detection method based on ultrasonic radar is used in an ultrasonic radar, wherein the ultrasonic radar includes at least two ultrasonic probes, and the method includes:
[0009] Determine a target probe from each of the ultrasonic probes, and control the target probe to send a detection signal;
[0010] Controlling each of the ultrasonic probes to receive an echo signal of the detection signal;
[0011] Analyze the echo signals received by each ultrasonic probe separately to obtain the echo analysis results corresponding to each ultrasonic probe;
[0012] Determining whether the target probe is abnormal based on the echo analysis results corresponding to each of the ultrasonic probes;
[0013] When it is determined that the target probe is not abnormal, for each of the ultrasonic probes, determining a reference distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal;
[0014] The obstacle distance is determined based on a reference distance from the obstacle to each of the ultrasonic probes.
[0015] By adopting the above technical solution, during the distance detection process, echo signals corresponding to the detection signals can be received by multiple ultrasonic probes, and the analysis results corresponding to the echo signals received by different ultrasonic probes can be comprehensively analyzed to determine whether the target probe is abnormal, which can help to promptly detect abnormalities in the ultrasonic probe and further help to improve the accuracy of obstacle distance detection.
[0016] Optionally, determining a target probe from each of the ultrasonic probes includes:
[0017] sequentially determining each of the ultrasonic probes as the target probe;
[0018] The determining the obstacle distance based on the distance from the obstacle to each of the ultrasonic probes comprises:
[0019] When it is determined that the detection is finished, for each ultrasonic probe, a corrected distance from the obstacle to the ultrasonic probe is determined based on a reference distance corresponding to each echo signal received by the ultrasonic probe during the detection process;
[0020] The obstacle distance is determined based on the corrected distance from the obstacle to each of the ultrasonic probes.
[0021] By adopting the above technical solution, when a detection is completed, the corrected distance from the obstacle to the ultrasonic probe will be determined based on the reference distance corresponding to each echo signal received by the ultrasonic probe during this detection process, and then the obstacle distance will be determined based on the corrected distance from the obstacle to each ultrasonic probe. This can help improve the accuracy of the final determined obstacle distance.
[0022] Optionally, when it is determined that the target probe is not abnormal, after determining, for each of the ultrasonic probes, a reference distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal, the method further includes:
[0023] After determining the target probe, whether there is any un-polled ultrasonic probe, wherein the un-polled ultrasonic probe refers to the ultrasonic probe that has not been determined as the target probe during the current round of polling;
[0024] When there is no unpolled ultrasonic probe after the target probe, end the current round of polling and determine whether a preset polling number is reached;
[0025] If the preset polling number is not reached, returning to the step of sequentially determining each of the ultrasonic probes as the target probe;
[0026] When the preset polling times are reached, it is determined that the detection is finished.
[0027] By adopting the above technical solution, the ultrasonic radar detection process can be accurately controlled by judging whether there are unpolled ultrasonic probes and whether the preset polling times have been reached, and the types and quantities of echo signals that can be referenced in a single detection process can be enriched, which can help improve the accuracy of the determined obstacle distance.
[0028] Optionally, after determining, for each of the ultrasonic probes, a reference distance from the obstacle to the ultrasonic probe based on the time at which the ultrasonic probe receives the echo signal, the method further includes:
[0029] Determining whether the target probe is valid based on a difference value between a reference distance corresponding to the target probe and a reference distance corresponding to the ultrasonic probe other than the target probe;
[0030] When it is determined that the detection is finished, for each ultrasonic probe, before determining the corrected distance from the obstacle to the ultrasonic probe based on the reference distance corresponding to each echo signal received by the ultrasonic probe, the method further includes:
[0031] When it is determined that the detection is finished, determining whether the number of valid probes in each of the ultrasonic probes is greater than or equal to a preset number;
[0032] In the case where the number of the effective probes is greater than or equal to the preset number, performing the step of determining, for each of the ultrasonic probes, a corrected distance from the obstacle to the ultrasonic probe based on a reference distance corresponding to each of the echo signals received by the ultrasonic probe;
[0033] When the number of valid probes is less than the preset number, it is determined that this round of detection is invalid, and the step of determining the corrected distance from the obstacle to the ultrasonic probe based on the reference distance corresponding to each echo signal received by the ultrasonic probe for each ultrasonic probe is not performed.
[0034] By adopting the above technical solution, the effectiveness of each ultrasonic probe can be judged during the detection process, and then the number of effective probes can be combined to determine whether the detection process is effective. If it is determined that the detection process is effective, the obstacle distance can be calculated, which can help improve the accuracy of the determined obstacle distance.
[0035] Optionally, the separately analyzing the echo signals received by each of the ultrasonic probes to obtain the echo analysis results corresponding to each of the ultrasonic probes includes:
[0036] Extracting features from the echo signal to obtain feature parameters of the echo signal, wherein the feature parameters include aftershock data and frequency data;
[0037] The characteristic parameters are analyzed to obtain echo analysis results corresponding to the ultrasonic probe.
[0038] By adopting the above technical solution, the echo signal can be judged to be abnormal in combination with characteristic parameters such as aftershocks and frequency of the echo signal, which can help avoid the influence of abnormal echo signals on obstacle distance detection, and further help improve the accuracy of obstacle distance detection results.
[0039] Optionally, analyzing the characteristic parameters to obtain an echo analysis result corresponding to the ultrasonic probe includes:
[0040] Get the environment parameters corresponding to the current environment;
[0041] The characteristic parameters are analyzed in combination with the environmental parameters to obtain the echo analysis results.
[0042] By adopting the above technical solution, the influence of the current environment on the echo data can be taken into account during the echo data analysis process, which can help improve the accuracy of the echo analysis results.
[0043] Optionally, analyzing the characteristic parameter in combination with the environmental parameter to obtain an echo analysis result includes:
[0044] Inputting the environmental parameters and the characteristic parameters into a pre-trained echo analysis model to obtain an echo analysis result;
[0045] The echo analysis model is obtained by training the initial network model using training data, wherein the training data includes at least one set of sample data and analysis results corresponding to the sample data, and each set of sample data includes sample environment parameters and sample characteristic parameters;
[0046] The loss function used in the echo analysis model training process includes a cross entropy loss term and an environmental loss term, and the environmental loss term is used to improve the sensitivity of the model to the environmental parameters.
[0047] In the above technical scheme, since the environmental loss term for learning environmental parameters is introduced into the loss function during the training process of the echo analysis model, the echo analysis model can comprehensively consider the input environmental parameters in the process of analyzing the characteristic parameters, which can help analyze the impact of environmental parameters on the results, thereby improving the accuracy of the echo analysis results.
[0048] Optionally, the loss function is expressed by the following formula:
[0049]
[0050] Wherein, L is the loss function; L CE is the cross entropy loss term; L EP is the environmental loss item;
[0051] The cross entropy loss term is expressed as follows:
[0052]
[0053] Among them, L CE is the cross entropy loss term; N is the number of sample data; x i is the sample data of group i; i is the analysis result corresponding to the i-th group of sample data; P(y i |x i ) is x i for y i probability.
[0054] The environmental loss term is expressed by the following formula:
[0055]
[0056] Among them, L EP is the environmental loss term; N is the number of sample data; M is the number of environmental parameters; θ is the environmental parameter vector, θ ij is the parameter value of the jth environmental parameter of the environmental parameter vector in the i-th sample.
[0057] In a second aspect, an electronic device is provided, which adopts the following technical solution:
[0058] An electronic device, comprising:
[0059] at least one processor;
[0060] Memory;
[0061] At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute any one of the ultrasonic radar-based obstacle distance detection methods provided in the first aspect.
[0062] In a third aspect, a computer-readable storage medium is provided, which adopts the following technical solution:
[0063] A computer-readable storage medium stores a computer program, which, when executed in a computer, causes the computer to execute the obstacle distance detection method based on ultrasonic radar in the first aspect.
[0064] In summary, the present application includes at least one of the following beneficial technical effects:
[0065] 1. During the distance detection process, multiple ultrasonic probes can be used to receive echo signals corresponding to detection signals, and the analysis results corresponding to the echo signals received by different ultrasonic probes can be combined to determine whether the target probe is abnormal, which can help to timely discover abnormalities of the ultrasonic probe, and further help to improve the accuracy of obstacle distance detection.
[0066] 2. The influence of the current environment on the echo data can be taken into account during the echo data analysis process, which can help improve the accuracy of the echo analysis results. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a flow chart of an obstacle distance detection method based on ultrasonic radar provided in an embodiment of the present application;
[0068] Figure 2 It is a flowchart of a method for determining a target probe provided in an embodiment of the present application;
[0069] Figure 3 It is a flowchart of a detection end judgment method provided in an embodiment of the present application;
[0070] Figure 4 It is a flowchart of another obstacle distance detection method based on ultrasonic radar provided in an embodiment of the present application;
[0071] Figure 5 It is a flowchart of a method for determining echo analysis results provided in an embodiment of the present application;
[0072] Figure 6 is a flow chart of another method for determining echo analysis results provided in an embodiment of the present application;
[0073] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figures 1 to 7 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0075] The present application provides an obstacle distance detection method based on ultrasonic radar, which is used in ultrasonic radar. The ultrasonic radar includes multiple ultrasonic probes. Figure 1 , the obstacle distance detection method includes the following steps:
[0076] Step 101, determining a target probe from various ultrasonic probes, and controlling the target probe to send a detection signal.
[0077] The detection signal is an ultrasonic signal, and the frequency of the detection signal is determined based on the target probe. The signal transmission frequencies corresponding to different ultrasonic probes may be the same or different.
[0078] Specifically, the target probe may be any probe among various ultrasonic probes.
[0079] In one example, each ultrasound probe may be determined as a target probe in sequence.
[0080] Step 102, controlling each ultrasonic probe to receive an echo signal of the detection signal.
[0081] In this embodiment, the signal detection ranges of the various ultrasonic probes overlap or are completely the same, so that the echo signals of the detection signals can be received by all the ultrasonic probes.
[0082] It should be noted that when different ultrasonic probes have different detection signal generation frequencies, the signal frequency range that each ultrasonic probe can accept includes the frequency that each ultrasonic probe can transmit, which can help ensure that all ultrasonic probes can receive echo signals.
[0083] Step 103 , analyzing the echo signals received by each ultrasonic probe separately to obtain the echo analysis results corresponding to each ultrasonic probe.
[0084] Specifically, the echo analysis result is used to indicate whether the echo data is valid. Specifically, when the ultrasonic probe receives the echo signal, it analyzes the validity of the echo signal based on the characteristics of the echo signal to obtain the echo analysis result.
[0085] The characteristics of the echo signal may be information such as aftershocks and frequencies that can be used to identify the echo signal. For example, the duration and number of aftershocks can be used to determine whether the echo signal is disturbed and the degree of disturbance. The frequency offset and frequency distribution can also be used to determine whether the signal is disturbed or the ultrasonic probe itself is faulty. This allows for accurate analysis of whether the echo data is valid.
[0086] Step 104 , determining whether the target probe is abnormal based on the echo analysis results corresponding to each ultrasonic probe.
[0087] Optionally, determining whether the target probe is abnormal based on the echo analysis results corresponding to each ultrasonic probe includes: comparing and analyzing the echo analysis results corresponding to each ultrasonic probe to determine whether the target probe is abnormal.
[0088] Optionally, determining whether the target probe is abnormal based on the echo analysis results corresponding to each ultrasonic probe includes: determining whether the echo data received by each ultrasonic probe are valid; if so, determining that the target probe is normal.
[0089] Furthermore, in the case where there is an ultrasonic probe whose received echo data is invalid, it is further determined whether the echo data received by the target ultrasonic probe is valid; if so, it is determined that the target probe is normal.
[0090] Furthermore, when the echo data received by the target ultrasonic probe is invalid, it is determined whether the number of ultrasonic probes that have received valid echo data is greater than a preset number threshold; if so, it is determined that the target probe is normal; if not, it is determined that the target probe is abnormal.
[0091] In actual implementation, when it is determined that there is an ultrasonic probe that receives invalid echo data or when it is determined that the echo data received by the target probe is invalid, it can be directly determined that the target probe is abnormal.
[0092] Step 105 : When it is determined that the target probe is not abnormal, for each ultrasonic probe, a reference distance from the obstacle to the ultrasonic probe is determined based on the time when the ultrasonic probe receives the echo signal.
[0093] Specifically, determining the parameter distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal includes: determining the interval between the time when the detection signal is sent and the time when the echo signal is received; and determining the reference distance based on the interval and the frequency of the detection signal. The frequency of the detection signal is preset.
[0094] Optionally, when it is determined that the target probe is abnormal, the target probe is re-determined among ultrasonic probes other than the target probe, and the process returns to step 101 .
[0095] Further, when it is determined that the target probe is abnormal, it can be directly determined that the target probe is faulty, or it can be determined whether the number of abnormalities of the target probe reaches a preset number threshold, and when the number of abnormalities of the target probe reaches the preset number threshold, it is determined that the target probe is faulty. The ultrasonic probe determined to be faulty will no longer perform subsequent distance detection tasks before the inspection is completed, that is, it will no longer transmit detection signals as a target probe, and will no longer receive echo signals.
[0096] Step 106 : determining the obstacle distance based on the reference distance from the obstacle to each ultrasonic probe.
[0097] Optionally, the obstacle distance is determined based on the reference distance from the obstacle to each ultrasonic probe, including: determining the minimum value of the reference distance from the obstacle to each ultrasonic probe as the obstacle distance. Since the obstacle distance will affect the driver's judgment on the driving method of the vehicle, for safety reasons, determining the minimum reference distance as the obstacle distance can achieve effective distance reminders, thereby helping the driver to accurately judge the situation of the obstacle, thereby improving driving safety.
[0098] The implementation principle of the obstacle distance detection method based on ultrasonic radar provided in this embodiment is: determine the target probe from each ultrasonic probe, and control the target probe to send a detection signal; control each ultrasonic probe to receive the echo signal of the detection signal; analyze the echo signal received by each ultrasonic probe separately to obtain the echo analysis result corresponding to each ultrasonic probe; determine whether the target probe is abnormal based on the echo analysis result corresponding to each ultrasonic probe; when it is determined that the target probe is not abnormal, for each ultrasonic probe, determine the reference distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal; and determine the obstacle distance based on the reference distance from the obstacle to each ultrasonic probe. By adopting the above technical scheme, after the target ultrasonic probe transmits a detection signal, the echo signal corresponding to the detection signal can be received by multiple ultrasonic probes, and the echo signal received by each ultrasonic probe can be analyzed respectively. When it is determined that the target probe is not abnormal based on the echo analysis results corresponding to each ultrasonic probe, the obstacle distance is finally determined based on the reference distance corresponding to the echo signal. In this way, during the distance detection process, it is possible to judge whether the target probe is abnormal by comprehensively analyzing the analysis results corresponding to the echo signals received by different ultrasonic probes, which can help to timely discover the abnormality of the ultrasonic probe, and further help to improve the accuracy of obstacle distance detection.
[0099] In some embodiments, reference Figure 2 , step 101, determining a target probe from each ultrasonic probe, comprising the following steps:
[0100] Step 201, determine each ultrasonic probe as a target probe in turn.
[0101] In one example, the ultrasonic radar includes four ultrasonic probes. In this case, the four ultrasonic probes can be determined as target probes in turn in a preset order (for example, from left to right by position).
[0102] In this embodiment, by determining each ultrasonic probe as a target probe in turn, obstacles in different directions can be accurately collected. At the same time, each ultrasonic probe can be synchronously detected for abnormalities during the distance detection process, which can help improve the accuracy of obstacle distance detection while ensuring the obstacle detection range.
[0103] Accordingly, step 106, determining the obstacle distance based on the distance from the obstacle to each ultrasonic probe, includes the following steps:
[0104] Step 202 : when it is determined that the detection is finished, for each ultrasonic probe, a corrected distance from the obstacle to the ultrasonic probe is determined based on a reference distance corresponding to each echo signal received by the ultrasonic probe during the detection.
[0105] Specifically, during a detection process, multiple different ultrasonic probes are successively identified as target probes. Accordingly, each ultrasonic probe will receive echo signals corresponding to ultrasonic signals sent by different target probes. According to the technical solutions of steps 103 to 105, each echo signal may correspond to a reference distance. Therefore, during a detection process, multiple distances from the obstacle to the ultrasonic probe may be determined for each ultrasonic probe. In order to facilitate subsequent calculations, it is necessary to comprehensively determine the reference distances corresponding to each echo signal to determine the corrected distance corresponding to the ultrasonic probe.
[0106] In one example, the corrected distance from the obstacle to the ultrasonic probe is determined based on the reference distances corresponding to the various echo signals received by the ultrasonic probe during the current detection process, including: determining the minimum value or average value of the reference distances corresponding to the various echo signals received by the ultrasonic probe during the current detection process as the corrected distance.
[0107] In this embodiment, the detection end condition is preset. For example, the detection is determined to be over when the detection duration reaches a preset duration; or the detection is determined to be over after the number of detection signal transmissions reaches a preset number and a preset waiting time.
[0108] Step 203: determining the obstacle distance based on the corrected distance from the obstacle to each ultrasonic probe.
[0109] Specifically, the implementation of step 203 can be similar to step 106, and will not be described in detail in this embodiment.
[0110] In the above implementation, since each ultrasonic probe can be identified as a target probe in turn during the detection process, and when one detection is completed, the corrected distance from the obstacle to the ultrasonic probe is first determined based on the reference distance corresponding to each echo signal received by the ultrasonic probe during this detection process, and then the obstacle distance is determined based on the corrected distance from the obstacle to each ultrasonic probe. This can help improve the accuracy of the ultimately determined obstacle distance.
[0111] For further reference, Figure 3 Step 105, when it is determined that the target probe is not abnormal, for each ultrasonic probe, after determining the reference distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal, the following steps are also included:
[0112] Step 301, determining whether there is any unpolled ultrasonic probe after the target probe.
[0113] The unpolled ultrasonic probe refers to an ultrasonic probe that has not been determined as a target probe during the current round of polling.
[0114] Step 302: When there is no unpolled ultrasonic probe after the target probe, end the current round of polling and determine whether the preset polling times are reached.
[0115] The preset polling number needs to be set by comprehensively considering the detection accuracy and timeliness. Specifically, the preset polling number is greater than or equal to 1. In one example, the preset polling number is three times.
[0116] Optionally, when there is still an un-polled ultrasonic probe behind the target probe, the un-polled ultrasonic probe behind the current target probe is determined as the target probe, and the process returns to step 101 .
[0117] Step 303, when the preset polling times are not reached, the process returns to the step of sequentially determining each ultrasonic probe as a target probe, that is, returns to step 201 to enter a new round of polling.
[0118] Step 304: When the preset polling times are reached, it is determined that the detection is finished and step 202 is executed.
[0119] In the above technical solution, precise control of the ultrasonic radar detection process is achieved by judging whether there is an unpolled ultrasonic probe and whether the preset polling number has been reached, and the types and quantities of echo signals that can be referenced in a single detection process are enriched, which can help improve the accuracy of the determined obstacle distance.
[0120] Based on the above technical solution, further, refer to Figure 4 In step 105, for each ultrasonic probe, after determining the reference distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal, the following steps are also included:
[0121] Step 401 : determining whether the target probe is valid based on a difference value between a reference distance corresponding to the target probe and a reference distance corresponding to an ultrasonic probe other than the target probe.
[0122] Optionally, whether the target probe is valid is determined based on a difference value between a reference distance corresponding to the target probe and a reference distance corresponding to an ultrasonic probe other than the target probe, including: for each ultrasonic probe other than the target probe, determining whether the difference value between the reference distance corresponding to the ultrasonic probe and the reference distance of the target ultrasonic probe is less than a difference value threshold corresponding to the ultrasonic probe; if the average difference between the reference distance corresponding to each ultrasonic probe other than the target probe and the reference distance of the ultrasonic probe is less than the difference value threshold corresponding to the ultrasonic probe, the target probe is determined to be valid; otherwise, the target probe is determined to be invalid.
[0123] The reference distance thresholds corresponding to different ultrasonic probes may be the same, or may be set separately according to the actual conditions of the ultrasonic probes, which is not limited here.
[0124] Further, when a preset polling number is polled each time during the monitoring process, and the preset polling number is greater than 1, step 401, before determining whether the target probe is valid based on the difference value between the reference distance corresponding to the target probe and the reference distance corresponding to the ultrasonic probe other than the target probe, also includes: determining whether the preset polling number is reached; when the preset polling number is reached, determining the echo signal corresponding to each detection signal sent by the target ultrasonic probe in this detection process as the target echo signal; for each ultrasonic probe, determining the average value of the reference distance corresponding to the target echo signal received by the ultrasonic probe as the reference distance corresponding to the ultrasonic probe, and executing the step of determining whether the target probe is valid based on the difference value between the reference distance corresponding to the target probe and the reference distance corresponding to the ultrasonic probe other than the target probe, that is, executing step 401; when the preset polling number is not reached, the step of determining whether the target probe is valid based on the difference value between the reference distance corresponding to the target probe and the reference distance corresponding to the ultrasonic probe other than the target probe is not executed, that is, step 401 is not executed.
[0125] Accordingly, in step 202, when it is determined that the detection is finished, for each ultrasonic probe, before determining the corrected distance from the obstacle to the ultrasonic probe based on the reference distance corresponding to each echo signal received by the ultrasonic probe, the method further includes:
[0126] Step 402: When it is determined that the detection is finished, determine whether the number of valid probes in each ultrasonic probe is greater than or equal to a preset number.
[0127] The preset number is less than the total number of ultrasonic probes. For example, if there are 4 ultrasonic probes in total, the preset number may be 3.
[0128] In step 402, the method of determining whether the current detection is completed is similar to the above steps 301 to 304.
[0129] Step 403, when the number of valid probes is greater than or equal to the preset number, the step of determining the corrected distance from the obstacle to the ultrasonic probe based on the reference distance corresponding to each echo signal received by the ultrasonic probe is performed for each ultrasonic probe, that is, step 202 is performed.
[0130] Step 404, when the number of valid probes is less than the preset number, it is determined that this round of detection is invalid, and the step of determining the corrected distance from the obstacle to the ultrasonic probe for each ultrasonic probe based on the reference distance corresponding to each echo signal received by the ultrasonic probe is not performed, that is, step 202 is not performed.
[0131] In the above technical scheme, after determining the reference distance of the ultrasonic probe, whether the target probe is valid can be determined based on the difference value between the reference distance corresponding to the target probe and the reference distance corresponding to the ultrasonic probe other than the target probe, and each ultrasonic probe will be determined as the target probe in turn during the detection process. Therefore, the effectiveness of each ultrasonic probe can be judged during the detection process, and then the effectiveness of this detection process can be determined in combination with the number of valid probes. When it is determined that this detection process is valid, the obstacle distance calculation is performed, which can help improve the accuracy of the determined obstacle distance.
[0132] In some embodiments, reference Figure 5 In step 103, the echo signals received by each ultrasonic probe are analyzed separately to obtain the echo analysis results corresponding to each ultrasonic probe, including the following steps:
[0133] Step 501: For each ultrasonic probe, feature extraction is performed on the echo signal to obtain feature parameters of the echo signal.
[0134] Among them, the characteristic parameters include aftershock data and frequency data.
[0135] In one example, feature extraction is performed on the echo signal to obtain feature parameters of the echo signal, including: identifying the main wave peak corresponding to the main echo signal; detecting the aftershock wave peak after the main wave peak, and recording the intensity and time position of the aftershock wave peak to obtain aftershock data.
[0136] In another example, the echo signal is transformed from the time domain to the frequency domain by using a fast Fourier transform (FFT), so as to analyze the frequency data of the echo signal. In actual implementation, the frequency data can be represented by a spectrum diagram.
[0137] Step 502: Analyze the characteristic parameters to obtain the echo analysis results corresponding to the ultrasonic probe.
[0138] In one example, analyzing the characteristic reference to obtain the echo analysis result includes: determining whether the ratio of the aftershock intensity to the main wave peak is less than a preset ratio threshold; if not, determining that the echo signal is abnormal. Further, in the case where it is determined that the ratio of the aftershock intensity to the main wave peak is less than the preset ratio threshold, it can be further determined whether the attenuation speed is greater than a preset speed threshold; if not, determining that the echo signal is abnormal.
[0139] In another example, the frequency data is represented by a spectrum graph, and the characteristic parameters are analyzed to obtain the echo analysis results, including: determining the frequency corresponding to the peak in the spectrum graph as the center frequency; determining whether the frequency difference between the center frequency and the detection signal is less than a preset frequency difference; if not, determining that the echo signal is abnormal. Further, in the case where the frequency difference between the center frequency and the detection signal is less than the preset frequency difference, the standard deviation of the frequency distribution can be further determined based on the frequency information, and determining whether the standard deviation of the frequency distribution is less than a preset standard deviation threshold; if not, determining that the echo signal is abnormal.
[0140] In the above technical solution, since it is possible to extract characteristic parameters including aftershock data and frequency data from the echo signal and analyze the characteristic parameters to obtain the echo analysis result, the echo signal can be judged as abnormal in combination with the characteristic parameters such as aftershocks and frequency of the echo signal, which can help avoid the influence of abnormal echo signals on obstacle distance detection, and further help improve the accuracy of obstacle distance detection results.
[0141] For further reference, Figure 6 Step 502, analyzing the characteristic parameters to obtain the echo analysis results corresponding to the ultrasonic probe, includes the following steps:
[0142] Step 601, obtaining environmental parameters corresponding to the current environment.
[0143] The current environment is the working environment of the ultrasonic radar, such as the environment where the vehicle is located. Specifically, the environmental parameters may include at least one parameter that can reflect the environment, such as temperature parameters, humidity parameters, and rainfall parameters (whether it is raining or the amount of rainfall). In actual implementation, the environmental parameters can be represented by actual values, such as temperature parameters are represented by temperature values, and rainfall parameters are represented by rainfall amounts.
[0144] In one example, obtaining environmental parameters corresponding to the current environment includes: obtaining environmental parameters from a host computer (eg, a vehicle-mounted terminal).
[0145] Step 602: Analyze the characteristic parameters in combination with the environmental parameters to obtain echo analysis results.
[0146] Optionally, the characteristic parameters are analyzed in combination with the environmental parameters to obtain the echo analysis results, including: adjusting the preset evaluation parameters based on the environmental parameters to obtain the adjusted evaluation parameters; and using the adjusted evaluation parameters to analyze the characteristic parameters to obtain the echo analysis results.
[0147] Among them, the preset evaluation parameters are evaluation parameters under ideal conditions, and the evaluation parameters are parameters used in the process of evaluating features, such as: the preset frequency gap used to evaluate frequency data, and the ratio threshold used to evaluate aftershock data.
[0148] In this embodiment, the method for adjusting the preset evaluation parameters based on the environmental parameters is pre-set. Specifically, the method for adjusting the preset evaluation parameters can be set based on the gap between the environment indicated by the current environmental parameters and the ideal environment, so that the adjusted evaluation parameters can adapt to the current environment.
[0149] In the above implementation, since the characteristic parameters can be analyzed in combination with the environmental parameters corresponding to the current environment to obtain the echo analysis results, the impact of the current environment on the echo data can be taken into account during the echo data analysis process, which can help improve the accuracy of the echo analysis results.
[0150] Furthermore, in step 602, the characteristic parameters are analyzed in combination with the environmental parameters to obtain an echo analysis result, including: inputting the environmental parameters and the characteristic parameters into a pre-trained echo analysis model to obtain an echo analysis result.
[0151] The echo analysis model is obtained by training the initial network model using training data, wherein the training data includes at least one set of sample data and analysis results corresponding to the sample data, and each set of sample data includes sample environment parameters and sample characteristic parameters.
[0152] The loss functions used in the echo analysis model training process include the cross entropy loss term and the environmental loss term. The environmental loss term is used to improve the model's sensitivity to environmental parameters.
[0153] In one example, the loss function is expressed as follows:
[0154]
[0155] Among them, L is the loss function; L CE is the cross entropy loss term; L EP It is the environmental loss item.
[0156] The cross entropy loss term is expressed as follows:
[0157]
[0158] Among them, L CE is the cross entropy loss term; N is the number of sample data; x i is the sample data of group i; i is the analysis result corresponding to the i-th group of sample data; P(y i |x i ) is x i for y i probability.
[0159] The environmental loss term is expressed as follows:
[0160]
[0161] Among them, L EP is the environmental loss term; N is the number of sample data; M is the number of environmental parameters; θ is the environmental parameter vector, θ ij is the parameter value of the jth environmental parameter in the i-th sample of the environmental parameter vector.
[0162] In the above embodiment, the characteristic parameters are analyzed by the echo analysis model to obtain the echo analysis results, and the environmental loss term for learning the environmental parameters is introduced into the loss function in the training process of the echo analysis model. In this way, the echo analysis model can comprehensively consider the input environmental parameters in the process of analyzing the characteristic parameters, which can help analyze the impact of the environmental parameters on the results, thereby improving the accuracy of the echo analysis results.
[0163] Furthermore, when there are multiple environmental parameters, considering that different environmental effects may act together on the echo analysis results, the environmental loss term can further learn the weights between different environmental parameters. This can help the model better adapt to different environmental conditions, thereby improving the accuracy of the echo analysis results.
[0164] In one example, the environmental loss term is represented by the following formula:
[0165]
[0166] Among them, L EP is the environmental loss term; N is the number of sample data; M is the number of environmental parameters; θ is the environmental parameter vector, θ ij is the parameter value of the jth environment parameter in the i-th sample of the environment parameter vector; α is a hyperparameter used to balance the weight loss between a single environment parameter loss and the environment parameters; W is the weight matrix, W ij represents the influence of the i-th environmental parameter on the j-th environmental parameter.
[0167] The present application also provides an electronic device, such as Figure 7 As shown, Figure 7 The electronic device 700 shown includes: a processor 701 and a memory 703. The processor 701 and the memory 703 are connected, such as through a bus 702. Optionally, the electronic device 700 may also include a transceiver 704. It should be noted that in actual applications, the transceiver 704 is not limited to one, and the structure of the electronic device 700 does not constitute a limitation on the embodiments of the present application.
[0168] Processor 701 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 701 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0169] The bus 702 may include a path to transmit information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 702 may be divided into an address bus, a data bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0170] The memory 703 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0171] The memory 703 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 701. The processor 701 is used to execute the application code stored in the memory 703 to implement the contents shown in the above method embodiment.
[0172] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, laptop computers, PDAs (personal digital assistants), PADs (tablet computers), etc., and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server terminal, etc. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0173] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the obstacle distance detection method based on ultrasonic radar provided in the above embodiment.
[0174] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise clearly stated in this document, the execution of these steps is not strictly limited in order and can be performed in other orders.
[0175] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An obstacle distance detection method based on ultrasonic radar, characterized in that: Used in an ultrasonic radar, the ultrasonic radar includes at least two ultrasonic probes, and the method includes: Determine a target probe from each of the ultrasonic probes, and control the target probe to send a detection signal; Controlling each of the ultrasonic probes to receive an echo signal of the detection signal; Analyze the echo signals received by each ultrasonic probe separately to obtain the echo analysis results corresponding to each ultrasonic probe; Determining whether the target probe is abnormal based on the echo analysis results corresponding to each of the ultrasonic probes; When it is determined that the target probe is not abnormal, for each of the ultrasonic probes, determining a reference distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal; Determining the obstacle distance based on the reference distance from the obstacle to each of the ultrasonic probes; The echo signals received by each ultrasonic probe are analyzed separately to obtain the echo analysis results corresponding to each ultrasonic probe, including: For each of the ultrasonic probes, feature extraction is performed on the echo signal received by the ultrasonic probe to obtain feature parameters of the echo signal, wherein the feature parameters include aftershock data and frequency data; Analyzing the characteristic parameters to obtain an echo analysis result corresponding to the ultrasonic probe; The step of determining a target probe from each of the ultrasonic probes comprises: sequentially determining each of the ultrasonic probes as the target probe; The determining the obstacle distance based on the distance from the obstacle to each of the ultrasonic probes comprises: When it is determined that the detection is finished, for each ultrasonic probe, a corrected distance from the obstacle to the ultrasonic probe is determined based on a reference distance corresponding to each echo signal received by the ultrasonic probe during the detection process; Determining the obstacle distance based on the corrected distance from the obstacle to each of the ultrasonic probes; In the case where it is determined that the target probe is not abnormal, for each of the ultrasonic probes, after determining a reference distance from the obstacle to the ultrasonic probe based on the time when the ultrasonic probe receives the echo signal, the method further includes: After determining the target probe, whether there is any un-polled ultrasonic probe, wherein the un-polled ultrasonic probe refers to the ultrasonic probe that has not been determined as the target probe during the current round of polling; When there is no unpolled ultrasonic probe after the target probe, end the current round of polling and determine whether a preset polling number is reached; If the preset polling number is not reached, returning to the step of sequentially determining each of the ultrasonic probes as the target probe; When the preset polling times are reached, it is determined that the detection is finished.
2. The method according to claim 1, characterized in that After determining the reference distance from the obstacle to each ultrasonic probe based on the time when the ultrasonic probe receives the echo signal, the method further includes: Determining whether the target probe is valid based on a difference value between a reference distance corresponding to the target probe and a reference distance corresponding to the ultrasonic probe other than the target probe; When it is determined that the detection is finished, for each ultrasonic probe, before determining the corrected distance from the obstacle to the ultrasonic probe based on the reference distance corresponding to each echo signal received by the ultrasonic probe, the method further includes: When it is determined that the detection is finished, determining whether the number of valid probes in each of the ultrasonic probes is greater than or equal to a preset number; In the case where the number of the effective probes is greater than or equal to the preset number, performing the step of determining, for each of the ultrasonic probes, a corrected distance from the obstacle to the ultrasonic probe based on a reference distance corresponding to each of the echo signals received by the ultrasonic probe; When the number of valid probes is less than the preset number, it is determined that this round of detection is invalid, and the step of determining the corrected distance from the obstacle to the ultrasonic probe based on the reference distance corresponding to each echo signal received by the ultrasonic probe for each ultrasonic probe is not performed.
3. The method according to claim 1, characterized in that The analyzing the characteristic parameters to obtain the echo analysis result corresponding to the ultrasonic probe includes: Get the environment parameters corresponding to the current environment; The characteristic parameters are analyzed in combination with the environmental parameters to obtain the echo analysis results.
4. The method according to claim 3, characterized in that The analyzing the characteristic parameter in combination with the environmental parameter to obtain the echo analysis result includes: Inputting the environmental parameters and the characteristic parameters into a pre-trained echo analysis model to obtain an echo analysis result; The echo analysis model is obtained by training the initial network model using training data, wherein the training data includes at least one set of sample data and analysis results corresponding to the sample data, and each set of sample data includes sample environment parameters and sample characteristic parameters; The loss function used in the echo analysis model training process includes a cross entropy loss term and an environmental loss term, and the environmental loss term is used to improve the sensitivity of the model to the environmental parameters.
5. The method according to claim 4, characterized in that The loss function is expressed by the following formula: , Wherein, L is the loss function; L CE is the cross entropy loss term; L EP is the environmental loss item; The cross entropy loss term is expressed as follows: , Among them, L CE is the cross entropy loss term; N is the number of sample data; x i is the sample data of group i; i is the analysis result corresponding to the i-th group of sample data; P(y i |x i ) is x i for y i The probability of The environmental loss term is expressed by the following formula: , Among them, L EP is the environmental loss term; N is the number of sample data; M is the number of environmental parameters; θ is the environmental parameter vector, θ ij is the parameter value of the jth environmental parameter of the environmental parameter vector in the i-th sample.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; Memory; At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the obstacle distance detection method based on ultrasonic radar as described in any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the obstacle distance detection method based on ultrasonic radar according to any one of claims 1 to 5.
