Distance measurement device and method, electronic equipment and readable storage medium

Through the method of band reception and mapping relationship filtering, the distance measurement misjudgment caused by ambient light interference in the prior art is solved, which improves measurement accuracy and efficiency and reduces costs.

CN120294769APending Publication Date: 2025-07-11VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510500322.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In the prior art, infrared light filtering method based on a single fixed threshold cannot effectively distinguish and filter out long-band infrared light in sunlight/ambient light in different situations, resulting in a high misjudgment rate and low efficiency of the distance measuring device under different environments.

Method used

The receiving module of the distance sensor receives infrared light to be identified in bands and ambient infrared light, and establishes a mapping relationship with the application processor to dynamically filter out environmental infrared light interference, and optimizes filtering logic to improve measurement accuracy and efficiency.

Benefits of technology

It realizes accurate identification and filtering of environmental infrared light interference in different environments, reduces the rate of error judgment, improves the accuracy and efficiency of distance measurement, and saves the cost of coating sheets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120294769A_ABST
    Figure CN120294769A_ABST
Patent Text Reader

Abstract

The invention discloses a distance measurement device and method, electronic equipment and a readable storage medium, the device comprises a distance sensor and an application processor, and the distance sensor comprises a transmitting module and a receiving module; the transmitting module is used for transmitting target infrared light of a preset wave band; the receiving module is used for receiving infrared light to be recognized and environment infrared light and sending light source energy values of the infrared light to be recognized and the environment infrared light to the application processor; the to-be-recognized infrared light comprises at least one of reflection infrared light obtained after target infrared light of the preset wave band is reflected by a shielding object and to-be-filtered infrared light of the preset wave band corresponding to the environment infrared light; the application processor is used for receiving the light source energy values of the to-be-recognized infrared light and the ambient infrared light, and determining the light source energy value of the reflected infrared light according to the light source energy values of the to-be-recognized infrared light and the ambient infrared light and a preset mapping relation; the application processor is further used for determining the distance of the shelter according to the light source energy value of the reflected infrared light.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of distance measurement, and particularly relates to a distance measurement device, method, electronic device, and readable storage medium. Background Art

[0002] In many scenarios, a mobile terminal needs to passively execute corresponding functions according to the user's posture and application environment, and the above functions can be realized by detecting the user's approach and air operation behaviors on the mobile terminal through a distance sensor. Currently, most sensors based on infrared light detection are used to achieve the distance sensing function, and the transmitting module and the receiving module need to work in parallel. When there is an obstacle above the sensor, the receiving module will receive more infrared energy, thereby detecting the obstacle and the distance of the obstacle.

[0003] In this process, the reason for the increase in the infrared energy received by the receiving module may be caused not only by the obstruction of the obstacle, but also by the long-wave infrared light in the external sunlight / environmental light. That is, in practical applications, the above situations will cause the receiving module to detect an increase in the light source energy of the infrared light. If not processed, it will lead to misjudgment problems of the sensor, thus affecting the recognition of the user's approach or air operation behavior. Related technologies filter out the light source energy value exceeding the fixed threshold by setting a fixed threshold to eliminate the influence of the long-wave infrared light in the external sunlight / environmental light, and realize distance sensing based on the reduced light source energy of the infrared light. However, in practical applications, there are different differences in the sunlight / environmental light in different situations, and it is impossible to accurately and efficiently filter out the long-wave infrared light in different situations based on a single fixed threshold, resulting in misjudgment of distance measurement. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a distance measurement device, method, electronic device, and readable storage medium, which can solve the problem that there are different differences in the sunlight / environmental light in different situations in practical applications, and it is impossible to accurately and efficiently filter out the long-wave infrared light in different situations based on a single fixed threshold.

[0005] In a first aspect, an embodiment of the present application provides a distance measurement device, which includes a distance sensor and an application processor. Among them, the distance sensor includes a transmitting module and a receiving module; the transmitting module is configured to transmit target infrared light in a preset wavelength band; the receiving module is configured to receive infrared light to be recognized and ambient infrared light, and send the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light to the application processor; among them, the infrared light to be recognized includes at least one of the following: reflected infrared light after the target infrared light in the preset wavelength band is reflected by an obstacle, and infrared light to be filtered in the preset wavelength band corresponding to the ambient infrared light; the application processor is configured to receive the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, and determine the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship; among them, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset wavelength band; the application processor is further configured to determine the distance of the obstacle according to the light source energy value of the reflected infrared light.

[0006] In a second aspect, an embodiment of the present application provides a distance measurement method, which includes: obtaining the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light; among them, the infrared light to be recognized includes at least one of the following: reflected infrared light after the target infrared light in the preset wavelength band is reflected by an obstacle, and infrared light to be filtered in the preset wavelength band corresponding to the ambient infrared light; determining the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship; among them, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset wavelength band; determining the distance of the obstacle according to the light source energy value of the reflected infrared light.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method described in the second aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented.

[0009] Fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run programs or instructions to implement the method described in the second aspect.

[0010] Sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the second aspect.

[0011] In the distance measurement device provided by the embodiment of the present application, the transmission module of the distance sensor emits target infrared light in a preset band, and the receiving module receives the infrared light to be recognized and ambient infrared light. The infrared light to be recognized includes at least one of the reflected infrared light after the target infrared light in the preset band is reflected by an obstacle and the infrared light to be filtered in the preset band corresponding to the ambient infrared light. The receiving module then sends the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light to the application processor. Then, the application processor receives the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, and determines the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship, so as to determine the distance of the obstacle according to the light source energy value of the reflected infrared light. Through the distance measurement device provided by the embodiment of the present application, the interference caused by long-wave infrared light in the external ambient light to the reflected infrared light is accurately recognized, the filtering logic is optimized, and the interference is dynamically filtered based on the obtained light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, avoiding misjudgment caused by a single fixed threshold, and thus improving the accuracy and efficiency of distance measurement. Description of the Drawings

[0012] Figure 1a is a schematic diagram of the layout of a distance sensor in a terminal device; Figure 1b is a schematic diagram of a scenario where a distance sensor detects an increase in infrared energy; Figure 1c is a schematic diagram of a scenario where a distance sensor detects an abnormal increase in infrared energy; Figure 2 is a schematic flowchart of filtering ambient infrared light in the related art; Figure 3a is a schematic structural diagram of a distance measurement device provided by an embodiment of the present application; Figure 3b is a schematic diagram of a scenario where a distance sensor provided by an embodiment of the present application detects an increase in infrared energy; Figure 4aIt is a schematic structural diagram of another distance measurement device provided by an embodiment of the present application; Figure 4b It is a schematic diagram of a scenario where the infrared energy detected by another distance sensor provided by an embodiment of the present application increases; Figure 5a It is a schematic optical path diagram of ambient visible light in an outdoor situation without obstacles; Figure 5b It is a schematic optical path diagram of ambient visible light in an outdoor situation with obstacles; Figure 6 It is a schematic flowchart of a distance measurement method provided by an embodiment of the present application; Figure 7 It is a schematic flowchart of another distance measurement method provided by an embodiment of the present application; Figure 8 It is a schematic flowchart of yet another distance measurement method provided by an embodiment of the present application; Figure 9 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application; Figure 10 It is a schematic hardware structure diagram of an electronic device implementing an embodiment of the present application. Detailed implementation manners

[0013] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope of protection of the present application.

[0014] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.

[0015] In existing terminal devices, refer to Figure 1a , Figure 1aA schematic diagram showing the layout of a distance sensor on a terminal device is presented. Since most user interactions occur in scenarios involving interaction with the screen body of the terminal device, the distance sensor is generally laid out on the front of the entire machine's screen. For a distance sensor based on infrared light detection, usually, the transmitting module and the receiving module need to work in parallel. When an obstacle appears in front of the terminal device, the receiving module will receive more infrared energy, and the distance to the obstacle is measured based on the change in infrared energy. Refer to Figure 1b , Figure 1b A schematic diagram showing a scenario where a distance sensor detects an increase in infrared energy is presented. A corresponding cover plate / screen material is also laid out above the distance sensor. Therefore, the infrared light emitted by the transmitting module will also be affected by internal crosstalk of the cover plate / screen material. In addition, since the receiving module will recognize any light source above a certain wavelength band (for example, the 750nm wavelength band) as infrared light, and currently most transmitting modules use light sources near the 940nm wavelength band to achieve distance measurement, in practical applications, the reasons for the increase in the infrared energy received by the receiving module may include not only occlusion by an obstacle but also the above-mentioned internal crosstalk and long-wavelength infrared light in sunlight / environmental light from the outside world, resulting in a situation where there is no approaching obstacle but the infrared energy obtained by the receiving module increases, as Figure 1c shown in Figure 1c A schematic diagram showing a scenario where a distance sensor detects an abnormally large increase in infrared energy is presented.

[0016] In summary, the increase in the infrared energy received by the receiving module may be caused by the above various situations. If not handled, it will lead to misjudgment problems of the sensor, thus affecting the recognition of user approaching or air gesture operations. In related technologies, internal crosstalk is optimized through structural design / stricter materials, and the optimization of internal crosstalk will not be elaborated in detail here. Regarding the influence of long-wavelength infrared light in sunlight / environmental light from the outside world, for example, M light above the 1300nm wavelength band, refer to Figure 2 , Figure 2 A schematic diagram showing the process of filtering environmental infrared light in related technologies is presented. The light sources in various situations are received by the infrared wavelength band light source receiving end and then reported to the Application Processor (AP). The AP sets a fixed threshold to filter out the light source energy values exceeding the fixed threshold, and distance sensing is achieved based on the light source energy of the infrared light after reduction to eliminate the influence of long-wavelength infrared light in sunlight / environmental light from the outside world.

[0017] However, the logic of filtering out interference in the above method is relatively simple. In actual applications, there are differences in sunlight / ambient light under different circumstances. For example, in different weather conditions, a single fixed threshold will lead to problems of over-filtering or insufficient filtering. There is no universal filtering condition. The change of scenes requires the terminal equipment to be individually debugged to determine the threshold, resulting in low efficiency and difficult to avoid misjudgment problems. Therefore, the interference filtering method based on a single fixed threshold has defects in both accuracy and efficiency.

[0018] The distance measurement device, method, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios, so as to at least solve the above-mentioned problems.

[0019] Figure 3a A schematic diagram of the structure of a distance measuring device provided in an embodiment of the present application is shown. Figure 3a The distance measuring device 300 includes: a distance sensor 31 and an application processor 32 , wherein the distance sensor 31 includes a transmitting module 311 and a receiving module 312 .

[0020] In the embodiment of the present application, the transmitting module 311 is used to transmit target infrared light of a preset band, so that when there is an obstruction, the obstruction reflects the target infrared light of the preset band, and the reflected infrared light is then received by the receiving module 312 .

[0021] In one embodiment, the transmitting module 311 and the receiving module 312 of the distance sensor 31 are in a periodic polling detection working state to reduce power consumption.

[0022] The receiving module 312 is used to receive the infrared light to be identified and the ambient infrared light, and to send the light source energy value of the infrared light to be identified and the light source energy value of the ambient infrared light to the application processor; wherein the infrared light to be identified includes at least one of the following: the reflected infrared light of the target infrared light of the preset band after being reflected by the shielding object, and the infrared light to be filtered out of the preset band corresponding to the ambient infrared light. That is to say, the receiving module 312 can receive the reflected infrared light and also has the ability to receive the ambient infrared light, and reports the light source energy value of each infrared light received to the application processor 32, so that the application processor 32 establishes a preset mapping relationship based on the light source energy value of the received ambient infrared light and the light source energy value of the infrared light to be filtered out of the preset band corresponding to the ambient infrared light, so as to filter out the infrared light to be filtered out of the infrared light to be identified according to the light source energy value of the infrared light to be identified, the light source energy value of the ambient infrared light and the preset mapping relationship during distance measurement, thereby eliminating the interference of the infrared light to be filtered out of the preset band in the ambient infrared light on the distance measurement.

[0023] The application processor 32 is configured to receive the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, and determine the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship; wherein, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset band; the application processor 32 is further configured to determine the distance of the occluder according to the light source energy value of the reflected infrared light after determining the light source energy value of the reflected infrared light.

[0024] In the embodiment of the present application, refer to Figure 3b The schematic diagram of a scenario where the infrared energy detected by the distance sensor provided in the embodiment of the present application increases. Through the distance measurement device provided in the embodiment of the present application, the sending module of the distance sensor emits target infrared light in a preset band, and the receiving module receives the infrared light to be recognized and the ambient infrared light. The infrared light to be recognized includes at least one of the reflected infrared light after the target infrared light in the preset band passes through the occluder and the infrared light to be filtered in the preset band corresponding to the ambient infrared light. The receiving module then sends the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light to the application processor. Then the application processor receives the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, and determines the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship, so as to determine the distance of the occluder according to the light source energy value of the reflected infrared light. Through the distance measurement device provided in the embodiment of the present application, the interference caused by the long-waveband infrared light in the external ambient light to the reflected infrared light is accurately recognized, the filtering logic is optimized, and the interference is dynamically filtered based on the obtained light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, avoiding misjudgment caused by a single fixed threshold, and further improving the accuracy and efficiency of distance measurement.

[0025] The above Figure 3a and Figure 3b The efficiency and accuracy of detecting infrared energy by the distance measurement device in the above and the illustrated embodiments have been improved to a certain extent. However, since there is no objective linear relationship in the preset mapping relationship, a certain amount of emitted infrared light will be filtered out each time based on the preset mapping relationship. Although it will not be misjudged when not approaching, the detection performance of the distance sensor will be affected, resulting in the inability to recognize some approaching or air-operating behaviors of some users or users, and thus the corresponding functions cannot be executed.

[0026] Based on this, Figure 4a Illustrates a schematic structural diagram of another distance measurement device provided in the embodiment of the present application in an alternative implementation manner. Refer toFigure 4a , in the distance measuring device 400, the receiving module 412 of the distance sensor 41 includes a first-band infrared light receiving unit 412a and a second-band infrared light receiving unit 412b.

[0027] In the embodiment of the present application, the first-band infrared light receiving unit 412a is configured to receive the infrared light to be recognized; the second-band infrared light receiving unit 412b is configured to receive the ambient infrared light.

[0028] Among them, the second-band infrared light receiving unit 412b has the ability to receive ambient infrared light, that is, the second-band infrared light receiving unit 412b can accurately identify the ambient infrared light and report the accurate light source energy value of the ambient infrared light, so as to establish a mapping relationship based on the accurate light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the corresponding preset band. When performing distance measurement subsequently, the light source energy value of the infrared light to be filtered in the preset band corresponding to the ambient infrared light is searched from the mapping relationship table formed by the mapping relationship according to the received light source energy value of the ambient infrared light, so as to filter the light source energy value of the infrared light to be filtered from the light source energy value of the infrared light to be recognized, and interference elimination is achieved.

[0029] In one embodiment, the second-band infrared light receiving unit 412b can be combined with a coating process. For example, the second-band infrared light receiving unit 412b is coated with an M-band coating film to receive M-band infrared light, and the light source energy value of the received M-band infrared light is reported to the application processor, so that the application processor establishes an accurate mapping relationship based on the received light source energy value of the M-band infrared light, thereby improving the accuracy of identifying the source of the infrared light to be filtered in the currently to-be-recognized infrared light and improving the measurement performance of the distance measuring device.

[0030] In the embodiment of the present application, refer to Figure 4bAnother schematic diagram of the scenario where the infrared energy detected by the distance sensor increases provided by the embodiment of the present application. In the distance measurement device 400 provided by the embodiment of the present application, the receiving module 41 of the distance sensor 41 includes a first-band infrared light receiving unit 412a and a second-band infrared light receiving unit 412b. The first-band infrared light receiving unit 412a receives the infrared light to be recognized, and the second-band infrared light receiving unit 412b receives the ambient infrared light. Since the second-band infrared light receiving unit 412b can accurately identify the ambient infrared light, the application processor can establish an accurate mapping relationship based on the light source energy value of the received ambient infrared light and the light source energy value of the infrared light to be filtered in the preset band corresponding thereto, so as to more accurately identify the interfering part in the current infrared light to be recognized, filter out the infrared light to be filtered in the preset band that causes interference, and the remaining reflected infrared light after the target infrared light in the preset band is reflected by the occluder. When the light source energy value of this part of the infrared light increases, it can be known that the increase in the infrared energy detected by the distance sensor is due to the reflection of the approaching occluder. Then, the distance of the occluder is determined based on the increase in the infrared energy, improving the measurement performance of the distance measurement device, making up for the problem that the receiving module in the previous embodiment cannot accurately identify infrared light, solving both the interference problem of the external ambient infrared light and improving the performance of the distance measurement device.

[0031] The above Figure 4a and Figure 4b The distance measurement device of the above-mentioned embodiment has been improved in terms of efficiency, accuracy, and measurement performance. However, coating the second-band infrared light receiving unit with an M-band coating film undoubtedly increases the manufacturing cost, and the stacking of the coating films also causes a certain amount of space pressure. In addition, considering the need to ensure the receiving performance of the second-band infrared light receiving unit, the assembly difficulty of the coating film is also inevitable.

[0032] In the recognition of ambient infrared light, there is an objective condition, that is, a high-infrared scenario with a large weight ratio only appears under the condition of sufficient sunlight during the day outdoors (i.e., M-band infrared light). The ambient visible light region and the infrared light region at the receiving end are almost in the same position, so they can be equivalent to the same device in the optical path environment. Moreover, in the application scenarios of the approaching occluder outdoors and indoors, there are obvious differences in the visible light band near 550nm, that is, the weight ratio of the ambient visible light when the occluder appears or not, such as Figure 5a The schematic diagram of the optical path of the ambient visible light without an occluder outdoors as shown, and as Figure 5b The schematic diagram of the optical path of the ambient visible light with an occluder outdoors as shown. Under the influence of extremely strong ambient light outdoors, the receiving end can identify the ambient visible light near the 550nm band. At this time, if an occluder approaches, the visible light component outdoors will also decrease synchronously.

[0033] Based on this, in an optional implementation manner, based on Figure 3a As shown in the structural schematic diagram of the distance measurement device, in the distance measurement device, the receiving module is further configured to receive ambient visible light and send the light source energy value of the ambient visible light to the application processor; the application processor is further configured to receive the light source energy value of the ambient visible light and determine whether the infrared light to be recognized includes the reflected infrared light according to the light source energy value of the ambient visible light.

[0034] In the embodiment of the present application, the receiving module of the distance sensor of the distance measurement device receives the infrared light to be recognized and can also receive ambient visible light. By reporting the light source energy value of the infrared light to be recognized and the light source energy value of the ambient visible light to the application processor, the application processor combines and analyzes the light source energy value of the infrared light to be recognized and the light source energy value of the ambient visible light, and determines whether the infrared light to be recognized includes the reflected infrared light according to the light source energy value of the ambient visible light. When it is determined that the infrared light to be recognized includes the reflected infrared light and the infrared light to be filtered in the preset band corresponding to the ambient infrared light, it can be known that there is an obstacle approaching. At the same time, based on the light source energy value of each received infrared light and the preset mapping relationship, the light source energy value of the reflected infrared light is determined, and thus the distance of the obstacle is determined according to the light source energy value of the reflected infrared light. When it is determined that the infrared light to be recognized does not include the reflected infrared light, it can be known that there is no obstacle approaching, and the increase in infrared energy is caused by the external ambient infrared light, so there is no need to misjudge the distance based on the light source energy value of the ambient infrared light. Therefore, through the embodiment of the present application, it is possible to perform dual-dynamic recognition and detection based on the infrared light to be recognized and the ambient visible light, which can not only filter out the interference of the external ambient infrared light, reduce the risk of misjudgment, ensure the measurement performance of the distance measurement device, but also save the cost of assembling the coating film.

[0035] Figure 6 The flowchart of a distance measurement method provided by an embodiment of the present application is shown. Refer to Figure 6 This method can be implemented by the distance measurement device in each of the above embodiments. The method includes the following steps.

[0036] Step 602, obtain the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light.

[0037] Among them, the infrared light to be recognized includes at least one of the following: the reflected infrared light after the target infrared light in a preset band is reflected by an obstacle, and the infrared light to be filtered in the preset band corresponding to the ambient infrared light. The target infrared light is emitted by the emission module of the distance sensor of the distance measurement device. When an obstacle approaches, the target infrared light is reflected by the obstacle, and the reflected infrared light after reflection is received by the receiving module of the distance sensor. The receiving module reports the light source energy value of the reflected infrared light and the light source energy value of the ambient infrared light to the application processor, and the application processor processes them to determine the distance of the obstacle.

[0038] Step 604: Determine the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship.

[0039] Among them, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset band. The preset mapping relationship can be stored in the application processor. The application processor determines the light source energy value of the reflected infrared light according to the received light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, so as to determine the distance of the obstacle.

[0040] Step 606: Determine the distance of the obstacle according to the light source energy value of the reflected infrared light.

[0041] In the embodiment of the present application, after the distance sensor recognizes and receives the infrared light to be recognized and the ambient infrared light, by obtaining the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, and then determining the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, that is, filtering the infrared light to be filtered in the preset band corresponding to the ambient infrared light in the infrared light to be recognized to obtain the reflected infrared light for measuring the distance of the obstacle, and then determining the distance of the obstacle according to the light source energy value of the reflected infrared light. It realizes the accurate recognition of the interference caused by the long-wave infrared light in the external ambient light to the reflected infrared light, optimizes the filtering logic, dynamically filters the interference based on the obtained light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, avoids misjudgment caused by a single fixed threshold, and further improves the accuracy and efficiency of distance measurement.

[0042] In an optional embodiment, step 604 of determining the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship may include the following steps.

[0043] Step 6041: Determine the filtering threshold corresponding to the light source energy value of the ambient infrared light according to the preset mapping relationship.

[0044] Among them, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset band. When the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light are received, the light source energy value of the infrared light to be filtered in the preset band corresponding to the ambient infrared light, that is, the filtering threshold, can be obtained from the preset mapping relationship. That is to say, for each received infrared light to be recognized and ambient infrared light, the filtering threshold may not be exactly the same, and the filtering threshold is more targeted and adaptable, so as to improve the accuracy of filtering interference.

[0045] Step 6042: Filter out the light source energy value in the light source energy value of the infrared light to be recognized that exceeds the filtering threshold to obtain the light source energy value of the reflected infrared light.

[0046] In the embodiment of the present application, the filtering threshold for filtering the interference of the ambient infrared light is dynamically determined based on the received light source energy value of the ambient infrared light and the preset mapping relationship, which improves the recognition accuracy of the ambient infrared light. Then, the light source energy value in the light source energy value of the infrared light to be recognized that exceeds the filtering threshold is filtered out to obtain the reflected infrared light for measuring the distance of the obstacle. Then, the distance of the obstacle is determined according to the light source energy value of the reflected infrared light. The dynamic change of the filtering threshold avoids misjudgment caused by a single fixed threshold, and thus improves the accuracy and efficiency of distance measurement.

[0047] In an optional embodiment, before step 604 of determining the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, the above method may also include the following steps.

[0048] Step 6031: Obtain the light source energy value of the ambient infrared light.

[0049] Among them, in this embodiment, the receiving module for receiving infrared light further includes a receiving unit for receiving ambient infrared light, which can accurately recognize the ambient infrared light, so as to provide a more accurate light source energy value of the ambient infrared light for the application processor, and then establish a more accurate mapping relationship based on the obtained accurate light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the corresponding preset band.

[0050] Step 6032: Establish the preset mapping relationship according to the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset band.

[0051] In the embodiment of the present application, based on the ambient infrared light received by the receiving module of the distance sensor of the distance measuring device, when the application processor obtains the light source energy value of the ambient infrared light, according to the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered out of the preset band corresponding to the ambient infrared light, the preset mapping relationship is established, so that based on the preset mapping relationship, when the receiving module receives the ambient infrared light a certain time, the application processor can search the light source energy value of the infrared light to be filtered out of the preset band corresponding to the ambient infrared light according to the light source energy value of the ambient infrared light from the preset mapping relationship, and the infrared light to be filtered out is the interfering infrared light that needs to be filtered out of the infrared light to be identified, and the light source energy value of the infrared light to be filtered out is filtered out from the light source energy value of the infrared light to be identified. Accurately identifying the ambient infrared light makes the established mapping relationship more accurate, so as to more accurately determine the light source energy value of the infrared light to be filtered out, so as to achieve accurate filtering of interference, make up for the influence of inaccurate ambient infrared light identification on the measurement performance, and improve the measurement performance of the distance measuring device.

[0052] In an alternative embodiment, see Figure 7 , Figure 7 A flow chart of another distance measurement method provided in an embodiment of the present application is shown, and the method may include the following steps.

[0053] Step 701, obtaining the light source energy value of the infrared light to be identified, the light source energy value of the ambient infrared light, and the light source energy value of the ambient visible light.

[0054] The infrared light to be identified includes at least one of the following: reflected infrared light of a target infrared light of a preset band after being reflected by an obstruction, and infrared light to be filtered out of a preset band corresponding to the ambient infrared light.

[0055] Step 702: Determine whether the infrared light to be identified includes the reflected infrared light according to the light source energy value of the ambient visible light.

[0056] In a specific implementation, the determining whether the infrared light to be identified includes the reflected infrared light according to the light source energy value of the ambient visible light includes the following situations.

[0057] (1) When the light source energy value of the ambient visible light is less than the light source energy value of the ambient visible light in the previous cycle, it is determined that the infrared light to be identified includes the reflected infrared light and the infrared light to be filtered out in the preset band.

[0058] Among them, in this case, the receiving module receives the infrared light to be recognized, the ambient infrared light, and the ambient visible light. The light source energy value of the infrared light to be recognized increases and the light source energy value of the ambient visible light decreases synchronously, that is, the light source energy value of the ambient visible light is less than that of the ambient visible light in the previous period. It can be known that the increase in the light source energy value of the infrared light to be recognized at this time is caused by the approaching of the occluder and the external ambient infrared light, so as to further perform the interference filtering and distance measurement in the subsequent steps 703 to 704.

[0059] (2) In the case where the light source energy value of the ambient visible light is not less than the light source energy value of the ambient visible light in the previous period, it is determined that the infrared light to be recognized includes the infrared light to be filtered in the preset band.

[0060] Among them, in this case, the receiving module receives the infrared light to be recognized, the ambient infrared light, and the ambient visible light. The light source energy value of the infrared light to be recognized increases but the light source energy value of the ambient visible light does not decrease synchronously, that is, the light source energy value of the ambient visible light is not less than that of the ambient visible light in the previous period. It can be known that the increase in the light source energy value of the infrared light to be recognized at this time is caused by the external ambient infrared light, so the subsequent interference filtering and distance measurement are no longer performed.

[0061] Step 703, determine the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship.

[0062] Among them, at this time, it is determined that the increase in the light source energy value of the infrared light to be recognized is caused by the approaching of the occluder and the external ambient infrared light. Therefore, the filtering threshold is dynamically determined based on the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship. The light source energy value exceeding the filtering threshold in the light source energy value of the infrared light to be recognized is filtered to obtain the light source energy value of the reflected infrared light, realizing the interference filtering of the external ambient infrared light, and the remaining light source energy value of the reflected infrared light for measuring the distance of the occluder.

[0063] Step 704, determine the distance of the occluder according to the light source energy value of the reflected infrared light.

[0064] In an embodiment of the present application, the receiving module of the distance sensor of the distance measuring device receives the infrared light to be recognized and ambient infrared light, and can also receive ambient visible light. The application processor determines whether the infrared light to be recognized includes the reflected infrared light by obtaining the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the light source energy value of the ambient visible light. When it is determined that the infrared light to be recognized includes the reflected infrared light and the infrared light to be filtered in the preset band corresponding to the ambient infrared light from the outside, it can be known that there is an obstacle approaching. At the same time, based on the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, the light source energy value of the reflected infrared light is determined, and the infrared light to be filtered in the preset band corresponding to the ambient infrared light from the outside is filtered out from the infrared light to be recognized, so as to accurately determine the distance of the obstacle according to the light source energy value of the reflected infrared light after filtering out the interference of the ambient infrared light. When it is determined that the infrared light to be recognized does not include the reflected infrared light, it can be known that there is no obstacle approaching at present, and the increase in infrared energy is caused by the ambient infrared light from the outside, so there is no need to misjudge the distance based on the light source energy value of the ambient infrared light. Therefore, through the embodiment of the present application, it is possible to perform dual-dynamic recognition and detection based on the infrared light to be recognized and the ambient visible light, which can not only filter out the interference of the ambient infrared light from the outside, reduce the risk of misjudgment, ensure the measurement performance of the distance measuring device, but also save the cost of assembling the coating film.

[0065] In another alternative embodiment, refer to Figure 8 , Figure 8 FIG. shows a schematic flowchart of another distance measurement method provided by an embodiment of the present application. In this embodiment, the distance sensor of the above distance measuring device is disposed on an Internet of Things (IOT) device around the terminal device, and the application processor is the central processing unit (CPU) of the terminal device. The method may include the following steps.

[0066] Step 801: Obtain the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, where the infrared light to be recognized and the ambient infrared light are received and recognized by the IOT device, and the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light are uploaded to the terminal device for processing by the terminal device.

[0067] Optionally, the ambient visible light may also be obtained, where the ambient visible light may also be received and recognized by the IOT device and uploaded to the terminal device for processing by the terminal device.

[0068] Steps 802 to 804 are similar to steps 702 to 704 above. For specific descriptions, refer to the descriptions of the above embodiments and will not be repeated here.

[0069] In the embodiments of the present application, due to the increasingly miniaturized design requirements of current terminal devices, it is difficult to simultaneously consider the miniaturized design of the transmitting and receiving optical paths and the performance requirements of the distance sensor. Therefore, infrared light (including infrared light to be recognized or ambient infrared light) and ambient visible light can be received by invoking IOT devices around the terminal device. These IOT devices are configured with high-performance distance sensors, and the IOT devices can establish corresponding protocols with the terminal device to be invoked by the terminal device. The emission and reception of infrared light or ambient visible light are realized by the IOT devices, and the CPU of the terminal device only needs to receive the relevant light source energy values and process and determine them, that is, the distance measurement performance can be further improved by relying on third-party devices outside the terminal device.

[0070] In one implementation, the embodiments of the present application provide an electronic device, which includes the distance detection device described in the above various embodiments. By implementing the above method embodiments through this electronic device, it is possible to accurately identify the interference caused by long-wave infrared light in the external ambient light to the reflected infrared light, optimize the filtering logic, and dynamically filter the interference based on the obtained light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, so as to improve the accuracy and efficiency of distance measurement.

[0071] As Figure 9 shown, the embodiments of the present application provide an electronic device 900, including a processor 901 and a memory 902. A program or instruction that can run on the processor 901 is stored on the memory 902. When the program or instruction is executed by the processor 901, each step of the above distance measurement method embodiments is implemented, and the same technical effects can be achieved. To avoid repetition, it will not be elaborated here.

[0072] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0073] Figure 10 FIG. is a schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application.

[0074] The electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.

[0075] Among them, the radio frequency unit 1001 can be used to emit target infrared light in a preset band. The interface unit 1008 can be used to receive the infrared light to be recognized and ambient infrared light, and send the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light to the processor 1010. The processor 1010 can be used to receive the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, and determine the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship; wherein, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset band; the processor 1010 can also be used to determine the distance of the occluder according to the light source energy value of the reflected infrared light.

[0076] Those skilled in the art can understand that the electronic device 1000 may further include a power supply (such as a battery) for powering each component. The power supply can be logically connected to the processor 1010 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 10 The structure of the electronic device shown does not limit the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0077] It should be understood that in the embodiments of the present application, the input unit 1004 may include a Graphics Processing Unit (GPU) 10041 and a microphone 10042. The graphics processor 10041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 may include a display panel 10061. The display panel 10061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. The other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.

[0078] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 1009 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.

[0079] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 1010 either.

[0080] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above embodiment of the distance measurement method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0081] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.

[0082] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above embodiment of the distance measurement method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0083] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0084] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above embodiment of the distance measurement method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0085] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0087] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative rather than restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.

Claims

1. A distance measuring device, characterized in that, Including: A distance sensor and an application processor, wherein the distance sensor includes a transmitting module and a receiving module; The transmitting module is configured to transmit target infrared light in a preset wavelength band; The receiving module is configured to receive infrared light to be recognized and ambient infrared light, and send the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light to the application processor; wherein, the infrared light to be recognized includes at least one of the following: reflected infrared light after the target infrared light in the preset wavelength band is reflected by an obstacle, and infrared light to be filtered in the preset wavelength band corresponding to the ambient infrared light; The application processor is configured to receive the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light, and determine the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship; wherein, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset wavelength band; The application processor is further configured to determine the distance of the obstacle according to the light source energy value of the reflected infrared light.

2. The distance measuring device according to claim 1, characterized in that, The receiving module includes a first-band infrared light receiving unit and a second-band infrared light receiving unit; The first-band infrared light receiving unit is configured to receive the infrared light to be recognized; The second-band infrared light receiving unit is configured to receive the ambient infrared light.

3. The distance measuring device according to claim 1, wherein The receiving module is further configured to receive ambient visible light, and send the light source energy value of the ambient visible light to the application processor; The application processor is further configured to receive the light source energy value of the ambient visible light, and determine whether the infrared light to be recognized includes the reflected infrared light according to the light source energy value of the ambient visible light.

4. A distance measurement method, characterized in that, Including: Obtaining the light source energy value of the infrared light to be recognized and the light source energy value of the ambient infrared light; wherein, the infrared light to be recognized includes at least one of the following: reflected infrared light after the target infrared light in the preset wavelength band is reflected by an obstacle, and infrared light to be filtered in the preset wavelength band corresponding to the ambient infrared light; Determining the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship; wherein, the preset mapping relationship includes the mapping relationship between the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset wavelength band; Determining the distance of the obstacle according to the light source energy value of the reflected infrared light.

5. The method according to claim 4, wherein The determining the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and a preset mapping relationship includes: Determining a filtering threshold corresponding to the light source energy value of the ambient infrared light according to the preset mapping relationship; Filtering out the light source energy value in the light source energy value of the infrared light to be recognized that exceeds the filtering threshold, to obtain the light source energy value of the reflected infrared light.

6. The method according to claim 4, characterized in that Before determining the light source energy value of the reflected infrared light according to the light source energy value of the infrared light to be recognized, the light source energy value of the ambient infrared light, and the preset mapping relationship, the method further includes: Establish the preset mapping relationship according to the light source energy value of the ambient infrared light and the light source energy value of the infrared light to be filtered in the preset band.

7. The method according to claim 4, wherein The method further includes: Obtain the light source energy value of ambient visible light; Determine whether the infrared light to be recognized includes the reflected infrared light according to the light source energy value of the ambient visible light.

8. The method according to claim 7, wherein The determining whether the infrared light to be recognized includes the reflected infrared light according to the light source energy value of the ambient visible light includes: When the light source energy value of the ambient visible light is less than the light source energy value of the ambient visible light in the previous period, determine that the infrared light to be recognized includes the reflected infrared light and the infrared light to be filtered in the preset band; When the light source energy value of the ambient visible light is not less than the light source energy value of the ambient visible light in the previous period, determine that the infrared light to be recognized includes the infrared light to be filtered in the preset band.

9. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores programs or instructions that can run on the processor. When the programs or instructions are executed by the processor, the steps of the distance measurement method according to any one of claims 4 to 8 are implemented.

10. A readable storage medium, characterized in that, Programs or instructions are stored on the readable storage medium, and when the programs or instructions are executed by the processor, the steps of the distance measurement method according to any one of claims 4 to 8 are implemented.