Distance detection method, distance measurement system, electronic equipment and readable storage medium

By dynamically adjusting the time resolution and output power of the DToF sensor and combining the combined mode, the problem of DToF sensor being difficult to take into account long distance and high-precision ranging without hardware upgrades is solved, and flexible ranging configuration and low-power ranging effect are achieved.

CN120539734APending Publication Date: 2025-08-26HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410757678.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-19
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

Without hardware upgrades, DToF sensors are difficult to take into account both long-distance and high-precision ranging at the same time, due to the limitations of memory size and output power.

Method used

By dynamically adjusting the time resolution and output power of the time counting circuit, combined with multiple combination modes, the time interval width of the histogram is dynamically adjusted to achieve long-distance and high-precision ranging configuration.

Benefits of technology

Without increasing hardware costs, long-distance and high-precision ranging of DToF sensors are achieved, reducing power consumption and avoiding signal accumulation or saturation, and improving the flexibility of the ranging system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120539734A_ABST
    Figure CN120539734A_ABST
Patent Text Reader

Abstract

The invention provides a distance detection method, a distance measurement system, electronic equipment and a readable storage medium. An electronic device has a ranging system on the electronic device that includes a time counting circuit. During distance measurement, a plurality of time bit widths of a time counting circuit are combined based on the determined number of time intervals included in a histogram to obtain a plurality of combination modes, and the next time interval of each combination mode corresponds to at least one time bit width; then dynamically adjusting the time interval width of the histogram according to multiple combination modes and data representing distance measurement requirements, and performing counting statistics on each optical signal by using the adjusted histogram according to the time interval of receiving each optical signal emitted by the current frame after being reflected by the target object; and determining distance information corresponding to the target object detected in the current frame according to a statistical histogram formed by statistics. By adopting the scheme, hardware of the ranging system does not need to be upgraded, different ranging configurations such as long distance and high precision can be fused and realized, and diversified ranging is realized.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the domestic patent application filed on February 19, 2024 with application number 202410184112.0. Technical Field

[0002] The present application relates to the field of distance measurement technology, and in particular to a distance detection method, a distance measurement system, an electronic device, and a readable storage medium. Background Art

[0003] Direct Time of Flight (DToF) sensor technology is widely used in various devices due to its advantages such as large test range and strong anti-interference. The DToF sensor is based on time-correlated single photon counting technology. The time data converter (TDC) inside it records the time it takes for the light signal (photon) to fly back and forth in space, and thus calculates the distance of the target object based on the recorded time and the known speed of light. Since the size of the memory used by the TDC for time storage counting is limited by the chip area, DToF cannot simultaneously take into account long-distance and high-precision ranging, unless the DToF hardware is upgraded and the hardware storage resources are increased, but this will undoubtedly increase the hardware cost of DToF. Summary of the Invention

[0004] In view of the above problems, various aspects of the present application provide a distance detection method, a distance measurement system, an electronic device, and a readable storage medium, so as to achieve the purpose of DToF distance measurement that can take into account both long distance and high precision without upgrading the DToF hardware.

[0005] In a first aspect, the present application provides a distance detection method applicable to an electronic device having a ranging system, wherein the ranging system includes a transmitter, a receiver, and a time counting circuit; the method includes:

[0006] Determining the number of time intervals included in the histogram corresponding to the time counting circuit;

[0007] Based on the number of time intervals, multiple time bit widths of the time counting circuit are combined to obtain multiple combination patterns; wherein the combination patterns include a correspondence between time intervals and time bit widths, and one time interval corresponds to at least one time bit width;

[0008] Dynamically adjust the time interval width of the histogram according to the multiple combination modes and the data representing the ranging requirements;

[0009] Based on the time interval detected by the time counting circuit between each optical signal emitted by the transmitting end in the current frame and reflected by the target object and received by the receiving end, the adjusted histogram is used to count and count each optical signal to form a statistical histogram;

[0010] Determine distance information corresponding to the target object detected in the current frame according to the statistical histogram.

[0011] In a second aspect, the present application provides a ranging system. The ranging system includes:

[0012] A transmitting end, used for transmitting an optical signal;

[0013] A receiving end, for receiving an optical signal;

[0014] a time counting circuit connected to the receiving end, for detecting the time interval between each optical signal being emitted by the transmitting end and being received by the receiving end, and storing the time interval of each optical signal in a storage circuit;

[0015] a storage circuit connected to the time counting circuit, and configured to perform histogram counting statistics on each optical signal according to the time interval of each optical signal;

[0016] The processing circuit is connected to the storage circuit and is used to implement the steps in the distance detection method provided by the present application.

[0017] In a third aspect, the present application provides an electronic device, which includes the ranging system provided by the present application.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium having computer program instructions stored therein; when the computer program instructions are executed by a processor, the steps of the distance detection method provided in the present application are implemented.

[0019] In a fifth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps in the distance detection method provided by the present application can be implemented.

[0020] The technical solutions provided by various embodiments of the present application include: an electronic device having a ranging system including a transmitter, a receiver, and a time counting circuit. When distance detection is achieved through the ranging system, the number of time intervals included in the histogram corresponding to the time counting circuit is first determined; further, based on the number of time intervals, multiple time bit widths of the time counting circuit are combined to obtain multiple combination modes; each combination mode includes a correspondence between time intervals and time bit widths, with one time interval corresponding to at least one time bit width; thereafter, the time interval width of the histogram can be dynamically adjusted based on the multiple combination modes and data representing the ranging requirements, and based on the time interval between each light signal emitted by the transmitter in the current frame detected by the time counting circuit and then reflected by the target object and received by the receiver, the adjusted histogram is used to count and statistically analyze each light signal; based on the statistical histogram formed by the counting and statistics, the distance information corresponding to the target object detected in the current frame can be determined. Because the time resolution of the time counting circuit in the ranging system is related to the time interval width of the histogram, and the time resolution is related to the ranging accuracy, specifically, time resolution = the time interval width of the histogram (that is, = the number of time bit widths corresponding to the time interval * the time unit represented by one time bit width), and ranging accuracy = the time interval width of the histogram * the speed of light ÷ 2. Therefore, it can be seen that a larger time interval width indicates lower time resolution and ranging accuracy, and conversely, a smaller time interval width indicates higher time resolution and ranging accuracy. In addition, because the maximum ranging distance achievable using a histogram = the product of the time interval width and the number of time intervals in the histogram, when the number of time intervals in the histogram is fixed, a larger time interval width indicates a longer achievable ranging distance, and conversely, a smaller time interval width indicates a shorter achievable ranging distance. Based on the above content, the present application scheme dynamically adjusts the width of each time interval in the histogram during the ranging process, which can actually be understood as dynamically adjusting the time resolution of the time counting circuit in the ranging system. Through this dynamic adjustment, different ranging configurations such as long distance and high precision can be integrated through software in the entire ranging process to achieve diverse ranging without the need for hardware upgrades to the ranging system (more importantly, without the need for hardware upgrades to the storage circuit therein). The ranging cost is low and it also helps to ensure ranging accuracy to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0022] Figure 1A A schematic structural diagram of a DToF sensor provided by an exemplary embodiment of the present application;

[0023] Figure 1BA schematic diagram illustrating a principle of calculating the distance to a target object by a DToF sensor provided by an exemplary embodiment of the present application;

[0024] Figure 2A The statistical histogram provided for the exemplary embodiment of the present application is saturated / clipped;

[0025] Figure 2B The statistical histogram provided for the exemplary embodiment of the present application is a schematic diagram of a normal situation;

[0026] Figure 3 A flow chart of the distance detection method provided in this application;

[0027] Figures 4A to 4C This is an example diagram of three combinations of multiple time bit widths of the time counting circuit in the ranging system provided by this application;

[0028] Figure 5 A schematic diagram of a ranging application scenario provided by this application;

[0029] Figure 6A This is a schematic diagram of the structure of an electronic device exemplified in this application;

[0030] Figure 6B A schematic diagram of a specific form of an exemplary electronic device is provided for this application. DETAILED DESCRIPTION

[0031] DToF is widely used in various devices, such as smartphones and smart cars, due to its advantages such as large ranging range, strong resistance to complex background interference, fast dynamic response calculation, and high accuracy. The ranging principle of DToF is as follows:

[0032] See Figure 1AThe structure example of the DToF sensor shown in the figure includes: a transmitter Tx, a receiver Rx, a TDC circuit, and a storage circuit (also called a histogram circuit, a statistical circuit, etc.); wherein the storage circuit is a time-correlated single photon counting (TCSPC) circuit, which is used to perform histogram counting statistics on each photon based on the time interval from the emission to the reception of each photon to form a statistical histogram. A transmitter Tx emits a light beam (e.g., visible light, infrared light, ultraviolet light, etc.). At least a portion of the photons in the transmitted light beam strikes a target object, where they are reflected to form a reflected light beam. At least a portion of the photon signals in the reflected light beam are received by a receiver Rx. Each individual photon in at least a portion of the photons strikes an avalanche photodiode (SPAD), triggering an avalanche. The SPAD outputs an avalanche signal to a time-dependent diode (TDC) circuit. The TDC circuit then detects the time interval between each photon's emission from the transmitter Tx and the triggering of the avalanche. The time interval is then sent to a storage circuit, which then performs a histogram counting operation based on the time intervals. For example, if the time interval of a detected photon falls within time bin 5 in the histogram, an increment operation is performed on time bin 5 (i.e., the length (height) of the bar corresponding to time bin 5 is increased by one), resulting in a corresponding photon count. According to the statistical histogram finally formed by counting statistics, the time corresponding to the peak (the highest frequency) can be determined, and thus the target time t required for the light beam to be emitted by the transmitter Tx and received by the receiver Rx can be determined based on the time corresponding to the peak. The target time t is the flight time between the emitted light beam and the reflected light beam, and thus the distance d of the target object can be calculated based on the target time t and the known speed of light c, as shown in the following example: Figure 1B As shown, that is: d = (c*t) / 2, c = 3*10 8 m / s.

[0033] The above-mentioned histogram is constructed within the storage circuit corresponding to the TDC circuit. Specifically, the storage circuit includes a memory, and the histogram is constructed within the memory. The bin depth (i.e., the number of time intervals (bins)) and the maximum count value corresponding to each bin in the histogram are determined by the storage space size of the memory. For example, the storage space of the memory is (6*10) bits, where 6 bits correspond to the bin depth. Specifically, 6 bits correspond to a bin depth of 64, and 10 bits are the maximum count value (or peak count value) for each bin. Therefore, it can be understood that when the storage space of the memory is (6*10) bits, the constructed histogram can include 64 time intervals, and the maximum count value corresponding to each time interval is 10 bits (which can be simply understood as the maximum length of the bar corresponding to each time interval). The width and number of time intervals in the histogram determine the minimum and maximum time range that can be detected, thereby affecting the ranging accuracy and maximum ranging range. Continuing with the above example, if the required ranging range is 5000mm, the ranging accuracy corresponding to each bin in the histogram is 5000 / 64=78.125mm, that is, the time interval width of each bin is the ratio of 2*78.125mm to the speed of light c (i.e. 2*78.125mm / speed of light c). Although this can measure far distances, the ranging accuracy is low; and if the ranging accuracy corresponding to the bin is required to be 25mm, that is, the time interval width of the bin is required to be the ratio of 2*25mm to the speed of light c, then the farthest ranging range that can be achieved is 25*64=1600mm, which can ensure high ranging accuracy but small ranging. From the above, it is obvious that the ranging distance and ranging accuracy that DToF can take into account are limited by the storage space size of the memory, and the storage space size of the memory is restricted by the chip area. Therefore, without upgrading the hardware of the memory chip, DToF cannot take into account both long-distance ranging and high-precision ranging.

[0034] It is understood that the symbol “*” appearing in the context of this application represents a multiplication operation.

[0035] In addition, the required output power of the transmitter Tx will vary depending on the distance and reflectivity of the target object being measured. For example, when measuring a target object at a long distance or with low reflectivity, a large output power is required to achieve the histogram statistical effect. This is because: the larger the output power of the transmitter Tx, the higher the energy of its emitted light beam, which has a strong ability to penetrate dust, fog, etc., and can achieve a long irradiation distance; in addition, the emitted light beam will also contain more photons with high energy. By irradiating the target object with low reflectivity with more photons with high energy, it can be ensured that at least part of the photons will not be absorbed by the target object but will be reflected back by the target object, and the reflected photon signal is strong and can be received by the receiver Rx. However, a large output power means high power consumption and increased temperature. Moreover, when measuring a target object at a close distance or with high reflectivity, if the output power is still large, the photon signal received by the receiver Rx will appear as follows. Figure 2A The accumulation or saturation phenomenon shown in the figure causes the ranging signal to be distorted, resulting in a large ranging error, and even the inability to sense the signal for a certain period of time, making it impossible to measure the distance; if the output power is small, this can be avoided. Figure 2A The accumulation or saturation phenomenon shown in FIG makes the statistical histogram corresponding to the photon information received by the receiving end Rx as shown in FIG. Figure 2B As shown, this is normal. This shows that low output power is more conducive to measuring close-range or highly reflective targets, and it also helps to reduce power consumption and temperature rise.

[0036] In summary, when using DToF to achieve ranging, the solution adopted by this application is to dynamically adjust the time resolution of the TDC to integrate different ranging configurations such as long distance and high precision, and match the appropriate output power to avoid signal accumulation or saturation caused by output power redundancy, while also helping to reduce power consumption. Among them, TDC resolution refers to the minimum time that can be distinguished, such as the interval width of each bin in the aforementioned histogram.

[0037] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0038] In the embodiments of the present application, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical items or similar items with substantially the same functions and effects. For example, the first signal generating circuit and the second signal generating circuit are merely used to distinguish different signal generating circuits and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily mean that they are different.

[0039] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design scheme described in this application as "exemplary" or "for example" should be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In addition, "at least one" in this application refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, B exists alone, wherein A and B can be singular or plural, etc. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b and c can represent: a, b, c, a, b and c, a and b, a and c, b and c.

[0040] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

[0041] Figure 3 A flow chart of a distance detection method provided in one embodiment of the present application is shown, and the execution subject of the method is an electronic device with a distance measurement system. The electronic device may be, but is not limited to, a smart phone (such as a folding screen phone, a straight phone), a laptop computer, a tablet computer, and a vehicle-mounted laser radar, etc. The distance measurement system includes a transmitting end, a receiving end, and a time counting circuit; and further, the distance measurement system may also include a storage circuit. The time counting circuit is used to detect the time interval between each light signal being emitted by the transmitting end and being received by the receiving end, and the time interval of each light signal is stored in the storage circuit for histogram statistics. In a specific implementation, the above-mentioned distance measurement system is a DToF sensor system, and the time counting circuit is as follows. Figure 1A The TDC circuit in the DToF sensor is shown in FIG. For a detailed description of the working principle of each terminal and each circuit in the ranging system, please refer to the aforementioned combined Figure 1ADescribed in detail the DToF sensor-related content. It should be noted that in addition to the various terminals and / or circuits described above, the ranging system may also include other circuits, such as a processing circuit. The processing circuit can control the transmitting terminal to emit a light beam containing multiple light signals, and can also analyze the statistical results of the histogram to determine the corresponding detected distance information. Therefore, more specifically, the executor of the distance detection method provided in this embodiment may be the processing circuit in the ranging system. It should be noted that the optical signal described in this embodiment here can also be understood as the aforementioned photon, but different description methods are used in different embodiment scenarios.

[0042] like Figure 3 As shown, the distance detection method includes the following steps:

[0043] 101. Determine the number of time intervals included in the histogram corresponding to the time counting circuit;

[0044] 102. Based on the number of time intervals, combine multiple time bit widths of the time counting circuit to obtain multiple combination modes; wherein the combination module includes a correspondence between time intervals and time bit widths, and one time interval corresponds to at least one time bit width;

[0045] 103. Dynamically adjust the time interval width of the histogram according to multiple combination modes and data representing ranging requirements;

[0046] 104. Based on the time intervals detected by the time counting circuit between the optical signals transmitted by the transmitting end in the current frame and reflected by the target object and received by the receiving end, count and count the optical signals using the adjusted histogram to form a statistical histogram;

[0047] 105. Determine distance information corresponding to the target object detected in the current frame according to the statistical histogram.

[0048] In the above 101, the histogram is created in the storage circuit in the ranging system, so specifically: the storage space information of the storage circuit can be obtained, and the number of time intervals included in the histogram is determined according to the storage space information of the storage circuit.

[0049] The storage circuit includes a memory, which may be but is not limited to a random access memory (RAM), and directly exchanges data with a processing circuit in the ranging system.

[0050] Accordingly, the storage space information of the storage circuit may refer to the storage space size of the memory in the storage circuit. The storage space size is related to the memory chip area. When the memory chip area is fixed, the storage space size of the memory is also fixed. The storage space size of the memory corresponds to the number of time intervals (bins) of the histogram and the maximum count value corresponding to each time interval. For example, the storage space size of the memory is (6*10) bits, which represents that the corresponding histogram includes 64 time intervals, and the maximum count value corresponding to each time interval is 10 bits, or in other words, the maximum length of the bar corresponding to each time interval is 10 bits.

[0051] Based on the number of time intervals included in the histogram, the multiple time bit widths of the time counting circuit can be flexibly combined to implement different ranging configurations. For example, ranging configurations such as long-distance ranging with low ranging accuracy and short-distance ranging with high ranging accuracy can be implemented. A time bit width represents a time unit. For example, the time unit represented by a time bit width can be, but is not limited to, 500 ps, ​​600 ps, ​​etc., where ps represents picoseconds.

[0052] For example, the number of time intervals included in the histogram is 2 3 =8, the time bit width of the time counting circuit is 2 5 =32, and a time unit represented by a time bit width is 500ps as an example, then:

[0053] For example, see Figure 4A The first combination mode for achieving long-distance ranging is to combine every four time bit widths into a corresponding time interval. In this case, the width of each time interval is 500ps*4=2000ps (or the width of the bar corresponding to each time interval is 2000ps, that is, the time resolution of the time counting circuit is 2000ps), and the ranging depth corresponding to each time interval is [2000ps*(3*10 8 )m / s] / 2=0.3m=300mm (that is, the ranging accuracy of the ranging sensor is 300mm). The ranging range corresponding to the histogram is 0~2400mm (300mm*8). It can be seen that in this first combination mode, the normal peak shape of the histogram can be achieved when measuring a target object at a longer distance, but the ranging accuracy is low.

[0054] For example, see Figure 4B The second combination mode for achieving close-range ranging is to match the time bit width to the time interval one by one. In this case, the width of each time interval is 500 ps (that is, the time resolution of the time counting circuit is 500 ps), and the ranging depth corresponding to each time interval is [500 ps*(3*10 8)m / s] / 2=75mm (that is, the ranging accuracy of the ranging sensor is 75mm), and the ranging range corresponding to the histogram is 0~600mm (75mm*8). It can be seen that in this second combination mode, the normal peak shape of the histogram of the target object at a relatively close distance can be achieved, and the ranging accuracy is also relatively high.

[0055] For example, see Figure 4C The third combination mode for achieving moderate distance ranging is to combine two time bit widths to correspond to a time interval. In this case, the interval width of each time interval is 500ps*2=1000ps (that is, the time resolution of the time counting circuit is 1000ps), and the ranging depth corresponding to each time interval is [1000ps*(3*10 8 )m / s] / 2=0.15m=150mm (that is, the ranging accuracy of the ranging sensor is 150mm), and the ranging range corresponding to the histogram is 0~1200mm (150mm*8).

[0056] Based on the above example content, in the above 102, the multiple combination modes include: a first combination mode and a second combination mode; the number of time widths corresponding to a time interval in the first combination mode is greater than the number of time widths corresponding to a time interval in the second combination mode. Figure 4A As shown, the second combination mode can be seen in Figure 4B Of course, in addition to this, other combination modes may also be included, such as the third combination mode, where the number of time widths corresponding to a time interval in the first combination mode is greater than the number of time widths corresponding to a time interval in the second combination mode, and is less than the number of time widths corresponding to a time interval in the first combination mode, as can be seen. Figure 4C shown.

[0057] In combination with the data that characterizes the ranging requirements, such as the frame identifier corresponding to the light signal that the transmitter currently needs to transmit, the camera attribute information used in conjunction with the ranging sensor, etc., an adapted combination mode can be selected from a variety of combination modes to adjust the time interval width of the histogram. In specific implementation, you can first select one of the first combination mode and the second combination mode to preliminarily adjust the time interval width of the histogram, and then continue to make real-time dynamic adjustments in combination with other data information (such as the reflectivity and distance of the target object) during the subsequent detection process. Based on this, in a specific implementable solution, the above 103 "dynamically adjust the time interval width of the histogram according to the multiple combination modes and the data that characterizes the ranging requirements" can be implemented by the following steps:

[0058] 1031. Select a combination mode from the first combination mode and the second combination mode according to at least one of a frame number corresponding to the optical signal currently to be transmitted by the transmitting end and attribute information of a camera used in conjunction with the ranging sensor;

[0059] 1032. Adjust the time interval width of the histogram according to the number of time bit widths corresponding to a time interval in a selected combination mode and a time unit represented by the time bit width.

[0060] In the above 1031, the frame number indicates the frame number of the light beam emitted by the transmitter. Specifically, the light beam is emitted by a laser light source in the transmitter, and a light beam often contains multiple light signals (photons). Camera attribute information may include, but is not limited to, focal length, aperture value, and pixels. Depending on the parity of the frame number and whether the camera attribute information meets the requirements, the first or second combination mode can be selected to adjust the time interval width of the histogram.

[0061] For example, when the frame number is even, the first combination mode can be selected, that is, the combination mode for achieving long-distance ranging; conversely, when the frame number is odd, the second combination mode can be selected, that is, the combination mode for achieving short-distance and high-precision ranging, thereby integrating long-distance and high-precision ranging. Alternatively, of course, when the frame number is odd, the first combination mode can be selected; conversely, when the frame number is even, the second combination mode can be selected.

[0062] For example, if the camera used with the ranging sensor is a telephoto camera (a telephoto camera with a focal length greater than the set focal length threshold, such as a camera with a focal length greater than 50mm, primarily used to magnify distant objects), the first combination mode can be selected. If the camera is a macro camera or a main camera, the second combination mode can be selected. A macro camera is a camera with a focal length less than or equal to the set focal length threshold. The main camera generally refers to the most important camera in an electronic device's camera module, possessing the highest resolution, largest number of pixels, and largest aperture value.

[0063] Therefore, in some examples, the above step 1031 of "selecting a combination mode from the first combination mode and the second combination mode based on at least one of the frame number corresponding to the optical signal currently required to be transmitted by the transmitting end and the attribute information of the camera used in conjunction with the ranging sensor" may include:

[0064] If the frame number is an even number and / or the camera attribute information meets the preset requirements, the first combination mode is selected;

[0065] If the frame number is an odd number or the camera attribute information does not meet the preset requirements, the second combination mode is selected;

[0066] The camera attribute information meeting the preset requirements includes, but is not limited to, at least one of the following: focal length greater than a set focal length threshold, pixels less than or equal to a set pixel threshold, aperture value less than or equal to a set aperture threshold, and resolution less than or equal to a set resolution threshold. The camera attribute information not meeting the requirements includes, but is not limited to, at least one of the following: focal length less than or equal to a set focal length threshold, pixels greater than a set pixel threshold, aperture value greater than a set aperture threshold, and resolution greater than a set resolution threshold, etc.

[0067] In the above 1032 , the product value of the number of time bit widths corresponding to a time interval in a selected combination mode and a time unit represented by the time bit width can be determined first, and then the time interval width of the histogram can be adjusted to the product value.

[0068] Furthermore, after the adjustment is completed, when controlling the output power of the transmitter, the maximum ranging distance represented by the histogram can be followed, and the principle that long-distance ranging requires large output power and short-distance ranging requires small output power can be followed to control the light source in the transmitter to emit a light beam containing multiple optical signals at a certain output power, thereby avoiding the problem of redundant output power. Figure 2A The histogram shown in FIG. 1 is saturated, and the power consumption is reduced. Therefore, between step 103 and step 104, the method provided in this embodiment may further include the following steps:

[0069] S1. Determine the maximum ranging distance represented by the adjusted histogram according to the adjusted time interval width and the number of time intervals of the histogram;

[0070] The maximum distance represented by the histogram = the time interval width of the histogram * the number of corresponding time intervals * the speed of light c ÷ 2, where the speed of light c = 3 * 10 8 m / s.

[0071] S2. If the maximum ranging distance is greater than the set distance threshold, control the transmitting end to transmit the optical signal at a first output power W1; if the maximum ranging distance is less than or equal to the set distance threshold, control the transmitting end to transmit the optical signal at a second output power W2; the second output power W2 is less than the first output power W1.

[0072] In the above 104-105, the time counting circuit can record the time t0 of each optical signal transmitted in the current frame and the time t1 when it is received by the receiving end (such as the time that causes the SPAD avalanche in the receiving end), and calculate the time difference between the time t1 and the time t0 of each optical signal, thereby determining the time interval corresponding to each optical signal, and storing the time interval corresponding to each optical signal in the storage circuit connected thereto. Through the storage circuit, based on the time interval corresponding to each optical signal, the adjusted histogram can be used to count and count each optical signal. After completing the statistics for each optical signal in the current frame, a statistical histogram can be formed. Peak search of the statistical histogram can determine the peak value, and the time corresponding to the peak value is determined as the target time. Therefore, the product of half of the target time and the speed of light c is the distance between the target object and the electronic device detected in the current frame.

[0073] Furthermore, the method may further comprise the following steps:

[0074] 106. Determine, based on the object information of the target object, whether the time interval width of the histogram and / or the output power of the transmitter need to be adjusted for the next frame detection;

[0075] 107. When necessary, select an adapted combination mode from the multiple combination modes according to the object information to adjust the time interval width of the histogram and / or reduce or increase the output power of the transmitting end;

[0076] The object information includes: distance information of the target object detected in the current frame, and reflectivity of the target object to light signals.

[0077] The reflectivity of the target object to photons can also be determined based on the histogram counting statistics of the current frame. That is, before step 106, the method can further include the following step: determining the reflectivity of the target object to the light signal based on the statistical histogram.

[0078] For example, if the number of optical signals counted is greater than or equal to the set threshold value according to the statistical histogram finally formed, and the statistical histogram is as follows: Figure 2A As shown in , the saturation or clipping phenomenon can indicate that the number of light signals reflected back by the target object is large, that is, the target object has a high reflectivity of the light signal; and if the statistical histogram is as shown in Figure 2B As shown, normal, it indicates that the reflectivity of the target object to the light signal is moderate. If it is determined according to the statistical histogram that the total number of received light signals is less than the set threshold, it indicates that the reflectivity of the target object to the light signal is low.

[0079] When the reflectivity of the target object is high or low, it may be determined that the output power of the transmitter needs to be adjusted to appropriately reduce or increase the output power.

[0080] If the distance between the currently detected target object and the ranging sensor is much smaller or much larger than the maximum ranging range represented by the histogram corresponding to the current frame, it can be determined that the time interval width of the histogram needs to be adjusted.

[0081] In order to facilitate understanding of the present application solution, a specific application scenario is given below. In the following application scenario, the number of time intervals included in the histogram corresponding to the ranging system is 8, and the number of time bit widths of the time counting circuit is 32 is taken as an example.

[0082] If combined Figure 5 , assuming that the smartphone includes multiple cameras and a ranging system (a DToF sensor system, not shown in the figure), the ranging system is used in conjunction with a telephoto camera among the multiple cameras. Initially, the ranging configuration set for the ranging system is: for even frames, according to Figure 4A The first combination mode shown (4 time bit widths are combined to correspond to a time interval), adjusts the interval width of each time interval in the histogram to the product value of 4 and the time unit represented by a time bit width, such as adjusting it to 4*500ps=2000ps. At this time, the ranging range corresponding to the histogram is, for example, 0 to 2400mm; and the output power set for the transmitter in the ranging system is the first output power (high power). According to the above ranging configuration, start controlling the ranging sensor to perform the 0th frame distance detection. Through the 0th frame distance detection, it is detected that the distance to the target object smartphone is 1000mm (much less than 2400mm) and the reflectivity is high (such as can be determined based on the saturation phenomenon of the statistical value of the third time interval in the histogram). At this time, it is determined that the ranging configuration needs to be adjusted when performing the next frame (1st frame) distance detection. When determining the corresponding combination mode for the next frame, the combination mode with the smallest difference between the maximum ranging distance represented by the corresponding histogram and the currently detected distance can be selected to adjust the interval width of each time interval in the histogram. For example, Figure 4C The maximum ranging distance represented by the histogram corresponding to the third combination mode shown in FIG is 1200 mm, which has the smallest difference from the above-mentioned detected distance of 1000 mm. Based on the third combination mode (i.e., the two time bit widths are combined to correspond to a time interval), for the next frame, the interval width of each time interval in the histogram can be adjusted to the product value of 2 and the time unit represented by a time bit width, such as 2*500ps=1000ps; in addition, due to the high reflectivity of the target object, the output power of the transmitter needs to be reduced when performing the distance detection of the next frame. For example, the output power of the transmitter in the next frame is the third output power, which is less than the first output power and greater than the aforementioned second output power (such as Figure 4B Based on this adjusted distance measurement configuration, when performing the first frame distance detection, the time counting circuit in the distance measurement sensor (such as Figure 1A The time resolution of the TDC circuit shown in FIG2 is improved. Specifically, the time resolution is increased from 2000 ps to 1000 ps. Accordingly, the ranging accuracy is also improved from 300 mm to 150 mm. The ranging accuracy is calculated as half of the time resolution multiplied by the speed of light. Moreover, the output power of the transmitter is reduced, which also reduces power consumption.

[0083] In summary, the distance detection solution provided by the present application can achieve different ranging configurations such as long distance and high precision by dynamically adjusting the time resolution of the time counting circuit in the ranging sensor without the need to upgrade the hardware of the ranging sensor. Moreover, at the same time, the transmitting end in the ranging sensor transmits the optical signal with an adapted output power, which can avoid the histogram saturation phenomenon caused by output power redundancy and help reduce power consumption.

[0084] The present application also provides a ranging system, which is a ranging system based on direct time of flight. Its structure can be found in Figure 1A The system structure of the DToF sensor is shown. Specifically, the ranging system includes:

[0085] Transmitter Tx, used to transmit optical signals;

[0086] The receiving end Rx is used to receive the optical signal;

[0087] a time counting circuit connected to the receiving end Rx, for detecting the time interval between each optical signal being sent from the transmitting end and being received by the receiving end, and storing the time interval of each optical signal in the storage circuit;

[0088] a storage circuit connected to the time counting circuit, and configured to perform histogram counting statistics on each optical signal according to the time interval of each optical signal;

[0089] The processing circuit is connected to the storage circuit and is configured to implement the steps of the distance detection method provided in other embodiments of the present application. Furthermore, the processing circuit is also connected to the transmitter Tx and is configured to control the light source in the transmitter Tx to emit a light beam containing multiple optical signals. The time counting circuit may be a TDC circuit.

[0090] For detailed description of the functions of the above terminals / circuits, please refer to the relevant content in other embodiments of this application.

[0091] The above-mentioned ranging system is deployed on corresponding electronic devices. Figure 6BSome example forms of electronic devices are shown, and the electronic devices may be, for example, smartphones (such as foldable phones and candy-bar phones), tablets, and laptops. In addition, they may also be drones, vehicle-mounted lidars, etc. Based on this, the present application also provides an electronic device that includes the ranging system provided in other embodiments of the present application.

[0092] For example, Figure 6A The schematic diagram of the structure of the electronic device is shown as an example. The ranging system may be a distance sensor included in the electronic device, more specifically, a DToF sensor. In addition, the electronic device 100 may further include: a memory 121 and a processor 110;

[0093] The memory storage 121 is used to store programs. Specifically, the memory storage 121 can be used to store computer executable program codes, and the executable program codes include instructions. The memory storage 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory storage 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the memory storage 121, and / or instructions stored in a memory provided in the processor.

[0094] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0095] The processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.

[0096] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0097] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0098] Furthermore, in addition to the functional components described above, Figure 6A As shown, the electronic device 100 also includes: an external memory interface 120, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0099] Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0100] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0101] Furthermore, it should be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from those in the above embodiments, or a combination of multiple interface connection methods.

[0102] Electronic device 100 implements display functionality through a GPU (Graphics Processing Unit), display screen 194, and an application processor. The GPU connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0103] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0104] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0105] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0106] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0107] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0108] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0109] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer, can implement one or more steps in any of the above methods.

[0110] The computer readable storage medium may be a non-transitory computer readable storage medium, for example, a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0111] Another embodiment of the present application further provides a computer program product comprising instructions, which, when executed by a computer, can implement one or more steps in any of the above methods.

[0112] Among them, the electronic device, computer-readable storage medium, and computer program product provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0113] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0114] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0115] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0117] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A distance detection method, characterized in that: Applied to electronic equipment, the method includes: Obtaining the frame identifier corresponding to the optical signal currently to be transmitted; If the frame identifier is an even number, the electronic device uses the first combination mode to perform distance detection; If the frame identifier is an odd number, the electronic device uses the second combination mode to perform distance detection; The first combination mode and the second combination mode have different ranging ranges and ranging accuracies.

2. The method according to claim 1, characterized in that The output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is greater than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode; Alternatively, the output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is smaller than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode.

3. The method according to claim 1, characterized in that The ranging range of the first combination mode is greater than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is less than the ranging accuracy of the second combination mode; Alternatively, the ranging range of the first combination mode is smaller than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is greater than the ranging accuracy of the second combination mode.

4. The method according to any one of claims 1 to 3, characterized in that Also includes: Determining a maximum ranging distance of the electronic device according to the ranging range of the combined mode used; If the maximum ranging distance is greater than a set distance threshold, the electronic device transmits an optical signal at a first output power; If the maximum ranging distance is less than or equal to the set distance threshold, the electronic device transmits an optical signal at a second output power; wherein the second output power is less than the first output power.

5. A distance detection method, characterized in that: Applied to electronic equipment, the method includes: Acquiring attribute information of a camera used in conjunction with a ranging function of the electronic device; If the attribute information indicates that the camera is in telephoto mode, the first combination mode is used for distance detection; If the attribute information indicates that the camera is in macro mode, the second combination mode is used for distance detection; The first combination mode and the second combination mode have different ranging ranges and ranging accuracies.

6. The method according to claim 5, characterized in that The output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is greater than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode; Alternatively, the output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is less than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode; Wherein, the electronic device uses the emitted light signal to perform distance detection.

7. The method according to claim 5, characterized in that The ranging range of the first combination mode is greater than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is less than the ranging accuracy of the second combination mode; Alternatively, the ranging range of the first combination mode is smaller than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is greater than the ranging accuracy of the second combination mode.

8. The method according to any one of claims 5 to 7, characterized in that Determining a maximum ranging distance of the electronic device according to the ranging range of the combined mode used; If the maximum ranging distance is greater than a set distance threshold, the electronic device transmits an optical signal at a first output power; If the maximum ranging distance is less than or equal to the set distance threshold, the electronic device transmits an optical signal at a second output power; wherein the second output power is less than the first output power.

9. An electronic device, characterized in that: It comprises a distance measuring system; the distance measuring system comprises a transmitting end and a processing circuit, the transmitting end is used to transmit an optical signal, and the processing circuit is used to implement the distance detection method according to any one of claims 1 to 4 above.

10. An electronic device, characterized in that: The device comprises a camera and a distance measuring system; the camera comprises a telephoto mode and a macro mode; the distance measuring system comprises a processing circuit, and the processing circuit is used to implement the distance detection method according to any one of claims 5 to 8.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the distance detection method according to any one of claims 1 to 4 or claims 5 to 8 can be implemented.

12. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, enables the processor to implement the distance detection method according to any one of claims 1 to 4 or claims 5 to 8.