CN103123394B - A kind of method and system that threshold value of proximity sensor is set - Google Patents
A kind of method and system that threshold value of proximity sensor is set Download PDFInfo
- Publication number
- CN103123394B CN103123394B CN201110370005.XA CN201110370005A CN103123394B CN 103123394 B CN103123394 B CN 103123394B CN 201110370005 A CN201110370005 A CN 201110370005A CN 103123394 B CN103123394 B CN 103123394B
- Authority
- CN
- China
- Prior art keywords
- currency
- proximity sensor
- threshold value
- reading
- initial threshold
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Testing Of Coins (AREA)
Abstract
The invention provides a kind of method arranging threshold value of proximity sensor, the method comprises the following steps: the initial threshold of S11, acquisition Proximity Sensor; The currency of S12, reading Proximity Sensor register, compares initial threshold and currency, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor.The present invention also provides a kind of system arranging threshold value of proximity sensor, and this system comprises: acquiring unit, for obtaining the initial threshold of Proximity Sensor; Reading unit, for reading the currency of Proximity Sensor register; Comparing unit, for comparing the size of initial threshold and currency; Setting unit, for when described comparing unit show that described currency is greater than initial threshold, is set to the threshold value of Proximity Sensor by currency.Method and system provided by the invention, can dynamically arrange the threshold value of Proximity Sensor, no longer by the impact of ambient environmental factors, improves the application of Proximity Sensor.
Description
Technical field
The invention belongs to communication field, particularly relate to a kind of method and system that threshold value of proximity sensor is set.
Background technology
Increasing smart mobile phone starts to adopt touch screen design now, and ambient light sensor and the two-in-one chip of Proximity Sensor can allow mobile phone more intelligent, and increase cruising time.Proximity Sensor is found range by infrared ray, when cellphone subscriber receives calls or put into pocket, Proximity Sensor can judge that mobile phone is near the face of people or clothes, and then closes the touch controllable function of screen, so just can prevent maloperation.So it is very important for arranging the close condition of mobile phone, starting point of the present invention is by selecting rational threshold value to realize.Described threshold value is exactly critical value, namely by this critical value judge mobile phone be near or away from state.
At present, the setting of threshold value is rule of thumb arranged, and is set to fixed value when initialization.In existing structure, Proximity Sensor is positioned at screen the top, the present inventor finds: because the design of every platform mobile phone is different, the many times sensitivity of Proximity Sensor can be subject to its surrounding environment various factors, and the position of installing also can not be just the same; Therefore, fixed threshold is difficult to meet its requirement, thus affects the application of some Proximity Sensors.
Summary of the invention
The object of this invention is to provide a kind of method that threshold value of proximity sensor is set, dynamically arranging of threshold value of proximity sensor can be realized, improve the application of Proximity Sensor.
The object of the invention is to be achieved through the following technical solutions:
Arrange a method for threshold value of proximity sensor, the method comprises the following steps:
The initial threshold of S11, acquisition Proximity Sensor;
The currency of S12, reading Proximity Sensor register, compares initial threshold and currency, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor.
The present invention also provides a kind of system arranging threshold value of proximity sensor, and this system comprises:
Acquiring unit, for obtaining the initial threshold of Proximity Sensor;
Reading unit, for reading the currency of Proximity Sensor register;
Comparing unit, for comparing the size of initial threshold and currency;
Setting unit, for when described comparing unit show that described currency is greater than initial threshold, is set to the threshold value of Proximity Sensor by currency.
Provided by the inventionly arrange in the method and system of threshold value of proximity sensor, first initialization is carried out to Proximity Sensor, obtain an initial threshold, then the currency in Proximity Sensor register is read, compare with described initial threshold, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor.Therefore, can dynamically arrange the threshold value of Proximity Sensor, no longer by the impact of ambient environmental factors, improve the application of Proximity Sensor.
Accompanying drawing explanation
Fig. 1 is the method flow schematic diagram arranging threshold value of proximity sensor provided by the invention.
Fig. 2 is the system architecture schematic diagram arranging threshold value of proximity sensor provided by the invention.
Embodiment
In order to make technical matters solved by the invention, technical scheme and beneficial effect clearly understand, below in conjunction with embodiment, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Please refer to shown in Fig. 1, a kind of method arranging threshold value of proximity sensor, the method comprises the following steps:
The initial threshold of S11, acquisition Proximity Sensor;
The currency of S12, reading Proximity Sensor register, compares initial threshold and currency, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor.
Provided by the inventionly arrange in the method for threshold value of proximity sensor, first initialization is carried out to Proximity Sensor, obtain an initial threshold, then the currency in Proximity Sensor register is read, compare with described initial threshold, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor.Principle is as follows: threshold value be judge near or away from the foundation of mobile phone, if be less than initial threshold, represent that, away from mobile phone, threshold value is constant; If be greater than initial threshold, represent near mobile phone, now need to reset threshold value.Therefore, this method can dynamically arrange the threshold value of Proximity Sensor, no longer by the impact of ambient environmental factors, thus improves the effect of Proximity Sensor.In a particular application, inventor finds, Proximity Sensor is subject to the impact of surrounding environment, the transmittance etc. of the color of such as phone housing, the infrared ray hole of touch-screen.
As a kind of concrete embodiment, in step s 11, the initial threshold of described acquisition Proximity Sensor is specially:
The threshold value that direct reading Proximity Sensor register is preset, using the initial threshold of described default threshold value as Proximity Sensor.Particularly, if first time starts shooting uses, each Proximity Sensor is when being installed on mobile phone, and all can preset a fixing threshold value for Proximity Sensor, this threshold value of fixing is the initial threshold of Proximity Sensor; The use if second time is started shooting, the distance sensed for the last time when last time then can shut down by Proximity Sensor, the predetermined threshold value of Proximity Sensor when starting shooting as this, by the initial threshold of this predetermined threshold value as Proximity Sensor.Therefore, no matter being fixing threshold value or the distance value sensed for the last time, is all the definite value that will be stored in Proximity Sensor register, and automatically as the initial threshold of Proximity Sensor, user can only read the existing threshold value of Proximity Sensor.
As the embodiment that another kind is concrete, in step s 11, the initial threshold of described acquisition Proximity Sensor can realize in the following way:
User can manually add an application in mobile phone, then blocks the front of Proximity Sensor, when detecting that user blocks the front of Proximity Sensor, receives a user-selected critical value, as the initial threshold of Proximity Sensor.Wherein, user can choose at random oneself satisfied position, is defined as the critical value of Proximity Sensor, makes it as the initial threshold of Proximity Sensor.Therefore, this embodiment manually can arrange the initial threshold of Proximity Sensor, improves the satisfaction of user.
As concrete embodiment, in step s 12, in order to improve the accuracy reading currency, two values are read continuously.Particularly, in step s 12, the currency of described reading comprises the first currency and the second currency, if the absolute value of the difference of the first currency and the second currency is less than or equal to 0.1, then using the arithmetic mean of the first currency and the second currency as currency, then this currency is compared with initial threshold, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor; If currency is less than initial threshold, represents that initial threshold meets the demands, do not need to reset threshold value.
In order to prevent when reading first currency or the second currency, there is unexpected rocking or the movement in threshold value direction in mobile phone, cause the sudden change of the first currency or the second currency, improve the consistance of the state reading currency, in step s 12, comprise further: if the absolute value of the difference of the first currency and the second currency is greater than 0.1, then the first currency and the second currency are exchanged, again read the second currency; Namely be as the criterion with the state reading the second currency, using the second currency of originally reading as the first currency, again read second currency, the error of currency can be reduced thus better.
The method arranging threshold value of proximity sensor provided by the invention, can circulate and read the currency of Proximity Sensor register, compare the size of initial threshold and currency, to on-the-fly modify threshold value.As a kind of specific embodiment, when user is when making a phone call, open the function of closely sensing, a newly-built thread reads the currency of closely sensing register, if currency is greater than initial threshold, then represent the state be near mobile phone, now need to reset threshold value, otherwise threshold value is constant; Meanwhile, after end of conversation, thread is closed.
The present invention also provides a kind of system arranging threshold value of proximity sensor, and this system comprises:
Acquiring unit 101, for obtaining the initial threshold of Proximity Sensor;
Reading unit 102, for reading the currency of Proximity Sensor register;
Comparing unit 103, for comparing the size of initial threshold and currency;
Setting unit 104, for when described comparing unit show that described currency is greater than initial threshold, is set to the threshold value of Proximity Sensor by currency.
Provided by the inventionly arrange in the system of threshold value of proximity sensor, first initialization is carried out to Proximity Sensor, obtain an initial threshold, then the currency in Proximity Sensor register is read, compare with described initial threshold, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor.Principle is as follows: threshold value be judge near or away from the foundation of mobile phone, if be less than initial threshold, represent that, away from mobile phone, threshold value is constant; If be greater than initial threshold, represent near mobile phone, now need to reset threshold value.Therefore, this method can dynamically arrange the threshold value of Proximity Sensor, no longer by the impact of ambient environmental factors, thus improves the effect of Proximity Sensor.
As a kind of concrete embodiment, described acquiring unit 101 comprises:
Acquisition module, for obtaining the threshold value that Proximity Sensor register is preset;
First arranges module, and the threshold value for being obtained by described acquisition module is set to the initial threshold of Proximity Sensor.
Wherein, acquisition module directly reads the threshold value that Proximity Sensor register is preset, and second arranges module using the initial threshold of described default threshold value as Proximity Sensor.Particularly, if first time starts shooting uses, each Proximity Sensor is when being installed on mobile phone, and all can preset a fixing threshold value for Proximity Sensor, this threshold value of fixing is the initial threshold of Proximity Sensor; The use if second time is started shooting, the distance sensed for the last time when last time then can shut down by Proximity Sensor, the predetermined threshold value of Proximity Sensor when starting shooting as this, by the initial threshold of this predetermined threshold value as Proximity Sensor.Therefore, no matter being fixing threshold value or the distance value sensed for the last time, is all the definite value that will be stored in Proximity Sensor register, and automatically as the initial threshold of Proximity Sensor, user can only read the existing threshold value of Proximity Sensor.
As the embodiment that another kind is concrete, described acquiring unit 101 comprises:
Whether detection module, block the front of Proximity Sensor for detecting user;
Receiver module, receives a user-selected critical value during for detecting block when detection module;
Second arranges module, for the critical value received by described receiver module being set to the initial threshold of Proximity Sensor.
Particularly, user can manually add an application in mobile phone, block the front of Proximity Sensor again, detection module detects the front whether user blocks Proximity Sensor, when detecting that user blocks the front of Proximity Sensor, receiver module receives a user-selected critical value, and second arranges module using the critical value that the receives initial threshold as Proximity Sensor.Wherein, user can choose at random oneself satisfied position, is defined as the critical value of Proximity Sensor, makes it as the initial threshold of Proximity Sensor.Therefore, this embodiment manually can arrange the initial threshold of Proximity Sensor, improves the satisfaction of user.
As concrete embodiment, in reading unit 102, in order to improve the accuracy reading currency, in the present embodiment, read two values continuously.Particularly, described reading unit 102 comprises:
First read module, for reading the first currency of Proximity Sensor register;
Second read module, for reading the second currency of Proximity Sensor register;
Judge module, whether the absolute value for the difference judging described first currency and the second currency is less than or equal to 0.1;
3rd arranges module, for when described judge module is obtained a result as being, using the arithmetic mean of the first currency and the second currency as currency.
Correspondingly, in setting unit 104, if when described comparing unit 103 show that described currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor; If when described comparing unit 103 show that described currency is less than initial threshold, then represent that initial threshold meets the demands, and does not need to reset threshold value.
In order to prevent when reading first currency or the second currency, there is unexpected rocking or the movement in threshold value direction in mobile phone, cause the sudden change of the first currency or the second currency, improve the consistance of the state reading currency, described reading unit 102 comprises further:
Switching Module, for obtaining a result as time no when described judge module, namely when the absolute value of the difference of the first currency and the second currency is greater than 0.1, exchanges the first currency and the second currency;
Third reading delivery block, for after described Switching Module exchanges, reads the second currency again; Namely be as the criterion with the state reading the second currency, using the second currency of originally reading as the first currency, again read second currency, the error of currency can be reduced thus better.
The system arranging threshold value of proximity sensor provided by the invention, can circulate and read the currency of Proximity Sensor register, compare the size of initial threshold and currency, to on-the-fly modify threshold value.As a kind of specific embodiment, when user is when making a phone call, open the function of closely sensing, a newly-built thread reads the currency of closely sensing register, if currency is greater than initial threshold, then represent the state be near mobile phone, now need to reset threshold value, otherwise threshold value is constant; Meanwhile, after end of conversation, thread is closed.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.
Claims (2)
1. arrange a method for threshold value of proximity sensor, it is characterized in that, the method comprises the following steps:
S11, when detecting that user blocks the front of Proximity Sensor, receive a user-selected critical value, as the initial threshold of Proximity Sensor;
The currency of S12, reading Proximity Sensor register, relatively initial threshold and currency, if currency is greater than initial threshold, then currency is set to the threshold value of Proximity Sensor, the currency of described reading comprises the first currency and the second currency, if the absolute value of the difference of the first currency and the second currency is less than or equal to 0.1, then using the arithmetic mean of the first currency and the second currency as currency; If the absolute value of the difference of the first currency and the second currency is greater than 0.1, then the first currency and the second currency is exchanged, again read the second currency.
2. arrange a system for threshold value of proximity sensor, it is characterized in that, this system comprises:
Acquiring unit, for obtaining the initial threshold of Proximity Sensor, described acquiring unit comprises: detection module, whether blocks the front of Proximity Sensor for detecting user; Receiver module, receives a user-selected critical value during for detecting block when detection module; Second arranges module, for the critical value received by described receiver module being set to the initial threshold of Proximity Sensor;
Reading unit, for reading the currency of Proximity Sensor register, described reading unit comprises: the first read module, for reading the first currency of Proximity Sensor register; Second read module, for reading the second currency of Proximity Sensor register; Judge module, whether the absolute value for the difference judging described first currency and the second currency is less than or equal to 0.1; 3rd arranges module, for when described judge module is obtained a result as being, using the arithmetic mean of the first currency and the second currency as currency; Switching Module, for obtaining a result as time no when described judge module, exchanges the first currency and the second currency; Third reading delivery block, for after described Switching Module exchanges, reads the second currency again;
Comparing unit, for comparing the size of initial threshold and currency;
Setting unit, for when described comparing unit show that described currency is greater than initial threshold, is set to the threshold value of Proximity Sensor by currency.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110370005.XA CN103123394B (en) | 2011-11-21 | 2011-11-21 | A kind of method and system that threshold value of proximity sensor is set |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110370005.XA CN103123394B (en) | 2011-11-21 | 2011-11-21 | A kind of method and system that threshold value of proximity sensor is set |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103123394A CN103123394A (en) | 2013-05-29 |
CN103123394B true CN103123394B (en) | 2015-08-26 |
Family
ID=48454442
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110370005.XA Active CN103123394B (en) | 2011-11-21 | 2011-11-21 | A kind of method and system that threshold value of proximity sensor is set |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103123394B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9689810B2 (en) * | 2013-10-08 | 2017-06-27 | Htc Corporation | Electronic apparatus with proximity sensor and automatic calibration method thereof |
CN103941310B (en) * | 2014-04-09 | 2017-02-15 | 苏州佳世达电通有限公司 | Correcting method and system of proximity sensor |
CN106201019B (en) * | 2016-06-28 | 2019-04-09 | Oppo广东移动通信有限公司 | A kind of the threshold value adjusting method and mobile terminal of proximity sensor |
CN106199620B (en) * | 2016-07-11 | 2018-09-21 | 广东欧珀移动通信有限公司 | Data processing method, data processing system and terminal device |
WO2018058605A1 (en) * | 2016-09-30 | 2018-04-05 | 华为技术有限公司 | Method and apparatus for obtaining distance threshold value when performing user related operation |
CN107102864A (en) | 2017-05-16 | 2017-08-29 | 广东欧珀移动通信有限公司 | One kind puts out screen control method, device, storage medium and terminal |
CN109307861B (en) * | 2017-07-28 | 2021-09-03 | 比亚迪股份有限公司 | Vehicle, vehicle positioning method and vehicle-mounted equipment |
CN108595213A (en) * | 2018-04-11 | 2018-09-28 | 广州视源电子科技股份有限公司 | The method, apparatus and electronic equipment of the threshold value of adjustable range sensor |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000174326A (en) * | 1998-12-08 | 2000-06-23 | Mitsubishi Electric Corp | Detection device |
US8030914B2 (en) * | 2008-12-29 | 2011-10-04 | Motorola Mobility, Inc. | Portable electronic device having self-calibrating proximity sensors |
CN101741983B (en) * | 2009-12-10 | 2013-08-07 | 中兴通讯股份有限公司 | Method and terminal for realizing proximity induction |
CN101751179B (en) * | 2009-12-16 | 2012-05-23 | 深圳市汇顶科技有限公司 | Method and system for automatically calibrating sensitivity of touch detection, and touch control terminal |
CN101815127B (en) * | 2010-04-12 | 2014-08-20 | 中兴通讯股份有限公司 | Mobile terminal and method for adjusting visual effect of screen thereof |
CN101951444A (en) * | 2010-09-29 | 2011-01-19 | 中兴通讯股份有限公司 | Method for realizing screen locking and unlocking of mobile terminal and mobile terminal |
WO2011150887A2 (en) * | 2011-06-24 | 2011-12-08 | 华为终端有限公司 | Method and device for adjusting detecting threshold of infrared proximity sensor |
-
2011
- 2011-11-21 CN CN201110370005.XA patent/CN103123394B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN103123394A (en) | 2013-05-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103123394B (en) | A kind of method and system that threshold value of proximity sensor is set | |
US10997477B2 (en) | Foreign matter recognition method and device | |
CN104700816B (en) | Method and device for setting screen brightness | |
US20150309568A1 (en) | Electronic apparatus and eye-gaze input method | |
US20080220829A1 (en) | Mobile terminal device, method of power saving control for mobile terminal device and computer product | |
CN101951444A (en) | Method for realizing screen locking and unlocking of mobile terminal and mobile terminal | |
CN102244699A (en) | Method of using acceleration sensor to unlock mobile phone screen and mobile phone thereof | |
CN104640184A (en) | Screen wake-up method and device | |
KR20170039201A (en) | Switching between cameras of an electronic device | |
CN103581407A (en) | Method and system for protecting screen against spurious triggering in conversation process | |
CN103076953B (en) | A kind of method of subscriber terminal equipment preview picture file and subscriber terminal equipment | |
CN103369144A (en) | Method for processing misoperation in mobile phone communication process through acceleration sensor | |
CN103377353A (en) | Electronic device and touch screen protection method and protection system thereof | |
CN103024173B (en) | Method for opening camera based on gravity sensing | |
CN104301461A (en) | Method and device for detecting state of device leather case | |
CN106101402B (en) | Method and system for adjusting sensing threshold of proximity sensor | |
CN102510423A (en) | Mobile hand-held device with touch screen and method and system for avoiding mistouching mobile hand-held device in call | |
CN104516474A (en) | Information processing method and electronic device | |
CN105630331A (en) | Display method and display system | |
CN105744160A (en) | Photographing method and device | |
CN104580657A (en) | A sensor user self-configuring method, and device and mobile terminal | |
CN104516641A (en) | Automatic calibration method and electronic apparatus | |
KR20100060834A (en) | Calling method in a touch pannel type portable terminal | |
CN109029720A (en) | Intensity of illumination detection method and device | |
CN109343066A (en) | Control method, device, storage medium and the mobile terminal of proximity sensor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |