CN108445475B - Data processing method and device and related medium product - Google Patents

Data processing method and device and related medium product Download PDF

Info

Publication number
CN108445475B
CN108445475B CN201810031979.7A CN201810031979A CN108445475B CN 108445475 B CN108445475 B CN 108445475B CN 201810031979 A CN201810031979 A CN 201810031979A CN 108445475 B CN108445475 B CN 108445475B
Authority
CN
China
Prior art keywords
distance
data processing
light intensity
terminal
processing device
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
CN201810031979.7A
Other languages
Chinese (zh)
Other versions
CN108445475A (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 CN201810031979.7A priority Critical patent/CN108445475B/en
Publication of CN108445475A publication Critical patent/CN108445475A/en
Application granted granted Critical
Publication of CN108445475B publication Critical patent/CN108445475B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S11/00Systems for determining distance or velocity not using reflection or reradiation
    • G01S11/12Systems for determining distance or velocity not using reflection or reradiation using electromagnetic waves other than radio waves

Abstract

The embodiment of the invention relates to the technical field of electronics, and discloses a data processing method and device. Wherein, the method comprises the following steps: the data processing device acquires the light intensity detected by the light sensor, and when the light intensity is judged not to be within the preset light intensity range, the light sensor meets the interrupt condition, so that the data processing device can further acquire the distance detected by the proximity sensor and report the distance to the terminal. By the mode, the data processing device can report the data of the proximity sensor to the terminal under the condition that the light sensor meets the interrupt condition and needs to report the data, so that the accuracy of the distance between the terminal and the obstacle can be improved.

Description

Data processing method and device and related medium product
Technical Field
The invention relates to the technical field of electronics, in particular to a data processing method and device and a related medium product.
Background
At present, terminals such as smart phones and tablet computers are equipped with various sensors, such as an ambient light sensor (also referred to as a light sensor), a proximity sensor, a gravity sensor, etc., and the working states of the sensors can be classified into a polling state (reporting data regularly) and an interruption state (reporting data when an interruption condition is met) according to a data reporting mode. The proximity sensor is a sensor operating in an interruption state, and generally triggers interruption when a distance state between the proximity sensor and an obstacle changes, that is, the proximity sensor reports a detected distance only when the distance between the obstacles changes from close to far or from far to close. Therefore, the existing data reporting mode of the proximity sensor can cause that the terminal cannot accurately acquire the distance between the terminal and the obstacle.
Disclosure of Invention
The embodiment of the invention discloses a data processing method and device, which can improve the accuracy of the distance between a terminal and an obstacle.
The embodiment of the invention discloses a data processing method, which comprises the following steps:
the data processing device acquires the light intensity detected by the light sensor and judges whether the light intensity is within a preset light intensity range or not;
when the light intensity is not within the preset light intensity range, the data processing device acquires the distance detected by the proximity sensor;
and the data processing device reports the distance to the terminal.
As a possible implementation, after the data processing device obtains the distance detected by the proximity sensor, the method further includes:
the data processing device judges whether the distance is consistent with a recorded historical reporting distance or not, and when the distance is inconsistent with the historical reporting distance, the data processing device executes the step of reporting the distance to the terminal;
after the data processing device reports the distance to the terminal, the method further includes:
and the data processing device updates the historical reporting distance into the distance.
As another possible implementation, after the data processing device obtains the distance detected by the proximity sensor, the method further includes:
the data processing device acquires an application program currently operated by the terminal;
and the data processing device judges whether the application program is the application program of the specified type, and when the application program is the application program of the specified type, the data processing device executes the step of reporting the distance to the terminal.
As another possible implementation, the method further includes:
when the light intensity is not within the preset light intensity range, the data processing device detects the screen state of the terminal, wherein the screen state comprises a screen-off state and a screen-on state;
and when the terminal is in the bright screen state, the data processing device reports the light intensity to the terminal.
As another possible implementation, the data processing apparatus obtains the light intensity detected by the light sensor and determines whether the light intensity is within a preset light intensity range, and the method further includes:
and the data processing device sets the upper and lower threshold values of the preset light intensity range as the same threshold value.
Correspondingly, the embodiment of the invention discloses a data processing device, which can comprise:
the acquisition unit is used for acquiring the light intensity detected by the light sensor;
the judging unit is used for judging whether the light intensity is within a preset light intensity range;
the acquisition unit is further used for acquiring the distance detected by the proximity sensor when the judgment unit judges that the light intensity is not within the preset light intensity range;
and the reporting unit is used for reporting the distance to the terminal.
As a feasible implementation manner, the determining unit is further configured to determine whether the distance is consistent with a recorded historical reporting distance, and when the distance is inconsistent with the historical reporting distance, trigger the reporting unit to perform the operation of reporting the distance to the terminal;
the device further comprises:
and the updating unit is used for updating the historical reporting distance into the distance after the reporting unit reports the distance to the terminal.
As another possible implementation manner, the obtaining unit is further configured to obtain an application currently running by the terminal;
the judging unit is further configured to judge whether the application program is an application program of a specified type, and when the application program is the application program of the specified type, trigger the reporting unit to perform the operation of reporting the distance to the terminal.
As yet another possible implementation, the apparatus further includes:
the detection unit is used for detecting the screen state of the terminal when the light intensity is not within the preset light intensity range, wherein the screen state comprises a screen off state and a screen on state;
the reporting unit is further configured to report the light intensity to the terminal when the terminal is in the bright screen state.
As yet another possible implementation, the apparatus further includes:
and the setting unit is used for setting the upper and lower limit thresholds of the preset light intensity range as the same threshold.
The embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, when the data processing device acquires the light intensity detected by the light sensor and judges that the light intensity is not in the preset light intensity range, the light sensor meets the interrupt condition, and the data processing device can further acquire the distance detected by the proximity sensor and report the distance to the terminal. By the mode, the data processing device can report the data of the proximity sensor to the terminal under the condition that the light sensor meets the interrupt condition and needs to report the data, so that the accuracy of the distance between the terminal and the obstacle can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a data processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another data processing method disclosed in the embodiment of the invention;
FIG. 3 is a flow chart illustrating a further data processing method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another data processing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of another data processing apparatus according to an embodiment of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 embodiment of the invention discloses a data processing method and device, which can improve the accuracy of the distance between a terminal and an obstacle. The following are detailed below.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a data processing method according to an embodiment of the present invention. The method shown in fig. 1 may be applied to a terminal configured with a light sensor and a proximity sensor, such as a smart phone (e.g., an Android Mobile phone, an iOS Mobile phone, etc.), a tablet computer, a palm computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and an intelligent wearable Device. As shown in fig. 1, the data processing method may include the steps of:
101. the data processing device acquires the light intensity detected by the light sensor.
In this embodiment of the present invention, the data processing apparatus may be a terminal, such as a smart phone and a tablet computer, or may be a sensor management module on the terminal, which is capable of performing centralized management on various sensors, including a light sensor, a proximity sensor, a gravity sensor, and the like, and the embodiment of the present invention is not limited thereto.
The following description will be made with a data processing apparatus as a sensor management module.
In the embodiment of the invention, when various sensors configured on the terminal need to report data, the data are reported to a central processing module of the terminal by the data processing device in a unified manner, so that the terminal adjusts the terminal parameters according to the reported data.
It should be noted that the light sensor is also a sensor operating in the interrupt state, and the interrupt condition is that the detected light intensity is greater than the upper threshold of the preset light intensity range or less than the lower threshold of the preset light intensity range. In the prior art, when the light sensor is interrupted, the data processing device reports data of the light sensor, and when the proximity sensor is interrupted, the data processing device reports data of the proximity sensor.
In the embodiment of the invention, the light sensor detects the light intensity in the environment periodically, namely detects a group of light intensity values when the integration period comes, so that the detected light intensity is sent to the data processing device, and the data processing device can periodically receive the light intensity detected by the light sensor.
102. The data processing device judges whether the light intensity is within a preset light intensity range, if so, the process is ended; if not, go to step 103.
In the embodiment of the present invention, after obtaining the light intensity detected by the light sensor, the data processing device may determine whether the light intensity is within a preset light intensity range. If the light sensor does not trigger interruption, namely the data processing device does not report the data detected by the sensor; if not, the light sensor triggers an interrupt, i.e. the data processing device reports the data detected by the sensor.
Further, in order to enable the data processing apparatus to report data in time, the data processing apparatus may set the preset light intensity range to be a small value, that is, the difference between the upper and lower threshold values is small, so that the light sensor may easily trigger the interrupt.
103. The data processing device acquires the distance detected by the proximity sensor.
In the embodiment of the present invention, when the data processing device determines that the light intensity is not within the preset light intensity range, the light sensor triggers an interrupt, and then the data processing device further obtains the distance between the obstacle and the light intensity detected by the proximity sensor.
104. And the data processing device reports the distance to the terminal and ends the process.
In the embodiment of the present invention, when the light sensor is triggered to be interrupted, the data processing apparatus may report the obtained distance to the terminal, or report the obtained intensity and the obtained distance to the terminal together, so that the terminal can accurately obtain the distance of the proximity sensor, thereby implementing the detection of the accuracy of the proximity sensor, or adjusting various parameters of the terminal, such as screen brightness, volume, photographing mode, and the like, according to the distance.
Further, the data processing device may also report the detected distance when the approaching/departing state of the proximity sensor changes.
It can be seen that, in the method described in fig. 1, when the data processing device acquires the light intensity detected by the light sensor and determines that the light intensity is not within the preset light intensity range, the light sensor satisfies the interrupt condition, and the data processing device can further acquire the distance detected by the proximity sensor and report the distance to the terminal. By the mode, the data processing device can report the data of the proximity sensor to the terminal under the condition that the light sensor meets the interrupt condition and needs to report the data, so that the accuracy of the distance between the terminal and the obstacle can be improved.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating another data processing method according to an embodiment of the present invention. The method shown in fig. 2 may be applied to a terminal configured with a light sensor and a proximity sensor, such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a PDA, an MID, an intelligent wearable device, etc. As shown in fig. 2, the data processing method may include the steps of:
201. the data processing device acquires the light intensity detected by the light sensor.
202. The data processing device judges whether the light intensity is within a preset light intensity range, if so, the process is ended; if not, go to step 203.
203. The data processing device acquires the distance detected by the proximity sensor.
204. The data processing device judges whether the distance is consistent with the recorded historical reporting distance, and if so, the process is ended; if not, go to step 205.
In the embodiment of the present invention, the data processing apparatus may record the distance detected by the proximity sensor as a historical reporting distance each time the distance is reported. The data processing device may further determine whether the distance detected by the proximity sensor is consistent with the recorded historical reported distance after acquiring the distance. If the distance is consistent with the historical reporting distance, the fact that the distance between the obstacle and the distance detected by the proximity sensor does not change is indicated, and therefore the obtained distance can not be reported. Therefore, repeated reporting can be avoided, and the power consumption of the terminal can be reduced to a certain extent. If the distance is inconsistent with the historical reporting distance, the data processing device can report the distance to the terminal.
As a possible implementation, the data processing apparatus may further determine whether the approaching/departing state of the proximity sensor changes, that is, whether the distance between the obstacle and the proximity sensor changes from the approaching state to the departing state or from the departing state to the approaching state, while determining whether the distance matches the historical reported distance. If there is a change, the data processing device can report the distance to the terminal even if the distance is consistent with the historical reporting distance. At the same time, the data sensor may also report the proximity/distancing status of the proximity sensor.
205. And the data processing device reports the distance to the terminal.
In the embodiment of the invention, when the data processing device judges that the distance is inconsistent with the historical reporting distance, the data processing device can indicate that the distance between the obstacle and the proximity sensor changes, so that the data processing device can report the acquired distance to the terminal, and the terminal can accurately acquire the distance of the proximity sensor, thereby realizing the detection of the precision of the proximity sensor, or adjusting various parameters of the terminal such as screen brightness, volume, photographing mode and the like according to the distance.
206. And the data processing device updates the historical reporting distance into the distance and ends the process.
In the embodiment of the invention, the data processing device can update the historical reporting distance to the distance after successfully reporting the distance to the terminal, so that whether the distance detected by the proximity sensor needs to be reported when the next interrupt is generated can be conveniently judged.
As a possible implementation manner, when the light intensity is determined not to be within the preset light intensity range, the data processing apparatus may further perform the following steps:
11) the data processing device detects the screen state of the terminal;
12) when the terminal is in a bright screen state, the data processing device reports the light intensity to the terminal.
In a specific implementation, the screen state includes a screen-off state and a screen-on state. The light sensor is generally used for adjusting the screen brightness of the terminal and the like, and in order to save the power consumption of the terminal, even if the data processing device judges that the light intensity detected by the light sensor is not within a preset light intensity range in the screen off state, the light intensity cannot be reported to the terminal even if the data processing device triggers interruption. If the light sensor triggers an interrupt in the bright screen state, the data processing device can report the light intensity and the distance detected by the proximity sensor to the terminal together.
Further, when the terminal is in a bright screen state, if the distance detected by the proximity sensor is consistent with the historical reporting distance, the data processing device only reports the light intensity; if the distance detected by the proximity sensor is inconsistent with the historical reported distance, the data processing device reports the light intensity and the distance at the same time.
It can be seen that, in the method described in fig. 2, when the light sensor triggers the interrupt and acquires the distance detected by the proximity sensor, the data processing apparatus further determines whether the distance is consistent with the historical reporting distance, and reports the distance only when the distance is inconsistent with the historical reporting distance, and if so, may report only the light intensity. Further, the data processing device reports the light intensity when determining that the terminal is in a bright screen state. That is, the intensity and distance of the light are reported to the terminal only when needed, so that the power consumption of the terminal can be saved.
Referring to fig. 3, fig. 3 is a schematic flow chart illustrating another data processing method according to an embodiment of the present invention. The method shown in fig. 3 may be applied to a terminal configured with a light sensor and a proximity sensor, such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a PDA, an MID, an intelligent wearable device, etc. As shown in fig. 3, the data processing method may include the steps of:
301. the data processing device sets the upper and lower threshold values of the preset light intensity range as the same threshold value.
In the embodiment of the invention, if the terminal needs to acquire the distance detected by the proximity sensor in real time, the data processing device can set the upper and lower limit thresholds of the preset light intensity range to be the same threshold in advance, and specifically can set the thresholds to be zero, so that the light sensor can trigger interruption frequently, and the data processing device can report data in real time so as to improve the accuracy of acquiring the distance between the terminal and the obstacle.
302. The data processing device acquires the light intensity detected by the light sensor.
303. The data processing device judges whether the light intensity is within a preset light intensity range, if so, the process is ended; if not, go to step 304.
304. The data processing device acquires the distance detected by the proximity sensor.
305. The data processing device obtains an application program currently running by the terminal.
In the embodiment of the invention, after the data processing device obtains the distance detected by the proximity sensor, the data processing device further obtains the application program currently operated by the terminal. The currently running application may be understood as a foreground running application or a background running application, which is not limited in the embodiments of the present invention.
Specifically, the data processing apparatus may acquire the identification information of the application program, such as an application icon, an application name, and the like, of the application program currently running in the terminal.
306. The data processing apparatus determines whether the application is a specified type of application, if yes, go to step 307; if not, the flow is ended.
In the embodiment of the present invention, after acquiring the application currently running in the terminal, the data processing apparatus may further determine whether the application is an application of a specified type. The application program of the specified type may be understood as an application program that needs to adjust a part of parameters or functions in the application program according to the distance between the obstacle detected by the proximity sensor, such as a call application, a camera application, and the like. During the call, the terminal may determine whether to turn on or off the screen according to the distance from the obstacle. When the front camera of the camera application is started, the terminal may adjust a photographing mode or adjust focusing according to a distance between the terminal and the user, which is not limited in the embodiment of the present invention.
Therefore, when the data processing device judges that the application is the application program of the specified type, the data processing device can report the distance detected by the proximity sensor to the terminal; when the data processing device judges that the application is not the application program of the specified type, the distance detected by the proximity sensor is not reported to the terminal, so that the terminal power consumption can be saved by conditionally reporting the distance.
307. The data processing device reports the distance to the terminal and ends the process.
It can be seen that, in the method described in fig. 3, when the light sensor triggers the interrupt and obtains the distance detected by the proximity sensor, the data processing apparatus further determines whether the application currently running in the terminal is an application of the specified type, and reports the distance to the terminal when the application is the application of the specified type. If not, only the light intensity may be reported. That is, the intensity and distance of the light are reported to the terminal only when needed, so that the power consumption of the terminal can be saved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention. The data processing apparatus 400 shown in fig. 4 may be applied to a terminal configured with a light sensor and a proximity sensor, such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a PDA, an MID, an intelligent wearable device, and the like. As shown in fig. 4, the data processing apparatus 400 may include:
an obtaining unit 401 is configured to obtain the intensity of the light detected by the light sensor.
In the embodiment of the present invention, when various sensors configured on the terminal need to report data, the data is uniformly reported to the central processing module of the terminal by the data processing apparatus 400, so that the terminal adjusts the terminal parameters according to the reported data.
It should be noted that the light sensor is also a sensor operating in the interrupt state, and the interrupt condition is that the detected light intensity is greater than the upper threshold of the preset light intensity range or less than the lower threshold of the preset light intensity range. In the prior art, when the light sensor is interrupted, the data processing device reports data of the light sensor, and when the proximity sensor is interrupted, the data processing device reports data of the proximity sensor.
In the embodiment of the present invention, since the light sensor detects the light intensity in the environment periodically, that is, detects a set of light intensity values when the integration period comes, the detected light intensity is sent to the data processing device, and the data processing device 400 can periodically receive the light intensity detected by the light sensor.
The determining unit 402 is configured to determine whether the light intensity is within a predetermined light intensity range.
In this embodiment of the present invention, after the obtaining unit 401 of the data processing apparatus 400 obtains the light intensity detected by the light sensor, the determining unit 402 may determine whether the light intensity is within a preset light intensity range. If the light sensor does not trigger interruption, namely the data processing device does not report the data detected by the sensor; if not, the light sensor triggers an interrupt, i.e. the reporting unit 403 reports the data detected by the sensor.
Further, in order to enable the reporting unit 403 to report the data in a timely manner, the data processing apparatus 400 may set the preset light intensity range to be smaller, that is, the difference between the upper and lower threshold values is smaller, so that the light sensor may easily trigger the interrupt.
The obtaining unit 401 is further configured to obtain the distance detected by the proximity sensor when the determining unit 402 determines that the light intensity is not within the preset light intensity range.
A reporting unit 403, configured to report the distance acquired by the acquiring unit 401 to the terminal.
Referring to fig. 5, fig. 5 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present invention. The data processing apparatus 400 shown in fig. 5 is optimized based on the data processing apparatus 400 shown in fig. 4. As shown in fig. 5, the data processing apparatus 400 may further include:
the determining unit 402 is further configured to determine whether the acquired distance of the acquiring unit 401 is consistent with the recorded historical reporting distance, and if not, trigger the reporting unit 403 to report the distance to the terminal.
The data processing apparatus 400 may further include:
an updating unit 404, configured to update the historical reporting distance to the distance.
As a possible implementation manner, the obtaining unit 401 is further configured to obtain an application currently running by the terminal.
The determining unit is configured to determine whether the application is an application of a specified type, and if so, trigger the reporting unit 403 to report the distance to the terminal.
As another possible implementation, the data processing apparatus 400 may further include:
a detecting unit 405, configured to detect a screen state of the terminal when the determining unit 402 determines that the light intensity is not within the preset light intensity range, where the screen state includes a screen-off state and a screen-on state.
The reporting unit 403 is further configured to report the light intensity obtained by the obtaining unit 401 to the terminal when the terminal is in a bright screen state.
As another possible implementation, the data processing apparatus 400 may further include:
the setting unit 406 is configured to set the upper and lower threshold values of the preset light intensity range as the same threshold value.
In the embodiment of the present invention, if the terminal needs to acquire the distance detected by the proximity sensor in real time, the setting unit 406 may set the upper and lower threshold values of the preset light intensity range to the same threshold value in advance, and may specifically set both the upper and lower threshold values to zero, so that the light sensor will trigger an interrupt frequently, and the reporting unit 403 may report data in real time, so as to improve the accuracy of acquiring the distance from the terminal to the obstacle.
It can be seen that, in the data processing apparatus described in fig. 4 and 5, when the data processing apparatus acquires the light intensity detected by the light sensor and determines that the light intensity is not within the preset light intensity range, the light sensor satisfies the interrupt condition, and the data processing apparatus can further acquire the distance detected by the proximity sensor and report the distance to the terminal. By the mode, the data processing device can report the data of the proximity sensor to the terminal under the condition that the light sensor meets the interrupt condition and needs to report the data, so that the accuracy of the distance between the terminal and the obstacle can be improved. Further, after obtaining the distance, the data processing device reports the distance only when the distance is inconsistent with the historical reporting distance or the current running application program of the terminal is an application program of a specified type. Therefore, the distance is reported when needed, and the power consumption of the terminal can be saved.
Referring to fig. 6, fig. 4 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present disclosure. The data processing apparatus 600 shown in fig. 6 may be applied to a terminal configured with a light sensor and a proximity sensor, such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a PDA, an MID, an intelligent wearable device, and the like. The data processing apparatus 600 may comprise at least one processor 601, such as a CPU, a communication interface 602, a memory 603 and at least one communication bus 604, wherein the memory 603 may be a high-speed RAM memory, a non-volatile memory (non-volatile memory), such as at least one disk memory, and optionally, the memory 603 may also be at least one storage device located remotely from the processor 601. Wherein:
the communication bus 604 is used for connection communication among the processor 601, the communication interface 602, and the memory 603.
A set of program code is stored in the memory 603 and the processor 601 is configured to call the program code stored in the memory 603, performing the following:
acquiring the light intensity detected by a light sensor, and judging whether the light intensity is within a preset light intensity range;
when the light intensity is judged not to be within the preset light intensity range, the distance detected by the proximity sensor is acquired;
and reporting the distance to the terminal.
As a possible implementation, the processor 601, after acquiring the distance detected by the proximity sensor, is further configured to call the program code stored in the memory 603, and perform the following operations:
judging whether the distance is consistent with the recorded historical reporting distance or not, and if not, reporting the distance to the terminal;
and after reporting the distance to the terminal, may further perform the following operations:
and updating the historical reporting distance to the distance.
As another possible implementation, the processor 601, when determining that the light intensity is not within the preset light intensity range, is further configured to call the program code stored in the memory 603, and perform the following operations:
detecting the screen state of the terminal;
when the terminal is in a bright screen state, the data processing device reports the light intensity to the terminal.
When the light sensor triggers an interrupt and acquires the distance detected by the proximity sensor, the data processing apparatus 600 further determines whether the distance is consistent with the historical reporting distance, reports the distance if the distance is inconsistent with the historical reporting distance, and if so, only reports the light intensity. Further, the data processing apparatus 600 reports the light intensity when it is determined that the terminal is in the bright screen state. That is, the intensity and distance of the light are reported to the terminal only when needed, so that the power consumption of the terminal can be saved.
As another possible implementation, the processor 601, after acquiring the distance detected by the proximity sensor, is further configured to call the program code stored in the memory 603, and perform the following operations:
acquiring an application program currently operated by a terminal;
and judging whether the application program is the application program of the specified type, and if so, reporting the distance to the terminal.
When the light sensor triggers the interrupt and the distance detected by the proximity sensor is acquired, the data processing apparatus 600 further determines whether the application currently running in the terminal is an application of a specified type, and reports the distance to the terminal when the application is the application of the specified type. If not, only the light intensity may be reported. That is, the intensity and distance of the light are reported to the terminal only when needed, so that the power consumption of the terminal can be saved.
As another possible implementation, the processor 601 is further configured to call the program code stored in the memory 603 before obtaining the intensity of the light detected by the light sensor, and perform the following operations:
and setting the upper and lower threshold values of the preset light intensity range as the same threshold value.
In the embodiment of the present invention, if the terminal needs to acquire the distance detected by the proximity sensor in real time, the data processing device 600 may set the upper and lower threshold values of the preset light intensity range to be the same threshold value in advance, and may specifically set both the upper and lower threshold values to be zero, so that the light sensor will trigger an interrupt frequently, and the data processing device 600 may report data in real time, so as to improve the accuracy of acquiring the distance from the terminal to the obstacle.
It can be seen that, in the data processing apparatus shown in fig. 6, when the data processing apparatus acquires the light intensity detected by the light sensor and determines that the light intensity is not within the preset light intensity range, the light sensor satisfies the interrupt condition, and the data processing apparatus can further acquire the distance detected by the proximity sensor and report the distance to the terminal. By the mode, the data processing device can report the data of the proximity sensor to the terminal under the condition that the light sensor meets the interrupt condition and needs to report the data, so that the accuracy of the distance between the terminal and the obstacle can be improved. Further, after obtaining the distance, the data processing device reports the distance only when the distance is inconsistent with the historical reporting distance or the current running application program of the terminal is an application program of a specified type. Therefore, the distance is reported when needed, and the power consumption of the terminal can be saved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (8)

1. A data processing method, comprising:
the method comprises the steps that a data processing device obtains light intensity detected by a light sensor and judges whether the light intensity is within a preset light intensity range, wherein upper and lower threshold values of the preset light intensity range are set to be identical threshold values, and the threshold values are zero;
when the light intensity is not within the preset light intensity range, the data processing device acquires the distance detected by the proximity sensor;
the data processing device reports the distance to the terminal;
wherein after the data processing device acquires the distance detected by the proximity sensor, the method further comprises: the data processing device judges whether the distance is consistent with a recorded historical reporting distance or not, and when the distance is inconsistent with the historical reporting distance, the data processing device executes the step of reporting the distance to the terminal;
after the data processing device reports the distance to the terminal, the method further includes: the data processing device updates the historical reporting distance to the distance;
wherein after the data processing device acquires the distance detected by the proximity sensor, the method further comprises:
the data processing device acquires an application program currently operated by the terminal; and the data processing device judges whether the application program is an application program of a specified type, and when the application program is the application program of the specified type, the data processing device executes the step of reporting the distance to the terminal, wherein the application program is an application program which needs to adjust partial parameters or functions in the application program according to the distance between the obstacle and the application program detected by the proximity sensor.
2. The method of claim 1, further comprising:
when the light intensity is not within the preset light intensity range, the data processing device detects the screen state of the terminal, wherein the screen state comprises a screen-off state and a screen-on state;
and when the terminal is in the bright screen state, the data processing device reports the light intensity to the terminal.
3. The method as claimed in any one of claims 1 to 2, wherein the data processing device obtains the light intensity detected by the light sensor and determines whether the light intensity is within a predetermined light intensity range, and the method further comprises:
and the data processing device sets the upper and lower threshold values of the preset light intensity range as the same threshold value.
4. A data processing apparatus, comprising:
the acquisition unit is used for acquiring the light intensity detected by the light sensor;
the judging unit is used for judging whether the light intensity is in a preset light intensity range, the upper and lower threshold values of the preset light intensity range are set to be the same threshold value, and the threshold value is zero;
the acquisition unit is further used for acquiring the distance detected by the proximity sensor when the judgment unit judges that the light intensity is not within the preset light intensity range;
a reporting unit, configured to report the distance to a terminal;
wherein the content of the first and second substances,
the judging unit is further configured to judge whether the distance is consistent with a recorded historical reporting distance, and when the distance is inconsistent with the historical reporting distance, trigger the reporting unit to perform the operation of reporting the distance to the terminal;
the device further comprises:
an updating unit, configured to update the historical reporting distance to the distance after the reporting unit reports the distance to the terminal;
wherein the content of the first and second substances,
the acquiring unit is further used for acquiring the application program currently operated by the terminal;
the judging unit is further configured to judge whether the application program is an application program of a specified type, and when the application program is the application program of the specified type, the reporting unit is triggered to perform the operation of reporting the distance to the terminal, where the application program is an application program that needs to adjust a part of parameters or functions in the application program according to the distance between the application program and the obstacle detected by the proximity sensor.
5. The apparatus of claim 4, further comprising:
the detection unit is used for detecting the screen state of the terminal when the light intensity is not within the preset light intensity range, wherein the screen state comprises a screen off state and a screen on state;
the reporting unit is further configured to report the light intensity to the terminal when the terminal is in the bright screen state.
6. The apparatus of any one of claims 4 to 5, further comprising:
and the setting unit is used for setting the upper and lower limit thresholds of the preset light intensity range as the same threshold.
7. A computer storage medium comprising, in combination,
the computer storage medium stores a program for instructing associated hardware to perform the method of any one of claims 1 to 3.
8. A mobile terminal, comprising: a processor and a memory; wherein the processor is configured to call program code stored in the memory to perform performing the method of any of claims 1 to 3.
CN201810031979.7A 2016-03-16 2016-03-16 Data processing method and device and related medium product Expired - Fee Related CN108445475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810031979.7A CN108445475B (en) 2016-03-16 2016-03-16 Data processing method and device and related medium product

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810031979.7A CN108445475B (en) 2016-03-16 2016-03-16 Data processing method and device and related medium product
CN201610151329.7A CN105842680B (en) 2016-03-16 2016-03-16 A kind of data processing method and device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201610151329.7A Division CN105842680B (en) 2016-03-16 2016-03-16 A kind of data processing method and device

Publications (2)

Publication Number Publication Date
CN108445475A CN108445475A (en) 2018-08-24
CN108445475B true CN108445475B (en) 2021-01-22

Family

ID=56587090

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810031979.7A Expired - Fee Related CN108445475B (en) 2016-03-16 2016-03-16 Data processing method and device and related medium product
CN201610151329.7A Active CN105842680B (en) 2016-03-16 2016-03-16 A kind of data processing method and device

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201610151329.7A Active CN105842680B (en) 2016-03-16 2016-03-16 A kind of data processing method and device

Country Status (1)

Country Link
CN (2) CN108445475B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325541B (en) * 2016-08-12 2018-07-03 广东欧珀移动通信有限公司 A kind of proximity sensor status information acquiring method, device and mobile terminal
CN106254661B (en) * 2016-08-15 2019-09-13 Oppo广东移动通信有限公司 A kind of data processing method of proximity sensor, device and mobile terminal
WO2019041321A1 (en) * 2017-09-01 2019-03-07 深圳传音通讯有限公司 Mobile terminal screen switch-off control method, apparatus, and computer storage medium
CN110233936B (en) * 2019-07-04 2021-02-12 Oppo广东移动通信有限公司 Proximity state acquisition method, proximity state acquisition device, computer device, and storage medium
CN112859050B (en) * 2019-11-27 2023-09-15 宇龙计算机通信科技(深圳)有限公司 Correction method and device for optical distance sensor, storage medium and terminal

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140106822A1 (en) * 2010-06-30 2014-04-17 Eldrege Smith Multi-Screen Personal Communication Device
CN102447787B (en) * 2011-12-09 2014-10-29 惠州Tcl移动通信有限公司 Mobile phone and method for controlling of prompt tone
CN103165102A (en) * 2011-12-09 2013-06-19 鸿富锦精密工业(深圳)有限公司 Display device and brightness adjustment method thereof
CN102662524A (en) * 2012-04-24 2012-09-12 深圳市拓盛电子科技有限公司 Electronic device
CN102799330B (en) * 2012-07-26 2016-04-13 惠州Tcl移动通信有限公司 Based on the sensor connecting circuit of electronic equipment and control method thereof and electronic equipment
CN103873667A (en) * 2012-12-17 2014-06-18 比亚迪股份有限公司 Method for detecting distance between user and mobile terminal and mobile terminal
CN103873670B (en) * 2012-12-17 2017-04-19 联想(北京)有限公司 Method and electronic equipment for controlling flexible screen shape
CN103902112A (en) * 2012-12-26 2014-07-02 联想(北京)有限公司 Control method and electronic equipment
CN104618565A (en) * 2013-11-04 2015-05-13 深圳富泰宏精密工业有限公司 Anti-misoperation electronic device and method
CN104407399B (en) * 2014-12-02 2017-01-04 三星半导体(中国)研究开发有限公司 For the method at portable terminal alignment proximity transducer
CN104683598B (en) * 2015-03-25 2017-06-09 广东欧珀移动通信有限公司 Proximity transducer threshold value adjusting method, device and smart machine
CN104700597A (en) * 2015-03-27 2015-06-10 苏州艾果智能科技有限公司 System and method for remotely controlling electric appliances through distance induction
CN105022633A (en) * 2015-07-14 2015-11-04 深圳市金立通信设备有限公司 Solving method of hotkey conflict and terminal
KR101584962B1 (en) * 2015-09-02 2016-01-13 (주)아이티엔제이 System for blocking use of mobile device during driving and method therefor
CN105357375A (en) * 2015-10-15 2016-02-24 Tcl移动通信科技(宁波)有限公司 Method for stabilizing distance of proximity sensor in mobile terminal, and mobile terminal

Also Published As

Publication number Publication date
CN108445475A (en) 2018-08-24
CN105842680A (en) 2016-08-10
CN105842680B (en) 2018-01-23

Similar Documents

Publication Publication Date Title
CN108445475B (en) Data processing method and device and related medium product
CN108550353B (en) Brightness adjusting method and related product
CN106507445B (en) Wireless fidelity Wi-Fi scanning method and mobile terminal
CN107582028B (en) Sleep monitoring method and device
EP3644219A1 (en) Human face feature point tracking method, device, storage medium and apparatus
CN108896911B (en) Charging abnormity detection method and device for electronic equipment
EP3163498A2 (en) Alarming method and device
EP2990949B1 (en) Methods and devices for backing up file
CN108764056B (en) Brightness adjusting method and related product
US10587741B2 (en) Communication event processing method and apparatus
CN107111882B (en) Stripe set searching method, device and system
CN109672978B (en) Wireless hotspot scanning frequency control method and device
CN112669583A (en) Alarm threshold value adjusting method and device, electronic equipment and storage medium
CN112050970B (en) Environment monitoring method and device
CN111078446A (en) Fault information acquisition method and device, electronic equipment and storage medium
CN108108117B (en) Screen capturing method and device and terminal
CN106055458A (en) Charging reminding method, device and mobile device
CN107302633B (en) Application control method, device, storage medium and electronic equipment
CN112530205A (en) Airport parking apron airplane state detection method and device
CN111046742A (en) Eye behavior detection method and device and storage medium
CN110800277B (en) Call processing method and related product
CN108304123B (en) Page display control method and related product
CN107832669B (en) Face detection method and related product
CN107343100B (en) Information prompting method and device, storage medium and electronic equipment
CN108362322B (en) Sensor testing method and device and readable 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

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

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

Address before: 523860 No. 18 Wusha Haibin Road, Chang'an Town, Dongguan City, Guangdong Province

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: 20210122

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