Power calibration method and device of distance sensor, electronic equipment and medium
Through the power calibration tooling, the detection value and noise floor value of the distance sensor are obtained and determined, which solves the problem of inaccurate power calibration of the sensor and ensures that the sensor works effectively in electronic equipment.
Patent Information
- Application Number
- CN202510530582.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art has difficulty in accurately calibrating power after the electronic equipment is updated or iterated or replaced by the distance sensor model, resulting in the inadequacy of the sensor with the actual use environment.
Through the power calibration tool, the detection value and target noise floor value of the distance sensor in the current power state are obtained, the response value is determined, and the power control parameters in the current power state are calibrated as target power parameters within the preset range.
The accuracy of distance sensor power calibration is achieved, ensuring that the sensor works effectively in the actual use environment and avoiding calibration environment errors.
Smart Images

Figure CN120334870A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of distance sensors, and in particular relates to a power calibration method for a distance sensor, a power calibration device for a distance sensor, an electronic device, and a computer-readable storage medium. Background Art
[0002] Distance sensors are widely used in electronic devices and can be used to measure the distance between a target object and the electronic device. With the update and iteration of electronic devices, or when different models of distance sensors are selected for the same model of electronic device, in order to ensure the normal realization of the functions of the electronic device, it is necessary to re-calibrate the power of the distance sensor in the electronic device. That is, re-determine the power control parameters of the current distance sensor in the electronic device. Therefore, there is an urgent need to provide a solution that can accurately calibrate the power of the distance sensor. Summary of the Invention
[0003] The purpose of this application is to provide a power calibration method for a distance sensor, a power calibration device for a distance sensor, an electronic device, and a computer-readable storage medium, which can provide a solution that can accurately calibrate the power of the distance sensor.
[0004] The first aspect of the embodiments of this application provides a power calibration method for a distance sensor, which is applied to a power calibration tooling. The power calibration method includes:
[0005] When the target device is installed on the power calibration tooling and a preset reflector is detected to be in place, obtain the detection value of the distance sensor in the current power state; wherein, the distance sensor is configured in the target device, and the detection value is used to represent the output value corresponding to the distance detected by the distance sensor to the preset reflector;
[0006] Based on the detection value and the target noise floor value of the distance sensor, determine the response value of the distance sensor; wherein, the target noise floor value is the noise floor value measured by the distance sensor in the current power state;
[0007] If the response value is within the preset range, calibrate the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor.
[0008] A power calibration method for a distance sensor provided by an embodiment of the present application is applied to a power calibration tooling. When the target device is installed on the power calibration tooling and a preset reflector is detected to be in place, the power calibration tooling obtains the detection value of the distance sensor in the current power state. Since the distance sensor is configured in the target device and the detection value is used to represent the output value corresponding to the distance at which the distance sensor detects the preset reflector, the power calibration tooling can determine the response value of the distance sensor based on the detection value and the target noise floor value of the distance sensor. Also, because the target noise floor value is the noise floor value measured by the distance sensor in the current power state, when the response value is within the preset range, it indicates that the response value of the distance sensor determined in the current power state is suitable for the target device to detect the preset reflector in place. Furthermore, the current power control parameter corresponding to the current power state can be calibrated as the target power parameter of the distance sensor, thus providing a solution that can accurately calibrate the power of the distance sensor.
[0009] A second aspect of the embodiment of the present application provides a power calibration device for a distance sensor, which is applied to a power calibration tooling. The power calibration device includes:
[0010] An acquisition unit, configured to obtain the detection value of the distance sensor in the current power state when the target device is installed on the power calibration tooling and a preset reflector is detected to be in place; wherein, the distance sensor is configured in the target device, and the detection value is used to represent the output value corresponding to the distance at which the distance sensor detects the preset reflector;
[0011] A determination unit, configured to determine the response value of the distance sensor based on the detection value and the target noise floor value of the distance sensor; wherein, the target noise floor value is the noise floor value measured by the distance sensor in the current power state;
[0012] A calibration unit, configured to calibrate the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor if the response value is within the preset range.
[0013] A third aspect of the embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the electronic device. When the processor executes the computer program, the steps of the power calibration method for the distance sensor provided in the first aspect as described above are implemented.
[0014] A fourth aspect of the embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the power calibration method for the distance sensor provided in the first aspect as described above are implemented.
[0015] It is understandable that for the beneficial effects of the above-mentioned second invention, third aspect, and fourth aspect, reference may be made to the relevant descriptions in the above-mentioned first aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 FIG. is a flowchart of an implementation of a method for power calibration of a distance sensor provided by an embodiment of the present application;
[0017] Figure 2 FIG. is a flowchart of an implementation of a method for power calibration of a distance sensor provided by another embodiment of the present application;
[0018] Figure 3 FIG. is a schematic structural diagram of a device for power calibration of a distance sensor provided by an embodiment of the present application;
[0019] Figure 4 FIG. is a block diagram of a structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] In order to make the technical problems, technical solutions, and beneficial effects to be solved by the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0021] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0022] It should be understood that the orientation or positional relationship indicated by terms such as "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation to the present application.
[0023] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the number of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, "a plurality" means two or more unless otherwise specifically defined.
[0024] Distance sensors are widely used in electronic devices and can be used to measure the distance between a target object and the electronic device. With the update and iteration of electronic devices, or different models of distance sensors being selected for the same model of electronic device, in order to ensure the normal realization of the functions of the electronic device, it is necessary to re-calibrate the power of the distance sensor in the electronic device. That is, to re-determine the power control parameters of the current distance sensor in the electronic device.
[0025] Exemplarily, in some related technologies, by obtaining the working parameter characteristics of the replaced sensor and the replaced sensor, and establishing a corresponding mathematical model therewith, the power parameters of the replaced sensor are calculated using the mathematical model, thereby realizing the power calibration of the sensor.
[0026] However, when calculating the power parameters of the replaced sensor using the mathematical model, the influence of the actual working environment to which the sensor belongs on the monitoring value or monitoring accuracy of the sensor cannot be fully considered. In this way, it is easy to cause the measured power parameters to be mismatched with the environment where the sensor is actually configured. Therefore, there is an urgent need to provide a solution that can accurately calibrate the power of the distance sensor.
[0027] To solve the above technical problems, a power calibration method for a distance sensor provided by an embodiment of the present application is applied to a power calibration tooling. When the target device is installed on the power calibration tooling and a preset reflector is detected to be in place, the power calibration tooling obtains the detection value of the distance sensor in the current power state. Since the distance sensor is configured in the target device and the detection value is used to represent the output value corresponding to the distance at which the distance sensor detects the preset reflector, the power calibration tooling can determine the response value of the distance sensor based on the detection value and the target noise floor value of the distance sensor. Also, because the target noise floor value is the noise floor value measured by the distance sensor in the current power state, when the response value is within the preset range, it means that the response value of the distance sensor determined in the current power state is suitable for the target device to detect the preset reflector in place. Furthermore, the current power control parameter corresponding to the current power state can be calibrated as the target power parameter of the distance sensor, thereby providing a solution that can accurately calibrate the power of the distance sensor.
[0028] A power calibration method for a distance sensor provided by this embodiment is applied to a power calibration tooling, that is, the execution subject is the power calibration tooling. Specifically, it can be a control device or a controller in the power calibration tooling. In actual use, by constructing a real usage environment for the distance sensor and connecting the power calibration tooling to the target device, the power calibration of the distance sensor of the target device by the power calibration tooling is consistent with the actual usage environment of the distance sensor, which can avoid the error of the calibration environment or the mismatch between the calibrated power and the actual usage environment.
[0029] The following is a detailed description of a method for calibrating the power of a distance sensor provided in this embodiment through specific implementation manners.
[0030] Figure 1 The flowchart of implementing a method for calibrating the power of a distance sensor provided in an embodiment of the present application is shown. As Figure 1 shown, the method for calibrating the power of the distance sensor includes the following steps:
[0031] 110: When the target device is installed on the power calibration tooling and a preset reflector is detected to be in place, obtain the detection value of the distance sensor in the current power state.
[0032] In 110, the distance sensor is configured in the target device. The detection value is used to characterize the output value corresponding to the distance at which the distance sensor detects the preset reflector.
[0033] In this embodiment, the preset reflector is a module configured on the power calibration tooling, which is used to simulate a target object that obstructs or contacts the target device when using the target device. The distance between the preset reflector and the target device can be monitored through the distance sensor, and then the distance can be characterized by the detection value. In specific implementation, different preset reflectors can be selected according to the actual usage scenario of the target device and / or the actual usage requirements of the distance sensor. It is easy to understand that when using the target device, the distance sensor can be used to detect whether the target device is obstructed by the target object or contacts the target object, and then trigger corresponding preset instructions to implement the intelligent response function of the target device.
[0034] For example, taking the target device as a hair remover, the target object can be regarded as the skin with hair. Correspondingly, the preset reflector can be a light-shielding dark box and / or simulation fur, etc. The distance between the target object / preset reflector and the light-emitting part of the hair remover can be detected through the distance sensor, and the distance can be characterized by outputting the detection value. When the target object / preset reflector obstructs the light-emitting part of the hair remover or is in full contact with the light-emitting part, a preset light-emitting instruction can be triggered to instruct the hair remover to work for light-emitting operation.
[0035] For another example, taking the target device as a beauty instrument, the target object can be regarded as the skin. Correspondingly, the preset reflector can be simulation leather / skin, etc. The distance between the target object / preset reflector and the acting part of the beauty instrument can be detected through the distance sensor, and the distance can be characterized by outputting the detection value. When the target object / preset reflector obstructs the acting part of the beauty instrument or is in full contact with the acting part, a preset energy output instruction can be triggered to instruct the beauty instrument to work for outputting energy acting on the target object / preset reflector, such as ultrasonic waves, microcurrents, pulse energy, light energy, heat energy, etc., which is not limited here.
[0036] Exemplarily, in specific implementation, the power calibration tooling may include a host computer, a bracket for carrying the target device, and an interaction interface for connecting the target device. When using the power calibration tooling to perform power calibration on the distance sensor of the target device, the target device can be installed on the bracket and connected to the power calibration tooling through the interaction interface, so that the host computer can interact with the target device through the interaction interface.
[0037] As an example, the bracket for carrying the target device is configured with connection electrodes or connection sockets corresponding to the target device. When the target device is installed on the bracket, the contact electrodes and / or connection sockets can be electrically connected to the target device. Based on this, when it is detected that the connection electrodes or connection sockets are connected to the target device, it can be determined that the target device is installed on the power calibration tooling.
[0038] In this embodiment, detecting that the preset reflector is in place means that the preset reflector has been installed on the power calibration tooling. In practical applications, the power calibration tooling can control the preset reflector to move along a predetermined trajectory, thereby simulating different distances between the object monitored by the distance sensor and the target device.
[0039] Combined with the above example, in some examples, the preset reflector is detachably installed on the power calibration tooling. In actual use, different preset reflectors can be selected according to the calibration requirements of different target devices. It is easy to understand that when the preset emitter is installed on the power calibration tooling, a corresponding electrical signal can be triggered, such as pulling down the interface voltage for carrying the preset reflector, thereby triggering a corresponding in-place signal, so that the power calibration tooling can learn the in-place state of the preset reflector.
[0040] In some embodiments, detecting that the preset reflector is in place means that the preset reflector has been installed on the power calibration tooling and the preset reflector is within the range of action of the distance sensor. That is, when the target device is installed on the power calibration tooling and it is detected that the preset reflector is in place, it means that the position where the preset reflector is currently located is the position where the target object is located during the actual use of the target device.
[0041] In actual use, when installing the target device on the power calibration tooling, the user can manually control the target device to enter the working state, or the power calibration tooling can control the target device to enter the working state, which is not limited here. When the target device is in the working state, by interacting with the power calibration tooling, the detection value of the distance sensor for the preset reflector in the current power state can be sent to the power calibration tooling. Here, the current power state can be understood as the default power for the target device to supply power to the distance sensor.
[0042] As an example, step 110 may include:
[0043] Based on the control parameters corresponding to the current power state, control the distance sensor to work, and make the distance sensor output detection parameters by detecting the distance of a preset reflector.
[0044] In this embodiment, the power calibration tooling can control the target device to power on and work by interacting with the target device. The control parameters corresponding to the current power state refer to the control parameters of the distance sensor, and specifically may include the power parameters corresponding to the current power state.
[0045] In specific implementation, the target device may have multiple working modes or multiple working states. The power calibration tooling can instruct the target device to enter the corresponding working mode and / or working state by configuring preset control strategies. At the same time, the corresponding relationship between the working mode and / or working state and the control parameters can be pre-configured in the power calibration tooling. According to this corresponding relationship, when controlling the target device to work, the corresponding power control parameters can be determined according to the current power state, and the power control parameters can be configured into the cache of the target device, so that the target device can provide corresponding electric energy for the distance sensor according to the power control parameters, and then control the distance sensor to work, and make the distance sensor output detection parameters by detecting the distance of a preset reflector.
[0046] Exemplarily, a mapping list is pre-configured in the power calibration tooling, and this mapping list is used to describe the power control parameters of the distance sensor of the target device in the parameter calibration working mode and / or the factory mode. When the target device is installed on the power calibration tooling and a preset reflector is detected to be in place, the power calibration tooling can control the target device to enter the parameter calibration working mode and / or the factory mode, and then obtain the corresponding power control parameters according to the mapping list, and configure the power control parameters to the target device, so that the target device can provide electric energy with corresponding power for the distance sensor in the parameter calibration working mode and / or the factory mode. Under the action of this electric energy, the distance sensor outputs detection parameters by detecting the distance of a preset reflector. Here, the target device can obtain the detection parameters and feedback the detection parameters to the power calibration tooling as the basis for the power calibration tooling to perform power calibration on the distance sensor of the target device. In this example, controlling the target device to enter the parameter calibration working mode and / or the factory mode may also be that the user manually turns on the target device and, by operating the target device, such as entering a password to make the target device enter the parameter calibration working mode and / or the factory mode, or manually switching the mode of the target device to make it enter the parameter calibration working mode and / or the factory mode, which is not limited here.
[0047] 120: Determine the response value of the distance sensor based on the detected value and the target background noise value of the distance sensor.
[0048] In 120, the target background noise value is the background noise value measured by the distance sensor in the current power state. This target background noise value can be pre-stored in the power calibration tooling. While the power calibration tooling obtains the detected value of the distance sensor in the current power state, it also obtains the background noise value of the distance sensor in the current power state.
[0049] It is easy to understand that the target background noise value in this embodiment specifically refers to the background noise value corresponding to the distance sensor in the current power state. Since the background noise value of the distance sensor refers to the inherent noise generated by factors such as the sensor's own circuit, components, and environmental interference when there is no effective input signal (such as no preset reflector or object to be measured), and the distance sensor may affect its own background noise value through factors such as thermal effects, gain adjustment, or noise source switching when the power changes, therefore, by clarifying that the background noise value measured by the distance sensor in the current power state is the target background noise value, the accuracy of the determined response value can be ensured.
[0050] In this embodiment, the response value is used to describe the effective value output by the distance sensor when detecting the distance to the preset reflector.
[0051] As an embodiment, step 120 may include: calculating the difference between the detected value and the target background noise value as the response value.
[0052] As an example, since the detected value is the real-time value monitored by the distance sensor and the target background noise value can be obtained by looking up a table or other means, therefore, in specific implementation, a calculation formula for determining the response value based on the detected value and the target background noise value can be pre-configured in the power calibration tooling. After obtaining the detected value, the detected value and the target background noise value can be substituted into this calculation formula to calculate the response value.
[0053] Combined with the above example, in some examples, according to the usage scenario of the target device or the configuration structure of the target device for the distance sensor, corresponding compensation factors or correction factors can also be set in the above calculation formula to compensate or correct the calculated response value. For example, the distance sensor may affect its own background noise value through factors such as thermal effects, gain adjustment, or noise source switching. In order to make the response value measured based on the detected value of the distance sensor and the target background noise value more accurate, a thermal effect compensation factor, a gain compensation factor, or a noise source compensation factor, etc., can be configured in the above formula to compensate or correct the calculated response value.
[0054] 130: If the response value is within the preset range, calibrate the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor.
[0055] In 130, the preset range refers to the range of action values or valid values of the values detected by the distance sensor in the target device. Here, when the response value is within the preset range, it means that the detection value currently detected by the distance sensor is adapted to the working environment of the target device. That is, the detection value can be used to indicate the preset reflector or target object within the action range of the target device.
[0056] In all embodiments of the present application, the target device has a certain action range. When the preset reflector or target object is within the action range of the target device, the distance sensor triggers a corresponding detection value. Under the action of the response value corresponding to the detection value, the target device can output corresponding energy to the preset reflector or target object. That is, the action range of the target device refers to the distance range for triggering the target device to output energy, and can also be understood as the action range for triggering the electrical signal indicating the target device to output energy through the distance sensor.
[0057] In this embodiment, the target power parameter is used to indicate the power magnitude for the target device to control the operation of the distance sensor. Calibrating the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor means using the current power control parameter corresponding to the current power state as the power control parameter when the target device supplies electrical energy to the distance sensor. That is, when the target device is working, electrical energy with the corresponding power can be output to the distance sensor according to the target power parameter, so that the distance sensor can work under the action of this electrical energy.
[0058] Exemplarily, the control parameters of each unit module can be pre-configured in the target device, and the control parameters can be stored in the storage unit of the target device. When the target device is working, different working modules can be controlled by running the corresponding control program and calling the corresponding control parameters.
[0059] In specific implementation, the power control parameter of the distance sensor can be stored in the storage unit of the target device, specifically in the target address of the storage unit. The target address can be configured by the user on the power calibration tooling, or determined by the power calibration tooling by accessing the target device. When calibrating the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor, the target address in the storage unit can be obtained, and the current power control parameter corresponding to the current power state can be stored in this target address, thereby realizing the calibration of the target power parameter of the distance sensor.
[0060] As an embodiment, step 130 may include:
[0061] Take the current power control parameter corresponding to the current power state as the target power parameter and configure it into the configuration file of the target device to calibrate it as the target power parameter of the distance sensor.
[0062] In this embodiment, the configuration file refers to the program file executed by the target device. When the target device is powered on and working, its corresponding functions can be realized by executing this configuration file.
[0063] Taking the target device as a hair removal device as an example, this configuration file is used to describe the working strategy of the hair removal device, which can specifically include the light emission strategy of the hair removal device, etc.
[0064] Taking the target device as a beauty device as an example, this configuration file is used to describe the working strategy of the beauty device, which can specifically include the energy output strategy of the energy output by the beauty device acting on the skin, etc.
[0065] In specific implementation, since the power control parameter refers to the power magnitude that provides electrical energy for the distance sensor when the target device is working, the current power control parameter can be used as the target power parameter and configured to the corresponding position in the configuration file, that is, declare the power supply magnitude of the distance sensor in the configuration file. In this way, when the target device is working, the distance sensor can be powered according to this target power parameter, so that the detection value output by the distance sensor when detecting the target object and the corresponding response value can be within the preset range, and then the target device can trigger energy according to this response value and act on the target object.
[0066] In one embodiment, before step 110, it may further include the step of obtaining the background noise value of the distance sensor, which may specifically include the following steps 1 to 2. Specifically:
[0067] Step 1: Respond to the preset instruction for controlling the target device to enter the background noise measurement mode, and control the target device to enter the background noise measurement mode.
[0068] Step 2: When the target device is in the background noise measurement mode, control the distance sensor to work according to the preset detection strategy to obtain the background noise values of the distance sensor at different powers.
[0069] In this embodiment, the preset instruction can be triggered by the user through manual operation on the power calibration tooling, or can be automatically triggered by the power calibration tooling, which is not limited herein. The preset detection strategy is used to describe the order of providing driving power to the distance sensor. Here, the distance sensor can operate at at least two driving powers, that is, when supplying electrical energy to the distance sensor, two types of electrical energy corresponding to at least two driving powers can be provided. When performing power calibration on the distance sensor, it can be understood as determining a target driving power adapted to the target device from the at least two driving powers, and then calibrating the corresponding control parameters as the target power parameters of the distance sensor.
[0070] As an example, the power calibration tooling automatically triggers the preset instruction to control the target device to enter the background noise measurement mode.
[0071] For example, the target device can be installed on the power calibration tooling in a shutdown state. When the power calibration tooling controls the target device to power on, the power calibration tooling can automatically trigger the preset instruction to control the target device to enter the background noise measurement mode.
[0072] For another example, when the user replaces the target device on the power calibration tooling, the power calibration tooling can detect the connection of the new target device, and at this time, the preset instruction can also be automatically triggered on the power calibration tooling to control the target device to enter the background noise measurement mode.
[0073] As another example, the user triggers the preset instruction by manually operating the power calibration tooling.
[0074] For example, the target device can be installed on the power calibration tooling in a shutdown state. The user manually operates the power calibration tooling, that is, controls the target device to power on through the power calibration tooling and enters the background noise measurement mode.
[0075] It is easy to understand that the background noise value refers to the noise level generated by the target device itself when there is no signal input. This kind of noise may come from the structure of the target device or environmental interference, etc. The background noise value may have different manifestation forms and measurement methods in different applications and devices.
[0076] In this embodiment, the background noise value of the distance sensor refers to the noise level output by the sensor when there is no object occlusion. For example, in the prior art, when the distance sensor is not blocked by obstacles, due to the influence of the hardware structure design of the distance sensor, the distance sensor will receive ranging data reflected by the light guide column of the sensor itself and the light blocking plate between the transmitter and the receiver, which is the background noise value of the distance sensor. Therefore, this embodiment does not specifically limit the form and measurement method of the background noise parameters. For example, the detected background noise value in this embodiment can be a numerical value (counts). For example, in this embodiment, the skin treatment device can respond to the power-on operation and control the immediate background noise parameter collected by the distance sensor to be 1800.
[0077] In a specific embodiment, the distance sensor includes any one of an infrared distance sensor, an ultrasonic distance sensor, a millimeter-wave radar distance sensor, and a laser rangefinder.
[0078] In this embodiment, the type of the distance sensor can include an infrared distance sensor, an ultrasonic distance sensor, a millimeter-wave radar distance sensor, a laser rangefinder, etc., and no specific limitation is made thereto.
[0079] In specific implementation, controlling the target device to enter the background noise measurement mode means controlling the target device to only read the value collected by the distance sensor without triggering the corresponding control operation. That is, when the target device is in the background noise test mode, the target device can read the immediate parameter collected / detected by the distance sensor according to a certain numerical reading strategy as the background noise value.
[0080] As an embodiment, the preset detection strategy includes the magnitude order of the power control parameters. Correspondingly, step 2 above can specifically include: when the target device is in the background noise measurement mode, controlling the distance sensor to work in the order of the power control parameters from large to small to obtain the background noise values of the distance sensor at different powers.
[0081] As an embodiment, the preset detection strategy includes the magnitude order of the power control parameters. Correspondingly, step 2 above can specifically include: when the target device is in the background noise measurement mode, controlling the distance sensor to work in the order of the power control parameters from small to large to obtain the background noise values of the distance sensor at different powers.
[0082] In specific implementation, when the target device is in the background noise measurement mode, only the values collected by the distance sensor are read, and the corresponding control operations are not triggered. Therefore, the immediate parameters collected / detected by the distance sensor in the target device can be obtained through a power calibration tooling as the background noise values. Here, a corresponding background noise value list can be established according to the order of the power control parameters. When controlling / driving the distance sensor to work according to a certain power control parameter, by obtaining the immediate parameters collected / detected by the distance sensor and storing the immediate parameters and the power control parameter correspondingly in the background noise value list, the background noise values of the distance sensor at different powers can be obtained.
[0083] In the above solution, by controlling the target device to enter the background noise measurement mode, when the target device is in the background noise measurement mode, the distance sensor can be controlled to work according to a preset detection strategy to obtain the background noise values of the distance sensor at different powers.
[0084] Figure 2 The flowchart of implementing a power calibration method for a distance sensor provided by another embodiment of the present application is shown. As Figure 1 shown, different from Figure 1 the above, the power calibration method for the distance sensor provided in this embodiment further includes:
[0085] 210: If the response value is not within the preset energy threshold range, determine a new power control parameter, and use the new power control parameter as the current power control parameter to control the distance sensor to work, so as to execute the step of obtaining the detection parameters of the distance sensor in the current power state.
[0086] In 210, the preset range refers to the action value range or the effective value range of the values detected by the distance sensor in the target device. Here, when the response value is not within the preset energy threshold range, it means that the detection value currently detected by the distance sensor does not match the working environment of the target device. That is, the detection value cannot be used to indicate the preset reflector or the target object within the action range of the target device. At this time, it is necessary to re-calibrate the power of the distance sensor by determining a new power control parameter.
[0087] In this embodiment, the new power control parameter refers to the control parameter corresponding to other driving powers of the distance sensor. Here, by using the new power control parameter as the current power control parameter, the power corresponding to the new power control parameter can be used to output the corresponding electric energy to control the distance sensor to work, so as to execute the step of obtaining the detection parameters of the distance sensor in the current power state, that is, re-execute steps 110 to 130.
[0088] It is easy to understand that for a distance sensor, it can include at least two driving powers, and each driving power corresponds to a set of power control parameters. In actual implementation, the distance sensor can work at most under N driving powers, where N is an integer and N≥2. Correspondingly, when performing the power calibration method of the distance sensor provided in this embodiment, the steps 110 to 210 can be cycled at most N times to implement the power calibration operation of the distance sensor.
[0089] In the above solution, when the response value is not within the preset energy threshold range, by determining new power control parameters and using the new power control parameters as the current power control parameters to control the operation of the distance sensor, and then looping back to the step of obtaining the detection parameters of the distance sensor in the current power state. In this way, by providing corresponding electrical energy to the distance sensor through different power control parameters, the power control parameters adapted to the target device can be found, thereby calibrating the power of the distance sensor. This not only realizes the automatic power calibration of the distance sensor but also improves the accuracy of power calibration of the distance sensor.
[0090] Please refer to Figure 3 , Figure 3 FIG. shows a schematic structural diagram of a power calibration device for a distance sensor provided in an embodiment of the present application. In this embodiment, each unit included in the power calibration device of the distance sensor is used to execute Figures 1 to 2 the corresponding steps in the corresponding embodiment. Specifically, please refer to Figures 1 to 2 the relevant descriptions in the corresponding embodiment. For the sake of convenience of description, only the parts related to this embodiment are shown. See Figure 3 , the power calibration device of the distance sensor includes: an acquisition unit 301, a determination unit 302, and a calibration unit 303. Specifically:
[0091] The acquisition unit 301 is configured to obtain the detection value of the distance sensor in the current power state when the target device is installed on the power calibration tool and a preset reflector is monitored to be in place; wherein, the distance sensor is configured in the target device, and the detection value is used to represent the output value corresponding to the distance at which the distance sensor detects the preset reflector.
[0092] The determination unit 302 is configured to determine the response value of the distance sensor based on the detection value and the target noise floor value of the distance sensor; wherein, the target noise floor value is the noise floor value measured by the distance sensor in the current power state.
[0093] The calibration unit 303 is configured to, if the response value is within the preset range, calibrate the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor.
[0094] As an embodiment, the power calibration device of the distance sensor further includes:
[0095] A first execution unit, configured to determine a new power control parameter if the response value is not within a preset energy threshold range, and use the new power control parameter as the current power control parameter to control the distance sensor to operate, so as to execute the step of obtaining the detection parameter of the distance sensor in the current power state.
[0096] As an embodiment, the power calibration device of the distance sensor further includes:
[0097] A background noise measurement unit, configured to control the target device to enter the background noise measurement mode in response to a preset instruction for controlling the target device to enter the background noise measurement mode.
[0098] A second execution unit, configured to control the distance sensor to operate according to a preset detection strategy when the target device is in the background noise measurement mode, so as to obtain the background noise values of the distance sensor at different powers.
[0099] It can be understood that the improvement points and specific implementation manners related to this application have been Figures 1 to 2 described in detail in the Figures 1 to 2 corresponding embodiments. When specifically implemented, on the basis of the Figure 3 corresponding embodiments, the units in the power calibration device of the distance sensor provided in the embodiments may be made to execute the steps in the above method embodiments, so details are not described herein again.
[0100] Figure 4 It is a structural block diagram of an electronic device provided by an embodiment of this application. As Figure 4 shown, the electronic device 4 in this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40, such as a program for the power calibration method of the distance sensor. When the processor 40 executes the computer program 42, the steps in the above various embodiments of the power calibration method of the distance sensor are implemented, such as Figures 1 to 2 the steps shown. Or, when the processor 40 executes the computer program 42, the functions of the units in the above Figure 3 corresponding embodiments are implemented. For specific reference, please refer to the Figure 3 relevant descriptions in the corresponding embodiments, and details are not described herein.
[0101] Exemplarily, the computer program 42 may be divided into one or more units, which are stored in the memory 41 and executed by the processor 40 to complete this application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 42 in the electronic device 4. For example, the computer program 42 may be divided into an acquisition unit, a determination unit, and a calibration unit, and the specific functions of each unit are as described above.
[0102] The electronic device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art can understand that Figure 4 merely being examples of the electronic device 4, they do not constitute a limitation on the electronic device 4. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, a bus, etc.
[0103] The so-called processor 40 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0104] The memory 41 may be an internal storage unit of the electronic device 4, such as the hard disk or memory of the electronic device 4. The memory 41 may also be an external storage device of the electronic device 4, such as a plug-in hard disk equipped on the electronic device 4, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 41 may also include both the internal storage unit and the external storage device of the electronic device 4. The memory 41 is used to store the computer program and other programs and data required by the electronic device. The memory 41 may also be used to temporarily store data that has been output or will be output.
[0105] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included within the protection scope of the present application.
Claims
1. A power calibration method for a distance sensor, characterized in that, Applied to a power calibration tooling, the power calibration method includes: When the target device is installed on the power calibration tooling and a preset reflector is detected to be in place, obtain the detection value of the distance sensor in the current power state; wherein, the distance sensor is configured in the target device, and the detection value is used to represent the output value corresponding to the distance at which the distance sensor detects the preset reflector; Based on the detection value and the target background noise value of the distance sensor, determine the response value of the distance sensor; wherein, the target background noise value is the background noise value measured by the distance sensor in the current power state; If the response value is within a preset range, calibrate the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor.
2. The power calibration method of the distance sensor according to claim 1, wherein It further includes: If the response value is not within the preset energy threshold range, determine a new power control parameter, and use the new power control parameter as the current power control parameter to control the operation of the distance sensor, so as to execute the step of obtaining the detection parameter of the distance sensor in the current power state.
3. The power calibration method of the distance sensor according to claim 1, characterized in that It further includes: In response to a preset instruction to control the target device to enter the background noise measurement mode, control the target device to enter the background noise measurement mode; When the target device is in the background noise measurement mode, control the operation of the distance sensor according to a preset detection strategy to obtain the background noise values of the distance sensor at different powers.
4. The power calibration method of the distance sensor according to claim 3, characterized in that The preset detection strategy includes the magnitude order of power control parameters; The step of, when the target device is in the background noise measurement mode, controlling the operation of the distance sensor according to a preset detection strategy to obtain the background noise values of the distance sensor at different powers includes: When the target device is in the background noise measurement mode, control the operation of the distance sensor in descending order of the power control parameters to obtain the background noise values of the distance sensor at different powers; or When the target device is in the background noise measurement mode, control the operation of the distance sensor in ascending order of the power control parameters to obtain the background noise values of the distance sensor at different powers.
5. The power calibration method of the distance sensor according to claim 1, characterized in that The step of obtaining the detection parameter of the distance sensor in the current power state includes: Based on the current power control parameter corresponding to the current power state, control the operation of the distance sensor, so that the distance sensor outputs the detection parameter by detecting the distance of the preset reflector.
6. The power calibration method of the distance sensor according to claim 1, characterized in that The step of, based on the detection value and the target background noise value of the distance sensor, determining the response value of the distance sensor includes: Calculate the difference between the detection value and the target background noise value as the response value.
7. The power calibration method of the distance sensor according to any one of claims 1 to 6, characterized in that, The step of calibrating the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor includes: Use the current power control parameter corresponding to the current power state as the target power parameter and configure it into the configuration file of the target device to be calibrated as the target power parameter of the distance sensor.
8. A power calibration device for a distance sensor, characterized in that, Applied to a power calibration tooling, the power calibration device includes: An acquisition unit, configured to acquire a detection value of the distance sensor in a current power state when a target device is installed on the power calibration tooling and a preset reflector is detected in place; wherein, the distance sensor is disposed in the target device, and the detection value is used to represent an output value corresponding to the distance at which the distance sensor detects the preset reflector; A determination unit, configured to determine a response value of the distance sensor based on the detection value and a target background noise value of the distance sensor; wherein, the target background noise value is the background noise value measured by the distance sensor in the current power state; A calibration unit, configured to, if the response value is within a preset range, calibrate the current power control parameter corresponding to the current power state as the target power parameter of the distance sensor.
9. An electronic device, characterized in that, Comprising: A memory, a processor, and a computer program stored in the memory and executable on the electronic device, wherein when the processor executes the computer program, the steps of the power calibration method of the distance sensor according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the power calibration method of the distance sensor according to any one of claims 1 to 7 are implemented.