[go: up one dir, main page]

CN108279408A - Proximity sensor calibration method and device, mobile terminal and computer readable medium - Google Patents

Proximity sensor calibration method and device, mobile terminal and computer readable medium Download PDF

Info

Publication number
CN108279408A
CN108279408A CN201810067556.0A CN201810067556A CN108279408A CN 108279408 A CN108279408 A CN 108279408A CN 201810067556 A CN201810067556 A CN 201810067556A CN 108279408 A CN108279408 A CN 108279408A
Authority
CN
China
Prior art keywords
proximity
value
parameter
proximity sensor
difference
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.)
Granted
Application number
CN201810067556.0A
Other languages
Chinese (zh)
Other versions
CN108279408B (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 CN201810067556.0A priority Critical patent/CN108279408B/en
Publication of CN108279408A publication Critical patent/CN108279408A/en
Application granted granted Critical
Publication of CN108279408B publication Critical patent/CN108279408B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G01S7/00Details of systems according to groups G01S13/00, G01S15/00, G01S17/00
    • G01S7/48Details of systems according to groups G01S13/00, G01S15/00, G01S17/00 of systems according to group G01S17/00
    • G01S7/497Means for monitoring or calibrating
    • 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
    • G01S17/00Systems using the reflection or reradiation of electromagnetic waves other than radio waves, e.g. lidar systems
    • G01S17/02Systems using the reflection of electromagnetic waves other than radio waves
    • G01S17/06Systems determining position data of a target
    • G01S17/08Systems determining position data of a target for measuring distance only
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/24Arrangements for testing
    • 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
    • G01S7/00Details of systems according to groups G01S13/00, G01S15/00, G01S17/00
    • G01S7/48Details of systems according to groups G01S13/00, G01S15/00, G01S17/00 of systems according to group G01S17/00
    • G01S7/497Means for monitoring or calibrating
    • G01S2007/4975Means for monitoring or calibrating of sensor obstruction by, e.g. dirt- or ice-coating, e.g. by reflection measurement on front-screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Electromagnetism (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a method and a device for calibrating a proximity sensor, a mobile terminal and a computer readable medium, and belongs to the technical field of mobile communication. The method comprises the following steps: when detecting that the proximity sensor is started, acquiring a proximity value acquired by the proximity sensor according to preset calibration parameters; judging whether the approach value is larger than a preset standard value and smaller than a preset maximum threshold value; and if so, updating the preset calibration parameters according to the difference value between the approach value and the preset standard value. And updating the preset calibration parameter according to the difference value between the approach value and the preset standard value, so that the approach value acquired by the approach sensor according to the updated preset calibration parameter approaches the preset standard value more, and the measurement accuracy of the approach sensor is improved.

Description

接近传感器校准方法、装置、移动终端及计算机可读介质Proximity sensor calibration method, device, mobile terminal and computer readable medium

技术领域technical field

本申请涉及移动通信技术领域,更具体地,涉及一种接近传感器校准方法、装置、移动终端及计算机可读介质。The present application relates to the technical field of mobile communication, and more specifically, relates to a proximity sensor calibration method, device, mobile terminal and computer-readable medium.

背景技术Background technique

目前应用在移动终端上的接近传感器多采用红外发射和接收的原理,如果在接近传感器的开孔位置覆盖保护膜或者涂抹油污,会导致接近传感器采集的接近值过大,导致移动终端在使用过程中出现功能紊乱,降低用户体验度。At present, the proximity sensors used in mobile terminals mostly use the principle of infrared emission and reception. If the opening position of the proximity sensor is covered with a protective film or smeared with oil, the proximity value collected by the proximity sensor will be too large, causing the mobile terminal to fail during use. Functional disorder occurs in the system, which reduces user experience.

发明内容Contents of the invention

本申请提出了一种接近传感器校准方法、装置、移动终端及计算机可读介质,以改善上述缺陷。The present application proposes a proximity sensor calibration method, device, mobile terminal and computer-readable medium to improve the above-mentioned defects.

第一方面,本申请实施例提供了一种接近传感器校准方法,包括:在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值;判断所述接近值是否大于预设标准值且小于预设最大阈值;若是,根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。In the first aspect, an embodiment of the present application provides a method for calibrating a proximity sensor, including: acquiring a proximity value collected by the proximity sensor according to preset calibration parameters when the proximity sensor is detected to be activated; judging whether the proximity value is greater than the preset Set a standard value and be less than a preset maximum threshold; if yes, update the preset calibration parameter according to the difference between the close value and the preset standard value.

第二方面,本申请实施例还提供了一种接近传感器校准装置,包括:获取单元、判断单元和更新单元。获取单元,用于在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值。判断单元,用于判断所述接近值是否大于预设标准值且小于预设最大阈值。更新单元,用于若是,根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。In a second aspect, the embodiment of the present application further provides a proximity sensor calibration device, including: an acquisition unit, a judgment unit, and an update unit. The obtaining unit is configured to obtain a proximity value collected by the proximity sensor according to preset calibration parameters when the proximity sensor is detected to be activated. A judging unit, configured to judge whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold. An updating unit, configured to update the preset calibration parameter according to the difference between the close value and the preset standard value if yes.

第三方面,本申请实施例还提供了一种移动终端,包括存储器和处理器,所述存储器与所述处理器耦合。所述存储器存储指令,当所述指令由所述处理器执行时以使所述处理器执行以下操作:在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值;判断所述接近值是否大于预设标准值且小于预设最大阈值;若是,根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。In a third aspect, the embodiment of the present application further provides a mobile terminal, including a memory and a processor, and the memory is coupled to the processor. The memory stores instructions, and when the instructions are executed by the processor, the processor performs the following operations: when the proximity sensor is detected to be activated, obtain the proximity value collected by the proximity sensor according to preset calibration parameters; Judging whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold; if yes, updating the preset calibration parameter according to a difference between the proximity value and the preset standard value.

第四方面,本申请实施例还提供了一种具有处理器可执行的程序代码的计算机可读介质,所述程序代码使所述处理器执行上述方法。In a fourth aspect, the embodiment of the present application further provides a computer-readable medium having a program code executable by a processor, and the program code causes the processor to execute the above method.

本申请实施例提供了一种接近传感器校准方法、装置、移动终端及计算机可读介质,在检测到接近传感器启动时,接近传感器会根据预设校准参数采集与周围目标物体之间的接近值,则获取到接近传感器所采集的接近值。判断所述接近值是否大于预设标准值且小于预设最大阈值,如果大于或等于预设最大阈值,则表示接近传感器处于正常使用状态,例如,用户通过移动终端通话,如果接近值小于或等于预设标准值,表示接近传感器的开孔位置没有被屏幕贴膜或油渍等障碍物挡住,而如果接近值大于预设标准值且小于预设最大阈值,则表示当前的接近值不符合标准,可能是因为接近传感器的开孔位置没有被屏幕贴膜或油渍等障碍物挡住而造成的,因此,根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数,使得之后接近传感器根据更新后的预设校准参数采集接近值,根据所述接近值与所述预设标准值之间的差值更新预设校准参数,使得接近传感器根据更新后的预设校准参数采集的接近值更加趋近预设标准值,较好地避免了移动终端因接近传感器采集的接近值不够准确而导致在使用过程中出现功能紊乱,进而提高了用户体验度。The embodiment of the present application provides a proximity sensor calibration method, device, mobile terminal and computer-readable medium. When the proximity sensor is detected to be activated, the proximity sensor will collect the proximity value with the surrounding target objects according to the preset calibration parameters. Then the proximity value collected by the proximity sensor is obtained. Judging whether the proximity value is greater than the preset standard value and less than the preset maximum threshold, if greater than or equal to the preset maximum threshold, it means that the proximity sensor is in normal use, for example, the user calls through a mobile terminal, if the proximity value is less than or equal to The preset standard value means that the opening position of the proximity sensor is not blocked by obstacles such as screen film or oil stains, and if the proximity value is greater than the preset standard value and less than the preset maximum threshold, it means that the current proximity value does not meet the standard and may It is caused by the fact that the opening position of the proximity sensor is not blocked by obstacles such as screen film or oil stains. Therefore, the preset calibration parameters are updated according to the difference between the proximity value and the preset standard value, so that Then the proximity sensor collects the proximity value according to the updated preset calibration parameter, and updates the preset calibration parameter according to the difference between the proximity value and the preset standard value, so that the proximity sensor collects the value according to the updated preset calibration parameter. The proximity value of the mobile terminal is closer to the preset standard value, which better avoids the malfunction of the mobile terminal during use due to the inaccurate proximity value collected by the proximity sensor, thereby improving the user experience.

本申请实施例的其他特征和优点将在随后的说明书阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请实施例而了解。本申请实施例的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Other features and advantages of the embodiments of the present application will be set forth in the following description, and partly become obvious from the description, or can be understood by implementing the embodiments of the present application. The objectives and other advantages of the embodiments of the application will be realized and attained by the structure particularly pointed out in the written description, claims hereof as well as the appended drawings.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1示出了本申请实施例提供的移动终端的结构示意图;FIG. 1 shows a schematic structural diagram of a mobile terminal provided by an embodiment of the present application;

图2示出了本申请一实施例提供的接近传感器校准方法的方法流程图;Fig. 2 shows the method flowchart of the proximity sensor calibration method provided by an embodiment of the present application;

图3示出了本申请另一实施例提供的接近传感器校准方法的方法流程图;FIG. 3 shows a method flowchart of a proximity sensor calibration method provided by another embodiment of the present application;

图4示出了本申请又一实施例提供的接近传感器校准方法的方法流程图;FIG. 4 shows a method flowchart of a proximity sensor calibration method provided in another embodiment of the present application;

图5示出了本申请一实施例提供的接近传感器校准装置的模块框图;FIG. 5 shows a block diagram of a proximity sensor calibration device provided by an embodiment of the present application;

图6示出了本申请另一实施例提供的接近传感器校准装置的模块框图;FIG. 6 shows a block diagram of a proximity sensor calibration device provided by another embodiment of the present application;

图7示出了本申请实施例提供的用于执行本申请实施例提供的方法的移动终端的模块框图。FIG. 7 shows a module block diagram of a mobile terminal provided in an embodiment of the present application for executing the method provided in the embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all of them. The components of the embodiments of the application generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative efforts belong to the scope of protection of the present application.

应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second" and the like are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

请参阅图1,示出了本申请实施例提供的一种移动终端100,该移动终端100设置有接近传感器114J,具体地,接近传感器114J位于移动终端100的正面,例如,位于移动终端100的正面的听筒附近。Please refer to FIG. 1 , which shows a mobile terminal 100 provided by an embodiment of the present application. The mobile terminal 100 is provided with a proximity sensor 114J. Specifically, the proximity sensor 114J is located on the front of the mobile terminal 100, for example, on the Near the earpiece on the front.

接近传感器114J用于检测周围物体与移动终端100之间的距离。具体地,接近传感器114J包括红外发射管和红外接收管,则在移动终端上设有开孔,接近传感器114J位于该开孔内,红外发射管用于发出红外线,当有物体靠近时,红外发射管发出的光线会被该物体反射回来,被红外接收管接收到,则根据红外接收管接收的光线强度就能够获得与物体之间的距离。具体地,接近传感器114J输出的接近值可以是与目标物体之间的距离,也可以是红外接收管所接收的由红外发射管发射的光线的光强度值或者根据所获取的光强度值而转换的电流值,在此,对接近值不做限定,只要能够表证接近传感器与目标物体之间的距离的值均可。The proximity sensor 114J is used to detect the distance between surrounding objects and the mobile terminal 100 . Specifically, the proximity sensor 114J includes an infrared emitting tube and an infrared receiving tube, and an opening is provided on the mobile terminal. The proximity sensor 114J is located in the opening, and the infrared emitting tube is used to emit infrared rays. When an object approaches, the infrared emitting tube The emitted light will be reflected back by the object and received by the infrared receiving tube, and the distance to the object can be obtained according to the intensity of the light received by the infrared receiving tube. Specifically, the proximity value output by the proximity sensor 114J may be the distance to the target object, or the light intensity value of the light emitted by the infrared emitting tube received by the infrared receiving tube or converted according to the acquired light intensity value Here, the proximity value is not limited, as long as it can demonstrate the distance between the proximity sensor and the target object.

移动终端在出厂的时候,一般都会对接近传感器进行校准,也就是会设定一个初始校准值,接近传感器在采集到初始采样值时,会根据该初始校准值对初始采样值进行校准,以获得实际测量的接近值,例如,实际测量的接近值等于初始采样值与初始校准值之差。When the mobile terminal leaves the factory, the proximity sensor is generally calibrated, that is, an initial calibration value is set. When the proximity sensor collects the initial sampling value, it will calibrate the initial sampling value according to the initial calibration value to obtain The actual measured proximity value, eg, the actual measured proximity value is equal to the difference between the initial sampled value and the initial calibration value.

但是,用户在使用移动终端时,会在移动终端的屏幕上贴膜而遮挡住接近传感器的开孔处,或者不慎将油污等污染物覆盖在接近传感器的开孔处,而影响了接近传感器的接近值的测量精度,例如,使得接近传感器测得的接近值过大,而所对应的距离小于实际距离。However, when using a mobile terminal, the user will stick a film on the screen of the mobile terminal to cover the opening of the proximity sensor, or accidentally cover the opening of the proximity sensor with pollutants such as oil, which affects the proximity sensor. The measurement accuracy of the proximity value, for example, makes the proximity value measured by the proximity sensor too large, while the corresponding distance is smaller than the actual distance.

因此,为了解决上述缺陷,请参阅图2,本申请实施例提供了一种接近传感器校准方法,应用于移动终端,用于解决接近传感器的测量精度不准确的问题,具体地,请参阅图2,该方法包括:S201至S203。Therefore, in order to solve the above defects, please refer to FIG. 2. The embodiment of the present application provides a method for calibrating a proximity sensor, which is applied to a mobile terminal to solve the problem of inaccurate measurement accuracy of the proximity sensor. Specifically, please refer to FIG. 2 , the method includes: S201 to S203.

S201:在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值。S201: Acquire a proximity value collected by the proximity sensor according to preset calibration parameters when it is detected that the proximity sensor is activated.

移动终端内的某些功能需要用到接近传感器采集的接近值,例如,移动终端的通话应用,用户在打开通话应用,即将通话应用在前台运行时,通过通话应用拨打电话或者接听电话的时候,通话应用会获取接近传感器采集的接近值,在根据接近值判断移动终端的听筒位于用户耳部时,将移动终端熄屏。在接近传感器启动时,移动终端获取接近传感器根据预设校准参数采集的接近值。Some functions in the mobile terminal need to use the proximity value collected by the proximity sensor. For example, the call application of the mobile terminal. The calling application will obtain the proximity value collected by the proximity sensor, and when it is judged according to the proximity value that the earpiece of the mobile terminal is located at the user's ear, the screen of the mobile terminal will be turned off. When the proximity sensor is activated, the mobile terminal obtains the proximity value collected by the proximity sensor according to preset calibration parameters.

具体地,接近传感器采集接近值的方式为,接近传感器的红外接收管接收到红外发射管发出的经目标物体反射回的光线,从而获得初始采样值,再获取预设校准参数,获取初始采样值与预设校准参数之间的差值,将该差值作为接近传感器采集的接近值。其中,预设校准参数可以预先存储在移动终端的寄存器内,则预设校准参数可以是一个数值,例如,可以是在移动终端出厂时所设置的初始校准值。Specifically, the method for the proximity sensor to collect the proximity value is that the infrared receiving tube of the proximity sensor receives the light emitted by the infrared transmitting tube and reflected by the target object, thereby obtaining the initial sampling value, and then obtaining the preset calibration parameters to obtain the initial sampling value The difference between the preset calibration parameters and the difference is used as the proximity value collected by the proximity sensor. Wherein, the preset calibration parameter may be pre-stored in a register of the mobile terminal, and the preset calibration parameter may be a value, for example, may be an initial calibration value set when the mobile terminal leaves the factory.

另外,为了提高校准精度,获取所述接近传感器根据预设校准参数采集的接近值的方式可以是:获取所述接近传感器根据预设校准参数采集的多个初始接近值;获取所述多个初始接近值的平均值;将所述平均值作为所述接近传感器采集的接近值。In addition, in order to improve the calibration accuracy, the manner of obtaining the proximity value collected by the proximity sensor according to the preset calibration parameters may be: obtaining a plurality of initial proximity values collected by the proximity sensor according to the preset calibration parameters; obtaining the plurality of initial proximity values The average value of the proximity value; the average value is used as the proximity value collected by the proximity sensor.

具体地,在检测到接近传感器启动时,所述接近传感器采集到多个初始采样值,将每个初始采样值都减去预设校准参数,以获得每个初始采样值对应的初始校准值。在计算获得多个初始校准值的平均值,则该平均值作为本申请实施例中的接近传感器采集的接近值。具体地,可以是采集5个初始接近值,将该5个初始接近值的平均值作为接近传感器采集的接近值。Specifically, when the proximity sensor is detected to be activated, the proximity sensor collects a plurality of initial sampling values, and subtracts a preset calibration parameter from each initial sampling value to obtain an initial calibration value corresponding to each initial sampling value. After calculation, the average value of multiple initial calibration values is obtained, and the average value is used as the proximity value collected by the proximity sensor in the embodiment of the present application. Specifically, five initial proximity values may be collected, and an average value of the five initial proximity values may be used as the proximity value collected by the proximity sensor.

S202:判断所述接近值是否大于预设标准值且小于预设最大阈值。S202: Determine whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold.

其中,预设标准值为一个期望值,理论上,如果接近传感器采集的接近值等于该预设标准值,则表示接近传感器的测量精度很准确。而在接近传感器因为移动终端的贴膜或其他油污等污染物而遮挡时,会导致接近传感器测量的接近值过大,即大于预设标准值,因此,需要对接近传感器进行校准,以使其所测量的接近值能够尽量接近于预设标准值。这样可以使得不同的移动终端的接近传感器的接近值都校准到同一个值,可以保证不同移动终端的息屏距离一样,减小不同移动终端之间的差异性。Wherein, the preset standard value is an expected value. In theory, if the proximity value collected by the proximity sensor is equal to the preset standard value, it means that the measurement accuracy of the proximity sensor is very accurate. When the proximity sensor is blocked by the film of the mobile terminal or other pollutants such as oil, the proximity value measured by the proximity sensor will be too large, that is, greater than the preset standard value. Therefore, the proximity sensor needs to be calibrated so that its The measured close value can be as close as possible to the preset standard value. In this way, the proximity values of the proximity sensors of different mobile terminals can be calibrated to the same value, which can ensure that the off-screen distances of different mobile terminals are the same, and reduce differences among different mobile terminals.

另外,预设标准值一般都较小,例如,如果接近传感器的总量程为1023,则预设标准值可以是200,即接近传感器的总量程的五分之一,则初始值大于200的都校准到200,则可以使物体在靠近接近传感器的过程中的接近值有一个大的动态调整范围。如果接近传感器采集的接近值小于或等于预设标准值,则可以判定当前未发生贴膜或油污遮挡的情况,则不需要对接近传感器校准。In addition, the preset standard value is generally small, for example, if the total range of the proximity sensor is 1023, the preset standard value can be 200, which is one-fifth of the total range of the proximity sensor, and the initial value is greater than 200 All of them are calibrated to 200, so that the proximity value of the object in the process of approaching the proximity sensor can have a large dynamic adjustment range. If the proximity value collected by the proximity sensor is less than or equal to the preset standard value, it can be determined that there is no film or oil covering, and the proximity sensor does not need to be calibrated.

其中,预设最大阈值即大于预设标准值,其为设定的一个较大的值。如果接近传感器采集的接近值大于预设最大阈值,则表示移动终端处于接近状态,则此时不需要对接近传感器校准。其中,接近状态为移动终端的接近传感器为用户遮挡。而由于贴膜或者油污等污染物虽然可以使接近传感器采集的接近值过大,但是,不会比移动终端在接近状态时的接近值更大,因此,在接近值大于预设标准值且小于预设最大阈值时,再对接近传感器进行校准,即执行步骤S203,而在接近值小于或等于预设标准值,或者在接近值大于或等于预设最大阈值时,则不对接近传感器进行校准。Wherein, the preset maximum threshold is greater than the preset standard value, which is a set larger value. If the proximity value collected by the proximity sensor is greater than the preset maximum threshold, it means that the mobile terminal is in the proximity state, and the proximity sensor does not need to be calibrated at this time. Wherein, the proximity state is that the proximity sensor of the mobile terminal is blocked by the user. Although pollutants such as film or oil stains can make the proximity value collected by the proximity sensor too large, it will not be larger than the proximity value of the mobile terminal when it is in the proximity state. Therefore, when the proximity value is greater than the preset standard value and less than the preset value When the maximum threshold is set, the proximity sensor is calibrated, that is, step S203 is executed, and when the proximity value is less than or equal to the preset standard value, or when the proximity value is greater than or equal to the preset maximum threshold, the proximity sensor is not calibrated.

S203:根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。S203: Update the preset calibration parameters according to the difference between the proximity value and the preset standard value.

具体地,获取所述接近值与所述预设标准值之间的差值,记为校准差值。再将述预设校准参数更新为所述预设校准参数与所述校准差值之和。假设,接近传感器采集的初始采样值为x,预设校准值为offset1,预设标准值为pc,则接近传感器采集的接近值为ps=x-offset1,则x=ps+offset1。则校准差值=ps-pc,则更新后的预设校准参数offset1’=offset1+ps-pc,则根据更新后的预设校准参数重新计算接近值:Specifically, the difference between the approach value and the preset standard value is obtained, which is recorded as a calibration difference. Then update the preset calibration parameter to the sum of the preset calibration parameter and the calibration difference. Suppose, the initial sampling value collected by the proximity sensor is x, the preset calibration value is offset1, and the preset standard value is pc, then the proximity value collected by the proximity sensor is ps=x-offset1, then x=ps+offset1. Then the calibration difference=ps-pc, then the updated preset calibration parameter offset1'=offset1+ps-pc, then recalculate the approach value according to the updated preset calibration parameter:

ps=x-offset1’=ps+offset1-offset1-ps+pc,即ps=pc,则校准值之后的接近值等于预设标准值,即满足校准要求。ps=x-offset1'=ps+offset1-offset1-ps+pc, that is, ps=pc, then the approximate value after the calibration value is equal to the preset standard value, that is, the calibration requirement is met.

作为一种实施方式,更新后的预设校准参数用于本次接近传感器采集接近值,也就是说,在本次接近传感器启动至关闭之间的时间段内,都使用更新后的预设校准参数对接近传感器的接近值进行校准。而在下次启动的时候,接近传感器重新根据更新前的预设校准参数采集接近值,即本次使用offset1’,而下次使用offset1。则预设校准参数为移动终端出厂时设定的初始校准参数,则在一些实施例中,预设校准参数为0,则根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数的方式可以是:将接近值与所述预设标准值之间的差值作为预设校准参数,即预设校准参数更新为接近值与所述预设标准值之间的差值。As an implementation, the updated preset calibration parameters are used to collect the proximity value of the proximity sensor this time, that is to say, the updated preset calibration parameters are used during the time period between the proximity sensor is turned on and off this time. The parameter calibrates the proximity value of the proximity sensor. At the next startup, the proximity sensor collects the proximity value again according to the preset calibration parameters before updating, that is, offset1' is used this time, and offset1 is used next time. Then the preset calibration parameter is the initial calibration parameter set by the mobile terminal when it leaves the factory. In some embodiments, the preset calibration parameter is 0, and the value is updated according to the difference between the proximity value and the preset standard value. The way of the preset calibration parameter may be: the difference between the close value and the preset standard value is used as the preset calibration parameter, that is, the preset calibration parameter is updated to be between the close value and the preset standard value difference.

作为另一种实施方式,更新后的预设校准参数被存储在移动终端的寄存器内,而在下次启动接近传感器的时候,可以继续使用该更新后的预设校准参数,即使用offset’。而如果offset’的数值过大,会导致下次启动接近传感器时,接近传感器根据该offset’采集的接近值过小,甚至小于0,则会造成需要使用接近值的应用程序的功能紊乱。As another implementation manner, the updated preset calibration parameters are stored in the register of the mobile terminal, and when the proximity sensor is started next time, the updated preset calibration parameters can continue to be used, that is, use offset'. If the value of offset' is too large, when the proximity sensor is activated next time, the proximity value collected by the proximity sensor according to the offset' is too small, or even less than 0, which will cause dysfunction of the application that needs to use the proximity value.

因此,为了解决该缺陷,本申请另一实施例提供了一种接近传感器校准方法。请参阅图3,本申请实施例提供了一种接近传感器校准方法,应用于移动终端,用于解决接近传感器的测量精度不准确的问题,具体地,请参阅图3,该方法包括:S301至S309。Therefore, in order to solve this defect, another embodiment of the present application provides a method for calibrating a proximity sensor. Please refer to FIG. 3 , the embodiment of the present application provides a method for calibrating a proximity sensor, which is applied to a mobile terminal to solve the problem of inaccurate measurement accuracy of the proximity sensor. Specifically, please refer to FIG. 3 , the method includes: S301 to S309.

S301:在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值。S301: Acquire a proximity value collected by the proximity sensor according to preset calibration parameters when it is detected that the proximity sensor is activated.

S302:判断所述接近值是否大于预设最小阈值。S302: Determine whether the proximity value is greater than a preset minimum threshold.

其中,预设最小阈值为用户根据接近传感器的正常使用要求而设定的数值。作为一种实施方式,预设最小阈值为0,当接近传感器将所采集的初始采样值与预设校准参数之差作为所采集的接近值时,如果预设校准参数过大,会导致初始采样值与预设校准参数之差为负数,即小于0,当移动终端的应用程序读取到接近传感器的接近值为负数时,会无法识别。而即使将所有的负数都更改成0,而在读取接近传感器采集的接近值时,不论初始采样值与预设校准参数之差是多少,只要是负数,则读取到的均为0,因此又会造成读取的接近值的正确度不够。则在所述接近值大于预设最小阈值执行步骤S303,而在所述接近值小于或等于预设最小阈值时,执行步骤S305。Wherein, the preset minimum threshold is a value set by the user according to the normal use requirements of the proximity sensor. As an implementation, the preset minimum threshold is 0. When the proximity sensor uses the difference between the collected initial sampling value and the preset calibration parameter as the collected proximity value, if the preset calibration parameter is too large, the initial sampling The difference between the value and the preset calibration parameter is a negative number, that is, less than 0. When the application program of the mobile terminal reads that the proximity value of the proximity sensor is a negative number, it will not be recognized. And even if all negative numbers are changed to 0, when reading the proximity value collected by the proximity sensor, no matter what the difference between the initial sampling value and the preset calibration parameter is, as long as it is a negative number, it will read 0. Therefore, the accuracy of the read proximity value is insufficient. Then, step S303 is executed when the proximity value is greater than the preset minimum threshold, and step S305 is executed when the proximity value is less than or equal to the preset minimum threshold.

S303:判断所述接近值是否大于预设标准值且小于预设最大阈值。S303: Determine whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold.

其中,所述预设标准值大于所述预设最小阈值。Wherein, the preset standard value is greater than the preset minimum threshold.

S304:根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。S304: Update the preset calibration parameter according to the difference between the proximity value and the preset standard value.

S305:将所述预设标准参数与预设数值之间的差值作为参数差值。S305: Use the difference between the preset standard parameter and the preset value as a parameter difference.

由于接近传感器采集的接近值小于或等于0是由于预设标准参数过大而造成的,因此,将预设标准参数逐渐减小,直到接近值大于预设最小阈值。具体地,获取预设标准参数与预设数值之间的差值,例如,预设标准参数为offset,预设数值为c,则预设标准参数与预设数值之间的差值为offset-c,则参数差值为offset-c。Since the proximity value collected by the proximity sensor is less than or equal to 0 because the preset standard parameter is too large, the preset standard parameter is gradually reduced until the proximity value is greater than the preset minimum threshold. Specifically, the difference between the preset standard parameter and the preset value is obtained. For example, if the preset standard parameter is offset and the preset value is c, then the difference between the preset standard parameter and the preset value is offset- c, the parameter difference is offset-c.

S306:获取所述接近传感器根据所述参数差值采集的接近值,作为更新后的所述接近值。S306: Obtain a proximity value collected by the proximity sensor according to the parameter difference as the updated proximity value.

由于接近值ps=x-offset,其中,x接近传感器采集的初始采样值,则在预设标准参数减少预设数值,相应地,接近值也应当增加预设数值,但是,在一些实施例中,由于接近传感器将所有的小于0的接近值都自动更新为0,因此,在接近值小于或等于0的时候,无法获知初始采样值以及真实的接近值的大小,则如果直接将接近值更新为接近值与预设数值之和,可能会出现错误。则将预设标准参数的数值修改为参数差值,并指示接近传感器根据修改为参数差值的预设标准参数采集接近值,将所采集的接近值并命名为更新后的接近值。Since the proximity value ps=x-offset, wherein, x is close to the initial sampling value collected by the sensor, the preset standard parameter is reduced by a preset value, and accordingly, the proximity value should also be increased by a preset value, but, in some embodiments , since the proximity sensor automatically updates all proximity values less than 0 to 0, therefore, when the proximity value is less than or equal to 0, the initial sampling value and the actual size of the proximity value cannot be known, if the proximity value is updated directly Errors may occur as the sum of the approximate value and the preset value. Then modify the value of the preset standard parameter to the parameter difference, and instruct the proximity sensor to collect the proximity value according to the preset standard parameter modified as the parameter difference, and name the collected proximity value as the updated proximity value.

S307:判断更新后的所述接近值是否大于预设最小阈值。S307: Determine whether the updated proximity value is greater than a preset minimum threshold.

如果更新后的所述接近值大于预设最小阈值,则执行步骤S308,如果更新后的所述接近值小于或等于预设最小阈值,则执行步骤S309。If the updated proximity value is greater than the preset minimum threshold, perform step S308, and if the updated proximity value is less than or equal to the preset minimum threshold, perform step S309.

S308:将所述参数差值作为所述预设标准参数。S308: Use the parameter difference as the preset standard parameter.

如果更新后的所述接近值大于预设最小阈值,则表示当预设标准参数等于参数差值时,所采集的接近值能够大于预设最小阈值,则将参数差值作为所述预设标准参数,即此时的预设标准参数为参数差值。例如,参数差值为offset-c,则此时的预设标准参数等于offset-c。其中,c为一个最小单位的数值,例如,预设标准参数、接近值等所有的数值都为整数,则C为1。If the updated proximity value is greater than the preset minimum threshold, it means that when the preset standard parameter is equal to the parameter difference, the collected proximity value can be greater than the preset minimum threshold, and the parameter difference is used as the preset standard The parameter, that is, the preset standard parameter at this time is the parameter difference. For example, if the parameter difference is offset-c, then the preset standard parameter at this time is equal to offset-c. Wherein, c is a numerical value of a minimum unit, for example, if all numerical values such as preset standard parameters and close values are integers, then C is 1.

S309:将所述参数差值更新为所述参数差值与所述预设数值之间的差值。S309: Update the parameter difference to a difference between the parameter difference and the preset value.

如果更新后的所述接近值还是负数或者0,则表示预设标准参数还是过大,需要再次降低预设标准参数。则将参数差值再次减掉预设数值。即所述参数差值更新为所述参数差值与所述预设数值之间的差值,并返回执行步骤S306,即将此时获得的参数差值再次用于接近值的获取,直至更新后的接近值大于预设最小阈值,则将此时的参数差值作为预设标准参数。If the updated proximity value is still a negative number or 0, it means that the preset standard parameter is still too large, and the preset standard parameter needs to be reduced again. Then subtract the preset value from the parameter difference again. That is, the parameter difference is updated to the difference between the parameter difference and the preset value, and returns to step S306, that is, the parameter difference obtained at this time is used again to obtain the approximate value until after the update If the approach value is greater than the preset minimum threshold, the parameter difference at this time is used as the preset standard parameter.

例如,预设数值为1,预设最小阈值为0,预设标准参数为offset,则参数差值为offset-1,将offset-1用于接近值的获取,即获取到更新后的接近值。则更新后的接近值等于0,则将参数差值更新为offset-2,将offset-2用于接近值的获取,判断获取到的接近值是否大于0,如果还是等于0,则将参数差值更新为offset-3,按照此方式不断循环,直至所采集的接近值大于0,则将此时的参数差值作为预设标准参数。For example, if the preset value is 1, the preset minimum threshold is 0, and the preset standard parameter is offset, then the parameter difference is offset-1, and offset-1 is used to obtain the proximity value, that is, the updated proximity value is obtained . Then the updated proximity value is equal to 0, then update the parameter difference to offset-2, use offset-2 to obtain the proximity value, and judge whether the obtained proximity value is greater than 0, if it is still equal to 0, then set the parameter difference The value is updated to offset-3, and the cycle continues in this way until the collected close value is greater than 0, and the parameter difference at this time is used as the preset standard parameter.

需要说明的是,上述步骤中为详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that, for the part described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

另外,当所采集的接近值等于预设标准值时,接近传感器所采集的接近值的精度最高,因此,进一步地,判断更新后的所述接近值是否大于预设最小阈值的方式为判断更新后的所述接近值是否等于预设标准值,具体地,请参阅图4,本申请实施例提供了一种接近传感器校准方法,应用于移动终端,用于解决接近传感器的测量精度不准确的问题,具体地,请参阅图4,该方法包括:S401至S411。In addition, when the collected proximity value is equal to the preset standard value, the precision of the proximity value collected by the proximity sensor is the highest. Therefore, further, the way of judging whether the updated proximity value is greater than the preset minimum threshold is to judge whether the updated Whether the proximity value is equal to the preset standard value, specifically, please refer to FIG. 4, the embodiment of the present application provides a proximity sensor calibration method, which is applied to a mobile terminal to solve the problem of inaccurate measurement accuracy of the proximity sensor , specifically, referring to FIG. 4 , the method includes: S401 to S411.

S401:在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值。S401: Acquire a proximity value collected by the proximity sensor according to preset calibration parameters when it is detected that the proximity sensor is activated.

S402:判断所述接近值是否大于预设最小阈值。S402: Determine whether the proximity value is greater than a preset minimum threshold.

S403:判断所述接近值是否大于预设标准值且小于预设最大阈值。S403: Determine whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold.

S404:根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。S404: Update the preset calibration parameter according to the difference between the proximity value and the preset standard value.

S405:将所述预设标准参数与预设数值之间的差值作为参数差值。S405: Use the difference between the preset standard parameter and the preset value as a parameter difference.

S406:判断所述参数差值是否大于零。S406: Determine whether the parameter difference is greater than zero.

与本申请实施例中,预设最小阈值为零。则接近传感器所采集的接近值小于预设最小阈值,是由于预设标准参数过大而造成的。通过减小预设标准参数的方式可以使接近值增大,但是,有可能导致预设标准参数小于零,导致无法顺利读取到接近值或者依赖于接近值的应用的功能紊乱。因此,需要保证预设标准参数不能小于零。如果参数差值大于零,则执行S407,如果参数差值小于或等于零,则执行S411。In the embodiment of the present application, the preset minimum threshold is zero. Then, the proximity value collected by the proximity sensor is smaller than the preset minimum threshold, which is caused by the preset standard parameter being too large. The proximity value can be increased by reducing the preset standard parameter, but it may cause the preset standard parameter to be less than zero, resulting in failure to read the proximity value smoothly or dysfunction of applications that depend on the proximity value. Therefore, it is necessary to ensure that the preset standard parameter cannot be less than zero. If the parameter difference is greater than zero, execute S407, and if the parameter difference is less than or equal to zero, execute S411.

S407:获取所述接近传感器根据所述参数差值采集的接近值,作为更新后的所述接近值。S407: Obtain a proximity value collected by the proximity sensor according to the parameter difference as the updated proximity value.

S408:判断所述更新后的所述接近值是否等于所述预设标准值。S408: Determine whether the updated proximity value is equal to the preset standard value.

S409:将所述参数差值更新为所述参数差值与所述预设数值之间的差值。S409: Update the parameter difference to a difference between the parameter difference and the preset value.

S410:将所述参数差值作为所述预设标准参数。S410: Use the parameter difference as the preset standard parameter.

S411:将所述预设标准参数修改为零。S411: Modify the preset standard parameter to zero.

接近值等于初始采样值减去预设标准参数,如果初始采样值本身就小于预设标准值,则如果要使得接近值等于预设标准值,则预设标准参数需要是负数,这会导致功能发生紊乱或者接近传感器无法正常使用等,因此,将接近值是否等于所述预设标准值的判断与所述参数差值是否大于零的结合在一起,当接近值等于预设标准值或参数差值小于或等于0的情况发生时,就停止校准。The proximity value is equal to the initial sampling value minus the preset standard parameter. If the initial sampling value itself is less than the preset standard value, then if the proximity value is to be equal to the preset standard value, the preset standard parameter needs to be a negative number, which will cause the function Disturbance occurs or the proximity sensor cannot be used normally. Therefore, the judgment of whether the proximity value is equal to the preset standard value is combined with whether the parameter difference is greater than zero. When the proximity value is equal to the preset standard value or the parameter difference Calibration is stopped when a value less than or equal to 0 occurs.

假设初始采样值为x=4,预设校准参数offset=8,预设标准值pc=2,预设数值为1。则第一次获取的ps=4-8=-4,判定-4不等于2,则offset-1为7,判定7大于0,则获取更新后的ps=4-7=-3,判定-3不等于2,再将offset-1之后再减1变为6,判定6大于0,再次更新后的ps=4-6=-2,判定-2不等于2,依次类推,在offset-6=2之后,获取更新后的ps=4-2=2,则此时更新后的接近值等于预设标准值,即ps=pc,则此时的预设校准参数为2。Assume that the initial sampling value is x=4, the preset calibration parameter offset=8, the preset standard value pc=2, and the preset value is 1. Then the ps obtained for the first time=4-8=-4, judge that -4 is not equal to 2, then offset-1 is 7, judge that 7 is greater than 0, then obtain the updated ps=4-7=-3, judge - 3 is not equal to 2, then subtract 1 after offset-1 to become 6, determine that 6 is greater than 0, update ps=4-6=-2 again, determine that -2 is not equal to 2, and so on, at offset-6 After = 2, the updated ps = 4-2 = 2 is obtained, then the updated approach value is equal to the preset standard value, that is, ps = pc, and the preset calibration parameter at this time is 2.

假设初始采样值为x=4,预设校准参数offset=8,预设标准值pc=6,预设数值为1。则第一次获取的ps=4-8=-4,判定-4不等于6,则offset-1为7,判定7大于0,则获取更新后的ps=4-7=-3,判定-3不等于6,再将offset-1之后再减1变为6,判定6大于0,再次更新后的ps=4-6=-2,判定-2不等于6,依次类推,在offset-8=0时,更新后的ps=4-0=4,判定4不等于6,但是,此时参数差值=offset-8已经等于0,则虽然,此时接近值不等于预设标准值,但是,参数差值已经等于0,则直接将预设校准参数修改为零。而且,虽然此时接近值不等于预设标准值,但是接近值已经尽量趋近于预设标准值。Assume that the initial sampling value is x=4, the preset calibration parameter offset=8, the preset standard value pc=6, and the preset value is 1. Then the ps obtained for the first time=4-8=-4, judge that -4 is not equal to 6, then offset-1 is 7, judge that 7 is greater than 0, then obtain the updated ps=4-7=-3, judge - 3 is not equal to 6, then subtract 1 after offset-1 to become 6, determine that 6 is greater than 0, update ps=4-6=-2 again, determine that -2 is not equal to 6, and so on, at offset-8 =0, the updated ps=4-0=4, it is judged that 4 is not equal to 6, but at this time the parameter difference=offset-8 is already equal to 0, although the approach value is not equal to the preset standard value at this time, However, if the parameter difference is already equal to 0, then directly modify the preset calibration parameters to zero. Moreover, although the close value is not equal to the preset standard value at this time, the close value has already approached the preset standard value as much as possible.

需要说明的是,上述步骤中为详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that, for the part described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

请参阅图5,本申请实施例提供了一种接近传感器校准装置,应用于移动终端,用于解决接近传感器的测量精度不准确的问题,具体地,请参阅图5,该装置包括:获取单元501、判断单元502和更新单元503。Please refer to FIG. 5. The embodiment of the present application provides a proximity sensor calibration device, which is applied to a mobile terminal to solve the problem of inaccurate measurement accuracy of the proximity sensor. Specifically, please refer to FIG. 5. The device includes: an acquisition unit 501 , a judging unit 502 and an updating unit 503 .

获取单元501,用于在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值。The obtaining unit 501 is configured to obtain a proximity value collected by the proximity sensor according to preset calibration parameters when it is detected that the proximity sensor is activated.

判断单元502,用于判断所述接近值是否大于预设标准值且小于预设最大阈值。A judging unit 502, configured to judge whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold.

更新单元503,用于若是,根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。The updating unit 503 is configured to update the preset calibration parameter according to the difference between the close value and the preset standard value if yes.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and units can refer to the corresponding process in the foregoing method embodiments, and details are not repeated here.

请参阅图6,本申请实施例提供了一种接近传感器校准装置,应用于移动终端,用于解决接近传感器的测量精度不准确的问题,具体地,请参阅图6,该装置包括:获取单元601、判断单元602、更新单元603和过零调整单元604。Please refer to FIG. 6. The embodiment of the present application provides a proximity sensor calibration device, which is applied to a mobile terminal to solve the problem of inaccurate measurement accuracy of the proximity sensor. Specifically, please refer to FIG. 6. The device includes: an acquisition unit 601 , judging unit 602 , updating unit 603 and zero-crossing adjusting unit 604 .

获取单元601,用于在检测到接近传感器启动时,获取所述接近传感器根据预设校准参数采集的接近值。The obtaining unit 601 is configured to obtain a proximity value collected by the proximity sensor according to preset calibration parameters when it is detected that the proximity sensor is activated.

判断单元602,用于判断所述接近值是否大于预设标准值且小于预设最大阈值。具体地,用于判断所述接近值是否大于预设最小阈值;若大于预设最小阈值,判断所述接近值是否大于预设标准值且小于预设最大阈值,其中,所述预设标准值大于所述预设最小阈值。A judging unit 602, configured to judge whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold. Specifically, for judging whether the proximity value is greater than a preset minimum threshold; if greater than a preset minimum threshold, judging whether the proximity value is greater than a preset standard value and smaller than a preset maximum threshold, wherein the preset standard value greater than the preset minimum threshold.

更新单元603,用于若是,根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数。The updating unit 603 is configured to update the preset calibration parameter according to the difference between the close value and the preset standard value if yes.

过零调整单元604,用于若所述接近值小于或等于预设最小阈值,将所述预设标准参数与预设数值之间的差值作为参数差值;获取所述接近传感器根据所述参数差值采集的接近值,作为更新后的所述接近值;判断更新后的所述接近值是否大于预设最小阈值;若是,将所述参数差值作为所述预设标准参数;若否,将所述参数差值更新为所述参数差值与所述预设数值之间的差值,并再次执行获取所述接近传感器根据所述参数差值采集的接近值,直至更新后的所述接近值大于预设最小阈值。A zero-crossing adjustment unit 604, configured to use the difference between the preset standard parameter and the preset value as a parameter difference if the proximity value is less than or equal to a preset minimum threshold; obtain the proximity sensor according to the The proximity value collected by the parameter difference is used as the updated proximity value; judging whether the updated proximity value is greater than a preset minimum threshold; if so, using the parameter difference as the preset standard parameter; if not , updating the parameter difference to the difference between the parameter difference and the preset value, and performing acquiring the proximity value collected by the proximity sensor according to the parameter difference again until the updated The proximity value is greater than a preset minimum threshold.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and units can refer to the corresponding process in the foregoing method embodiments, and details are not repeated here.

请再次参阅图1,基于上述的方法和装置,本申请实施例还提供一种移动终端100,其包括电子本体部10,所述电子本体部10包括壳体12及设置在所述壳体12上的主显示屏120。所述壳体12可采用金属、如钢材、铝合金制成。本实施例中,所述主显示屏120通常包括显示面板111,也可包括用于响应对所述显示面板111进行触控操作的电路等。所述显示面板111可以为一个液晶显示面板(Liquid Crystal Display,LCD),在一些实施例中,所述显示面板111同时为一个触摸屏109。Please refer to FIG. 1 again. Based on the above-mentioned method and device, the embodiment of the present application also provides a mobile terminal 100, which includes an electronic body part 10, and the electronic body part 10 includes a housing 12 and is arranged on the housing 12 The main display screen 120 on. The housing 12 can be made of metal, such as steel or aluminum alloy. In this embodiment, the main display screen 120 generally includes a display panel 111 , and may also include a circuit for responding to a touch operation on the display panel 111 . The display panel 111 may be a liquid crystal display panel (Liquid Crystal Display, LCD), and in some embodiments, the display panel 111 is also a touch screen 109 .

请同时参阅图7,在实际的应用场景中,所述移动终端100可作为智能手机终端进行使用,在这种情况下所述电子本体部10通常还包括一个或多个(图中仅示出一个)处理器102、存储器104、RF(Radio Frequency,射频)模块106、音频电路110、传感器114、输入模块118、电源模块122。本领域普通技术人员可以理解,图7所示的结构仅为示意,其并不对所述电子本体部10的结构造成限定。例如,所述电子本体部10还可包括比图7中所示更多或者更少的组件,或者具有与图1所示不同的配置。Please also refer to FIG. 7. In an actual application scenario, the mobile terminal 100 can be used as a smart phone terminal. In this case, the electronic main body 10 usually includes one or more (only shown in the figure) a) A processor 102 , a memory 104 , an RF (Radio Frequency, radio frequency) module 106 , an audio circuit 110 , a sensor 114 , an input module 118 , and a power module 122 . Those skilled in the art can understand that the structure shown in FIG. 7 is only a schematic diagram, which does not limit the structure of the electronic body part 10 . For example, the electronic body part 10 may also include more or fewer components than shown in FIG. 7 , or have a different configuration than that shown in FIG. 1 .

本领域普通技术人员可以理解,相对于所述处理器102来说,所有其他的组件均属于外设,所述处理器102与这些外设之间通过多个外设接口124相耦合。所述外设接口124可基于以下标准实现:通用异步接收/发送装置(Universal Asynchronous Receiver/Transmitter,UART)、通用输入/输出(General Purpose Input Output,GPIO)、串行外设接口(Serial Peripheral Interface,SPI)、内部集成电路(Inter-Integrated Circuit,I2C),但不并限于上述标准。在一些实例中,所述外设接口124可仅包括总线;在另一些实例中,所述外设接口124还可包括其他元件,如一个或者多个控制器,例如用于连接所述显示面板111的显示控制器或者用于连接存储器的存储控制器。此外,这些控制器还可以从所述外设接口124中脱离出来,而集成于所述处理器102内或者相应的外设内。Those skilled in the art can understand that, relative to the processor 102 , all other components belong to peripherals, and the processor 102 is coupled to these peripherals through a plurality of peripheral interfaces 124 . The peripheral interface 124 can be implemented based on the following standards: Universal Asynchronous Receiver/Transmitter (UART), General Purpose Input Output (GPIO), Serial Peripheral Interface (Serial Peripheral Interface) , SPI), inter-integrated circuit (Inter-Integrated Circuit, I2C), but not limited to the above standards. In some examples, the peripheral interface 124 may only include a bus; in other examples, the peripheral interface 124 may also include other components, such as one or more controllers, for example for connecting the display panel 111 display controller or memory controller for connecting memory. In addition, these controllers can also be separated from the peripheral interface 124 and integrated in the processor 102 or corresponding peripherals.

所述存储器104可用于存储软件程序以及模块,所述处理器102通过运行存储在所述存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理。所述存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,所述存储器104可进一步包括相对于所述处理器102远程设置的存储器,这些远程存储器可以通过网络连接至所述电子本体部10或所述主显示屏120。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104 . The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory that is remotely located relative to the processor 102 , and these remote memories may be connected to the electronic main body 10 or the main display 120 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

所述RF模块106用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。所述RF模块106可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。所述RF模块106可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。上述的无线网络可以使用各种通信标准、协议及技术,包括但并不限于全球移动通信系统(Global System for Mobile Communication,GSM)、增强型移动通信技术(Enhanced Data GSM Environment,EDGE),宽带码分多址技术(wideband codedivision multiple access,W-CDMA),码分多址技术(Code division access,CDMA)、时分多址技术(time division multiple access,TDMA),无线保真技术(Wireless,Fidelity,WiFi)(如美国电气和电子工程师协会标准IEEE802.10A,IEEE 802.11b,IEEE802.11g和/或IEEE 802.11n)、网络电话(Voice over internet protocal,VoIP)、全球微波互联接入(Worldwide Interoperability for Microwave Access,Wi-Max)、其他用于邮件、即时通讯及短消息的协议,以及任何其他合适的通讯协议,甚至可包括那些当前仍未被开发出来的协议。The RF module 106 is used to receive and send electromagnetic waves, realize mutual conversion between electromagnetic waves and electrical signals, and communicate with communication networks or other devices. The RF module 106 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption/decryption chips, Subscriber Identity Module (SIM) cards, memory, etc. . The RF module 106 can communicate with various networks such as the Internet, intranet, wireless network or communicate with other devices through the wireless network. The wireless network mentioned above may include a cellular telephone network, a wireless local area network or a metropolitan area network. The above-mentioned wireless network can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), wideband code Division multiple access technology (wideband code division multiple access, W-CDMA), code division multiple access technology (Code division access, CDMA), time division multiple access technology (time division multiple access, TDMA), wireless fidelity technology (Wireless, Fidelity, WiFi) (such as IEEE802.10A, IEEE 802.11b, IEEE802.11g and/or IEEE 802.11n), VoIP (Voice over internet protocal, VoIP), Worldwide Interoperability for Microwave Access, Wi-Max), other protocols for mail, instant messaging, and short messages, and any other suitable communication protocols, even those that have not yet been developed.

音频电路110、听筒101、声音插孔103、麦克风105共同提供用户与所述电子本体部10或所述主显示屏120之间的音频接口。具体地,所述音频电路110从所述处理器102处接收声音数据,将声音数据转换为电信号,将电信号传输至所述听筒101。所述听筒101将电信号转换为人耳能听到的声波。所述音频电路110还从所述麦克风105处接收电信号,将电信号转换为声音数据,并将声音数据传输给所述处理器102以进行进一步的处理。音频数据可以从所述存储器104处或者通过所述RF模块106获取。此外,音频数据也可以存储至所述存储器104中或者通过所述RF模块106进行发送。The audio circuit 110 , the earpiece 101 , the sound jack 103 , and the microphone 105 jointly provide an audio interface between the user and the electronic main body 10 or the main display 120 . Specifically, the audio circuit 110 receives sound data from the processor 102 , converts the sound data into electrical signals, and transmits the electrical signals to the earpiece 101 . The earpiece 101 converts electrical signals into sound waves that can be heard by the human ear. The audio circuit 110 also receives electrical signals from the microphone 105, converts the electrical signals into sound data, and transmits the sound data to the processor 102 for further processing. Audio data may be retrieved from the memory 104 or through the RF module 106 . In addition, audio data can also be stored in the memory 104 or sent through the RF module 106 .

所述传感器114设置在所述电子本体部10内或所述主显示屏120内,所述传感器114的实例包括但并不限于:光传感器、运行传感器、压力传感器、加速度传感器114F、接近传感器114J以及其他传感器。The sensor 114 is arranged in the electronic main body 10 or in the main display screen 120, examples of the sensor 114 include but not limited to: light sensor, operation sensor, pressure sensor, acceleration sensor 114F, proximity sensor 114J and other sensors.

具体地,所述光传感器可包括光线传感器、压力传感器。其中,压力传感器可以检测由按压在移动终端100产生的压力的传感器。即,压力传感器检测由用户和移动终端之间的接触或按压产生的压力,例如由用户的耳朵与移动终端之间的接触或按压产生的压力。因此,压力传感器可以用来确定在用户与移动终端100之间是否发生了接触或者按压,以及压力的大小。Specifically, the light sensor may include a light sensor and a pressure sensor. Wherein, the pressure sensor may be a sensor that detects pressure generated by pressing on the mobile terminal 100 . That is, the pressure sensor detects pressure generated by contact or press between the user and the mobile terminal, eg, pressure generated by contact or press between the user's ear and the mobile terminal. Therefore, the pressure sensor can be used to determine whether contact or pressing occurs between the user and the mobile terminal 100, and the magnitude of the pressure.

请再次参阅图1,具体地在图1所示的实施例中,所述光线传感器及所述压力传感器邻近所述显示面板111设置。所述光线传感器可在有物体靠近所述主显示屏120时,例如所述电子本体部10移动到耳边时,所述处理器102关闭显示输出。Please refer to FIG. 1 again. Specifically, in the embodiment shown in FIG. 1 , the light sensor and the pressure sensor are disposed adjacent to the display panel 111 . The light sensor can turn off the display output of the processor 102 when an object is close to the main display screen 120 , for example, when the electronic main body 10 moves to the ear.

作为运动传感器的一种,加速度传感器114F可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别所述移动终端100姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等。另外,所述电子本体部10还可配置陀螺仪、气压计、湿度计、温度计等其他传感器,在此不再赘述,As a type of motion sensor, the acceleration sensor 114F can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is stationary, and can be used to identify the application of the posture of the mobile terminal 100 (such as horizontal and vertical Screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc. In addition, the electronic main body 10 can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, etc., which will not be repeated here.

本实施例中,所述输入模块118可包括设置在所述主显示屏120上的所述触摸屏109,所述触摸屏109可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在所述触摸屏109上或在所述触摸屏109附近的操作),并根据预先设定的程序驱动相应的连接装置。可选的,所述触摸屏109可包括触摸检测装置和触摸控制器。其中,所述触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给所述触摸控制器;所述触摸控制器从所述触摸检测装置上接收触摸信息,并将该触摸信息转换成触点坐标,再送给所述处理器102,并能接收所述处理器102发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现所述触摸屏109的触摸检测功能。In this embodiment, the input module 118 may include the touch screen 109 arranged on the main display screen 120, and the touch screen 109 may collect the user's touch operations on or near it (for example, the user uses a finger, a stylus) operation of any suitable object or accessory on the touch screen 109 or near the touch screen 109), and drive the corresponding connection device according to the preset program. Optionally, the touch screen 109 may include a touch detection device and a touch controller. Wherein, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, and The touch information is converted into touch point coordinates, and then sent to the processor 102, and can receive and execute commands sent by the processor 102. In addition, the touch detection function of the touch screen 109 can be realized by various types such as resistive, capacitive, infrared, and surface acoustic wave.

所述主显示屏120用于显示由用户输入的信息、提供给用户的信息以及所述电子本体部10的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、数字、视频和其任意组合来构成,在一个实例中,所述触摸屏109可设置于所述显示面板111上从而与所述显示面板111构成一个整体。The main display screen 120 is used to display information input by the user, information provided to the user, and various graphical user interfaces of the electronic main body 10. These graphical user interfaces can be composed of graphics, text, icons, numbers, video and Any combination thereof may be used. In one example, the touch screen 109 may be disposed on the display panel 111 so as to form an integral body with the display panel 111 .

所述电源模块122用于向所述处理器102以及其他各组件提供电力供应。具体地,所述电源模块122可包括电源管理系统、一个或多个电源(如电池或者交流电)、充电电路、电源失效检测电路、逆变器、电源状态指示灯以及其他任意与所述电子本体部10或所述主显示屏120内电力的生成、管理及分布相关的组件。The power module 122 is used to provide power supply to the processor 102 and other components. Specifically, the power module 122 may include a power management system, one or more power sources (such as batteries or alternating current), a charging circuit, a power failure detection circuit, an inverter, a power status indicator light, and any other components related to the electronic body. Part 10 or the components related to the generation, management and distribution of power in the main display screen 120 .

所述移动终端100还包括定位器119,所述定位器119用于确定所述移动终端100所处的实际位置。本实施例中,所述定位器119采用定位服务来实现所述移动终端100的定位,所述定位服务,应当理解为通过特定的定位技术来获取所述移动终端100的位置信息(如经纬度坐标),在电子地图上标出被定位对象的位置的技术或服务。The mobile terminal 100 further includes a locator 119, and the locator 119 is used to determine the actual location of the mobile terminal 100. In this embodiment, the locator 119 uses a positioning service to realize the positioning of the mobile terminal 100. The positioning service should be understood as obtaining the position information (such as longitude and latitude coordinates) of the mobile terminal 100 through a specific positioning technology. ), a technology or service that marks the position of a positioned object on an electronic map.

应当理解的是,上述的移动终端100并不局限于智能手机终端,其应当指可以在移动中使用的计算机设备。具体而言,移动终端100,是指搭载了智能操作系统的移动计算机设备,移动终端100包括但不限于智能手机、智能手表、平板电脑,等等。It should be understood that the above-mentioned mobile terminal 100 is not limited to a smart phone terminal, but refers to a computer device that can be used on the move. Specifically, the mobile terminal 100 refers to a mobile computer device equipped with an intelligent operating system, and the mobile terminal 100 includes but is not limited to a smart phone, a smart watch, a tablet computer, and the like.

综上所述,本申请实施例提供了一种接近传感器校准方法、装置、移动终端及计算机可读介质,在检测到接近传感器启动时,接近传感器会根据预设校准参数采集与周围目标物体之间的接近值,则获取到接近传感器所采集的接近值。判断所述接近值是否大于预设标准值且小于预设最大阈值,如果大于或等于预设最大阈值,则表示接近传感器处于正常使用状态,例如,用户通过移动终端通话,如果接近值小于或等于预设标准值,表示接近传感器的开孔位置没有被屏幕贴膜或油渍等障碍物挡住,而如果接近值大于预设标准值且小于预设最大阈值,则表示当前的接近值不符合标准,可能是因为接近传感器的开孔位置没有被屏幕贴膜或油渍等障碍物挡住而造成的,因此,根据所述接近值与所述预设标准值之间的差值更新所述预设校准参数,使得之后接近传感器根据更新后的预设校准参数采集接近值,根据所述接近值与所述预设标准值之间的差值更新预设校准参数,使得接近传感器根据更新后的预设校准参数采集的接近值更加趋近预设标准值,较好地避免了移动终端因接近传感器采集的接近值不够准确而导致在使用过程中出现功能紊乱,进而提高了用户体验度。In summary, the embodiment of the present application provides a proximity sensor calibration method, device, mobile terminal and computer readable medium. When the proximity sensor is detected to be activated, the proximity sensor will collect the distance between the proximity sensor and the surrounding target objects according to the preset calibration parameters. The proximity value collected by the proximity sensor is obtained. Judging whether the proximity value is greater than the preset standard value and less than the preset maximum threshold, if greater than or equal to the preset maximum threshold, it means that the proximity sensor is in normal use, for example, the user calls through a mobile terminal, if the proximity value is less than or equal to The preset standard value means that the opening position of the proximity sensor is not blocked by obstacles such as screen film or oil stains, and if the proximity value is greater than the preset standard value and less than the preset maximum threshold, it means that the current proximity value does not meet the standard and may It is caused by the fact that the opening position of the proximity sensor is not blocked by obstacles such as screen film or oil stains. Therefore, the preset calibration parameters are updated according to the difference between the proximity value and the preset standard value, so that Then the proximity sensor collects the proximity value according to the updated preset calibration parameter, and updates the preset calibration parameter according to the difference between the proximity value and the preset standard value, so that the proximity sensor collects the value according to the updated preset calibration parameter. The proximity value of the mobile terminal is closer to the preset standard value, which better avoids the malfunction of the mobile terminal during use due to the inaccurate proximity value collected by the proximity sensor, thereby improving the user experience.

使移动终端在出厂后在用户手中状态发生变化时(比如贴膜或者沾了油污等)也能自动校准,使接近传感器在贴膜或者沾了油污之后也能保持原来的初始值,这样不会出现贴膜或者沾油污后接近功能异常的情况。When the state of the mobile terminal changes in the hands of the user after leaving the factory (such as film or oil stains, etc.), it can also be automatically calibrated, so that the proximity sensor can maintain the original initial value after the film is attached or oil stains, so that there will be no film. Or it is close to malfunction after being stained with oil.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific examples", or "some examples" mean that specific features described in connection with the embodiment or example , structure, material or characteristic is included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the described specific features, structures, materials or characteristics may be combined in any suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples and features of different embodiments or examples described in this specification without conflicting with each other.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In the description of the present application, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions in flowcharts or otherwise described herein may be understood to represent modules, segments or portions of code comprising one or more executable instructions for implementing specific logical functions or steps of the process , and the scope of preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in substantially simultaneous fashion or in reverse order depending on the functions involved, which shall It should be understood by those skilled in the art to which the embodiments of the present application belong.

在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(移动终端),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium, For use with instruction execution systems, devices, or devices (such as computer-based systems, systems including processors, or other systems that can fetch instructions from instruction execution systems, devices, or devices and execute instructions), or in conjunction with these instruction execution systems, devices or equipment used. For the purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use in or in conjunction with an instruction execution system, device or device. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connection with one or more wires (mobile terminal), portable computer disk case (magnetic device), random access memory (RAM), Read Only Memory (ROM), Erasable and Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, since the program can be read, for example, by optically scanning the paper or other medium, followed by editing, interpretation or other suitable processing if necessary. The program is processed electronically and stored in computer memory.

应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that each part of the present application may be realized by hardware, software, firmware or a combination thereof. In the embodiments described above, various steps or methods may be implemented by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques known in the art: Discrete logic circuits, ASICs with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。Those of ordinary skill in the art can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. During execution, one or a combination of the steps of the method embodiments is included. In addition, each functional unit in each embodiment of the present application may be integrated into one processing module, each unit may exist separately physically, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are realized in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium.

上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, and the like. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limitations on the present application, and those skilled in the art can make the above-mentioned The embodiments are subject to changes, modifications, substitutions and variations.

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not drive the essence of the corresponding technical solutions away from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims (10)

1. a kind of proximity sensor calibration method, which is characterized in that including:
When detecting that proximity sensor starts, proximity values of the proximity sensor according to default calibration parameter acquisition are obtained;
Judge whether the proximity values are more than preset standard value and less than default max-thresholds;
If so, updating the default calibration parameter according to the difference between the proximity values and the preset standard value.
2. according to the method described in claim 1, it is characterized in that, described judge whether the proximity values are more than preset standard value And less than default max-thresholds, including:
Judge whether the proximity values are more than default minimum threshold;
If more than default minimum threshold, judge whether the proximity values are more than preset standard value and are less than default max-thresholds, In, the preset standard value is more than the default minimum threshold.
3. according to the method described in claim 2, it is characterized in that, further including:
If the proximity values are less than or equal to default minimum threshold, by the difference between the preset standard parameter and default value As parameter difference;
The proximity values that the proximity sensor is acquired according to the parameter difference are obtained, as the updated proximity values;
Judge whether the updated proximity values are more than default minimum threshold;
If so, using the parameter difference as the preset standard parameter;
If it is not, the parameter difference is updated to the difference between the parameter difference and the default value, and execute again The proximity values that the proximity sensor is acquired according to the parameter difference are obtained, are preset until the updated proximity values are more than Minimum threshold.
4. according to the method described in claim 3, it is characterized in that, judging whether the updated proximity values are more than in advance If minimum threshold;If so, using the parameter difference as the preset standard parameter;If it is not, the parameter difference is updated to Difference between the parameter difference and the default value, and execute obtain the proximity sensor according to the parameter again The proximity values of difference acquisition, until the updated proximity values further include more than default minimum threshold:
Judge whether the updated proximity values are equal to the preset standard value;
If being equal to, using the parameter difference as the preset standard parameter;
If being not equal to, the parameter difference is updated to the difference between the parameter difference and the default value, and again It executes and obtains the proximity values that the proximity sensor is acquired according to the parameter difference, until the updated proximity values are equal to The preset standard value.
5. according to the method described in claim 3, it is characterized in that, described obtain the proximity sensor according to the parameter difference It is worth the proximity values of acquisition, as the updated proximity values, including:
Judge whether the parameter difference is more than zero;
If more than zero, the proximity values that the proximity sensor is acquired according to the parameter difference are obtained, as updated described Proximity values.
6. according to the method described in claim 5, it is characterized in that, the method further includes:
If being less than or equal to zero, the preset standard parameter is revised as zero.
7. according to any methods of claim 1-6, which is characterized in that described to obtain the proximity sensor according to default The proximity values of calibration parameter acquisition, including:
Obtain multiple initial proximity values of the proximity sensor according to default calibration parameter acquisition;
Obtain the average value of the multiple initial proximity values;
The proximity values that the average value is acquired as the proximity sensor.
8. a kind of proximity sensor calibrating installation, which is characterized in that including:
Acquiring unit, for when detecting that proximity sensor starts, obtaining the proximity sensor according to default calibration parameter The proximity values of acquisition;
Judging unit, for judging whether the proximity values are more than preset standard value and less than default max-thresholds;
Updating unit is used for if so, updating the default school according to the difference between the proximity values and the preset standard value Quasi- parameter.
9. a kind of mobile terminal, which is characterized in that including memory and processor, the memory is coupled with the processor; The memory store instruction, when executed by the processor so that the processor executes following operation:
When detecting that proximity sensor starts, proximity values of the proximity sensor according to default calibration parameter acquisition are obtained;
Judge whether the proximity values are more than preset standard value and less than default max-thresholds;
If so, updating the default calibration parameter according to the difference between the proximity values and the preset standard value.
10. a kind of computer-readable medium for the program code that can perform with processor, which is characterized in that said program code The processor is set to execute any one of claim 1-7 the methods.
CN201810067556.0A 2018-01-24 2018-01-24 Proximity sensor calibration method, device, mobile terminal and computer readable medium Expired - Fee Related CN108279408B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810067556.0A CN108279408B (en) 2018-01-24 2018-01-24 Proximity sensor calibration method, device, mobile terminal and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810067556.0A CN108279408B (en) 2018-01-24 2018-01-24 Proximity sensor calibration method, device, mobile terminal and computer readable medium

Publications (2)

Publication Number Publication Date
CN108279408A true CN108279408A (en) 2018-07-13
CN108279408B CN108279408B (en) 2020-04-21

Family

ID=62804923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810067556.0A Expired - Fee Related CN108279408B (en) 2018-01-24 2018-01-24 Proximity sensor calibration method, device, mobile terminal and computer readable medium

Country Status (1)

Country Link
CN (1) CN108279408B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109186657A (en) * 2018-09-26 2019-01-11 Oppo广东移动通信有限公司 Proximity sensor parameter calibration method and device, terminal equipment and storage medium
CN109724640A (en) * 2019-01-12 2019-05-07 Oppo广东移动通信有限公司 Proximity sensor calibration method, electronic device, and computer-readable storage medium
CN110823963A (en) * 2018-08-09 2020-02-21 上海朴道水汇环保科技股份有限公司 TDS detection method and system, and terminal
CN111239750A (en) * 2020-01-03 2020-06-05 歌尔股份有限公司 Proximity sensor test method and proximity sensor test system
CN111337907A (en) * 2020-02-26 2020-06-26 歌尔股份有限公司 Near object sensor calibration method, device, equipment and computer medium
CN111857154A (en) * 2020-08-02 2020-10-30 珠海市一微半导体有限公司 Robot calibration detection method, chip and robot
CN111872939A (en) * 2020-08-02 2020-11-03 珠海市一微半导体有限公司 Robot automatic calibration detection method, chip and robot
CN112260672A (en) * 2020-10-19 2021-01-22 深圳市太美亚电子科技有限公司 Method for adjusting induction distance of infrared device
CN113031081A (en) * 2021-03-10 2021-06-25 维沃移动通信有限公司 Proximity sensing detection circuit, capacitance calibration method and device and electronic equipment
CN113091890A (en) * 2021-03-22 2021-07-09 北京小米移动软件有限公司 Calibration method of optical sensor, optical sensor and electronic device with optical sensor
CN118482741A (en) * 2024-06-14 2024-08-13 深圳大深传感科技有限公司 A method and system for calibrating detection distance of a photoelectric sensor

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130049641A1 (en) * 2011-08-26 2013-02-28 Qualcomm Incorpoated Proximity sensor calibration
US8775103B1 (en) * 2011-06-17 2014-07-08 Amazon Technologies, Inc. Proximity sensor calibration and configuration
CN105783900A (en) * 2016-03-15 2016-07-20 广东欧珀移动通信有限公司 Sensor data calibrating method and device
CN106210227A (en) * 2016-07-06 2016-12-07 广东欧珀移动通信有限公司 Calibration method, device and mobile terminal of an infrared proximity sensor
CN106323353A (en) * 2016-08-12 2017-01-11 广东欧珀移动通信有限公司 Calibration method, device and terminal of a proximity sensor
CN106500751A (en) * 2016-10-20 2017-03-15 广东欧珀移动通信有限公司 Calibration method of proximity sensor and mobile terminal
CN107290802A (en) * 2017-07-18 2017-10-24 广东欧珀移动通信有限公司 Proximity sensor calibration method, proximity sensor calibration device and intelligent terminal
CN107504994A (en) * 2017-08-08 2017-12-22 广东欧珀移动通信有限公司 Calibration method, device, mobile terminal and readable storage medium for proximity sensor

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8775103B1 (en) * 2011-06-17 2014-07-08 Amazon Technologies, Inc. Proximity sensor calibration and configuration
US20130049641A1 (en) * 2011-08-26 2013-02-28 Qualcomm Incorpoated Proximity sensor calibration
CN105783900A (en) * 2016-03-15 2016-07-20 广东欧珀移动通信有限公司 Sensor data calibrating method and device
CN106210227A (en) * 2016-07-06 2016-12-07 广东欧珀移动通信有限公司 Calibration method, device and mobile terminal of an infrared proximity sensor
CN106323353A (en) * 2016-08-12 2017-01-11 广东欧珀移动通信有限公司 Calibration method, device and terminal of a proximity sensor
CN106500751A (en) * 2016-10-20 2017-03-15 广东欧珀移动通信有限公司 Calibration method of proximity sensor and mobile terminal
CN107290802A (en) * 2017-07-18 2017-10-24 广东欧珀移动通信有限公司 Proximity sensor calibration method, proximity sensor calibration device and intelligent terminal
CN107504994A (en) * 2017-08-08 2017-12-22 广东欧珀移动通信有限公司 Calibration method, device, mobile terminal and readable storage medium for proximity sensor

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110823963A (en) * 2018-08-09 2020-02-21 上海朴道水汇环保科技股份有限公司 TDS detection method and system, and terminal
CN109186657B (en) * 2018-09-26 2022-03-08 Oppo广东移动通信有限公司 Proximity sensor parameter calibration method and device, terminal equipment and storage medium
CN109186657A (en) * 2018-09-26 2019-01-11 Oppo广东移动通信有限公司 Proximity sensor parameter calibration method and device, terminal equipment and storage medium
CN109724640A (en) * 2019-01-12 2019-05-07 Oppo广东移动通信有限公司 Proximity sensor calibration method, electronic device, and computer-readable storage medium
CN111239750A (en) * 2020-01-03 2020-06-05 歌尔股份有限公司 Proximity sensor test method and proximity sensor test system
CN111239750B (en) * 2020-01-03 2023-03-03 歌尔光学科技有限公司 Proximity sensor testing method and proximity sensor testing system
CN111337907A (en) * 2020-02-26 2020-06-26 歌尔股份有限公司 Near object sensor calibration method, device, equipment and computer medium
CN111337907B (en) * 2020-02-26 2022-03-25 歌尔光学科技有限公司 Near object sensor calibration method, device, equipment and computer medium
CN111872939B (en) * 2020-08-02 2021-06-08 珠海市一微半导体有限公司 Robot automatic calibration detection method, chip and robot
CN111857154B (en) * 2020-08-02 2022-03-04 珠海一微半导体股份有限公司 Robot calibration detection method, chip and robot
CN111872939A (en) * 2020-08-02 2020-11-03 珠海市一微半导体有限公司 Robot automatic calibration detection method, chip and robot
CN111857154A (en) * 2020-08-02 2020-10-30 珠海市一微半导体有限公司 Robot calibration detection method, chip and robot
CN112260672A (en) * 2020-10-19 2021-01-22 深圳市太美亚电子科技有限公司 Method for adjusting induction distance of infrared device
CN112260672B (en) * 2020-10-19 2024-02-06 深圳市太美亚电子科技有限公司 Method for adjusting induction distance of infrared device
CN113031081A (en) * 2021-03-10 2021-06-25 维沃移动通信有限公司 Proximity sensing detection circuit, capacitance calibration method and device and electronic equipment
CN113031081B (en) * 2021-03-10 2024-06-04 维沃移动通信有限公司 Proximity sensing detection circuit, capacitance calibration method and device and electronic equipment
CN113091890A (en) * 2021-03-22 2021-07-09 北京小米移动软件有限公司 Calibration method of optical sensor, optical sensor and electronic device with optical sensor
CN118482741A (en) * 2024-06-14 2024-08-13 深圳大深传感科技有限公司 A method and system for calibrating detection distance of a photoelectric sensor

Also Published As

Publication number Publication date
CN108279408B (en) 2020-04-21

Similar Documents

Publication Publication Date Title
CN108279408A (en) Proximity sensor calibration method and device, mobile terminal and computer readable medium
CN108415024B (en) Proximity sensor calibration method and device, mobile terminal and computer readable medium
CN107943345B (en) Calibration method, device, storage medium and electronic device for proximity sensor
CN107896131B (en) Bluetooth signal adjustment method, device, test terminal, system and readable medium
CN108234035B (en) Transmit power adjustment method, device, terminal test system and electronic terminal
CN108199787B (en) Transmit power adjustment method, device, terminal test system and electronic terminal
WO2018103441A1 (en) Network positioning method and terminal device
CN109104521B (en) Proximity state correction method, device, mobile terminal and storage medium
CN107742523A (en) Speech signal processing method, device and mobile terminal
CN108234034A (en) Bluetooth signal method of adjustment, device, test terminal, system and readable medium
CN108199789B (en) Bluetooth signal adjustment method, device, test terminal, system and readable medium
CN108901031A (en) Radio frequency parameter adjusting method, device, mobile terminal and storage medium
CN108964838A (en) Transmission rate adjusting method and device and electronic device
CN108199785B (en) Transmission power test method, device, system and electronic equipment
CN108650335A (en) Method, device and testing equipment for communication connection with mobile terminal to be tested
CN108345422A (en) Application control method, apparatus, mobile terminal and computer-readable medium
CN108055092A (en) Bluetooth signal method of adjustment, device, test terminal, system and readable medium
CN108769299A (en) Screen control method, device and mobile terminal
CN107766548A (en) Method for information display, device, mobile terminal and readable storage medium storing program for executing
CN110221882B (en) Display method, display device, mobile terminal and storage medium
CN108880751A (en) Transmission rate adjustment method, device and electronic device
CN108234045B (en) Received signal strength adjusting method and device, terminal testing system and electronic terminal
CN108039928A (en) Received signal strength test method, device, system and electronic equipment
CN108199791A (en) Received signal strength testing method, device and system and electronic equipment
CN108958816A (en) Initial method, device and electronic device

Legal Events

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

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

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

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

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

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

Granted publication date: 20200421