CN106791108B - Threshold updating method and device of proximity sensor and terminal - Google Patents

Threshold updating method and device of proximity sensor and terminal Download PDF

Info

Publication number
CN106791108B
CN106791108B CN201611201571.7A CN201611201571A CN106791108B CN 106791108 B CN106791108 B CN 106791108B CN 201611201571 A CN201611201571 A CN 201611201571A CN 106791108 B CN106791108 B CN 106791108B
Authority
CN
China
Prior art keywords
proximity sensor
value
proximity
continuous acquisition
state
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
CN201611201571.7A
Other languages
Chinese (zh)
Other versions
CN106791108A (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 CN201611201571.7A priority Critical patent/CN106791108B/en
Publication of CN106791108A publication Critical patent/CN106791108A/en
Application granted granted Critical
Publication of CN106791108B publication Critical patent/CN106791108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • 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/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • 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/0416Control or interface arrangements specially adapted for digitisers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/66Substation equipment, e.g. for use by subscribers with means for preventing unauthorised or fraudulent calling
    • H04M1/667Preventing unauthorised calls from a telephone set
    • H04M1/67Preventing unauthorised calls from a telephone set by electronic means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion

Abstract

The embodiment of the invention discloses a threshold updating method, a threshold updating device and a terminal of a proximity sensor, wherein the method comprises the following steps: when the proximity sensor is detected to be in a far state, recording a proximity value continuously acquired by the proximity sensor and accumulating the continuous acquisition times; if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value; when the approach sensor is detected to be switched from the far state to the approach state, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record the approach value again when the approach sensor is in the far state; and if the re-accumulated continuous acquisition times reach the set times, updating the threshold value of the proximity sensor based on the re-recorded proximity value. The embodiment of the invention can accurately set the threshold of the proximity sensor, solves the problem of inaccurate screen control, and avoids the problem of inaccurate threshold setting caused by the influence of oil stains on the proximity sensor.

Description

Threshold updating method and device of proximity sensor and terminal
Technical Field
The invention relates to the technical field of terminals, in particular to a threshold updating method and device of a proximity sensor and a terminal.
Background
The proximity sensor provided in the terminal is typically an infrared proximity sensor. The infrared proximity sensor includes an infrared transmitting tube and an infrared receiving tube. First, infrared light is emitted from an infrared emitting tube in the direction of the screen of the display screen. Then, the infrared receiving tube receives the infrared light reflected by the shielding object and converts the infrared light into an electric signal, the electric signal is amplified and subjected to analog-to-digital conversion (A/D conversion) to obtain a digital signal corresponding to the intensity of the reflected infrared light, and the digital signal is sent to the CPU, and the CPU takes the digital signal as a proximity value for further judgment. For example, the distance between the shield and the terminal is determined by the proximity value, and the stronger the intensity of the received infrared light, the larger the proximity value, the smaller the distance between the shield and the received infrared light.
In order to facilitate the judgment of the approach or the departure of the obstruction according to the approach value, a threshold value of the approach sensor is usually set, and the threshold value is often set in a dynamic manner, and the threshold value of the approach sensor is updated through the acquired approach value, namely the approach threshold value and the departure threshold value. And when the approach value is larger than the approach threshold value, judging that the approach sensor is in an approach state, and controlling the screen to be extinguished. And when the approach value is smaller than the away threshold value, judging that the approach sensor is in the away state, and controlling the screen to be lightened.
However, in the process of implementing the invention, the inventor finds that the prior art has the following defects: in the process of acquiring the proximity value by the proximity sensor to update the threshold value, the proximity value often has a jumping range, so that the threshold value is easily set inaccurately, and the screen cannot be controlled accurately.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a terminal for updating a threshold of a proximity sensor, so as to solve the technical problem of inaccurate screen control in the prior art.
In a first aspect, an embodiment of the present invention provides a threshold updating method for a proximity sensor, including:
when the proximity sensor is detected to be in a far state, recording a proximity value continuously acquired by the proximity sensor and accumulating continuous acquisition times;
if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value;
when the proximity sensor is detected to be switched from a far state to a near state, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record a near value again when the proximity sensor is in the far state;
and if the re-accumulated continuous acquisition times reach the set times, updating the threshold value of the proximity sensor based on the re-recorded proximity value.
In a second aspect, an embodiment of the present invention further provides a threshold updating apparatus for a proximity sensor, including:
the recording and accumulating module is used for recording the continuously acquired approach value and accumulating the continuously acquired times of the approach sensor when the approach sensor is detected to be in a far state;
the first updating module is used for updating the threshold value of the proximity sensor according to the recorded proximity value if the continuous acquisition times reach the set times;
the first resetting module is used for resetting the continuous acquisition times when the proximity sensor is detected to be switched from the far state to the near state, so that the continuous acquisition times are accumulated again when the proximity sensor is in the far state, and the proximity value is recorded again;
and the second updating module is used for updating the threshold value of the proximity sensor based on the re-recorded proximity value if the re-accumulated continuous acquisition times reach the set times.
In a third aspect, an embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
when the proximity sensor is detected to be in a far state, recording a proximity value continuously acquired by the proximity sensor and accumulating continuous acquisition times;
if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value;
when the proximity sensor is detected to be switched from a far state to a near state, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record a near value again when the proximity sensor is in the far state;
and if the re-accumulated continuous acquisition times reach the set times, updating the threshold value of the proximity sensor based on the re-recorded proximity value.
According to the technical scheme provided by the embodiment of the invention, when the proximity sensor is detected to be in a far state and the recorded continuous acquisition times reach the set times, the threshold value is updated through the recorded proximity value; when the proximity sensor is detected to be switched from the far state to the near state, continuous acquisition times are accumulated again and the near value is recorded again by resetting the continuous acquisition times so that the proximity sensor is in the far state, and when the accumulated continuous acquisition times reach the set times, the threshold value is updated based on the recorded near value, the threshold value of the proximity sensor can be accurately set, the problem of inaccurate screen control is solved, and the problem of inaccurate threshold value setting caused by the influence of oil stains on the proximity sensor is avoided.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a flowchart of a threshold updating method for a proximity sensor according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for updating a threshold of a proximity sensor according to another embodiment of the present invention;
FIG. 3 is a flowchart of a method for updating a threshold of a proximity sensor according to another embodiment of the present invention;
fig. 4 is a block diagram of a threshold updating apparatus for a proximity sensor according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings.
Fig. 1 is a flowchart of a threshold updating method for a proximity sensor, which is provided by an embodiment of the present invention, and is performed by a threshold updating apparatus for a proximity sensor, which is implemented by software and/or hardware, and which is generally configured in a terminal such as a mobile phone. When the terminal is a mobile phone, the method is applied to a conversation scene. As shown in fig. 1, the technical solution provided in this embodiment is as follows:
s110: when the proximity sensor is detected to be in a far state, the proximity value continuously acquired by the proximity sensor is recorded, and the continuous acquisition times are accumulated.
The threshold value of the proximity sensor is often set in a dynamic mode, namely the threshold value is determined according to the proximity value acquired by the proximity sensor in a far-away state, and because the acquired proximity value has a jumping range, the threshold value is inaccurate or unreasonable in setting due to the fact that the acquired proximity value determines the threshold value once, and inaccurate screen control is caused. Therefore, in this embodiment, when the proximity sensor is detected to be in the distant state, the proximity value continuously acquired by the proximity sensor is recorded and the number of times of continuous acquisition is accumulated, and the threshold value is determined based on the plurality of recorded continuously acquired proximity values.
In this embodiment, the detection that the proximity sensor is in the distant state is determined by the acquired proximity value and the threshold value determined last time. And when the acquired approach value is smaller than the last determined departure threshold value, determining that the approach sensor is in a departure state. The detection of the state of the proximity sensor may be detected by the processor or may be detected by other modules within the terminal.
S120: and if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value.
In this embodiment, the set number is a preset number, and can be set as needed. And when the proximity sensor is in a far state, if the continuous acquisition times reach the set times, determining an average value according to the recorded proximity value, and updating the threshold value of the proximity sensor according to the average value.
Specifically, if the number of continuous acquisition times reaches the set number of times, the recorded multiple approach values are summed, and an average value of the multiple approach values is obtained. And respectively adding a first constant and a second constant on the basis of the average value to respectively obtain a proximity threshold value and a distance threshold value of the proximity sensor.
For example, the number of times is set to 5, and when the proximity sensor is in the distant state and the number of continuous acquisition times reaches 5, the 5 acquired proximity values recorded are averaged, and the proximity threshold value and the distant threshold value of the proximity sensor are determined from the average value.
S130: when the approach sensor is detected to be switched from the far state to the approach state, the continuous acquisition times are reset so as to be accumulated again when the approach sensor is in the far state and the approach value is recorded again.
When the approach sensor is switched from a far state to an approach state, the approach value of the approach sensor is greatly changed due to the fact that the approach sensor is easily affected by oil stains. When the accumulated continuous acquisition times do not reach the set times, the proximity sensor needs to continuously acquire the proximity value after being switched from the proximity state to the distant state, and the threshold value is determined according to the acquired proximity value of the set times. Because the proximity sensor receives the influence of greasy dirt when being close to the state, consequently, when the proximity sensor switches to the state of being close to by far away from the state, need reset the continuous collection number of times that adds up, be about to continuous collection number of times clear to the continuous collection number of times and record the approximate value again of reincumulating when making the proximity sensor be in the state of keeping away from.
Or when the proximity sensor is switched from the far state to the near state, even if the continuous acquisition times reach the set times, the continuous acquisition times can be reset so as to accumulate the continuous acquisition times again and record the near value again when the proximity sensor is in the far state.
S140: and if the re-accumulated continuous acquisition times reach the set times, updating the threshold value of the proximity sensor based on the re-recorded proximity value.
In this embodiment, for example, if the number of times of continuous collection accumulated again reaches the set number of times, updating the threshold value of the proximity sensor based on the newly recorded proximity value includes: when the re-accumulated continuous acquisition times reach the set times, determining an average value according to the re-recorded approach value; updating a threshold of the proximity sensor based on the average. Wherein said updating the threshold of the proximity sensor according to the average value comprises: on the basis of the average value, a first constant and a second constant are respectively superimposed to obtain a proximity threshold value and a distance threshold value after the proximity sensor update.
In the method for updating the threshold of the proximity sensor provided by the embodiment, when the proximity sensor is detected to be in a far state and the recorded continuous acquisition times reach the set times, the threshold is updated according to the recorded proximity value; when the proximity sensor is detected to be switched from the far state to the near state, continuous acquisition times are accumulated again and the near value is recorded again by resetting the continuous acquisition times so that the proximity sensor is in the far state, when the accumulated continuous acquisition times reach the set times, the threshold value is updated based on the recorded near value, the threshold value of the proximity sensor can be accurately set, the control of the proximity screen is inaccurate, and the problem of inaccurate threshold value setting caused by the influence of oil stains on the proximity sensor is avoided.
Fig. 2 is a flowchart of a threshold updating method for a proximity sensor according to an embodiment of the present invention, and on the basis of the above embodiment, optionally, the resetting the consecutive acquisition times when the proximity sensor is detected to switch from the far state to the near state to enable the proximity sensor to be in the far state and to re-accumulate the consecutive acquisition times and re-record the proximity value includes:
when the proximity sensor is detected to be switched from a far state to a near state and the continuous acquisition times do not reach the set times, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record the acquired near value again when the proximity sensor is in the far state.
From this, through when detecting proximity sensor by keeping away from the state and switching to the state of being close, and when the number of times of gathering in succession did not reach the settlement number of times, reset the number of times of gathering in succession, can avoid the threshold value that the greasy dirt leads to the proximity sensor to confirm the inaccurate condition, solve the inaccurate problem of screen control.
Based on the above optimization, as shown in fig. 2, the technical solution provided in this embodiment is specifically as follows:
s210: when the proximity sensor is detected to be in a far state, the proximity value continuously acquired by the proximity sensor is recorded, and the continuous acquisition times are accumulated.
S220: and if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value.
S230: when the proximity sensor is detected to be switched from a far state to a near state and the continuous acquisition times do not reach the set times, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record the acquired near value again when the proximity sensor is in the far state.
In this embodiment, when it is detected that the proximity sensor is switched from the distant state to the proximate state, and the accumulated consecutive acquisition times does not reach the set times, the consecutive acquisition times needs to be reset, so that the situation that the acquisition times are continuously accumulated on the basis of the previously accumulated consecutive acquisition times when the proximity sensor is switched to the distant state again is avoided, and the problem that the threshold value is set inaccurately due to the influence of oil stains on the proximity sensor under the condition that the threshold value is determined based on the recorded consecutive acquired proximity value is avoided.
For example, if the set number of times is 5, that is, when the proximity sensor is in the distant state, the threshold value of the proximity sensor is determined by recording the proximity values acquired 5 times in succession. If the proximity sensor is switched from the distant state to the proximity state, the accumulated number of continuous acquisition times is 3, and the proximity values of 3 times recorded without reaching the set number (5 times) are 100, 102 and 105, respectively. If the proximity sensor is affected by oil contamination in a proximity state, the upper limit value of the oil contamination threshold value set at this time is 850, and the lower limit value of the oil contamination threshold value is 800. The upper limit value of the oil stain threshold value is the sum of the approaching value of the current approaching sensor and the maximum variation of the approaching value caused by the oil stain, and the lower limit value of the oil stain threshold value is the difference between the upper limit value of the oil stain threshold value and a constant. When the approach value of the approach sensor is smaller than the lower limit value of the oil stain threshold value, the approach sensor is in a far-away state, and when the approach value of the approach sensor is larger than the upper limit value of the oil stain threshold value, the approach sensor is in an approach state. And when the proximity sensor is in the proximity state, the proximity value of the proximity sensor is not recorded, that is, the threshold value is not determined by the proximity value in the proximity state.
When the proximity sensor is switched from the proximity state to the remote state, and the proximity sensor is in the remote state again, if the continuous acquisition times are not reset, the continuous acquisition times are continuously accumulated on the basis of the previous 3 times, and the set times (5 times) can be reached by accumulating 2 times. And the recorded proximity values of the proximity sensors for 2 consecutive acquisitions are 500, 600, respectively. The proximity sensor threshold is determined from the proximity values (100, 105) recorded the first 3 times (unaffected by oil contamination) and the proximity values (500 and 600) recorded the 2 times after being affected by oil contamination. Since 500 and 600 are the proximity values recorded in the case where the proximity sensor is affected by oil contamination, the change from the proximity value recorded the previous 3 times is large, and thus the determined threshold value of the proximity sensor is inaccurate.
Therefore, when the proximity sensor is switched from the distant state to the proximity state and the number of continuous acquisitions does not reach the set number, the number of continuous acquisitions needs to be reset. When the proximity sensor is switched from the proximity state to the far state and the proximity sensor is in the far state again, the continuous acquisition times are accumulated again and the proximity value is recorded again. Specifically, after the number of continuous acquisition times is reset, when the proximity sensor is in the distant state again, the proximity value is acquired for 5 times again, and the proximity value is recorded, and if the recorded proximity values are 500, 600, 400, 450, and 550, respectively, the threshold value of the proximity sensor is updated by the newly recorded proximity value, thereby improving the accuracy of setting the threshold value. By calculation, the average value of 500, 600, 400, 450, 550 is 500. If the first constant (80) is added to 500, the approach threshold (580) is obtained, and if the second constant (40) is added to 500, the departure threshold (540) is obtained. If the approach value of the proximity sensor is 450 in the process of the next approach to the distance from the proximity sensor, which is less than the distance threshold, the screen should be bright.
However, if the number of continuous acquisition is not reset when the proximity sensor is switched from the distant state to the close state, the average value calculated by 100, 105, 500, 600 is 282, the determined distant threshold is 322, and the determined close threshold is 362, and if the proximity value of the proximity sensor is 450, 450 is greater than the distant threshold, the control screen is turned off, resulting in inaccurate screen control. Therefore, when the proximity sensor is switched from the distant state to the proximity state and the number of continuous acquisitions does not reach the set number, the number of continuous acquisitions needs to be reset.
S240: and if the re-accumulated continuous acquisition times reach the set times, updating the threshold value of the proximity sensor based on the re-recorded proximity value.
According to the threshold updating method for the proximity sensor, when the proximity sensor is detected to be switched from the far state to the close state and the continuous collection times do not reach the set times, the continuous collection times are reset, the condition that threshold determination is inaccurate due to the influence of oil stains on the proximity sensor can be avoided, and the problem of inaccurate screen control is solved.
Fig. 3 is a flowchart of a threshold updating method for a proximity sensor according to another embodiment of the present invention, on the basis of the above embodiment, after the threshold of the proximity sensor is updated according to the recorded proximity value when the number of consecutive acquisitions reaches the set number, the following operations are further performed:
resetting the number of consecutive acquisitions to reincumulate the number of consecutive acquisitions when the proximity sensor is in the far state.
Therefore, the continuous acquisition times are reset after the threshold value of the proximity sensor is updated, so that the proximity sensor periodically and continuously acquires the proximity value to continuously update the threshold value, the threshold value of the proximity sensor is accurately set, and the problem of inaccurate screen control is avoided.
Correspondingly, as shown in fig. 3, the technical solution provided by this embodiment is as follows:
s310: when the proximity sensor is detected to be in a far state, the proximity value continuously acquired by the proximity sensor is recorded, and the continuous acquisition times are accumulated.
S320: and if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value.
S330: when the approach sensor is detected to be switched from the far state to the approach state, the continuous acquisition times are reset so as to be accumulated again when the approach sensor is in the far state and the approach value is recorded again.
S340: and if the re-accumulated continuous acquisition times reach the set times, updating the threshold value of the proximity sensor based on the re-recorded proximity value.
S350: resetting the number of consecutive acquisitions to reincumulate the number of consecutive acquisitions when the proximity sensor is in the far state.
In this embodiment, if the re-accumulated continuous acquisition times reaches the set times, after the threshold of the proximity sensor is updated based on the re-recorded proximity value, the continuous acquisition times need to be reset so that the continuous acquisition times are re-accumulated when the proximity sensor is in a distant state, and the proximity value is re-recorded, thereby periodically and continuously updating the threshold of the proximity sensor. Or when the continuous acquisition times reach the set times, resetting the continuous acquisition times so as to lead the proximity sensor to periodically and continuously update the threshold value.
In this embodiment, for example, if the set number of times is 5. When the proximity sensor is in a far state and the accumulated continuous acquisition times reach 5 times, updating the threshold value of the proximity sensor according to the recorded 5 proximity values, then resetting the continuous acquisition times, namely resetting the continuous acquisition times, accumulating the continuous acquisition times again, recording the proximity values again and periodically updating the threshold value of the proximity sensor.
In the embodiment of the present invention, S310 to S350 are exemplarily combined into an example to perform a threshold updating method of a proximity sensor, but the embodiment is only an example of the present invention, and in other embodiments of the present invention, S350 may also be combined with S210 to S240 into an example to perform a threshold updating method of a proximity sensor.
According to the threshold updating method of the proximity sensor, the number of continuous acquisition times is reset after the threshold of the proximity sensor is updated, so that the proximity sensor periodically and continuously acquires the proximity value to continuously update the threshold, the threshold of the proximity sensor is accurately set, and the problem of inaccurate screen control is avoided.
Fig. 4 is a block diagram illustrating a threshold updating apparatus for a proximity sensor according to an embodiment of the present invention, the apparatus being configured to perform a threshold updating method for a proximity sensor, where the apparatus 400 includes: a recording and accumulating module 410, a first updating module 420, a first resetting module 430 and a second updating module 440.
The recording and accumulating module 410 is configured to record a proximity value and accumulated consecutive acquisition times that are continuously acquired by a proximity sensor when the proximity sensor is detected to be in a distant state;
a first updating module 420, configured to update the threshold of the proximity sensor according to the recorded proximity value if the consecutive acquisition times reach a set number of times;
a first reset module 430, configured to reset the consecutive acquisition times when the proximity sensor is detected to be switched from the far state to the near state, so as to re-accumulate the consecutive acquisition times and re-record a near value when the proximity sensor is in the far state;
a second updating module 440, configured to update the threshold of the proximity sensor based on the re-recorded proximity value if the re-accumulated consecutive acquisition times reaches the set number.
Further, the first reset module 430 is specifically configured to:
when the proximity sensor is detected to be switched from a far state to a near state and the continuous acquisition times do not reach the set times, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record the acquired near value again when the proximity sensor is in the far state.
Further, the second updating module 440 is specifically configured to: when the re-accumulated continuous acquisition times reach the set times, determining an average value according to the re-recorded approach value;
updating a threshold of the proximity sensor based on the average.
Further, said updating the threshold of the proximity sensor according to the average value includes:
on the basis of the average value, a first constant and a second constant are respectively superimposed to obtain a proximity threshold value and a distance threshold value after the proximity sensor update.
Further, the method also comprises the following steps: and a second resetting module 450, configured to reset the consecutive acquisition times after updating the threshold of the proximity sensor according to the recorded proximity value when the consecutive acquisition times reach the set times, so as to re-accumulate the consecutive acquisition times when the proximity sensor is in a distant state.
The embodiment provides a threshold updating device of a proximity sensor, when the proximity sensor is detected to be in a far state and the recorded continuous acquisition times reach the set times, the threshold is updated according to the recorded proximity value; when the proximity sensor is detected to be switched from the far state to the near state, continuous acquisition times are accumulated again and the near value is recorded again by resetting the continuous acquisition times so that the proximity sensor is in the far state, when the accumulated continuous acquisition times reach the set times, the threshold value is updated based on the recorded near value, the threshold value of the proximity sensor can be accurately set, the control of the proximity screen is inaccurate, and the problem of inaccurate threshold value setting caused by the influence of oil stains on the proximity sensor is avoided.
The embodiment of the invention provides a terminal, and the terminal can be integrated with the threshold updating device of the proximity sensor provided by the embodiment of the invention. Fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention. As shown in fig. 5, the terminal 500 may include: a memory 501, a Central Processing Unit (CPU) 502 (also called a processor, hereinafter referred to as CPU), a touch screen 512, and a computer program stored in the memory and running on the processor. The touch screen 512 is used for converting user operation into an electric signal, inputting the electric signal to the processor and displaying a visual output signal; the processor 502, when executing the computer program, performs the following steps: when the proximity sensor is detected to be in a far state, recording a proximity value continuously acquired by the proximity sensor and accumulating continuous acquisition times; if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value; when the proximity sensor is detected to be switched from a far state to a near state, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record a near value again when the proximity sensor is in the far state; and if the re-accumulated continuous acquisition times reach the set times, updating the threshold value of the proximity sensor based on the re-recorded proximity value.
The terminal 500 further includes: peripheral interface 503, RF (Radio Frequency) circuitry 505, audio circuitry 506, speakers 511, power management chip 508, input/output (I/O) subsystem 509, other input/control devices 510, and external port 504, which communicate via one or more communication buses or signal lines 507.
It should be understood that the illustrated terminal 500 is only one example of a terminal, and that the terminal 500 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail a terminal integrated with a proximity sensor threshold updating apparatus provided in this embodiment, where the terminal is a mobile phone as an example.
A memory 501, the memory 501 being accessible by the CPU502, the peripheral interface 503, and the like, the memory 501 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 503, the peripheral interface 503 may connect input and output peripherals of the device to the CPU502 and the memory 501.
An I/O subsystem 509, which I/O subsystem 509 may connect input and output peripherals on the device, such as a touch screen 512 and other input/control devices 510, to the peripheral interface 503. The I/O subsystem 509 may include a display controller 5091 and one or more input controllers 5092 for controlling other input/control devices 510. Where one or more input controllers 5092 receive electrical signals from or send electrical signals to other input/control devices 510, the other input/control devices 510 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 5092 may be connected to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 512, which is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 5091 in the I/O subsystem 509 receives electrical signals from the touch screen 512 or transmits electrical signals to the touch screen 512. The touch screen 512 detects a contact on the touch screen, and the display controller 5091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 512, that is, implements a human-computer interaction, and the user interface object displayed on the touch screen 512 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 505 is mainly used to establish communication between the mobile phone and the wireless network (i.e., network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, the RF circuitry 505 receives and transmits RF signals, also referred to as electromagnetic signals, through which the RF circuitry 505 converts electrical signals to or from electromagnetic signals and communicates with communication networks and other devices. The RF circuitry 505 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 506 is mainly used to receive audio data from the peripheral interface 503, convert the audio data into an electric signal, and transmit the electric signal to the speaker 511.
The speaker 511 is used for restoring the voice signal received by the handset from the wireless network through the RF circuit 505 to sound and playing the sound to the user.
And a power management chip 508 for supplying power and managing power to the hardware connected to the CPU502, the I/O subsystem, and the peripheral interfaces.
The terminal provided in this embodiment is used to execute the threshold updating method of the proximity sensor described in each of the above embodiments, and the technical principle and the generated technical effect are similar, which are not described herein again.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (5)

1. A method for updating a threshold of a proximity sensor, comprising:
when detecting that a proximity value acquired by a proximity sensor is smaller than a last determined distance threshold value, determining that the proximity sensor is in a distance state, recording the proximity value continuously acquired by the proximity sensor and accumulating the continuous acquisition times, wherein the state detection of the proximity sensor is detected by a processor;
if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value;
resetting the number of consecutive acquisitions to reincumulate the number of consecutive acquisitions when the proximity sensor is in a far state;
when the proximity sensor is detected to be switched from a far state to a near state, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record a near value again when the proximity sensor is in the far state;
when the re-accumulated continuous acquisition times reach the set times, determining an average value according to the re-recorded approach value;
on the basis of the average value, a first constant and a second constant are respectively superimposed to obtain a proximity threshold value and a distance threshold value after the proximity sensor update.
2. The method of claim 1, wherein resetting the number of consecutive acquisitions when the proximity sensor is detected to switch from a far state to a near state to re-accumulate the number of consecutive acquisitions and re-record a proximity value when the proximity sensor is in the far state comprises:
when the proximity sensor is detected to be switched from a far state to a near state and the continuous acquisition times do not reach the set times, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record the acquired near value again when the proximity sensor is in the far state.
3. A proximity sensor threshold updating apparatus, comprising:
the system comprises a recording and accumulating module, a processor and a control module, wherein the recording and accumulating module is used for determining that a proximity sensor is in a far state when detecting that a proximity value acquired by the proximity sensor is smaller than a far threshold value determined last time, recording a proximity value continuously acquired by the proximity sensor and accumulating continuous acquisition times, and the state detection of the proximity sensor is detected by the processor;
the first updating module is used for updating the threshold value of the proximity sensor according to the recorded proximity value if the continuous acquisition times reach the set times;
the first resetting module is used for resetting the continuous acquisition times when the proximity sensor is detected to be switched from the far state to the near state, so that the continuous acquisition times are accumulated again when the proximity sensor is in the far state, and the proximity value is recorded again;
the second resetting module is used for resetting the continuous acquisition times after updating the threshold value of the proximity sensor according to the recorded proximity value when the continuous acquisition times reach the set times so as to enable the continuous acquisition times to be accumulated again when the proximity sensor is in a far state;
the second updating module is used for updating the threshold value of the proximity sensor based on the re-recorded proximity value if the re-accumulated continuous acquisition times reach the set times;
the second update module is specifically configured to: when the re-accumulated continuous acquisition times reach the set times, determining an average value according to the re-recorded approach value;
on the basis of the average value, a first constant and a second constant are respectively superimposed to obtain a proximity threshold value and a distance threshold value after the proximity sensor update.
4. The apparatus of claim 3, wherein the first reset module is specifically configured to:
when the proximity sensor is detected to be switched from a far state to a near state and the continuous acquisition times do not reach the set times, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record the acquired near value again when the proximity sensor is in the far state.
5. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program performs the steps of:
when detecting that a proximity value acquired by a proximity sensor is smaller than a last determined distance threshold value, determining that the proximity sensor is in a distance state, recording the proximity value continuously acquired by the proximity sensor and accumulating the continuous acquisition times, wherein the state detection of the proximity sensor is detected by a processor;
if the continuous acquisition times reach the set times, updating the threshold value of the proximity sensor according to the recorded proximity value;
resetting the number of consecutive acquisitions to reincumulate the number of consecutive acquisitions when the proximity sensor is in a far state;
when the proximity sensor is detected to be switched from a far state to a near state, resetting the continuous acquisition times so as to accumulate the continuous acquisition times again and record a near value again when the proximity sensor is in the far state;
when the re-accumulated continuous acquisition times reach the set times, determining an average value according to the re-recorded approach value;
on the basis of the average value, a first constant and a second constant are respectively superimposed to obtain a proximity threshold value and a distance threshold value after the proximity sensor update.
CN201611201571.7A 2016-12-22 2016-12-22 Threshold updating method and device of proximity sensor and terminal Active CN106791108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611201571.7A CN106791108B (en) 2016-12-22 2016-12-22 Threshold updating method and device of proximity sensor and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611201571.7A CN106791108B (en) 2016-12-22 2016-12-22 Threshold updating method and device of proximity sensor and terminal

Publications (2)

Publication Number Publication Date
CN106791108A CN106791108A (en) 2017-05-31
CN106791108B true CN106791108B (en) 2020-03-10

Family

ID=58899886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611201571.7A Active CN106791108B (en) 2016-12-22 2016-12-22 Threshold updating method and device of proximity sensor and terminal

Country Status (1)

Country Link
CN (1) CN106791108B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109343066B (en) * 2018-09-18 2020-07-21 Oppo广东移动通信有限公司 Control method and device of proximity sensor, storage medium and mobile terminal
KR102628105B1 (en) * 2019-08-13 2024-01-23 엘지전자 주식회사 mobile terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411425A (en) * 2011-07-22 2012-04-11 华为终端有限公司 Method and device for controlling function of touch screen
CN102665008A (en) * 2012-05-08 2012-09-12 广东欧珀移动通信有限公司 Detecting algorithm for infrared proximity sensor of touch screen mobile phone
JP2013258517A (en) * 2012-06-12 2013-12-26 Nec Casio Mobile Communications Ltd Proximity sensor adjustment device, adjustment method, and program
CN105262882A (en) * 2015-08-28 2016-01-20 上海卓易科技股份有限公司 Method and device for automatically calibrating distance induction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411425A (en) * 2011-07-22 2012-04-11 华为终端有限公司 Method and device for controlling function of touch screen
CN102665008A (en) * 2012-05-08 2012-09-12 广东欧珀移动通信有限公司 Detecting algorithm for infrared proximity sensor of touch screen mobile phone
JP2013258517A (en) * 2012-06-12 2013-12-26 Nec Casio Mobile Communications Ltd Proximity sensor adjustment device, adjustment method, and program
CN105262882A (en) * 2015-08-28 2016-01-20 上海卓易科技股份有限公司 Method and device for automatically calibrating distance induction

Also Published As

Publication number Publication date
CN106791108A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US9906723B2 (en) Method for selection between front-facing camera and rear-facing camera of mobile terminal and mobile terminal
CN107943345B (en) Method and device for calibrating proximity sensor, storage medium and electronic equipment
CN107294522B (en) Response method and device based on touch key, storage medium and electronic equipment
US10884550B2 (en) Method, mobile terminal and non-transitory computer-readable storage medium for response control of touch screen
CN108279408B (en) Proximity sensor calibration method and device, mobile terminal and computer readable medium
CN107484231B (en) Screen parameter adjusting method, device, terminal and computer readable storage medium
CN107463289B (en) Calibration method and device of touch screen, storage medium and terminal
US20150310637A1 (en) Interface adjustment method, apparatus, and terminal
CN107942306B (en) Method and device for calibrating proximity sensor, storage medium and electronic equipment
US11157334B2 (en) Control method and apparatus for broadcast sending, storage medium, and electronic device
CN106708332B (en) threshold setting method and device of proximity sensor and terminal
CN106791108B (en) Threshold updating method and device of proximity sensor and terminal
WO2018161956A1 (en) Broadcast recipient adjustment method, device, and terminal
CN108076223B (en) Task switching method and device, terminal equipment and storage medium
CN106502819B (en) Control method and device based on proximity sensor and mobile terminal
CN106686222A (en) Ambient light sensor control method, ambient light sensor control device and terminal
CN106776092B (en) State detection method and device of proximity sensor and terminal
CN109186657B (en) Proximity sensor parameter calibration method and device, terminal equipment and storage medium
CN106936828B (en) Method, device and terminal for adjusting broadcast receiver queue
CN113612957B (en) Call method and related equipment
CN114625588A (en) Method, device and equipment for measuring touch operation response time and storage medium
CN109375855B (en) Terminal state determination method and device, terminal equipment and storage medium
CN110928443B (en) Touch position detection method and electronic equipment
CN111081198B (en) Data control method, data control device, storage medium and terminal equipment
CN109061662B (en) Infrared detection method and device, computer equipment and storage medium

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
CB02 Change of applicant information

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

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

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

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

GR01 Patent grant
GR01 Patent grant