CN106598358B - Proximity detection method and device and terminal - Google Patents

Proximity detection method and device and terminal Download PDF

Info

Publication number
CN106598358B
CN106598358B CN201611108002.8A CN201611108002A CN106598358B CN 106598358 B CN106598358 B CN 106598358B CN 201611108002 A CN201611108002 A CN 201611108002A CN 106598358 B CN106598358 B CN 106598358B
Authority
CN
China
Prior art keywords
detection result
signal
detection
signal receiver
terminal
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.)
Expired - Fee Related
Application number
CN201611108002.8A
Other languages
Chinese (zh)
Other versions
CN106598358A (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 CN201611108002.8A priority Critical patent/CN106598358B/en
Publication of CN106598358A publication Critical patent/CN106598358A/en
Application granted granted Critical
Publication of CN106598358B publication Critical patent/CN106598358B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/042Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means by opto-electronic means
    • G06F3/0421Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means by opto-electronic means by interrupting or reflecting a light beam, e.g. optical touch-screen

Abstract

The embodiment of the invention provides a proximity detection method, a proximity detection device and a terminal, wherein the method adopts a first signal emitter to emit a detection signal; the signal receiver acquires a first detection result; the second signal emitter emits a detection signal; the signal receiver obtains a second detection result; judging whether the first detection result is the same as the second detection result to obtain a judgment result; and determining the approaching or separating state between the terminal and the external object according to the judgment result. According to the scheme, the two signal transmitters are adopted to respectively transmit the detection signals and respectively acquire the detection results twice, the approaching or far-away state between the terminal and the external object is determined based on whether the detection results twice are the same, the inaccuracy of the detection result when a single signal transmitter is used can be avoided, and the accuracy of the approaching or far-away state between the detection terminal and the external object can be improved.

Description

Proximity detection method and device and terminal
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to a proximity detection method, an apparatus, and a terminal.
Background
With the rapid development of terminal technology, mobile terminals are becoming more and more popular and become indispensable devices in people's lives. People can learn, entertain and the like through the mobile terminal.
Currently, mobile terminals have proximity sensors therein. The proximity sensor is arranged below the glass cover plate. The proximity sensor is used to determine whether the mobile terminal is in a close state or a distant state from an external object. The proximity sensor includes an infrared emitter and an infrared receiver. The infrared emitter emits infrared rays outwards, the infrared rays form reflected light after being reflected by an external object, the infrared receiver receives the reflected light, and then whether the mobile terminal is in a close state or a far state with the external object is judged according to the intensity of the received reflected light.
In practical applications, there are situations where the infrared emitter fails. Once the infrared emitter fails, the detection of the proximity sensor may be inaccurate, and the detection of the proximity or distance state between the mobile terminal and the external object may be inaccurate.
Disclosure of Invention
The embodiment of the invention provides a proximity detection method, a proximity detection device and a terminal, which can improve the accuracy of detecting the proximity or distance state between the terminal and an external object.
The embodiment of the invention provides a proximity detection method, which is applied to a terminal, wherein the terminal comprises a first signal transmitter, a second signal transmitter and a signal receiver, and the proximity detection method comprises the following steps:
the first signal emitter emits a detection signal;
the signal receiver obtains a first detection result;
the second signal emitter emits a detection signal
The signal receiver obtains a second detection result;
judging whether the first detection result is the same as the second detection result to obtain a judgment result;
and determining the approaching or separating state between the terminal and the external object according to the judgment result.
Correspondingly, an embodiment of the present invention further provides a proximity detection apparatus, which is applied to a terminal, where the terminal includes a first signal transmitter, a second signal transmitter, and a signal receiver, and the proximity detection apparatus includes:
the first acquisition module is used for acquiring a first detection result by the signal receiver when the first signal transmitter transmits a detection signal;
the second acquisition module is used for acquiring a second detection result by the signal receiver when the second signal transmitter transmits the detection signal;
the first judgment module is used for judging whether the first detection result is the same as the second detection result or not so as to obtain a judgment result;
and the first determining module is used for determining the approaching or departing state between the terminal and the external object according to the judgment result.
Correspondingly, an embodiment of the present invention further provides a terminal, including:
a proximity sensor for detecting a proximity or distant state between the terminal and an external object;
a memory storing executable program code;
a processor coupled to the memory;
the processor calls the executable program code stored in the memory to execute the proximity detection method.
The embodiment of the invention adopts a first signal emitter to emit a detection signal; the signal receiver acquires a first detection result; the second signal emitter emits a detection signal; the signal receiver obtains a second detection result; judging whether the first detection result is the same as the second detection result to obtain a judgment result; and determining the approaching or separating state between the terminal and the external object according to the judgment result. According to the scheme, the two signal transmitters are adopted to respectively transmit the detection signals and respectively acquire the detection results twice, the approaching or far-away state between the terminal and the external object is determined based on whether the detection results twice are the same, the inaccuracy of the detection result when a single signal transmitter is used can be avoided, and the accuracy of the approaching or far-away state between the detection terminal and the external object can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic flow chart of a proximity detection method according to an embodiment of the present invention.
Fig. 2 is a schematic view of an application scenario of the proximity detection method according to the embodiment of the present invention.
Fig. 3 is a schematic view of another application scenario of the proximity detection method according to the embodiment of the present invention.
Fig. 4 is another schematic flow chart of a proximity detection method according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a proximity detection device according to an embodiment of the present invention.
Fig. 6 is another schematic structural diagram of a proximity detection device according to an embodiment of the present invention.
Fig. 7 is a schematic view of another structure of the proximity detection device according to the embodiment of the present invention.
Fig. 8 is a schematic view of another structure of the proximity detection device according to the embodiment of the present invention.
Fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Fig. 10 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the objects so described are interchangeable under appropriate circumstances. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, or apparatus, terminal, system comprising a list of steps is not necessarily limited to those steps or modules or elements expressly listed, and may include other steps or modules or elements not expressly listed, or inherent to such process, method, apparatus, terminal, or system.
Embodiments of the present invention provide a proximity detection method, a proximity detection device, and a terminal, which will be described in detail below.
A proximity detection method may be applied in a terminal including a first signal transmitter, a second signal transmitter, and a signal receiver. The terminal can be a smart phone, a tablet computer and other devices.
As shown in fig. 1, the proximity detection method may include the steps of:
s110, the first signal emitter emits a detection signal, and the signal receiver obtains a first detection result.
And S120, the second signal emitter emits a detection signal, and the signal receiver acquires a second detection result.
In practical application, a proximity sensor is arranged on the terminal. The proximity sensor includes a signal transmitter and a signal receiver. The signal transmitter is used for transmitting signals, and the signal receiver is used for receiving reflected signals formed after the signals are reflected by external objects. The signal may be an optical signal or an acoustic signal. For example, the signal may be infrared light, laser light, or ultrasonic wave.
Referring to fig. 2 and 3, in the present embodiment, the proximity sensor includes a signal transmitter and a signal receiver. The signal transmitter comprises a first signal transmitter and a second signal transmitter, and the signal receiver comprises a first signal receiver and a second signal receiver. First, a first signal emitter emits a signal outwards. The signal is reflected by an external object to form a reflected signal. The first signal receiver and the second signal receiver receive the reflected signals, respectively. The distance between the first signal receiver and the first signal transmitter and the distance between the second signal receiver and the first signal transmitter are different, and therefore the signal strength received by the first signal receiver and the second signal receiver is different.
After the first signal receiver and the second signal receiver receive the reflected signals, a first detection result is obtained according to the received reflected signals. The detection result is in a close state or a distant state.
Then, the first signal emitter is turned off, and the second signal emitter is switched to emit signals outwards. Similarly, the signal is reflected by an external object to form a reflected signal. The first signal receiver and the second signal receiver receive the reflected signal. Moreover, the distance between the first signal receiver and the second signal transmitter is different from the distance between the second signal receiver and the second signal transmitter, so that the signal strength received by the first signal receiver and the second signal receiver is also different.
And after the first signal receiver and the second signal receiver receive the reflected signals, acquiring a second detection result according to the received reflected signals. The detection result is in a close state or a distant state.
Wherein a signal strength threshold may be set in the terminal in advance. When the signal intensity value received by the signal receiver is greater than or equal to the threshold value, the detection result is in an approaching state; when the signal intensity is smaller than the threshold value, the detection result is in a far state.
After the first signal receiver and the second signal receiver receive the reflected signals, the intensity of the received reflected signals is compared with the threshold value respectively to obtain respective detection results. When the detection result of at least one of the first signal receiver and the second signal receiver is in the proximity state, the detection result acquired by the signal receiver is in the proximity state. When the detection results of the first signal receiver and the second signal receiver are both in the remote state, the detection result acquired by the signal receiver is in the remote state.
In practical application, when the first signal transmitter transmits a detection signal, if a detection result of at least one of the first signal receiver and the second signal receiver is in a proximity state, the first detection result is in the proximity state; if the detection results of the first signal receiver and the second signal receiver are both in the remote state, the first detection result is in the remote state.
When the second signal emitter emits the detection signal, if the detection result of at least one of the first signal receiver and the second signal receiver is in the proximity state, the second detection result is in the proximity state; and if the detection results of the first signal receiver and the second signal receiver are both in the remote state, the second detection result is in the remote state.
For example, the preset signal strength threshold is 500. When the first signal transmitter transmits the probe signal, if the signal strength received by the first signal receiver is 600 and the signal strength received by the second signal receiver is 400, the detection result of the first signal receiver is in the close state and the detection result of the second signal receiver is in the far state. At this time, the first detection result is in a proximity state.
Referring to fig. 1 and 4 together, in some embodiments, before the second signal transmitter transmits the probe signal and the signal receiver obtains the second detection result, the proximity detection method may further include the following steps:
s150, acquiring the motion parameters of the terminal;
s160, judging whether the state of the terminal is changed according to the motion parameters;
if not, the second signal emitter emits a detection signal, and the signal receiver acquires a second detection result.
The motion parameters may include acceleration and angular velocity of the terminal, among others. The state of the terminal may include a position of the terminal and a posture of the terminal. In practical application, the terminal is provided with an acceleration sensor and a gyroscope. The acceleration sensor may be used to acquire an acceleration of the terminal. The gyroscope may be used to obtain the angular velocity of the terminal.
If the acceleration of the terminal changes, the speed of the terminal changes, that is, the position of the terminal changes. If the angular velocity of the terminal changes, the posture of the terminal changes. And after the terminal acquires the motion parameters, judging whether the motion parameters change. When neither the acceleration nor the angular velocity of the terminal has changed, it can be determined that the state of the terminal has not changed. Subsequently, the transmission of the probe signal by the first signal transmitter is switched to the transmission of the probe signal by the second signal transmitter. If the state of the terminal is determined to have changed, the process may be terminated and the proximity detection method may be restarted.
S130, judging whether the first detection result is the same as the second detection result to obtain a judgment result.
In practical application, after acquiring a first detection result and a second detection result, the terminal compares the first detection result with the second detection result to determine whether the first detection result and the second detection result are the same, and obtains a determination result.
And S140, determining the approaching or separating state between the terminal and the external object according to the judgment result.
In practical applications, after the determination result is obtained in S130, the terminal determines the approaching or departing state between the terminal and the external object according to the determination result.
In some embodiments, determining the approaching or departing state between the terminal and the external object according to the determination result may include:
s141, when the first detection result is the same as the second detection result, determining the first detection result or the second detection result as a close or distant state between the terminal and an external object;
s142, when the first detection result is different from the second detection result, the first signal transmitter and the second signal transmitter transmit the detection signal simultaneously, and the signal receiver obtains a third detection result;
s143, determining the third detection result as an approaching or separating state between the terminal and the external object.
In practical applications, when the first detection result is the same as the second detection result, any one of the first detection result and the second detection result may be determined as a close or distant state between the terminal and an external object. For example, if the first detection result and the second detection result are both in the proximity state, it may be determined that the terminal and the external object are in the proximity state.
Since the state of the terminal is not changed in the two detection processes, the two detection results should be the same theoretically. Therefore, when the first detection result and the second detection result are different, it can be understood that the detection result of one of them is inaccurate. At this time, the first signal emitter and the second signal emitter simultaneously emit the probe signal to perform the third detection. The signal receiver receives the reflected signal and obtains a third detection result. The process of obtaining the third detection result is substantially the same as the process of obtaining the first detection result and the second detection result, and is not described herein again.
And after the third detection result is obtained, determining the third detection result as the approaching or departing state between the terminal and the external object. For example, if the third detection result is a distant state, it may be determined that the terminal and the external object are in a distant state.
After the approaching or departing state between the terminal and the external object is determined, the terminal can be correspondingly controlled. For example, when the terminal is in a close state with an external object, the display screen can be turned off; when the terminal is far away from the external object, the display screen can be lightened.
In some embodiments, after determining the approaching or departing state between the terminal and the external object according to the determination result, the method may further include:
s170, comparing the third detection result with the first detection result to obtain a comparison result;
s171, when the third detection result is the same as the first detection result, determining that the second signal transmitter is malfunctioning;
and S172, when the third detection result is different from the first detection result, determining that the first signal transmitter has a fault.
In practical application, after the approaching or departing state between the terminal and the external object is determined, the third detection result is further compared with the first detection result. Since the first signal emitter and the second signal emitter are used simultaneously in the third detection process, it can be understood that the third detection result is accurate. When the third detection result is the same as the first detection result, indicating that the second detection result is inaccurate, it may be determined that the second signal transmitter is malfunctioning. When the third detection result is different from the first detection result, the first detection result is inaccurate, and the first signal transmitter is determined to be in fault.
In some embodiments, the third detection result may also be compared to the second detection result. When the third detection result is the same as the second detection result, indicating that the first detection result is inaccurate, it can be determined that the first signal transmitter is malfunctioning. When the third detection result is different from the second detection result, the second detection result is inaccurate, and the second signal transmitter can be determined to be in fault.
In some embodiments, after determining that the first signal transmitter is faulty or the second signal transmitter is faulty, the method may further include:
s180, acquiring preset prompt information;
and S190, displaying the preset prompt message on the terminal.
The preset prompting information can be information stored in the terminal memory in advance. The preset prompt message is used to cause a malfunction of a signal transmitter for use in the proximity sensor so that a user can take measures such as replacement or repair. For example, the preset prompting message may be "the signal transmitter is out of order, please replace in time", etc.
And after the terminal determines that the first signal transmitter fails or the second signal transmitter fails, calling the preset prompt information from a memory of the terminal, and displaying the preset prompt information on the terminal.
In particular, the present invention is not limited by the execution sequence of the steps, and some steps may be performed in other sequences or simultaneously without conflict.
As can be seen from the above, in the proximity detection method provided in the embodiment of the present invention, the first signal transmitter transmits the probe signal; the signal receiver acquires a first detection result; the second signal emitter emits a detection signal; the signal receiver acquires a second detection result; judging whether the first detection result is the same as the second detection result to obtain a judgment result; and determining the approaching or separating state between the terminal and the external object according to the judgment result. According to the scheme, the two signal transmitters are used for respectively transmitting the detection signals and respectively acquiring the detection results twice, the approaching or far-away state between the terminal and the external object is determined based on whether the detection results twice are the same, the inaccuracy of the detection result when a single signal transmitter is used can be avoided, and the accuracy of the approaching or far-away state between the detection terminal and the external object can be improved.
The embodiment of the invention also provides a proximity detection device, which can be applied to a terminal, wherein the terminal comprises a first signal transmitter, a second signal transmitter and a signal receiver. The terminal can be a smart phone, a tablet computer and other devices.
As shown in fig. 5, the proximity detection apparatus 200 may include: a first obtaining module 201, a second obtaining module 202, a first judging module 203, and a first determining module 204.
The first obtaining module 201 is configured to, when the first signal transmitter transmits the probe signal, obtain a first detection result by the signal receiver;
the second obtaining module 202 is configured to obtain a second detection result by the signal receiver when the second signal transmitter transmits the probe signal.
In practical application, a proximity sensor is arranged on the terminal. The proximity sensor includes a signal transmitter and a signal receiver. The signal transmitter is used for transmitting signals, and the signal receiver is used for receiving reflected signals formed after the signals are reflected by external objects. The signal may be an optical signal or an acoustic signal. For example, the signal may be infrared light, laser light, or ultrasonic wave.
In the present embodiment, the proximity sensor includes a signal transmitter and a signal receiver. The signal transmitter comprises a first signal transmitter and a second signal transmitter, and the signal receiver comprises a first signal receiver and a second signal receiver. First, a first signal emitter emits a signal outwards. The signal is reflected by an external object to form a reflected signal. The first signal receiver and the second signal receiver receive the reflected signals, respectively. The distance between the first signal receiver and the first signal transmitter and the distance between the second signal receiver and the first signal transmitter are different, and therefore the signal strength received by the first signal receiver and the second signal receiver is different.
After the first signal receiver and the second signal receiver receive the reflected signals, a first detection result is obtained according to the received reflected signals. The detection result is in a close state or a distant state.
Then, the first signal emitter is turned off, and the second signal emitter is switched to emit signals outwards. Similarly, the signal is reflected by an external object to form a reflected signal. The first signal receiver and the second signal receiver receive the reflected signal. Moreover, the distance between the first signal receiver and the second signal transmitter is different from the distance between the second signal receiver and the second signal transmitter, so that the signal strength received by the first signal receiver and the second signal receiver is also different.
And after the first signal receiver and the second signal receiver receive the reflected signals, acquiring a second detection result according to the received reflected signals. The detection result is in a close state or a distant state.
Wherein a signal strength threshold may be set in the terminal in advance. When the signal intensity value received by the signal receiver is greater than or equal to the threshold value, the detection result is in an approaching state; when the signal intensity is smaller than the threshold value, the detection result is in a far state.
After the first signal receiver and the second signal receiver receive the reflected signals, the intensity of the received reflected signals is compared with the threshold value respectively to obtain respective detection results. When the detection result of at least one of the first signal receiver and the second signal receiver is in the proximity state, the detection result acquired by the signal receiver is in the proximity state. When the detection results of the first signal receiver and the second signal receiver are both in the remote state, the detection result acquired by the signal receiver is in the remote state.
In practical application, when the first signal transmitter transmits a detection signal, if a detection result of at least one of the first signal receiver and the second signal receiver is in a proximity state, the first detection result is in the proximity state; if the detection results of the first signal receiver and the second signal receiver are both in the remote state, the first detection result is in the remote state.
When the second signal emitter emits the detection signal, if the detection result of at least one of the first signal receiver and the second signal receiver is in the proximity state, the second detection result is in the proximity state; and if the detection results of the first signal receiver and the second signal receiver are both in the remote state, the second detection result is in the remote state.
For example, the preset signal strength threshold is 500. When the first signal transmitter transmits the probe signal, if the signal strength received by the first signal receiver is 600 and the signal strength received by the second signal receiver is 400, the detection result of the first signal receiver is in the close state and the detection result of the second signal receiver is in the far state. At this time, the first detection result is in a proximity state.
In some embodiments, as shown in fig. 6, the proximity detection device further includes: a fourth obtaining module 205 and a second judging module 206.
The fourth obtaining module 205 is configured to obtain a motion parameter of the terminal;
the second determining module 206, configured to determine whether the state of the terminal changes according to the motion parameter;
the second obtaining module 202 is configured to, when the second determining module 206 determines that the second signal is not detected, transmit a probe signal by the second signal transmitter, and obtain a second detection result by the signal receiver.
The motion parameters may include acceleration and angular velocity of the terminal, among others. The state of the terminal may include a position of the terminal and a posture of the terminal. In practical application, the terminal is provided with an acceleration sensor and a gyroscope. The acceleration sensor may be used to acquire an acceleration of the terminal. The gyroscope may be used to obtain the angular velocity of the terminal.
If the acceleration of the terminal changes, the speed of the terminal changes, that is, the position of the terminal changes. If the angular velocity of the terminal changes, the posture of the terminal changes. After the fourth obtaining module 205 obtains the motion parameter of the terminal, the second determining module 206 determines whether the motion parameter changes. When neither the acceleration nor the angular velocity of the terminal has changed, it can be determined that the state of the terminal has not changed. Subsequently, the transmission of the probe signal by the first signal transmitter is switched to the transmission of the probe signal by the second signal transmitter. If the state of the terminal is determined to have changed, the process may be terminated and the proximity detection method may be restarted.
The first determining module 203 is configured to determine whether the first detection result is the same as the second detection result to obtain a determination result.
In practical applications, after obtaining the first detection result and the second detection result, the first determining module 203 compares the first detection result with the second detection result to determine whether the first detection result is the same as the second detection result, and obtains a determination result.
The first determining module 204 is configured to determine a proximity or a distance state between the terminal and the external object according to the determination result.
In practical applications, after the first determining module 203 obtains the determination result, the first determining module 204 determines the approaching or departing state between the terminal and the external object according to the determination result.
In some embodiments, the first determination module 204 is configured to perform the following steps:
determining the first detection result or the second detection result as a close or far state between the terminal and an external object when the first detection result is the same as the second detection result;
when the first detection result is different from the second detection result, the first signal transmitter and the second signal transmitter simultaneously transmit detection signals, and the signal receiver acquires a third detection result;
the third detection result is determined as a close or distant state between the terminal and the external object.
In practical applications, when the first detection result is the same as the second detection result, any one of the first detection result and the second detection result may be determined as a close or distant state between the terminal and an external object. For example, if the first detection result and the second detection result are both in the proximity state, it may be determined that the terminal and the external object are in the proximity state.
Since the state of the terminal is not changed in the two detection processes, the two detection results should be the same theoretically. Therefore, when the first detection result and the second detection result are different, it can be understood that the detection result of one of them is inaccurate. At this time, the first signal emitter and the second signal emitter simultaneously emit the probe signal to perform the third detection. The signal receiver receives the reflected signal and obtains a third detection result. The process of obtaining the third detection result is substantially the same as the process of obtaining the first detection result and the second detection result, and is not described herein again.
And after the third detection result is obtained, determining the third detection result as the approaching or departing state between the terminal and the external object. For example, if the third detection result is a distant state, it may be determined that the terminal and the external object are in a distant state.
After the approaching or departing state between the terminal and the external object is determined, the terminal can be correspondingly controlled. For example, when the terminal is in a close state with an external object, the display screen can be turned off; when the terminal is far away from the external object, the display screen can be lightened.
In some embodiments, as shown in fig. 7, the proximity detection apparatus 200 further includes: a comparison module 207, a second determination module 208.
The comparing module 207 is configured to compare the third detection result with the first detection result to obtain a comparison result;
the second determining module 208 is configured to determine that the second signal transmitter is faulty when the third detection result is the same as the first detection result; and when the third detection result is different from the first detection result, determining that the first signal transmitter is in fault.
In practical applications, after the first determining module 204 determines the approaching or departing state between the terminal and the external object, the comparing module 207 further compares the third detection result with the first detection result. Since the first signal emitter and the second signal emitter are used simultaneously in the third detection process, it can be understood that the third detection result is accurate. When the third detection result is the same as the first detection result, indicating that the second detection result is inaccurate, the second determination module 208 may determine that the second signal transmitter is malfunctioning. When the third detection result is different from the first detection result, indicating that the first detection result is inaccurate, the second determination module 208 may determine that the first signal transmitter is malfunctioning.
In some embodiments, the third detection result may also be compared to the second detection result. When the third detection result is the same as the second detection result, indicating that the first detection result is inaccurate, it can be determined that the first signal transmitter is malfunctioning. When the third detection result is different from the second detection result, the second detection result is inaccurate, and the second signal transmitter can be determined to be in fault.
In some embodiments, as shown in fig. 8, the proximity detection apparatus 200 further includes: a third acquisition module 209 and a display module 210.
The third obtaining module 209 is configured to obtain a preset prompt message;
the display module 210 is configured to display the preset prompting message on the terminal.
The preset prompting information can be information stored in the terminal memory in advance. The preset prompt message is used to cause a malfunction of a signal transmitter for use in the proximity sensor so that a user can take measures such as replacement or repair. For example, the preset prompting message may be "the signal transmitter is out of order, please replace in time", etc.
After the second determining module 208 determines that the first signal transmitter fails or the second signal transmitter fails, the third obtaining module 209 retrieves the preset prompting message from the memory of the terminal, and the display module 210 displays the preset prompting message on the terminal.
In specific implementation, the modules may be implemented as independent entities, or may be combined arbitrarily and implemented as one or several entities.
As can be seen from the above, in the proximity detection apparatus 200 according to the embodiment of the present invention, when the first obtaining module 201 transmits the detection signal by the first signal transmitter, the signal receiver obtains the first detection result; when the second obtaining module 202 sends the detection signal to the second signal transmitter, the signal receiver obtains a second detection result; the first determining module 203 determines whether the first detection result is the same as the second detection result to obtain a determination result; the first determination module 204 determines the approaching or departing state between the terminal and the external object according to the determination result. According to the scheme, the two signal transmitters are used for respectively transmitting the detection signals and respectively acquiring the detection results twice, the approaching or far-away state between the terminal and the external object is determined based on whether the detection results twice are the same, the inaccuracy of the detection result when a single signal transmitter is used can be avoided, and the accuracy of the approaching or far-away state between the detection terminal and the external object can be improved.
The embodiment of the invention also provides a terminal which can be equipment such as a smart phone and a tablet personal computer.
As shown in fig. 9, the terminal 300 may include: a first obtaining module 301, a second obtaining module 302, a first judging module 303, and a first determining module 304.
The first obtaining module 301 is configured to, when the first signal transmitter transmits the probe signal, obtain a first detection result by the signal receiver;
the second obtaining module 302 is configured to obtain a second detection result by the signal receiver when the second signal transmitter transmits the probe signal;
the first determining module 303 is configured to determine whether the first detection result is the same as the second detection result to obtain a determination result;
the first determining module 304 is configured to determine a proximity or a distance state between the terminal and the external object according to the determination result.
In some embodiments, the first determination module 304 is configured to:
and when the judgment result is that the first detection result is the same as the second detection result, determining the first detection result or the second detection result as the approaching or departing state between the terminal and the external object.
In some embodiments, the first determination module 304 is configured to:
when the judgment result is that the first detection result is different from the second detection result, the first signal transmitter and the second signal transmitter simultaneously transmit detection signals, and the signal receiver acquires a third detection result;
the third detection result is determined as a close or distant state between the terminal and the external object.
In some embodiments, the terminal 300 further comprises: the comparison module and the second determination module.
The comparison module is used for comparing the third detection result with the first detection result to obtain a comparison result;
the second determining module is configured to determine that the second signal transmitter fails when the comparison result is that the third detection result is the same as the first detection result, and determine that the first signal transmitter fails when the comparison result is that the third detection result is different from the first detection result.
In some embodiments, the terminal 300 further comprises: the third acquisition module and the display module.
The third acquisition module is used for acquiring preset prompt information;
the display module is used for displaying the preset prompt message on the terminal.
In some embodiments, the terminal 300 further comprises: the fourth acquisition module and the second judgment module.
The fourth obtaining module is used for obtaining the motion parameters of the terminal;
the second judging module is used for judging whether the state of the terminal changes according to the motion parameters;
the second obtaining module 302 is configured to, when the second determining module determines that the second signal is not detected, transmit a detection signal by a second signal transmitter, and obtain a second detection result by a signal receiver.
As shown in fig. 10, the terminal 400 may include a Radio Frequency (RF) circuit 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display unit 404, a sensor 405, an audio circuit 406, a Wireless Fidelity (WiFi) module 407, a processor 408 including one or more processing cores, and a power supply 409. Those skilled in the art will appreciate that the terminal structure shown in fig. 10 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The radio frequency circuit 401 may communicate with a network device or other electronic devices through wireless communication, and complete information transceiving with the network device or other electronic devices.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing executable program code. The application programs may constitute various functional modules. The processor 408 executes various functional applications and data processing by running application programs stored in the memory 402.
The input unit 403 may be used to receive input numbers, character information, or user characteristic information, such as a fingerprint, and generate a keyboard, mouse, joystick, optical, or trackball signal input related to user setting and function control. The input unit 403 may include a fingerprint recognition module.
The display unit 404 may be used to display information input by or provided to the user and various graphical user interfaces of the terminal, which may be made up of graphics, text, icons, video, and any combination thereof.
The terminal may also include at least one sensor 405, such as a proximity sensor, an acceleration sensor, a gyroscope, and other sensors. The proximity sensor can control the terminal to close the display panel and/or the backlight when the terminal moves to the ear of the user during the conversation process of the user. The acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and the terminal can detect the magnitude and direction of gravity when the terminal is stationary. The gyroscope can be used for detecting the magnitude of angular velocity in all directions (generally three axes), so as to sense the posture change of the terminal. Other sensors such as barometers, hygrometers and thermometers which can be configured at the terminal are not described in detail herein.
The audio circuitry 406 may convert electrical signals to sound signals or vice versa.
Wireless fidelity (WiFi) belongs to short-distance wireless transmission technology, and the terminal can communicate with other terminals or servers through the wireless fidelity module 407.
The processor 408 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, performs various functions of the terminal and processes data by running or executing an application program stored in the memory 402 and calling data stored in the memory 402, thereby monitoring the terminal as a whole.
The terminal also includes a power source 409 (such as a battery) to power the various components. In some embodiments, the power supply may be logically coupled to the processor 408 through a power management system, such that functions to manage charging, discharging, and power consumption management are performed through the power management system.
Although not shown in fig. 10, the terminal may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
In this embodiment, the processor 408 in the terminal loads the executable program code corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 408 runs the application programs stored in the memory 402, thereby implementing various functions:
the first signal emitter emits a detection signal;
the signal receiver acquires a first detection result;
the second signal emitter emits a detection signal;
the signal receiver obtains a second detection result;
judging whether the first detection result is the same as the second detection result to obtain a judgment result;
and determining the approaching or separating state between the terminal and the external object according to the judgment result.
In some embodiments, when determining the approaching or departing state between the terminal and the external object according to the determination result, the processor 408 is configured to determine the first detection result or the second detection result as the approaching or departing state between the terminal and the external object when the determination result is that the first detection result is the same as the second detection result.
In some embodiments, when determining the approaching or departing state between the terminal and the external object according to the determination result, the processor 408 is configured to transmit the detection signal simultaneously by the first signal transmitter and the second signal transmitter when the determination result is that the first detection result is different from the second detection result, and the signal receiver obtains a third detection result and determines the third detection result as the approaching or departing state between the terminal and the external object.
In some embodiments, after determining the third detection result as a close or far state between the terminal and the external object, the processor 408 is further configured to compare the third detection result with the first detection result to obtain a comparison result; when the comparison result is that the third detection result is the same as the first detection result, determining that the second signal transmitter has a fault; and when the comparison result is that the third detection result is different from the first detection result, determining that the first signal transmitter is in fault.
In some embodiments, processor 408 is further configured to obtain a predetermined prompt after determining that the second signal transmitter is malfunctioning or determining that the first signal transmitter is malfunctioning; and displaying the preset prompt message on the terminal.
In some embodiments, before the second signal transmitter transmits the probe signal, the processor 408 is further configured to obtain a motion parameter of the terminal; judging whether the state of the terminal is changed or not according to the motion parameters; if not, the second signal emitter emits a detection signal, and the signal receiver acquires a second detection result.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and for parts that are not described in detail in some embodiments, reference may be made to the foregoing detailed description of the proximity detection method, which is not described herein again.
As can be seen from the above, the embodiment of the present invention provides a terminal, which transmits a probe signal by using a first signal transmitter; the signal receiver acquires a first detection result; the second signal emitter emits a detection signal; the signal receiver acquires a second detection result; judging whether the first detection result is the same as the second detection result to obtain a judgment result; and determining the approaching or separating state between the terminal and the external object according to the judgment result. According to the scheme, the two signal transmitters are used for respectively transmitting the detection signals and respectively acquiring the detection results twice, the approaching or far-away state between the terminal and the external object is determined based on whether the detection results twice are the same, the inaccuracy of the detection result when a single signal transmitter is used can be avoided, and the accuracy of the approaching or far-away state between the detection terminal and the external object can be improved.
It should be noted that, as one of ordinary skill in the art would understand, all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, where the program may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The proximity detection method, the proximity detection device and the terminal provided by the embodiment of the invention are described in detail, a specific example is applied in the description to explain the principle and the implementation of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A proximity detection method applied to a terminal including a first signal transmitter, a second signal transmitter, and a signal receiver, wherein the signal receiver includes a first signal receiver and a second signal receiver, a distance between the first signal receiver and the first signal transmitter and a distance between the second signal receiver and the first signal transmitter are different, a distance between the first signal receiver and the second signal transmitter and a distance between the second signal receiver and the second signal transmitter are different, the proximity detection method comprising:
the first signal emitter emits a detection signal;
the signal receiver acquires a first detection result, wherein the first detection result is in a close state when the detection result of at least one of the first signal receiver and the second signal receiver is in a close state, and the first detection result is in a far state when the detection results of the first signal receiver and the second signal receiver are in far states;
the second signal emitter emits a detection signal;
the signal receiver acquires a second detection result, wherein the second detection result is in a close state when the detection result of at least one of the first signal receiver and the second signal receiver is in a close state, and the second detection result is in a far state when the detection results of the first signal receiver and the second signal receiver are in far states;
judging whether the first detection result is the same as the second detection result to obtain a judgment result, wherein the judgment result comprises that the first detection result is the same as or different from the second detection result;
determining a close or far state between the terminal and an external object according to the judgment result, wherein when the judgment result is that the first detection result is the same as the second detection result, the close or far state between the terminal and the external object is determined according to the first detection result or the second detection result;
when the judgment result is that the first detection result is different from the second detection result, the first signal emitter and the second signal emitter emit detection signals simultaneously;
the signal receiver acquires a third detection result, wherein the third detection result is in a close state when the detection result of at least one of the first signal receiver and the second signal receiver is in a close state, and the third detection result is in a far state when the detection results of the first signal receiver and the second signal receiver are in far states;
determining the third detection result as a close or distant state between the terminal and an external object, and determining a signal transmitter generating a malfunction according to a comparison result of the third detection result with the first detection result or the second detection result.
2. The proximity detection method according to claim 1, wherein the determining of the proximity or the distant state between the terminal and the external object according to the determination result includes:
and when the judgment result is that the first detection result is the same as the second detection result, determining the first detection result or the second detection result as the approaching or departing state between the terminal and an external object.
3. The proximity detection method according to claim 1, wherein after determining the third detection result as a proximity or distant state between the terminal and an external object, the proximity detection method further comprises:
comparing the third detection result with the first detection result to obtain a comparison result;
when the comparison result is that the third detection result is the same as the first detection result, determining that the second signal transmitter has a fault;
and when the comparison result is that the third detection result is different from the first detection result, determining that the first signal transmitter has a fault.
4. The proximity detection method according to claim 3, wherein after determining that the second signal transmitter is malfunctioning or determining that the first signal transmitter is malfunctioning, the proximity detection method further comprises:
acquiring preset prompt information;
and displaying the preset prompt information on the terminal.
5. The proximity detection method according to any one of claims 1 to 4, wherein, prior to the step of the second signal transmitter transmitting a probe signal, the proximity detection method further comprises:
acquiring a motion parameter of the terminal;
judging whether the state of the terminal is changed or not according to the motion parameters;
if not, the second signal emitter emits a detection signal.
6. A proximity detection apparatus applied to a terminal including a first signal transmitter, a second signal transmitter, and a signal receiver, wherein the signal receiver includes a first signal receiver and a second signal receiver, a distance between the first signal receiver and the first signal transmitter and a distance between the second signal receiver and the first signal transmitter are different, a distance between the first signal receiver and the second signal transmitter and a distance between the second signal receiver and the second signal transmitter are different, the proximity detection apparatus comprising:
a first obtaining module, configured to obtain a first detection result by the signal receiver when the first signal transmitter transmits a probe signal, where the first detection result is in a close state when a detection result of at least one of the first signal receiver and the second signal receiver is in a close state, and the first detection result is in a far state when the detection results of the first signal receiver and the second signal receiver are in far states;
a second obtaining module, configured to obtain a second detection result by the signal receiver when the second signal transmitter transmits a probe signal, where the second detection result is in a close state when a detection result of at least one of the first signal receiver and the second signal receiver is in a close state, and the second detection result is in a far state when the detection results of the first signal receiver and the second signal receiver are in far states;
the first judging module is used for judging whether the first detection result is the same as the second detection result to obtain a judgment result, wherein the judgment result comprises the first detection result and the second detection result which are the same or different;
a first determining module, configured to determine, according to the determination result, a proximity or a distance state between the terminal and an external object, where, when the determination result is that the first detection result is the same as the second detection result, the proximity or the distance state between the terminal and the external object is determined according to the first detection result or the second detection result; when the judgment result is that the first detection result is different from the second detection result, the first signal transmitter and the second signal transmitter simultaneously transmit a detection signal, and the signal receiver acquires a third detection result, wherein when the detection result of at least one of the first signal receiver and the second signal receiver is in an approaching state, the third detection result is in an approaching state, and when the detection results of the first signal receiver and the second signal receiver are in a far state, the third detection result is in a far state; determining the third detection result as a close or distant state between the terminal and an external object, and determining a signal transmitter generating a malfunction according to a comparison result of the third detection result with the first detection result or the second detection result.
7. The proximity detection apparatus of claim 6, wherein the first determination module is configured to:
and when the judgment result is that the first detection result is the same as the second detection result, determining the first detection result or the second detection result as the approaching or departing state between the terminal and an external object.
8. The proximity detection apparatus according to claim 6, further comprising:
the comparison module is used for comparing the third detection result with the first detection result to obtain a comparison result;
and the second determining module is used for determining that the second signal transmitter has a fault when the comparison result is that the third detection result is the same as the first detection result, and determining that the first signal transmitter has a fault when the comparison result is that the third detection result is different from the first detection result.
9. The proximity detection apparatus according to claim 8, further comprising:
the third acquisition module is used for acquiring preset prompt information;
and the display module is used for displaying the preset prompt information on the terminal.
10. The proximity detection apparatus according to any one of claims 6 to 9, further comprising:
the fourth acquisition module is used for acquiring the motion parameters of the terminal;
the second judging module is used for judging whether the state of the terminal is changed or not according to the motion parameters;
and the second obtaining module is used for transmitting a detection signal by a second signal transmitter and obtaining a second detection result by a signal receiver when the second judging module judges that the detection signal is not the first detection result.
11. A terminal, comprising:
a proximity sensor for detecting a proximity or distant state between the terminal and an external object;
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to perform the proximity detection method of any of claims 1 to 4.
12. A terminal, comprising:
a proximity sensor for detecting a proximity or distant state between the terminal and an external object;
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to perform the proximity detection method of claim 5.
CN201611108002.8A 2016-12-06 2016-12-06 Proximity detection method and device and terminal Expired - Fee Related CN106598358B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611108002.8A CN106598358B (en) 2016-12-06 2016-12-06 Proximity detection method and device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611108002.8A CN106598358B (en) 2016-12-06 2016-12-06 Proximity detection method and device and terminal

Publications (2)

Publication Number Publication Date
CN106598358A CN106598358A (en) 2017-04-26
CN106598358B true CN106598358B (en) 2020-01-14

Family

ID=58596100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611108002.8A Expired - Fee Related CN106598358B (en) 2016-12-06 2016-12-06 Proximity detection method and device and terminal

Country Status (1)

Country Link
CN (1) CN106598358B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844246B (en) * 2017-11-22 2019-08-20 Oppo广东移动通信有限公司 Display screen condition control method, device, storage medium and terminal
CN107948418B (en) * 2017-11-22 2019-09-13 Oppo广东移动通信有限公司 Display screen condition control method, device, storage medium and terminal
CN108122253A (en) * 2017-12-04 2018-06-05 广东欧珀移动通信有限公司 Proximity test method, apparatus and electronic equipment
CN110275213A (en) 2018-03-16 2019-09-24 广东欧珀移动通信有限公司 A kind of method, apparatus of proximity test, storage medium and electronic equipment
CN109407631B (en) * 2018-09-29 2020-09-22 珠海格力电器股份有限公司 Processing method, device, unit and storage medium for input load information
CN110865710B (en) * 2019-11-19 2023-08-18 Oppo(重庆)智能科技有限公司 Terminal control method and device, mobile terminal and storage medium
US11893959B2 (en) 2021-05-17 2024-02-06 Samsung Electronics Co., Ltd. Electronic device including proximity sensor having a plurality of light receiving elements and method of controlling the same

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023753A (en) * 2009-09-09 2011-04-20 联想(北京)有限公司 Approach detection apparatus and electronic equipment
EP2722733A4 (en) * 2011-06-16 2015-02-25 Sony Corp Information processing device, information processing method, and program
CN104618575A (en) * 2014-12-30 2015-05-13 小米科技有限责任公司 Method and device for approaching detected objects
CN106155382A (en) * 2015-04-01 2016-11-23 深圳市汇顶科技股份有限公司 Based on the proximity test method of HotKnot, device and touch screen terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070024584A1 (en) * 2005-08-01 2007-02-01 Chee-Heng Wong System and method for fault detection and recovery for an optical input area
CN103777818B (en) * 2012-10-17 2016-08-17 敦宏科技股份有限公司 Proximity method for sensing and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023753A (en) * 2009-09-09 2011-04-20 联想(北京)有限公司 Approach detection apparatus and electronic equipment
EP2722733A4 (en) * 2011-06-16 2015-02-25 Sony Corp Information processing device, information processing method, and program
CN104618575A (en) * 2014-12-30 2015-05-13 小米科技有限责任公司 Method and device for approaching detected objects
CN106155382A (en) * 2015-04-01 2016-11-23 深圳市汇顶科技股份有限公司 Based on the proximity test method of HotKnot, device and touch screen terminal

Also Published As

Publication number Publication date
CN106598358A (en) 2017-04-26

Similar Documents

Publication Publication Date Title
CN106598358B (en) Proximity detection method and device and terminal
CN109542279B (en) Terminal device control method and terminal device
US10897687B2 (en) Electronic device and method for identifying location by electronic device
CN109451130B (en) Mobile terminal testing method and device, mobile terminal and storage medium
CN108551525B (en) State determination method of movement track and mobile terminal
CN110069407B (en) Function test method and device for application program
CN109993234B (en) Unmanned driving training data classification method and device and electronic equipment
CN110933551A (en) Operation method and system of wireless earphone and wireless communication equipment
CN108965042B (en) Network delay obtaining method and device, terminal equipment and storage medium
CN112199246B (en) Terminal test method and device, storage medium and mobile terminal
US11294481B2 (en) Detection of pen location relative to an electronic device
CN107545204B (en) Article sequence determination method and device
CN109857305B (en) Input response method and mobile terminal
KR102499917B1 (en) Electronic device performing positioning and method for controlling thereof
CN112486350B (en) Detection method and device for touch screen of mobile terminal, storage medium and mobile terminal
KR101939925B1 (en) Video-based check-in method, terminal, server and system
US11567822B2 (en) Method of monitoring closed system, apparatus thereof and monitoring device
CN109151160B (en) Communication method, communication device, mobile terminal and storage medium
CN108988413B (en) Mobile terminal charging method and mobile terminal
CN108965577B (en) Interface display method and terminal equipment
CN111913942A (en) Data quality detection method and device
CN112667868A (en) Data detection method and device
CN111083285A (en) Mobile terminal call positioning system and method
CN105988801B (en) Method and device for displaying annotation information
US20230118461A1 (en) Method for transmitting request to external device, and electronic device supporting same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

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

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

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

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200114

CF01 Termination of patent right due to non-payment of annual fee