Ranging method and electronic device

CN116256741BActive Publication Date: 2026-10-09HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111508464.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2026-10-09
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

[0006]本申请实施例提供一种测距方法及电子设备,能够减少对存储空间的内存的使用,提高存储空间的利用率,从而解决了传统技术中存储压力较大,存储空间不足的问题

Benefits of technology

[0023]Fourthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on a computing device, cause the computing device to perform the method described in any one of the first aspects and their possible implementations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116256741B_ABST
    Figure CN116256741B_ABST
Patent Text Reader

Abstract

The application discloses a ranging method and an electronic device, relates to the field of laser radars, and can solve the problem of insufficient storage space. The method is applied to an electronic device, the electronic device is configured with multiple intervals, and each interval is used for representing a time range in which a signal transmission time is located. The method comprises the following steps: dividing the multiple intervals into multiple first time ranges, each interval is divided into at least one first time range; saving, in sequence, a count value corresponding to each first time range divided by each interval according to the interval; wherein the count values corresponding to the first time ranges divided by different intervals are multiplexed in a same target storage space; determining, as a first target time range, a first time range corresponding to a target count value in the multiple first time ranges; dividing the first target time range into multiple second time ranges; saving count values corresponding to the multiple second time ranges; and predicting a distance between a to-be-measured object and the electronic device based on the count values corresponding to the multiple second time ranges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lidar, and more particularly to a ranging method and electronic device. Background Technology

[0002] With the development of artificial intelligence technology, the technique of measuring the distance between an electronic device and the object under test by using pulse signals is being applied to all aspects of real life.

[0003] An existing distance measurement method, such as Figure 1 As shown, an electronic device transmits a pulse signal to the object under test. After the pulse signal reaches the object under test, a portion of the pulse signal is reflected back to the electronic device. Subsequently, the electronic device records the count values ​​of each coarse-precision time range in the target storage space based on the transmission time of the reflected portion of the pulse signal (the transmission time refers to the time interval between the electronic device transmitting the pulse signal to the object under test and receiving the pulse signal reflected by the object under test). The count value of the coarse-precision time range is used to characterize the number of pulse signals whose transmission time falls within the coarse-precision time range.

[0004] After executing the above method multiple times, the coarse-precision time range with the largest count value among all coarse-precision time ranges is determined as the target coarse-precision time range. Then, the target coarse-precision time range is divided into fine-precision ranges to obtain multiple fine-precision time ranges. After performing a similar method on these multiple fine-precision time ranges, the fine-precision time range with the largest count value among all fine-precision time ranges is determined as the target time range. The distance between the electronic device and the object under test is determined based on this target time range.

[0005] However, in the above-mentioned technical means, the target storage space needs to record the count values ​​of all coarse-precision time ranges at the same time, which puts a lot of pressure on the target storage space and further leads to the problem of insufficient storage space. Summary of the Invention

[0006] This application provides a ranging method and electronic device that can reduce the use of memory in storage space and improve the utilization rate of storage space, thereby solving the problems of high storage pressure and insufficient storage space in traditional technologies.

[0007] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0008] In a first aspect, embodiments of this application provide a ranging method applied to an electronic device. The electronic device is configured with multiple intervals, each interval representing a time range in which a signal transmission time occurs. The signal transmission time is the time interval between the electronic device transmitting a signal to a target object and receiving a signal reflected from the target object. The method includes: dividing the multiple intervals into multiple first time ranges, each interval being divided into at least one first time range; sequentially storing the count value corresponding to the first time range divided by each interval according to the multiple intervals; wherein the count value corresponding to the first time range represents the number of signals in the first time range in which the signal transmission time occurs, and the count values ​​corresponding to the first time ranges divided by different intervals reuse the same target storage space; determining the first time range corresponding to the target count value among the multiple first time ranges as a first target time range; wherein the target count value is the count value representing the largest number of signals among the count values ​​corresponding to the multiple first time ranges; dividing the first target time range into multiple second time ranges; storing the count values ​​corresponding to the multiple second time ranges; wherein the count values ​​corresponding to the second time ranges represent the number of signals in the second time range in which the signal transmission time occurs; and predicting the distance between the target object and the electronic device based on the count values ​​corresponding to the multiple second time ranges.

[0009] Compared to existing technologies, the ranging method provided in this application does not simultaneously store all count values ​​corresponding to the first time range in the target storage space. Instead, it sequentially stores the count values ​​corresponding to the first time range divided by each interval. The count values ​​corresponding to the first time range divided by different intervals reuse the same target storage space. For example, after the electronic device stores the count values ​​corresponding to each first time range in the first interval in the target storage space, it releases the target storage space so that the target storage space can store the count values ​​corresponding to each first time range in the second interval. This reduces the storage pressure on the target storage space, improves the utilization rate of the storage space, and solves the problems of high storage pressure and insufficient storage space in traditional technologies.

[0010] In one possible implementation, the aforementioned multiple intervals include a first interval and a second interval. The step of sequentially saving the count values ​​corresponding to the first time ranges divided by each interval includes: saving the count values ​​corresponding to M first time ranges divided by the first interval in the target storage space; where M is an integer greater than or equal to 1; determining a first candidate range based on the count values ​​corresponding to the M first time ranges, where the first candidate range is the first time range with the largest corresponding count value among the M first time ranges; and releasing the target storage space, where the released target storage space is used to save the count values ​​corresponding to N first time ranges divided by the second interval during the process of determining the second candidate range corresponding to the second interval, where the second candidate range is the first time range with the largest corresponding count value among the N first time ranges; where N is an integer greater than or equal to 1; and where the first target time range is determined based on the first and second candidate ranges.

[0011] In one possible implementation, determining the first candidate range based on the count values ​​corresponding to the M first time ranges includes: correcting the count values ​​corresponding to the M first time ranges based on the Coates algorithm to obtain corrected count values ​​corresponding to the M first time ranges; determining the first candidate range based on the corrected count values ​​corresponding to the M first time ranges; wherein the first candidate range is the first time range with the largest corrected count value among the M first time ranges.

[0012] The ranging method provided in this application embodiment involves an electronic device that uses the Coates algorithm to correct the count values ​​corresponding to M first time ranges, thereby obtaining corrected count values ​​corresponding to M first time ranges. This reduces the influence of ambient light on the count values ​​corresponding to the M first time ranges. Then, the electronic device determines a first candidate range based on the corrected count values ​​corresponding to the M first time ranges, thereby improving the accuracy of the first candidate range.

[0013] In one possible implementation, the electronic device includes a receiver that transmits Y signals during the process of determining the first candidate range, where Y is an integer greater than or equal to 1; during the transmission of the Y signals, the receiver is turned on within the first interval and turned off in other intervals, the other intervals including the second interval.

[0014] In this way, by controlling the receiver to work in a specific range and stopping it in other ranges, interference from ambient light in other ranges is effectively suppressed, thereby improving the accuracy of distance measurement.

[0015] In one possible implementation, after determining the first time range corresponding to the target count value in multiple first time ranges as the first target time range, the target storage space is released so that the count value corresponding to the second time range can reuse the target storage space.

[0016] The ranging method provided in this application releases the target storage space through an electronic device, so that the count values ​​corresponding to the second time range can reuse the target storage space. Compared with the prior art, which stores all count values ​​corresponding to the first time range and all count values ​​corresponding to the second time range in the target storage space at the same time, the ranging method provided in this application reduces the storage pressure on the storage space and improves the utilization rate of the storage space.

[0017] Secondly, embodiments of this application provide an electronic device, including: a configuration module, a division module, a storage module, a determination module, and a prediction module; the configuration module is used to configure multiple intervals in the electronic device, each interval representing a time range in which a signal transmission time occurs, the signal transmission time being the time interval between the electronic device transmitting a signal to a test object and receiving a signal reflected from the test object; the division module is used to divide the multiple intervals into multiple first time ranges, each interval being divided into at least one first time range; the storage module is used to sequentially store the count value corresponding to the first time range divided by each interval according to the intervals; wherein, the count value corresponding to the first time range represents the number of signals in the first time range in which the signal transmission time occurs. The count values ​​corresponding to the first time ranges divided by different intervals reuse the same target storage space; the determining module is used to determine the first time range corresponding to the target count value in the multiple first time ranges as the first target time range; wherein, the target count value is the count value representing the largest number of signals among the count values ​​corresponding to the multiple first time ranges; the dividing module is also used to divide the first target time range into multiple second time ranges; the storage module is also used to save the count values ​​corresponding to the multiple second time ranges; wherein, the count values ​​corresponding to the second time ranges are used to represent the number of signals whose signal transmission time is in the second time range; the prediction module is used to predict the distance between the object under test and the electronic device based on the count values ​​corresponding to the multiple second time ranges.

[0018] In one possible implementation, the electronic device further includes: a release module; the storage module is specifically used to store the count values ​​corresponding to M first time ranges divided by the first interval in the target storage space; wherein M is an integer greater than or equal to 1; the determining module is used to determine a first candidate range based on the count values ​​corresponding to the M first time ranges, wherein the first candidate range is the first time range with the largest corresponding count value among the M first time ranges; the release module is used to release the target storage space, wherein the released target storage space is used to store the count values ​​corresponding to N first time ranges divided by the second interval during the process of determining the second candidate range corresponding to the second interval, wherein the second candidate range is the first time range with the largest corresponding count value among the N first time ranges; N is an integer greater than or equal to 1; wherein the first target time range is determined based on the first candidate range and the second candidate range.

[0019] In one possible implementation, the electronic device further includes: a correction module; the correction module is used to correct the count values ​​corresponding to the M first time ranges based on the Coates algorithm to obtain the corrected count values ​​corresponding to the M first time ranges; the determining module is specifically used to determine the first candidate range based on the corrected count values ​​corresponding to the M first time ranges; wherein, the first candidate range is the first time range with the largest corrected count value among the M first time ranges.

[0020] In one possible implementation, the electronic device further includes a transceiver module and a control module; the transceiver module is used to transmit Y signals during the process of determining the first candidate range; wherein Y is an integer greater than or equal to 1; the control module is used to turn on the receiver in the first interval and turn off the receiver in other intervals during the transmission of the Y signals, the other intervals including the second interval.

[0021] In one possible implementation, the release module is further configured to release the target storage space after determining the first time range corresponding to the target count value in the plurality of first time ranges as the first target time range, so that the count value corresponding to the second time range can reuse the target storage space.

[0022] Thirdly, embodiments of this application provide a ranging device, including a memory and a processor, wherein the memory is coupled to the processor; the memory is used to store computer program code, wherein the computer program code includes computer instructions; when the computer instructions are executed by the processor, the ranging device performs the method described in the first aspect and any one of its possible implementations.

[0023] Fourthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on a computing device, cause the computing device to perform the method described in any one of the first aspects and their possible implementations.

[0024] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the method described in any one of the first aspects and their possible implementations.

[0025] It should be understood that the beneficial effects achieved by the second to fifth aspects of the technical solutions and the corresponding possible implementations of the embodiments of this application can be referred to the above-described technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description

[0026] Figure 1 A schematic diagram of signal transmission provided in an embodiment of this application;

[0027] Figure 2 Figure A in the figure is a schematic diagram of a coarse-precision histogram provided in an embodiment of this application;

[0028] Figure 2 Figure B in the figure is a schematic diagram of a fine-precision histogram provided in an embodiment of this application;

[0029] Figure 3 A hardware schematic diagram of an electronic device provided in an embodiment of this application;

[0030] Figure 4 A schematic flowchart of a ranging method provided in this application embodiment. Figure 1 ;

[0031] Figure 5 This application provides a schematic diagram of a preset time interval, interval, and time range as an embodiment of the present application.

[0032] Figure 6 A schematic diagram of an interval histogram provided in an embodiment of this application;

[0033] Figure 7 A schematic diagram illustrating the division of a second time range as provided in an embodiment of this application;

[0034] Figure 8 A schematic flowchart of a ranging method provided in this application embodiment. Figure 2 ;

[0035] Figure 9 A schematic flowchart of a ranging method provided in this application embodiment. Figure 3 ;

[0036] Figure 10 A schematic flowchart of a ranging method provided in this application embodiment. Figure 4 ;

[0037] Figure 11 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation

[0038] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0039] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first interval" and "second interval," etc., are used to distinguish different intervals, not to describe a specific order of intervals.

[0040] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0041] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple first time ranges refer to two or more time ranges.

[0042] In this embodiment of the application, nanosecond A (ns) to nanosecond B is abbreviated as AB, where AB represents a time period greater than nanosecond A and less than or equal to nanosecond B. For example, 0ns to 350ns can be abbreviated as 0-350 to represent a time period greater than 0ns and less than or equal to 350ns, which will not be elaborated further.

[0043] With the development of technology, the technique of measuring distance by emitting pulse signals through electronic devices is being used more and more widely in real life.

[0044] An existing distance measurement method, such as Figure 1As shown, the electronic device transmits a pulse signal to the object under test and records the signal transmission time. After the pulse signal contacts the object under test, a portion of the pulse signal is reflected back to the electronic device. At this time, the electronic device receives the reflected portion of the pulse signal (i.e., the target signal) and records the signal reception time. Then, the electronic device determines the transmission time of the target signal based on the signal reception time and the signal transmission time. Finally, based on the transmission time of the target signal, the electronic device determines the time range within a preset time interval where the signal transmission time falls, and records the count value of the time range in the target storage space. The preset time interval is the maximum time period from when a pulse signal is transmitted to when it is reflected back. The preset time interval includes multiple time ranges, and the count value of the time range is used to characterize the number of target signals whose signal transmission time falls within that time range.

[0045] After executing the above method multiple times, a coarse-precision histogram is plotted based on the count values ​​recorded in the target storage space for each time range, as shown below. Figure 2 As shown in Figure A, the preset time interval is from 0 ns to 350 ns. This preset time interval includes seven time ranges: 0 ns to 50 ns (abbreviated as 0-50), 50-100, 100-150, 150-200, 200-250, 250-300, and 300-350. Among them, the time range 200-250 has the largest count value, meaning that 200-250 is the time range with the highest precision. Therefore, 200-250 is determined as the target time range for coarse precision. Then, this coarse precision target time range is further divided into multiple fine precision time ranges. After performing the above method multiple times on these multiple fine precision time ranges, a fine precision histogram is plotted. Figure 2 As shown in Figure B, the electronic device divides the aforementioned coarse-precision target time range (200-250) into five fine-precision time ranges: 200-210, 210-220, 220-230, 230-240, and 240-250. Among these, 220-230 is the fine-precision time range with the largest count value. Therefore, the electronic device determines 220-230 as the target time range, and the distance between the electronic device and the object under test is determined based on this target time range.

[0046] However, in the above technical solution, the target storage space needs to record the count values ​​of all coarse-precision time ranges at the same time, which increases the storage pressure on the target storage space and further leads to the problem of insufficient storage space.

[0047] For example, Figure 3 This is a hardware schematic diagram of an electronic device provided in an embodiment of this application, such as... Figure 3As shown, the electronic device includes a processor 301, a memory 302, and a transceiver 303.

[0048] The processor 301 includes one or more CPUs. The CPU can be a single-core CPU or a multi-core CPU.

[0049] The memory 302 includes, but is not limited to, RAM, ROM, EPROM, flash memory, or optical memory.

[0050] Optionally, the processor 301 implements the ranging method provided in the embodiments of this application by reading instructions stored in the memory 302, or the processor 301 implements the ranging method provided in the embodiments of this application by internally stored instructions. When the processor 301 implements the method in the above embodiments by reading instructions stored in the memory 302, the memory 302 stores instructions for implementing the ranging method provided in the embodiments of this application.

[0051] The transceiver 303 includes a signal transmitter and a signal receiver. The signal transmitter is used to transmit signals, and the signal receiver is used to receive the reflected signals. The signal receiver is used to receive the first returned photon signal.

[0052] Optionally, the electronic device also includes a bus 304, through which the processor 301, memory 302, and transceiver 303 are typically interconnected, or in other ways.

[0053] This application provides a ranging method, which is executed by an electronic device, such as... Figure 4 As shown, the method may include: S410-S460.

[0054] S410, the electronic equipment divides multiple intervals into multiple first time ranges.

[0055] The aforementioned electronic device is configured with multiple intervals, each interval being used to characterize the time range in which the signal transmission time is located. The signal transmission time is the time interval between when the electronic device transmits a signal to the object under test and when it receives the signal reflected by the object under test.

[0056] It should be noted that the multiple intervals configured in the aforementioned electronic device are obtained by dividing the device into preset time intervals, which represent the maximum estimated signal transmission time range. The sizes of these multiple intervals can be the same or different. The size of an interval is the difference between its maximum and minimum values, and can also be referred to as the interval's width / time width.

[0057] For example, such as Figure 5As shown, the electronic device divides the preset time interval into a first interval and a second interval, wherein the first interval is 0-200 and the second interval is 200-400; when the transmission time of a signal is 100ns, the transmission time of the signal belongs to the first interval; when the transmission time of a signal is 350ns, the transmission time of the signal belongs to the second interval.

[0058] Multiple intervals are divided into multiple first time ranges, wherein each interval is divided into at least one first time range, and the number of first time ranges in each interval is an integer. The different first time ranges are of equal size. The number of first time ranges in different intervals may be equal or unequal.

[0059] For example, such as Figure 5 As shown, the first interval and the second interval are divided into 8 first time ranges. The first interval includes 4 first time ranges, namely 0-50, 50-100, 100-150 and 150-200; the second interval also includes 4 first time ranges, namely 200-250, 250-300, 300-350 and 350-400.

[0060] S420: The electronic device sequentially saves the count value corresponding to the first time range divided by each interval.

[0061] The count value corresponding to the first time range mentioned above is used to characterize the number of signals whose transmission time is within the first time range.

[0062] For example, such as Figure 6 As shown, the count value corresponding to the first time range of 0-50 is 80, which means that there are 80 signals with transmission times between 0ns and 50ns.

[0063] It should be noted that the counting values ​​corresponding to the first time ranges divided by the different intervals mentioned above reuse the same target storage space, including: after storing the counting values ​​corresponding to each first time range in the first interval in the target storage space, releasing the target storage space so that the target storage space can store the counting values ​​corresponding to each first time range in the second interval.

[0064] S430, the electronic device determines the first time range corresponding to the target count value among multiple first time ranges as the first target time range.

[0065] The target count value mentioned above is the count value that represents the largest number of signals among the count values ​​corresponding to multiple first time ranges. In other words, the first target time range is the first time range with the largest corresponding count value among all intervals.

[0066] For example, such as Figure 6 As shown, the count value corresponding to the first time range 200-250 is greater than the count values ​​corresponding to other first time ranges. Therefore, the first time range 200-250 is determined as the first target time range.

[0067] S440, the electronic device divides the first target time range into multiple second time ranges.

[0068] The above step S440 is to divide the first target time range into more granular parts so that the first target time range includes multiple second time ranges.

[0069] For example, based on the example in S430, such as Figure 7 As shown, the electronic device divides the first target time range 200-250 into 10 second time ranges, which are: 200-205, 205-210, 210-215, 215-220, 220-225, 225-230, 230-235, 235-240, 240-245, and 245-250.

[0070] S450: The electronic device stores multiple count values ​​corresponding to a second time range.

[0071] The count value corresponding to the second time range mentioned above is used to characterize the number of signals whose signal transmission time is within that second time range.

[0072] It should be noted that the implementation of S450 above is similar to storing the count values ​​corresponding to the M first time ranges divided by the first interval in S910 below. For a detailed description of S450, please refer to the relevant description of S910 below, which will not be repeated here.

[0073] S460, The electronic device predicts the distance between the object under test and the electronic device based on count values ​​corresponding to multiple second time ranges.

[0074] The above-mentioned prediction of the distance between the object to be tested and the electronic device specifically includes: S1-S2.

[0075] S1. The electronic device determines a second target time range based on the count values ​​corresponding to multiple second time ranges. The second target time range is the second time range with the largest corresponding count value among the multiple second time ranges.

[0076] S2. Predict the distance between the object under test and the electronic device based on the second target time range.

[0077] The above prediction of the distance between the object under test and the electronic device based on the second target time range can be based on the following formula 1:

[0078] Formula (1) s = vt / 2

[0079] In Formula 1 above, s represents the distance between the object under test and the electronic device; v represents the speed of light; and t represents the signal transmission time, where t takes a value within the second target time range.

[0080] This application provides a ranging method in which an electronic device divides multiple intervals into multiple first time ranges, with each interval being divided into at least one first time range; and sequentially saves the count value corresponding to the first time range divided in each interval according to the interval, with the count values ​​corresponding to the first time range divided in different intervals reusing the same target storage space; then, the electronic device determines the first time range corresponding to the target count value among the multiple first time ranges as the first target time range; subsequently, the electronic device further divides the first target time range into multiple second time ranges and saves the count values ​​corresponding to the multiple second time ranges; finally, the electronic device predicts the distance between the object to be measured and the electronic device based on the count values ​​corresponding to the multiple second time ranges. Compared to existing technologies, the ranging method provided in this application does not simultaneously store the count values ​​corresponding to all first time ranges in the target storage space. Instead, it sequentially stores the count values ​​corresponding to the first time ranges divided by each interval. The count values ​​corresponding to the first time ranges divided by different intervals reuse the same target storage space. That is, after the electronic device stores the count values ​​corresponding to each first time range in the first interval in the target storage space, it releases the target storage space so that the target storage space can store the count values ​​corresponding to each first time range in the second interval. This reduces the storage pressure on the target storage space, improves the utilization rate of the storage space, and solves the problems of high storage pressure and insufficient storage space in traditional technologies.

[0081] When there are many counts in the second time range, the target storage space needs to store all the counts corresponding to the second time range at the same time. At this time, the storage pressure on the target storage space is large, which further leads to the problem of insufficient storage space.

[0082] Optionally, based on the problems mentioned above, S440-S450 can be replaced with a method similar to S410-S430. For details, please refer to the relevant descriptions of S910-S960 below, which will not be repeated here.

[0083] Optional, combined Figure 4 ,like Figure 8 As shown, the ranging method provided in this application embodiment further includes S810 after S430.

[0084] S810, The electronic device releases the target storage space so that the count value corresponding to the second time range can reuse the target storage space.

[0085] Specifically, S810 includes: clearing / deleting all count values ​​corresponding to the first time range in the target storage space, so that the target storage space can be used to store count values ​​corresponding to the second time range. Since the time width of the second time range is smaller than the time width of the first time range, i.e., the first time range is a coarse-precision time range and the second time range is a fine-precision time range; that is, the electronic device saves the count values ​​corresponding to different precision time ranges in sequence according to precision, and the count values ​​corresponding to different precision time ranges reuse the same target storage space.

[0086] The ranging method provided in this application releases the target storage space through an electronic device, so that the count values ​​corresponding to the second time range can reuse the target storage space. Compared with the prior art, which stores all count values ​​corresponding to the first time range and all count values ​​corresponding to the second time range in the target storage space at the same time, the ranging method provided in this application reduces the storage pressure on the storage space and improves the utilization rate of the storage space.

[0087] Optional, such as Figure 9 As shown, when the above multiple intervals include the first interval and the second interval, the specific implementation of the above S420-S430 includes: S910-S960.

[0088] S910. The electronic device stores the count values ​​corresponding to the M first time ranges divided by the first interval in the target storage space.

[0089] M is an integer greater than or equal to 1.

[0090] For example, such as Figure 6 As shown, assuming the target storage space includes 4 storage blocks, the electronic device stores the count value 80 corresponding to the first time range 0-50 on the first storage block, the count value 120 corresponding to the first time range 50-100 on the second storage block, the count value 100 corresponding to the first time range 100-150 on the third storage block, and the count value 160 corresponding to the first time range 150-200 on the fourth storage block.

[0091] The count values ​​corresponding to the aforementioned M first time ranges are the count values ​​corresponding to the M first time ranges after the electronic device sequentially sends a predetermined number of signals. Specifically, after the electronic device sends a signal, it determines the first time range corresponding to the signal based on the transmission time of the signal. Then, the electronic device increments the count value corresponding to the first time range in the target storage space by 1. After that, the electronic device sends the next signal, and so on, until the electronic device has sent out the predetermined number of signals, thus obtaining the count values ​​corresponding to the M first time ranges.

[0092] It should be noted that when an electronic device transmits a signal and does not receive a reflected signal within a predetermined time, the electronic device sends the next signal. The predetermined time is greater than or equal to the maximum time in the preset time interval.

[0093] For example, based on the above example, assuming the preset time is 600ns, after the electronic device transmits a signal, the transmission time of the signal is 40ns. The electronic device increments the count value in the first storage block in the target storage space by 1. Then, the electronic device transmits a second signal. If the electronic device does not receive the signal within 600ns after transmitting the second signal, the electronic device directly sends a third signal.

[0094] S920: The electronic device determines the first candidate range based on the count values ​​corresponding to the M first time ranges.

[0095] The first candidate range mentioned above is the first time range with the largest corresponding count value among the M first time ranges.

[0096] For example, such as Figure 6 As shown, the first interval includes four first time ranges. The count value corresponding to the first time range 0-50 is 80, the count value corresponding to the first time range 50-100 is 120, the count value corresponding to the first time range 100-150 is 100, and the count value corresponding to the first time range 150-200 is 160. Since the count value corresponding to the first time range 150-200 is the largest, the first time range 150-200 is determined as the first candidate range.

[0097] It should be noted that when there are multiple first time ranges with the largest corresponding count values ​​among the M first time ranges, one of the first time ranges with the largest count value can be randomly selected as the first candidate range, or the first candidate range can be determined from multiple first time ranges with the largest corresponding count values ​​through other means. The specific implementation of this application does not limit this.

[0098] It should be noted that the aforementioned electronic device includes a receiver. During the entire process of determining the first candidate range (S910-S920), the electronic device sequentially transmits Y signals to the object under test; where Y is an integer greater than or equal to 1. During the transmission of the Y signals, the electronic device turns on the receiver in the first interval so that the receiver receives the signal reflected back to the electronic device by the object under test. The electronic device turns off the receiver in other intervals, including the second interval. That is, the aforementioned electronic device uses time-gated gating technology to control the receiver to work only in a specific time window and stop working in other time windows, so that the target storage space stores only the count values ​​corresponding to each time range in the target interval at a certain moment, thereby effectively suppressing the interference of ambient light on the count values ​​corresponding to the time range.

[0099] For example, such as Figure 5 As shown, the first interval is 0-200, and the second interval is 200-400. After the electronic device transmits a signal, it controls the receiver to turn on within 0ns to 200ns so that the receiver can receive the reflected signal of the signal. When the time scale reaches 200ns, the electronic device controls the receiver to turn off and no longer receives the reflected signal of the signal until the electronic device transmits the second signal. Then the electronic device controls the receiver to turn on again, and so on, until the electronic device transmits Y signals.

[0100] S930, electronic devices release target storage space.

[0101] The above-mentioned release of target storage space refers to: clearing the count value corresponding to each of the M first time ranges belonging to the first interval in the target storage space.

[0102] S940. The electronic device stores the count values ​​corresponding to the N first time ranges divided by the second interval in the target storage space.

[0103] N is an integer greater than or equal to 1.

[0104] It should be noted that the implementation of S940 is similar to that of S910. For a detailed description of S940, please refer to the relevant description of S910 above. It will not be repeated here.

[0105] S950: The electronic device determines the second candidate range based on the count values ​​corresponding to N first time ranges.

[0106] It should be noted that the implementation of S950 is similar to that of S920. For a detailed description of S950, please refer to the relevant description of S920 above. It will not be repeated here.

[0107] S960, the electronic device determines the first target time range based on the first candidate range and the second candidate range.

[0108] It should be noted that each interval has a candidate range. When there are multiple intervals, the first target time range is the candidate range with the largest corresponding count value among the multiple candidate ranges.

[0109] This application embodiment, based on the shared storage space between the first and second time ranges, adds a time-gating method to control the receiver to operate only within a specific time window, effectively suppressing interference from ambient light at other times. The electronic device divides the entire measurement range into multiple intervals, storing only the count values ​​corresponding to each time range within one interval in the target storage space each time, and then releasing the target storage space for the count values ​​corresponding to the time ranges of the next interval. After coarsely locating the signal by combining the results of several intervals (i.e., determining the first target time range), the first target time range is further divided into finer time ranges (i.e., the second time range), and the count values ​​corresponding to each second time range are accumulated. The count values ​​corresponding to the second time range and the count values ​​corresponding to the first time range reuse the same storage space. The time-gating technique introduced in determining the first target time range divides the entire measurement range into several intervals, determining the candidate time range for each interval separately, while simultaneously reusing storage space. This improves detection probability and accuracy while saving storage space.

[0110] Optional, combined Figure 9 ,like Figure 10 As shown, the above-mentioned S920 may also include: S1010-S1020.

[0111] S1010, the electronic device is based on the Coates algorithm to correct the count values ​​corresponding to the M first time ranges, and obtain the corrected count values ​​corresponding to the M first time ranges.

[0112] The specific formula for the Coates algorithm is as follows:

[0113]

[0114] The above N is used to represent the corrected waveform (i.e., the count value corresponding to the first time range after removing ambient light). j This refers to the count of the j-th first time range, N is the number of measurements, i.e. the number of times the signal is transmitted. The number of times the signal is transmitted is pre-configured in the electronic device, i is used to indicate a specific first time range, and ln() is the logarithmic function.

[0115] Specifically, S1010 includes: the electronic device corrects the count values ​​corresponding to the M first time ranges according to the above formula (2) to obtain the corrected count values ​​corresponding to the M first time ranges.

[0116] S1020: The electronic device determines the first candidate range based on the corrected count values ​​corresponding to the M first time ranges.

[0117] The first candidate range mentioned above is the first time range with the largest corrected count value among the M first time ranges.

[0118] It should be noted that the specific implementation of S950 is similar to that of S1010-S1020. For a detailed description of S950, please refer to the relevant descriptions of S1010-S1020 above, which will not be repeated here.

[0119] The ranging method provided in this application divides the entire range into multiple intervals, accumulates the count values ​​corresponding to M time ranges within one interval each time, and corrects the count values ​​corresponding to the M time ranges based on the Coates algorithm. Then, the electronic device determines the first candidate range based on the corrected count values ​​corresponding to the M time ranges, thereby improving the accuracy of the first candidate range.

[0120] Accordingly, this application provides an electronic device for performing the various steps in the above-described ranging method. This application can divide the electronic device into functional modules based on the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. The module division in this application is illustrative and represents only one logical functional division; other division methods may be used in actual implementation.

[0121] When dividing each function into modules according to its corresponding function. Figure 11 A schematic diagram of a possible structure of the electronic device involved in the above embodiments is shown. For example... Figure 11 As shown, the electronic device includes: a configuration module 1110, a partitioning module 1120, a storage module 1130, a determination module 1140, and a prediction module 1150.

[0122] The configuration module 1110 is used to configure multiple zones in an electronic device, and the configuration module is implemented by a circuit structure.

[0123] The partitioning module 1120 is used to divide multiple intervals into multiple first time ranges, for example, by executing step S410 in the above method embodiment.

[0124] The storage module 1130 is used to sequentially save the count values ​​corresponding to the first time range divided by each interval, for example, by executing step S420 in the above method embodiment.

[0125] The determining module 1140 is used to determine the first time range corresponding to the target count value in a plurality of first time ranges as the first target time range, for example, by executing step S430 in the above method embodiment.

[0126] The division module 1120 is also used to divide the first target time range into multiple second time ranges, for example, by performing step S440 in the above method embodiment.

[0127] Storage module 1130 is also used to store multiple count values ​​corresponding to a second time range, for example, by performing step S450 in the above method embodiment.

[0128] The prediction module 1150 is used to predict the distance between the object under test and the electronic device based on the count values ​​corresponding to multiple second time ranges, for example, by performing step S460 in the above method embodiment.

[0129] Optionally, the electronic device provided in this application embodiment further includes: a release module 1160.

[0130] The aforementioned storage module 1130 is used to store the count values ​​corresponding to the M first time ranges divided by the first interval in the target storage space, for example, by executing step S910 in the above method embodiment.

[0131] The aforementioned determining module 1140 is used to determine a first candidate range based on the count values ​​corresponding to M first time ranges, for example, by executing step S920 in the above method embodiment.

[0132] The release module 1160 is used to release the target storage space, for example, by performing step S930 in the above method embodiment.

[0133] Optionally, the electronic device provided in this application embodiment further includes: a correction module 1170.

[0134] The correction module 1170 is used to correct the count values ​​corresponding to M first time ranges based on the Coates algorithm to obtain the corrected count values ​​corresponding to M first time ranges, for example, by executing step S1010 in the above method embodiment.

[0135] The aforementioned determining module 1140 is used to determine the first candidate range based on the corrected count values ​​corresponding to the M first time ranges, for example, by executing step S1020 in the above method embodiment.

[0136] Optionally, the electronic device provided in this application embodiment further includes: a receiving module 1180 and a control module 1190.

[0137] The receiving module 1180 is used to transmit Y signals during the process of determining the first candidate range.

[0138] The control module 1190 is used to turn on the receiver in the first interval and turn off the receiver in other intervals during the transmission of Y signals.

[0139] The various modules of the above-mentioned electronic device can also be used to perform other actions in the above-mentioned method embodiments. All relevant content of each step involved in the above-mentioned method embodiments can be referred to in the functional description of the corresponding functional module, and will not be repeated here.

[0140] Among them, some or all of the steps in the configuration module 1110, division module 1120, determination module 1140, prediction module 1150, control module 1190, release module 1160, and correction module 1170 can be achieved through... Figure 3 The processor 301 executes the code in the memory 302. Some or all of the steps in the storage module 1130 can be implemented through... Figure 3 The memory 302 in the middle is implemented, and some or all of the steps of the transceiver module 1170 can be implemented through Figure 3 The transceiver 303 executes the code in the memory 302.

[0141] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center integrating one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).

[0142] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0143] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0144] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0145] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0146] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0147] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A distance measurement method, characterized in that, The method is applied to an electronic device, which is configured with multiple intervals, each interval representing a time range in which a signal transmission time occurs, wherein the signal transmission time is the time interval between the electronic device transmitting a signal to a test object and receiving a signal reflected from the test object; the method includes: The plurality of intervals are divided into a plurality of first time ranges, and each interval is divided into at least one first time range; According to the interval, the count value corresponding to the first time range divided by each interval is stored sequentially; wherein, the count value corresponding to the first time range is used to characterize the number of signals whose signal transmission time is within the first time range, and the count values ​​corresponding to the first time range divided by different intervals reuse the same target storage space. The first time range corresponding to the target count value among the plurality of first time ranges is determined as the first target time range; wherein, the target count value is the count value representing the largest number of signals among the count values ​​corresponding to the plurality of first time ranges; Release the target storage space; divide the first target time range into multiple second time ranges; reuse the count values ​​corresponding to the second time ranges after releasing the target storage space; Store the count values ​​corresponding to the plurality of second time ranges; wherein, the count values ​​corresponding to the second time ranges are used to characterize the number of signals whose signal transmission time falls within the second time range; The distance between the object under test and the electronic device is predicted based on the count values ​​corresponding to the plurality of second time ranges.

2. The method according to claim 1, characterized in that, The plurality of intervals includes a first interval and a second interval. The step of sequentially saving the count value corresponding to the first time range divided by each interval, according to the intervals, includes: The target storage space stores the count values ​​corresponding to the M first time ranges divided by the first interval; wherein M is an integer greater than or equal to 1; Based on the count values ​​corresponding to the M first time ranges, a first candidate range is determined, wherein the first candidate range is the first time range with the largest corresponding count value among the M first time ranges; Release the target storage space, wherein the released target storage space is used to store the count values ​​corresponding to the N first time ranges divided by the second interval during the process of determining the second candidate range corresponding to the second interval, wherein the second candidate range is the first time range with the largest corresponding count value among the N first time ranges; and N is an integer greater than or equal to 1. The first target time range is determined based on the first candidate range and the second candidate range.

3. The method according to claim 2, characterized in that, Based on the count values ​​corresponding to the M first time ranges, a first candidate range is determined, including: Based on the Coates algorithm, the count values ​​corresponding to the M first time ranges are corrected to obtain the corrected count values ​​corresponding to the M first time ranges. The first candidate range is determined based on the corrected count values ​​corresponding to the M first time ranges; wherein the first candidate range is the first time range with the largest corresponding corrected count value among the M first time ranges.

4. The method according to claim 2, characterized in that, The electronic device includes a receiver, and the method further includes: In the process of determining the first candidate range, Y signals are transmitted; wherein Y is an integer greater than or equal to 1; During the transmission of the Y signals, the receiver is turned on in the first interval and turned off in other intervals, including the second interval.

5. An electronic device, characterized in that, include: Configuration module, partitioning module, storage module, determination module, release module, and prediction module; The configuration module is used to configure multiple intervals in the electronic device, each interval being used to characterize the time range in which the signal transmission time is located. The signal transmission time is the time interval between when the electronic device transmits a signal to the object under test and when it receives the signal reflected by the object under test. The division module is used to divide the plurality of intervals into a plurality of first time ranges, wherein each interval is divided into at least one first time range. The storage module is used to sequentially save the count value corresponding to the first time range divided by each interval according to the interval; wherein, the count value corresponding to the first time range is used to characterize the number of signals whose signal transmission time is within the first time range, and the count values ​​corresponding to the first time range divided by different intervals reuse the same target storage space. The determining module is used to determine the first time range corresponding to the target count value among the plurality of first time ranges as the first target time range; wherein, the target count value is the count value representing the largest number of signals among the count values ​​corresponding to the plurality of first time ranges; The release module is used to release the target storage space; The partitioning module is further configured to divide the first target time range into multiple second time ranges; wherein the count value corresponding to the second time range is reused in the target storage space after release; The storage module is further configured to store count values ​​corresponding to the plurality of second time ranges; wherein the count values ​​corresponding to the second time ranges are used to characterize the number of signals whose signal transmission time falls within the second time range; The prediction module is used to predict the distance between the object to be tested and the electronic device based on the count values ​​corresponding to the plurality of second time ranges.

6. The electronic device according to claim 5, characterized in that, The storage module is specifically used to store the count values ​​corresponding to the M first time ranges divided by the first interval in the target storage space; wherein, M is an integer greater than or equal to 1; the plurality of intervals includes the first interval and the second interval; The determining module is specifically used to determine a first candidate range based on the count values ​​corresponding to the M first time ranges, wherein the first candidate range is the first time range with the largest corresponding count value among the M first time ranges; The release module is used to release the target storage space, wherein the released target storage space is used to store the count values ​​corresponding to the N first time ranges divided by the second interval during the process of determining the second candidate range corresponding to the second interval, and the second candidate range is the first time range with the largest corresponding count value among the N first time ranges; N is an integer greater than or equal to 1; The first target time range is determined based on the first candidate range and the second candidate range.

7. The electronic device according to claim 6, characterized in that, The electronic device further includes: a correction module; The correction module is used to correct the count values ​​corresponding to the M first time ranges based on the Coates algorithm, so as to obtain the corrected count values ​​corresponding to the M first time ranges. The determining module is specifically used to determine the first candidate range based on the corrected count values ​​corresponding to the M first time ranges; wherein, the first candidate range is the first time range with the largest corresponding corrected count value among the M first time ranges.

8. The electronic device according to claim 6, characterized in that, The electronic device further includes: a transceiver module and a control module; The transceiver module is used to transmit Y signals during the process of determining the first candidate range; wherein Y is an integer greater than or equal to 1. The control module is used to turn on the transceiver module in the first interval and turn off the transceiver module in other intervals during the transmission of the Y signals, wherein the other intervals include the second interval.

9. A ranging device, characterized in that, The device includes a memory and a processor, the memory being coupled to the processor; the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the processor, the ranging device performs the method as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on a computing device, cause the computing device to perform the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Distance measuring method and distance measuring system based on flight time

    CN113075674A

  • Time-of-flight measurement apparatus and time-of-flight measurement method with ambiguity resolution in real time

    US20170016981A1