Proximity judgment method, terminal equipment and storage medium
By using the comparison of light intensity values and bias values in the terminal device to assist in determining whether the object is approaching, the error problem caused by the infrared reflective proximity sensor during the screen squeezing and release process is solved, and the accuracy of proximity judgment is improved .
Patent Information
- Application Number
- CN202310990021.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-02-14
AI Technical Summary
The existing infrared reflective proximity sensors may cause fluctuations in the light intensity value during the screen squeezing and release, which in turn causes misjudgment of the object approaching or being away from the state.
By obtaining the light intensity value and light intensity bias value in the terminal device, calculating the light intensity report value, and comparing it with the preset reference value, the absolute difference value is determined to assist in determining whether the object is close to the terminal device, thereby reducing misjudgment.
It effectively avoids misjudgment of the object approaching or being away from the state due to the large detection light intensity value after the screen is squeezed, and improves the accuracy of the proximity judgment.
Smart Images

Figure CN119449945A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the terminal field and relates to object detection technology, and in particular to a method for determining the proximity of an object, a terminal device and a storage medium. Background Art
[0002] At present, infrared reflection proximity sensors (PS) are widely used in various electronic devices to detect whether there is an object approaching in a specific direction. For example, the infrared reflection proximity sensor installed under the mobile phone screen can detect whether there is an object approaching the mobile phone screen. If the light intensity value output by the infrared reflection proximity sensor is greater than the proximity threshold, it is judged that there is an object approaching the electronic device. However, the detection range of the ADC of the proximity light sensor is usually small. The proximity sensor in the overall structural part may have a large bias due to the leakage scenario of the structural part itself. The existence of this bias may directly exceed the ADC range. In order to increase the adaptability of the whole machine and ensure the consistency of multiple whole machines, the OFFSET mechanism is introduced at the device level, so that the whole machine in the unobstructed state outputs a certain range of proximity light noise value after startup. However, when the screen of the electronic device is squeezed, the light intensity value output by the infrared reflection proximity sensor will decrease. When the light intensity value decreases to the zero-crossing calibration threshold, the light intensity value zero-crossing recalibration mechanism will be triggered, and the light intensity offset value will be reduced through the light intensity value zero-crossing recalibration mechanism. However, when the screen squeeze is canceled, the infrared reflective proximity sensor will output a larger light intensity value based on the reduced light intensity bias value. If the larger light intensity bias value is close to the proximity threshold value, it is easy to cause a misjudgment of the object approaching the screen. Summary of the invention
[0003] In view of the above, it is necessary to provide a proximity judgment method, a terminal device and a storage medium to solve the problem of misjudgment of an object approaching or moving away from a terminal device.
[0004] In the first aspect, the embodiment of the present application provides a proximity judgment method, which is applied to a terminal device, and the method includes: obtaining a first light intensity value and a first light intensity bias value in the terminal device; obtaining a first light intensity report value according to the first light intensity value and the first light intensity bias value; obtaining a first difference value according to the first light intensity report value and a first preset reference value; obtaining a first comparison result according to the absolute value of the first difference value and the first preset value; obtaining a second comparison result according to the first light intensity value and a preset proximity threshold; determining whether the object is close to or far away from the terminal device according to the first comparison result and the second comparison result. In the above technical scheme, on the basis of the comparison between the first light intensity value and the proximity threshold, the comparison result between the absolute value of the difference between the first light intensity report value and the first preset reference value and the first preset value is added as a judgment basis to judge whether the object is close to the screen of the terminal device, thereby avoiding the misjudgment of the object's close or far state due to the large light intensity value detected after the screen is squeezed.
[0005] In one embodiment of the present application, according to the first comparison result and the second comparison result, determining whether an object is close to or far away from the terminal device includes: if the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is less than the proximity threshold, determining that the object is far away from the terminal device; or if the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is greater than or equal to the proximity threshold, determining that the object is close to the terminal device; or if the absolute value of the first difference is less than the first preset value, and the first light intensity value is greater than or equal to the proximity threshold, determining that the object is far away from the terminal device, and calibrating the first light intensity value. In the above technical solution, if the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is greater than or equal to the proximity threshold, it can be determined that the object is close to the terminal device, thereby accurately identifying the proximity state of the object.
[0006] In one embodiment of the present application, calibrating the first light intensity value includes: starting a bias value software calibration mechanism to calibrate the first light intensity value. In the above technical solution, when the absolute value of the first difference is less than the first preset value and the first light intensity value is greater than or equal to the proximity threshold, starting the bias value software calibration mechanism to calibrate the first light intensity value can improve the accuracy of the light intensity value detection.
[0007] In one embodiment of the present application, starting the bias value software calibration mechanism and calibrating the first light intensity value includes: sensing the second light intensity value reported by the proximity light sensor; determining the first light intensity adjustment value by adjusting the first light intensity bias value; and obtaining the calibration value of the first light intensity value according to the second light intensity value reported and the first light intensity adjustment value. In the above technical solution, the first light intensity adjustment value is obtained after adjusting the first light intensity bias value, and the calibration value of the first light intensity value is obtained according to the second light intensity value reported and the first light intensity adjustment value, which can further improve the accuracy of the detected light intensity value.
[0008] In one embodiment of the present application, the method further includes: obtaining a second light intensity value and a second light intensity bias value of the terminal device under the condition that no object blocks the screen; and obtaining a first preset reference value according to the second light intensity value and the second light intensity bias value. The above technical solution obtains the first preset reference value according to the second light intensity value and the second light intensity bias value, so that the first preset reference value of different terminal devices of the same model can be set differently, thereby helping to improve the accuracy of approach judgment of individual terminal devices.
[0009] In one embodiment of the present application, obtaining the first preset reference value according to the second light intensity value and the second light intensity bias value includes: determining the second light intensity adjustment value by adjusting the second light intensity bias value; and obtaining the first preset reference value according to the second light intensity value and the second light intensity adjustment value.
[0010] In one embodiment of the present application, the method further includes: obtaining a set of second light intensity values and a set of second light intensity bias values of multiple terminal devices of the same model under the condition that no object blocks the screen, wherein each second light intensity value in the set of second light intensity values corresponds to a second light intensity bias value; obtaining a reference value according to each second light intensity value and the corresponding second light intensity bias value; and averaging all reference values to obtain a first preset reference value. In the above technical solution, a reference value is calculated by obtaining the second light intensity value and the corresponding second light intensity bias value of each terminal device, and the first preset reference value is obtained by averaging all reference values, so as to achieve a unified setting of the first preset reference value for all terminal devices of the same model.
[0011] In the second aspect, the embodiment of the present application provides a proximity judgment method, which is applied to a terminal device, and the method includes: obtaining a third light intensity value and a third light intensity bias value in the terminal device; obtaining a second difference value according to the third light intensity bias value and a second preset reference value; obtaining a third comparison result according to the absolute value of the second difference value and the second preset value; obtaining a fourth comparison result according to the third light intensity value and a proximity threshold; determining whether the object is close to or far away from the terminal device according to the third comparison result and the fourth comparison result. In the above technical solution, on the basis of the comparison between the third light intensity value and the proximity threshold, a judgment basis of the comparison result between the absolute value of the difference between the third light intensity bias value and the second preset reference value and the second preset value is added to judge whether the object is close to the screen of the terminal device, thereby avoiding the occurrence of misjudgment of the object's approaching or distant state after the screen is squeezed.
[0012] In one embodiment of the present application, according to the third comparison result and the fourth comparison result, determining that the object is close to or far away from the terminal device includes: if the absolute value of the second difference is greater than the second preset value, and the third light intensity value is less than the proximity threshold, determining that the object is far away from the terminal device; or if the absolute value of the second difference is less than or equal to the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, determining that the object is close to the terminal device; or if the absolute value of the second difference is greater than the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, determining that the object is far away from the terminal device, and calibrating the third light intensity value. In the above technical solution, if the absolute value of the second difference is less than or equal to the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, determining that the object is close to the terminal device, thereby accurately identifying the proximity state of the object.
[0013] In one embodiment of the present application, calibrating the third light intensity value includes: starting a bias value software calibration mechanism to calibrate the third light intensity value. In the above technical solution, if the absolute value of the second difference is greater than the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, starting the bias value software calibration mechanism to calibrate the first light intensity value can improve the accuracy of the detected light intensity value.
[0014] In one embodiment of the present application, starting the bias value software calibration mechanism to calibrate the third light intensity value includes: sensing the third light intensity value reported by the proximity light sensor; determining the third light intensity adjustment value by adjusting the third light intensity bias value; and obtaining a calibration value of the third light intensity value according to the third light intensity value reported and the third light intensity adjustment value. In the above technical solution, the third light intensity adjustment value is obtained after adjusting the third light intensity bias value, and the calibration value of the third light intensity value is obtained according to the third light intensity value reported and the third light intensity adjustment value, which can further improve the accuracy of the detected light intensity value.
[0015] In one embodiment of the present application, the method further includes: obtaining a fourth light intensity bias value of the terminal device under the condition that no object blocks the screen, and using the fourth light intensity bias value as the second preset reference value. The above technical solution uses the fourth light intensity bias value obtained from the terminal device as the second preset reference value, which can achieve differentiated setting of the second preset reference value for different terminal devices of the same model, thereby helping to improve the accuracy of approach judgment of individual terminal devices.
[0016] In one embodiment of the present application, the method further includes: obtaining a set of fourth light intensity bias values of multiple terminal devices of the same model under the condition that no object blocks the screen; and averaging all fourth light intensity bias values in the set of fourth light intensity bias values to obtain a second preset reference value. In the above technical solution, averaging all fourth light intensity bias values in the set of fourth light intensity bias values to obtain the second preset reference value can achieve a unified setting of the second preset reference value for all terminal devices of the same model.
[0017] In a third aspect, an embodiment of the present application provides a proximity judgment method, which is applied to a terminal device, and the method includes: obtaining all light intensity values of the terminal device within a preset time range, and obtaining a light intensity average based on all the light intensity values; obtaining a fourth light intensity value and a fifth light intensity bias value of the terminal device at the judgment moment; obtaining an absolute value of a third difference based on the light intensity average and a third preset reference value, if the absolute value of the third difference is less than the third preset value, obtaining a fifth comparison result based on the fourth light intensity value and a proximity threshold, and determining whether the object is close to or far away from the terminal device based on the fifth comparison result; if the absolute value of the third difference is greater than or equal to the third preset value, calibrating the fourth light intensity value based on the fourth light intensity value and the fifth light intensity bias value to obtain a fifth light intensity value; obtaining a sixth comparison result based on the fifth light intensity value and the proximity threshold, and determining whether the object is close to or far away from the terminal device based on the sixth comparison result. In the above technical solution, when the third light intensity value reaches the proximity threshold, the second preset value is also used as the secondary proximity threshold to compare with the absolute value of the difference between the fifth light intensity bias value and the second preset reference value, and whether the object is close to the terminal device is determined according to the comparison result, thereby avoiding the occurrence of misjudgment of the object's approaching or distant state after the screen is squeezed.
[0018] In one embodiment of the present application, determining that the object is close to or far away from the terminal device according to the fifth comparison result includes: if the fourth light intensity value is greater than or equal to the proximity threshold, determining that the object is close to the terminal device; if the fourth light intensity value is less than the proximity threshold, determining that the object is far away from the terminal device. In the above technical solution, if the absolute value of the third difference is less than the third preset value, it can be directly determined whether the object is close to or far away from the terminal device based on the comparison between the fourth light intensity value and the proximity threshold.
[0019] In one embodiment of the present application, the fourth light intensity value is calibrated according to the fourth light intensity value and the fifth light intensity bias value to obtain the fifth light intensity value, which includes: sensing the fourth light intensity value reported by the proximity light sensor; determining the fourth light intensity adjustment value by adjusting the fifth light intensity bias value; and obtaining the fifth light intensity value according to the fourth light intensity value reported and the fourth light intensity adjustment value. In the above technical solution, the fourth light intensity adjustment value is determined by adjusting the fifth light intensity bias value, and the fifth light intensity value is obtained according to the fourth light intensity value reported and the fourth light intensity adjustment value, so as to improve the accuracy of the detected light intensity value.
[0020] In one embodiment of the present application, determining that an object is close to or far away from a terminal device according to the sixth comparison result includes: if the fifth light intensity value is greater than or equal to the proximity threshold, determining that the object is close to the terminal device; if the fifth light intensity value is less than the proximity threshold, determining that the object is far away from the terminal device. In the above technical solution, the fourth light intensity value obtained at the time of determination is calibrated according to the bias value software calibration mechanism, and the comparison result of the fifth light intensity value obtained after calibration with the proximity threshold determines whether the object is close to or far away from the terminal device, which can accurately identify the proximity state of the object.
[0021] In one embodiment of the present application, the method further includes: obtaining a third light intensity value of the terminal device under the condition that no object blocks the screen, and using the third light intensity value as a third preset reference value.
[0022] In one embodiment of the present application, the method further includes: obtaining a set of third light intensity values of multiple terminal devices of the same model under the condition that no object blocks the screen, and averaging all the third light intensity values in the set of third light intensity values to obtain a third preset reference value. In the above technical solution, averaging all the third light intensity values in the set of third light intensity values to obtain the third preset reference value can achieve a unified setting of the second preset reference value for all terminal devices of the same model.
[0023] In a fourth aspect, an embodiment of the present application provides a terminal device, including a processor and a proximity light sensor; wherein the processor is connected to the proximity light sensor; the proximity light sensor is used to sense a light intensity value; and the processor is used to implement the above-mentioned proximity judgment method based on the light intensity value.
[0024] In a fifth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the above-mentioned proximity determination method is implemented.
[0025] In addition, the technical effects brought about by the fourth to fifth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a schematic diagram of the structure of a proximity light sensor installed in a mobile phone.
[0027] Figure 2 Schematic diagram of the structure of the proximity light sensor.
[0028] Figure 3 Schematic diagram of the software calibration mechanism for the relevant bias values and the zero-crossing recalibration mechanism for the light intensity values.
[0029] Figure 4 This is a schematic diagram of a proximity light sensor judging approach or distance based on light intensity value and decision threshold.
[0030] Figure 5 Schematic diagram of the process of approaching misjudgment.
[0031] Figure 6 Schematic diagram of a mobile phone screen being squeezed.
[0032] Figure 7 A flowchart of a proximity determination method provided in one embodiment of the present application.
[0033] Figure 8 This is a flow chart of a proximity determination method provided in accordance with another embodiment of the present application.
[0034] Fig. 9 A flowchart of a proximity determination method provided in one embodiment of the present application.
[0035] Fig.10 A flowchart of a proximity determination method provided in another embodiment of the present application.
[0036] Fig.11 A flowchart of a proximity determination method provided in another embodiment of the present application.
[0037] Fig.12 This is a schematic diagram of obtaining all light intensity values of a terminal device within a preset time range in one embodiment of the present application.
[0038] Fig.13 A schematic diagram of calibrating a first light intensity value provided by an embodiment of the present application.
[0039] Fig.14 Schematic diagram of the hardware structure of a terminal device in one embodiment of the present application. DETAILED DESCRIPTION
[0040] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of some embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in some embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can represent A or B. "And / or" in some embodiments of the present application is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations.
[0042] Currently, proximity sensors, such as infrared reflection sensors (also known as proximity light sensors), capacitive sensors, ultrasonic distance sensors, etc., are widely used in various terminal devices to detect whether there is an object approaching in a specific direction. For example, a proximity sensor installed under the screen of a terminal device can detect whether there is an object approaching the mobile phone screen. The following takes the mobile phone as an example for explanation. Figure 1 The figure shows a schematic diagram of the structure of a proximity light sensor installed in a mobile phone. The proximity light sensor is arranged below the screen of the mobile phone. The proximity light sensor includes a proximity light transmitting end (such as an infrared light source) and a receiving end (such as an infrared light detector). Black isolation foam is usually used inside the mobile phone to isolate the crosstalk between the infrared light source and the infrared light source. The black isolation foam is compressed by the screen and the printed circuit board (PCB) on which the proximity light sensor is installed. The higher the compression, the denser the black isolation foam and the stronger the ability to isolate light. Reference Figure 2The figure shows the structure of the proximity light sensor. The working principle of the proximity light sensor is as follows: infrared light is emitted by an infrared light source, such as an infrared light emitting diode (LED) or an infrared laser; at the same time, the infrared light reflected by the object is received by the infrared light detector, and the intensity of the reflected infrared light is integrated to obtain an integral value; the proximity distance of the object is sensed according to the size of the integral value. The infrared light indicated by the integral value of the infrared light detector can be divided into two parts. The first part is emitted by the infrared light source, and is reflected and diffracted by the screen or internal structural parts to reach the infrared light detector. The integral value corresponding to the first part is part of the background noise, and the background noise can be reduced and the signal-to-noise ratio can be improved by using black isolation foam between the infrared light detector and the infrared light source. The second part is emitted by the infrared light source, and is reflected by external obstacles and reaches the infrared light detector. The integral value of the second part of the infrared light is the main basis for the proximity state judgment process and is also the effective part of the proximity light sensing.
[0043] The range of light intensity reports of conventional proximity light is small. Due to the reflection and diffraction of infrared light caused by the terminal device's own structural parts (i.e., infrared light leakage), or the influence of the infrared component of the terminal device's ambient light, the proximity light sensor may have a large basic noise integral value in the unobstructed state. The basic noise may directly exceed the range of the light intensity report output by the proximity light sensor or the terminal device. In addition, different hardware conditions of the whole machine are different, that is, different whole machines will show different basic noise integral values in the unobstructed state.
[0044] In order to ensure the accuracy of the light intensity outputted by the proximity light sensor and the consistency of different devices, the embodiment of the present application introduces a bias value software calibration mechanism and a light intensity value zero-crossing recalibration mechanism to calibrate the output light intensity report value. Figure 3 As shown in the figure, it is a schematic diagram of the relevant bias value software calibration mechanism and the light intensity value zero-crossing recalibration mechanism. The working principle of the bias value software calibration mechanism is as follows: due to the differences in the overall structural parts of different terminal devices, the proximity light sensor has different degrees of infrared light leakage; the infrared light leakage leads to inconsistent background noise integral values of different terminal devices, which affects the proximity light sensor's judgment of the proximity of the object; the current value of the infrared light detector is increased or decreased by the DC bias current source to adjust the light intensity value output by the infrared light detector; thereby adjusting the larger or smaller integral value collected by the infrared light detector in the unobstructed state to the target range value, thereby ensuring the consistency of the light intensity report value output by the proximity light sensor. The DC bias current source can generate a light intensity bias value. By increasing or decreasing the current value of the infrared light detector by the DC bias current source, the light intensity value detected by the infrared light detector can be adjusted according to the light intensity bias value.
[0045] The working principle of the light intensity value zero-crossing recalibration mechanism is as follows: when the bias value software calibration is performed, the proximity light sensor cannot sense whether the screen is blocked by an object; if the power-on software calibration is performed when there is an object blocking the screen, the infrared light reflected by the object causes the integral value detected by the infrared light detector to increase. In order to ensure that the light intensity value output by the infrared light detector is within the target range, the light intensity bias value will be adjusted to a larger value; when the object leaves the screen, there is no infrared light reflected by the object, causing the light intensity value output by the infrared light detector to approach the calibration threshold; if the output light intensity value reaches the calibration threshold, the bias value software calibration mechanism will be re-triggered to adjust the light intensity value.
[0046] In one embodiment of the present application, after the light intensity value is calibrated, the terminal device determines whether an object is approaching or moving away from the terminal device based on the light intensity value and the decision threshold. Figure 4 As shown, it is a schematic diagram of the proximity light sensor judging approach or distance based on the light intensity value and the decision threshold. The decision threshold includes a first threshold component, a second threshold component and a third threshold component. For the convenience of the following description, the first threshold component is represented as Pwave, the second threshold component is described as Pwindow, and the third threshold component is represented as Pth. The following Table 1 shows a schematic diagram of each threshold component. The first threshold component is represented by: the difference between the light intensity value P1 detected by the proximity light sensor of the terminal device under the condition that the target object is placed at a first preset distance from the screen of the terminal device, and the light intensity value P0 detected by the proximity light sensor under the condition that there is no target object blocking the screen. The second threshold component is represented by: the difference between the light intensity value P2 detected by the proximity light sensor under the condition that the target object is placed at a second preset distance from the screen, and the light intensity value P1 detected by the proximity light sensor under the condition that the target object is placed at the first preset distance from the screen. The sum of the first threshold component and the second threshold component is expressed as: the difference between the light intensity value P2 detected by the proximity light sensor under the condition that the target object is placed at the second preset distance from the screen, and the light intensity value P0 detected by the proximity light sensor under the condition that no target object blocks the screen. In one embodiment of the present application, the first preset distance and the second preset distance can be set as needed. For example, the first preset distance can be set to 50 mm, and the second preset distance can be set to 30 mm. The target object can be a gray card measurement tool, and is not limited to the above examples in actual applications.
[0047] Table 1
[0048] Pwave <![CDATA[P1-P0]]> Pwindow <![CDATA[P2-P1]]> Pwave+Pwindow <![CDATA[P2-P0]]> Approach threshold Pwave+Pwindow+Pth Stay away from the threshold Pwave+Pth
[0049] In one embodiment of the present application, the third threshold component is represented by the background noise integral value of the terminal device, specifically, the light intensity value of the infrared light reflected and diffracted by the screen or the internal structure of the terminal device. The proximity threshold is represented by the sum of the first threshold component, the second threshold component, and the third threshold component, and the distance threshold represents the sum of the first threshold component and the third threshold component. In one embodiment of the present application, if the light intensity value is greater than the proximity threshold value, the proximity light sensor determines that the object is approaching; if the light intensity value is less than the distance threshold value, the proximity light sensor determines that the object is far away. In one embodiment of the present application, before judging the proximity or distance based on the light intensity value detected by the proximity light sensor and the judgment threshold, the light intensity value needs to be filtered using a preset filtering method to suppress transient interference. The preset filtering method includes at least a median filtering method.
[0050] As mentioned above, when the proximity light sensor detects the light intensity value near the screen of the terminal device, it will output the detected light intensity value minus a light intensity bias value according to the bias value software calibration mechanism. The output light intensity value will be judged with the proximity threshold or distance threshold to determine whether there is an object approaching or moving away from the terminal device. However, there are many scenarios in life where the screen of a mobile phone is squeezed. For example, if you put the phone in your pocket and sit down, the human body may squeeze the screen. For another example, if you put the phone under a quilt, the human body may inadvertently press the screen of the phone. For another example, if you put the phone in a bag, other heavy objects in the bag may squeeze the screen of the phone. Reference Figure 5 As shown in Figure 1, it is a schematic diagram of the process of approaching misjudgment. Figure 6 ), the distance between the screen and the PCB board will be reduced, the compression of the black isolation foam will be increased, and the crosstalk of the diffracted light or reflected light leaked from the internal structural parts of the mobile phone will be reduced, resulting in a decrease in the light intensity value output by the proximity light sensor. When the light intensity value decreases to the zero-crossing calibration threshold, the light intensity value zero-crossing recalibration mechanism will be triggered, and the light intensity bias value will be adjusted down through the light intensity value zero-crossing recalibration mechanism. However, when the screen squeeze is canceled, the proximity light sensor will output a larger light intensity value based on the reduced light intensity bias value. If the light intensity value is close to the proximity threshold value, it is easy to cause a false judgment of proximity.
[0051] In order to solve the problem of misjudgment of proximity, an embodiment of the present application provides a proximity judgment method to solve the problem of misjudgment of an object approaching a screen of a terminal device.
[0052] refer to Figure 7As shown, it is a flow chart of a proximity judgment method provided by an embodiment of the present application. The proximity judgment method is applied in a terminal device. It should be noted that the method disclosed in the embodiment of the present application or the method shown in the flowchart includes one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchangeable with each other, and some steps can also be deleted. Some embodiments will be described below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. The method specifically includes the following process.
[0053] Step S701, obtaining a first light intensity value and a first light intensity bias value in a terminal device.
[0054] In one embodiment of the present application, the terminal device can obtain the first light intensity value and the first light intensity bias value in the terminal device through the sensorlist software. In another embodiment of the present application, the terminal device can also obtain the first light intensity value and the first light intensity bias value in the terminal device through an adb command, such as adb shell "logcat|grep prox_event". In this embodiment, the infrared light detector of the terminal device detects the infrared light of the surrounding environment, and records the first light intensity value and the first light intensity bias value of the infrared light in the terminal device. The terminal device obtains the first light intensity value and the first light intensity bias value of the infrared light through the sensorlist software.
[0055] Step S702, calculating a first light intensity reporting value according to the first light intensity value and the first light intensity offset value.
[0056] In one embodiment of the present application, the first light intensity report value is calculated according to a preset formula B=PDATA1+y(OFFSET), wherein PDATA1 represents the first light intensity value, y(OFFSET) represents a linear transformation function of an equivalent conversion of a light intensity adjustment value with respect to a light intensity offset value (marked as OFFSET), and B represents the first light intensity report value. In one embodiment of the present application, the determination process of y(OFFSET) is as follows: place the gray card measuring tool above the screen of the terminal device and keep a fixed distance from the proximity light sensor, so as to keep the first light intensity report value unchanged; drive the infrared light source in the proximity light sensor with a fixed driving current to emit infrared light; set the first light intensity bias value (marked as OFFSET1) to zero, and according to the above preset formula, the initial value of the first light intensity value PDATA1 of the proximity light sensor reaches the maximum; increase the value of the first light intensity bias value OFFSET1 at each preset time interval, and the first light intensity value PDATA1 will decrease successively; subtract the initial value of the first light intensity value PDATA1 from the value of the reduced first light intensity value PDATA1, and according to the result of the subtraction, a transformation function y(OFFSET) of the light intensity adjustment value equivalently converted with respect to the light intensity bias value OFFSET can be obtained. In one embodiment of the present application, the first light intensity bias value OFFSET1 is substituted into the y(OFFSET) function, and the light intensity adjustment value of the first light intensity bias value OFFSET1 can be calculated.
[0057] Step S703: Subtract the first light intensity reported value from the first preset reference value to obtain a first difference and calculate the absolute value of the first difference.
[0058] In one embodiment of the present application, the first preset reference value can be pre-set and stored in the terminal device. The terminal device loads the first preset reference value when it is powered on, and the loaded first preset reference value can be called by the terminal device. In other embodiments, the first preset reference value can also be stored in a cloud server. The terminal device can obtain the first preset reference value by accessing the cloud server. In one embodiment of the present application, the calculation method of the first preset reference value includes: obtaining a second light intensity value and a second light intensity bias value of the terminal device under the condition that no object blocks the screen; and calculating the first preset reference value according to the second light intensity value and the second light intensity bias value. In one embodiment of the present application, the second light intensity value is a light intensity value obtained when the terminal device is in a factory state or an initial state, and the second light intensity bias value is a light intensity bias value obtained when the terminal device is in a factory state or an initial state. In one embodiment of the present application, the second light intensity value can represent the average value of the light intensity values obtained by the terminal device over a period of time under the condition that no object blocks the screen, and the second light intensity bias value can represent the average value of the light intensity bias values obtained by the terminal device over a period of time under the condition that no object blocks the screen. In one embodiment of the present application, an infrared light detector of a proximity light sensor detects infrared light of a terminal device when there is no object blocking the screen, and the second light intensity value and the second light intensity bias value of the infrared light are recorded in the terminal device. The terminal device obtains the second light intensity value and the second light intensity bias value of the infrared light through the sensorlist software. In one embodiment of the present application, the first preset reference value can be calculated according to the preset formula C=PDATA2+y(OFFSET), PDATA2 represents the second light intensity value, C represents the first preset reference value, and y(OFFSET) represents a transformation function of the equivalent conversion of the light intensity adjustment value with respect to the light intensity bias value. In one embodiment of the present application, the second light intensity bias value (marked as OFFSET2) is substituted into the y(OFFSET) function to calculate the light intensity adjustment value of the second light intensity bias value OFFSET2.
[0059] This embodiment obtains the second light intensity value and the second light intensity bias value of each terminal device under the condition that there is no object blocking the screen, and calculates the first preset reference value of each terminal device based on the second light intensity value and the second light intensity bias value. It can achieve differentiated setting of the first preset reference value of different terminal devices of the same model, thereby helping to improve the accuracy of approach judgment of individual terminal devices.
[0060] In another embodiment of the present application, the calculation method of the first preset reference value includes: obtaining a set of second light intensity values and a set of second light intensity bias values of multiple terminal devices of the same model under the condition that no object blocks the screen, wherein each second light intensity value in the set of second light intensity values corresponds to a second light intensity bias value; a reference value can be calculated based on each second light intensity value and the corresponding second light intensity bias value; in this embodiment, all reference values can be averaged to obtain the first preset reference value. Specifically, the infrared light of the terminal device under the condition that no object blocks the screen is detected by the infrared light detector of each terminal device, and the second light intensity value and the second light intensity bias value of the infrared light are recorded in the corresponding terminal device. The second light intensity value and the second light intensity bias value of each terminal device under the condition that no object blocks the screen are obtained by sensorlist software or adb command. A reference value is calculated based on each second light intensity value and the corresponding second light intensity bias value; the first preset reference value is obtained by averaging all reference values.
[0061] In this embodiment, a reference value is calculated by obtaining the second light intensity value and the corresponding second light intensity bias value of each terminal device, and the first preset reference value is obtained by averaging all reference values, so as to achieve a unified setting of the first preset reference value for all terminal devices of the same model.
[0062] Step S704: compare the absolute value of the first difference with a first preset value to determine a first comparison result.
[0063] In one embodiment of the present application, the terminal device may pre-set and store a first preset value. The terminal device loads the first preset value and calls it when it is powered on. In other embodiments, the first preset value may also be stored in a cloud server. The terminal device may obtain the first preset value by accessing the cloud server. In one embodiment of the present application, the first preset value may take a value within the range of [Pwave, Pwave+Pwindow]. In one embodiment of the present application, the first comparison result includes that the absolute value of the first difference is less than the first preset value, the absolute value of the first difference is equal to the first preset value, and the absolute value of the first difference is greater than the first preset value. The following will describe the judgment result of whether the object is close to the device based on the first comparison result.
[0064] Step S705: compare the first light intensity value with the proximity threshold to determine a second comparison result.
[0065] In an embodiment of the present application, the second comparison result includes that the first light intensity value is less than a proximity threshold, the first light intensity value is equal to the proximity threshold, and the first light intensity value is greater than the proximity threshold.
[0066] Step S706: determining whether the object is close to or far away from the terminal device according to the first comparison result and / or the second comparison result.
[0067] In one embodiment of the present application, determining that an object is close to or far away from the terminal device according to the first comparison result and / or the second comparison result includes: if the absolute value of the first difference is less than the first preset value, determining that the object is far away from the terminal device; or if the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is less than the proximity threshold, determining that the object is far away from the terminal device; or if the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is greater than or equal to the proximity threshold, determining that the object is close to the terminal device; or if the absolute value of the first difference is less than the first preset value, and the first light intensity value is greater than or equal to the proximity threshold, determining that the object is far away from the terminal device, and calibrating the first light intensity value. In one embodiment of the present application, the object being far away from the terminal device includes a scene where there is no object around the terminal device.
[0068] In one embodiment of the present application, calibrating the first light intensity value includes: starting a bias value software calibration mechanism to calibrate the first light intensity value. Specifically, the second light intensity value is sensed by a proximity light sensor of the terminal device, and the calibrated first light intensity value is calculated according to the formula PDATA=Ay(OFFSET), where PDATA represents the calibrated first light intensity value, A represents the second light intensity value, and y(OFFSET) represents a first-order transformation function of the equivalent conversion of the light intensity adjustment value with respect to the light intensity bias value. In one embodiment of the present application, the first light intensity bias value is substituted into the y(OFFSET) function to calculate the light intensity adjustment value of the first light intensity bias value.
[0069] In an embodiment of the present application, if the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is greater than or equal to the proximity threshold, it can be determined that the object is close to the terminal device, and thus, based on the comparison between the first light intensity value and the proximity threshold, an additional basis for judging the proximity state is added, that is, the comparison result between the absolute value of the first difference and the first preset value is added as a basis for judgment to judge whether the object is close to the screen of the terminal device, thereby avoiding the misjudgment of the object's approaching or distant state after the screen is squeezed.
[0070] refer to Figure 8 FIG. 2 is a flow chart of a proximity determination method provided by another embodiment of the present application. The method comprises the following steps.
[0071] Step S801, obtaining a first light intensity value and a first light intensity bias value in a terminal device.
[0072] The specific implementation content of the above step S801 refers to the implementation content of the above step S701, and will not be repeated here.
[0073] Step S802: Calculate a first light intensity reporting value according to the first light intensity value and the first light intensity offset value.
[0074] In one embodiment of the present application, the first light intensity value is greater than or equal to the proximity threshold. The method for calculating the first light intensity value according to the first light intensity value and the first light intensity bias value can refer to the above Figure 7 The implementation content of step S702 will not be repeated here.
[0075] Step S803, obtaining a second light intensity value and a second light intensity offset value of the terminal device under the condition that no object blocks the screen.
[0076] Step S804, according to the second light intensity value, the second light intensity offset value and the preset formula C = PDATA2 + y (OFFSET), the first preset reference value is calculated. Wherein PDATA2 represents the second light intensity value, y (OFFSET) represents a first-order conversion function of the light intensity adjustment value with respect to the light intensity offset value, and C represents the first preset reference value. In one embodiment of the present application, the second light intensity offset value is substituted into the y (OFFSET) function to calculate the light intensity adjustment value of the second light intensity offset value.
[0077] The specific implementation contents of the above steps S803-S804 refer to the implementation contents of calculating the first preset reference value in the above step S703, and will not be repeated here.
[0078] Step S805, subtract the first light intensity report value from the first preset reference value to obtain a first difference, and determine whether the absolute value of the first difference is less than the first preset value for comparison. If the absolute value of the first difference is less than the first preset value, execute step S806, otherwise, if the absolute value of the first difference is greater than or equal to the first preset value, execute step S807.
[0079] Step S806: determine that the object is far away from the terminal device, and calibrate the first light intensity value.
[0080] For the specific implementation content of the above step S806, please refer to the implementation content of step S706.
[0081] Step S807: determine whether the object is close to the terminal device.
[0082] In one embodiment of the present application, the object being away from the terminal device means that the object is away from the screen of the terminal device, and the object being close to the terminal device means that the object is close to the screen of the terminal device.
[0083] In an embodiment of the present application, when the first light intensity value reaches the proximity threshold, the first preset value is also used as the secondary proximity threshold for comparison with the absolute value of the first difference, and whether the object is close to the terminal device is determined based on the comparison result, thereby avoiding the occurrence of misjudgment of the object's approaching or distant state after the screen is squeezed.
[0084] refer to Fig. 9 FIG. 1 is a flow chart of a proximity determination method provided by another embodiment of the present application. The method specifically includes the following process.
[0085] Step S901, obtaining a third light intensity value and a third light intensity bias value in a terminal device.
[0086] The specific implementation content of the above step S901 refers to the implementation content of the above step S701, and will not be repeated here.
[0087] Step S902: Subtract the third light intensity bias value from the second preset reference value to obtain a second difference and calculate the absolute value of the second difference.
[0088] In one embodiment of the present application, the calculation method of the second preset reference value includes: obtaining a fourth light intensity bias value of the terminal device under the condition that no object blocks the screen, and using the fourth light intensity bias value as the second preset reference value. In one embodiment of the present application, the fourth light intensity bias value is a light intensity bias value obtained when the terminal device is in a factory state or an initial state. In the embodiment of the present application, the fourth light intensity bias value obtained from the terminal device is used as the second preset reference value, which can achieve differentiated setting of the second preset reference value for different terminal devices of the same model, thereby helping to improve the accuracy of approach judgment of individual terminal devices.
[0089] In another embodiment of the present application, the calculation method of the second preset reference value includes: obtaining a set of fourth light intensity bias values of multiple terminal devices of the same model under the condition that no object blocks the screen; averaging all fourth light intensity bias values in the set of fourth light intensity bias values to obtain the second preset reference value. In the embodiment of the present application, averaging all fourth light intensity bias values in the set of fourth light intensity bias values to obtain the second preset reference value can achieve a unified setting of the second preset reference value for all terminal devices of the same model.
[0090] Step S903: compare the absolute value of the second difference with a second preset value to determine a third comparison result.
[0091] In one embodiment of the present application, the second preset value may be pre-set in the terminal device. The terminal device loads the second preset value and calls it when it is powered on. In other embodiments, the second preset value may also be stored in a cloud server. The terminal device may obtain the second preset value by accessing the cloud server. In one embodiment of the present application, the second preset value is 10% or a smaller proportion of the second light intensity bias, and may be adjusted according to actual needs.
[0092] Step S904: Compare the third light intensity value with a proximity threshold to determine a fourth comparison result.
[0093] Step S905 , determining whether the object is close to or far away from the terminal device according to the third comparison result and / or the fourth comparison result.
[0094] In one embodiment of the present application, determining that an object is close to or far away from the terminal device according to the third comparison result and / or the fourth comparison result includes: if the absolute value of the second difference is greater than a first preset value, determining that the object is far away from the terminal device; or if the absolute value of the second difference is greater than a first preset value, and the third light intensity value is less than a proximity threshold, determining that the object is far away from the terminal device; or if the absolute value of the second difference is less than or equal to the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, determining that the object is close to the terminal device; or if the absolute value of the second difference is greater than the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, determining that the object is far away from the terminal device, and calibrating the third light intensity value. Calibrating the third light intensity value includes: starting a bias value software calibration mechanism to calibrate the third light intensity value. Specifically, the second light intensity value is sensed by the proximity light sensor of the terminal device, and the calibrated first light intensity value is calculated according to the formula PDATA=Dy(OFFSET), PDATA represents the calibrated third light intensity value, D represents the third light intensity value, and y(OFFSET) represents a first-order transformation function of the light intensity adjustment value equivalently converted with respect to the light intensity offset value. In one embodiment of the present application, the third light intensity offset value is substituted into the y(OFFSET) function to calculate the light intensity adjustment value of the third light intensity offset value.
[0095] In an embodiment of the present application, if the absolute value of the difference between the third light intensity bias value and the second preset reference value is less than the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, it is determined that the object is close to the terminal device, and thus, on the basis of the comparison between the third light intensity value and the proximity threshold, an additional basis for judging the proximity state is added, that is, the basis for judging the absolute value of the difference between the third light intensity bias value and the second preset reference value and the comparison result with the second preset value is added to judge whether the object is close to the screen of the terminal device, thereby avoiding the occurrence of misjudgment of the object's approaching or distant state after the screen is squeezed.
[0096] refer to Fig.10 FIG. 2 is a flow chart of a proximity determination method provided by another embodiment of the present application. The method comprises the following steps.
[0097] Step S1001, obtaining a third light intensity value and a third light intensity bias value in a terminal device.
[0098] In one embodiment of the present application, the third light intensity value is greater than or equal to the proximity threshold, wherein the specific implementation content of obtaining the third light intensity value and the third light intensity bias value in the above step S1001 refers to the implementation content of the above step S701, and will not be repeated here.
[0099] Step S1002, obtaining a fourth light intensity bias value of the terminal device when no object blocks the screen, and using the fourth light intensity bias value as a second preset reference value.
[0100] For the implementation content of the above step S1002, please refer to the implementation content of step S602.
[0101] Step S1003, subtract the third light intensity bias value from the second preset reference value to obtain a second difference, and determine whether the absolute value of the second difference is less than the second preset value. If the absolute value of the second difference is less than or equal to the second preset value, execute step S904, otherwise, if the absolute value of the second difference is greater than the second preset value, execute step S1005.
[0102] For the specific implementation content of the above step S1003, please refer to the implementation content of the above steps S902-S903, which will not be repeated here.
[0103] Step S1004: determine whether the object is close to the terminal device.
[0104] Step S1005, determining that the object is far away from the terminal device, and calibrating the third light intensity value.
[0105] For the specific implementation content of the above step S1005, please refer to the implementation content of step S706.
[0106] In an embodiment of the present application, when the third light intensity value reaches the proximity threshold, the second preset value is also used as the secondary proximity threshold for comparison with the absolute value of the difference between the fourth light intensity bias value and the second preset reference value, and whether the object is close to the terminal device is determined based on the comparison result, thereby avoiding the occurrence of misjudgment of the object's approaching or distant state after the screen is squeezed.
[0107] refer to Fig.11 FIG. 2 is a flow chart of a proximity determination method provided by another embodiment of the present application. The method comprises the following steps.
[0108] Step S1101, obtaining all light intensity values of the terminal device within a preset time range, and calculating the average value of all light intensity values to obtain a light intensity mean value.
[0109] In one embodiment of the present application, all light intensity values recorded by the terminal device within a preset time range before the determination moment are obtained, and the average value of all light intensity values is calculated to obtain the light intensity mean value. Fig.12 , the light intensity values recorded within the preset time range include the light intensity value at time T1 and the light intensity value at time T2, and the terminal device calculates the average of the light intensity value at time T1 and the light intensity value at time T2 to obtain the light intensity mean. The judgment moment refers to the time point used by the terminal device to judge whether an object is close to or far away from the terminal device, which can be the current time point that changes in real time, or it can be a preset time point, for example, 10:10:10. In addition, in other embodiments, the judgment moment can also be a time point triggered when the terminal device enters a preset scene. The preset scene can be set according to actual needs, and the embodiment of the present application does not limit this. For example, when the terminal device detects that it is in a preset scene of answering a call, it determines that the judgment moment is the time point when the terminal device enters the scene of answering a call. The preset time range can be a specific time period, such as within 30 minutes. In one example, all light intensity values recorded by the terminal device within 30 minutes before 10:10:10 are obtained, and the light intensity mean is calculated based on all light intensity values.
[0110] Step S1102, obtaining the fourth light intensity value and the fifth light intensity bias value of the terminal device at the determination moment.
[0111] In one example, the fourth light intensity value and the fifth light intensity bias value of the terminal device at the determination time (for example, 10:10:10 mentioned in the above example) can be obtained.
[0112] Step S1103, calculate the third difference between the light intensity mean and the third preset reference value, and determine whether the absolute value of the third difference is less than the third preset value. If the absolute value of the third difference is less than the third preset value, execute step S1104; otherwise, if the absolute value of the third difference is greater than or equal to the third preset value, execute step S1105.
[0113] Step S1104: compare the fourth light intensity value with the proximity threshold, and determine whether the object is approaching or moving away from the terminal device according to the fifth comparison result.
[0114] In one embodiment of the present application, if the absolute value of the third difference is less than the third preset value, it means that the probability of the terminal device making a proximity misjudgment at the moment of judgment is almost zero, and whether the object is close to or far away from the terminal device can be directly determined based on the comparison between the fourth light intensity value and the proximity threshold. In one embodiment of the present application, the light intensity value of the terminal device under the condition that no object blocks the screen is obtained, and the light intensity value is used as the third preset reference value. In one embodiment of the present application, the light intensity value is the light intensity value obtained when the terminal device is in the factory state or the initial state. In another embodiment of the present application, a set of light intensity values of multiple terminal devices of the same model under the condition that no object blocks the screen is obtained, and all light intensity values in the set of light intensity values are averaged to obtain the third preset reference value. In one embodiment of the present application, the third preset value can take a value in the range of [Pwave, Pwave+Pwindow].
[0115] In one embodiment of the present application, if the fourth light intensity value is greater than or equal to a proximity threshold, it is determined that the object is approaching the terminal device; if the fourth light intensity value is less than the proximity threshold, it is determined that the object is moving away from the terminal device.
[0116] Step S1105, calibrating the fourth light intensity value to obtain a fifth light intensity value according to the fourth light intensity value and the fifth light intensity offset value, comparing the fifth light intensity value with the proximity threshold, and determining whether the object is approaching or moving away from the terminal device according to a sixth comparison result.
[0117] In one embodiment of the present application, if the absolute value of the third difference between the light intensity mean value and the third preset reference value is greater than or equal to the third preset value, a proximity misjudgment due to squeezing the screen may occur at the time of determination, and the fourth light intensity value obtained at the time of determination needs to be calibrated. Fig.13 As shown, it is a schematic diagram of calibrating the fourth light intensity value. As mentioned above, when the light intensity value decreases to the zero-crossing calibration threshold, the light intensity value zero-crossing recalibration mechanism will be triggered, and the fifth light intensity bias value will be reduced through the light intensity value zero-crossing recalibration mechanism. However, when the screen squeeze is canceled, the proximity light sensor will output a larger light intensity value based on the reduced fifth light intensity bias value. If the light intensity value is close to the proximity threshold value, it is easy to cause a false judgment of proximity. In this embodiment, the light intensity mean is obtained by calculating the average value of all light intensity values of the terminal device within a preset time range, and the light intensity mean is compared with the proximity threshold. When the absolute value of the third difference between the light intensity mean and the third preset reference value is greater than or equal to the third preset value, the fourth light intensity value obtained at the judgment moment is calibrated according to the bias value software calibration mechanism, and the comparison result of the fifth light intensity value obtained after calibration and the proximity threshold is determined.
[0118] In one embodiment of the present application, calibrating the fourth light intensity value according to the fourth light intensity value and the fifth light intensity offset value to obtain the fifth light intensity value includes: sensing the fourth light intensity value by a proximity light sensor; calculating the fifth light intensity value according to the formula PDATA=Ay(OFFSET), where PDATA represents the fifth light intensity value, A represents the fourth light intensity value, and y(OFFSET) represents a first-order conversion function of the light intensity adjustment value equivalently converted with respect to the fifth light intensity offset value. In one embodiment of the present application, the fifth light intensity offset value is substituted into the y(OFFSET) function to calculate the light intensity adjustment value of the fifth light intensity offset value.
[0119] In one embodiment of the present application, the method further includes: after determining that the object is approaching the terminal device, reducing the preset time range to update the preset time range. In this embodiment, the light intensity mean is calculated based on the average value of all light intensity values within the reduced preset time range, which can reduce the impact of abnormal light intensity values within the preset time range on the misjudgment of the object approaching or moving away from the terminal device.
[0120] In an embodiment of the present application, before judging whether an object is approaching the screen based on the fourth light intensity value obtained at the judgment moment, if the absolute value of the third difference between the average of all light intensity values within the preset time range before the judgment moment and the third preset reference value is greater than or equal to the third preset value, the fourth light intensity value is calibrated once, and after the calibration, the fourth light intensity value is judged to be approaching the screen, thereby avoiding the occurrence of misjudgment of the approaching or distant state of an object after the screen is squeezed.
[0121] refer to Fig.14 , which is a schematic diagram of the hardware structure of the terminal device 100 in an embodiment of the present application. The terminal device 100 may include a processor 110, an internal memory 120, an external memory interface 130, a display screen 140, and a sensor module 150. The sensor module 150 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0122] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0123] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0124] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0125] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0126] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0127] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0128] The terminal device 100 implements the display function through a GPU, a display screen 140, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0129] The display screen 140 is used to display images, videos, etc. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 140, where N is a positive integer greater than 1.
[0130] The internal memory 120 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc. The non-volatile memory may include a disk storage device and a flash memory. Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0131] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data, etc.
[0132] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0133] The external memory interface 130 can be used to connect to an external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 130 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0134] The internal memory 120 or the external memory interface 130 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 110, the proximity judgment method executed on the terminal device 100 in the above embodiment can be implemented to realize the proximity judgment function of the terminal device 100.
[0135] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the proximity determination method in the above-mentioned embodiment.
[0136] In addition, some embodiments of the present application also provide a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the proximity judgment method in the above-mentioned method embodiments.
[0137] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0138] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0139] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0140] The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present application may be integrated in a processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of some embodiments of the present application are essentially or partly contributed to the prior art or all or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of some embodiments of the present application and are not limiting. Although some embodiments of the present application are described in detail with reference to the preferred embodiments, ordinary technicians in this field should understand that the technical solutions of some implementation examples of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of some embodiments of the present application.
Claims
1. A proximity determination method, applied to a terminal device, characterized in that: The method comprises: Acquire a first light intensity value and a first light intensity bias value in the terminal device; Obtaining a first light intensity report value according to the first light intensity value and the first light intensity offset value; Obtaining a first difference value according to the first light intensity report value and a first preset reference value; Obtaining a first comparison result according to the absolute value of the first difference and a first preset value; Obtaining a second comparison result according to the first light intensity value and a preset proximity threshold; It is determined whether the object is close to or far away from the terminal device according to the first comparison result and the second comparison result.
2. The proximity determination method according to claim 1, characterized in that: The determining, according to the first comparison result and the second comparison result, that the object is close to or far away from the terminal device comprises: If the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is less than the proximity threshold, it is determined that the object is far away from the terminal device; or If the absolute value of the first difference is greater than or equal to the first preset value, and the first light intensity value is greater than or equal to the proximity threshold, it is determined that the object is close to the terminal device; or If the absolute value of the first difference is smaller than the first preset value and the first light intensity value is greater than or equal to the proximity threshold, it is determined that the object is far away from the terminal device, and the first light intensity value is calibrated.
3. The proximity determination method according to claim 2, characterized in that: The calibrating the first light intensity value comprises: The bias value software calibration mechanism is started to calibrate the first light intensity value.
4. The proximity determination method according to claim 3, characterized in that: The starting the bias value software calibration mechanism to calibrate the first light intensity value includes: Sensing a second light intensity value by a proximity light sensor; determining a first light intensity adjustment value by adjusting the first light intensity bias value; A calibration value of the first light intensity value is obtained according to the second light intensity reported value and the first light intensity adjustment value.
5. The proximity determination method according to claim 1, wherein: The method further comprises: Obtaining a second light intensity value and a second light intensity bias value of the terminal device under the condition that no object blocks the screen; The first preset reference value is obtained according to the second light intensity value and the second light intensity offset value.
6. The proximity determination method according to claim 5, characterized in that: The obtaining the first preset reference value according to the second light intensity value and the second light intensity offset value comprises: determining a second light intensity adjustment value by adjusting the second light intensity bias value; The first preset reference value is obtained according to the second light intensity value and the second light intensity adjustment value.
7. The proximity determination method according to claim 1, characterized in that: The method further comprises: Obtaining a set of second light intensity values and a set of second light intensity bias values of multiple terminal devices of the same model under the condition that no object blocks the screen, wherein each second light intensity value in the set of second light intensity values corresponds to a second light intensity bias value; Obtaining a reference value according to each second light intensity value and the corresponding second light intensity bias value; The first preset reference value is obtained by averaging all the reference values.
8. A proximity determination method, applied to a terminal device, characterized in that: The method comprises: Acquire a third light intensity value and a third light intensity bias value in the terminal device; Obtaining a second difference value according to the third light intensity bias value and a second preset reference value; Obtaining a third comparison result according to the absolute value of the second difference and a second preset value; Obtaining a fourth comparison result according to the third light intensity value and the proximity threshold; According to the third comparison result and the fourth comparison result, it is determined whether the object is close to or far away from the terminal device.
9. The proximity determination method according to claim 8, characterized in that: The determining, according to the third comparison result and the fourth comparison result, that the object is close to or far away from the terminal device comprises: If the absolute value of the second difference is greater than the second preset value, and the third light intensity value is less than the proximity threshold, it is determined that the object is far away from the terminal device; or If the absolute value of the second difference is less than or equal to the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, it is determined that the object is close to the terminal device; or If the absolute value of the second difference is greater than the second preset value, and the third light intensity value is greater than or equal to the proximity threshold, it is determined that the object is far away from the terminal device, and the third light intensity value is calibrated.
10. The proximity determination method according to claim 9, characterized in that: The calibrating the third light intensity value comprises: The bias value software calibration mechanism is started to calibrate the third light intensity value.
11. The proximity determination method according to claim 10, characterized in that: The starting of the bias value software calibration mechanism to calibrate the third light intensity value comprises: sensing a third light intensity value through a proximity light sensor; determining a third light intensity adjustment value by adjusting the third light intensity bias value; A calibration value of the third light intensity value is obtained according to the third light intensity reported value and the third light intensity adjustment value.
12. The proximity determination method according to claim 8, characterized in that: The method further comprises: A fourth light intensity bias value of the terminal device under the condition that no object blocks the screen is obtained, and the fourth light intensity bias value is used as a second preset reference value.
13. The proximity determination method according to claim 8, characterized in that: The method further comprises: Obtain a set of fourth light intensity bias values of multiple terminal devices of the same model under the condition that no object blocks the screen; A second preset reference value is obtained by averaging all the fourth light intensity bias values in the set of fourth light intensity bias values.
14. A proximity determination method, applied to a terminal device, characterized in that: The method comprises: Acquire all light intensity values of the terminal device within a preset time range, and obtain a light intensity average according to all the light intensity values; Obtaining a fourth light intensity value and a fifth light intensity bias value of the terminal device at the determination moment; According to the light intensity mean value and the third preset reference value, an absolute value of a third difference is obtained; if the absolute value of the third difference is less than the third preset value, a fifth comparison result is obtained according to the fourth light intensity value and the proximity threshold, and according to the fifth comparison result, it is determined that the object is close to or far away from the terminal device; If the absolute value of the third difference is greater than or equal to the third preset value, calibrating the fourth light intensity value according to the fourth light intensity value and the fifth light intensity bias value to obtain a fifth light intensity value; A sixth comparison result is obtained according to the fifth light intensity value and the proximity threshold, and it is determined according to the sixth comparison result that the object is approaching or moving away from the terminal device.
15. The proximity determination method according to claim 14, characterized in that: The determining, according to the fifth comparison result, that the object is close to or far away from the terminal device comprises: If the fourth light intensity value is greater than or equal to the proximity threshold, it is determined that the object is close to the terminal device; If the fourth light intensity value is less than the proximity threshold, it is determined that the object is far away from the terminal device.
16. The proximity determination method according to claim 14, characterized in that: The step of calibrating the fourth light intensity value according to the fourth light intensity value and the fifth light intensity offset value to obtain a fifth light intensity value comprises: sensing a fourth light intensity value through a proximity light sensor; determining a fourth light intensity adjustment value by adjusting the fifth light intensity bias value; The fifth light intensity value is obtained according to the fourth light intensity reported value and the fourth light intensity adjustment value.
17. The proximity determination method according to claim 14, characterized in that: Determining, according to the sixth comparison result, that the object is close to or far away from the terminal device comprises: If the fifth light intensity value is greater than or equal to the proximity threshold, it is determined that the object is close to the terminal device; If the fifth light intensity value is less than the proximity threshold, it is determined that the object is far away from the terminal device.
18. The proximity determination method according to claim 14, characterized in that: The method further comprises: A third light intensity value of the terminal device under the condition that no object blocks the screen is obtained, and the third light intensity value is used as the third preset reference value.
19. The proximity determination method according to claim 14, characterized in that: The method further comprises: A set of third light intensity values of multiple terminal devices of the same model under the condition that no object blocks the screen is obtained, and the third preset reference value is obtained by averaging all third light intensity values in the set of third light intensity values.
20. A terminal device, characterized in that: It includes a processor and a proximity light sensor; wherein the processor is connected to the proximity light sensor; The proximity light sensor is used to sense the light intensity value; The processor is used to implement the proximity determination method according to any one of claims 1 to 19 based on the light intensity value.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the proximity determination method according to any one of claims 1 to 19 is implemented.