CN107764406B - Infrared detection management method and electronic equipment - Google Patents

Infrared detection management method and electronic equipment Download PDF

Info

Publication number
CN107764406B
CN107764406B CN201711013510.2A CN201711013510A CN107764406B CN 107764406 B CN107764406 B CN 107764406B CN 201711013510 A CN201711013510 A CN 201711013510A CN 107764406 B CN107764406 B CN 107764406B
Authority
CN
China
Prior art keywords
infrared
light
sensor
variation
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711013510.2A
Other languages
Chinese (zh)
Other versions
CN107764406A (en
Inventor
徐国楚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Meizu Technology Co Ltd
Original Assignee
Meizu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Meizu Technology Co Ltd filed Critical Meizu Technology Co Ltd
Priority to CN201711013510.2A priority Critical patent/CN107764406B/en
Publication of CN107764406A publication Critical patent/CN107764406A/en
Application granted granted Critical
Publication of CN107764406B publication Critical patent/CN107764406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • G01J5/0022Radiation pyrometry, e.g. infrared or optical thermometry for sensing the radiation of moving bodies
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • G01J5/10Radiation pyrometry, e.g. infrared or optical thermometry using electric radiation detectors
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V8/00Prospecting or detecting by optical means
    • G01V8/10Detecting, e.g. by using light barriers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/026Details of the structure or mounting of specific components

Abstract

The invention discloses a management method of infrared detection and electronic equipment, wherein the electronic equipment comprises an infrared sensor and a light sensor, and specifically, whether the infrared sensor detects a first message for representing an infrared approaching event or an infrared departing event is determined; if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not; and if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, receiving the first message sent by the infrared sensor. By adopting the scheme, infrared misjudgment can be avoided, and the accuracy of infrared detection is improved.

Description

Infrared detection management method and electronic equipment
Technical Field
The invention relates to the technical field of electronics, in particular to a management method for infrared detection and electronic equipment.
Background
In recent years, with the development of science and technology, the existing electronic devices such as smart phones occupy a great share of the mobile phone market by virtue of strong functions thereof, and the smart phones increasingly become an indispensable part of people in daily life. The smart phone is continuously innovated in software and hardware, and the social contact and the life of people are continuously changed layer by layer. In a word, the dependence degree of people on the smart phone is higher and higher, and the design of the smart phone is more and more humanized. For example, to prevent the user from operating the screen of the smart phone by mistake, an infrared sensor installed on the housing of the smart phone is generally used to sense the approach of an object, when the object approaches the smart phone, a part of infrared light is reflected to the infrared sensor by an obstacle, the infrared sensor senses an infrared light intensity value, and when the infrared light intensity value reaches a certain intensity, the infrared sensor detects that the object approaches, and the screen of the smart phone is extinguished. Or when the object is far away from the smart phone, a part of infrared light is reflected to the infrared sensor by the obstacle, the infrared sensor senses an infrared light intensity value, and when the infrared light intensity value is weakened to a certain intensity, the object is detected to be far away, and the screen of the smart phone is lightened.
In the working process of the infrared sensor, an infrared approaching threshold value and an infrared far threshold value are needed, when the infrared sensor detects that infrared light is gradually enhanced and the intensity of the infrared light is greater than the infrared approaching threshold value, an object is considered to be close to the infrared sensor, and a screen of the smart phone is turned off. When the infrared sensor detects that the infrared light is gradually weakened and the infrared light intensity is smaller than the infrared far threshold value, it is considered that an object is far away, and the screen of the smart phone is lightened.
Currently, most manufacturers can correct the infrared approaching threshold and the infrared far threshold before leaving a factory, and determine the infrared approaching threshold and the infrared far threshold, but the corrections are complex, once the mobile phone leaves the factory, the infrared approaching threshold and the infrared far threshold start to be fixed, and when the conditions of the mobile phone after leaving the factory change, for example, the change of the ink transmittance of an infrared opening on a mobile phone shell, the shielding degree of a mobile phone film on the infrared opening, dust at the infrared opening, and the like, the misjudgment of the smart phone on infrared approaching and far events is easily caused. For example, when the infrared report is close to and away from an event, if water mist exists at an infrared opening of a mobile phone, the problem of infrared misjudgment is caused.
It can be seen that there are at least the following technical problems in the prior art: when the electronic device detects an event close to the electronic device and an event far away from the electronic device by using infrared detection, infrared misjudgment can be caused because the infrared close threshold and the infrared far threshold cannot be flexibly adjusted according to the actual condition of the electronic device.
Disclosure of Invention
The embodiment of the invention provides an infrared detection management method and electronic equipment, and aims to solve the technical problem that infrared misjudgment can be caused because an infrared approaching threshold value and an infrared far threshold value cannot be flexibly adjusted according to the actual condition of the electronic equipment when the electronic equipment detects an event approaching the electronic equipment and an event far from the electronic equipment by using infrared detection in the prior art.
In a first aspect, an embodiment of the present invention provides a management method for infrared detection, which is applied to an electronic device, where the electronic device includes an infrared sensor and a light sensor, and the method includes:
determining whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not;
and if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, receiving the first message sent by the infrared sensor.
Optionally, after determining whether a variation of the light sensing value received by the light sensor is within a first preset light threshold range, the method further includes:
and if the variation of the light sensing value received by the light sensor in the preset time period is not within the range of a first preset light threshold value, adjusting the infrared approaching threshold value and the infrared departing threshold value of the electronic equipment.
Optionally, if a variation of the light sensing value received by the light sensor in a preset time period is not within a first preset light threshold range, adjusting an infrared approaching threshold and an infrared departing threshold of the electronic device, including:
if the variation of the light sensing value received by the light sensor in a preset time period is smaller than the minimum value in the first preset light threshold range, obtaining a default background noise value of the infrared sensor;
increasing an infrared approach threshold and an infrared departure threshold of the electronic device based on the default noise floor value.
Optionally, if a variation of the light sensing value received by the light sensor in a preset time period is not within a first preset light threshold range, adjusting an infrared approaching threshold and an infrared departing threshold of the electronic device, including:
if the variation of the light sensing value received by the light sensor in a preset time period is greater than the maximum value in the first preset light threshold range, acquiring a default background noise value of the infrared sensor;
based on the default noise floor value, an infrared approach threshold and an infrared departure threshold of the electronic device are reduced.
Optionally, the electronic device further includes a coprocessor and a main processor:
determining, with the co-processor, whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range by using the coprocessor;
if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, awakening the main processor by using the coprocessor;
and the main processor receives the first message sent by the infrared sensor.
In a second aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes an infrared sensor and a light sensor, and the electronic device further includes:
a determination module to determine whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
the judging module is used for judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not when the variation of the light sensing value is yes;
the receiving module is configured to receive the first message sent by the infrared sensor if a variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range.
Optionally, the electronic device further includes:
the adjusting module is used for adjusting the infrared approaching threshold and the infrared far-away threshold of the electronic equipment if the variation of the light sensing value received by the light sensor in a preset time period is not within a first preset light threshold range after judging whether the variation of the light sensing value received by the light sensor is within the first preset light threshold range.
Optionally, the adjusting module includes:
the first obtaining submodule is used for obtaining the default background noise value of the infrared sensor if the variation of the light sensing value received by the light sensor in a preset time period is smaller than the minimum value in the first preset light threshold range;
and the first adjusting submodule is used for increasing the infrared approaching threshold and the infrared departing threshold of the electronic equipment based on the default background noise value.
Optionally, the adjusting module includes:
the second obtaining submodule is used for obtaining the default background noise value of the infrared sensor if the variation of the light sensing value received by the light sensor in a preset time period is larger than the maximum value in the first preset light threshold range;
and the second adjusting submodule is used for reducing the infrared approaching threshold and the infrared far threshold of the electronic equipment based on the default background noise value.
Optionally, the receiving module includes:
the awakening submodule is used for awakening the receiving submodule if the variation of the light sensing value received by the light sensor in the preset time period is within a first preset light threshold range;
the receiving submodule is used for receiving the first message sent by the infrared sensor;
the electronic equipment further comprises a coprocessor and a main processor, wherein the coprocessor comprises the determining module, the judging module and the awakening submodule; the main processor comprises the receiving submodule.
Determining, with the co-processor, whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range by using the coprocessor;
if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, the main processor is awakened by the coprocessor, so that the main processor receives the first message sent by the infrared sensor.
In a third aspect, an embodiment of the present invention provides a computer apparatus, which includes a processor, and the processor is configured to implement the steps of the information processing method in the embodiment of the foregoing first aspect when executing the computer program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored: which when executed by a processor implements the steps of the information processing method as described in the embodiments of the first aspect described above.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
by adopting the technical scheme provided by the embodiment of the invention, the electronic equipment can more accurately determine the infrared approaching event or the infrared far event, and avoid infrared misjudgment, thereby improving the technical effect of the accuracy of infrared detection.
Drawings
Fig. 1 is a flowchart of a management method for infrared detection according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an electronic device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to solve the technical problem, the technical scheme in the embodiment of the invention has the following general idea: a management method of infrared detection and an electronic device comprise an infrared sensor and a light sensor, and specifically determine whether the infrared sensor detects a first message for representing an infrared approach event or an infrared departure event; if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not; and if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, receiving the first message sent by the infrared sensor. By adopting the scheme, infrared misjudgment can be avoided, and the accuracy of infrared detection is improved.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
In a specific implementation process, the management method for infrared detection may be applied to an electronic device, and the electronic device mentioned in the embodiment of the present invention includes but is not limited to: smart phones (such as Android phones and IOS phones), tablet computers, notebook computers, palmtop computers, wearable smart devices, and other electronic devices. Other electronic devices are also possible, and this is not necessarily the case.
As shown in fig. 1, an embodiment of the present invention provides a management method for infrared detection, which is applied to an electronic device, where the electronic device includes an infrared sensor and a light sensor, and the method includes:
s101, determining whether the infrared sensor detects a first message for representing an infrared approaching event or an infrared departing event;
s102, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not when the variation is positive;
and S103, if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, receiving the first message sent by the infrared sensor.
For step S101, taking a mobile phone as an example, an infrared sensor and a light sensor are installed on the mobile phone, a transmitting end of the infrared sensor transmits light with a specific wavelength, and a receiving end of the infrared sensor receives light reflected by an external object.
Whether shielding exists or not is judged by measuring the quantity of light reflected by an external object received by the receiving end of the infrared sensor, and how far the shielded object is away from the mobile phone.
Aiming at the interference that the light at the receiving end on the mobile phone is reflected by the shielding of the transmitting end and the diffuse reflection of the natural light of the sun and the like. For example, when a mobile phone is placed on a table, a measured value of light reflected by an external object received by a receiving end of an infrared sensor is 100, and the 100 can be understood as 100 basic units due to different infrared principle mechanisms of different manufacturers. This 100, commonly referred to as prototype infrared default noise floor, is understood as the default interference.
When an external object is shielded on the mobile phone, the closer the external object is to the mobile phone, the larger the value of light reflected by the external object received by the infrared sensor receiving end is. This is particularly relevant to the structure, ink transmittance of the infrared sensor, and the like.
Assuming that the measured value of the light reflected by the external object received by the receiving end of the infrared sensor is 350 when the external object is shielded from the mobile phone and is 8cm away from the mobile phone, and the measured value is 550 when the external object is shielded from the mobile phone by 5 cm; at 650 cm, this data is assumed, but the specific item can be measured.
A shield is generally set 4cm from the handset and considered to be present. That is, when the infrared measurement value is greater than 650, an interrupt is generated, and the infrared sensor reports an approach action, it is determined that the infrared sensor detects the first message for characterizing the infrared approach event. In the close state, if the shielding object slowly moves away, when the distance exceeds 5cm, namely when the infrared measurement value is less than 550, an interruption is generated, and a far-away action is reported, it is determined that the infrared sensor detects a first message for representing an infrared far-away event.
That is, the static amplification of the mobile phone is 100 in normal times, and suddenly the hand approaches the mobile phone, when the value increases over 650, the approach is reported, and when the value decreases over 550, the distance is reported. 550. 650 are generally referred to as ir far threshold and ir near threshold, respectively. These values are related to the infrared scheme of a specific project, the structure of the infrared IC, the ink transmittance of the infrared opening on the touch screen and the like, and these data can be tested when the specific project is debugged. The data are not the same for different models, which are the same item, because the structures of the models have tolerance and cannot be completely the same.
After step S101 is executed, step S102 is executed continuously, where step S102 specifically includes:
still continuing with the foregoing example, the light sensor is specifically configured to receive the ambient light, that is, the light sensor detects a lumen value of the ambient light received by itself within a preset time period, and determines whether a variation of a light sensing value received by the light sensor within the preset time period is within a first preset light threshold range.
Assuming that an external object blocks the mobile phone and gradually approaches the mobile phone, the infrared sensor detects a first message used for representing an infrared approach event, and in a preset time period (which may be designed according to actual conditions) during which the external object blocks the mobile phone and gradually approaches the mobile phone, a lumen value of ambient light received by the light sensor is also gradually reduced, and a variation of a light sensing value received by the light sensor in the preset time period, for example, a variation of a lumen value of ambient light received by the light sensor in the preset time period, is calculated. And judging whether the variation of the lumen value of the ambient light received by the light sensor in the preset time period is within a first preset light threshold range. Assuming that the first predetermined light threshold range, i.e. the threshold range of the lumen value transformation amount is [380- & 420], the first predetermined light threshold range can be set according to the actual requirement.
Assuming that an external object is shielded from the mobile phone and gradually gets away from the mobile phone, the infrared sensor detects a first message for representing an infrared away event, and in a preset time period in which the external object is shielded from the mobile phone and gradually gets away from the mobile phone, a lumen value of ambient light received by the light sensor is gradually increased, and a variation of a light sensing value received by the light sensor in the preset time period, for example, a variation of the lumen value of the ambient light received by the light sensor in the preset time period, is calculated. And judging whether the variation of the lumen value of the ambient light received by the light sensor in the preset time period is within a first preset light threshold range.
After step S102 is executed, step S103 is executed continuously, specifically as follows:
still using the foregoing example, assuming that the external object is shielded from the mobile phone and gradually approaches the mobile phone, and the variation of the lumen value of the ambient light received by the light sensor in the preset time period is 400 (the lumen value gradually decreases), if the variation is within the first preset light threshold range [380-420], which indicates that the external object actually has been shielded approaches, the first message sent by the infrared sensor and indicating that the infrared approach event occurs is received.
Assuming that the external object is shielded from the mobile phone and gradually gets away from the mobile phone, and the variation of the lumen value of the ambient light received by the light sensor within the preset time period is 400 (the lumen value gradually increases), the variation is within the first preset light threshold range [380 and 420], which indicates that the external object is really shielded from the mobile phone, and then the first message which is sent by the infrared sensor and indicates that the infrared remote event occurs is received.
In addition, after step S102 is executed, if the variation of the light sensing value received by the light sensor in the preset time period is not within the first preset light threshold range, it indicates that the infrared approaching event or the infrared departing event detected by the infrared sensor is a false judgment. Due to the occurrence of misjudgment, the infrared approaching threshold and the infrared departing threshold need to be adjusted, which is specifically as follows:
and if the variation of the light sensing value received by the light sensor in the preset time period is not within the range of the first preset light threshold value, adjusting the infrared approaching threshold value and the infrared departing threshold value of the electronic equipment.
The adjustment is specifically as follows:
if the variation of the light sensing value received by the light sensor in a preset time period is smaller than the minimum value in the first preset light threshold range, obtaining a default background noise value of the infrared sensor;
increasing an infrared approach threshold and an infrared departure threshold of the electronic device based on the default noise floor value.
If the variation of the light sensing value received by the light sensor in a preset time period is greater than the maximum value in the first preset light threshold range, acquiring a default background noise value of the infrared sensor;
based on the default noise floor value, an infrared approach threshold and an infrared departure threshold of the electronic device are reduced.
Still using the foregoing example, the infrared sensor detects an infrared approaching event when the external object approaches the mobile phone by 8cm, at this time, the measured value of the light reflected by the external object received by the receiving end of the infrared sensor is 350, which indicates that the infrared approaching threshold is 350, and the light sensation variation amount is assumed to be 100, which is not within the first preset light threshold range [380 + 420] and is smaller than the minimum value 380 in the first preset light threshold range, which indicates that the infrared approaching event detected by the infrared sensor at 8cm is a false determination, and the infrared approaching threshold needs to be increased, so that the infrared approaching threshold is increased according to the default bottom noise value of the infrared sensor. For example, when an infrared sensor is expected to report an infrared approach event when an external object approaches the mobile phone by 4cm, the infrared approach threshold and the infrared distance threshold of the electronic device are increased according to a default background noise value. For example, default noise floor value is 100, infrared approach threshold is increased to 350+300 to 650, and infrared approach threshold is increased to 350+200 to 550.
In some cases, for example, during factory calibration and/or debugging of the mobile phone, if the infrared approach threshold is large, the infrared sensor detects the infrared approach event when the external object is close to the mobile phone or even the external object is about to be attached to the mobile phone, which indicates that the infrared approach threshold is too large and needs to be adjusted to be small. Assuming that the infrared sensor detects an infrared approaching event when an external object approaches the mobile phone by 2cm, a measurement value of light reflected by the external object received by a receiving end of the infrared sensor is 750, which indicates that the infrared approaching threshold is 750, and a light sensation variation amount is 600, which is not within a first preset light threshold range [380-420] and is greater than a maximum value 420 in the first preset light threshold range, which indicates that the infrared approaching event detected by the infrared sensor at 2cm is a false judgment, and the infrared approaching threshold needs to be reduced, the infrared approaching threshold is reduced according to the default bottom noise value of the infrared sensor. For example, if the infrared sensor is expected to report an infrared approach event when an external object approaches the mobile phone by 4cm, the infrared approach threshold and the infrared distance threshold of the electronic device are reduced according to a default background noise value. For example, the default noise floor value is 100, the infrared approach threshold is increased to 750-.
In addition, in the electronic device, if the main processor directly processes the data reported by the optical sensor and the infrared sensor, when a misjudged infrared approach event (for example, an external object is not close to the mobile phone but the infrared sensor is considered to have the external object, or the external object is close to the mobile phone but the infrared sensor is considered to have no object close to the mobile phone) or a misjudged infrared distance event (for example, an external object is not far away from the mobile phone but the infrared sensor is considered to have the external object, or the external object is far away from the mobile phone but the infrared sensor is considered to have no object far away from the mobile phone) occurs, the main processor also needs to perform a series of data processing, which increases the processing pressure of the main processor, and therefore, in the method, the coprocessor and the main processor are used for cooperatively processing data, specifically as follows:
the electronic equipment further comprises a coprocessor and a main processor;
determining, with the co-processor, whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range by using the coprocessor;
if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, awakening the main processor by using the coprocessor;
and the main processor receives the first message sent by the infrared sensor.
This greatly reduces the pressure on the main processor to process data and also reduces the power consumption of the overall processing system in the electronic device. The coprocessor is, for example, an MCU in a mobile phone, the main frequency of the MCU is not higher than that of the main processor, and the MCU can perform arithmetic processing. The light sensor and the infrared sensor are connected to the coprocessor, the coprocessor processes the data, and if the data are misjudged, the coprocessor can directly recalibrate the infrared without waking the main processor. The power consumption of the system is lower without waking up the master control.
As shown in fig. 2, a second embodiment of the present invention provides an electronic device, where the electronic device includes an infrared sensor and a light sensor, and the electronic device further includes:
a determining module 201, configured to determine whether the infrared sensor detects a first message for characterizing an infrared approach event or an infrared departure event;
the judging module 202 is configured to, if yes, judge whether a variation of a light sensing value received by the light sensor in a preset time period is within a first preset light threshold range;
the receiving module 203 is configured to receive the first message sent by the infrared sensor if a variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range.
Further, taking a mobile phone as an example, an infrared sensor and a light sensor are installed on the mobile phone, a transmitting end of the infrared sensor transmits light with a specific wavelength, and a receiving end of the infrared sensor receives light reflected by an external object.
Whether shielding exists or not is judged by measuring the quantity of light reflected by an external object received by the receiving end of the infrared sensor, and how far the shielded object is away from the mobile phone.
Aiming at the interference that the light at the receiving end on the mobile phone is reflected by the shielding of the transmitting end and the diffuse reflection of the natural light of the sun and the like. For example, when a mobile phone is placed on a table, a measured value of light reflected by an external object received by a receiving end of an infrared sensor is 100, and the 100 can be understood as 100 basic units due to different infrared principle mechanisms of different manufacturers. This 100, commonly referred to as prototype infrared default noise floor, is understood as the default interference.
When an external object is shielded on the mobile phone, the closer the external object is to the mobile phone, the larger the value of light reflected by the external object received by the infrared sensor receiving end is. This is particularly relevant to the structure, ink transmittance of the infrared sensor, and the like.
Assuming that the measured value of the light reflected by the external object received by the receiving end of the infrared sensor is 350 when the external object is shielded from the mobile phone and is 8cm away from the mobile phone, and the measured value is 550 when the external object is shielded from the mobile phone by 5 cm; at 650 cm, this data is assumed, but the specific item can be measured.
A shield is generally set 4cm from the handset and considered to be present. That is, when the infrared measurement value is greater than 650, an interrupt is generated, the infrared sensor reports an approach action, and the determining module 201 determines that the infrared sensor detects a first message for characterizing an infrared approach event. In the close state, if the shielding object moves away slowly, when the distance exceeds 5cm, that is, when the infrared measurement value is less than 550, an interrupt is generated, and a far-away action is reported, the determining module 201 determines that the infrared sensor detects a first message for representing an infrared far-away event.
That is, the static amplification of the mobile phone is 100 in normal times, and suddenly the hand approaches the mobile phone, when the value increases over 650, the approach is reported, and when the value decreases over 550, the distance is reported. 550. 650 are generally referred to as ir far threshold and ir near threshold, respectively. These values are related to the infrared scheme of a specific project, the structure of the infrared IC, the ink transmittance of the infrared opening on the touch screen and the like, and these data can be tested when the specific project is debugged. The data are not the same for different models, which are the same item, because the structures of the models have tolerance and cannot be completely the same.
A determining module 201, configured to determine whether the infrared sensor detects a first message for characterizing an infrared approach event or an infrared departure event;
the determining module 202 is configured to determine whether a variation of a light sensing value received by the light sensor in a preset time period is within a first preset light threshold range when the determining module 201 determines that the infrared sensor detects a first message for characterizing an infrared approaching event or an infrared departing event.
Still using the foregoing example, the light sensor is specifically configured to receive the ambient light, that is, the light sensor detects a lumen value of the ambient light received by itself within a preset time period, and the determining module 202 determines whether a variation of the light sensing value received by the light sensor within the preset time period is within a first preset light threshold range.
Assuming that an external object blocks the mobile phone and gradually approaches the mobile phone, the infrared sensor detects a first message used for representing an infrared approach event, and in a preset time period (which may be designed according to actual conditions) during which the external object blocks the mobile phone and gradually approaches the mobile phone, a lumen value of ambient light received by the light sensor is also gradually reduced, and a variation of a light sensing value received by the light sensor in the preset time period, for example, a variation of a lumen value of ambient light received by the light sensor in the preset time period, is calculated. And judging whether the variation of the lumen value of the ambient light received by the light sensor in the preset time period is within a first preset light threshold range. Assuming that the first predetermined light threshold range, i.e. the threshold range of the lumen value transformation amount is [380- & 420], the first predetermined light threshold range can be set according to the actual requirement.
Assuming that an external object is shielded from the mobile phone and gradually gets away from the mobile phone, the infrared sensor detects a first message for representing an infrared away event, and in a preset time period in which the external object is shielded from the mobile phone and gradually gets away from the mobile phone, a lumen value of ambient light received by the light sensor is gradually increased, and a variation of a light sensing value received by the light sensor in the preset time period, for example, a variation of the lumen value of the ambient light received by the light sensor in the preset time period, is calculated. The determining module 202 determines whether a variation of a lumen value of the ambient light received by the light sensor in the preset time period is within a first preset light threshold range.
The receiving module 203 is configured to receive the first message sent by the infrared sensor if a variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range.
Still using the foregoing example, assuming that the external object is shielded from the mobile phone and gradually approaches the mobile phone, and the variation of the lumen value of the ambient light received by the light sensor in the preset time period is 400 (the lumen value gradually decreases), if the variation is within the first preset light threshold range [380-420], which indicates that the external object actually has been shielded approaches, the first message sent by the infrared sensor and indicating that the infrared approach event occurs is received.
Assuming that the external object is shielded from the mobile phone and gradually gets away from the mobile phone, and the variation of the lumen value of the ambient light received by the light sensor in the preset time period is 400 (the lumen value gradually increases), the variation is within the first preset light threshold range [380 and 420], which indicates that the external object really shielded from light gets away from the mobile phone, and the receiving module 203 receives the first message sent by the infrared sensor and indicating that the infrared distance event occurs.
In addition, the electronic device further includes:
an adjusting module, configured to adjust an infrared approaching threshold and an infrared departing threshold of the electronic device after the determining module 202 determines whether a variation of the light sensing value received by the light sensor is within a first preset light threshold range, if the variation of the light sensing value received by the light sensor in a preset time period is not within the first preset light threshold range.
Further, the adjustment module includes:
the first obtaining submodule is used for obtaining the default background noise value of the infrared sensor if the variation of the light sensing value received by the light sensor in a preset time period is smaller than the minimum value in the first preset light threshold range; and the first adjusting submodule is used for increasing the infrared approaching threshold and the infrared departing threshold of the electronic equipment based on the default background noise value.
The second obtaining submodule is used for obtaining the default background noise value of the infrared sensor if the variation of the light sensing value received by the light sensor in a preset time period is larger than the maximum value in the first preset light threshold range; and the second adjusting submodule is used for reducing the infrared approaching threshold and the infrared far threshold of the electronic equipment based on the default background noise value.
Still in the foregoing example, the infrared sensor detects an infrared approach event at a position from 8cm when the external object approaches the mobile phone, at this time, a measurement value of light reflected by the external object received by the receiving end of the infrared sensor is 350, which indicates that the infrared approach threshold is 350, and at this time, the light sensation variation is assumed to be 100, which is not within the range [380-420] of the first preset light threshold and is smaller than the minimum value 380 in the range of the first preset light threshold, which indicates that the infrared approach event detected by the infrared sensor at 8cm is a false determination, and the infrared approach threshold needs to be increased, and then the infrared approach threshold is increased according to the default bottom noise value of the infrared sensor obtained by the first obtaining sub-module. For example, when an infrared sensor is expected to report an infrared approach event when an external object approaches the mobile phone by 4cm, the first adjusting submodule increases the infrared approach threshold and the infrared distance threshold of the electronic device according to a default background noise value. For example, default noise floor value is 100, infrared approach threshold is increased to 350+300 to 650, and infrared approach threshold is increased to 350+200 to 550.
In some cases, for example, during factory calibration and/or debugging of the mobile phone, if the infrared approach threshold is large, the infrared sensor detects the infrared approach event when the external object is close to the mobile phone or even the external object is about to be attached to the mobile phone, which indicates that the infrared approach threshold is too large and needs to be adjusted to be small. Assuming that the infrared sensor detects an infrared approaching event when the external object approaches the mobile phone by 2cm, the measurement value of the light reflected by the external object received by the receiving end of the infrared sensor is 750, which indicates that the infrared approaching threshold is 750, and the light sensation variation amount is 600, which is not within the range [380-420] of the first preset light threshold and is greater than the maximum value 420 in the range of the first preset light threshold, which indicates that the infrared approaching event detected by the infrared sensor at 2cm is a false judgment, and the infrared approaching threshold needs to be reduced, the infrared approaching threshold is reduced according to the default bottom noise value of the infrared sensor obtained by the second obtaining sub-module. For example, if the infrared sensor is expected to report an infrared approach event when an external object approaches the mobile phone by 4cm, the second adjusting submodule reduces the infrared approach threshold and the infrared distance threshold of the electronic device according to a default background noise value. For example, the default noise floor value is 100, the infrared approach threshold is increased to 750-.
In addition, in the electronic device, if the main processor directly processes the data reported by the optical sensor and the infrared sensor, when a misjudged infrared approach event (for example, an external object is not close to the mobile phone but the infrared sensor is considered to have the external object, or the external object is close to the mobile phone but the infrared sensor is considered to have no object close to the mobile phone) or a misjudged infrared distance event (for example, an external object is not far away from the mobile phone but the infrared sensor is considered to have the external object, or the external object is far away from the mobile phone but the infrared sensor is considered to have no object far away from the mobile phone) occurs, the main processor also needs to perform a series of data processing, which increases the processing pressure of the main processor, and therefore, in the method, the coprocessor and the main processor are used for cooperatively processing data, specifically as follows:
the receiving module 203 specifically includes:
the awakening submodule is used for awakening the receiving submodule if the variation of the light sensing value received by the light sensor in the preset time period is within a first preset light threshold range;
the receiving submodule is used for receiving the first message sent by the infrared sensor;
the electronic equipment further comprises a coprocessor and a main processor;
determining, with the co-processor, whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range by using the coprocessor;
if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, awakening the main processor by using the coprocessor;
and the main processor receives the first message sent by the infrared sensor.
This greatly reduces the pressure on the main processor to process data and also reduces the power consumption of the overall processing system in the electronic device. The coprocessor is, for example, an MCU in a mobile phone, the main frequency of the MCU is not higher than that of the main processor, and the MCU can perform arithmetic processing. The light sensor and the infrared sensor are connected to the coprocessor, the coprocessor processes the data, and if the data are misjudged, the coprocessor can directly recalibrate the infrared without waking the main processor. The power consumption of the system is lower without waking up the master control.
As shown in fig. 3, a third embodiment of the present invention provides a computer apparatus, including: a processor 301, a memory 302, and a computer program stored in the memory and executable on the processor, for example, a program corresponding to the management method of infrared detection in the first embodiment. The processor, when executing the computer program, implements the steps of the management method for infrared detection in the first embodiment, for example, steps S101 to S103 shown in fig. 1. Alternatively, the processor, when executing the computer program, implements the functions of the modules in the electronic device embodiment of the second embodiment, for example, the functions of the determining module 201, the determining module 202, and the receiving module 203 shown in fig. 2. Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the computer apparatus. For example, the computer program may be divided into functions of a determining module, a determining module and a receiving module, and the specific functions of each module are as follows:
a determination module to determine whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
the judging module is used for judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not when the variation of the light sensing value is yes;
the receiving module is configured to receive the first message sent by the infrared sensor if a variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing equipment. The computer device may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the schematic diagram 3 is merely an example of a computer apparatus and is not intended to limit the computer apparatus, and may include more or less components than those shown, or some components in combination, or different components, for example, the computer apparatus may further include input and output devices, network access devices, buses, etc.
The Processor 301 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like which is the control center for the computer device and which connects the various parts of the overall computer device using various interfaces and lines.
The memory 302 may be used to store the computer programs and/or modules, and the processor may implement the various functions of the computer device by running or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
A fourth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the module integrated with the electronic device in the second embodiment of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, all or part of the flow of the management method for infrared detection in the first embodiment of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-described method embodiments may be implemented.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The technical scheme in the embodiment of the invention at least has the following technical effects or advantages:
by adopting the technical scheme provided by the embodiment of the invention, the electronic equipment can more accurately determine the infrared approaching event or the infrared far event, and avoid infrared misjudgment, thereby improving the technical effect of the accuracy of infrared detection.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A management method of infrared detection is applied to an electronic device, the electronic device comprises an infrared sensor and a light sensor, and the method comprises the following steps:
determining whether the infrared sensor detects a first message for characterizing an infrared approach event or an infrared departure event of an external object;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not; the preset time period starts to time when the first message is detected;
and if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, receiving the first message sent by the infrared sensor.
2. The method of claim i, wherein after determining whether the variation of the light sensor value received by the light sensor is within a first predetermined light threshold, the method further comprises:
and if the variation of the light sensing value received by the light sensor in the preset time period is not within the range of a first preset light threshold value, adjusting the infrared approaching threshold value and the infrared departing threshold value of the electronic equipment.
3. The method of claim 2, wherein the adjusting the infrared approach threshold and the infrared distance threshold of the electronic device if the variation of the light sensing value received by the light sensor in the predetermined time period is not within the first predetermined light threshold range comprises:
if the variation of the light sensing value received by the light sensor in a preset time period is smaller than the minimum value in the first preset light threshold range, obtaining a default background noise value of the infrared sensor;
increasing an infrared approach threshold and an infrared departure threshold of the electronic device based on the default noise floor value.
4. The method of claim l, wherein the electronic device further comprises a coprocessor and a main processor:
determining, with the co-processor, whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range by using the coprocessor;
if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, awakening the main processor by using the coprocessor;
and the main processor receives the first message sent by the infrared sensor.
5. An electronic device, the electronic device comprising an infrared sensor and a light sensor, the electronic device further comprising:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining whether the infrared sensor detects a first message of an infrared approaching event or an infrared far event for representing an external object;
the judging module is used for judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range or not when the variation of the light sensing value is yes; the preset time period starts to time when the first message is detected;
the receiving module is configured to receive the first message sent by the infrared sensor if a variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range.
6. The electronic device of claim 5, wherein the electronic device further comprises:
the adjusting module is used for adjusting the infrared approaching threshold and the infrared far-away threshold of the electronic equipment if the variation of the light sensing value received by the light sensor in a preset time period is not within a first preset light threshold range after judging whether the variation of the light sensing value received by the light sensor is within the first preset light threshold range.
7. The electronic device of claim 6, wherein the adjustment module comprises:
the first obtaining submodule is used for obtaining the default background noise value of the infrared sensor if the variation of the light sensing value received by the light sensor in a preset time period is smaller than the minimum value in the first preset light threshold range;
and the first adjusting submodule is used for increasing the infrared approaching threshold and the infrared departing threshold of the electronic equipment based on the default background noise value.
8. The electronic device of claim 6, wherein the receiving module comprises:
the awakening submodule is used for awakening the receiving submodule if the variation of the light sensing value received by the light sensor in the preset time period is within a first preset light threshold range;
the receiving submodule is used for receiving the first message sent by the infrared sensor;
the electronic equipment further comprises a coprocessor and a main processor, wherein the coprocessor comprises the determining module, the judging module and the awakening submodule; the main processor comprises the receiving submodule;
determining, with the co-processor, whether the infrared sensor detects a first message characterizing an infrared proximity event or an infrared distancing event;
if so, judging whether the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range by using the coprocessor;
if the variation of the light sensing value received by the light sensor in a preset time period is within a first preset light threshold range, the main processor is awakened by the coprocessor, so that the main processor receives the first message sent by the infrared sensor.
9. A computer arrangement, characterized in that the arrangement comprises a processor for implementing the steps of the method according to any of claims 1-4 when executing a computer program stored in a memory.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program realizing the steps of the method according to any one of claims 1-4 when executed by a processor.
CN201711013510.2A 2017-10-26 2017-10-26 Infrared detection management method and electronic equipment Active CN107764406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711013510.2A CN107764406B (en) 2017-10-26 2017-10-26 Infrared detection management method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711013510.2A CN107764406B (en) 2017-10-26 2017-10-26 Infrared detection management method and electronic equipment

Publications (2)

Publication Number Publication Date
CN107764406A CN107764406A (en) 2018-03-06
CN107764406B true CN107764406B (en) 2020-12-04

Family

ID=61270233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711013510.2A Active CN107764406B (en) 2017-10-26 2017-10-26 Infrared detection management method and electronic equipment

Country Status (1)

Country Link
CN (1) CN107764406B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110410923B (en) * 2019-07-22 2021-04-02 宁波奥克斯电气股份有限公司 Operation control method and device of air conditioner and air conditioner
CN113219435B (en) * 2020-02-05 2024-02-06 北京小米移动软件有限公司 Sensor module, control circuit, control method of control circuit and electronic equipment
CN111722546B (en) * 2020-06-30 2022-12-06 广东美的厨房电器制造有限公司 Control method and control device of sensor and cooking equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885588A (en) * 2014-03-05 2014-06-25 小米科技有限责任公司 Automatic switchover method and device
CN104407399A (en) * 2014-12-02 2015-03-11 三星半导体(中国)研究开发有限公司 Method for calibrating proximity sensor in portable terminal
CN106443639A (en) * 2016-09-26 2017-02-22 深圳市金立通信设备有限公司 Distance calibration method and terminal
CN106686222A (en) * 2016-12-19 2017-05-17 广东欧珀移动通信有限公司 Ambient light sensor control method, ambient light sensor control device and terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102665008B (en) * 2012-05-08 2013-11-13 广东欧珀移动通信有限公司 Detecting algorithm for infrared proximity sensor of touch screen mobile phone
CN102883061A (en) * 2012-09-26 2013-01-16 广东欧珀移动通信有限公司 Method and system for controlling working state of touch screen of mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885588A (en) * 2014-03-05 2014-06-25 小米科技有限责任公司 Automatic switchover method and device
CN104407399A (en) * 2014-12-02 2015-03-11 三星半导体(中国)研究开发有限公司 Method for calibrating proximity sensor in portable terminal
CN106443639A (en) * 2016-09-26 2017-02-22 深圳市金立通信设备有限公司 Distance calibration method and terminal
CN106686222A (en) * 2016-12-19 2017-05-17 广东欧珀移动通信有限公司 Ambient light sensor control method, ambient light sensor control device and terminal

Also Published As

Publication number Publication date
CN107764406A (en) 2018-03-06

Similar Documents

Publication Publication Date Title
AU2016238845B2 (en) Mobile computing device and wearable computing device having automatic access mode control
CN107764406B (en) Infrared detection management method and electronic equipment
US9904409B2 (en) Touch input processing method that adjusts touch sensitivity based on the state of a touch object and electronic device for supporting the same
WO2018107897A1 (en) Touch screen control method and device, mobile terminal, and storage medium
WO2018107902A1 (en) Control method and device for touch screen of mobile terminal, mobile terminal, and storage medium
US9026179B2 (en) Devices with displays and related methods involving light sensing with photovoltaic arrays
CN105593868B (en) Fingerprint identification method and device and mobile terminal
EP3435199A2 (en) Method, mobile terminal and non-transitory computer-readable storage medium for adjusting scanning frequency of touch screen
US20150301595A1 (en) Electronic apparatus and eye-gaze input method
US20220346020A1 (en) Method for reducing power consumption of terminal, and terminal
WO2018107903A1 (en) Control method and device for touch screen of mobile terminal, mobile terminal, and storage medium
CN108759892B (en) Sensor calibration method, electronic device and computer-readable storage medium
US9423883B2 (en) Electronic apparatus and method for determining validity of touch key input used for the electronic apparatus
US20180032785A1 (en) Method for setting fingerprint sensor interrupt threshold, apparatus, and terminal device
CN112911484A (en) Earphone state detection method and device
CN107135660B (en) False touch prevention method and device and electronic equipment
EP3654624B1 (en) Screen state control method and device, storage medium, and mobile terminal
CN108801321B (en) Sensor calibration method, electronic device and computer-readable storage medium
CN106768311A (en) A kind of environment light detection method, device and terminal
CN111338508B (en) Touch screen point reporting method, terminal and storage medium
CN110413183B (en) Method and equipment for presenting page
US20200125702A1 (en) Wearable devices and associated security apparatus
TW201617786A (en) System and method for controlling time of usage of electronic device automatically
TWI459273B (en) A touch screen device with correction function and its correction method
TWI502442B (en) Clamshell electronic device and calibration method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant