CN112859050B - Correction method and device for optical distance sensor, storage medium and terminal - Google Patents

Correction method and device for optical distance sensor, storage medium and terminal Download PDF

Info

Publication number
CN112859050B
CN112859050B CN201911182303.9A CN201911182303A CN112859050B CN 112859050 B CN112859050 B CN 112859050B CN 201911182303 A CN201911182303 A CN 201911182303A CN 112859050 B CN112859050 B CN 112859050B
Authority
CN
China
Prior art keywords
value
signal
state
optical
distance sensor
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
CN201911182303.9A
Other languages
Chinese (zh)
Other versions
CN112859050A (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.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen Co 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 Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201911182303.9A priority Critical patent/CN112859050B/en
Publication of CN112859050A publication Critical patent/CN112859050A/en
Application granted granted Critical
Publication of CN112859050B publication Critical patent/CN112859050B/en
Active 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

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)
  • Optical Radar Systems And Details Thereof (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The embodiment of the application discloses a correction method and device of an optical distance sensor, a storage medium and a terminal, and belongs to the field of correction. The method and the device can solve the problem that in the related art, when sundries are attached to the glass cover plate, the fixed threshold is used for judging the approaching state and the separating state, and in the embodiment of the application, the approaching state judgment threshold and the separating state judgment threshold are dynamically adjusted according to the signal intensity value of the received optical signal in the non-shielding environment, and when the sundries are attached to the glass cover plate, the judging threshold can be adjusted in a self-adaptive mode, so that the measuring accuracy of the optical distance sensor is improved.

Description

Correction method and device for optical distance sensor, storage medium and terminal
Technical Field
The present application relates to the field of calibration, and in particular, to a method and apparatus for calibrating an optical distance sensor, a storage medium, and a terminal.
Background
The principle of the optical distance sensor is that a detection optical signal is emitted, the detection optical signal can be reflected to form a reflection optical signal after encountering an obstacle in front, and the optical signal sensor determines the distance of the obstacle according to the signal intensity of the reflection optical signal. Before the mobile phone leaves the factory, the tester can correct the optical distance sensor to determine the accuracy of the optical distance sensor, the correction of the optical distance sensor is performed under the clean state of the screen of the mobile phone, however, in the use process of the mobile phone, sundries such as greasy dirt, bubbles, sweat stains and the like possibly adhere to the glass cover plate of the optical sensor, and the working environment of the optical distance sensor changes relative to the factory correction environment, so that the working of the optical distance sensor is abnormal.
Disclosure of Invention
The embodiment of the application provides a correction method and device of an optical distance sensor, a storage medium and a terminal, which can solve the problem that the optical distance sensor is inaccurate in measurement due to attachment of sundries. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for calibrating an optical distance sensor, the method including:
transmitting a first optical signal by a signal transmitter of an optical distance sensor when an on condition of the optical distance sensor is satisfied;
receiving a second optical signal by a signal receiver of the optical distance sensor; wherein the second optical signal comprises an ambient noise signal and a diffraction signal formed by internal diffraction of the first optical signal;
determining a proximity state judgment threshold value according to the signal intensity value of the second optical signal and a preset proximity state correction value;
and determining a remote state judgment threshold value according to the signal intensity value of the second optical signal and a preset remote state correction value.
In one possible design, the approach state correction value is related to a first differential value, which is related to an approach state calibration value and an unoccluded signal strength value;
the away state correction value is related to a second differential value, and the second differential value is related to a away state calibration value and the unoccluded signal strength value;
the approaching state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, the away state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a second distance, and the first distance is smaller than the second distance.
In a second aspect, an embodiment of the present application provides a correction device for an optical distance sensor, including:
an indication unit for transmitting a first optical signal through a signal transmitter of an optical distance sensor when a condition for turning on the optical distance sensor is satisfied;
the indication unit is further used for receiving a second optical signal through a signal receiver of the optical distance sensor; wherein the second optical signal is an optical signal received in an unobstructed environment;
a correction unit, configured to determine a proximity state determination threshold according to a signal intensity value of the second optical signal and a preset proximity state correction value;
the correction unit is further configured to determine a remote state determination threshold according to the signal intensity value of the second optical signal and a preset remote state correction value.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-described method steps.
In a fourth aspect, an embodiment of the present application provides a terminal, including: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The technical scheme provided by the embodiments of the application has the beneficial effects that at least:
when the optical distance sensor works, the terminal acquires the signal intensity value of the received optical signal in the non-shielding environment, obtains the approaching state judgment threshold value according to the signal intensity value of the optical signal and the preset approaching state correction value, and obtains the distant state judgment threshold value according to the signal intensity value of the optical signal and the preset distant state correction value, so that the terminal candidate judges the approaching state or the distant state of the obstacle according to the dynamically adjusted approaching state judgment threshold value and the distant state judgment threshold value, the problem that the fixed threshold value is used for judging the approaching state and the distant state in the related art when sundries are attached to the glass cover plate is solved, and the accuracy of the optical distance sensor measurement is improved according to the dynamically adjusted approaching state judgment threshold value and the distant state judgment threshold value of the signal intensity value of the received optical signal in the non-shielding environment.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a terminal according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an operating system and user space provided by an embodiment of the present application;
FIG. 3 is an architecture diagram of the android operating system of FIG. 1;
FIG. 4 is an architecture diagram of the IOS operating system of FIG. 1;
FIG. 5 is a flow chart of a method for controlling a child mode according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an unobstructed time light distance sensor provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of an embodiment of the present application providing occlusion that is a light distance sensor;
fig. 8 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings.
In order to make the objects, technical solutions and advantages of the present application more apparent, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings.
Referring to fig. 1, a block diagram illustrating a structure of a terminal according to an exemplary embodiment of the present application is shown. The terminal of the present application may include one or more of the following components: processor 110, memory 120, input device 130, output device 140, and bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall terminal using various interfaces and lines, performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in at least one hardware form of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), programmable logic array (programmable logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processing unit (central processing unit, CPU), an image processor (graphics processing unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The memory 120 may include a random access memory (random Access Memory, RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system (including a system developed based on the Android system), an IOS system developed by apple corporation (including a system developed based on the IOS system), or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal in use (such as phonebook, audio-video data, chat-record data), etc.
Referring to FIG. 2, the memory 120 may be divided into an operating system space in which the operating system runs and a user space in which native and third party applications run. In order to ensure that different third party application programs can achieve better operation effects, the operating system allocates corresponding system resources for the different third party application programs. However, the requirements of different application scenarios in the same third party application program on system resources are different, for example, under the local resource loading scenario, the third party application program has higher requirement on the disk reading speed; in the animation rendering scene, the third party application program has higher requirements on the GPU performance. The operating system and the third party application program are mutually independent, and the operating system often cannot timely sense the current application scene of the third party application program, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third party application program.
In order to enable the operating system to distinguish specific application scenes of the third-party application program, data communication between the third-party application program and the operating system needs to be communicated, so that the operating system can acquire current scene information of the third-party application program at any time, and targeted system resource adaptation is performed based on the current scene.
Taking an operating system as an Android system as an example, as shown in fig. 3, a program and data stored in the memory 120 may be stored in the memory 120 with a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application layer 380, where the Linux kernel layer 320, the system runtime library layer 340 and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides the various hardware of the terminal with the underlying drivers such as display drivers, audio drivers, camera drivers, bluetooth drivers, wi-Fi drivers, power management, etc. The system runtime layer 340 provides the main feature support for the Android system through some C/c++ libraries. For example, the SQLite library provides support for databases, the OpenGL/ES library provides support for 3D graphics, the Webkit library provides support for browser kernels, and the like. Also provided in the system runtime library layer 340 is a An Zhuoyun runtime library (Android run) which provides mainly some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used in building applications, which developers can also build their own applications by using, for example, campaign management, window management, view management, notification management, content provider, package management, call management, resource management, location management. At least one application program is running in the application layer 380, and these application programs may be native application programs of the operating system, such as a contact program, a short message program, a clock program, a camera application, etc.; and may also be a third party application developed by a third party developer, such as a game-like application, instant messaging program, photo beautification program, shopping program, etc.
Taking an operating system as an IOS system as an example, the programs and data stored in the memory 120 are shown in fig. 4, the IOS system includes: core operating system layer 420 (Core OS layer), core service layer 440 (Core Services layer), media layer 460 (Media layer), and touchable layer 480 (Cocoa Touch Layer). The core operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide more hardware-like functionality for use by the program frameworks at the core services layer 440. The core services layer 440 provides system services and/or program frameworks required by the application, such as a Foundation (Foundation) framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a sports framework, and the like. The media layer 460 provides an interface for applications related to audiovisual aspects, such as a graphics-image related interface, an audio technology related interface, a video technology related interface, an audio video transmission technology wireless play (AirPlay) interface, and so forth. The touchable layer 480 provides various commonly used interface-related frameworks for application development, with the touchable layer 480 being responsible for user touch interactions on the terminal. Such as a local notification service, a remote push service, an advertisement framework, a game tool framework, a message User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
Among the frameworks illustrated in fig. 4, frameworks related to most applications include, but are not limited to: the infrastructure in core services layer 440 and the UIKit framework in touchable layer 480. The infrastructure provides many basic object classes and data types, providing the most basic system services for all applications, independent of the UI. While the class provided by the UIKit framework is a basic UI class library for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides the infrastructure for applications to build user interfaces, draw, process and user interaction events, respond to gestures, and so on.
The manner and principle of implementing data communication between the third party application program and the operating system in the IOS system can refer to the Android system, and the application is not described herein.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are a touch display screen for receiving a touch operation thereon or thereabout by a user using a finger, a touch pen, or any other suitable object, and displaying a user interface of each application program. The touch display screen is typically provided at the front panel of the terminal. The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen may also be designed as a combination of a full screen and a curved screen, and the combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configuration of the terminal illustrated in the above-described figures does not constitute a limitation of the terminal, and the terminal may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the terminal further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (wireless fidelity, wiFi) module, a power supply, and a bluetooth module, which are not described herein.
In the embodiment of the present application, the execution subject of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or other operating systems, which is not limited by the embodiments of the present application.
The terminal of the embodiment of the application can be further provided with a display device, and the display device can be various devices capable of realizing display functions, such as: cathode ray tube displays (cathode ray tubedisplay, CR), light-emitting diode displays (light-emitting diode display, LED), electronic ink screens, liquid crystal displays (liquid crystal display, LCD), plasma display panels (plasma display panel, PDP), and the like. A user may view displayed text, images, video, etc. information using a display device on the terminal 101. The terminal may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality ) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook, a desktop computing device, a wearable device such as an electronic watch, electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic article of clothing, etc.
In the terminal shown in fig. 1, the processor 110 may be used to call an application program stored in the memory 120 and specifically execute the calibration method of the optical distance sensor according to the embodiment of the present application.
In the technical scheme provided by the embodiment of the application, when the optical distance sensor works, the terminal acquires the signal intensity value of the optical signal received in the non-shielding environment, obtains the approaching state judgment threshold value according to the signal intensity value of the optical signal and the preset approaching state correction value, and obtains the distant state judgment threshold value according to the signal intensity value of the optical signal and the preset distant state correction value, so that the terminal candidate judges the approaching state or the distant state of the obstacle according to the dynamically adjusted approaching state judgment threshold value and the distant state judgment threshold value, the problem that the approaching state and the distant state are inaccurate when sundries are attached to the glass cover plate in the related technology is solved.
In the following method embodiments, for convenience of explanation, only the execution subject of each step is described as a terminal.
Referring to fig. 5, a flowchart of a method for calibrating an optical distance sensor according to an embodiment of the application is provided, and the method may include the following steps:
s501, when the condition of starting the optical distance sensor is met, a first optical signal is emitted through a signal emitter of the optical distance sensor.
The optical distance sensor comprises a light emitter and a light receiver, the light emitter is used for emitting light signals, the light emitter can be a laser diode, the light receiver is used for receiving the light signals, the optical distance sensor is arranged below a transparent glass cover plate, and the emitted light signals and the received light signals need to pass through the glass cover plate. The terminal estimates the distance between the obstacle in front and the optical distance sensor according to the signal intensity value of the received optical signal, wherein the signal intensity value and the distance are in negative correlation, and the larger the signal intensity value is, the smaller the distance is, and the smaller the signal intensity value is, and the larger the distance is. The terminal detects whether the condition of starting the optical distance sensor is met, and the detection method can be as follows: after the terminal detects the called request, when the terminal detects an instruction sent by the user and used for answering the called request, for example: sliding a sliding bar on the incoming call interface, determining that the condition for starting the optical distance sensor is met by the terminal, and indicating the optical distance sensor to start working by the terminal; or the terminal detects an instruction to issue a caller request, for example: after the user inputs a calling number on the dial plate, the dial button is clicked, the terminal determines that the condition for starting the optical distance sensor is met, and the terminal indicates the optical distance sensor to start working. When the optical distance sensor works, the optical distance sensor can periodically transmit a first optical signal, the transmission period can be determined according to actual requirements, the resolution of the distance estimated by the terminal and the transmission period are in negative correlation, and the smaller the transmission period is, the higher the resolution of the distance is; the larger the period of the emission, the smaller the resolution of the distance.
For example, referring to fig. 6, the optical distance sensor includes an optical transmitter 601, an optical receiver 602, and a glass cover plate 603, where an oil stain 604 is attached to the glass cover plate 603. When the terminal detects that the condition of starting the optical distance sensor is met, the first optical signal is emitted through the optical emitter 601, and when the optical emitter 601 emits the first optical signal, the front of the optical distance sensor is free of barriers.
In one or more possible embodiments, detecting whether a condition for turning on the light sensor is satisfied includes:
a: after the called request is detected, when an instruction for answering the called request is received, the condition for starting the optical distance sensor is determined to be met.
The called request is a voice call request or a video call request initiated by other terminals, when the terminal receives the called request, the terminal displays an incoming call interface and sends out an incoming call prompt, the incoming call interface comprises an answer button and a refusal button, when the terminal detects that a user clicks on the answer button, the terminal determines that the condition for starting the optical distance sensor is met, and the terminal starts the optical distance sensor.
B: the terminal displays a dialing interface, the terminal receives a dialing number input by a user on the dialing interface, a dialing button is arranged on the dialing interface, when the terminal detects click operation on the dialing button, the terminal is switched to a calling interface, and at the moment, the terminal determines that the condition for starting the optical distance sensor is met.
S502, receiving a second optical signal through a signal receiver of the optical distance sensor.
Wherein, there is no obstacle in front of the optical distance sensor when the first optical signal is emitted, but there may be impurities (e.g. sweat stain, greasy dirt, etc.) attached on the glass cover plate, the second optical signal includes an environmental noise optical signal and a diffraction signal formed by diffraction of the first optical signal by the impurities inside, and since there is no obstacle in front of the optical distance sensor when the first optical signal is emitted, the second optical signal does not include a reflection signal formed by reflection of the obstacle.
For example, referring to fig. 6, when the optical transmitter 601 emits the first optical signal, the optical distance sensor is free from an obstacle in front, and the optical receiver 602 receives the environmental noise signal and the first optical signal through the emission of the oil stain 604 to the diffraction signal formed by internal diffraction.
S503, determining a proximity state judgment threshold according to the signal intensity value of the second optical signal and a preset proximity state correction value.
The terminal measures the signal intensity value of the second optical signal, prestores or is preconfigured with an approaching state correction value, and obtains an approaching state judgment threshold according to the signal intensity value of the second optical signal and the approaching state correction value, wherein the approaching state judgment threshold is used for judging whether the distance between the obstacle and the terminal is approaching state or not. For example: and the terminal transmits a third optical signal through the optical transmitter, receives a fourth optical signal which is formed by transmitting the third optical signal to the obstacle through the optical receiver, compares whether the fourth optical signal is larger than or equal to the approaching state judging threshold, and if so, the terminal determines that the terminal is in an approaching state.
S504, determining a remote state judgment threshold according to the signal intensity value of the second optical signal and a preset remote state correction value.
The terminal obtains the signal intensity value of the second optical signal measured in S503, and the terminal prestores or is preconfigured with a remote state correction value, and obtains a remote state determination threshold according to the intensity value of the second optical signal and the remote state correction value, where the remote state determination threshold is smaller than the proximity state determination threshold. For example: the terminal takes the sum of the signal intensity value of the second optical signal and the remote state correction value as a remote state judgment threshold value, the terminal transmits a third optical signal through the optical transmitter, the terminal receives a fourth optical signal which is formed by transmitting the third optical signal to the obstacle through the optical receiver, the terminal judges whether the signal intensity value of the third optical signal is smaller than or equal to the remote state judgment threshold value, and if the signal intensity value of the third optical signal is smaller than or equal to the remote state judgment threshold value, the terminal determines that the terminal is in a remote state.
In one possible embodiment, the approach state correction value is related to a first differential value, the first differential value is related to an approach state calibration value and an unoccluded signal strength value;
the distance state correction value is related to a second differential value, and the second differential value is related to a distance state calibration value and a non-shielding signal intensity value;
the approaching state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, and the separating state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a second distance, wherein the first distance is smaller than the second distance.
The approach state correction value and the separation state correction value are preset, when no obstacle exists in front of the optical distance sensor, the optical distance sensor emits an optical signal, then the optical distance sensor corresponds to an unobstructed optical signal of the optical signal, and the intensity value of the unobstructed optical signal is the intensity value of the unobstructed optical signal. Then, a gray card is arranged at a first distance of the optical distance sensor, the optical distance sensor emits an optical signal, the optical signal is reflected by the gray card to form a reflected signal, and the optical distance sensor receives the reflected signal, wherein the signal intensity value of the reflected signal is the approaching state calibration value of the application. And arranging a gray card at a second distance of the optical distance sensor, wherein the optical distance sensor emits an optical signal, the optical signal meets the gray card to generate a reflected signal, the optical distance sensor receives the reflected signal, and the signal intensity value of the reflected signal is the far-away state calibration value of the application. The difference value obtained by subtracting the non-shielding signal intensity value from the approaching state calibration value is used as a first difference value, and the difference value obtained by subtracting the non-shielding signal intensity value from the separating state calibration value is used as a second difference value. The present application may multiply the first differential value by a preset weighting coefficient as the approach state correction value and directly multiply the second differential value by a preset weighting coefficient as the distance state correction value. The first distance and the second distance may be determined according to practical requirements, for example: the first distance is 3cm and the second distance is 5cm.
Further, the first differential value and the second differential value are determined by the following formula:
far=far_value–rawdata1;
near = near_value-rawdata1; wherein far represents the second differential value, far_value represents the far state calibration value, near represents the first differential value, near_value represents the near state calibration value, and rawdata1 represents the unoccluded signal strength value. The units of the above parameters can be expressed in decibels.
Further, the approach state correction value is obtained by weighted averaging a plurality of first differential values, and the distance state correction value is obtained by weighted averaging a plurality of second differential values, and the number of the plurality of first differential values and the number of the plurality of second differential values are equal. The method of weighted averaging may be arithmetic averaging, geometric averaging, etc.
For example: n second differential values are far1, far2, …, far, n first differential values are near1, near2, …, near, the final second differential values are (far 1+far2+, …, +far)/n, the final first differential values are (near 1+near2+, …, +near)/n, and n is an integer greater than or equal to 2.
The first differential values and the second differential values may be measured by a plurality of different optical distance sensors, or may be measured by the same optical distance sensor.
For example: the 50 optical distance sensors are an optical distance sensor 1, optical distance sensors 2 and …, and an optical distance sensor 50, respectively, a first differential value 1 and a second differential value 1 measured by the optical distance sensor 1, a first differential value 2 and first differential values 2 and … measured by the optical distance sensor 2, and a first differential value 50 and a second differential value 50 measured by the optical distance sensor 50.
Also for example: the optical distance sensor in S501 performs 50 measurements, the first measurement results in a first differential value 1 and a second differential value 1, the second measurement results in a first differential value 2 and a first differential value 2, …, and the fifty-th measurement results in a first differential value 50 and a second differential value 50.
In one or more possible embodiments, the approaching state determination threshold and the distancing state determination threshold are determined by the following formulas:
mTask.ps_threshold_low=rawdata+FAR;
mtask.ps_threshold_high=rawdata+near; wherein, mtask.ps_threshold_low represents the distance state determination threshold, mtask.ps_threshold_high represents the approach state determination threshold, rawdata represents the signal intensity value of the second optical signal, FAR represents the distance state correction value, NEAR represents the approach state correction value.
After the approaching state judgment threshold value and the principle state judgment threshold value are determined, when an obstacle exists in front of the optical distance sensor, the terminal transmits an optical signal through the optical distance sensor, the optical signal meets the obstacle to form a reflected signal, the terminal receives the reflected signal through the optical distance sensor, when the terminal determines that the signal strength value of the reflected signal is greater than or equal to the approaching state judgment threshold value, the terminal determines that the obstacle is in an approaching state, and when the terminal receives an incoming call or dials a call, the terminal can perform screen-off processing; when the terminal determines that the signal intensity value of the reflected signal is smaller than or equal to the far-away state judging threshold value, the terminal determines that the obstacle is in a far-away state, and the terminal can lighten a screen when receiving an incoming call or making a call.
For example, referring to fig. 7, the optical distance sensor includes a light emitter 701, a light receiver 702, a glass cover 703, and oil dirt 704 attached to the glass cover 703, and an obstacle 705 is present in front of the optical distance sensor. The approach state judgment threshold value determined by the optical distance sensor when no obstacle exists in front is-50 dB, the distance state judgment threshold value is-70 dB, and the terminal can determine the two threshold values according to the signal intensity value of the non-shielding optical signal when detecting an instruction for processing an incoming call request or detecting an instruction for making a call. The terminal periodically transmits an optical signal, a reflected signal is formed after the optical signal meets the barrier 705, the terminal measures the signal intensity value of the reflected signal, when the signal intensity value is greater than or equal to-50 dB, the terminal determines that the barrier 705 is in a close state, and the terminal lights a display screen; when the terminal determines that the signal intensity value of the reflected signal is less than or equal to-70 dB, the terminal extinguishes the display screen.
According to the method, when the optical distance sensor works, the terminal acquires the signal intensity value of the optical signal received in the non-shielding environment, the approaching state judgment threshold value is obtained according to the signal intensity value of the optical signal and the preset approaching state correction value, and the remote state judgment threshold value is obtained according to the signal intensity value of the optical signal and the preset remote state correction value, so that the terminal candidate judges the approaching state or the remote state of the obstacle according to the dynamically adjusted approaching state judgment threshold value and the remote state judgment threshold value, the problem that the fixed threshold value is used for judging the approaching state and the remote state inaccurately when sundries are attached to the glass cover plate in the related art is solved, and the method, the device and the system can adaptively adjust the judging threshold value and improve the measuring accuracy of the optical distance sensor according to the signal intensity value of the optical signal received in the non-shielding environment.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Referring to fig. 8, a schematic structural diagram of a calibration device for an optical distance sensor according to an exemplary embodiment of the present application is shown, and the calibration device 8 is hereinafter referred to as "calibration device". The correction means 8 may be implemented as all or part of the smart lever by software, hardware or a combination of both, the correction means 8 comprising: an instruction unit 801 and a correction unit 802.
An indication unit 801 for transmitting a first optical signal through a signal transmitter of an optical distance sensor when a condition for turning on the optical distance sensor is satisfied;
the indication unit 801 is further configured to receive a second optical signal through a signal receiver of the optical distance sensor; wherein the second optical signal is an optical signal received in an unobstructed environment;
a correction unit 802, configured to determine a proximity state determination threshold according to a signal intensity value of the second optical signal and a preset proximity state correction value;
the correction unit 802 is further configured to determine a remote status determination threshold according to the signal intensity value of the second optical signal and a preset remote status correction value.
In one or more possible embodiments, the approach state correction value is related to a first differential value, the first differential value is related to an approach state calibration value and an unoccluded signal strength value;
the away state correction value is related to a second differential value, and the second differential value is related to a away state calibration value and the unoccluded signal strength value;
the approaching state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, the away state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a second distance, and the first distance is smaller than the second distance.
In one or more possible embodiments, the first differential value and the second differential value are determined by the following formula:
far=far_value–rawdata1;
near = near_value-rawdata1; wherein far represents the second differential value, far_value represents the far state calibration value, near represents the first differential value, near_value represents the near state calibration value, and rawdata1 represents the unoccluded signal strength value.
In one or more possible embodiments, the approach state correction value is obtained by weighted averaging a plurality of first differential values, and the distance state correction value is obtained by weighted averaging a plurality of second differential values.
In one or more possible embodiments, the plurality of first differential values and the plurality of second differential values are measured by a plurality of different optical distance sensors, or by the same optical distance sensor measured multiple times.
In one or more possible embodiments, the correction device 8 further comprises:
the processing unit is used for determining that the condition for starting the optical distance sensor is met when receiving an instruction for receiving the called request after the called request is detected; or (b)
Upon receiving an instruction to initiate a caller request, it is determined that a condition to turn on the light sensor is satisfied.
In one or more possible embodiments, the approaching state determination threshold and the distancing state determination threshold are determined by the following formulas:
mTask.ps_threshold_low=rawdata+FAR;
mtask.ps_threshold_high=rawdata+near; wherein, mtask.ps_threshold_low represents the distance state determination threshold, mtask.ps_threshold_high represents the approach state determination threshold, rawdata represents the signal intensity value of the second optical signal, FAR represents the distance state correction value, NEAR represents the approach state correction value.
It should be noted that, when the correction device for an optical distance sensor provided in the foregoing embodiment performs the correction method for an optical distance sensor, only the division of the foregoing functional modules is used as an example, and in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. In addition, the correction device of the optical distance sensor provided in the above embodiment and the correction method embodiment of the optical distance sensor belong to the same concept, which embody the detailed implementation process in the method embodiment, and are not described herein again.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
When the scheme of the embodiment of the application is executed, the correction device 8 acquires the signal intensity value of the optical signal received in the non-shielding environment when the optical distance sensor works, obtains the approaching state judgment threshold value according to the signal intensity value of the optical signal and the preset approaching state correction value, and obtains the far state judgment threshold value according to the signal intensity value of the optical signal and the preset far state correction value, so that the terminal candidate judges the approaching state or the far state of the obstacle according to the dynamically adjusted approaching state judgment threshold value and the far state judgment threshold value, and solves the problem that inaccuracy exists in judging the approaching state and the far state by using the fixed threshold value when sundries are attached on the glass cover plate in the related technology.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are adapted to be loaded by a processor and execute the steps of the method as described above, and the specific implementation process may refer to the specific description of the embodiment shown in fig. 5, which is not repeated herein.
The application also provides a terminal, which comprises a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described embodiment of the apparatus is merely illustrative, and for example, the division of the units is merely a logic function division, and there may be other division manners in actual implementation, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The functional units in the embodiments of the present application may be all integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (7)

1. A method for calibrating an optical distance sensor, comprising:
transmitting a first optical signal by a signal transmitter of an optical distance sensor when a condition for turning on the optical distance sensor is satisfied;
receiving a second optical signal by a signal receiver of the optical distance sensor; wherein the second optical signal comprises an environmental noise signal and a diffraction signal formed by the first optical signal diffracting inside when encountering oil stains in front of the optical distance sensor;
determining a proximity state judgment threshold value according to the signal intensity value of the second optical signal and a preset proximity state correction value;
determining a remote state judgment threshold value according to the signal intensity value of the second optical signal and a preset remote state correction value;
wherein the approach state correction value is related to a first differential value, and the first differential value is related to an approach state calibration value and a non-occlusion signal strength value; the away state correction value is related to a second differential value, and the second differential value is related to a away state calibration value and the unoccluded signal strength value; the approaching state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, the away state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a second distance, and the first distance is smaller than the second distance;
the first differential value and the second differential value are determined by the following formula:
far = far_value – rawdata1;
near = near_value-rawdata1; wherein the far represents the second differential value, the far_value represents the far state calibration value, the near represents the first differential value, the near_value represents the near state calibration value, and the rawdata1 represents the unoccluded signal strength value;
the approaching state determination threshold and the distancing state determination threshold are determined by the following formulas:
mTask.ps_threshold_low = rawdata + FAR;
mtask.ps_threshold_high=rawdata+near; wherein, mtask.ps_threshold_low represents the away state determination threshold, mtask.ps_threshold_high represents the approach state determination threshold, rawdata represents the signal intensity value of the second optical signal, FAR represents the away state correction value, and NEAR represents the approach state correction value.
2. The method of calibrating according to claim 1, wherein,
the approach state correction value is obtained by weighted average of a plurality of first differential values, and the distant state correction value is obtained by weighted average of a plurality of second differential values.
3. The correction method according to claim 2, wherein the plurality of first differential values and the plurality of second differential values are measured by a plurality of different optical distance sensors or by the same optical distance sensor measured a plurality of times.
4. The correction method according to claim 1, characterized by further comprising:
after a called request is detected, when an instruction for receiving the called request is received, determining that a condition for starting the optical distance sensor is met; or (b)
Upon receiving an instruction to initiate a caller request, it is determined that a condition to turn on the light sensor is satisfied.
5. A correction device for an optical distance sensor, comprising:
an indication unit for transmitting a first optical signal through a signal transmitter of an optical distance sensor when a condition for turning on the optical distance sensor is satisfied;
the indication unit is further used for receiving a second optical signal through a signal receiver of the optical distance sensor; wherein the second optical signal comprises an environmental noise signal and a diffraction signal formed by the first optical signal diffracting inside when encountering oil stains in front of the optical distance sensor;
a correction unit, configured to determine a proximity state determination threshold according to a signal intensity value of the second optical signal and a preset proximity state correction value;
the correction unit is further used for determining a remote state judgment threshold value according to the signal intensity value of the second optical signal and a preset remote state correction value;
wherein the approach state correction value is related to a first differential value, and the first differential value is related to an approach state calibration value and a non-occlusion signal strength value; the away state correction value is related to a second differential value, and the second differential value is related to a away state calibration value and the unoccluded signal strength value; the approaching state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, the away state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a second distance, and the first distance is smaller than the second distance;
the first differential value and the second differential value are determined by the following formula:
far = far_value – rawdata1;
near = near_value-rawdata1; wherein the far represents the second differential value, the far_value represents the far state calibration value, the near represents the first differential value, the near_value represents the near state calibration value, and the rawdata1 represents the unoccluded signal strength value;
the approaching state determination threshold and the distancing state determination threshold are determined by the following formulas:
mTask.ps_threshold_low = rawdata + FAR;
mtask.ps_threshold_high=rawdata+near; wherein, mtask.ps_threshold_low represents the away state determination threshold, mtask.ps_threshold_high represents the approach state determination threshold, rawdata represents the signal intensity value of the second optical signal, FAR represents the away state correction value, and NEAR represents the approach state correction value.
6. A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method steps of any one of claims 1 to 4.
7. A terminal, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1-4.
CN201911182303.9A 2019-11-27 2019-11-27 Correction method and device for optical distance sensor, storage medium and terminal Active CN112859050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911182303.9A CN112859050B (en) 2019-11-27 2019-11-27 Correction method and device for optical distance sensor, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911182303.9A CN112859050B (en) 2019-11-27 2019-11-27 Correction method and device for optical distance sensor, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN112859050A CN112859050A (en) 2021-05-28
CN112859050B true CN112859050B (en) 2023-09-15

Family

ID=75984774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911182303.9A Active CN112859050B (en) 2019-11-27 2019-11-27 Correction method and device for optical distance sensor, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN112859050B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105842680A (en) * 2016-03-16 2016-08-10 广东欧珀移动通信有限公司 Data processing method and apparatus thereof
CN107102864A (en) * 2017-05-16 2017-08-29 广东欧珀移动通信有限公司 One kind puts out screen control method, device, storage medium and terminal
CN107219515A (en) * 2017-05-25 2017-09-29 深圳市金立通信设备有限公司 The parameter calibrating method and terminal of a kind of range sensor
CN107665081A (en) * 2017-10-16 2018-02-06 广东欧珀移动通信有限公司 Display screen condition control method, device, storage medium and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ITMO20120235A1 (en) * 2012-09-27 2014-03-28 Datalogic IP Tech Srl OPTOELECTRONIC SENSOR FOR THE DETECTION OF ONE OR MORE CHARACTERISTICS OF AN OBJECT

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105842680A (en) * 2016-03-16 2016-08-10 广东欧珀移动通信有限公司 Data processing method and apparatus thereof
CN107102864A (en) * 2017-05-16 2017-08-29 广东欧珀移动通信有限公司 One kind puts out screen control method, device, storage medium and terminal
CN107219515A (en) * 2017-05-25 2017-09-29 深圳市金立通信设备有限公司 The parameter calibrating method and terminal of a kind of range sensor
CN107665081A (en) * 2017-10-16 2018-02-06 广东欧珀移动通信有限公司 Display screen condition control method, device, storage medium and terminal

Also Published As

Publication number Publication date
CN112859050A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN109543099B (en) Content recommendation method and terminal equipment
CN111447107B (en) Network state determining method and device, storage medium and electronic equipment
CN111459586B (en) Remote assistance method, device, storage medium and terminal
WO2019233307A1 (en) User interface display method and apparatus, and terminal and storage medium
US11227533B2 (en) Ambient light collecting method and apparatus, terminal and storage medium
CN112714216B (en) Brightness adjusting method and device, storage medium and terminal
CN112116212B (en) Application evaluation method and device, storage medium and electronic equipment
CN108804151B (en) Method and terminal for restarting application program
CN111986454A (en) Wireless earphone searching method, device, storage medium and terminal
CN110012152B (en) Interface display method and terminal equipment
CN111918386A (en) Positioning method, positioning device, storage medium and electronic equipment
CN114285936B (en) Screen brightness adjustment method and device, storage medium and terminal
CN113163055B (en) Vibration adjusting method and device, storage medium and electronic equipment
CN112859050B (en) Correction method and device for optical distance sensor, storage medium and terminal
CN109639880B (en) Weather information display method and terminal equipment
CN109561258B (en) Light supplementing method and terminal equipment
CN113126859A (en) Contextual model control method, contextual model control device, storage medium and terminal
CN112995562A (en) Camera calling method and device, storage medium and terminal
CN113595662B (en) Signal prompting method, device, terminal equipment and storage medium
CN115379005A (en) Message processing method and device, storage medium and electronic equipment
CN115328725A (en) State monitoring method and device, storage medium and electronic equipment
CN111770510B (en) Network experience state determining method and device, storage medium and electronic equipment
CN111949150B (en) Method and device for controlling peripheral switching, storage medium and electronic equipment
CN113495641A (en) Touch screen ghost point identification method and device, terminal and storage medium
CN112612487B (en) Application installation method, device, storage medium and 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