CN106325541B - A kind of proximity sensor status information acquiring method, device and mobile terminal - Google Patents

A kind of proximity sensor status information acquiring method, device and mobile terminal Download PDF

Info

Publication number
CN106325541B
CN106325541B CN201610662567.4A CN201610662567A CN106325541B CN 106325541 B CN106325541 B CN 106325541B CN 201610662567 A CN201610662567 A CN 201610662567A CN 106325541 B CN106325541 B CN 106325541B
Authority
CN
China
Prior art keywords
close
proximity sensor
distance
threshold
interrupt signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610662567.4A
Other languages
Chinese (zh)
Other versions
CN106325541A (en
Inventor
张强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610662567.4A priority Critical patent/CN106325541B/en
Publication of CN106325541A publication Critical patent/CN106325541A/en
Application granted granted Critical
Publication of CN106325541B publication Critical patent/CN106325541B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form

Abstract

The embodiment of the invention discloses a kind of proximity sensor status information acquiring method, device and mobile terminals;This method includes obtaining proximity sensor based on the first interrupt signal generated close to distance threshold;According to the first interrupt signal, to being configured in proximity sensor close to distance threshold, so that proximity sensor generates the second interrupt signal according to after setting close to distance threshold;It is current close to distance between terminal and barrier that acquisition proximity sensor detects according to the second interrupt signal;According to currently close to distance, obtaining the status information of corresponding proximity sensor;The program improves the speed that terminal obtains proximity sensor status information by the way that proximity sensor is made to generate forced interruption.

Description

A kind of proximity sensor status information acquiring method, device and mobile terminal
Technical field
The present invention relates to field of terminal technology, and in particular to a kind of proximity sensor status information acquiring method, device and Mobile terminal.
Background technology
When mobile phone is in bright screen state, it may be possible to which user is operated using mobile phone, it is also possible to because maloperation makes The bright screen of mobile phone.Therefore when the bright screen state of mobile phone is excited, the proximity sensor in mobile phone can be triggered, proximity sensor will detect hand Whether there is shelter on machine, wherein having shelter for proximity state, have no occluder is far from state.Mobile phone is believed further according to the state Breath is handled accordingly.
In the prior art, interruption can be generated when proximity sensor, which is in close, to interrupt, it will be reported to be at this time Proximity state, the speed of the status information of mobile phone acquisition at this time is very fast, only needs 5 milliseconds or so;And proximity sensor is in separate , can only be after a chip integration period during state, the processor in mobile phone is to close to sensor status data analyze Go out it to be in far from state, this process speed is slower, and taking about needs 100 milliseconds.
Invention content
The embodiment of the present invention provides a kind of proximity sensor status information acquiring method, device and mobile terminal, can solve It is certainly existing to obtain the technical issues of proximity sensor state velocity is slower.
The embodiment of the present invention provides a kind of proximity sensor status information acquiring method, including:
Proximity sensor is obtained based on the first interrupt signal generated close to distance threshold;
According to the first interrupt signal, to being configured in proximity sensor close to distance threshold, so that proximity sensor According to after setting the second interrupt signal is generated close to distance threshold;
According to the second interrupt signal, obtain between the terminal and barrier that proximity sensor detects it is current close to away from From;
According to currently close to distance, obtaining the status information of corresponding proximity sensor.
The embodiment of the present invention additionally provides a kind of proximity sensor state information acquisition device, including:
Interrupt signal acquisition module interrupts letter for obtaining proximity sensor based on first generated close to distance threshold Number;
Setup module, for according to first interrupt signal, to described close to apart from threshold in the proximity sensor Value is configured, so that the proximity sensor generates the second interrupt signal according to after the setting close to distance threshold;
It approaches apart from acquisition module, for according to second interrupt signal, obtaining what the proximity sensor detected It is current close to distance between terminal and barrier;
State information acquisition module, for, currently close to distance, obtaining the state of corresponding proximity sensor according to described Information.
The embodiment of the present invention additionally provides a kind of mobile terminal, including proximity sensor and with the proximity sensor The above-mentioned proximity sensor state information acquisition device of connection, wherein, the proximity sensor state information acquisition device includes:
Interrupt signal acquisition module interrupts letter for obtaining proximity sensor based on first generated close to distance threshold Number;
Setup module, for according to first interrupt signal, to described close to apart from threshold in the proximity sensor Value is configured, so that the proximity sensor generates the second interrupt signal according to after the setting close to distance threshold;
It approaches apart from acquisition module, for according to second interrupt signal, obtaining what the proximity sensor detected It is current close to distance between terminal and barrier;
State information acquisition module, for, currently close to distance, obtaining the state of corresponding proximity sensor according to described Information.
The embodiment of the present invention is using acquisition proximity sensor based on the first interrupt signal generated close to distance threshold;According to First interrupt signal, to being configured in proximity sensor close to distance threshold, so that after proximity sensor is according to setting The second interrupt signal is generated close to distance threshold;According to the second interrupt signal, terminal and barrier that proximity sensor detects are obtained Hinder current close to distance between object;According to currently close to distance, obtaining the status information of corresponding proximity sensor.The program By make proximity sensor generate forced interruption, compared with the prior art for, can improve terminal obtain proximity sensor state The speed of information.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is the flow chart of the first proximity sensor status information acquiring method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of second of proximity sensor status information acquiring method provided in an embodiment of the present invention;
Fig. 3 is a kind of structure diagram of proximity sensor state information acquisition device provided in an embodiment of the present invention;
Fig. 4 is a kind of structure diagram of mobile terminal provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, the every other implementation that those skilled in the art are obtained without creative efforts Example, shall fall within the protection scope of the present invention.
Term " first ", " second ", " third " and " the 4th " in the present invention etc. be for distinguish different objects rather than For describing particular order.In addition, term " comprising " and " having " and their any deformations, it is intended that cover non-exclusive Comprising.Such as it contains process, method, system, product or the equipment of series of steps or unit and is not limited to what is listed Step or unit, but optionally further include the step of not listing or unit or optionally further include for these processes, side The intrinsic other steps of method, product or equipment or unit.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments Containing at least one embodiment of the present invention.Each position in the description occur the phrase might not each mean it is identical Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.
The executive agent of proximity sensor status information acquiring method provided in an embodiment of the present invention can be that the present invention is real The proximity sensor state information acquisition device of example offer is provided or is integrated with the proximity sensor state information acquisition device Terminal, hardware may be used in the proximity sensor state information acquisition device or the mode of software is realized;It is of the invention real It can be smart mobile phone (such as Android phone, Windows Phone mobile phones), tablet computer, the palm to apply the described terminal of example The packets such as upper computer, laptop, mobile internet device (MID, Mobile Internet Devices) or Wearable Mobile equipment containing proximity sensor, above-mentioned terminal are only citings, and non exhaustive, including but not limited to above-mentioned terminal.
The embodiment of the present invention provides a kind of proximity sensor status information acquiring method, device and mobile terminal.Below will It is described in detail respectively.
Embodiment one,
Fig. 1 is please referred to, Fig. 1 is the stream of the first proximity sensor status information acquiring method provided in an embodiment of the present invention Cheng Tu.This method is used to obtain the status information of proximity sensor, and specific steps include:
Step S101 obtains proximity sensor based on the first interrupt signal generated close to distance threshold.
Step S102, according to the first interrupt signal, to being configured in proximity sensor close to distance threshold, so as to connect Nearly sensor generates the second interrupt signal according to after setting close to distance threshold.
Step S103, according to the second interrupt signal, working as between terminal and barrier that acquisition proximity sensor detects Preceding close distance.
Step S104, according to currently close to distance, obtaining the status information of corresponding proximity sensor.
The following detailed description of the specific stream of each step of the proximity sensor status information acquiring method of this preferred embodiment Journey.
In step S101, terminal obtains proximity sensor based on the first interrupt signal generated close to distance threshold.It connects Nearly sensor is to be detected based on infrared emitting principle close to distance, and what is such as detected is bigger close to distance, illustrate terminal The distance between barrier is nearer;Such as detect close to apart from smaller, illustrate that the distance between terminal and barrier are more remote.
It should be noted that first interrupt signal is included close to interrupt signal and far from interrupt signal.Believe close to interrupting The interrupt signal for number referring to terminal proximity sensor generating when having the barrier to block;Refer to that clear is blocked far from interrupt signal When proximity sensor generate interrupt signal.Specifically, can set it is one default close to distance range, when detect close to away from It is generated when generating close to interrupt signal from when this is preset close in distance range, but being preset more than this close to distance range separate Interrupt signal.Then continue at step S102.
In step s 102, according to the first interrupt signal, to being configured in proximity sensor close to distance threshold, with Proximity sensor is made to generate the second interrupt signal close to distance threshold according to after setting.In the prior art, only there is barrier Hinder object block in the case of proximity sensor could generate close to interruption, and can not generate far from interruption, cause in this way terminal without The status information of method quick obtaining proximity sensor.Therefore, in the preferred embodiment by close in proximity sensor Distance threshold is configured, to force that proximity sensor is made to generate interruption.
Specifically, this includes the first upper limit threshold and the first lower threshold close to distance threshold, as long as making after setting The first upper limit threshold perseverance be less than proximity values or setting after the first lower threshold perseverance be more than proximity values can make proximity sensor Forced interruption is generated, that is, generates the second interrupt signal, the first upper limit threshold is such as set as 0, the first lower threshold is set as 0xffff.It should be noted that the occurrence close to distance threshold is not defined in the present embodiment.Then continue at step S103。
In step s 103, terminal obtains terminal and barrier that proximity sensor detects according to the second interrupt signal Between it is current close to distance.Then according to currently corresponding status information is obtained close to distance, it is specifically shown in step S104.
In step S104, terminal is according to currently close to distance, obtaining the status information of corresponding proximity sensor.Its In, the status information of proximity sensor is included far from state and proximity state.When terminal has barrier to block, proximity sensor In proximity state;When terminal clear is blocked, proximity sensor is in far from state.It specifically, can be by judging to work as It is preceding whether in a certain default to determine the status information of proximity sensor close to distance range close to distance.
The proximity sensor status information acquiring method of the embodiment of the present invention using obtain proximity sensor be based on close to away from The first interrupt signal generated from threshold value;According to the first interrupt signal, to being set in proximity sensor close to distance threshold It puts, so that proximity sensor generates the second interrupt signal according to after setting close to distance threshold;According to the second interrupt signal, obtain It takes current close to distance between the terminal and barrier that proximity sensor detects;According to currently close to distance, acquisition corresponds to Proximity sensor status information.It is close to improve terminal acquisition by the way that proximity sensor is made to generate forced interruption for the program The speed of sensor status information.
Embodiment two,
Fig. 2 is please referred to, Fig. 2 is the stream of second of proximity sensor status information acquiring method provided in an embodiment of the present invention Cheng Tu.This method is used to obtain the status information of proximity sensor, and specific steps include:
Step S201 obtains proximity sensor based on the first interrupt signal generated close to distance threshold.
Step S202, according to the first interrupt signal, by the first upper limit threshold of proximity sensor and the first lower threshold into Row threshold value is exchanged.
Step S203, according to the second interrupt signal, working as between terminal and barrier that acquisition proximity sensor detects Preceding close distance.
Step S204 judges currently whether be more than the second upper limit threshold close to distance.
Step S205, such as larger than the second upper limit threshold then obtain the status information that proximity sensor is in proximity state.
Step S206, such as less than or equal to the second upper limit threshold then judge currently whether be less than the second lower limit close to distance Threshold value;Such as less than the second lower threshold then obtains proximity sensor and is in the status information far from state.
The following detailed description of the specific stream of each step of the proximity sensor status information acquiring method of this preferred embodiment Journey.
In step s 201, terminal obtains proximity sensor based on the first interrupt signal generated close to distance threshold.It connects Nearly sensor is to be detected based on infrared emitting principle close to distance, and what is such as detected is bigger close to distance, illustrate terminal The distance between barrier is nearer;Such as detect close to apart from smaller, illustrate that the distance between terminal and barrier are more remote.
It should be noted that first interrupt signal is included close to interrupt signal and far from interrupt signal.Believe close to interrupting The interrupt signal for number referring to terminal proximity sensor generating when having the barrier to block;Refer to that clear is blocked far from interrupt signal When proximity sensor generate interrupt signal.Specifically, can set it is one default close to distance range, when detect close to away from It is generated when generating close to interrupt signal from when this is preset close in distance range, but being preset more than this close to distance range separate Interrupt signal.Then continue at step S202.
In step S202, terminal, will be under the first upper limit threshold of proximity sensor and first according to the first interrupt signal It limits threshold value and carries out threshold value exchange, so that proximity sensor generates the second interrupt signal according to after exchange close to distance threshold. In the prior art, only in the case where there is barrier to block, proximity sensor could be generated close to interruption, and can not be generated remote From interruption, cause in this way terminal can not quick obtaining proximity sensor status information.Therefore, pass through in the preferred embodiment To being configured in proximity sensor close to distance threshold, to force that proximity sensor is made to generate interruption.
Specifically, if the first upper limit threshold of proximity sensor is 0xffff, the first lower threshold is 0, by this on first After limiting threshold value and the exchange of the first lower threshold, the first upper limit threshold is 0, and the first lower threshold is 0xffff, is got in this way It is current be centainly more than the first upper limit threshold close to distance or less than the first lower threshold, therefore proximity sensor will generate it is strong System is interrupted, that is, is generated the second interrupt signal, after such terminal receives the second interrupt signal, will quickly be obtained proximity sensor Status information.
Next, the status information for terminal will be discussed in detail in step S203-S207 how obtaining proximity sensor.
In step S203, terminal obtains terminal and barrier that proximity sensor detects according to the second interrupt signal Between it is current close to distance.Then this is currently compared close to distance with the second upper limit threshold, the second lower threshold, with Obtain the status information of proximity sensor.
Before this, first terminal is sampled to obtain second upper limit threshold and the second lower threshold.Terminal first Obtain in preset time between the terminal that detects of proximity sensor and barrier close to range information;Then from close to distance Minimum approach distance is obtained in information, the second upper limit threshold and the second lower threshold are set according to minimum approach distance.Below first The acquisition methods of the second upper limit threshold are discussed in detail, terminal first first connects what proximity sensor in preset time detected every time Analysis is closely compared, obtains the minimum close distance min_value close to based on distance;Again due to actual use Middle greasy dirt can impact the detection of proximity sensor, therefore can increase on basis close on the basis of distance min_value Add an adjusted value dirty_value to improve the second upper limit threshold accuracy, i.e. the second upper limit threshold is min_value+ dirty_value.Then the second lower threshold can be on the basis of second upper limit threshold min_value+dirty_value It subtracts a setting value set_value to obtain, i.e. the second lower threshold is min_value+dirty_value-set_value. Then continue at step S204.
In step S204, terminal judges currently whether be more than the second upper limit threshold, such as larger than second upper limit close to distance Threshold value is then transferred to step S205;Such as less than or equal to the second upper limit threshold is then transferred to step S206.
In step S205, as judged currently to be more than the second upper limit threshold close to distance in step S204, illustrate terminal quilt Barrier blocks, therefore terminal obtains the status information that proximity sensor is in proximity state.
In step S206, as judged currently to be less than or equal to the second upper limit threshold close to distance in step S204, then need Further currently whether less than the second lower threshold judge the state of proximity sensor close to distance by comparing;Such as less than Two lower thresholds illustrate that terminal is not blocked by barrier, therefore obtain proximity sensor and be in the status information far from state.
It should be noted that after terminal gets the status information of proximity sensor in step S205, step S206, The second interrupt signal of proximity sensor generation should be removed, to ensure that subsequent terminal normally obtains the state letter of proximity sensor Breath.
The proximity sensor status information acquiring method of the embodiment of the present invention using obtain proximity sensor be based on close to away from The first interrupt signal generated from threshold value;It, will be under the first upper limit threshold of proximity sensor and first according to the first interrupt signal It limits threshold value progress threshold value and exchanges setting, so that proximity sensor interrupts letter according to after exchange close to distance threshold generation second Number;It is current close to distance between terminal and barrier that acquisition proximity sensor detects according to the second interrupt signal;Judge It is current whether to be more than the second upper limit threshold close to distance;Such as larger than the second upper limit threshold then obtains proximity sensor and is in close The status information of state;Such as less than or equal to the second upper limit threshold then judges currently whether be less than the second lower limit threshold close to distance Value;Such as less than the second lower threshold then obtains proximity sensor and is in the status information far from state.The program passes through mutual changing-over The first upper limit threshold and the first lower threshold of nearly sensor are so that proximity sensor generates forced interruption, so as to improve terminal Obtain the speed of proximity sensor status information.
Embodiment three,
In order to preferably implement above method, the embodiment of the present invention also provides a kind of proximity sensor state information acquisition dress It puts, which can integrate in the terminal, which can be specifically smart mobile phone, tablet Apparatus such as computer.As shown in figure 3, the proximity sensor state information acquisition device 30 includes interrupt signal acquisition module 301, sets Put module 302, close to apart from acquisition module 303 and state information acquisition module 304.It is described in detail below:
Interrupt signal acquisition module interrupts letter for obtaining proximity sensor based on first generated close to distance threshold Number;
For according to first interrupt signal, this in the proximity sensor is carried out close to distance threshold for setup module Setting, so that the proximity sensor generates the second interrupt signal according to after the setting close to distance threshold;
It approaches apart from acquisition module, for according to second interrupt signal, obtaining the terminal that the proximity sensor detects It is current close to distance between barrier;
State information acquisition module, for, currently close to distance, obtaining the state letter of corresponding proximity sensor according to this Breath.
Specifically, this includes the first upper limit threshold and the first lower threshold close to distance threshold;The setup module 302 is specific For:
According to first interrupt signal, first upper limit threshold of the proximity sensor and first lower threshold are carried out Threshold value is exchanged.
Further, which includes:
First judging submodule, for judging that this is current close to apart from whether more than the second upper limit threshold;
Close to acquisition submodule, proximity state is in for when more than the second upper limit threshold, obtaining the proximity sensor Status information;
Second judgment submodule, for whether when less than or equal to the second upper limit threshold, judging the current close distance Less than second lower threshold;
Far from acquisition submodule, it is in for when less than the second lower threshold, obtaining the proximity sensor far from state Status information.
Further, which further includes:
Acquisition submodule, for obtaining between terminal and barrier that the proximity sensor in preset time detects Close to range information;
Submodule is set, for obtaining minimum approach distance close in range information from this, according to the minimum approach distance Second upper limit threshold and second lower threshold are set.
The proximity sensor state information acquisition device of the embodiment of the present invention using obtain proximity sensor be based on close to away from The first interrupt signal generated from threshold value;According to the first interrupt signal, to being set in proximity sensor close to distance threshold It puts, so that proximity sensor generates the second interrupt signal according to after setting close to distance threshold;According to the second interrupt signal, obtain It takes current close to distance between the terminal and barrier that proximity sensor detects;According to currently close to distance, acquisition corresponds to Proximity sensor status information.It is close to improve terminal acquisition by the way that proximity sensor is made to generate forced interruption for the program The speed of sensor status information.
Example IV,
The embodiment of the present invention also provides a kind of mobile terminal, which includes proximity sensor and approached with this The proximity sensor state information acquisition device of sensor connection.The proximity sensor state information acquisition device can be used for holding The proximity sensor status information acquiring method that the row embodiment of the present invention one and embodiment two provide, realization principle and technology effect Seemingly, details are not described herein again for fruit.
Correspondingly, with reference to attached drawing 4, Fig. 4 is a kind of structure diagram of mobile terminal provided in an embodiment of the present invention.The shifting Dynamic terminal 40 includes at least a processor 401, such as central processing unit (CPU, Central Processing Unit), until A few network interface 402, user interface 403, memory 404 and at least one communication bus 405.
Wherein, communication bus 405 is used to implement processor 401, the connection communication between 404 grade components of memory.Network Interface 402 is used to implement the connection communication between physical host and network, such as can be used for connecting physical network card and physical exchange The equipment such as machine;User interface 403 can include display screen, keyboard, while user interface 403 can be wireless interface, can also For wireline interface;Memory 404 can be high-speed memory or non-labile memory.
In some embodiments, memory 404 further includes operating system 4041 and application module 4042.Operating system 4041 contain various system programs, are used to implement various basic businesses and the hardware based business of processing;Application module 4042 include various application programs, are used to implement various applied business.
Specifically, processor 401 is used for according to first interrupt signal, to this in the proximity sensor close to apart from threshold Value is configured, so that the proximity sensor generates the second interrupt signal according to after the setting close to distance threshold;According to this Second interrupt signal obtains current close to distance between the terminal and barrier that the proximity sensor detects;According to deserve Preceding close distance obtains the status information of corresponding proximity sensor.
Specifically, this includes the first upper limit threshold and the first lower threshold close to distance threshold;The processor 401 is specifically used In:
According to first interrupt signal, first upper limit threshold of the proximity sensor and first lower threshold are carried out Threshold value is exchanged.
Further, which is used to judge that this is current close to apart from whether more than the second upper limit threshold;More than During the second upper limit threshold, the status information that the proximity sensor is in proximity state is obtained;Less than or equal to the second upper limit threshold During value, judge that this is current close to apart from whether less than second lower threshold;When less than the second lower threshold, it is close to obtain this Sensor is in the status information far from state.
Further, the processor 401 be additionally operable to obtain in preset time the terminal that detects of the proximity sensor with Between barrier close to range information;Minimum approach distance is obtained close in range information from this, according to the minimum close to away from From setting second upper limit threshold and second lower threshold.
The terminal of the embodiment of the present invention interrupts letter using proximity sensor is obtained based on first generated close to distance threshold Number;According to the first interrupt signal, to being configured in proximity sensor close to distance threshold, so that proximity sensor is according to setting What is postponed generates the second interrupt signal close to distance threshold;According to the second interrupt signal, the end that proximity sensor detects is obtained It is current close to distance between end and barrier;According to currently close to distance, obtaining the status information of corresponding proximity sensor. The program improves the speed that terminal obtains proximity sensor status information by the way that proximity sensor is made to generate forced interruption.
When it is implemented, Yi Shang modules can be independent entity to realize, arbitrary combination can also be carried out, is made It is realized for same or several entities, the specific implementation of more than modules can be found in the embodiment of the method for front, herein not It repeats again.
It should be noted that one of ordinary skill in the art will appreciate that whole in the various methods of above-described embodiment or Part steps are relevant hardware can be instructed to complete by program, which can be stored in computer-readable storage medium It in matter, is such as stored in the memory of terminal, and is performed by least one processor in the terminal, can be wrapped in the process of implementation Include the flow of the embodiment such as information issuing method.Wherein, storage medium can include:Read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc..
A kind of proximity sensor status information acquiring method provided in an embodiment of the present invention and device have been carried out in detail above Thin to introduce, each function module can be integrated in a processing chip or modules are individually physically present, and also may be used It is integrated in a module with two or more modules.The form realization of hardware had both may be used in above-mentioned integrated module, It can also be realized in the form of software function module.Specific case used herein is to the principle of the present invention and embodiment It is expounded, the explanation of above example is only intended to facilitate the understanding of the method and its core concept of the invention;Meanwhile for Those skilled in the art, thought according to the present invention, there will be changes, comprehensive in specific embodiments and applications Upper described, the content of the present specification should not be construed as limiting the invention.

Claims (6)

1. a kind of proximity sensor status information acquiring method, which is characterized in that including:
Obtain that proximity sensor detects close to distance, obtain proximity sensor and be based on the close distance and close to apart from threshold It is worth the first interrupt signal generated, first interrupt signal is included close to interrupt signal and far from interrupt signal;
It is described to include the first upper limit threshold and the first lower threshold close to distance threshold, according to first interrupt signal, to institute State in proximity sensor it is described be configured close to distance threshold, by first upper limit threshold of the proximity sensor and First lower threshold carries out threshold value exchange, and the first upper limit threshold perseverance after setting is less than the close distance or sets The the first lower threshold perseverance postponed is more than the close distance, so that the proximity sensor is according to connecing after the setting Closely threshold value generates the second interrupt signal;
According to second interrupt signal, obtain current close between the terminal and barrier that the proximity sensor detects Distance, wherein, described current bigger close to distance, then the distance between the proximity sensor and barrier are nearer, described to work as It is preceding close to apart from smaller, then the distance between the proximity sensor and barrier are more remote;
According to described currently close to distance and default close to distance range, the status information of corresponding proximity sensor, institute are obtained Status information is stated to include far from state and proximity state.
2. proximity sensor status information acquiring method according to claim 1, which is characterized in that work as described in the basis The step of preceding close distance, the status information for obtaining corresponding proximity sensor, specifically includes:
Obtain multiple close distance letters between the terminal and barrier that the proximity sensor detects in preset time Breath;
Minimum approach distance is obtained close in range information from the multiple, is set according to the minimum approach distance and adjusted value Second upper limit threshold and the second lower threshold;
Judge described current close to apart from whether more than the second upper limit threshold;
Such as larger than the second upper limit threshold then obtains the status information that the proximity sensor is in proximity state;
Whether such as less than or equal to the second upper limit threshold then judges described current close to apart from less than second lower threshold;
Such as less than the second lower threshold then obtains the proximity sensor and is in the status information far from state.
3. proximity sensor status information acquiring method according to claim 1, which is characterized in that work as described in the basis Preceding close distance further includes after the step of obtaining the status information of corresponding proximity sensor:
Remove the second interrupt signal that the proximity sensor generates.
4. a kind of proximity sensor state information acquisition device, which is characterized in that include the first upper limit threshold close to distance threshold With the first lower threshold, described device includes:
Interrupt signal acquisition module for obtaining that proximity sensor detects close to distance, obtains proximity sensor and is based on institute State close to distance and close to the first interrupt signal that distance threshold generates, first interrupt signal include close to interrupt signal and Far from interrupt signal;
Setup module, for according to first interrupt signal, in the proximity sensor it is described close to distance threshold into First upper limit threshold of the proximity sensor and first lower threshold are carried out threshold value exchange, setting by row setting The first lower threshold perseverance that the first upper limit threshold perseverance afterwards is less than after the proximity values or setting is more than described close Value, so that the proximity sensor generates the second interrupt signal according to after the setting close to distance threshold;
It approaches apart from acquisition module, for according to second interrupt signal, obtaining the terminal that the proximity sensor detects It is current close to distance between barrier, wherein, the current close distance is bigger, then the proximity sensor and barrier The distance between it is nearer, described current close to apart from smaller, then the distance between the proximity sensor and barrier are more remote;
State information acquisition module, for, currently close to distance and default close to distance range, obtaining corresponding connects according to described The status information of nearly sensor, the status information are included far from state and proximity state.
5. proximity sensor state information acquisition device according to claim 4, which is characterized in that the status information obtains Modulus block includes:
Acquisition submodule, for obtaining between the terminal and barrier that the proximity sensor in preset time detects It is multiple close to range information;
Submodule is set, for obtaining minimum approach distance close in range information from described, according to the minimum approach distance The second upper limit threshold and the second lower threshold are set with adjusted value;
First judging submodule, it is described current close to apart from whether more than the second upper limit threshold for judging;
Close to acquisition submodule, proximity state is in for when more than the second upper limit threshold, obtaining the proximity sensor Status information;
Whether second judgment submodule is described current small close to distance for when less than or equal to the second upper limit threshold, judging In second lower threshold;
Far from acquisition submodule, it is in for when less than the second lower threshold, obtaining the proximity sensor far from state Status information.
6. a kind of mobile terminal, which is characterized in that connect including proximity sensor and with the proximity sensor close to biography Sensor state information acquisition device includes the first upper limit threshold and the first lower threshold close to distance threshold, wherein, it is described close Sensor status information acquisition device includes:
Interrupt signal acquisition module for obtaining that proximity sensor detects close to distance, obtains proximity sensor and is based on institute State close to distance and close to the first interrupt signal that distance threshold generates, first interrupt signal include close to interrupt signal and Far from interrupt signal;
Setup module, for according to first interrupt signal, in the proximity sensor it is described close to distance threshold into First upper limit threshold of the proximity sensor and first lower threshold are carried out threshold value exchange, setting by row setting The first lower threshold perseverance that the first upper limit threshold perseverance afterwards is less than after the close distance or setting is more than described connect Closely, so that the proximity sensor generates the second interrupt signal according to after the setting close to distance threshold;
It approaches apart from acquisition module, for according to second interrupt signal, obtaining the terminal that the proximity sensor detects It is current close to distance between barrier, wherein, the current close distance is bigger, then the proximity sensor and barrier The distance between it is nearer, described current close to apart from smaller, then the distance between the proximity sensor and barrier are more remote;
State information acquisition module, for, currently close to distance and default close to distance range, obtaining corresponding connects according to described The status information of nearly sensor, the status information are included far from state and proximity state.
CN201610662567.4A 2016-08-12 2016-08-12 A kind of proximity sensor status information acquiring method, device and mobile terminal Active CN106325541B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610662567.4A CN106325541B (en) 2016-08-12 2016-08-12 A kind of proximity sensor status information acquiring method, device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610662567.4A CN106325541B (en) 2016-08-12 2016-08-12 A kind of proximity sensor status information acquiring method, device and mobile terminal

Publications (2)

Publication Number Publication Date
CN106325541A CN106325541A (en) 2017-01-11
CN106325541B true CN106325541B (en) 2018-07-03

Family

ID=57740243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610662567.4A Active CN106325541B (en) 2016-08-12 2016-08-12 A kind of proximity sensor status information acquiring method, device and mobile terminal

Country Status (1)

Country Link
CN (1) CN106325541B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203446B (en) * 2017-05-24 2020-12-01 歌尔光学科技有限公司 Method and system for testing virtual reality equipment wakeup time

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010167522A (en) * 2009-01-21 2010-08-05 Okuma Corp Slip detection apparatus in machine tool
CN105842680A (en) * 2016-03-16 2016-08-10 广东欧珀移动通信有限公司 Data processing method and apparatus thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010167522A (en) * 2009-01-21 2010-08-05 Okuma Corp Slip detection apparatus in machine tool
CN105842680A (en) * 2016-03-16 2016-08-10 广东欧珀移动通信有限公司 Data processing method and apparatus thereof

Also Published As

Publication number Publication date
CN106325541A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
US10048804B2 (en) Method for preventing false touches on terminal and terminal
CN103635873B (en) touch operation processing method and terminal device
US20160349983A1 (en) Terminal screen shot method and terminal
CN103440092B (en) A kind of processing method returning button, system and mobile terminal
CN102830931A (en) Method for checking notification information of smart terminal by shaking
US20140002396A1 (en) Information processing method, information processing apparatus and electronic device
TWI695311B (en) Method, device and terminal for simulating mouse operation using gestures
CN104866225A (en) Electronic device having touch display screen and control method therefor
CN104182068A (en) Error touch identifying method and device
CN106657472A (en) handheld terminal and control method thereof
KR101870392B1 (en) Method for processing touch signal and terminal device
CN106200878A (en) Fingerprint control method, device and mobile terminal
CN107045421A (en) Screen switching and mobile terminal
CN104769601A (en) Method for recognition of user identity and electronic equipment
CN107025002A (en) Terminal applies control method, device and terminal
CN103518177B (en) Information processor, the control method of information processor, program and information storage medium
CN104123072A (en) Method and device for providing virtual keyboard in mobile device
CN106325541B (en) A kind of proximity sensor status information acquiring method, device and mobile terminal
CN108270921B (en) Falling information detection method and related product
CN108076300A (en) Video record processing method, record processing device and mobile terminal
CN105739776B (en) A kind of calibration method of pressure value, device and mobile terminal
CN104898838B (en) The incoming call response method and device of handheld device
US20160379033A1 (en) Interaction method and apparatus
WO2023246714A1 (en) State determination method and apparatus, electronic device, and readable storage medium
CN108777735A (en) Display area method of adjustment and relevant device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: Guangdong Opel Mobile Communications Co., Ltd.

CP01 Change in the name or title of a patent holder