CN109186657B - Proximity sensor parameter calibration method and device, terminal equipment and storage medium - Google Patents

Proximity sensor parameter calibration method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN109186657B
CN109186657B CN201811124230.3A CN201811124230A CN109186657B CN 109186657 B CN109186657 B CN 109186657B CN 201811124230 A CN201811124230 A CN 201811124230A CN 109186657 B CN109186657 B CN 109186657B
Authority
CN
China
Prior art keywords
parameter value
calibration parameter
calibration
proximity sensor
value
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
CN201811124230.3A
Other languages
Chinese (zh)
Other versions
CN109186657A (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 CN201811124230.3A priority Critical patent/CN109186657B/en
Publication of CN109186657A publication Critical patent/CN109186657A/en
Application granted granted Critical
Publication of CN109186657B publication Critical patent/CN109186657B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electronic Switches (AREA)

Abstract

The embodiment of the application discloses a method, a device, terminal equipment and a storage medium for calibrating parameters of a proximity sensor, wherein the method comprises the steps of writing a first calibration parameter value into a parameter data set of a nonvolatile file; when generation of a second calibration parameter value is detected, acquiring the first calibration parameter value, and determining whether a difference value between the first calibration parameter value and the second calibration parameter value meets a calibration parameter value updating condition; if the updating condition of the calibration parameter value is not met, the first calibration parameter value is determined as the current calibration parameter of the proximity sensor, the method and the system improve the rationality of parameter calibration of the proximity sensor, and perfect the parameter calibration function of the proximity sensor.

Description

Proximity sensor parameter calibration method and device, terminal equipment and storage medium
Technical Field
The embodiment of the application relates to computer technologies, and in particular, to a method and an apparatus for calibrating a proximity sensor parameter, a terminal device, and a storage medium.
Background
With the increase of the popularity of terminal devices, more and more users use the terminal devices to perform various functions to meet their own needs, such as reading characters, watching videos, listening to music, playing games, etc., and the terminal devices integrate various sensors for function assistance, such as acceleration sensors, illumination sensors, proximity sensors, cameras, etc.
Wherein, proximity sensor sets up in the screen top, mainly used shelters from the detection of thing, in the terminal equipment use, it is the state of being close to detect the corresponding definite terminal state when having the shelter, the control screen extinguishes, when detecting not having the shelter, confirm the terminal state and be the state of keeping away from, the bright screen of control screen, because proximity sensor's control function receives external environment and terminal equipment self to be stained with the interference of greasy dirt easily, the event needs to calibrate proximity sensor parameter in the proximity sensor use, current calibration mode has the defect, need improve.
Disclosure of Invention
The application provides a method and a device for calibrating parameters of a proximity sensor, terminal equipment and a storage medium, which improve the rationality of parameter calibration of the proximity sensor and perfect the parameter calibration function of the proximity sensor.
In a first aspect, an embodiment of the present application provides a method for calibrating a proximity sensor parameter, including:
writing the first calibration parameter value into a parameter dataset of the non-volatile file;
when generation of a second calibration parameter value is detected, acquiring the first calibration parameter value, and determining whether a difference value between the first calibration parameter value and the second calibration parameter value meets a calibration parameter value updating condition;
and if the calibration parameter value updating condition is not met, determining the first calibration parameter value as the current calibration parameter of the proximity sensor.
In a second aspect, an embodiment of the present application further provides a proximity sensor parameter calibration apparatus, including:
the parameter recording module is used for writing the first calibration parameter value into a parameter data set of the nonvolatile file;
the parameter comparison module is used for acquiring the first calibration parameter value when the generation of a second calibration parameter value is detected, and determining whether the difference value between the first calibration parameter value and the second calibration parameter value meets the calibration parameter value updating condition;
and the parameter updating module is used for determining the first calibration parameter value as the current calibration parameter of the proximity sensor if the calibration parameter value updating condition is not met.
In a third aspect, an embodiment of the present application further provides a terminal device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor, the processor when executing the computer program implementing a proximity sensor parameter calibration method as described in embodiments of the present application.
In a fourth aspect, the present application further provides a storage medium containing terminal device executable instructions, which when executed by a terminal device processor, are configured to perform the proximity sensor parameter calibration method according to the present application.
In the scheme, a first calibration parameter value is written into a parameter data set of the nonvolatile file; when generation of a second calibration parameter value is detected, acquiring the first calibration parameter value, and determining whether a difference value between the first calibration parameter value and the second calibration parameter value meets a calibration parameter value updating condition; if the updating condition of the calibration parameter value is not met, the first calibration parameter value is determined as the current calibration parameter of the proximity sensor, the method and the system improve the rationality of parameter calibration of the proximity sensor, and perfect the parameter calibration function of the proximity sensor.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a method for calibrating parameters of a proximity sensor according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of another method for calibrating parameters of a proximity sensor provided in an embodiment of the present application;
FIG. 3 is a flow chart of another method for calibrating parameters of a proximity sensor provided in an embodiment of the present application;
FIG. 4 is a flow chart of another method for calibrating parameters of a proximity sensor provided in an embodiment of the present application;
fig. 5 is a block diagram illustrating a proximity sensor parameter calibration apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are for purposes of illustration and not limitation. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of a method for calibrating a proximity sensor parameter according to an embodiment of the present application, which is applicable to calibrating a proximity sensor, and the method may be executed by a terminal device according to an embodiment of the present application, where a proximity sensor parameter calibration apparatus of the terminal device may be implemented in a software and/or hardware manner, as shown in fig. 1, a specific scheme provided in this embodiment is as follows:
and step S101, writing the first calibration parameter value into a parameter data set of the nonvolatile file.
In one embodiment, the proximity sensor is disposed above a screen of the terminal device, and may be an infrared proximity sensor, where the infrared proximity sensor includes an infrared transmitting tube and an infrared receiving tube, the infrared transmitting tube transmits infrared light outwards along the screen direction, the infrared receiving tube receives the infrared light reflected by the shielding object and converts the infrared light into an electrical signal, the electrical signal is amplified and analog-to-digital converted (a/D converted) processed to obtain a digital signal corresponding to the intensity of the reflected infrared light and then sent to the CPU, and the CPU determines whether the terminal device is in a shielding state according to the digital signal. Above-mentioned function is in the use, because the difference of terminal equipment place environment, like under outdoor highlight environment, the infrared light intensity that infrared receiving tube received this moment is strong when being in under the dark place environment than terminal equipment, if, again, terminal equipment pad pasting or be infected with after oil stain, also can have great error to the judgement of proximity sensor's the state of sheltering from, consequently need calibrate so that under different environmental conditions, proximity sensor's function keeps normally to the proximity sensor parameter.
The non-volatile file may be an NV (non-volatile) file of the terminal device, and the content in the NV file is not changed by operations such as shutdown, total clearing, and system upgrade of the terminal device. The first calibration parameter value may be written as an initial calibration value for proximity sensor parameter calibration into a parameter dataset of the non-volatile file, which may also contain calibration parameters for other sensors, the first calibration parameter recorded in the parameter dataset being used for subsequent calibration comparisons.
In an embodiment, the first calibration parameter value may be a calibration parameter value obtained by calibrating the proximity sensor when the terminal device leaves a factory. When the terminal device leaves the factory, hardware and software are required to be tested, and parameters of the proximity sensor are required to be calibrated so that the terminal device meets the factory requirements. The calibration parameter value obtained at the time of factory calibration may be determined as a first calibration parameter value, which may be, for example, 5, 6, or 15.
Step S102, when the generation of a second calibration parameter value is detected, acquiring the first calibration parameter value, and determining whether the difference value between the first calibration parameter value and the second calibration parameter value meets the updating condition of the calibration parameter value.
The terminal equipment can perform self-calibration of the parameters of the proximity sensor in the subsequent use process, the self-calibration can be a self-calibration mode integrated in the terminal equipment, and also can be a self-calibration function developed and accessed by a third party developer, and the functions of the proximity sensor can be kept normal under any environmental conditions through the self-calibration of the parameters of the proximity sensor. In one embodiment, the proximity sensor parameters are updated after self-calibration is completed, and the calibration process may be affected by many uncontrollable factors, so that the calibrated parameters have large deviation, and the proximity sensor fails to function if the parameters are directly updated.
In an embodiment, the second calibration parameter value may be a calibration parameter value obtained by a self-calibration manner of a proximity sensor carried by the terminal device, and when the second calibration parameter value is generated, a first calibration parameter value is obtained, and it is determined whether a difference between the first calibration parameter value and the second calibration parameter value satisfies a calibration parameter value update condition, where the first calibration parameter value may be a calibration parameter value stored in a parameter data set of an NV file, and specifically, whether the difference satisfies the calibration parameter value update condition includes: whether the absolute value of the difference is less than or equal to a preset update value, which may be 10, the second calibration parameter value may be-30, 5, 8, 10, 20, etc.
And step S103, if the calibration parameter value updating condition is not met, determining the first calibration parameter value as the current calibration parameter of the proximity sensor.
In one embodiment, when it is determined that the difference between the obtained second calibration parameter value and the first calibration parameter value does not satisfy the calibration parameter value updating condition, the previously stored first calibration parameter value is used as the current calibration parameter of the proximity sensor, that is, the calibration parameter value is not updated. And if the updating condition of the calibration parameter value is met, determining the second calibration parameter value as the current calibration parameter of the proximity sensor, and storing the second calibration parameter value in the parameter data set to replace the first calibration parameter value for comparison during subsequent calibration parameter value updating.
According to the method, when the terminal equipment generates a new calibration parameter, the calibration parameter value is compared with the stored calibration parameter value, if the updating condition is not met, the original stored calibration parameter value is continuously used for calibrating the proximity sensor parameter, and if the updating condition is met, the new calibration parameter value is used for updating the proximity sensor calibration parameter, so that the rationality of the proximity sensor parameter calibration is improved, and the parameter calibration function of the proximity sensor is perfected.
Fig. 2 is a flowchart of another proximity sensor parameter calibration method provided in an embodiment of the present application, and optionally before detecting generation of a second calibration parameter value, the method further includes: when a start-up event is detected, the proximity sensor parameters are calibrated to generate second calibration parameter values. As shown in fig. 2, the technical solution is as follows:
step S201, carrying out factory calibration of the proximity sensor parameters, and determining a first calibration parameter value.
Step S202, writing the first calibration parameter value into a parameter data set of the nonvolatile file.
Step S203, when the startup event is detected, calibrating the proximity sensor parameter to generate a second calibration parameter value.
In an embodiment, when the terminal device is switched from the power-off state to the power-on state, a second calibration parameter value is obtained when the proximity sensor is calibrated, where the second calibration parameter value may be a calibration parameter value obtained by first self-calibrating the proximity sensor after the terminal device is powered on each time.
Step S204, obtaining the first calibration parameter value, and determining whether the difference value between the first calibration parameter value and the second calibration parameter value meets the calibration parameter value updating condition.
The calibration parameter value updating condition may be the same as the calibration parameter value updating condition in step S102, and is not described herein again.
And S205, if the updating condition of the calibration parameter value is met, determining the second calibration parameter value as the current calibration parameter of the proximity sensor.
Step S206, saving the second calibration parameter value in the parameter data set to replace the first calibration parameter value.
In one embodiment, when the second calibration parameter value satisfies the update condition, the calibration parameter is replaced in the calibration parameter set, and the original first calibration parameter value is replaced by the second calibration parameter value.
Therefore, in the parameter calibration process of the proximity sensor, the parameter values meeting the updating conditions are updated and stored in the calibration parameter set, so that the calibration result is in a reasonable range every time, and the problem of failure of the proximity judgment function caused by the fact that the calibration parameters of the proximity sensor are modified due to mis-calibration or overlarge deviation of the calibration parameter values is avoided.
Fig. 3 is a flowchart of another proximity sensor parameter calibration method provided in the embodiment of the present application, and optionally, after determining a current calibration parameter of a proximity sensor, the method further includes: when the function of the proximity sensor is detected to be started, calibrating the proximity sensor parameter to generate a third calibration parameter value; and acquiring a second calibration parameter value stored in the parameter data set, determining a third calibration value as a current calibration parameter close to the sensor if a difference value between the stored calibration parameter value and the third calibration parameter value satisfies a calibration parameter value updating condition, and updating the calibration parameter value stored in the parameter data set. As shown in fig. 3, the technical solution is as follows:
and S301, carrying out factory calibration on the parameters of the proximity sensor, and determining a first calibration parameter value.
Step S302, writing the first calibration parameter value into a parameter data set of the nonvolatile file.
Step S303, when the startup event is detected, calibrating the proximity sensor parameter to generate a second calibration parameter value.
Step S304, acquiring the first calibration parameter value, and determining whether the difference value between the first calibration parameter value and the second calibration parameter value meets the calibration parameter value updating condition.
And S305, if the calibration parameter value updating condition is met, determining the second calibration parameter value as the current calibration parameter of the proximity sensor.
Step S306, saving the second calibration parameter value in the parameter data set in place of the first calibration parameter value.
And step S307, when the function of the proximity sensor is detected to be started, calibrating the proximity sensor parameter to generate a third calibration parameter value.
In one embodiment, when the proximity sensor starts to operate each time or performs calibration once every preset time, a third calibration parameter value is generated, and a specific calibration manner may exemplarily be: when the shielding is detected, the real-time infrared signal acquired by the proximity sensor is acquired, the real-time infrared signal and the oil stain threshold value are compared, when the real-time infrared signal is larger than or equal to the oil stain threshold value, oil stain is judged to be present, a corrected value (such as 50) is obtained through calculation, and the value-50 of the currently acquired real-time infrared signal is used as a third calibration parameter value.
Step S308, obtaining a second calibration parameter value stored in the parameter data set, if a difference between the stored calibration parameter value and the third calibration parameter value satisfies a calibration parameter value updating condition, determining the third calibration value as a current calibration parameter close to the sensor, and updating the calibration parameter value stored in the parameter data set.
According to the method, the calibration parameter value can be generated according to the existing calibration mode in the using process of the proximity sensor, whether the calibration parameter value meets the updating condition or not is judged, if yes, the calibration parameter value is updated and stored for subsequent comparison, the problem of proximity function failure caused by fluctuation change of the calibration parameter is reduced, meanwhile, the calibration parameter value can be updated in an iterative mode, the calibration parameter value is updated within a certain change range, and the calibration precision is improved.
Fig. 4 is a flowchart of another proximity sensor parameter calibration method provided in an embodiment of the present application, and optionally, before determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update condition, the method further includes: determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update comparison condition. As shown in fig. 4, the technical solution is as follows:
and S401, carrying out factory calibration on the parameters of the proximity sensor, and determining a first calibration parameter value.
Step S402, writing the first calibration parameter value into a parameter data set of the nonvolatile file.
Step S403, when the power-on start event is detected, calibrating the proximity sensor parameter to generate a second calibration parameter value.
Step S404, judging whether the second calibration parameter value meets the calibration parameter value updating comparison condition, if so, executing step S405, otherwise, executing step S406.
In an embodiment, before comparing the second calibration parameter value with the first calibration parameter value, it is determined whether the second calibration parameter value satisfies the calibration parameter value update comparison condition, specifically, the size of the second calibration parameter value may be greater than-20 or less than or equal to 50.
Step S405, obtaining the first calibration parameter value, and determining whether the difference between the first calibration parameter value and the second calibration parameter value satisfies a calibration parameter value update condition, if so, executing step S407, otherwise, executing step S406.
Step S406, determining the first calibration parameter value as the current calibration parameter of the proximity sensor.
And step S407, determining the second calibration parameter value as the current calibration parameter of the proximity sensor.
Step S408, saving the second calibration parameter value in the parameter data set in place of the first calibration parameter value.
And step S409, when the function of the proximity sensor is detected to be started, calibrating the proximity sensor parameter to generate a third calibration parameter value.
And step S410, judging whether the third calibration parameter value meets the comparison condition of the calibration parameter value updating, if so, executing step S412, otherwise, executing step S411.
In an embodiment, before comparing the second calibration parameter value with the third calibration parameter value, it is determined whether the third calibration parameter value satisfies the calibration parameter value update comparison condition, specifically, the size of the third calibration parameter value may be greater than-20 or less than or equal to 50.
And step S411, determining the second calibration parameter value as the current calibration parameter of the proximity sensor.
Step S412, acquiring a second calibration parameter value, and determining whether a difference between the second calibration parameter value and the third calibration parameter value satisfies a calibration parameter value update condition, if so, executing step S413, otherwise, executing step S411.
And step S413, determining the third calibration value as a current calibration parameter of the proximity sensor, and updating the calibration parameter value stored in the parameter data set.
According to the parameter calibration method and device, before the parameter value comparison is carried out to judge whether the parameter updating condition is met, the numerical values of the second calibration parameter value and/or the third calibration parameter value are judged, the parameter values meeting the updating comparison condition are compared with the parameter values recorded in the parameter data set to determine whether the newly calibrated parameter values are adopted, the parameter calibration efficiency of the parameter calibration scheme in the scheme is improved, the parameter values which do not meet the updating condition can be directly filtered out, the updating condition is not judged, and the scheme is further improved.
Fig. 5 is a block diagram of a proximity sensor parameter calibration apparatus according to an embodiment of the present application, where the apparatus is configured to execute a proximity sensor parameter calibration method according to the foregoing embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus specifically includes: a parameter recording module 101, a parameter comparing module 102 and a parameter updating module 103, wherein,
a parameter recording module 101, configured to write the first calibration parameter value into a parameter data set of the non-volatile file.
The non-volatile file may be an NV (non-volatile) file of the terminal device, and the content in the NV file is not changed by operations such as shutdown, total clearing, and system upgrade of the terminal device. The first calibration parameter value may be written as an initial calibration value for proximity sensor parameter calibration into a parameter dataset of the non-volatile file, which may also contain calibration parameters for other sensors, the first calibration parameter recorded in the parameter dataset being used for subsequent calibration comparisons.
In an embodiment, the first calibration parameter value may be a calibration parameter value obtained by calibrating the proximity sensor when the terminal device leaves a factory. When the terminal device leaves the factory, hardware and software are required to be tested, and parameters of the proximity sensor are required to be calibrated so that the terminal device meets the factory requirements. The calibration parameter value obtained at the time of factory calibration may be determined as a first calibration parameter value, which may be, for example, 5, 6, or 15.
The parameter comparison module 102 is configured to, when it is detected that a second calibration parameter value is generated, obtain the first calibration parameter value, and determine whether a difference between the first calibration parameter value and the second calibration parameter value satisfies a calibration parameter value update condition.
The terminal equipment can perform self-calibration of the parameters of the proximity sensor in the subsequent use process, the self-calibration can be a self-calibration mode integrated in the terminal equipment, and also can be a self-calibration function developed and accessed by a third party developer, and the functions of the proximity sensor can be kept normal under any environmental conditions through the self-calibration of the parameters of the proximity sensor. In the prior art, parameters of a proximity sensor are updated and used after self-calibration is completed, and the calibrated parameters have large deviation due to the influence of a plurality of uncontrollable factors in the calibration process, and the function failure of the proximity sensor can be caused if the parameters are directly updated and used.
In an embodiment, the second calibration parameter value may be a calibration parameter value obtained by a self-calibration manner of a proximity sensor carried by the terminal device, and when the second calibration parameter value is generated, a first calibration parameter value is obtained, and it is determined whether a difference between the first calibration parameter value and the second calibration parameter value satisfies a calibration parameter value update condition, where the first calibration parameter value may be a calibration parameter value stored in a parameter data set of an NV file, and specifically, whether the difference satisfies the calibration parameter value update condition includes: whether the absolute value of the difference is less than or equal to a preset update value, which may be 10, the second calibration parameter value may be-30, 5, 8, 10, 20, etc.
A parameter updating module 103, configured to determine the first calibration parameter value as the current calibration parameter of the proximity sensor if the calibration parameter value updating condition is not satisfied.
In one embodiment, when it is determined that the difference between the obtained second calibration parameter value and the first calibration parameter value does not satisfy the calibration parameter value updating condition, the previously stored first calibration parameter value is used as the current calibration parameter of the proximity sensor, that is, the calibration parameter value is not updated. And if the updating condition of the calibration parameter value is met, determining the second calibration parameter value as the current calibration parameter of the proximity sensor, and storing the second calibration parameter value in the parameter data set to replace the first calibration parameter value for comparison during subsequent calibration parameter value updating.
According to the method, when the terminal equipment generates a new calibration parameter, the calibration parameter value is compared with the stored calibration parameter value, if the updating condition is not met, the original stored calibration parameter value is continuously used for calibrating the proximity sensor parameter, and if the updating condition is met, the new calibration parameter value is used for updating the proximity sensor calibration parameter, so that the rationality of the proximity sensor parameter calibration is improved, and the parameter calibration function of the proximity sensor is perfected.
In one possible embodiment, the apparatus further comprises a calibration module 104 for:
before the first calibration parameter value is written into the parameter data set of the nonvolatile file, factory calibration of the proximity sensor parameter is carried out, and the first calibration parameter value is determined.
In one possible embodiment, the calibration module 104 is further configured to:
and before the generation of the second calibration parameter value is detected, when a starting-up event is detected, calibrating the proximity sensor parameter to generate the second calibration parameter value.
In a possible embodiment, the parameter updating module 103 is specifically configured to: if a calibration parameter value update condition is satisfied, determining the second calibration parameter value as a current calibration parameter of the proximity sensor, and saving the second calibration parameter value in the parameter data set in place of the first calibration parameter value.
In one possible embodiment, the calibration module 104 is further configured to:
after determining the current calibration parameters of the proximity sensor, when detecting that the function of the proximity sensor is started, calibrating the parameters of the proximity sensor to generate third calibration parameter values;
and acquiring a second calibration parameter value stored in the parameter data set, determining a third calibration value as a current calibration parameter close to the sensor if a difference value between the stored calibration parameter value and the third calibration parameter value satisfies a calibration parameter value updating condition, and updating the calibration parameter value stored in the parameter data set.
In a possible embodiment, the parameter comparison module 102 is further configured to:
determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update comparison condition before determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update condition.
In one possible embodiment, whether the difference satisfies the calibration parameter value update condition includes: whether the absolute value of the difference is less than or equal to a preset update value; the calibration parameter value updating comparison conditions comprise: whether the second calibration parameter value or the third calibration parameter value is greater than or equal to a preset comparison value.
In this embodiment, a terminal device is provided on the basis of the foregoing embodiments, and fig. 6 is a schematic structural diagram of a terminal device provided in an embodiment of the present application, and as shown in fig. 6, the terminal device 200 includes: memory 201, processor (CPU) 202, peripheral interfaces 203, RF (Radio Frequency) circuitry 205, audio circuitry 206, speaker 211, power management chip 208, input/output (I/O) subsystem 209, touch screen 212, proximity sensors 213, other input/control devices 210, and external port 204, which communicate via one or more communication buses or signal lines 207.
It should be understood that the illustrated terminal device 200 is only one example of a terminal device, and that the terminal device 200 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 scheme for calibrating a proximity sensor of a terminal device, which is provided in this embodiment, where the terminal device is a smart phone as an example.
A memory 201, the memory 201 being accessible by the CPU202, the peripheral interface 203, and the like, the memory 201 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 203, said peripheral interface 203 may connect input and output peripherals of the device to the CPU202 and the memory 201.
An I/O subsystem 209, the I/O subsystem 209 may connect input and output peripherals on the device, such as a touch screen 212 and other input/control devices 210, to the peripheral interface 203. The I/O subsystem 209 may include a display controller 2091 and one or more input controllers 2092 for controlling the other input/control devices 210. Where one or more input controllers 2092 receive electrical signals from or transmit electrical signals to other input/control devices 210, the other input/control devices 210 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 2092 may be coupled to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 212, the touch screen 212 being an input interface and an output interface between the user terminal and the user, displaying visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 2091 within the I/O subsystem 209 receives electrical signals from the touch screen 212 or transmits electrical signals to the touch screen 212. The touch screen 212 detects a contact on the touch screen, and the display controller 2091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 212, i.e., implements a human-machine interaction, and the user interface object displayed on the touch screen 212 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 205 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 205 receives and transmits RF signals, also referred to as electromagnetic signals, through which the RF circuitry 205 converts electrical signals to or from electromagnetic signals and communicates with communication networks and other devices. RF circuitry 205 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 206 is mainly used to receive audio data from the peripheral interface 203, convert the audio data into an electric signal, and transmit the electric signal to the speaker 211.
And a speaker 211 for reproducing the voice signal received by the handset from the wireless network through the RF circuit 205 into sound and playing the sound to the user.
And the power management chip 208 is used for supplying power and managing power to the hardware connected with the CPU202, the I/O subsystem and the peripheral interface.
The proximity sensor parameter calibration device of the terminal device and the terminal device provided in the above embodiments may execute the proximity sensor parameter calibration method of the terminal device provided in any embodiment of the present application, and have a corresponding functional module and beneficial effects for executing the method. Technical details that are not described in detail in the above embodiments may be referred to a proximity sensor parameter calibration method of a terminal device provided in any embodiment of the present application.
Embodiments of the present application further provide a storage medium containing terminal device executable instructions, which when executed by a terminal device processor, are configured to perform a method for calibrating a proximity sensor parameter, the method including:
writing the first calibration parameter value into a parameter dataset of the non-volatile file;
when generation of a second calibration parameter value is detected, acquiring the first calibration parameter value, and determining whether a difference value between the first calibration parameter value and the second calibration parameter value meets a calibration parameter value updating condition;
and if the calibration parameter value updating condition is not met, determining the first calibration parameter value as the current calibration parameter of the proximity sensor.
In a possible embodiment, before the writing the first calibration parameter value to the parameter data set of the non-volatile file, the method further includes:
and carrying out factory calibration on the parameters of the proximity sensor, and determining a first calibration parameter value.
In one possible embodiment, before detecting generation of the second calibration parameter value, the method further includes:
when a start-up event is detected, the proximity sensor parameters are calibrated to generate second calibration parameter values.
In one possible embodiment, if a calibration parameter value update condition is satisfied, the second calibration parameter value is determined to be the current calibration parameter of the proximity sensor and saved in the parameter data set in place of the first calibration parameter value.
In one possible embodiment, after determining the current calibration parameters of the proximity sensor, the method further includes:
when the function of the proximity sensor is detected to be started, calibrating the proximity sensor parameter to generate a third calibration parameter value;
and acquiring a second calibration parameter value stored in the parameter data set, determining a third calibration value as a current calibration parameter close to the sensor if a difference value between the stored calibration parameter value and the third calibration parameter value satisfies a calibration parameter value updating condition, and updating the calibration parameter value stored in the parameter data set.
In one possible embodiment, before determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update condition, the method further includes:
determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update comparison condition.
In one possible embodiment, whether the difference satisfies the calibration parameter value update condition includes:
whether the absolute value of the difference is less than or equal to a preset update value;
the calibration parameter value updating comparison conditions comprise:
whether the second calibration parameter value or the third calibration parameter value is greater than or equal to a preset comparison value.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the operations of the proximity sensor parameter calibration method described above, and may also perform related operations in the proximity sensor parameter calibration method provided in any embodiments of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application 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 application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. A method for calibrating a proximity sensor parameter, comprising:
writing the first calibration parameter value into a parameter dataset of the non-volatile file;
when generation of a second calibration parameter value is detected, acquiring the first calibration parameter value, and determining whether a difference value between the first calibration parameter value and the second calibration parameter value meets a calibration parameter value updating condition, wherein the second calibration parameter value comprises a calibration parameter value generated after self-calibration of a proximity sensor parameter;
and if the calibration parameter value updating condition is not met, determining the first calibration parameter value as the current calibration parameter of the proximity sensor.
2. The method of claim 1, further comprising, prior to said writing the first calibration parameter value to the parameter data set of the non-volatile file:
and carrying out factory calibration on the parameters of the proximity sensor, and determining a first calibration parameter value.
3. The method of claim 1, prior to detecting generation of the second calibration parameter value, further comprising:
when a start-up event is detected, the proximity sensor parameters are calibrated to generate second calibration parameter values.
4. A method according to any of claims 1-3, characterized by determining the second calibration parameter value as a current calibration parameter close to the sensor and saving the second calibration parameter value in the parameter data set in place of the first calibration parameter value if a calibration parameter value update condition is fulfilled.
5. The method of claim 4, wherein after determining the second calibration parameter value as a current calibration parameter for the proximity sensor, further comprising:
when the function of the proximity sensor is detected to be started, calibrating the proximity sensor parameter to generate a third calibration parameter value;
and acquiring a second calibration parameter value stored in the parameter data set, determining a third calibration value as a current calibration parameter close to the sensor if a difference value between the stored calibration parameter value and the third calibration parameter value meets a calibration parameter value updating condition, and updating the calibration parameter value stored in the parameter data set.
6. The method of claim 5, prior to determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update condition, further comprising:
determining whether the second calibration parameter value or the third calibration parameter value satisfies a calibration parameter value update comparison condition.
7. The method of claim 6, wherein whether the difference satisfies a calibration parameter value update condition comprises:
whether the absolute value of the difference is less than or equal to a preset update value;
the calibration parameter value updating comparison conditions comprise:
whether the second calibration parameter value or the third calibration parameter value is greater than or equal to a preset comparison value.
8. A proximity sensor parameter calibration device, comprising:
the parameter recording module is used for writing the first calibration parameter value into a parameter data set of the nonvolatile file;
the parameter comparison module is used for acquiring the first calibration parameter value when detecting that a second calibration parameter value is generated, and determining whether a difference value between the first calibration parameter value and the second calibration parameter value meets a calibration parameter value updating condition, wherein the second calibration parameter value comprises a calibration parameter value generated after self-calibration is carried out on the proximity sensor parameter;
and the parameter updating module is used for determining the first calibration parameter value as the current calibration parameter of the proximity sensor if the calibration parameter value updating condition is not met.
9. A terminal device, comprising: processor, memory and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the proximity sensor parameter calibration method according to any of claims 1-7.
10. A storage medium containing terminal device-executable instructions, which when executed by a terminal device processor, are configured to perform the proximity sensor parameter calibration method of any one of claims 1-7.
CN201811124230.3A 2018-09-26 2018-09-26 Proximity sensor parameter calibration method and device, terminal equipment and storage medium Active CN109186657B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811124230.3A CN109186657B (en) 2018-09-26 2018-09-26 Proximity sensor parameter calibration method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811124230.3A CN109186657B (en) 2018-09-26 2018-09-26 Proximity sensor parameter calibration method and device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109186657A CN109186657A (en) 2019-01-11
CN109186657B true CN109186657B (en) 2022-03-08

Family

ID=64907295

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811124230.3A Active CN109186657B (en) 2018-09-26 2018-09-26 Proximity sensor parameter calibration method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109186657B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3923566A4 (en) 2019-02-05 2022-03-23 NEC Corporation Learning device, learning method, non-transitory computer-readable medium having control program stored thereon, and estimation device
CN112712184B (en) * 2020-12-28 2023-05-19 浙江中控技术股份有限公司 Parameter maintenance method of equipment instrument and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197357A (en) * 2013-02-26 2013-07-10 深圳市中兴移动通信有限公司 Infrared proximity detector self-calibration method and device
CN105022530A (en) * 2015-08-04 2015-11-04 广东欧珀移动通信有限公司 Calibration method and system for proximity sensor
CN106973163A (en) * 2017-03-30 2017-07-21 努比亚技术有限公司 The dynamic calibration method and its device of a kind of infrared proximity transducer
CN108279408A (en) * 2018-01-24 2018-07-13 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium
CN108415024A (en) * 2018-01-24 2018-08-17 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8030914B2 (en) * 2008-12-29 2011-10-04 Motorola Mobility, Inc. Portable electronic device having self-calibrating proximity sensors
IT1393868B1 (en) * 2009-04-01 2012-05-11 Elsag Datamat Spa PROXIMITY SENSOR FOR PARKING AREA
CN103442136B (en) * 2013-08-19 2015-07-15 惠州Tcl移动通信有限公司 Method and system for dual calibration of proximity sensor
EP3277610B1 (en) * 2015-05-08 2019-07-17 Hp Indigo B.V. Measured sensor distance correction
CN105866781B (en) * 2016-03-24 2020-09-25 联想(北京)有限公司 Data processing method and electronic equipment
KR102384875B1 (en) * 2016-05-11 2022-04-08 삼성전자주식회사 Method, Device and System for Calibration of Distant Sensor
GB2545137B (en) * 2016-06-27 2021-06-23 Sensyne Health Group Ltd Method and apparatus for sensing and for improving sensor accuracy
CN106791209A (en) * 2017-03-10 2017-05-31 上海传英信息技术有限公司 The self-checking device and method of distance of mobile terminal sensor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197357A (en) * 2013-02-26 2013-07-10 深圳市中兴移动通信有限公司 Infrared proximity detector self-calibration method and device
CN105022530A (en) * 2015-08-04 2015-11-04 广东欧珀移动通信有限公司 Calibration method and system for proximity sensor
CN106973163A (en) * 2017-03-30 2017-07-21 努比亚技术有限公司 The dynamic calibration method and its device of a kind of infrared proximity transducer
CN108279408A (en) * 2018-01-24 2018-07-13 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium
CN108415024A (en) * 2018-01-24 2018-08-17 广东欧珀移动通信有限公司 proximity sensor calibration method, device, mobile terminal and computer-readable medium

Also Published As

Publication number Publication date
CN109186657A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
US11861161B2 (en) Display method and apparatus
CN107402835B (en) Application program exception handling method and device, storage medium and mobile terminal
CN110045878B (en) Response control method and device for touch screen, storage medium and terminal
EP3435199B1 (en) Method, mobile terminal and non-transitory computer-readable storage medium for adjusting scanning frequency of touch screen
EP3432136B1 (en) Sound effect configuration method and related device
CN107463289B (en) Calibration method and device of touch screen, storage medium and terminal
CN108681474B (en) Application preloading method and device, storage medium and terminal
CN106817753B (en) Method and device for saving electricity by switching background gray scales and mobile terminal
CN109408465B (en) File attribution information recording method, device, storage medium and terminal
CN109343066B (en) Control method and device of proximity sensor, storage medium and mobile terminal
CN110046497B (en) Function hook realization method, device and storage medium
CN110837343B (en) Snapshot processing method and device and terminal
CN109186657B (en) Proximity sensor parameter calibration method and device, terminal equipment and storage medium
CN110830127B (en) Radio frequency parameter processing method and device, mobile terminal and storage medium
CN103631502A (en) Display content adjusting method and device and electronic equipment
WO2020125182A1 (en) Algorithm processing method and apparatus, and storage medium and terminal device
WO2019033436A1 (en) Volume adjustment method, device, storage medium and mobile terminal
CN106502819B (en) Control method and device based on proximity sensor and mobile terminal
CN109032322B (en) Navigation control method, navigation control device, terminal equipment and storage medium
CN109871324B (en) Control operation method and device
CN106791108B (en) Threshold updating method and device of proximity sensor and terminal
CN108594705B (en) State detection method and device of mobile terminal, storage medium and mobile terminal
CN109375855B (en) Terminal state determination method and device, terminal equipment and storage medium
US10666789B2 (en) Control method and device for sensors of mobile terminal, storage medium and mobile terminal
CN108399090B (en) Visibility refreshing method and device, storage medium and intelligent terminal

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
GR01 Patent grant
GR01 Patent grant