CN112859050A - Method and device for correcting optical distance sensor, storage medium and terminal - Google Patents

Method and device for correcting optical distance sensor, storage medium and terminal Download PDF

Info

Publication number
CN112859050A
CN112859050A CN201911182303.9A CN201911182303A CN112859050A CN 112859050 A CN112859050 A CN 112859050A CN 201911182303 A CN201911182303 A CN 201911182303A CN 112859050 A CN112859050 A CN 112859050A
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.)
Granted
Application number
CN201911182303.9A
Other languages
Chinese (zh)
Other versions
CN112859050B (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

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • 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

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 inaccurate approaching state and far state exists when sundries are attached to the glass cover plate in the related art by using the fixed threshold value, the approaching state judgment threshold value and the far state judgment threshold value are dynamically adjusted according to the signal intensity value of the received optical signal in the non-shielding environment, and the threshold value can be adaptively adjusted and judged under the condition that the sundries are attached to the glass cover plate, so that the measuring accuracy of the optical distance sensor is improved.

Description

Method and device for correcting optical distance sensor, storage medium and terminal
Technical Field
The present disclosure relates to the field of calibration, and in particular, to a method and an apparatus for calibrating an optical distance sensor, a storage medium, and a terminal.
Background
The principle of the optical distance sensor is to emit a detection optical signal, the detection optical signal is reflected to form a reflected optical signal after encountering a front obstacle, and the optical signal sensor determines the distance of the obstacle according to the signal intensity of the reflected optical signal. Before the mobile phone leaves a factory, a 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 in a clean state on a screen of the mobile phone, however, in the using process of the mobile phone, sundries such as oil stains, bubbles and sweat stains may be attached to a 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 optical distance sensor is not normally operated.
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 has inaccurate 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 correcting an optical distance sensor, where the method includes:
when the starting condition of the optical distance sensor is met, a first optical signal is transmitted by a signal transmitter of the optical distance sensor;
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 internally diffracting the first optical signal;
determining an approaching state judgment threshold according to the signal intensity value of the second optical signal and a preset approaching state correction value;
and determining a far-away state judgment threshold according to the signal intensity value of the second optical signal and a preset far-away state correction value.
In one possible design, the proximate state modifier value is associated with a first differential value, the first differential value is associated with a proximate state calibration value and a no-occlusion signal strength value;
the far state correction value is related to a second differential value, and the second differential value is related to the far state calibration value and the non-shielding signal intensity value;
the close state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, the far 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 calibration apparatus for an optical distance sensor, the calibration apparatus including:
the indicating unit is used for transmitting a first optical signal through a signal transmitter of the optical distance sensor when the condition of starting the optical distance sensor is met;
the indicating 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;
the correction unit is used for determining an approaching state judgment threshold value according to the signal intensity value of the second optical signal and a preset approaching state correction value;
the correction unit is further configured to determine a far-state decision threshold according to the signal intensity value of the second optical signal and a preset far-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-mentioned 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 beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
when the terminal works in the optical distance sensor, the signal intensity value of the optical signal received in the non-shielding environment is obtained, 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 far state judgment threshold value is obtained 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, the problem that the approaching state and the far state are inaccurate by using the fixed threshold value when sundries are adhered to the glass cover plate in the related art is solved, the approaching state judgment threshold value and the far state judgment threshold value are dynamically adjusted according to the signal intensity value of the optical signal received in the non-shielding environment, and under the condition that the sundries are adhered to the glass cover plate, the threshold value of the judgment can be adjusted in a self-adaptive mode, and the accuracy of the measurement of the optical distance sensor is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an operating system and a user space provided in an embodiment of the present application;
FIG. 3 is an architectural 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 flowchart illustrating a control method for a child mode according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an optical distance sensor without occlusion according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a shielded optical distance sensor according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, a block diagram of a terminal according to an exemplary embodiment of the present application is shown. A terminal in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and 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 entire terminal using various interfaces and lines, and 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 calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-programmable gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a read-only Memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, 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, and the operating system may be an Android (Android) system (including a system based on Android system depth development), an IOS system developed by apple inc (including a system based on IOS system depth development), or other systems. The storage data area may also store data created by the terminal in use, such as a phonebook, audio-video data, chat log data, and the like.
Referring to fig. 2, the memory 120 may be divided into an operating system space, in which an 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 a better operation effect, 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, in a local resource loading scenario, the third-party application program has a higher requirement on the disk reading speed; in the animation rendering scene, the third-party application program has a high requirement on the performance of the GPU. The operating system and the third-party application program are independent from each other, and the operating system cannot sense the current application scene of the third-party application program in time, 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 a specific application scenario of the third-party application program, data communication between the third-party application program and the operating system needs to be opened, so that the operating system can acquire current scenario information of the third-party application program at any time, and further perform targeted system resource adaptation based on the current scenario.
Taking an operating system as an Android system as an example, programs and data stored in the memory 120 are as shown in fig. 3, and a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360, and an application layer 380 may be stored in the memory 120, 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 underlying drivers for various hardware of the terminal, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, a power management, and the like. The system runtime library layer 340 provides a main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system runtime library layer 340 is an Android runtime library (Android runtime), which mainly provides 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 an application, and developers may build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, package management, session management, resource management, and location management. At least one application program runs in the application layer 380, and the application programs may be native application programs carried by the operating system, such as a contact program, a short message program, a clock program, a camera application, and the like; or a third-party application developed by a third-party developer, such as a game-like application, an instant messaging program, a photo beautification program, a shopping program, and the like.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 4, and the IOS system includes: a Core operating system Layer 420(Core OS Layer), a Core Services Layer 440(Core Services Layer), a Media Layer 460(Media Layer), and a touchable Layer 480(Cocoa Touch Layer). The kernel operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide functionality closer to hardware for use by program frameworks located in the core services layer 440. The core services layer 440 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, as required by the application. The media layer 460 provides audiovisual related interfaces for applications, such as graphics image related interfaces, audio technology related interfaces, video technology related interfaces, audio video transmission technology wireless playback (AirPlay) interfaces, and the like. Touchable layer 480 provides various common interface-related frameworks for application development, and touchable layer 480 is responsible for user touch interaction operations on the terminal. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
In the framework shown in FIG. 4, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 440 and a UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.
The Android system can be referred to as a mode and a principle for realizing data communication between the third-party application program and the operating system in the IOS system, and details are not repeated herein.
The input device 130 is used for receiving 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 for outputting 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 touch display screens for receiving touch operations of a user on or near the touch display screens by using any suitable object such as a finger, a touch pen, and the like, and displaying user interfaces of various applications. The touch display screen is generally provided at a front panel of the terminal. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the embodiment of the present application, the main body of execution 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 another operating system, which is not limited in this embodiment of the present application.
The terminal of the embodiment of the application can also be provided with a display device, and the display device can be various devices capable of realizing a display function, for example: a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink panel, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. The user can view information such as displayed text, images, video, etc. using the 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, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
In the terminal shown in fig. 1, the processor 110 may be configured 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 solution provided in the embodiment of the present application, when the optical distance sensor works, the terminal obtains the signal intensity value of the received optical signal in the non-shielding environment, obtains the approaching state decision threshold according to the signal intensity value of the optical signal and the preset approaching state correction value, and obtains the departing state decision threshold according to the signal intensity value of the optical signal and the preset departing state correction value, so that the terminal candidate judges the approaching state or the departing state of the obstacle according to the dynamically adjusted approaching state decision threshold and departing state decision threshold, thereby solving the problem that the approaching state and the departing state are determined inaccurately by using the fixed threshold when the sundries are attached to the glass cover plate in the related art, the embodiment of the present application dynamically adjusts the approaching state decision threshold and the departing state decision threshold according to the signal intensity value of the received optical signal in the non-shielding environment, under the condition that sundries are attached to the glass cover plate, the judgment threshold value can be adjusted in a self-adaptive mode, and the measuring accuracy of the optical distance sensor is improved.
In the following method embodiments, for convenience of description, only the main execution body of each step is described as a terminal.
Referring to fig. 5, a schematic flow chart of a calibration method of an optical distance sensor is provided in an embodiment of the present application, where the calibration method includes 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, wherein the light emitter is used for emitting optical signals, the light emitter can be a laser diode, the light receiver is used for receiving optical signals, the optical distance sensor is arranged below a transparent glass cover plate, and the emitted optical signals and the received optical signals need to pass through the glass cover plate. The terminal estimates the distance between the front obstacle and the optical distance sensor according to the signal intensity value of the received optical signal, the signal intensity value and the distance are in negative correlation, the distance is smaller when the signal intensity value is larger, and the distance is larger when the signal intensity value is smaller. The terminal detects whether the condition for 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 to answer the called request, for example: sliding a sliding strip 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 for sending the calling request, for example: after a user inputs a calling number on the dial plate, the user clicks a dialing button, 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 emit a first optical signal, the emitting period can be determined according to actual requirements, the resolution of the distance estimated by the terminal is in negative correlation with the emitting period, and the smaller the emitting period is, the higher the resolution of the distance is; the larger the period of emission, the smaller the resolution of the distance.
For example, referring to fig. 6, the optical distance sensor includes a light emitter 601, a light receiver 602, and a glass cover plate 603, and a layer of oil stain 604 is attached to the glass cover plate 603. When the terminal detects that the condition for starting the optical distance sensor is met, the light emitter 601 emits a first light signal, and when the light emitter 601 emits the first light signal, no obstacle exists in front of the optical distance sensor.
In one or more possible embodiments, detecting whether a condition for turning on the light sensor is satisfied includes:
a: and after the called request is detected, when an instruction for answering the called request is received, determining that the condition for starting the optical distance sensor is met.
The called request is that the terminal receives a voice call request or a video call request initiated by other terminals, when the terminal receives the called request, the terminal displays a call interface and sends out a call prompt, the call interface comprises an answering button and a rejection button, when the terminal detects the click operation of a user on the answering button, the condition of starting the optical distance sensor is determined to be met, and the terminal starts the optical distance sensor.
B: the terminal displays a dialing interface, receives a dialing number input on the dialing interface by a user, a dialing button is arranged on the dialing interface, when the terminal detects a click operation on the dialing button, the terminal is switched to a calling interface, and at the moment, the terminal determines that the condition of starting the optical distance sensor is met.
And S502, receiving a second optical signal through a signal receiver of the optical distance sensor.
The optical distance sensor comprises a first optical signal and a second optical signal, wherein no obstacle exists in front of the optical distance sensor when the first optical signal is emitted, but sundries (such as sweat stains, oil stains and the like) can be adhered to the glass cover plate, the second optical signal comprises an ambient noise optical signal and a diffraction signal formed by diffraction of the first optical signal when the first optical signal meets the sundries, and the second optical signal does not comprise a reflection signal formed by reflection of the obstacles because the first optical signal is emitted and no obstacle exists in front of the optical distance sensor.
For example, referring to fig. 6, when the optical transmitter 601 transmits the first optical signal, there is no obstacle in front of the optical distance sensor, and the optical receiver 602 receives the environmental noise signal and the diffraction signal of the first optical signal from the oil stain 604.
And S503, determining an approaching state judgment threshold according to the signal intensity value of the second optical signal and a preset approaching state correction value.
The terminal measures a signal intensity value of the second optical signal, the terminal prestores or preconfigures an approach state correction value, an approach state judgment threshold is obtained according to the signal intensity value of the second optical signal and the approach state correction value, and the approach state judgment threshold is used for judging whether the distance between the obstacle and the terminal is in an approach state or not. For example: and the sum of the signal intensity value of the second optical signal and the proximity state correction value is used as a proximity state judgment threshold value, the terminal transmits a third optical signal through the optical transmitter, receives a fourth optical signal formed by transmitting the third optical signal to the obstacle through the optical receiver, compares whether the fourth optical signal is greater than or equal to the proximity state judgment threshold value, and if so, determines that the terminal is in the proximity state.
And S504, determining a far-away state judgment threshold according to the signal intensity value of the second optical signal and a preset far-away state correction value.
The terminal obtains the signal intensity value of the second optical signal measured in S503, the terminal prestores or is preconfigured with a far-away state correction value, and obtains a far-away state decision threshold according to the signal intensity value of the second optical signal and the far-away state correction value, where the far-away state decision threshold is smaller than the close-to state decision threshold. For example: and the terminal takes the sum of the signal intensity value of the second optical signal and the distance state correction value as a distance state judgment threshold value, the terminal transmits a third optical signal through the optical transmitter, the terminal receives a fourth optical signal 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 distance state judgment threshold value, and if so, the terminal determines that the terminal is in the distance state.
In one possible embodiment, the proximity state correction value is associated with a first differential value, the first differential value is associated with the proximity state calibration value and the non-occluded signal strength value;
the far state correction value is related to a second differential value, and the second differential value is related to a far 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, the departing 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 approaching state correction value and the departing 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 emits a non-shielding optical signal corresponding to the optical signal, and the intensity value of the non-shielding optical signal is the intensity value of the non-shielding 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 meets the gray card to generate reflection to form a reflection signal, the optical distance sensor receives the reflection signal, and the signal intensity value of the reflection signal is the close 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 reflection signal, the optical distance sensor receives the reflection signal, and the signal intensity value of the reflection signal is the far-away state calibration value of the application. And taking a difference value obtained by subtracting the non-shielding signal intensity value from the close state calibration value as a first difference value, and taking a difference value obtained by subtracting the non-shielding signal intensity value from the far state calibration value as a second difference value. The application can multiply the first difference value by a preset weighting coefficient to be used as the close state correction value, and directly multiply the second difference value by a preset weighting coefficient to be used as the far state correction value. The first distance and the second distance may be determined according to actual requirements, for example: the first distance is 3cm and the second distance is 5 cm.
Further, the first differential value and the second differential value are determined by the following formula:
far=far_value–rawdata1;
near _ value-raw data 1; wherein far represents the second difference value, far _ value represents the far state calibration value, near represents the first difference value, near _ value represents the near state calibration value, and rawdata1 represents the no-occlusion signal strength value. The unit of each of the above parameters can be expressed in decibels.
Further, the approaching state correction value is obtained by weighted averaging of the plurality of first differential values, and the receding state correction value is obtained by weighted averaging of the 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 weighted average may be an arithmetic average, a geometric average, or the like.
For example: the n second differential values are far1, far2, … and far, the n first differential values are near1, near2, … and near, the final second differential values are (far1+ far2+, … and + far)/n, the final first differential values are (near1+ near2+, … and + near)/n, and n is an integer greater than or equal to 2.
The plurality of first differential values and the plurality of second differential values may be obtained by measuring by a plurality of different optical distance sensors, or may be obtained by measuring by the same optical distance sensor.
For example: the 50 optical distance sensors are respectively an optical distance sensor 1, optical distance sensors 2, … and an optical distance sensor 50, wherein the optical distance sensor 1 measures a first differential value 1 and a second differential value 1, the optical distance sensor 2 measures a first differential value 2 and a first differential value 2, …, and the optical distance sensor 50 measures a first differential value 50 and a second differential value 50.
Another example is: the optical distance sensor in S501 performs 50 measurements, the first differential value 1 and the second differential value 1 obtained by the first measurement, the first differential value 2 and the first differential value 2, … obtained by the second measurement, and the first differential value 50 and the second differential value 50 obtained by the fiftieth measurement.
In one or more possible embodiments, the approach state decision threshold and the departure state decision threshold are determined by the following formulas:
mTask.ps_threshold_low=rawdata+FAR;
ps _ threshold _ high ═ raw data + NEAR; wherein mtask.ps _ threshold _ low represents the distant state determination threshold, mtask.ps _ threshold _ high represents the close state determination threshold, rawdata represents the signal intensity value of the second optical signal, FAR represents the distant state correction value, and NEAR represents the close state correction value.
After the proximity 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 emits an optical signal through the optical distance sensor, the optical signal meets the obstacle to form a reflection signal, the terminal receives the reflection signal through the optical distance sensor, when the terminal determines that the signal intensity value of the reflection signal is greater than or equal to the proximity state judgment threshold value, the terminal determines that the obstacle is in a proximity state, and when the terminal receives an incoming call or makes a call, screen off processing can be carried out; when the terminal determines that the signal intensity value of the reflected signal is smaller than or equal to the far state judgment threshold value, the terminal determines that the barrier is in the far state, and the terminal can light the 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 an oil stain 704 attached to the glass cover 703, and there is an obstacle 705 in front of the optical distance sensor. The approaching state determination threshold value determined by the optical distance sensor when there is no obstacle in the front is-50 dB, and the departing state determination threshold value is-70 dB, and the terminal may determine the two threshold values according to the signal intensity value of the unobstructed optical signal when detecting an instruction to process an incoming call request or when detecting an instruction to make a call. The terminal then periodically emits a light signal, the light signal forms a reflected signal after encountering the obstacle 705, the terminal measures a 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 obstacle 705 is in a close state, and the terminal lights up a display screen; and 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.
From the above, when the optical distance sensor works, the terminal obtains the signal intensity value of the optical signal received in the non-shielding environment, obtains the approaching state judgment threshold according to the signal intensity value of the optical signal and the preset approaching state correction value, and obtains the departing state judgment threshold according to the signal intensity value of the optical signal and the preset departing state correction value, so that the terminal candidate judges the approaching state or the departing state of the obstacle according to the dynamically adjusted approaching state judgment threshold and departing state judgment threshold, the problem that the terminal candidate judges the approaching state and the departing state to have inaccuracy by using the fixed threshold when the sundries are adhered on the glass cover plate in the related art is solved, the embodiment of the application dynamically adjusts the approaching state judgment threshold and the departing state judgment threshold according to the signal intensity value of the optical signal received in the non-shielding environment, under the condition that sundries are attached to the glass cover plate, the judgment threshold value can be adjusted in a self-adaptive mode, and the measuring accuracy of the optical distance sensor is improved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 8, a schematic structural diagram of a calibration apparatus of an optical distance sensor according to an exemplary embodiment of the present application is shown, and hereinafter referred to as the calibration apparatus 8. The correction device 8 may be implemented as all or part of a smart pole by software, hardware or a combination of both, the correction device 8 comprising: an instruction unit 801 and a correction unit 802.
An indicating unit 801, configured to transmit 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 indicating 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 correcting unit 802, configured to determine an approach state decision threshold according to the signal intensity value of the second optical signal and a preset approach state correction value;
the correcting unit 802 is further configured to determine a departing state determination threshold according to the signal strength value of the second optical signal and a preset departing state correction value.
In one or more possible embodiments, the proximity state correction value is associated with a first differential value, the first differential value is associated with a proximity state calibration value and a no-occlusion signal strength value;
the far state correction value is related to a second differential value, and the second differential value is related to the far state calibration value and the non-shielding signal intensity value;
the close state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, the far 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 _ value-raw data 1; wherein far represents the second difference value, far _ value represents the far state calibration value, near represents the first difference value, near _ value represents the near state calibration value, and rawdata1 represents the no-occlusion signal strength value.
In one or more possible embodiments, the approach state correction value is obtained by weighted averaging of a plurality of first differential values, and the distance state correction value is obtained by weighted averaging of 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 measured by the same optical distance sensor for a plurality of 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 answering the called request after the called request is detected; or
When an instruction for initiating a calling request is received, it is determined that a condition for turning on the optical sensor is satisfied.
In one or more possible embodiments, the approach state decision threshold and the departure state decision threshold are determined by the following formulas:
mTask.ps_threshold_low=rawdata+FAR;
ps _ threshold _ high ═ raw data + NEAR; wherein mtask.ps _ threshold _ low represents the distant state determination threshold, mtask.ps _ threshold _ high represents the close state determination threshold, rawdata represents the signal intensity value of the second optical signal, FAR represents the distant state correction value, and NEAR represents the close state correction value.
It should be noted that, when the calibration method of the optical distance sensor is executed by the calibration device of the optical distance sensor provided in the above embodiment, only the division of the above functional modules is taken as an example, in practical applications, the above functions may be distributed to different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules, so as to complete all or part of the above described functions. In addition, the embodiments of the calibration apparatus for an optical distance sensor and the calibration method for an optical distance sensor provided in the foregoing embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments, and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
When the scheme of the embodiment of the application is executed, the correcting device 8 obtains the signal intensity value of the received optical signal 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, the problem that the judgment of the approaching state and the far state by using the fixed threshold value is inaccurate when sundries are adhered on the glass cover plate in the related art is solved, the embodiment of the application dynamically adjusts the approaching state judgment threshold value and the far state judgment threshold value according to the signal intensity value of the received optical signal in the non-shielding environment, under the condition that sundries are attached to the glass cover plate, the judgment threshold value can be adjusted in a self-adaptive mode, and the measuring accuracy of the optical distance sensor is improved.
An 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 suitable for being loaded by a processor and executing the above method steps, and a specific execution process may refer to a specific description of the embodiment shown in fig. 5, which is not described herein again.
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 in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways 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 implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
All functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for calibrating an optical distance sensor, comprising:
when the condition of starting the optical distance sensor is met, a first optical signal is transmitted by a signal transmitter of the optical distance sensor;
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 internally diffracting the first optical signal;
determining an approaching state judgment threshold according to the signal intensity value of the second optical signal and a preset approaching state correction value;
and determining a far-away state judgment threshold according to the signal intensity value of the second optical signal and a preset far-away state correction value.
2. The correction method according to claim 1, characterized in that:
the proximity state correction value is related to a first differential value, and the first differential value is related to a proximity state calibration value and a non-shielding signal intensity value;
the far state correction value is related to a second differential value, and the second differential value is related to the far state calibration value and the non-shielding signal intensity value;
the close state calibration value represents a received signal strength value obtained by shielding a gray card arranged at a first distance, the far 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.
3. The correction method according to claim 2, characterized in that said first differential value and said second differential value are determined by the following formula:
far=far_value–rawdata1;
near _ value-raw data 1; wherein far represents the second difference value, far _ value represents the far state calibration value, near represents the first difference value, near _ value represents the near state calibration value, and rawdata1 represents the no-occlusion signal strength value.
4. The correction method according to claim 2 or 3,
the approaching state correction value is obtained by weighted averaging of the plurality of first differential values, and the departing state correction value is obtained by weighted averaging of the plurality of second differential values.
5. The calibration method according to claim 4, 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 measured by the same optical distance sensor for a plurality of times.
6. The correction method according to claim 1, characterized by further comprising:
after a called request is detected, determining that the condition for starting the optical distance sensor is met when an instruction for answering the called request is received; or
When an instruction for initiating a calling request is received, it is determined that a condition for turning on the optical sensor is satisfied.
7. The correction method according to claim 4, wherein the approaching state decision threshold and the departing state decision threshold are determined by the following formulas:
mTask.ps_threshold_low=rawdata+FAR;
ps _ threshold _ high ═ raw data + NEAR; wherein mtask.ps _ threshold _ low represents the distant state determination threshold, mtask.ps _ threshold _ high represents the close state determination threshold, rawdata represents the signal intensity value of the second optical signal, FAR represents the distant state correction value, and NEAR represents the close state correction value.
8. A calibration device for an optical distance sensor, comprising:
the indicating unit is used for transmitting a first optical signal through a signal transmitter of the optical distance sensor when the condition of starting the optical distance sensor is met;
the indicating 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;
the correction unit is used for determining an approaching state judgment threshold value according to the signal intensity value of the second optical signal and a preset approaching state correction value;
the correction unit is further configured to determine a far-state decision threshold according to the signal intensity value of the second optical signal and a preset far-state correction value.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.
10. 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 to 7.
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 true CN112859050A (en) 2021-05-28
CN112859050B 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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150268067A1 (en) * 2012-09-27 2015-09-24 Datalogic Ip Tech S.R.L. Optoelectronic sensor for detecting one or more features of an object
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150268067A1 (en) * 2012-09-27 2015-09-24 Datalogic Ip Tech S.R.L. Optoelectronic sensor for detecting one or more features of an object
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
CN112859050B (en) 2023-09-15

Similar Documents

Publication Publication Date Title
WO2021190184A1 (en) Remote assistance method and apparatus, and storage medium and terminal
CN111225138A (en) Camera control method and device, storage medium and terminal
CN112788583B (en) Equipment searching method and device, storage medium and electronic equipment
CN111986454A (en) Wireless earphone searching method, device, storage medium and terminal
CN112714216A (en) Brightness adjusting method and device, storage medium and terminal
CN108804151B (en) Method and terminal for restarting application program
CN113163055B (en) Vibration adjusting method and device, storage medium and electronic equipment
CN111104236A (en) Paste control method and electronic equipment
CN110012152B (en) Interface display method and terminal equipment
CN114285936B (en) Screen brightness adjustment method and device, storage medium and terminal
CN112995562A (en) Camera calling method and device, storage medium and terminal
CN112859050B (en) Correction method and device for optical distance sensor, storage medium and terminal
CN113595662B (en) Signal prompting method, device, terminal equipment and storage medium
CN110489318A (en) Grasping means, device, storage medium and the terminal of systrace information
CN115379005A (en) Message processing method and device, storage medium and electronic equipment
CN112150983B (en) Screen brightness adjusting method and device, storage medium and electronic equipment
CN115328725A (en) State monitoring method and device, storage medium and electronic equipment
CN111949150B (en) Method and device for controlling peripheral switching, storage medium and electronic equipment
CN113419650A (en) Data moving method and device, storage medium and electronic equipment
CN111859999A (en) Message translation method, device, storage medium and electronic equipment
CN113114849A (en) Alarm clock reminding method and device, storage medium and terminal
CN113495641A (en) Touch screen ghost point identification method and device, terminal and storage medium
CN113010078A (en) Touch method and device, storage medium and electronic equipment
CN113126859A (en) Contextual model control method, contextual model control device, storage medium and terminal
CN111770510A (en) Network experience state determination method and device, storage medium and electronic equipment

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