Detection method and electronic equipment

By analyzing the reflectivity and waveform of the optical signal, combining the equipment parameters of the target sensor, and using the target model to predict the object material, the problem of distance limitation in ultrasonic detection is solved, and flexible material detection is achieved in different distance scenarios.

CN120293920APending Publication Date: 2025-07-11LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510534788.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The existing ultrasonic detection method has fixed requirements for the distance between ultrasonic transmitter and object, which limits the applicable scenarios of detection and cannot be applied to environments of different distances.

Method used

By obtaining the detection information of the target sensor, the surface material of the object is determined using the reflectance of the optical signal, including analyzing the waveform and attenuation of the optical signal, combining the equipment parameters of the target sensor, the target model is used to predict the material of the object.

Benefits of technology

It realizes the flexibility of detecting object materials in different distance scenarios, simplifies the detection process, reduces the burden of data processing, and improves the scope of application of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120293920A_ABST
    Figure CN120293920A_ABST
Patent Text Reader

Abstract

The invention discloses a detection method and electronic equipment, and relates to the field of information processing, and the method comprises the steps: obtaining the detection information of a target sensor, the detection information corresponding to a receiving optical signal received by the target sensor, the received optical signal is an optical signal which is emitted by the target sensor to a target object at a preset emission intensity and reflected back to the target sensor; determining the reflectivity of the target object according to the detection information and the optical signal with the preset emission intensity; and determining the surface material of the target object according to the reflectivity of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information processing, and in particular, to a detection method and an electronic device. Background Art

[0002] In order to determine the material properties of an object, currently, the ultrasonic reflection time is often used to estimate the material on the surface of the object. Specifically, the distance between the ultrasonic transmitter and the object is fixed. The transmitter emits ultrasonic waves. After hitting the object surface, part of the ultrasonic waves are reflected back to the probe, and part penetrate into the object interior. Due to the differences in the acoustic characteristics (such as acoustic impedance, sound velocity, attenuation coefficient, etc.) of the surfaces of objects made of different materials, the time for the waves to be reflected back to the receiver is different, and thus the material on the surface of the object can be identified based on this.

[0003] However, when using ultrasonic waves to detect the material of an object, there are fixed requirements for the distance between the ultrasonic transmitter and the object, and there are many restrictions on the detection conditions, which are not applicable to other distance scenarios. Summary of the Invention

[0004] A first aspect of this application provides a detection method, including:

[0005] Obtaining detection information of a target sensor, where the detection information corresponds to a received optical signal received by the target sensor, and the received optical signal is an optical signal that is reflected back to the target sensor after the target sensor emits an optical signal to a target object with a preset emission intensity;

[0006] Determining a reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity;

[0007] Determining a surface material of the target object based on the reflectivity of the target object.

[0008] In a possible implementation, the determining the reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity includes:

[0009] Obtaining a first waveform corresponding to the emitted optical signal;

[0010] Analyzing the detection information to obtain a second waveform corresponding to the intensity of the received optical signal, where the second waveform is the same type of waveform as the first waveform;

[0011] Determining a detection distance between the target sensor and the target object based on the first waveform and the second waveform;

[0012] Determining a target reception intensity of the received optical signal based on the second waveform;

[0013] Determining the reflectivity of the target object based on the preset emission intensity, the target reception intensity, and the detection distance.

[0014] In a possible implementation, determining the target reception intensity of the received optical signal based on the second waveform includes:

[0015] Analyze the second waveform based on the first waveform being a sine wave to obtain the peak of the second waveform;

[0016] Use the peak of the second waveform as the target reception intensity of the optical signal.

[0017] In a possible implementation, determining the reflectivity of the target object based on the preset transmission intensity, the target reception intensity, and the detection distance includes:

[0018] Obtain a first attenuation, where the first attenuation is the attenuation of the optical signal caused by the hardware in the target sensor;

[0019] Determine the propagation attenuation of the optical signal during transmission between the target sensor and the target object based on the detection distance;

[0020] Determine the reflectivity of the target object based on the propagation attenuation, the first attenuation, the target reception intensity, and the preset transmission intensity.

[0021] In a possible implementation, obtaining the detection information of the target sensor includes:

[0022] Obtain at least two voltage sets output by the target sensor, with each voltage set serving as a detection information. The voltage values in the voltage set correspond one-to-one with the photosensitive elements in the photosensitive matrix of the target sensor. Different photosensitive elements in the photosensitive matrix correspond to different positions of the target object. Each voltage set corresponds to a signal acquisition moment. The time of obtaining any voltage set matches the time when the target sensor receives the received optical signal. The voltage value of any photosensitive element corresponds to the light intensity of the photosensitive element.

[0023] In a possible implementation, analyzing the detection information to obtain the second waveform corresponding to the intensity of the received optical signal includes:

[0024] Analyze the voltages corresponding to the photosensitive elements in each voltage set to obtain the intensity of the received optical signal corresponding to each photosensitive element at the corresponding moment;

[0025] Obtain the second waveform corresponding to the intensity of each received optical signal based on the intensity of the received optical signal corresponding to each photosensitive element at each moment.

[0026] In a possible implementation, determining the surface material of the target object based on the reflectivity of the target object includes:

[0027] Determine at least one region according to the reflectivity corresponding to each photosensitive element in the photosensitive matrix, where the reflectivities of the photosensitive elements in the same region are similar;

[0028] Determine the surface material of the object corresponding to each region according to the reflectivity corresponding to each region.

[0029] In a possible implementation, the determining the reflectivity of the target object according to the detection information and the optical signal with the preset emission intensity; and determining the surface material of the target object according to the reflectivity of the target object includes:

[0030] Obtain the device parameters of the target sensor, where the device parameters are related to the influence on the optical signal during the transmission of the optical signal by the target sensor;

[0031] Use the target model to process the detection information, the device parameters, and the preset emission intensity to obtain the surface material of the target object.

[0032] In a possible implementation, the target model is trained by the following process:

[0033] Obtain a training sample set, where each training sample in the training sample set includes: sample detection information, the device parameters of the target sensor, and the sample emission intensity, and the training label corresponding to the training sample includes the material of the sample detection item. The sample detection information corresponds to the sample received optical signal received by the target sensor, and the sample received optical signal is the optical signal reflected back to the target sensor after the target sensor emits the sample optical signal to the sample detection object with the sample emission intensity;

[0034] Train the original model according to the training sample set until the training end condition is met to obtain the target model.

[0035] A second aspect of the present application provides an electronic device, including:

[0036] An interface for obtaining the detection information of the target sensor. The detection information corresponds to the received optical signal received by the target sensor, and the received optical signal is the optical signal reflected back to the target sensor after the target sensor emits the optical signal to the target object with the preset emission intensity;

[0037] A processor for determining the reflectivity of the target object according to the detection information and the optical signal with the preset emission intensity; and determining the surface material of the target object according to the reflectivity of the target object.

[0038] A third aspect of the present application provides a computer program product, including computer-readable instructions, which when running on an electronic device, enable the electronic device to implement the detection method of the first aspect or any implementation manner of the first aspect.

[0039] In a fourth aspect of the present application, an electronic device is provided, including at least one processor and a memory connected to the processor, where:

[0040] The memory is used to store a computer program;

[0041] The processor is used to execute the computer program so that the electronic device can implement the detection method of the above first aspect or any implementation manner of the first aspect.

[0042] In a fifth aspect of the present application, a computer storage medium is provided. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the detection method of the above first aspect or any implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages and aspects of the various embodiments of the present disclosure will become more obvious. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the original elements and elements are not necessarily drawn to scale.

[0044] Figure 1 is a schematic flowchart of a detection method provided by an embodiment of the present application;

[0045] Figure 2 is a schematic flowchart of determining the reflectivity of the target object according to the detection information and the optical signal with the preset emission intensity provided by an embodiment of the present application;

[0046] Figure 3 is a schematic waveform diagram provided by an embodiment of the present application;

[0047] Figure 4 is another schematic waveform diagram provided by an embodiment of the present application;

[0048] Figure 5 is a schematic flowchart of determining the reflectivity of the target object according to the preset emission intensity, the target reception intensity, and the detection distance provided by an embodiment of the present application;

[0049] Figure 6 is a schematic structural diagram of the target sensor provided in an embodiment of the present application;

[0050] Figure 7 is a schematic flowchart of analyzing the detection information to obtain the second waveform corresponding to the intensity of the received optical signal provided by an embodiment of the present application;

[0051] Figure 8It is a schematic flowchart for determining the surface material of the target object based on the reflectivity of the target object provided by an embodiment of the present application;

[0052] Figure 9 It is a schematic diagram of area division provided by an embodiment of the present application;

[0053] Figure 10 It is a schematic flowchart for determining the reflectivity of the target object based on the detection information and the optical signal with a preset emission intensity; and for determining the surface material of the target object based on the reflectivity of the target object, provided by an embodiment of the present application;

[0054] Figure 11 It is a schematic flowchart of the training process of the target model provided by an embodiment of the present application;

[0055] Figure 12 It is a schematic structural diagram of an electronic device for an application detection method provided by an embodiment of the present application;

[0056] Figure 13 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0057] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The terms used in the implementation part of the present application are only for explaining the specific embodiments of the present application, rather than aiming to limit the present application.

[0058] The embodiments of the present application will be described below with reference to the accompanying drawings. Those skilled in the art know that with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0059] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinguishing when describing objects with the same attributes in the embodiments of the present application. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product or device including a series of units does not have to be limited to those units, but may include other units not clearly listed or inherent to these processes, methods, products or devices.

[0060] Refer to Figure 1 , Figure 1 It is a schematic flowchart of a detection method provided by an embodiment of the present application. The detection method provided by an embodiment of the present application may include steps 101 to 103, and these steps will be described in detail below.

[0061] 101. Obtain the detection information of the target sensor, where the detection information corresponds to the received optical signal received by the target sensor, and the received optical signal is the optical signal reflected back to the target sensor after the target sensor emits an optical signal to the target object with a preset emission intensity.

[0062] Among them, the target sensor emits an optical signal to the target object with a preset emission intensity, and the optical signal is reflected by the target object and then reflected back to the target sensor.

[0063] Among them, the target sensor receives the reflected optical signal and generates detection information based on the received optical signal.

[0064] Among them, the value of the detection information corresponds to the received optical signal.

[0065] In a possible implementation, the target sensor uses an iTOF (Indirect Time - of - Flight Sensor), and the target sensor is a depth sensor based on the time - of - flight principle. By emitting a modulated infrared optical signal and indirectly calculating the time of flight of the optical signal through the transmitted optical signal and the received optical signal, the depth information of the target object can be obtained.

[0066] 102. Determine the reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity.

[0067] Among them, the detection information is the information corresponding to the received optical signal. Correspondingly, use the detection information and the transmitted optical signal to determine the reflectivity of the target object.

[0068] In a possible implementation, when the optical signal emitted by the target sensor is transmitted through the air, it is affected by the air passed through during the transmission process. Moreover, due to the structure of the target sensor hardware itself, there is also a certain impact on the optical signal at the input and output of the target sensor. Therefore, the reflectivity of the optical signal at the target object can be determined by combining the influence during the transmission process, the detection information of the received reflected light, and the preset emission intensity of the transmitted optical signal.

[0069] 103. Determine the surface material of the target object based on the reflectivity of the target object.

[0070] Among them, the reflectivity of an object is related to its material.

[0071] In a possible implementation, the corresponding relationship between the material and the reflectivity can be set cosine - like. Correspondingly, after determining the reflectivity of the target object, the corresponding material can be queried based on the reflectivity, and this material is used as the surface material of the target object.

[0072] A correspondence table of the reflectivity and material of an object as shown in Table 1 below.

[0073] Table 1

[0074]

[0075] For example, when the reflectivity of the target object is determined to be 82%, the corresponding material can be determined by looking up the table as glass mirror surface.

[0076] In a possible implementation, in the device for executing the detection method in this application, the corresponding relationship table is preset, and the surface material of the object corresponding to the reflectivity is determined by looking up the table.

[0077] Since the object materials existing in the real scene are not limited to the several materials listed in Table 1 above, correspondingly, in the specific implementation, the object materials in the corresponding relationship table can be other materials, and this application does not limit the number of materials and the content of the materials involved in this corresponding relationship.

[0078] The detection method in this application can be applied to the 3D (Three Dimensions) display field. For example, the determined object surface material can be used to present the light and shadow effect on the model in the 3D display program; another example is that the reconstructed models such as FBX can be directly used in the 3D display, and during the interaction process, the determined object surface material is used to make a deformation effect that conforms to physics.

[0079] The detection method in this application can also be applied to the field of robot control. In the robot obstacle avoidance control, adding the object surface material can enable the robot to judge which items in its environment need to be avoided and which items can be touched based on the object surface material.

[0080] In this embodiment, the detection information of the target sensor is obtained. The detection information corresponds to the received optical signal received by the target sensor, and the received optical signal is the optical signal reflected back to the target sensor after the target sensor emits an optical signal to the target object with a preset emission intensity; based on the detection information and the optical signal with the preset emission intensity, the reflectivity of the target object is determined; based on the reflectivity of the target object, the surface material of the target object is determined. In the process of detecting the surface material of the target object, the reflectivity of the target object is determined through the detection information of the target sensor and the preset emission intensity of the optical signal emitted by the target sensor, and then its surface material is determined using the reflectivity. There is no need to limit the distance between the target object and the target sensor, and the detection conditions are few, which is applicable to various distance scenarios and has a wide application range.

[0081] Figure 2It is a schematic flowchart for determining the reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity provided by an embodiment of the present application, which may include steps 201 to 205. The following will describe these steps in detail.

[0082] 201. Obtain a first waveform corresponding to the emitted optical signal;

[0083] Among them, the target sensor emits an optical signal with a preset emission intensity, and the optical signal may be infrared light.

[0084] Moreover, the target sensor may emit an optical signal with a specific waveform, and the specific waveform is the first waveform corresponding to the emitted optical signal.

[0085] As an example, the first waveform may be a sine wave, a square wave, etc.

[0086] 202. Analyze the detection information to obtain a second waveform corresponding to the intensity of the received optical signal, and the second waveform is the same type of waveform as the first waveform;

[0087] Among them, the target sensor emits an optical signal, and the optical signal passes through air transmission between the target sensor and the target object, surface reflection of the target object, air transmission between the target sensor and the target object, and hardware transmission of the target sensor and then returns to the receiving component of the target sensor to obtain the detection information corresponding to the received optical signal.

[0088] Correspondingly, the detection information is the information formed by the received optical signal received by the target sensor in the target sensor, and the detection information corresponds to the received optical signal.

[0089] Correspondingly, by analyzing the detection information, a second waveform corresponding to the intensity of the received optical signal can be obtained.

[0090] Among them, the first waveform is the initial waveform when the target sensor emits an optical signal, and the second waveform is the waveform after the optical signal is attenuated due to transmission and reflection.

[0091] Among them, the change of the second waveform relative to the first waveform characterizes the attenuation caused by the transmission and reflection of the optical signal.

[0092] Among them, the phase difference between the first waveform and the second waveform represents the time difference between the transmission and reception of the optical signal, and the height difference between the first waveform and the second waveform is due to the attenuation of the transmitted optical signal.

[0093] As an example, the first waveform is a square wave, and the second waveform is also a square wave. The value of the high level in the first waveform represents the preset emission intensity, and the value of the high level in the second waveform represents the intensity of the received optical signal.

[0094] 203. Determine the detection distance between the target sensor and the target object based on the first waveform and the second waveform;

[0095] Among them, compare the first waveform and the second waveform to determine the phase difference between the two. The time corresponding to the phase difference between the two is the time difference between the target sensor emitting the optical signal and receiving the optical signal, and this time difference is the time for the optical signal to travel.

[0096] In a possible implementation, given the transmission speed of the optical signal in air, taking the phase difference between the first waveform and the second waveform as the transmission time, and multiplying half of this transmission time by the transmission speed, the detection distance between the target sensor and the object can be obtained.

[0097] 204. Determine the target reception intensity of the received optical signal based on the second waveform;

[0098] Among them, analyze the second waveform, and the peak in the second waveform is used as the target reception intensity of the received optical signal.

[0099] Among them, if the waveform is a sine wave, the peak in the second waveform is the peak of the sine wave; if the waveform is a square wave, the peak in the second waveform is the highest point of the high level.

[0100] Figure 3 It is a waveform schematic diagram provided by an embodiment of the present application. In this schematic diagram, the horizontal axis represents time and the vertical axis represents optical intensity. The first waveform is the waveform corresponding to the emitted optical signal (represented by the solid line in the figure), and the second waveform is the waveform corresponding to the received optical signal (represented by the dashed line in the figure). The first waveform is a sine wave, and the second waveform has a phase difference Φ1 from the first waveform. The peak A1 of the first waveform is used as the intensity of the emitted optical signal, specifically the preset emission intensity, and the peak A2 of the second waveform is used as the intensity of the received optical signal, as the target reception intensity.

[0101] In a possible implementation, the optical signal emitted by the target sensor can use an optical signal with a preset wavelength and a preset frequency.

[0102] As an example, the optical signal emitted by the target sensor can use an optical signal with a wavelength of 940 nm (nanometers). The optical signal with a wavelength of 940 nm has the advantages of long transmission distance, convenient filtering of other light sources using a light source with a fixed wavelength, and resistance to solar interference.

[0103] Figure 4It is another waveform schematic diagram provided by an embodiment of the present application. In this schematic diagram, the horizontal axis represents time, and the vertical axis represents light intensity. The first waveform is the waveform corresponding to the emitted optical signal (represented by a solid line in the figure), and the second waveform is the waveform corresponding to the received optical signal (represented by a dashed line in the figure). The first waveform is a square wave, and the second waveform has a phase difference Φ2 from the first waveform. The high level B1 of the first waveform is used as the intensity of the emitted optical signal, which is a preset emission intensity. The high level B2 of the second waveform is used as the intensity of the received optical signal, which is the target reception intensity.

[0104] Among them, half of the duration corresponding to the phase difference is the transmission time of the optical signal from the target sensor to the target object. The product of the transmission time and the transmission speed of the optical signal is the detection distance from the target sensor to the target object.

[0105] In a possible implementation, based on the first waveform being a sine wave, the second waveform is analyzed to obtain the peak of the second waveform; the peak of the second waveform is used as the target reception intensity of the optical signal.

[0106] Among them, using the peak of the sine wave to determine the reception intensity of the optical signal can be free from ambient light and multipath light interference, improving the detection anti-interference ability.

[0107] In a possible implementation, based on the first waveform being a square wave, the second waveform is analyzed to obtain the high level of the second waveform; the high level of the second waveform is used as the target reception intensity of the optical signal.

[0108] Due to the advantages of the sine wave such as strong anti-interference ability, good spectral characteristics, high phase measurement accuracy, and low requirements for optical components, in the specific implementation process, the waveform of the emitted optical signal generally adopts a sine wave.

[0109] 205. Determine the reflectivity of the target object according to the preset emission intensity, the target reception intensity, and the detection distance.

[0110] Among them, after determining the target reception intensity of the received optical signal and the detection distance between the target sensor and the target object, the target emission intensity and the target reception intensity can be used to determine the signal attenuation during the transmission of the optical signal and the signal attenuation caused by the reflection of the target object. Furthermore, using the detection distance, the reflectivity of the target object can be determined.

[0111] In a possible implementation, if there is no signal attenuation when the optical signal is transmitted in the target sensor, then when determining the reflectivity of the target object, it is not necessary to consider the signal attenuation caused by the target sensor, and only the attenuation during the transmission of the optical signal between the target sensor and the target object and the attenuation caused by the reflection of the target object need to be considered.

[0112] In a possible implementation, if the target sensor itself also exhibits signal attenuation, then when determining the reflectivity of the target object, the signal attenuation caused by the target sensor needs to be considered.

[0113] In this embodiment, a first waveform corresponding to the transmitted optical signal is obtained; the detection information is analyzed to obtain a second waveform corresponding to the intensity of the received optical signal, and the second waveform is the same type of waveform as the first waveform; based on the first waveform and the second waveform, the detection distance between the target sensor and the target object is determined; based on the second waveform, the target received intensity of the received optical signal is determined; based on the preset transmission intensity, the target received intensity, and the detection distance, the reflectivity of the target object is determined. In this process, by analyzing the first waveform corresponding to the transmitted optical signal and the second waveform corresponding to the received optical signal, the detection distance between the target sensor and the target object can be analyzed, so that during the detection process, there is no need to limit the distance between the target sensor and the target object, and the material of the target object at any distance interval can be detected. Moreover, based on the preset transmission intensity of the transmitted optical signal, the target received intensity of the received optical signal, and the calculated detection distance, the reflectivity of the target object can be calculated, and the calculation process is simple and easy, without increasing a large amount of data processing burden.

[0114] Figure 5 It is a schematic flow chart for determining the reflectivity of the target object according to the preset transmission intensity, the target received intensity, and the detection distance provided by an embodiment of the present application, which may include steps 501 to 503, and the following will describe these steps in detail.

[0115] 501. Obtain a first attenuation, where the first attenuation is the attenuation of the optical signal caused by the hardware in the target sensor.

[0116] In this embodiment, when the target sensor receives the reflected optical signal, due to the refraction and haze attenuation of the optical lens in the target sensor and the circuit attenuation in the target sensor during the transmission of the optical signal by the hardware in the target sensor, the optical signal will be attenuated during transmission in the hardware. To improve the accuracy of the determined reflectivity, the attenuation caused by the hardware in the target sensor is considered when determining the reflectivity of the target object.

[0117] Among them, the refraction of the optical lens is an optical phenomenon when the optical signal passes through the optical lens, which has a certain attenuation on the optical signal.

[0118] Among them, the haze attenuation of the optical lens refers to the phenomenon that the light transmittance decreases and the scattered light increases due to surface or internal defects (such as atomization, scratches, pollution, etc.) of the lens material. Therefore, the optical signal will undergo haze attenuation when passing through the optical lens, and this haze attenuation is also considered when determining the first attenuation.

[0119] Among them, circuit attenuation occurs when the target sensor receives an optical signal and converts it from an optical signal to an electrical signal. Therefore, when determining the first attenuation, this circuit attenuation is also considered.

[0120] Among them, since the first attenuation of the target sensor is caused by its internal structure and the internal structure of the target sensor generally does not change, correspondingly, the first attenuation of the same target sensor can be a fixed value.

[0121] In specific implementation, the corresponding first attenuation can be set for different models of sensors. When obtaining the first attenuation of a certain sensor, its corresponding first attenuation can be determined using the model of the sensor.

[0122] 502. Determine the propagation attenuation of the optical signal during transmission between the target sensor and the target object based on the detection distance;

[0123] Among them, when the optical signal is transmitted in the air, due to the influence of impurities in the air, propagation attenuation will occur, and this propagation attenuation is related to the transmission distance.

[0124] Generally, the farther the transmission distance, the greater the propagation attenuation; the closer the transmission distance, the smaller the propagation attenuation.

[0125] Among them, an attenuation value can be preset in advance. This attenuation value is the attenuation of the optical signal per unit transmission distance. Correspondingly, after determining the detection distance, the propagation attenuation of the optical signal during transmission between the target sensor and the target object can be calculated using this attenuation value and the detection distance.

[0126] Among them, the propagation attenuation during transmission between the target sensor and the target object includes the attenuation of the optical signal from the target sensor to the target object and the attenuation from the target object to the target sensor.

[0127] Among them, the propagation attenuation = attenuation value × (detection distance × 2).

[0128] 503. Determine the reflectivity of the target object based on the propagation attenuation, the first attenuation, the target received intensity, and the preset transmitted intensity.

[0129] Among them, the reflectivity of the target object is the ratio of the preset transmitted intensity of the optical signal emitted by the target sensor, the target received optical intensity of the received signal, and the propagation attenuation and the first attenuation.

[0130] Reflectivity = preset transmitted intensity / (target received optical intensity + propagation attenuation + first attenuation).

[0131] In a possible implementation, the optical signal attenuation of the target object can also be used to determine the surface material of the target object.

[0132] Among them, the attenuation of the target object can be the difference between the preset emission intensity, the target received light intensity of the received signal, and the propagation attenuation and the first attenuation.

[0133] Attenuation of the target object = preset emission intensity - (target received light intensity + propagation attenuation + first attenuation).

[0134] In this embodiment, the first attenuation is obtained, and the first attenuation is the attenuation of the optical signal caused by the hardware in the target sensor; according to the detection distance, the propagation attenuation of the optical signal transmitted between the target sensor and the target object is determined; according to the propagation attenuation, the first attenuation, the target received intensity, and the preset emission intensity, the reflectivity of the target object is determined, realizing the process of obtaining the reflectivity of the target object through calculation, and the calculation process is simple and easy.

[0135] In a possible implementation, the detection information of the target sensor is obtained, including:

[0136] At least two voltage sets output by the target sensor are obtained, and each voltage set is used as a detection information. The voltage values in the voltage set correspond one-to-one with the photosensitive elements in the photosensitive matrix of the target sensor. Different photosensitive elements in the photosensitive matrix correspond to different positions of the target object. Each voltage set corresponds to a signal acquisition moment, and the voltage value of any photosensitive element corresponds to the light intensity of the photosensitive element. The time of obtaining any voltage set matches the time when the target sensor receives the received optical signal.

[0137] Among them, a photosensitive matrix composed of several photosensitive elements is arranged in the target sensor. The photosensitive matrix receives the reflected optical signal and generates different voltage values for different intensities of the received reflected optical signal.

[0138] Among them, the photosensitive element can receive the optical signal and convert the optical signal into an electrical signal. The electrical signal is an analog signal. Through a supporting converter in the target sensor, such as an ADC (Analog-to-Digital Converter), the analog signal is converted into a digital signal, and the electrical signal in the form of the digital signal is a voltage value.

[0139] Among them, the photosensitive matrix can be a part of the display screen on the target sensor and can present an image of the target object based on the received optical signal.

[0140] Among them, different materials of the reflecting surface will return reflected optical signals with different intensities. Correspondingly, the photosensitive elements at the corresponding positions on the target sensor will generate different voltage values.

[0141] Among them, a detection period can be preset, and the voltages of the photosensitive elements in the target sensor are collected according to the detection period to obtain the detection information output by the target sensor.

[0142] In a possible implementation, the digital signal in the detection period can be averaged to obtain the voltage of the corresponding photosensitive element in this detection period.

[0143] In a possible implementation, the detection period can also be set to the duration corresponding to analog-to-digital conversion, and all the electrical signals in the form of digital signals are used as the voltage of the corresponding photosensitive element.

[0144] In a possible implementation, the target sensor adopts iTOF, and its working principle is based on flood illumination and continuous wave modulation technology. Among them, the optical signal emitted by the target sensor is floodlight, which emits a uniformly covered light field to the outside. The target object in this light field reflects the optical signal. Due to the influence of the material of the target object on the reflectivity, the intensity of the optical signal reflected back by the target object to the target sensor is different from the intensity of the optical signal reflected back by other objects to the target sensor. Correspondingly, the photosensitive matrix in this iTOF is used to output the optical signal reflected back by the light field (received optical signal).

[0145] Figure 6 FIG. is a schematic structural diagram of the target sensor provided in the embodiment of the present application. The target sensor includes a transmitting end 601 and a receiving end 602. Among them, the transmitting end 601 emits an optical signal with a preset emission intensity. Among them, the receiving end 602 includes a lens 6021, a photosensitive matrix 6022, and a converter 6023. The photosensitive matrix 6022 is a matrix composed of 320×240 photosensitive elements.

[0146] Among them, the transmitting end 601 sends out an optical signal outward with a preset emission intensity. After the optical signal contacts the target object, it is reflected back to the target sensor. It forms an image on the photosensitive matrix 6022 through the lens 6021 of the receiving end 602. The photosensitive element can receive the optical signal and convert the optical signal into an electrical signal in the form of an analog signal. The converter 6023 converts the electrical signal in the form of an analog signal into an electrical signal in digital form, and this electrical signal in digital form is used as the voltage of each photosensitive element.

[0147] Among them, the Figure 6 Only the functional structures involved in the embodiment of the present application are shown in the figure, and other component structures of the target sensor are not shown. The structure of the target sensor is not limited in the present application.

[0148] In a possible implementation, the target sensor receives the optical signal returned by the emitted optical signal, and the received optical signal is output in the photosensitive matrix of the target sensor. The voltage in each photosensitive element corresponds to its corresponding received optical signal.

[0149] Among them, the greater the intensity of the received optical signal corresponding to the photosensitive element, the higher the voltage of the photosensitive element.

[0150] In this embodiment, at least two voltage sets output by the target sensor are obtained, and each voltage set is used as a detection message. The voltage values in the voltage set correspond one by one to the photosensitive elements in the photosensitive matrix of the target sensor. Different photosensitive elements in the photosensitive matrix correspond to different positions of the target object. Each voltage set corresponds to a signal acquisition moment. The voltage value of any photosensitive element corresponds to the light intensity of the photosensitive element. The time for obtaining any voltage set matches the time when the target sensor receives the received optical signal. The photosensitive elements in the target sensor are used to determine the electrical signals generated by the photosensitive elements' induction of the received optical signal, so as to obtain the detection message, using the function of the existing target sensor to convert the optical signal into voltage, without modifying the structure of the existing target sensor.

[0151] Figure 7 It is a schematic flowchart of the process of analyzing the detection message provided by the embodiment of the present application to obtain the second waveform corresponding to the intensity of the received optical signal, which may include steps 701 to 702, and the following will describe these steps in detail.

[0152] 701. Analyze the voltages corresponding to the photosensitive elements in each voltage set to obtain the intensity of the received optical signal corresponding to each photosensitive element at the corresponding moment;

[0153] Among them, the detection message is a voltage set, and this voltage set is composed of the voltages of the photosensitive elements in the photosensitive matrix.

[0154] Among them, the voltage of the photosensitive element is positively correlated with the intensity of the optical signal it receives. The greater the intensity of the optical signal received by the photosensitive element, the greater its output voltage.

[0155] Therefore, the voltages corresponding to each photosensitive element in the voltage set can be analyzed to obtain the intensity of the received optical signal corresponding to the corresponding photosensitive element.

[0156] In a possible implementation, a function or algorithm, etc., of the relationship between the intensity of the optical signal received by the photosensitive element and the output voltage can be preset. Correspondingly, using this function or algorithm, calculate the intensity of the optical signal corresponding to the voltage to obtain the intensity of the optical signal corresponding to the corresponding photosensitive element.

[0157] 702. Obtain the second waveform corresponding to the intensity of each received optical signal based on the intensity of the received optical signal corresponding to each photosensitive element at each moment.

[0158] Among them, for the intensity of the received optical signal of each photosensitive element, sort them in chronological order to obtain the second waveform of the intensity of the received optical signal of each photosensitive element.

[0159] Among them, if the target sensor emits an optical signal in a sine wave, correspondingly, the intensity of the received optical signal is also in a sine wave form. There is a time delay between the received optical signal and the emitted optical signal, and there is a phase difference between them. This phase difference is the transmission time of the optical signal. For the second waveform and the first waveform of the emitted optical signal, please refer to the foregoing Figure 3 。

[0160] In this embodiment, by analyzing the voltages corresponding to each photosensitive element in each voltage set, the intensity of the received optical signal corresponding to each photosensitive element at the corresponding moment is obtained; according to the intensity of the received optical signal corresponding to each photosensitive element at each moment, the second waveform corresponding to the intensity of each received optical signal is obtained, realizing the determination of the intensity of the received optical signal corresponding to each photosensitive element based on the voltage corresponding to the photosensitive element, and then obtaining the second waveform corresponding to each photosensitive element, providing a calculation basis for determining the reflectivity of the target object in the subsequent process.

[0161] Figure 8 FIG. is a schematic flowchart for determining the surface material of the target object according to the reflectivity of the target object provided by the embodiment of the present application, which may include steps 801 to 802. The following will describe these steps in detail.

[0162] 801. Determine at least one region according to the reflectivities corresponding to each photosensitive element in the photosensitive matrix, and the reflectivities of the photosensitive elements in the same region are similar;

[0163] Among them, the reflectivities of the same material are the same. If the reflectivities of multiple photosensitive elements in the photosensitive matrix are the same, it can be determined that the materials corresponding to these photosensitive elements are the same.

[0164] During the detection process, there may be a certain error. Therefore, an error range can be set, and multiple photosensitive elements with reflectivities within the error range can be divided into photosensitive elements with similar reflectivities.

[0165] Among them, according to the reflectivities corresponding to each photosensitive element in the photosensitive matrix, one or more regions are determined in the region corresponding to the photosensitive matrix, and the reflectivities of the photosensitive elements in the same region are similar.

[0166] As an example, the target object is a glass bottle with a metal lid. The reflectivity of the lid part of the target object is different from that of the glass bottle body part. Correspondingly, in the photosensitive matrix, the reflectivity of the photosensitive element corresponding to the lid part is also different from the reflectivity of the photosensitive element corresponding to the bottle body part.

[0167] 802. Determine the surface material of the object corresponding to each region according to the reflectivity corresponding to each region.

[0168] Among them, the reflectivity corresponding to the photosensitive element in each region is used as the reflectivity of the region, and the surface material of the object corresponding to the region is determined according to the reflectivity.

[0169] In a possible implementation, the average value of the reflectivities of the photosensitive elements in the same region can be taken as the reflectivity of the region.

[0170] In a possible implementation, the number of photosensitive elements with the same reflectivity in the same region can be counted, and the one with the largest proportion value of the number of photosensitive elements in the region can be determined as the reflectivity of the region.

[0171] Figure 9 is a schematic diagram of region division provided by an embodiment of the present application. The schematic diagram includes a photosensitive matrix. One square in the schematic diagram represents one photosensitive element. In this figure, according to the reflectivities corresponding to the photosensitive elements, two regions 901-902 are determined, and the reflectivities corresponding to the two regions are different. Different gray levels are used in the figure to represent the different reflectivities of the two regions. In this figure, region 901 is rectangular and region 902 is oval. Subsequently, the material corresponding to each region can be determined according to the reflectivity of each region.

[0172] It should be noted that since Figure 9 The schematic diagram shown only schematically shows the photosensitive matrix in the target sensor, and the number of photosensitive elements it contains is much smaller than the number of photosensitive elements in the actual target sensor. Therefore, the determined oval region is an approximately oval region. In the actual target sensor matrix, a region corresponding to a more rounded oval curve can be obtained.

[0173] In this embodiment, at least one region is determined according to the reflectivities corresponding to the photosensitive elements in the photosensitive matrix, and the reflectivities of the photosensitive elements in the same region are similar; according to the reflectivity corresponding to each region, the surface material of the object corresponding to each region is determined, realizing the division of the photosensitive matrix into different regions by using the different reflectivities corresponding to the photosensitive elements in the photosensitive matrix, and determining the corresponding surface material of the object for the reflectivities of different regions, without determining the corresponding material for each photosensitive element, reducing the data processing amount.

[0174] Figure 10 is a schematic flowchart for determining the reflectivity of the target object according to the detection information and the optical signal with the preset emission intensity, and determining the surface material of the target object according to the reflectivity of the target object, which may include steps 1001 to 1002. These steps will be described in detail below.

[0175] 1001. Obtain the device parameters of the target sensor, where the device parameters are related to the influence on the optical signal during the transmission of the optical signal by the target sensor;

[0176] Among them, in this embodiment, the target model is processed to achieve the purpose of predicting the surface material of the target object.

[0177] Among them, due to the influence of the device hardware of the target sensor, during the processing of the target model, the influence of the target sensor hardware on the optical signal needs to be considered. This influence on the optical signal can be the attenuation effect on the optical signal.

[0178] Among them, since the influence of the target sensor on the optical signal is caused by its internal structure, the influence of target sensors with different structures on the optical signal may be different. This structure includes the refractive index of the optical lens, the distribution law of the internal medium, etc. Since the internal structure of the target sensor generally does not change, therefore, device parameters can be used to represent different target sensors.

[0179] Correspondingly, when using the target model to predict the surface material of the target object, the device parameters of the target sensor can be used as input. These device parameters characterize the attenuation of the optical signal by the target sensor, and the target model can use these device parameters to determine the attenuation of the optical signal by the target sensor.

[0180] 1002. Process the detection information, the device parameters, and the preset emission intensity using the target model to obtain the surface material of the target object.

[0181] Among them, the detection information output by the target sensor, the preset emission intensity of the optical signal emitted by the target sensor, and the device parameters of the target sensor can be used as input parameters of the target model. The target model uses the input parameters for prediction to obtain the surface material of the target object.

[0182] In a possible implementation, the preset emission intensity of the optical signal can be converted into a voltage value, and this voltage signal can be used as the input information of the target processing model, which is of the same type as the voltage value of the detection information. The processing model can use the preset emission intensity and the detection information in the form of voltage for processing without the need for signal intensity information format conversion, improving the processing efficiency of the target processing model.

[0183] Among them, the target model can be a multi-class AI (Artificial Intelligence) model, including but not limited to classification models such as SVM (Support Vector Machine), ordinary neural network, and transfermer (a deep learning model architecture based on the Attention Mechanism) model.

[0184] In a possible implementation, the detection distance between the target object and the target sensor can also be measured, and this detection distance can be used as input information and input into the target model as well, so as to reduce the data processing burden of the target model and improve the data processing efficiency of the target model.

[0185] In this embodiment, the device parameters of the target sensor are obtained. The device parameters are related to the influence on the optical signal during the transmission of the optical signal by the target sensor. The target model is used to process the detection information, the device parameters, and the preset emission intensity to obtain the surface material of the target object, realizing the prediction of the surface material of the target object using the target model. Since the target model has a high compatibility and can be compatible with various models of target sensors, it can be applied to more detection scenarios.

[0186] Figure 11 It is a schematic flowchart of the training process of the target model provided by the embodiments of the present application, which may include steps 1101 to 1102. The following will describe these steps in detail.

[0187] 1101. Obtain a training sample set. Each training sample in the training sample set includes: sample detection information, device parameters of the target sensor, and sample emission intensity. The training label corresponding to the training sample includes the material of the sample detection item. The sample detection information corresponds to the sample received optical signal received by the target sensor, and the sample received optical signal is the optical signal reflected back to the target sensor after the target sensor emits a sample optical signal to the sample detection object at the sample emission intensity.

[0188] Among them, for training the target model, a training sample set is preset in advance, and the training sample set can be set for various detection environments.

[0189] Among them, the training sample set contains several training samples. The training samples include sample detection information, device parameters of the target sensor, and sample emission intensity. The training label corresponding to the training sample includes the material of the sample detection item.

[0190] Among them, the different detection environments may include at least one of the following: the distance between the target sensor and the sample detection object is different, the sample detection object is different, and the target sensor is different.

[0191] Among them, each target sensor emits an optical signal to the detection object at the set sample emission intensity. After the optical signal is reflected by the detection object, the reflected optical signal received by the target sensor is used as the corresponding sample received optical signal, and the target sensor outputs sample detection information after receiving the sample received optical information. Among them, the device parameters of the target sensor, the corresponding sample emission intensity, and the corresponding sample detection information are used as a training sample.

[0192] In a possible implementation, sample detection information, sample emission intensity, device parameters of the target sensor, etc. in different detection environments can be determined to train the target model for different detection environments, thereby improving the compatibility of the target model.

[0193] 1102. Train the original model based on the training sample set until the training end condition is met to obtain the target model.

[0194] Among them, the original model is trained based on each training sample and the corresponding training label in the training sample set to obtain the target model.

[0195] In a possible implementation, the training sample is input into the original model, the original model outputs a prediction result, the training loss is calculated by comparing the prediction result with the corresponding training label, the parameters of the original model are adjusted using the training loss, and the model with adjusted parameters is continuously iteratively trained until the training end condition is met to obtain the target model.

[0196] Among them, the training end condition may include any one of the following: the loss of the target model no longer converges, reaching the preset number of training iterations, etc. The specific content of the training end condition is not limited in this application.

[0197] Among them, by training the target model, a corresponding relationship between detection information and the surface material of an object can be established in the target model. In application, the detection information of the target sensor, the preset emission light intensity of the light signal emitted by the target sensor, and the device parameters of the target sensor are input into the target model, and the target model can predict the surface material of the target object.

[0198] In this embodiment, a training sample set is obtained. Each training sample in the training sample set includes: sample detection information, device parameters of the target sensor, and sample emission intensity. The training label corresponding to the training sample includes the material of the sample detection item. The sample detection information corresponds to the sample received optical signal received by the target sensor, and the sample received optical signal is the optical signal reflected back to the target sensor after the target sensor emits a sample optical signal to the sample detection object with the sample emission intensity. The original model is trained based on the training sample set until the training end condition is met to obtain the target model. The process of training the target model is disclosed. The target model can determine the material of the target object using detection information, device parameters, and the light signal emission intensity, providing a basis for subsequent prediction of the material of objects in various detection scenarios using the target model.

[0199] The above introduced a detection method provided by an embodiment of the present application. Next, an electronic device for executing the above detection method will be introduced.

[0200] Please refer to Figure 12 ,Figure 12 This is a schematic structural diagram of an electronic device for an application detection method provided by an embodiment of the present application. As Figure 12 shown, the electronic device 1200 includes:

[0201] An interface 1201, configured to obtain detection information of a target sensor, where the detection information corresponds to a received optical signal received by the target sensor, and the received optical signal is an optical signal that is reflected back to the target sensor after the target sensor emits an optical signal to a target object with a preset emission intensity;

[0202] A processor 1202, configured to determine a reflectivity of the target object according to the detection information and the optical signal with the preset emission intensity; and determine a surface material of the target object according to the reflectivity of the target object.

[0203] In a possible implementation, the processor includes:

[0204] A first determination module, configured to determine a reflectivity of the target object according to the detection information and the optical signal with the preset emission intensity;

[0205] A second determination module, configured to determine a surface material of the target object according to the reflectivity of the target object.

[0206] In a possible implementation, the first determination module includes:

[0207] An obtaining unit, configured to obtain a first waveform corresponding to the emitted optical signal;

[0208] An analysis unit, configured to analyze the detection information to obtain a second waveform corresponding to an intensity of the received optical signal, where the second waveform is the same type of waveform as the first waveform;

[0209] A first determination unit, configured to determine a detection distance between the target sensor and the target object according to the first waveform and the second waveform;

[0210] A second determination unit, configured to determine a target reception intensity of the received optical signal according to the second waveform;

[0211] A third determination unit, configured to determine a reflectivity of the target object according to the preset emission intensity, the target reception intensity, and the detection distance.

[0212] In a possible implementation, the second determination unit is specifically configured to:

[0213] Based on the fact that the first waveform is a sine wave, analyze the second waveform to obtain a peak of the second waveform;

[0214] Use the peak of the second waveform as the target reception intensity of the optical signal.

[0215] In a possible implementation, the third determining unit is specifically configured to:

[0216] Obtain a first attenuation, which is the attenuation of the optical signal caused by the hardware in the target sensor;

[0217] Determine the propagation attenuation of the optical signal during transmission between the target sensor and the target object according to the detection distance;

[0218] Determine the reflectivity of the target object according to the propagation attenuation, the first attenuation, the target reception intensity, and the preset transmission intensity.

[0219] In a possible implementation, the interface is specifically configured to:

[0220] Obtain at least two voltage sets output by the target sensor, with each voltage set serving as a detection message. The voltage values in the voltage set correspond one by one to the photosensitive elements in the photosensitive matrix of the target sensor. Different photosensitive elements in the photosensitive matrix correspond to different positions of the target object. Each voltage set corresponds to a signal acquisition moment. The voltage value of any photosensitive element corresponds to the light intensity of the photosensitive element, and the time when any voltage set is obtained matches the time when the target sensor receives the received optical signal.

[0221] In a possible implementation, the analysis unit is specifically configured to:

[0222] Analyze the voltages corresponding to the photosensitive elements in each voltage set to obtain the intensity of the received optical signal corresponding to each photosensitive element at the corresponding moment;

[0223] Obtain a second waveform corresponding to the intensity of each received optical signal according to the intensity of the received optical signal corresponding to each photosensitive element at each moment.

[0224] In a possible implementation, the second determining module is specifically configured to:

[0225] Determine at least one region according to the reflectivities corresponding to the photosensitive elements in the photosensitive matrix, where the reflectivities of the photosensitive elements in the same region are similar;

[0226] Determine the surface material of the object corresponding to each region according to the reflectivity corresponding to each region.

[0227] In a possible implementation, the processor is specifically configured to:

[0228] Obtain the device parameters of the target sensor, where the device parameters are related to the influence on the optical signal during the transmission of the optical signal by the target sensor;

[0229] Use the target model to process the detection message, the device parameters, and the preset transmission intensity to obtain the surface material of the target object.

[0230] In a possible implementation, the target model is trained through the following process:

[0231] Obtain a training sample set. Each training sample in the training sample set includes: sample detection information, device parameters of the target sensor, and sample emission intensity. The training label corresponding to the training sample includes the material of the sample detection item. The sample detection information corresponds to the sample received optical signal received by the target sensor, and the sample received optical signal is the optical signal reflected back to the target sensor after the target sensor emits a sample optical signal to the sample detection object at the sample emission intensity;

[0232] Train the original model based on the training sample set until the training end condition is met to obtain the target model.

[0233] It should be noted that for the functional explanations of the components in an electronic device provided in the embodiments of the present application, please refer to the explanations in the foregoing method embodiments, and details will not be elaborated here.

[0234] In this embodiment, the electronic device includes: an interface for obtaining the detection information of the target sensor. The detection information corresponds to the received optical signal received by the target sensor, and the received optical signal is the optical signal reflected back to the target sensor after the target sensor emits an optical signal to the target object at a preset emission intensity; a processor for determining the reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity; and determining the surface material of the target object based on the reflectivity of the target object. In the process of detecting the surface material of the target object, the reflectivity of the target object is determined through the detection information of the target sensor and the preset emission intensity of the optical signal emitted by the target sensor, and then the surface material is determined using the reflectivity. There is no need to limit the distance between the target object and the target sensor, and the detection conditions are few, which is applicable to scenarios with various distances and has a wide application range.

[0235] The embodiments of the present application also provide an electronic device. Refer to Figure 13 As shown, it shows a schematic structural diagram of an electronic device suitable for implementing the electronic device in the embodiments of the present application. The electronic device in the embodiments of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptop computers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), desktop computers, and the like. Figure 13 The shown electronic device is only an example and should not bring any limitations to the functions and usage scopes of the embodiments of the present application.

[0236] Such as Figure 13As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 1301, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1302 or the program loaded from the storage device 1308 into the random access memory (RAM) 1303. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 1303. The processing device 1301, the ROM 1302, and the RAM 1303 are connected to each other through a bus 1304. The input / output (I / O) interface 1305 is also connected to the bus 1304.

[0237] Generally, the following devices may be connected to the I / O interface 1305: an input device 1306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1308 including, for example, a memory card, a hard disk, etc.; and a communication device 1309. The communication device 1309 may allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 13 an electronic device with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.

[0238] In an embodiment of the present application, there is also provided a computer program product including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement any one of the detection methods provided in the embodiments of the present application.

[0239] In an embodiment of the present application, there is also provided a computer-readable storage medium carrying one or more computer programs, which, when executed by an electronic device, can enable the electronic device to implement any one of the detection methods provided in the embodiments of the present application.

[0240] In addition, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided in the present application, the connection relationship between the modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines.

[0241] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions accomplished by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits, etc. However, for the present application, software program implementation is a better embodiment in more cases. Based on such understanding, the technical solution of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disc of a computer, and includes several instructions for causing a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0242] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.

[0243] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, training device, or data center to another website, computer, training device, or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can store, or a data storage device such as a training device or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.

Claims

1. A detection method, comprising: Obtaining detection information of a target sensor, where the detection information corresponds to a received optical signal received by the target sensor, and the received optical signal is an optical signal that is reflected back to the target sensor after the target sensor emits an optical signal to a target object with a preset emission intensity; Determining the reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity; Determining the surface material of the target object based on the reflectivity of the target object.

2. The detection method according to claim 1, where determining the reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity includes: Obtaining a first waveform corresponding to the emitted optical signal; Analyzing the detection information to obtain a second waveform corresponding to the intensity of the received optical signal, where the second waveform is the same type of waveform as the first waveform; Determining the detection distance between the target sensor and the target object based on the first waveform and the second waveform; Determining the target reception intensity of the received optical signal based on the second waveform; Determining the reflectivity of the target object based on the preset emission intensity, the target reception intensity, and the detection distance.

3. The detection method according to claim 2, where determining the target reception intensity of the received optical signal based on the second waveform includes: Based on the first waveform being a sine wave, analyzing the second waveform to obtain the peak of the second waveform; Taking the peak of the second waveform as the target reception intensity of the optical signal.

4. The detection method according to claim 2, where determining the reflectivity of the target object based on the preset emission intensity, the target reception intensity, and the detection distance includes: Obtaining a first attenuation, where the first attenuation is the attenuation of the optical signal caused by the hardware in the target sensor; Determining the propagation attenuation of the optical signal during transmission between the target sensor and the target object based on the detection distance; Determining the reflectivity of the target object based on the propagation attenuation, the first attenuation, the target reception intensity, and the preset emission intensity.

5. The detection method according to claim 2, where obtaining the detection information of the target sensor includes: Obtaining at least two voltage sets output by the target sensor, with each voltage set being a detection information. The voltage values in the voltage set correspond one-to-one with the photosensitive elements in the photosensitive matrix of the target sensor. Different photosensitive elements in the photosensitive matrix correspond to different positions of the target object. Each voltage set corresponds to a signal acquisition moment. The voltage value of any photosensitive element corresponds to the light intensity of the photosensitive element. The time of obtaining any voltage set matches the time when the target sensor receives the received optical signal.

6. The detection method according to claim 5, where analyzing the detection information to obtain the second waveform corresponding to the intensity of the received optical signal includes: Analyzing the voltages corresponding to the photosensitive elements in each voltage set to obtain the intensity of the received optical signal corresponding to each photosensitive element at the corresponding moment; Obtaining the second waveform corresponding to the intensity of each received optical signal based on the intensity of the received optical signal corresponding to each photosensitive element at each moment.

7. The detection method according to claim 5, wherein determining the surface material of the target object based on the reflectivity of the target object comprises: Determining at least one region based on the reflectivities corresponding to the photosensitive elements in the photosensitive matrix, where the reflectivities of the photosensitive elements in the same region are similar; Determining the surface material of the object corresponding to each region based on the reflectivity corresponding to each region.

8. The detection method according to claim 1, determining the reflectivity of the target object based on the detection information and the optical signal with the preset emission intensity; Determining the surface material of the target object based on the reflectivity of the target object comprises: Obtaining the device parameters of the target sensor, where the device parameters are related to the influence on the optical signal during the transmission of the optical signal by the target sensor; Using the target model to process the detection information, the device parameters, and the preset emission intensity to obtain the surface material of the target object.

9. The detection method according to claim 8, wherein the target model is trained using the following process: Obtain a training sample set, where each training sample in the training sample set includes: Training the sample detection information, the device parameters of the target sensor, and the sample emission intensity, where the training label corresponding to the training sample includes the material of the sample detection item, the sample detection information corresponds to the sample received optical signal received by the target sensor, and the sample received optical signal is the optical signal reflected back to the target sensor after the target sensor emits the sample optical signal to the sample detection object at the sample emission intensity; Training the original model based on the training sample set until the training end condition is satisfied to obtain the target model.

10. An electronic device, comprising: An interface for obtaining the detection information of the target sensor, where the detection information corresponds to the received optical signal received by the target sensor, and the received optical signal is the optical signal reflected back to the target sensor after the target sensor emits the optical signal to the target object at the preset emission intensity; A processor for determining the reflectivity of the target object based on the detection information and the optical signal of the preset emission intensity; Determining the surface material of the target object based on the reflectivity of the target object.