WO2022198984A1 - 传感器的控制方法、装置、终端设备及存储介质 - Google Patents

传感器的控制方法、装置、终端设备及存储介质 Download PDF

Info

Publication number
WO2022198984A1
WO2022198984A1 PCT/CN2021/122209 CN2021122209W WO2022198984A1 WO 2022198984 A1 WO2022198984 A1 WO 2022198984A1 CN 2021122209 W CN2021122209 W CN 2021122209W WO 2022198984 A1 WO2022198984 A1 WO 2022198984A1
Authority
WO
WIPO (PCT)
Prior art keywords
sensor
value
range
preset
detected value
Prior art date
Application number
PCT/CN2021/122209
Other languages
English (en)
French (fr)
Inventor
刘文姝
Original Assignee
歌尔股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 歌尔股份有限公司 filed Critical 歌尔股份有限公司
Publication of WO2022198984A1 publication Critical patent/WO2022198984A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D21/00Measuring or testing not otherwise provided for
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00

Definitions

  • the present application relates to the technical field of sensors, and in particular, to a control method, device, terminal device and storage medium for a sensor.
  • Various types of terminal equipment often need to use sensors to collect various data (such as temperature, humidity, light intensity, motion data, etc.).
  • the senor collects various data, it needs to perform analog-to-digital conversion on the collected analog data to convert it into converted data (digital signal), and then report the converted data to the terminal device.
  • the reported parameters such as the range or resolution of the sensor are fixed, and will not change according to the use environment or the collected data under different use environments.
  • the parameters reported by the sensor need to be calibrated.
  • the process of calibrating the sensor reporting parameters is mainly performed by the user performing a fixed operation after being prompted, and the calibration operation is cumbersome and difficult to complete.
  • the main purpose of this application is to provide a sensor control method, device, terminal device and storage medium, aiming to simplify the sensor calibration process.
  • the present application provides a method for controlling a sensor, the method comprising:
  • the current reporting parameter of the sensor is adjusted to the target reporting parameter, and the target reporting parameter and the current reporting parameter are at least one of resolution and range.
  • the preset condition includes any one of the following:
  • the ratio of the detection value to the maximum detection value of the sensor is greater than the first preset ratio, or the ratio of the detection value to the minimum detection value of the sensor is smaller than the second preset ratio;
  • the difference between the maximum detection value of the sensor and the detection value is smaller than the first preset difference, or the difference between the detection value and the minimum detection value of the sensor is greater than the second preset difference;
  • the preset condition includes that the detected value exceeds a preset value range, and the preset value range is less than or equal to a value range corresponding to the range of the sensor.
  • the preset condition includes that the detected value exceeds a preset value range, and the preset value range is less than or equal to the value range corresponding to the range of the sensor;
  • the step of determining that the detected value meets a preset condition, and adjusting the current reporting parameter of the sensor to the target reporting parameter includes:
  • the step of determining that the detected value meets a preset condition, and adjusting the current reporting parameter of the sensor to the target reporting parameter includes:
  • control method for the sensor further includes:
  • control method for the sensor further includes:
  • control method for the sensor further includes:
  • the steps of the control method for the sensor include:
  • the initialization instruction of the sensor is detected, the resolution of the sensor is configured as the default resolution configuration in the initialization file, and the range of the sensor is configured as the default range in the initialization file.
  • the present application also proposes a control device for a sensor, the control device for a sensor includes a memory, a processor, and a control program for the sensor that is stored in the memory and can be run on the processor. , when the control program of the sensor is executed by the processor, the control method of the sensor as described above is implemented.
  • the present application also proposes a terminal device, the terminal device includes a sensor, wherein the sensor includes the control device for the sensor as described above.
  • the present application also proposes a computer-readable storage medium, where a control program of a sensor is stored on the computer-readable storage medium, and when the control program of the sensor is executed by a processor, the above-mentioned implementation is realized The steps of the sensor control method.
  • the analog data is converted from analog to digital by resolution to obtain the detected value. After the detected value is obtained, if the detected value is If the preset conditions are met, indicating that the reporting parameters need to be adjusted, the reporting parameters of the sensor are adjusted.
  • This solution can realize the adjustment of the reporting parameters in the process of data detection, which simplifies the calibration process of the sensor.
  • FIG. 1 is a schematic diagram of a hardware architecture of a terminal device involved in a sensor control method of the present application
  • FIG. 2 is a schematic flowchart of the first embodiment of the sensor control method of the present application running on a first terminal;
  • FIG. 3 is a schematic flowchart of the first embodiment of the sensor control method of the present application running on a second terminal;
  • FIG. 5 is a schematic flowchart of the third embodiment of the sensor control method of the present application running on the first terminal.
  • FIG. 1 is a schematic diagram of a hardware architecture of a device involved in a sensor control method of the present application.
  • the device involved in this embodiment is a sensor
  • the sensor in this embodiment may be a motion sensor such as a gravity accelerometer, a geomagnetic sensor and/or a gyroscope, or a light sensor such as an infrared sensor, or It can be an ultrasonic sensor, or a pressure sensor, etc.
  • the device in this embodiment includes a memory 110, a processor 130, a communication interface 120, and an analog-to-digital converter 140.
  • the memory 110 can be used to control a sensor program
  • the communication interface 120 can be an I2C interface or an SPI (Serial Peripheral Interface). Interface) interface
  • the memory 110 can store the control program of the control system and the sensor.
  • the resolution of the sensor is adjusted.
  • FIG. 2 is a schematic flowchart of a first embodiment of a sensor control method of the present application.
  • the sensor control method includes:
  • Step S10 acquiring the analog data collected by the sensor
  • the sensor converts the physical effects of the detection element (such as piezoelectric effect, magnetostriction, ionization, polarization, pyroelectric, photoelectric, magnetoelectric and other effects) or chemical effects into electrical signals, and the voltage transformation of the electrical signals converts into binary data.
  • the detection element such as piezoelectric effect, magnetostriction, ionization, polarization, pyroelectric, photoelectric, magnetoelectric and other effects
  • Step S20 performing analog-to-digital conversion on the analog data according to the resolution of the sensor to obtain a detected value
  • the number of digits of the sensor can be set according to the performance of the sensor.
  • the range of the sensor, the number of digits of the sensor, and the resolution of the sensor are corresponding.
  • the number of digits of the sensor is 10, and the maximum value of the range corresponds to
  • the digital-to-analog conversion in this embodiment actually means that after converting the binary data of the analog data into decimal data, the detected value can be obtained by multiplying the decimal data by the resolution.
  • Step S30 determining that the detected value meets a preset condition, and adjusting the current reporting parameter of the sensor to a target reporting parameter, where the target reporting parameter and the current reporting parameter include at least one of resolution and range.
  • the preset condition may include any one of the following: the detected value exceeds a preset value range, and the preset data range is less than or equal to the value range corresponding to the range of the sensor; or, the detected value The ratio to the maximum detection value of the sensor is greater than the first preset ratio, and the ratio of the detection value to the minimum detection value of the sensor is smaller than the second preset ratio; or, the maximum detection value of the sensor and the The difference between the detected values is smaller than the first preset difference, and the difference between the detected value and the sensor is greater than the second preset difference.
  • the preset value range can be obtained from the range of the sensor.
  • the range of the sensor can include the upper limit value and the lower limit value.
  • the preset value range can be composed of the upper limit value and the lower limit value of the range; or, multiply the upper limit value by the first value.
  • a preset percentage (for example, 80%) obtains the maximum value of the preset value range, and the lower limit value is multiplied by a second preset percentage (eg 20%) to obtain the minimum value of the preset value range; the maximum detection value of the sensor
  • the difference from the detected value can be set as required, the maximum detected value is the upper limit of the range, the minimum detected value can be the lower limit of the range, the first preset difference and the second preset difference can be Set as required, in order to ensure that the detected value is within the range and avoid the reported data exceeding the range, the difference between the maximum detected value of the sensor and the detected value is less than the first preset difference, and the detected value and
  • the matching conditions corresponding to the difference value of the sensor being greater than the second preset difference value may include that the detected value is smaller than the maximum detected value and the detected value is greater than the minimum detected value.
  • the detected data is relatively close to the upper limit value or the lower limit value of the sensor range, and the detected value may exceed the range. range of the sensor.
  • the target reporting parameter and the current reporting parameter include at least one of resolution and range.
  • the resolution of the sensor can be adjusted first, and after the resolution is adjusted, the range can be adjusted according to the resolution. Adjustment, that is, when the resolution increases, the range of the sensor increases correspondingly, and when the resolution decreases, the range of the sensor decreases correspondingly; or you can adjust the resolution and range at the same time; or you can adjust the range first and then adjust the resolution.
  • the analog data is replaced by the analog data through the resolution to obtain the detected value. After the detected value is obtained, if the detected value satisfies the preset conditions, the parameters to be reported are explained. If adjustment is required, the reporting parameters of the sensor are adjusted. This solution can realize the adjustment of the reporting parameters in the process of data detection, which simplifies the calibration process of the sensor.
  • step S30 includes:
  • the resolution of the sensor is increased.
  • the preset numerical range is less than or equal to the numerical range corresponding to the range of the sensor, and the resolution array can be preset.
  • the resolution array can be preset.
  • the preset resolution array is sorted according to the size of the resolution. For example, when the resolution of the sensor is increased, you can search for the target adjacent to the current resolution and larger than the current resolution in the preset resolution array.
  • Resolution take the found target resolution as the adjusted resolution, and the adjustment method for reducing the resolution will not be repeated here; it is understandable that other methods can also be used to adjust the resolution process, such as setting Adjustment value, when the resolution of the sensor is reduced, the adjustment value is subtracted from the current resolution, and when the resolution of the sensor is increased, the adjustment value is increased on the basis of the current resolution.
  • step S30 includes: the ratio of the detected value to the maximum detected value of the sensor is greater than the first preset ratio, or the ratio of the detected value to the minimum detected value of the sensor is less than At the second preset ratio, step S30 includes:
  • the resolution of the sensor is increased.
  • step S30 includes:
  • the resolution of the sensor is increased.
  • the range can be adjusted correspondingly when the resolution is adjusted, and since the resolution is positively correlated with the range, the range increases when the resolution increases, and decreases when the resolution decreases.
  • step S30 includes:
  • Step S31 determining that the detected value satisfies a preset condition, and increasing the number of times that the detected value satisfies the preset condition;
  • Step S32 determine that the continuous number of times reaches a preset number of times, and adjust the current reporting parameter of the sensor to the target reporting parameter, wherein, after adjusting the current reporting parameter of the sensor, the continuous number of times is cleared;
  • step S20 it also includes steps:
  • Step S40 when the detected value does not meet the preset condition, clear the continuous number of times to zero.
  • the preset number of times is 3.
  • the first analog data is converted into the detection value 1, and the detection value 1 is compared with the preset condition, and the detection value 1 meets the preset condition. , and add 1 to the number of continuations.
  • the number of continuations is one, and no adjustment of the reported parameters will be performed; and continue to collect analog data 2, convert the analog data 2 into detection value 2, and when the detection value 2 meets the preset conditions , and add one to the number of continuations.
  • the number of continuations is 2, and the reported parameters will not be adjusted; and continue to collect analog data 3, convert the analog data 3 into the detection value 3, when the detection value 3 meets the preset conditions , and add 1 to the number of continuations.
  • the number of continuations reaches 3. Adjust the current reporting parameters of the sensor to the target reporting parameters. After adjusting the reporting parameters, clear the number of continuations to zero.
  • the analog data 3 is the continuously collected analog data.
  • the detection value When the detection value meets the preset conditions, the detection value may jump or drift due to the sudden change of the external environment. At this time, it is not necessary to adjust the resolution. Therefore, when the detection value is detected multiple times and all meet the preset conditions, it means that the sensor is indeed An exception occurs, and the resolution needs to be adjusted at this time.
  • the preset condition includes that the detected value exceeds
  • the preset value range includes after step S20:
  • Step S50 sending the detection value to the terminal device where the sensor is located or connected.
  • the terminal device Since the sensor value detected by the sensor is used for the control or display of the terminal device, for example, the terminal device counts the steps according to the detection value of the motion sensor, or obtains the light intensity according to the value detected by the light sensor, and performs corresponding control according to the light intensity. Controls and displays based on sensor values are not specifically limited.
  • step S20 the following steps are included:
  • step S40 that is, the detection value is sent to the terminal device where the sensor is located or connected.
  • the detection data may exceed the range.
  • the upper or lower limit of the range can be sent to the terminal device where the sensor is located or connected.
  • the detection value is greater than
  • the upper limit is sent to the terminal device where the sensor is located or connected.
  • the lower limit is sent to the terminal device where the sensor is located or connected.
  • the limit value of the range is sent to the device end, so as to avoid abnormal control or display of the device.
  • step S10 a schematic flowchart of the fifth embodiment of the sensor control method of the present application is proposed.
  • step S10 it further includes:
  • Step S60 detecting the initialization instruction of the sensor, configuring the resolution of the sensor as the default resolution configuration in the initialization file, and configuring the range of the sensor as the default range in the initialization file.
  • the sensor stores an initialization file, and when the sensor is abnormal or the sensor is used for the first time, the sensor can be initialized through the initialization file to configure the range and resolution.
  • the present application also proposes a terminal device, the terminal device includes a memory, a processor, and a control program of a sensor stored in the memory and running on the processor, and the control program of the sensor is executed by the processor The control method of the sensor as described in the above embodiments.
  • the present application also provides a computer-readable storage medium, where a control program of a sensor is stored on the computer-readable storage medium, and when the control program of the sensor is executed by a processor, the control method of the sensor as described in the above embodiments is implemented A step of.
  • a software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
  • RAM random access memory
  • ROM read only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)
  • Indication And Recording Devices For Special Purposes And Tariff Metering Devices (AREA)

Abstract

一种传感器的控制方法,包括:获取传感器采集的模拟数据(S10);根据传感器的分辨率对模拟数据进行模数转换以得到检测数值(S20);确定检测数值满足预设条件,将传感器的当前上报参数调整为目标上报参数,目标上报参数以及当前上报参数包括分辨率以及量程中的至少一个(S30)。在数据检测的过程中即可实现上报参数的调整,简化了传感器的校准过程。还提供一种传感器的控制装置、一种终端设备及一种计算机可读存储介质。

Description

传感器的控制方法、装置、终端设备及存储介质
本申请要求于2021年3月26日提交中国专利局、申请号为202110329903.4、发明名称为“传感器的控制方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及传感器技术领域,尤其涉及一种传感器的控制方法、装置、终端设备及存储介质。
背景技术
各类终端设备,往往需要采用传感器采集各种不同数据(例如温度、湿度、光照强度、运动数据等)。
通常,传感器采集到各种不同数据后,需要先将采集到的模拟数据进行模数转换从而转换成转换数据(数字信号),然后再将转换数据上报至终端设备。
一般来说,传感器的量程或者分辨率等上报参数是固定不变的、在不同使用环境下不会依使用环境或者所采集数据等改变。对于所采集数据的数据范围不完全在传感器的量程范围内的情况,需要对传感器的上报参数进行校准。
目前,校准传感器上报参数的过程,主要通过用户在被提示后执行固定操作进行,校准操作繁琐、不易完成。
发明内容
本申请的主要目的在于提供一种传感器的控制方法、装置、终端设备及 存储介质,旨在简化传感器的校准过程。
为实现上述目的,本申请提供一种传感器的控制方法,所述方法包括:
获取所述传感器采集的模拟数据;
根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值;
确定所述检测数值满足预设条件,将所述传感器的当前上报参数调整为目标上报参数,所述目标上报参数以及所述当前上报参数为分辨率以及量程中的至少一个。
可选地,所述预设条件包括以下任意一个:
所述检测数值与所述传感器的最大检测数值的比值大于第一预设比值,或所述检测数值与所述传感器的最小检测数值的比值小于第二预设比值;
或者,所述传感器的最大检测数值与所述检测数值的差值小于第一预设差值,或所述检测数值与所述传感器的最小检测数值的差值大于第二预设差值;
或者,所述预设条件包括所述检测数值超出预设数值范围,所述预设数值范围小于或等于所述传感器的量程对应的数值范围。
可选地,所述预设条件包括所述检测数值超出预设数值范围,所述预设数值范围小于或等于所述传感器的量程对应的数值范围;
所述确定所述检测数值满足预设条件,将所述传感器的当前上报参数调整为目标上报参数的步骤包括:
确定所述检测数值大于所述预设数值范围的最大值,减小所述传感器的分辨率;
确定所述检测数值小于预设数值范围的最小值,增大所述传感器的分辨率。
可选地,所述确定所述检测数值满足预设条件,将所述传感器的当前上报参数调整为目标上报参数的步骤包括:
确定所述检测数值满足预设条件,增大所述检测数值满足预设条件持续次数;
确定所述持续次数达到预设次数,将所述传感器的当前上报参数调整为目标上报参数,其中,在调整所述传感器的当前上报参数后,对所述持续次数清零;
所述根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值的步骤之后,所述传感器的控制方法还包括:
在所述检测数值不满足所述预设条件时,对所述持续次数清零。
可选地,所述根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值的步骤之后,所述传感器的控制方法还包括:
将所述检测数值发送至传感器所在或者连接的终端设备。
可选地,所述根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值的步骤之后,所述传感器的控制方法还包括:
判断所述检测数值是否超出所述传感器的量程;
确定所述检测数值超出所述量程,将量程的上限值或下限值发送至所述传感器所在或者连接的终端设备;
确定所述检测数值未超出所述量程,执行所述将所述检测数值发送至所述传感器所在或者连接的终端设备。
可选地,所述获取所述传感器采集的模拟数据的步骤之前,所述传感器的控制方法的步骤包括:
检测到所述传感器的初始化指令,将所述传感器的分辨率配置为初始化文件中的默认分辨率配置,并将所述传感器的量程配置为所述初始化文件中的默认量程。
此外,为实现上述目的,本申请还提出一种传感器的控制装置,所述传感器的控制装置包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的传感器的控制程序,所述传感器的控制程序被所述处理器执行时实现如以上所述的传感器的控制方法。
此外,为实现上述目的,本申请还提出一种终端设备,所述终端设备包 括传感器,其中,所述传感器包括如以上所述的传感器的控制装置。
此外,为实现上述目的,本申请还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有传感器的控制程序,所述传感器的控制程序被处理器执行时实现如以上所述的传感器的控制方法的步骤。
本申请提出的传感器的控制方法、装置、终端设备及存储介质,在传感器采集到模拟数据时,通过分辨率对模拟数据进行模数装换以得到检测数值,在得到检测数值后,如果检测数值满足预设条件,说明上报参数需要调整,则调整传感器的上报参数,该方案在数据检测的过程中即可实现上报参数的调整,简化了传感器的校准过程。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一部分附图,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请传感器的控制方法涉及的终端设备的硬件架构示意图;
图2为本申请传感器的控制方法第一实施例运行于第一终端的流程示意图;
图3为本申请传感器的控制方法第一实施例运行于第二终端的流程示意图;
图4为本申请传感器的控制方法第二实施例运行于第一终端的流程示意图;
图5为本申请传感器的控制方法第三实施例运行于第一终端的流程示意图。
本申请目的实现、功能特点及优点将结合实施例,参照附图做进一步说 明。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
参照图1,图1为本申请传感器的控制方法涉及的装置的硬件架构示意图。
如图1所示,本实施例涉及的装置为传感器,本实施例中的传感器可为运动类传感器如重力加速度计、地磁传感器及/或陀螺仪,也可为光传感器,如红外传感器,也可为超声波传感器,或者压力传感器等。
本实施例中的装置包括存储器110、处理器130、通信接口120以及模数转换器140,存储器110可传感器的控制程序,通信接口120可为I2C接口或者SPI(Serial Peripheral Interface,串行外设接口)接口,存储器110中可存储控制系统以及传感器的控制程序。
存储器110中的传感器的控制程序被处理器130执行时实现以下步骤:
获取所述传感器采集的模拟数据;
根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值;
在所述检测数值满足预设条件时,调整所述传感器的分辨率。
实施例一
参照图2,图2为本申请传感器的控制方法第一实施例的示意性流程示意图,本实施例中,所述传感器的控制方法包括:
步骤S10,获取所述传感器采集的模拟数据;
传感器将检测元件物理效应(如压电效应,磁致伸缩现象,离化、极化、热电、光电、磁电等效应)或者化学效应转换成电信号,电信号的电压变换转换为二进制数据。
步骤S20,根据所述传感器的分辨率对所述模拟数据进行模数转换以得到 检测数值;
在本实施例中传感器的位数可根据传感器的性能设置,传感器的量程、传感器的位数以及传感器的分辨率是相对应的,例如传感器的为位数为10位,则量程的最大值对应的模拟数据为1111111111,对应的最大值为1024,重力传感器的量程最大值为9.8G,则对应的分辨率可为9.8/1024=0.0096,而针对位数为8位的传感器,量程的最大值对应的模拟数据为11111111,对应的最大值为256,重力传感器的量程最大值为9.8G,则对应的分辨率可为9.8/256=0.038,故传感器的位数、量程以及分辨率是相关的,而由于传感器的位数是固定的,则传感器的量程随分辨率变化。
本实施例中的数模转换实际为将模拟数据的二进制数据转换为十进制数据后,采用十进制数据乘以分辨率即可得到检测数值。
步骤S30,确定所述检测数值满足预设条件,将所述传感器的当前上报参数调整为目标上报参数,所述目标上报参数以及所述当前上报参数包括分辨率以及量程中的至少一个。
在本实施例中,预设条件可包括以下任意一个:所述检测数值超出预设数值范围,所述预设数据范围小于或等于所述传感器的量程对应的数值范围;或者,所述检测数值与所述传感器的最大检测数值的比值大于第一预设比值,所述检测数值与所述传感器的最小检测数值的比值小于第二预设比值;或者,所述传感器的最大检测数值与所述检测数值的差值小于第一预设差值,所述述检测数值与所述传感器的差值大于第二预设差值。
预设数值范围可通过传感器的量程得到,传感器的量程可包括上限值以及下限值,该预设数值范围可由量程的上限值和下限值组成;或者,将上限值乘以第一预设百分比(例如80%)得到预设数值范围的最大值,将下限值乘以第二预设百分比(如20%)得到预设数值范围的最小值;所述传感器的最大检测数值与所述检测数值的差值可根据需要设定,最大检测数值为量程的上限值,最小检测数值可为量程的下限值,该第一预设差值以及第二预设差值可根据需要进行设定,为保证检测数值在量程内,避免上报的数据超量程,所述传感器的最大检测数值与所述检测数值的差值小于第一预设差值,所述述检测数值与所述传感器的差值大于第二预设差值对应的配合条件可包 括检测数值小于最大检测数值以及检测数值大于最小检测数值。
根据上述预设条件可知,在检测数值满足预设条件时检测数据比较接近传感器量程的上极限值或者下极限值,此时检测数值会有超出量程的可能,则通过调整分辨率避免检测数值超出传感器的量程。
本实施例中,目标上报参数以及所述当前上报参数包括分辨率以及量程中的至少一个,在本实施例中,可先调整传感器的分辨率,在分辨率调整后可根据分辨率对量程进行调整,即在分辨率增大时,传感器的量程对应增大,在分辨率减小时,传感器的量程对应减小;或者可同时调整分辨率以及量程;或者也可先调整量程再调整分辨率。
本实施例公开的技术方案中,在传感器采集到模拟数据时,通过分辨率对模拟数据进行模数装换以得到检测数值,在得到检测数值后,如果检测数值满足预设条件,说明上报参数需要调整,则调整传感器的上报参数,该方案在数据检测的过程中即可实现上报参数的调整,简化了传感器的校准过程。
实施例二
基于第一实施例提出本申请传感器的控制方法第二实施例,本实施例中,所述预设条件包括所述检测数值超出预设数值范围,步骤S30包括:
在所述检测数值大于预设数值范围的最大值时,减小所述传感器的分辨率;
在所述检测数值大于预设数值范围的最小值时,增大所述传感器的分辨率。
本实施例中所述预设数值范围小于或等于所述传感器的量程对应的数值范围,可预设分辨率数组,在增大以及减小分辨率时,可在预设非分辨率数组中查找对应的分辨率,预设分辨率数组按照分辨率的大小依次排序,例如在增大传感器的分辨率时,可在预设分辨率数组中查找与当前分辨率相邻且大于当前分辨率的目标分辨率,将查找到的目标分辨率作为调整后的分辨率,减小分辨率的调整方式同理在此不再赘述;可以理解的是,也可采用其它方式对分辨率进程调整,例如设置调整值,在减小传感器的分辨率时,在当前的分辨率的基础上减去该调整值,在增大传感器的分辨率时,在在当前的分 辨率的基础上增加该调整值。
可以理解的是,在所述预设条件包括:所述检测数值与所述传感器的最大检测数值的比值大于第一预设比值,或所述检测数值与所述传感器的最小检测数值的比值小于第二预设比值时,步骤S30包括:
在所述检测数值与所述传感器的最大检测数值的比值大于第一预设比值时,减小所述传感器的分辨率;
在所述检测数值与所述传感器的最小检测数值的比值小于第二预设比值时,增大所述传感器的分辨率。
或者,在所述传感器的最大检测数值与所述检测数值的差值小于第一预设差值,或所述检测数值与所述传感器的最小检测数值的差值大于第二预设差值时,步骤S30包括:
在所述传感器的最大检测数值与所述检测数值的差值小于第一预设差值时,减小所述传感器的分辨率;
在所述检测数值与所述传感器的最小检测数值的差值大于第二预设差值时,增大所述传感器的分辨率。
可以理解的是,在所述检测数值不满足预设条件时,保持当前的分辨率不变,对应的在保持当前分辨率不变的同时保持传感器的量程不变。
根据前述实施例可知,在调整分辨率的同时可对应调整量程,而由于分辨率与量程正相关,在分辨率增大时量程增大,在分辨率减小时量程减小。
本实施例公开的技术方案中,通过在不同条件下增大或者减小分辨率,使得分辨率的调整更加灵活。
实施例三
参照图3,在第一或第二实施例的基础上提出本申请传感器的控制方法第三实施例的示意性流程示意图,本实施例中,所述预设条件包括所述检测数值超出预设数值范围,步骤S30包括:
步骤S31,确定所述检测数值满足预设条件,增大所述检测数值满足预设条件持续次数;
步骤S32,确定所述持续次数达到预设次数,将所述传感器的当前上报参 数调整为目标上报参数,其中,在调整所述传感器的当前上报参数后,对所述持续次数清零;
步骤S20之后,还包括步骤:
步骤S40,在所述检测数值不满足所述预设条件时,对所述持续次数清零。
在本实施例中,例如预设次数为3次,在传感器采集到模拟数据一时,将模拟数据一转换为检测数值一,比对检测数值一与预设条件,在检测数值一满足预设条件时,并对持续次数加一,此时持续次数为一次,并不进行上报参数的调整;并继续采集模拟数据二,将模拟数据二转换为检测数值二,在检测数值二满足预设条件时,并对持续次数加一,此时持续次数为2次,并不进行上报参数的调整;并继续采集模拟数据三,将模拟数据三转换为检测数值三,在检测数值三满足预设条件时,并对持续次数加一,此时持续次数达到3次,将所述传感器的当前上报参数调整为目标上报参数,在调整上报参数后将持续次数清零,该模拟数据一、模拟数据二以及模拟数据三为连续采集的模拟数据。
在检测数值满足预设条件可能会出现由于外界环境突变影响出现检测数值跳变或者漂移,此时并不需要调整分辨率,故在多次检测到检测数值均满足预设条件时,说明传感器确实出现异常,此时需要进行分辨率的调整。
本实施例公开的技术方案中,通过设置满足预设条件持续次数,是的分辨率的调整更加准确,避免分辨率的调整次数过多。
实施例四
参照图4,在第一至第三任一实施例的基础上提出本申请传感器的控制方法第四实施例的示意性流程示意图,本实施例中,所述预设条件包括所述检测数值超出预设数值范围,步骤S20之后包括:
步骤S50,将所述检测数值发送至所述传感器所在或者连接的终端设备。
由于传感器检测到的传感器数值用于终端设备的控制或者显示,例如终端设备根据运动传感器的检测数值进行计步,或者根据光传感器检测到的数值获取光强度,根据光强度进行对应的控制,该根据传感器数值进行的控制和显示不做具体限定。
可以理解的是,检测数值可能会出现超出传感器量程的情况,此时步骤S20之后还包括:
判断所述检测数值是否超出所述传感器的量程;
确定所述检测数值超出所述量程,将量程的上限值或下限值发送至所述传感器所在或者连接的终端设备;
确定所述检测数值未超出所述量程,执行步骤S40即,所述将所述检测数值发送至所述传感器所在或者连接的终端设备。
在本实施例中,由于数据的波动,可能会出现检测数据超出量程的情况,此时可将量程的上限值或者下限值发送至所述传感器所在或者连接的终端设备,在检测数值大于量程的上限值时,将上限值发送至所述传感器所在或者连接的终端设备,在检测数值小于量程的下限值时,将下限值发送至所述传感器所在或者连接的终端设备。
本实施例公开的技术方案,在传感器检测的数据漂移时,将量程的极限值发送至设备端,避免设备控制或者显示异常。
实施例五
参照图5,在第一至第四任一实施例的基础上提出本申请传感器的控制方法第五实施例的示意性流程示意图,本实施例中,步骤S10之前还包括:
步骤S60,检测到所述传感器的初始化指令,将所述传感器的分辨率配置为初始化文件中的默认分辨率配置,并将所述传感器的量程配置为所述初始化文件中的默认量程。
本实施例中,传感器存储有初始化文件,在传感器异常或者传感器首次使用时可通过初始化文件对传感器进行初始化操作,以对量程以及分辨率进行配置。
本申请还提出一种终端设备,终端设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的传感器的控制程序,所述传感器的控制程序被所述处理器执行如以上实施例所述的传感器的控制方法。
本申请还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有传感器的控制程序,所述传感器的控制程序被处理器执行时实现如以上实施例所述的传感器的控制方法的步骤。
本说明书中各个实施例采用并列或者递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处可参见方法部分说明。
本领域普通技术人员还可以理解,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (10)

  1. 一种传感器的控制方法,其特征在于,所述方法包括:
    获取所述传感器采集的模拟数据;
    根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值;
    确定所述检测数值满足预设条件,将所述传感器的当前上报参数调整为目标上报参数,所述目标上报参数以及所述当前上报参数包括分辨率以及量程中的至少一个。
  2. 如权利要求1所述的传感器的控制方法,其特征在于,所述预设条件包括以下任意一个:
    所述检测数值与所述传感器的最大检测数值的比值大于第一预设比值,或所述检测数值与所述传感器的最小检测数值的比值小于第二预设比值;
    或者,所述传感器的最大检测数值与所述检测数值的差值小于第一预设差值,或所述检测数值与所述传感器的最小检测数值的差值大于第二预设差值;
    或者,所述预设条件包括所述检测数值超出预设数值范围,所述预设数值范围小于或等于所述传感器的量程对应的数值范围。
  3. 如权利要求2所述的传感器的控制方法,其特征在于,所述预设条件包括所述检测数值超出预设数值范围,所述预设数值范围小于或等于所述传感器的量程对应的数值范围;所述确定所述检测数值满足预设条件,将所述传感器的当前上报参数调整为目标上报参数的步骤包括:
    确定所述检测数值大于所述预设数值范围的最大值,减小所述传感器的分辨率;
    确定所述检测数值小于预设数值范围的最小值,增大所述传感器的分辨率。
  4. 如权利要求1-3任一项所述的传感器的控制方法,其特征在于,所述确定所述检测数值满足预设条件,将所述传感器的当前上报参数调整为目标上报参数的步骤包括:
    确定所述检测数值满足预设条件,增大所述检测数值满足预设条件持续次数;
    确定所述持续次数达到预设次数,将所述传感器的当前上报参数调整为目标上报参数,并返回执行所述获取所述传感器采集的模拟数据的步骤,其中,在调整所述传感器的当前上报参数后,对所述持续次数清零;
    所述根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值的步骤之后,所述传感器的控制方法还包括:
    确定所述检测数值不满足所述预设条件,对所述持续次数清零,并返回执行所述获取所述传感器采集的模拟数据的步骤。
  5. 如权利要求1所述的传感器的控制方法,其特征在于,所述根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值的步骤之后,所述传感器的控制方法还包括:
    将所述检测数值发送至传感器所在或者连接的终端设备。
  6. 如权利要求5所述的传感器的控制方法,其特征在于,所述根据所述传感器的分辨率对所述模拟数据进行模数转换以得到检测数值的步骤之后,所述传感器的控制方法还包括:
    判断所述检测数值是否超出所述传感器的量程;
    确定所述检测数值超出所述量程,将量程的上限值或下限值发送至所述传感器所在或者连接的终端设备;
    确定所述检测数值未超出所述量程,执行所述将所述检测数值发送至所述传感器所在或者连接的终端设备。
  7. 如权利要求1所述的传感器的控制方法,其特征在于,所述获取所述传感器采集的模拟数据的步骤之前,所述传感器的控制方法的步骤包括:
    检测到所述传感器的初始化指令,将所述传感器的分辨率配置为初始化文件中的默认分辨率配置,并将所述传感器的量程配置为所述初始化文件中的默认量程。
  8. 一种传感器的控制装置,其特征在于,所述传感器的控制装置包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的传感器的控制程序,所述传感器的控制程序被所述处理器执行时实现如权利要求1-7中任一项所述的传感器的控制方法。
  9. 一种终端设备,其特征在于,所述终端设备包括传感器,其中,所述传感器包括如权利要求8所述的传感器的控制装置。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有传感器的控制程序,所述传感器的控制程序被处理器执行时实现如权利要求1至7中任一项所述的传感器的控制方法的步骤。
PCT/CN2021/122209 2021-03-26 2021-09-30 传感器的控制方法、装置、终端设备及存储介质 WO2022198984A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110329903.4A CN112903000A (zh) 2021-03-26 2021-03-26 传感器的控制方法、装置及存储介质
CN202110329903.4 2021-03-26

Publications (1)

Publication Number Publication Date
WO2022198984A1 true WO2022198984A1 (zh) 2022-09-29

Family

ID=76109477

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/122209 WO2022198984A1 (zh) 2021-03-26 2021-09-30 传感器的控制方法、装置、终端设备及存储介质

Country Status (2)

Country Link
CN (1) CN112903000A (zh)
WO (1) WO2022198984A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112903000A (zh) * 2021-03-26 2021-06-04 歌尔光学科技有限公司 传感器的控制方法、装置及存储介质
CN114937439B (zh) * 2022-06-02 2023-10-24 歌尔股份有限公司 一种光传感器的控制方法、系统及装置

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110273172A1 (en) * 2010-05-05 2011-11-10 Austriamicrosystems Ag Sensor Arrangement and Method for Operating a Sensor Arrangement
CN102376154A (zh) * 2010-07-12 2012-03-14 罗斯蒙德公司 具有可缩放的可调范围的变送器输出
CN102844643A (zh) * 2010-04-19 2012-12-26 高通股份有限公司 动态传感器量程选择
CN105424236A (zh) * 2015-11-19 2016-03-23 南京信息工程大学 一种多量程阵列式压力传感芯片及其检测方法
CN106404244A (zh) * 2016-08-31 2017-02-15 歌尔股份有限公司 压力传感器及其信号校准方法
CN107238410A (zh) * 2017-06-19 2017-10-10 上海斐讯数据通信技术有限公司 一种可穿戴设备及信息采样方法
US10298189B1 (en) * 2017-12-15 2019-05-21 Microchip Technology Incorporated Analog-to-digital converter with autonomous gain stage and auto scaling, and related systems and methods
CN111024216A (zh) * 2019-12-24 2020-04-17 北京金迈捷科技有限公司 一种量程在线调整系统以及方法
CN112903000A (zh) * 2021-03-26 2021-06-04 歌尔光学科技有限公司 传感器的控制方法、装置及存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101603978B (zh) * 2009-07-21 2012-05-30 深圳市科陆电子科技股份有限公司 交流测试中自动量程转换方法及装置
CN101907654B (zh) * 2010-07-20 2012-07-18 西北核技术研究所 用于辐射探测的大动态微弱电流探测装置
CN102096061A (zh) * 2010-12-03 2011-06-15 华北电力科学研究院有限责任公司 一种用于电子式互感器的量程自适应校验装置
CN102768008B (zh) * 2012-07-23 2015-04-29 绍兴中轴自动化设备有限公司 Lvdt位移传感器调理电路
CN103185614B (zh) * 2013-02-13 2015-11-11 乌光 具有多量程和自动量程切换功能的差压流量变送器
CN103439379A (zh) * 2013-08-29 2013-12-11 复旦大学 一种基于电化学传感器的读出电路及读出方法
CN104410418A (zh) * 2014-12-03 2015-03-11 杭州腾振科技有限公司 一种高动态范围的模数转换电路
CN107576346B (zh) * 2017-08-31 2020-03-06 广东美的制冷设备有限公司 传感器的检测方法、装置及计算机可读存储介质
CN107907506B (zh) * 2017-11-08 2020-05-19 华东师范大学 一种宽量程和动态最佳分辨率测量含沙量的测量装置及方法

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102844643A (zh) * 2010-04-19 2012-12-26 高通股份有限公司 动态传感器量程选择
US20110273172A1 (en) * 2010-05-05 2011-11-10 Austriamicrosystems Ag Sensor Arrangement and Method for Operating a Sensor Arrangement
CN102376154A (zh) * 2010-07-12 2012-03-14 罗斯蒙德公司 具有可缩放的可调范围的变送器输出
CN105424236A (zh) * 2015-11-19 2016-03-23 南京信息工程大学 一种多量程阵列式压力传感芯片及其检测方法
CN106404244A (zh) * 2016-08-31 2017-02-15 歌尔股份有限公司 压力传感器及其信号校准方法
CN107238410A (zh) * 2017-06-19 2017-10-10 上海斐讯数据通信技术有限公司 一种可穿戴设备及信息采样方法
US10298189B1 (en) * 2017-12-15 2019-05-21 Microchip Technology Incorporated Analog-to-digital converter with autonomous gain stage and auto scaling, and related systems and methods
CN111024216A (zh) * 2019-12-24 2020-04-17 北京金迈捷科技有限公司 一种量程在线调整系统以及方法
CN112903000A (zh) * 2021-03-26 2021-06-04 歌尔光学科技有限公司 传感器的控制方法、装置及存储介质

Also Published As

Publication number Publication date
CN112903000A (zh) 2021-06-04

Similar Documents

Publication Publication Date Title
WO2022198984A1 (zh) 传感器的控制方法、装置、终端设备及存储介质
EP3183871B1 (en) Gain calibration for an imaging system
US9885620B2 (en) Pressure detecting apparatus, method of controlling the pressure detecting apparatus, and program
WO2019144303A1 (zh) 电容检测电路、触控装置和终端设备
CN102959375B (zh) 用于检测按钮的激活的算法
WO2013051198A1 (ja) 隔膜型圧力計
US9998101B2 (en) Method for controlling operation of moving average filter
KR101560051B1 (ko) 온도 감지를 갖는 아날로그-디지털 변환 회로 및 그의 전자 장치
WO2009096224A1 (ja) 差圧発信器
JP2006300748A (ja) 温度分布測定装置
US7543503B2 (en) Deformation detection sensor with temperature correction
CN110068875B (zh) 地磁传感器校准方法、移动终端及计算机可读存储介质
JP2015200633A (ja) サーミスタの温度特性補正装置及びサーミスタの温度特性補正方法
CN108627299B (zh) 压力感测装置的校正方法及其校正电路
JP2013015444A (ja) 信号処理装置、信号処理方法、及び信号処理プログラム
CN213754475U (zh) 电容传感装置和电子设备
US11451238B2 (en) Recording device and recording method
TWI679399B (zh) 晶片內建曲率校正架構及其方法
KR101098163B1 (ko) 터치 정확도 향상을 위한 정전용량 측정 장치
WO2021205942A1 (ja) 信号処理回路および荷重検出装置
KR100417114B1 (ko) 고주파 전력 측정 장치 및 방법
TWI584184B (zh) 觸控偵測裝置及觸控偵測方法
JP2001021417A (ja) 放射温度計
JP6276484B1 (ja) センサ装置及びセンサの補正方法
JP6854618B2 (ja) 温度測定装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21932593

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21932593

Country of ref document: EP

Kind code of ref document: A1