Infrared proximity sensing method, device, equipment and storage medium based on self-calibration

Through the self-calibrated infrared proximity sensing method, the infrared proximity sensing results are confirmed using dynamic threshold values, which solves the problem of detection inaccuracy caused by fixed threshold values, and improves the accuracy and reliability of detection.

CN114296146BActive Publication Date: 2025-08-12GUANGZHOU HEDONG TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111552480.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-08-12
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

In the existing infrared proximity sensing technology, fixed threshold values lead to inaccurate detection results, which are prone to problems such as misoperation, miss sensing or induction failure.

Method used

Through self-calibration method, the infrared proximity sensor is used to perform proximity detection at a preset time interval, calculate the average induction value as the reference threshold value, and confirm the induction result based on the dynamic threshold value, dynamic threshold value = reference threshold value + absolute correction value + current proximity induction value /n.

Benefits of technology

It improves the accuracy of infrared proximity sensing, reduces the phenomenon of erroneous operation and induction instability, and enhances the reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296146B_ABST
    Figure CN114296146B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose a self-calibration-based infrared proximity sensing method, apparatus, device, and storage medium. The method includes: performing proximity detection using an infrared proximity sensor at preset time intervals to obtain multiple proximity sensing values; accumulating the proximity sensing values at preset intervals to obtain an accumulated value, and calculating an average sensing value based on the accumulated value; using the average sensing value as the reference threshold value for each proximity detection in the next period; and confirming the infrared proximity sensing result based on the current proximity sensing value and the reference threshold value corresponding to the current period. This solution enables self-calibration of the infrared proximity sensing threshold value, improving detection and sensing accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of smart homes, and in particular to a self-calibration-based infrared proximity sensing method, apparatus, device, and storage medium. Background Art

[0002] Infrared proximity sensing technology is widely used in everyday applications, such as smart homes, in-car navigation systems, and smart electronic devices like mobile phones. It can be used to wake up smart home devices like bedside lamps and range hoods; turn off the screen of a mobile phone or other device when it's held close to the head during a call, and turn it back on when it's held away; and provide in-car navigation systems with reminders of obstructions around parking spaces during parking. This effectively detects moving objects.

[0003] In existing technologies, infrared proximity sensing technology is implemented using infrared proximity sensors. These sensors compare the detected signal with an absolute threshold and perform corresponding operations based on the comparison result. This absolute threshold is either factory-set and fixed, or, in existing technologies, is switched based on external conditions. This approach ensures that the threshold remains unchanged for a relatively long period of time. However, using the absolute threshold to determine the comparison result can result in inaccurate detection results, leading to erroneous operations, false sensing, or sensing failure. Summary of the Invention

[0004] In view of the above-mentioned phenomenon of misoperation caused by the comparison method using absolute threshold values, the embodiments of the present invention provide a self-calibration-based infrared proximity sensing method, apparatus, device and storage medium to automatically calibrate the threshold value in real time and improve the accuracy of proximity sensing.

[0005] In a first aspect, the present invention provides an infrared proximity sensing method based on self-calibration, comprising:

[0006] Performing proximity detection based on the infrared proximity sensor at preset time intervals to obtain multiple proximity sensing values;

[0007] Accumulating the proximity sensing values according to a preset period to obtain an accumulated value, and calculating an average sensing value based on the accumulated value;

[0008] Using the average sensing value as the reference threshold value for each proximity detection in the next cycle;

[0009] The infrared proximity sensing result is confirmed based on the proximity sensing value of the current time and the reference threshold value corresponding to the current cycle.

[0010] Furthermore, based on the proximity sensing value of the current time and the reference threshold value corresponding to the current cycle, a dynamic threshold value corresponding to the proximity sensing value of the current time is calculated;

[0011] The infrared proximity sensing result is confirmed according to the magnitude relationship between the proximity sensing value at that time and the corresponding dynamic threshold value.

[0012] Furthermore, the dynamic threshold is calculated as follows:

[0013] Dynamic threshold value = reference threshold value + absolute correction value + current proximity sensing value / n;

[0014] Correspondingly, confirming the infrared proximity sensing result according to the magnitude relationship between the proximity sensing value of the current time and the corresponding dynamic threshold value includes:

[0015] When the proximity sensing value is greater than the corresponding dynamic threshold value, it is confirmed that the presence of the approaching object is detected;

[0016] Otherwise, confirm that no approaching object is detected;

[0017] Where n is the real-time correction coefficient.

[0018] Furthermore, when the proximity sensing value is greater than the corresponding dynamic threshold value, it is confirmed that the presence of the approaching object is detected, and the method further includes:

[0019] Sends a preset control signal to the associated controller.

[0020] Furthermore, sending a preset control signal to the associated controller includes:

[0021] It is confirmed that the current validity period of the previous control signal has been exceeded, and preset control information is sent to the associated controller.

[0022] Furthermore, if it is detected that the amplitude of the proximity sensing value changes continuously for multiple times within the sensing threshold in the current cycle, the reference threshold value corresponding to the current cycle is used as the average sensing value calculated in the current cycle.

[0023] In a second aspect, an embodiment of the present invention provides an infrared proximity sensing device based on self-calibration, comprising:

[0024] an infrared light detection unit, configured to perform proximity detection based on the infrared proximity sensor at preset time intervals to obtain a plurality of proximity sensing values;

[0025] a sensing value accumulation unit, configured to accumulate the proximity sensing values according to a preset period to obtain an accumulated value, and calculate an average sensing value based on the accumulated value;

[0026] a reference threshold value confirmation unit, configured to use the average sensing value as a reference threshold value for each proximity detection in the next cycle;

[0027] The sensing judgment unit is used to confirm the infrared proximity sensing result based on the proximity sensing value of the current time and the reference threshold value corresponding to the current cycle.

[0028] Furthermore, the sensing and judging unit includes:

[0029] A threshold value calculation module, configured to calculate a dynamic threshold value corresponding to the current proximity sensing value based on the current proximity sensing value and a reference threshold value corresponding to the current cycle;

[0030] The threshold value comparison module is used to confirm the infrared proximity sensing result according to the magnitude relationship between the proximity sensing value at that time and the corresponding dynamic threshold value.

[0031] Furthermore, the dynamic threshold is calculated as follows:

[0032] Dynamic threshold value = reference threshold value + absolute correction value + current proximity sensing value / n;

[0033] Correspondingly, the sensing and judging unit includes:

[0034] A first comparison module is configured to confirm that the presence of an approaching object is detected when the proximity sensing value is greater than a corresponding dynamic threshold value;

[0035] a second comparison module, configured to confirm that no approaching object is detected when the current proximity sensing value is less than or equal to a corresponding dynamic threshold value;

[0036] Where n is the real-time correction coefficient.

[0037] Furthermore, the infrared proximity sensing device further includes:

[0038] The signal sending unit is used to send a preset control signal to the associated controller.

[0039] Furthermore, the signal sending unit includes:

[0040] The timeliness judgment module is used to confirm that the current validity period of the previous control signal has exceeded and send preset control information to the associated controller.

[0041] Furthermore, the infrared proximity sensing device further includes:

[0042] The second threshold value confirmation unit is configured to use the reference threshold value corresponding to the current cycle as the average sensing value calculated for the current cycle if it is detected that the amplitude of the proximity sensing value changes continuously for multiple times within the sensing threshold within the current cycle.

[0043] In a third aspect, an embodiment of the present invention further provides an electronic device, including:

[0044] one or more processors;

[0045] a storage device for storing one or more programs;

[0046] When the one or more programs are executed by the one or more processors, the one or more processors implement the infrared proximity sensing method based on self-calibration as described in the first aspect.

[0047] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the infrared proximity sensing method based on self-calibration as described in the first aspect.

[0048] In this solution, the infrared proximity sensor emits and receives infrared light at a certain time frequency and calculates an average proximity sensing value per calculation cycle. The baseline threshold value for the next cycle is determined based on the average proximity sensing value, and the current threshold value is calculated based on the proximity sensing value at the current moment. The self-calibration method of the threshold value in this solution greatly improves the accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0050] Figure 1 A method flow chart of a self-calibration-based infrared proximity sensing method provided by an embodiment of the present invention;

[0051] Figure 2 The infrared proximity sensor structure and transmission and reception schematic diagram provided by an embodiment of the present invention;

[0052] Figure 3 A schematic diagram of transmitting and receiving infrared light of another infrared proximity sensor provided by an embodiment of the present invention;

[0053] Figure 4 A schematic diagram of detection timing of a self-calibration-based infrared proximity sensing method provided by an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of control signal transmission of a self-calibration-based infrared proximity sensing method according to an embodiment of the present invention;

[0055] Figure 6 A schematic diagram of the response of the self-calibration-based infrared proximity sensing method provided by an embodiment of the present invention;

[0056] Figure 7 A schematic diagram of the structure of a device for a self-calibration infrared proximity sensing method according to an embodiment of the present invention;

[0057] Figure 8 A schematic structural diagram of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The present invention aims to address the shortcomings of the prior art and provide a method for threshold self-calibration. It should be noted that this embodiment improves the calculation and calibration of the threshold. The methods for transmitting, receiving, outputting, and controlling signals involved in the present invention are not the subject of this invention and can be implemented using existing technologies.

[0059] The threshold self-calibration method provided in this solution can be applied to electronic devices equipped with infrared proximity sensors in scenarios requiring intelligent wake-up, such as smart homes and navigation systems. These electronic devices can include, but are not limited to, smart faucets, smart lights, smart range hoods, smart speakers, soap dispensers, and water dispensers.

[0060] In the smart home sector, with the increasing use of smart devices and the increasing number of smart home devices in users' homes, users often need to wake up the smart home device they want to control before operating it so that it can receive operation instructions and perform the corresponding actions. There are also various smart home wake-up methods, such as voice wake-up, light wake-up, Bluetooth wake-up, and infrared wake-up. Because wake-up methods such as voice or light are not convenient at certain times, waking up smart home devices based on infrared proximity sensing and gesture detection is more user-friendly and intelligent, which can significantly improve the user experience.

[0061] Infrared detection technology is a type of infrared reflection technology. The infrared sensor has a built-in infrared transmitter and receiver. When the receiver receives infrared light that is blocked and reflected by an object, the corresponding trigger mechanism is activated. This infrared detection technology allows the infrared sensor to detect the presence of nearby objects without requiring any direct contact between the object and the infrared sensor. The infrared transmitter and receiver are placed in the same direction. The infrared light emitted by the transmitter is reflected by the object and then received by the receiver. The infrared sensor converts the infrared light received by the receiver into an electrical signal output, which triggers the control pin and controls the circuit switch.

[0062] When infrared detection is specifically applied to infrared proximity sensing technology, the device that implements infrared proximity sensing technology is an infrared proximity sensor. An infrared proximity sensor is a functional device that can detect the movement and presence of an object and convert the information into an electrical signal output. Among them, the infrared proximity sensor is generally installed indoors, and its infrared light emission and reception process is always ongoing and uninterrupted. To avoid misoperation, the working principle of the infrared proximity sensor is that when the signal intensity of the infrared light received by the infrared receiving tube changes and the change intensity exceeds a certain threshold, the infrared proximity sensor converts the received infrared light into an electrical signal output, compares the electrical signal with the threshold value set by the system, determines the result of infrared proximity sensing, and performs the corresponding operation. Of course, installing the infrared proximity sensor outdoors or in other open locations does not affect the realization of the same detection function.

[0063] The threshold value is a parameter used to determine the detection results of infrared proximity sensors. It is typically set to a fixed value during factory debugging, and the threshold value setting affects the detection results. To reduce false recognition, false sensing, and unstable sensing, and to improve detection accuracy, this solution provides a self-calibration infrared proximity sensing method that automatically calibrates the threshold value at a preset interval.

[0064] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended to explain the present invention, not to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0065] It should be noted that due to space limitations, this application specification does not enumerate all optional implementation methods. After reading this application specification, those skilled in the art should be able to understand that as long as the technical features do not contradict each other, any combination of technical features can constitute an optional implementation method.

[0066] Each embodiment is described in detail below.

[0067] Figure 1 A method flow chart of a self-calibration-based infrared proximity sensing method provided by an embodiment of the present invention is shown in the figure. The self-calibration-based infrared proximity sensing method includes:

[0068] Step S101: Perform proximity detection based on an infrared proximity sensor at preset time intervals to obtain a plurality of proximity sensing values.

[0069] The devices to which the present invention is applied can be, for example, smart desk lamps, smart water dispensers, smart speakers in smart home environments, or various fixed-type terminal devices equipped with infrared proximity sensors that require pre-awakening, such as navigation systems in other scenarios. However, in addition to fixed-type terminal devices that require awakening, the solution of this embodiment can also be applied to mobile terminal devices such as mobile phones and tablet computers.

[0070] Infrared proximity sensors are equipped with an infrared emitting tube and an infrared receiving tube. When the infrared light emitted by the infrared emitting tube within a certain range is blocked by an object in front of it, this infrared light is reflected back. The infrared receiving tube receives the reflected infrared light and converts the signal intensity of this infrared light. It should be noted that the infrared receiving tube can only receive infrared light signals from the infrared emitting tube it is paired with.

[0071] Infrared proximity sensors perform analog-to-digital conversion on the intensity of the received infrared light signal. This conversion converts an analog signal into a quantifiable digital signal. In this solution, the analog-to-digital conversion converts the infrared light signal intensity into a specific numerical value, which is the proximity sensing value. The infrared light signal intensity and the converted numerical value are directly proportional; that is, the greater the infrared light signal intensity, the greater the corresponding output sensing value.

[0072] It's understandable that the intensity of the received infrared light signal is related to the distance to the object, its reflective surface area, and its color. A larger proximity value indicates a closer distance between the object and the sensor. A larger area reflects infrared light, resulting in a higher value. The color of the object, such as white, also produces a higher value than a less reflective color like black.

[0073] In this embodiment, the infrared proximity sensing of a smart bedside lamp in a smart home scenario is taken as an example, and the detection object is a hand. The following description is made using gestures.

[0074] Figure 2 The infrared proximity sensor structure and transmission and reception schematics provided in an embodiment of the present invention. The infrared proximity sensor includes an infrared emitting tube 21 and an infrared receiving tube 22, and the infrared emitting tube 21 and the infrared receiving tube 22 are placed in the same direction. The infrared emitting tube 21 emits infrared light of a certain frequency within a certain range. If there is no moving object in front of the infrared proximity sensor, the signal intensity of the infrared light received by the infrared receiving tube 22 matched with the infrared emitting tube 21 only varies within a small range. If there is an opaque object moving in front, the signal intensity of the infrared light reflected by the opaque object received by the infrared receiving tube 22 continuously varies over a continuous period of time during the movement of the opaque object. At this time, the infrared proximity sensor converts the infrared light into an electrical signal and outputs a proximity sensing value.

[0075] In this embodiment, considering that the detection and recognition of gestures has the characteristics of short distance, fast gesture speed, and large gesture range, the infrared proximity sensor can respond at high speed in a short-distance contactless detection mode, can detect the movement information of objects and has a wide detection range, and can further improve the detection accuracy in detecting the movement of objects.

[0076] like Figure 2 The following illustrates the detection of gesture movement. Within the infrared range, a gesture moves perpendicularly to the infrared proximity sensor's infrared light emission direction at a certain speed at a certain distance from the infrared proximity sensor. Assume the gesture moves from position A to position B and then to position C. At positions A and C, the reflection distance is greater, and the area of the palm reflecting infrared light is smaller. Consequently, the infrared signal strength received by the infrared receiver is lower, and the corresponding output proximity value is also lower. When moving to position B, the distance to the infrared proximity sensor is closer, and the area of the palm reflecting infrared light is larger, so the reflected infrared signal strength is also higher, resulting in a higher output proximity value. From position A to position B and then to position C, the infrared light signal strength increases, then decreases, and the corresponding output proximity value also increases, then decreases. It should be noted that during the gesture movement, when the gesture is first detected and confirmed at position A, the infrared proximity sensor's output proximity value changes from the environmental proximity value to the proximity value corresponding to the gesture at position A. Because the proximity sensing distance of the gesture is closer than the proximity sensing distance of the environment, the output trend of the proximity sensing value during the gesture movement is: from the proximity sensing value of the environment to the proximity sensing value of the gesture at position A, the proximity sensing value corresponding to the gesture at position A then rises to the proximity sensing value corresponding to the gesture at position B, and the proximity sensing value change trend reaches a peak at position B and then drops to the proximity sensing value corresponding to position C.

[0077] Figure 3 This is another schematic diagram of infrared light transmission and reception for an infrared proximity sensor according to an embodiment of the present invention. Within the infrared range, a gesture moves at a certain speed along the linear direction of infrared light emitted by the infrared emitting tube at a certain distance from the infrared proximity sensor. Assuming the gesture moves from position E to position F, the area of infrared light reflected by the palm remains unchanged, while the detection distance between the infrared proximity sensor and the gesture decreases. When the gesture is at position E, the detection distance is S1, and when the gesture is at position F, the detection distance is S2, where S1 is greater than S2. As the received infrared light signal strength increases, the corresponding proximity sensing value output by the infrared proximity sensor also increases.

[0078] It's important to note that in a fixed environment, the amplitude variation of the infrared signal strength received by the infrared receiver is relatively small. For example, in this solution, consider the gesture wake-up feature of a smart bedside lamp in a smart home scenario. In a bedroom, the user is typically asleep or the room is unoccupied most of the time. During this time, the infrared proximity sensor built into the smart bedside lamp receives infrared light reflected from fixed objects in the bedroom. These fixed objects can be relatively stationary, such as wardrobes, dressing tables, or televisions. Because fixed objects have a fixed reflection distance and reflective surface area, the output sensing value corresponding to the signal strength of the reflected infrared light also varies slowly and slightly. Therefore, the sensing value of a fixed object can be considered fixed. For example, in this solution, if the smart bedside lamp's sensor in the bedroom is facing a wardrobe when there are no moving objects obstructing the view, the proximity sensing value corresponding to the signal strength of the infrared light reflected from the wardrobe is 5000.

[0079] Relatively speaking, when the gesture moves within a small range or stays in front of the infrared proximity sensor, the received infrared signal intensity changes slowly. At this time, the output sensing value only changes within a very small threshold range. In addition, the infrared proximity sensor's infrared light emission and reception is a continuous process. Therefore, in order to improve detection efficiency, gesture detection needs to set a certain time frequency, and infrared light emission and reception are performed according to the said time frequency.

[0080] Figure 4 This is a schematic diagram of the detection timing of the self-calibration infrared proximity sensing method provided by an embodiment of the present invention. The infrared emitting tube continuously emits infrared light, wherein the infrared receiving tube can continuously detect infrared light. In actual processing, the detection value of infrared light is not generated continuously, but is obtained once at a certain interval in a periodic sampling manner, for example, at a time interval of 20ms, i.e., the proximity sensing value in infrared proximity sensing. Figure 4 As shown, in this solution, 20 detection sensing times are preset as a detection sensing cycle, and multiple proximity sensing values are obtained within the detection cycle. The scale on the coordinate axis represents the detection sensing moment, and the detection sensing time is divided into cycles according to the number of times. For example, the first cycle is T0, the second cycle is T1, the third cycle is T2, and so on. In each cycle, 20 detection sensing moments are detected and sensed at time intervals and the corresponding proximity sensing values are output.

[0081] Step S102: Accumulate the proximity sensing values according to a preset period to obtain an accumulated value, and calculate an average sensing value based on the accumulated value.

[0082] The detection time is divided into preset periods, and multiple sensing values are detected within the preset period. The proximity sensing values corresponding to the signal strength of the infrared light detected within the period are accumulated and averaged to obtain an average value. In this embodiment, the detection is performed once at a time interval of 20ms, and 20 detections are taken as a period. At the last detection moment of the period, all proximity sensing values detected within the period are accumulated and averaged. Figure 4 As shown, the last detection sensing moment of the T0 cycle is T 020 , the last detection sensing moment of T1 cycle is t 120 At t 020 Accumulate the proximity sensing values in the T0 period at the moment to obtain the accumulated value of the T0 period, and calculate the average value to obtain the average proximity sensing value in the T0 period; at t 120 Accumulate the proximity sensing values in the T1 period at all times to obtain the accumulated value of the T1 period, and calculate the average value to obtain the average proximity sensing value in the T1 period;

[0083] Among them, the time interval and preset period can be set according to the usage environment. In situations where wake-up is required frequently or the object in front moves frequently, the time interval and period can be shortened to adjust the detection accuracy; when the number of wake-up times is small or the number of times the object in front moves is small, the detection time interval and period can be appropriately extended to reduce loss and resource usage.

[0084] Step S103: Using the average sensing value as a reference threshold value for each proximity detection in the next cycle.

[0085] In order to determine the results of the infrared proximity sensor's detection, a threshold value for determining the detection sensing value must be pre-set. The current infrared proximity sensing result is determined by comparing the proximity sensing value with the threshold value. The threshold value may include only the proximity threshold value, or it may include both the proximity threshold value and the distance threshold value. The threshold value is a specific numerical value that can be set by the infrared proximity sensor during factory debugging or according to the environment or object of use. Generally speaking, the threshold value is fixed. However, during use, due to changes in the surrounding environment, as well as external or internal factors such as parameter settings and the sensitivity of the infrared proximity sensor's detection, the use of a fixed threshold value may result in unstable sensing distance, sensing failure, or malfunction. To address this problem, if the threshold value is adjusted by switching to different modes, a sudden change in the threshold value occurs when switching between two different modes. The threshold values vary between different modes. For example, the system's preset threshold value in high-light mode is higher than that in low-light mode. A sudden change in threshold value occurs when the system's threshold value jumps from a smaller threshold value to a larger threshold value during the brief period between the start and completion of a mode switch. This sudden change in threshold value can cause recognition failure, resulting in poor infrared proximity sensor recognition or incorrect gesture recognition by the infrared proximity sensor, causing the device terminal to perform an unexpected operation, leading to erroneous operation.

[0086] To avoid the aforementioned detection errors, this embodiment employs a self-calibration method that maintains a relatively constant threshold value. This relatively constant threshold value refers to the situation where, in a fixed environment with no moving objects, the threshold value fluctuates slightly within a small range. In this case, the threshold value is considered to remain fixed. Similarly, within a detection cycle, a large jump from one threshold value to another in a short period of time can destabilize the system. Therefore, the threshold value is also set to remain fixed within the detection cycle.

[0087] As can be seen from the above, the average proximity sensing value of the current cycle is obtained at the last detection sensing moment in each cycle, and this average proximity sensing value is used as the reference threshold value of the next adjacent cycle, and so on. 020 The average proximity sensing value of the T0 period calculated at the moment is used as the reference threshold value of the T1 period and will be 120 The average proximity sensing value of the T1 cycle calculated at the moment is used as the reference threshold value of the T2 cycle, and so on. It is undeniable that before the detection sensing and calculation work of the current cycle is completed, the threshold value of the next cycle adjacent to the current cycle has not yet been determined. For example: in the T0 cycle, 019At the detection sensing moment, the threshold value for cycle T1 has not yet been determined. The detection calculation result of the current cycle is output as the reference threshold value for the next cycle, and this reference threshold value remains fixed within the cycle. If the amplitude of the detected sensing values at the detection moments in the current cycle changes slowly over multiple consecutive times, and the amplitude of change remains within the sensing threshold, then after the detection moment of the current cycle is completed, the sensing values of all detection moments in the current cycle are not accumulated and averaged. Instead, the reference threshold value of the current cycle is directly used as the reference threshold value for the next cycle. During the detection process of the current cycle, the results of each detection are accumulated or recorded to ensure that if the detection results fluctuate at any time, there is detection data available for reference threshold value calculation. Of course, after the accumulation and averaging calculations, the result can also be compared with the reference threshold value of the current cycle. If the calculated result is close to the reference threshold value of the current cycle, the reference threshold value of the current cycle is directly used as the reference threshold value for the next cycle. It should be noted that using the result of each average calculation as the reference threshold value for the next cycle, or retaining the use of the reference threshold value according to the change situation, does not deviate from the design framework of this solution and is a feasible implementation method of this solution.

[0088] Step S104: confirming the infrared proximity sensing result based on the proximity sensing value of the current time and the reference threshold value corresponding to the current cycle.

[0089] As previously mentioned, after the infrared proximity sensor outputs the proximity value corresponding to the detection moment, it must also be evaluated. By comparing the dynamic threshold value with the proximity value at the detection moment, it is determined whether an object has been detected. If so, the system issues a corresponding control signal and controls the terminal device to perform the corresponding operation. For example, in this case, the smart bedside lamp wakes up and activates lighting upon confirming the presence of a detected object.

[0090] Among them, the dynamic threshold value is the sum of the reference threshold value and the static fluctuation correction value, and the static fluctuation correction value is used to judge the degree of deviation between the proximity sensing value output at the current moment and the reference threshold value. The calculation formula of the static fluctuation correction value is: static fluctuation correction value = absolute correction value + proximity sensing value output at the current moment / n, where n is the real-time correction coefficient. The absolute correction value and n are set according to the use environment and are generally set to a fixed value in a fixed environment. It can be seen from the formula that the larger the proximity sensing value output at the current moment, the larger its static fluctuation correction value, indicating that the degree of deviation of the proximity sensing value output at the current moment is greater. Since the output proximity sensing value corresponding to each detection sensing moment has its corresponding static fluctuation correction value, the corresponding dynamic threshold value is also inconsistent.

[0091] Figure 5Schematic diagram of control signal transmission provided by an embodiment of the present invention. After obtaining the corresponding dynamic threshold value, compare the proximity sensing value output at the current detection sensing moment with the corresponding dynamic threshold value. If the sensing value output at the current detection moment is greater than the corresponding dynamic threshold value, it is considered that the detection sensing gesture exists; if the sensing value output at the current detection moment is less than the corresponding dynamic threshold value, it is considered that no detection sensing gesture exists. After confirming that the gesture is detected, if Figure 5 As shown, infrared proximity sensor 31 sends a control signal to controller 32. Controller 32, upon receiving the control signal, sends a trigger signal to associated terminal device 33. Terminal device 33 receives the trigger signal and responds accordingly. For example, in this solution, the smart bedside lamp activates its lighting function upon receiving the trigger signal.

[0092] Figure 6 Schematic diagram of the response provided by the embodiment of the present invention. It should be noted that after receiving the trigger signal, the terminal device 33 responds according to the preset response time t. After confirming that the terminal device is not within the preset time, the controller 32 sends a trigger signal to the terminal device 33. The preset response time t is the duration of the response of the terminal device 33 after receiving the trigger signal. Figure 6 As shown, assuming that the terminal device 33 is in an unresponsive state, at t a After receiving the trigger signal at the moment, the terminal device 33 responds according to the preset response time t. If the response time is within the length t, the controller 32 is connected to the t b time and t c At this moment, the controller 32 does not send a trigger signal to the terminal device. a After the trigger signal received at time t is responded to, as shown in the figure, that is, at t d At the end of time, the terminal device 33 is at t d For example, if the lighting function of the smart bedside lamp is turned off, the device terminal 33 will re-enter the unresponsive state. e When the controller 32 receives the control signal at the time, it continues to send the trigger signal to the terminal device 33, and the terminal device 33 receives the control signal at the time t e Continue to trigger the response at all times to enter the response state.

[0093] In summary, compared with the prior art, the present invention offers the advantage of providing a threshold self-calibration method based on infrared proximity sensing technology. The detection results of the current cycle serve as the baseline threshold for the next cycle, and the dynamic threshold is determined based on the proximity sensing value at the current detection moment. This improves the false detection phenomenon caused by the use of fixed threshold values.

[0094] Figure 7This is a schematic diagram of the structure of an infrared proximity sensing device based on self-calibration provided by an embodiment of the present invention. Figure 7 The infrared proximity sensing device based on self-calibration includes: an infrared light detection unit 701 , a sensing value accumulation unit 702 , a reference threshold value confirmation unit 703 and a sensing judgment unit 704 .

[0095] Among them, the infrared detection unit 701 is used to perform proximity detection based on the infrared proximity sensor at preset time intervals to obtain multiple proximity sensing values; the sensing value accumulation unit 702 is used to accumulate the proximity sensing values at preset periods to obtain accumulated values, and calculate the average sensing value based on the accumulated values; the reference threshold value confirmation unit 703 is used to use the average sensing value as the reference threshold value for each proximity detection in the next period; the sensing judgment unit 704 is used to confirm the infrared proximity sensing result based on the current proximity sensing value and the reference threshold value corresponding to the current period.

[0096] Based on the above embodiment, the device further includes:

[0097] A threshold value calculation module, configured to calculate a dynamic threshold value corresponding to the current proximity sensing value based on the current proximity sensing value and a reference threshold value corresponding to the current cycle;

[0098] The threshold value comparison module is used to confirm the infrared proximity sensing result according to the magnitude relationship between the proximity sensing value at that time and the corresponding dynamic threshold value.

[0099] an infrared light emitting unit, configured to emit infrared light at the time frequency; and an infrared light receiving unit, configured to receive the reflected infrared light;

[0100] an analog-to-digital conversion unit, configured to convert the infrared light received by the infrared light receiving unit into an electrical signal and output a proximity sensing value;

[0101] a reference threshold value assigning unit, configured to assign the average proximity sensing value of the current cycle as the reference threshold value of the next cycle;

[0102] The time division unit is used to divide the detection time into preset time intervals.

[0103] On the basis of the above embodiment, the reflected infrared light is received by the infrared light receiving unit which can only receive the infrared light emitted by the corresponding infrared emitting unit.

[0104] The infrared proximity device based on self-calibration provided in the embodiment of the present invention is installed in various devices and can be used to execute any infrared proximity method based on self-calibration provided in the above embodiments, and has corresponding functions and beneficial effects.

[0105] It is worth noting that in the above-mentioned embodiment of the infrared proximity sensing method based on self-calibration, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present invention.

[0106] Figure 8 This is a schematic diagram of the structure of a terminal device provided by an embodiment of the present invention. Figure 8 As shown, the terminal device includes a processor 810, a memory 820, an input device 830, an output device 840 and a communication device 850; the number of processors 810 in the terminal device can be one or more. Figure 8 In the example, a processor 810 is used; the processor 810, memory 820, input device 830, output device 840 and communication device 850 in the terminal device can be connected via a bus or other means. Figure 8 The bus connection is taken as an example.

[0107] The memory 820, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the infrared proximity sensing method in the embodiments of the present invention (for example, the sensing value accumulation unit 702, the reference threshold value confirmation unit 703, and the sensing judgment unit 704 based on self-calibration infrared proximity sensing). The processor 810 executes the software programs, instructions, and modules stored in the memory 820 to execute various functional applications and data processing of the terminal device, thereby implementing the above-mentioned self-calibration-based infrared proximity sensing method.

[0108] The memory 820 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal device, etc. In addition, the memory 820 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 820 may further include a memory remotely located relative to the processor 810, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0109] The input device 830 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the terminal device. The output device 840 may include a display device such as a display screen.

[0110] The above-mentioned terminal device includes an infrared proximity sensing device, which can be used to execute any infrared proximity sensing method and has corresponding functions and beneficial effects.

[0111] An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform relevant operations in the infrared proximity sensing method provided in any embodiment of the present application, and have corresponding functions and beneficial effects.

[0112] Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products.

[0113] Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0114] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in a computer-readable medium, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0115] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0116] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0117] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. The infrared proximity sensing method based on self-calibration is characterized in that: include: Performing proximity detection based on the infrared proximity sensor at preset time intervals to obtain multiple proximity sensing values; Accumulating the proximity sensing values according to a preset period to obtain an accumulated value, and calculating an average sensing value based on the accumulated value; Using the average sensing value as the reference threshold value for each proximity detection in the next cycle; Confirm the infrared proximity sensing result based on the proximity sensing value of the current time and the reference threshold value corresponding to the current cycle; The step of confirming the infrared proximity sensing result based on the proximity sensing value of the current time and the reference threshold value corresponding to the current cycle includes: Calculate the dynamic threshold value corresponding to the current proximity sensing value based on the current proximity sensing value and the reference threshold value corresponding to the current cycle; confirming the infrared proximity sensing result according to the magnitude relationship between the proximity sensing value at that time and the corresponding dynamic threshold value; The dynamic threshold is calculated as follows: Dynamic threshold value = reference threshold value + absolute correction value + current proximity sensing value / n; Correspondingly, confirming the infrared proximity sensing result according to the magnitude relationship between the proximity sensing value of the current time and the corresponding dynamic threshold value includes: When the proximity sensing value is greater than the corresponding dynamic threshold value, it is confirmed that the presence of the approaching object is detected; Otherwise, confirm that no approaching object is detected; Where n is the real-time correction coefficient.

2. The method according to claim 1, characterized in that When the secondary proximity sensing value is greater than the corresponding dynamic threshold value, after confirming that the proximity object is detected, the method further includes: Sends a preset control signal to the associated controller.

3. The method according to claim 2, characterized in that The sending of a preset control signal to the associated controller includes: It is confirmed that the current validity period of the previous control signal has been exceeded, and preset control information is sent to the associated controller.

4. The method according to claim 1, wherein Also includes: If the amplitude of the proximity sensing value changes continuously detected multiple times within the sensing threshold in the current cycle, the reference threshold value corresponding to the current cycle is used as the average sensing value calculated in the current cycle.

5. An infrared proximity sensing device based on self-calibration, characterized in that: include: an infrared light detection unit, configured to perform proximity detection based on the infrared proximity sensor at preset time intervals to obtain a plurality of proximity sensing values; a sensing value accumulation unit, configured to accumulate the proximity sensing values according to a preset period to obtain an accumulated value, and calculate an average sensing value based on the accumulated value; a reference threshold value confirmation unit, configured to use the average sensing value as a reference threshold value for each proximity detection in the next cycle; A sensing judgment unit, configured to confirm the infrared proximity sensing result based on the proximity sensing value of the current time and the reference threshold value corresponding to the current cycle; Wherein, the sensing and judging unit includes: A threshold value calculation module, configured to calculate a dynamic threshold value corresponding to the current proximity sensing value based on the current proximity sensing value and a reference threshold value corresponding to the current cycle; The threshold value comparison module is used to confirm the infrared proximity sensing result according to the magnitude relationship between the proximity sensing value at that time and the corresponding dynamic threshold value.

6. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the electronic device implements the self-calibration-based infrared proximity sensing method according to any one of claims 1 to 4.

7. A storage medium containing computer-executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to perform the infrared proximity sensing method based on self-calibration according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and system for correcting functions of keyboard plate

    CN104935920A

  • Method and electronic device for detecting finger-on or finger-off

    CN108304760A

  • Infrared proximity sensing method and device, air conditioner and storage medium

    CN112612028A