Sensor control method, electronic device, and storage medium

By collecting data in the sensor sleep state to obtain reference reference values ​​and adjusting the reference values ​​independently, the adaptability and measurement accuracy of the sensor in different environments is solved, and the sensor is efficiently adapted and accurately measured in multiple scenarios.

WO2025140254A1PCT designated stage expired Publication Date: 2025-07-03QUECLINK WIRELESS SOLUTIONS

Patent Information

Application Number
PCT/CN2024/142142
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-29
Filing Date
2024-12-25
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

When existing embedded devices with sensors change scenes, the original algorithm is prone to failure, resulting in inaccurate measurement results and lack of adaptability and measurement accuracy to different environments.

Method used

After the sensor enters sleep state, it collects sensor data to obtain the reference reference value, and decides whether to update based on the current reference value and reference value, so as to realize the independent adjustment of the reference value and adapt to different environments.

Benefits of technology

It improves the measurement accuracy and adaptability of sensors in different application scenarios, reduces the need for repeated development, reduces noise interference, and improves system stability and code reusability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024142142_03072025_PF_FP_ABST
    Figure CN2024142142_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of sensors. Disclosed are a sensor control method, an electronic device, and a storage medium. The sensor control method comprises: when a sensor enters a sleep state and the sleep state is kept for a first preset duration, obtaining sensing data acquired by the sensor in the sleep state of the first preset duration; on the basis of the obtained sensing data, determining a reference baseline value of the sensor; on the basis of a baseline value currently used by the sensor and the reference baseline value, determining whether the baseline value currently used by the sensor needs to be updated or not; and when it is determined that the baseline value currently used by the sensor needs to be updated, controlling the sensor to update the currently used baseline value into the reference baseline value.
Need to check novelty before this filing date? Find Prior Art

Description

Sensor control method, electronic device and storage medium CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application is based on the Chinese patent application with application number "202311868601.X" and application date of December 29, 2023, and claims the priority of the above-mentioned Chinese patent application. The entire content of the above-mentioned Chinese patent application is hereby incorporated into this application by introduction. Technical Field

[0002] The embodiments of the present application relate to the field of sensor technology, and in particular to a sensor control method, electronic device, and storage medium. Background Art

[0003] A sensor is a detection device that senses the information being measured and, according to certain rules, converts it into an electrical signal or other desired form of information output to meet the requirements of information transmission, processing, storage, display, recording, and control. Furthermore, with the development of related technologies such as automation and artificial intelligence, the application of sensors in embedded devices is becoming increasingly widespread. For example, the booming Internet of Things (IoT) technology is inseparable from the use of sensors.

[0004] However, current embedded devices with sensors are usually developed for specific and fixed application scenarios. Their internal data processing algorithms are usually relatively simple and have many vulnerabilities. Once the scenario changes, the original algorithm will become invalid and need to be redeveloped, otherwise it will lead to inaccurate measurement results. Summary of the Invention

[0005] According to some embodiments of the present application, on the one hand, the embodiments of the present application provide a method for controlling a sensor, including: after the sensor enters a sleep state and the sleep state lasts for a first preset time period, obtaining sensor data collected by the sensor in the sleep state for the first preset time period; determining a reference baseline value of the sensor based on the obtained sensor data; determining whether the baseline value currently used by the sensor needs to be updated based on the baseline value currently used by the sensor and the reference baseline value; and if it is determined that the baseline value currently used by the sensor needs to be updated, controlling the sensor to update the currently used baseline value to the reference baseline value.

[0006] According to some embodiments of the present application, on the other hand, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the sensor control method as described above.

[0007] According to some embodiments of the present application, on the other hand, embodiments of the present application further provide a storage medium storing a computer program, which implements the sensor control method as described above when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0009] FIG1 is a flow chart of a sensor control method provided in one embodiment of the present application;

[0010] FIG2 is another flow chart of a sensor control method provided in an embodiment of the present application;

[0011] FIG3 is another flow chart of a sensor control method provided in an embodiment of the present application;

[0012] FIG4 is a line chart showing the growth rate of sensor data collected by a sensor involved in a sensor control method provided in an embodiment of the present application;

[0013] FIG5 is another flow chart of a sensor control method provided in an embodiment of the present application;

[0014] FIG6 is a simplified comparison diagram of sensor output data and adopted data involved in the sensor control method provided in one embodiment of the present application;

[0015] FIG7 is a schematic structural diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0016] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, each embodiment of the present application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will appreciate that many technical details are provided in each embodiment of the present application to help readers better understand the present application. However, even without these technical details and various variations and modifications based on the following embodiments, the technical solutions claimed in the present application can still be implemented.

[0017] The following embodiments are divided for the convenience of description and should not constitute any limitation on the specific implementation of the present application. The various embodiments can be combined with each other and referenced to each other without contradiction.

[0018] In one aspect, an embodiment of the present application provides a sensor control method for an embedded device equipped with a sensor. The program implementing the sensor control method can be deployed within the controlled sensor, such as as a sensor driver, or deployed in other components of the embedded device besides the sensor, such as the embedded device's central processing unit (CPU). Details will not be detailed here. The sensor control method provided by the embodiment of the present application at least improves the sensor's measurement accuracy and adaptability to various application scenarios. After the sensor enters a sleep state and the sleep state lasts for a first preset duration, the sensor collects sensor data during the first preset duration to promptly obtain a reference baseline value appropriate for the sensor's current environment. The reference baseline value then updates the sensor's current baseline value. This enables autonomous adjustment of the sensor's baseline value under different environments, facilitating more accurate sensor measurements and improving the sensor's adaptability to different environments in different application scenarios. To facilitate understanding of the sensor control method provided by the embodiment of the present application, the following description will be combined with its various implementation processes.

[0019] In some embodiments, the flow of the sensor control method is shown in FIG1 , and includes the following steps:

[0020] Step 101 : After the sensor enters a sleep state and the sleep state lasts for a first preset time, sensor data collected by the sensor in the sleep state for the first preset time is acquired.

[0021] Step 102: Determine a reference value of the sensor based on the acquired sensor data.

[0022] Step 103: Determine whether the reference value currently used by the sensor needs to be updated based on the reference value currently used by the sensor and the reference reference value.

[0023] Step 104 : When it is determined that the reference value currently used by the sensor needs to be updated, the sensor is controlled to update the reference value currently used to a reference reference value.

[0024] In this way, after the sensor enters a sleep state and remains in this sleep state for a first preset duration, the sensor uses the sensor data collected during the first preset duration to promptly obtain a reference baseline value appropriate for the sensor's current environment, thereby updating the sensor's current baseline value using the reference baseline value. This enables autonomous adjustment of the sensor's baseline value in different environments, eliminating the need for repeated development for different environments. This helps the sensor suppress noise, achieve more accurate measurements, and improve its adaptability to different environments in different application scenarios. It also improves the reusability of sensor-related code and the stability of the system in which the sensor resides.

[0025] To facilitate those skilled in the art to better understand the control method of the sensor shown in FIG1 , the steps thereof will be further described below.

[0026] In step 101, the first preset duration can be set according to different application scenarios and the measurement characteristics of the sensor. For example, when the environment in the application scenario of the sensor changes frequently, the first preset duration can be set to a shorter duration, such as 10 minutes, so that the baseline value can be updated sensitively, efficiently and timely to avoid omissions of environmental changes; or, when there is changing noise in the application scenario of the sensor, the first preset duration can be set to a longer duration, such as 1 hour, so that the noise characteristics in the environment can be more accurately determined by observing the noise for a long time, thereby determining a more accurate reference baseline value and achieving a more accurate baseline value update; or, when the sensor measurement is relatively sensitive, the first preset duration can be set to a shorter duration, such as half an hour, so that the baseline value can be updated sensitively and efficiently to obtain more accurate sensor data.

[0027] In some embodiments, for step 101, the sensor can be considered to have two working states, namely, an active state and a sleep state. In the sleep state, the sensor does not stop measuring, but rather reduces the frequency of measurement (i.e., the frequency of external sampling). That is, the frequency of measurement performed by the sensor in the active state and the sleep state is different. Specifically, the frequency of measurement performed by the sensor in the active state is greater than the frequency of measurement performed by the sensor in the sleep state. For example, when the sensor is an accelerometer, the frequency of measurement performed in the active state is 1600 Hz, and the frequency of measurement performed in the sleep state is 12.5 Hz.

[0028] In this way, by setting a sleep state for the sensor, when the sensor does not need to keep measuring (such as the embedded device where the sensor is located remains stationary, the accelerometer in the sensor no longer needs to keep measuring, etc.), the sensor can reduce the frequency of measurement by entering the sleep state to reduce power consumption and save resources. At the same time, the sensor can also maintain the measurement operation instead of completely stopping the measurement, so as to timely perceive the need to switch to the active state and efficiently switch to the active state.

[0029] The sensor's transition between the active state and the sleep state can be determined autonomously by the sensor or achieved under sensor control. That is, in some embodiments, the sensor control method may further include the following steps to achieve the sensor's transition from the active state to the sleep state, as shown in FIG2 :

[0030] Step 105: monitor the sensor data collected by the sensor.

[0031] Step 106 : When it is detected that the growth rate of the sensor data collected by the active sensor is continuously less than the third threshold value within the second preset time period, the active sensor is controlled to enter the sleep state.

[0032] In this way, the sensor in the active state will enter the sleep state only when the collected sensor data is continuously less than the third threshold value within the second preset time period, instead of being controlled to enter the sleep state when the collected sensor data is less than the third threshold value. By setting the second preset time period, a buffer time is reserved for the decision to enter the sleep state, thereby ensuring the accuracy of the decision to switch the sensor from the active state to the sleep state based on sufficient data support, avoiding misjudgment caused by abnormal sensor data or environmental interference, and helping to improve the accuracy of controlling the switching of the sensor from the active state to the sleep state, and can ensure the real-time and low power consumption of the sensor measurement.

[0033] Of course, the sensor can also switch from the sleep state to the active state. For example, in some embodiments, the process of the sensor control method can also be shown in Figure 3, and further include the following steps:

[0034] Step 107 : When it is detected that the growth rate of the sensor data collected by the sensor in the sleep state is continuously greater than the third threshold value within a fourth preset time period, the sensor in the sleep state is controlled to enter the active state.

[0035] In some cases, the growth rate is represented by the difference between the sensor data at two adjacent sampling moments. In some cases, the growth rate can also be represented by the slope of a fitted curve of the sensor data, based on the average value, median, etc. over a certain period of time. Of course, the above are only examples and will not be listed here one by one.

[0036] In this way, a sensor in a sleep state will enter a sleep state when the collected sensor data is continuously less than the fourth threshold value within the third preset time period, instead of being controlled to enter a sleep state when the collected sensor data is less than the fourth threshold value. By setting the third preset time period, a buffer time is reserved for the decision to enter the sleep state, thereby ensuring the accuracy of the decision to switch from the sleep state to the active state based on sufficient data support, avoiding misjudgment caused by abnormal sensor data or environmental interference, and helping to improve the accuracy of controlling the sensor to enter the active state from the sleep state, and can ensure the real-time and low power consumption of sensor measurements.

[0037] Of course, if the growth rate of the sensor data collected by the active sensor is not monitored to be continuously less than the third threshold within the second preset time period, and the growth rate of the sensor data collected by the sleeping sensor is not monitored to be continuously greater than the third threshold within the fourth preset time period, the sensor does not need to change its working state and does not need to take action.

[0038] To facilitate those skilled in the art to better understand the control method of the sensor shown in FIG. 2 and FIG. 3 , the steps thereof will be explained below.

[0039] In step 106, in some examples, the third threshold value may be determined by the following expression:

[0040] The third threshold = the reference currently used by the sensor + (k1*first noise coefficient);

[0041] Wherein, k1 is a preset value, the value range of the first noise coefficient is [1, 2], and the first noise coefficient is related to the switching of the sensor between the active state and the sleep state.

[0042] In step 107, in some examples, the fourth threshold value may be determined by the following expression:

[0043] Fourth threshold value = reference value currently used by the sensor + (k2*second noise coefficient);

[0044] Wherein, k2 is a preset value, the value range of the second noise coefficient is [1, 2], and the second noise coefficient is related to the switching of the sensor between the active state and the sleep state.

[0045] It should be noted that the ranges for the first and second noise coefficients are primarily based on the inevitable presence of noise in the environment. However, excessive noise is required, as otherwise the sensor will be unable to distinguish valid information from noise, and thus will not be able to achieve reliable measurements based on valid information. In some cases, the ranges for the first and second noise coefficients can be further expanded or narrowed based on specific application scenarios, energy requirements, hardware performance, and other factors. These are not listed here.

[0046] It should be noted that the initial values ​​of the third and fourth thresholds and / or the degree of correlation with the switching of the sensor between the active state and the sleep state can be the same or different. When the initial values ​​of the third and fourth thresholds and the degree of correlation with the switching of the sensor between the active state and the sleep state are the same, the threshold update process can be simplified, the workload can be reduced, and power consumption can be saved. When the initial values ​​of the third and fourth thresholds and / or the degree of correlation with the switching of the sensor between the active state and the sleep state are different, the value setting method of the third and fourth thresholds can be adapted to the characteristics of the active state and the sleep state, respectively, thereby facilitating simultaneous real-time measurement and low power consumption.

[0047] It should also be noted that "k1" and "k2" in the above expressions represent the allowable noise values. Their specific values ​​will vary with the type of sensor, measurement principle, etc. Taking the accelerometer as an example, k1=k2=40, where the value "40" is an empirical value. Of course, the specific values ​​of k1 and k2 can be further determined based on the specific application scenario, energy consumption requirements, hardware performance, etc., which will not be repeated here.

[0048] In addition, the above-mentioned specific determination expressions for the third threshold value and the fourth threshold value are only examples. In some examples, the third threshold value and the fourth threshold value can also be preset fixed values, or the third threshold value and the fourth threshold value can be the result of multiplying the reference value currently used by the sensor by a certain ratio, etc., which will not be described one by one here.

[0049] To help those skilled in the art better understand how the first and second noise coefficients are determined, the following uses the first noise coefficient as an example for illustration. The first and second noise coefficients are determined in roughly the same manner, differing primarily in their possible initial values ​​and their degree of positive correlation with the duration of the sensor's active state. Therefore, the second noise coefficient will not be further illustrated here.

[0050] Assume that the initial value of the first noise coefficient is 1. That is, each time the embedded device starts, the first noise coefficient will be initialized to 1. Then, each time the sensor cannot enter the sleep state for 18 consecutive hours, the first noise coefficient will increase by 0.1 until the first noise coefficient increases to 2. The increase in the first noise coefficient will stop, and an alarm will be issued if the sensor cannot enter the sleep state for 18 consecutive hours again.

[0051] Of course, the relevant values ​​in the above example are for illustration only. In other examples, other values ​​may be selected. For example, the value of each increase in the first noise coefficient may be 0.05, 0.12, etc., which will not be described in detail here.

[0052] Furthermore, it is understood that while a sensor can have two operating states, since the frequency of measurements in the sleep state is lower than that in the active state, the sleep state is more likely to miss relevant information about the measurement target than the active state. Therefore, when the measurement accuracy requirements for the sleep and active states are the same, the decision to enter the sleep state from the active state should be more accurate than the decision to enter the active state from the sleep state. Based on this, in some cases, the second preset duration is greater than the third preset duration. In other words, compared to entering the active state from the sleep state, the decision to enter the sleep state from the active state has a longer duration reserved for the decision, and is based on more data, resulting in a higher accuracy decision to enter the sleep state from the active state.

[0053] For example, in some cases, the second preset duration has a value range of (1000ms, 6000ms), and the third preset duration has a value range of (20ms, 1000ms).

[0054] It should also be noted that the measurement data of a sensor may be multidimensional, such as the output data of a three-axis acceleration sensor is three-dimensional. The third threshold and the fourth threshold can be one-dimensional data, for example, the third threshold is 1.2, or the third threshold (1.2, 2, 1) can also be multi-dimensional data, such as the fourth threshold is (1, 1, 1), or the fourth threshold is 3.5. Accordingly, the growth rate of the sensor data collected by the active sensor is continuously less than the third threshold within the second preset time period, which can be that the growth rate of the sensor data collected by the active sensor in each dimension is continuously less than the third threshold (one-dimensional data) within the second preset time period, or the growth rate of the sensor data collected by the active sensor in each dimension is continuously less than the corresponding dimension in the third threshold within the second preset time period, or the growth rate of at least one dimension of the sensor data collected by the active sensor is continuously less than the third threshold (one-dimensional data) within the second preset time period. Of course, the above is only an example. According to different application scenarios, different requirements, different hardware capabilities, etc., the relevant settings can be different, and they will not be described here one by one.

[0055] To help those skilled in the art better understand the transition process between the sleep and active states of an accelerometer, the following explanation will be provided with reference to the acceleration data collected by the accelerometer, as shown in Figure 4. The points in the acceleration data graph in Figure 4 represent the following: the horizontal axis represents the corresponding sensor sampling moment, the vertical axis represents the acceleration value collected by the sensor at the corresponding sampling moment minus the acceleration value at the previous sampling moment, the third threshold = the fourth threshold = the absolute value of the wake-up threshold shown in Figure 4, and "-" represents the subtraction operator.

[0056] As shown in Figure 4, at time T0, the accelerometer is active and measures at a frequency of 100 Hz;

[0057] From time T0 to time T1, the growth rate of the sensing data collected by the acceleration sensor is always greater than the wake-up threshold. Therefore, the acceleration sensor remains active from time T0 to time T1.

[0058] At time T1, the acceleration sensor, while in the active state, collects sensor data whose growth rate falls below the wake-up threshold for the first time, potentially entering the sleep state. Monitoring begins to determine whether the growth rate remains below the wake-up threshold for a second preset duration. At this point, the accelerometer remains in the active state.

[0059] From time T1 to time T2, the growth rate of the sensor data collected by the acceleration sensor is less than the wake-up threshold for a second preset time period. Therefore, the sensor will be controlled to enter the sleep state at time T2. Before time T2, the acceleration sensor remains active.

[0060] From time T2 to time T3, the growth rate of the sensor data collected by the acceleration sensor continues to be less than the wake-up threshold, so the acceleration sensor remains in the sleep state.

[0061] At time T3, the acceleration sensor, while in the sleep state, collects data at a rate exceeding the wake-up threshold for the first time, potentially entering the active state. Monitoring begins to determine whether the rate exceeding the wake-up threshold persists for a third preset duration. At this point, the accelerometer remains in the sleep state.

[0062] From time T3 to time T4, the growth rate of the sensor data collected by the acceleration sensor is greater than the wake-up threshold for a third preset time period. Therefore, the sensor will be controlled to enter the active state at time T4. Before time T4, the acceleration sensor remains in the sleep state.

[0063] After time T4, the growth rate of the sensor data collected by the acceleration sensor continues to be greater than the wake-up threshold, so the acceleration sensor remains active.

[0064] It should be noted that the time delay between the instruction for controlling the sensor to switch the working state and the response of the sensor is not shown in FIG4 for ease of understanding, but it does not mean that it does not exist, and it will not be described here one by one.

[0065] In step 102, in some examples, determining a reference baseline value of the sensor based on the acquired sensor data can be achieved by determining the mean and variance of the acquired sensor data; and when the variance value is less than a second threshold, determining the mean as the reference baseline value.

[0066] It's understandable that sensors are generally considered to enter a sleep state when measurements are not needed. For example, when an embedded device is stationary, there's no need for acceleration measurement, so the accelerometer can enter a sleep state. However, this sleep state doesn't necessarily mean the collected sensor data is zero. This is because of environmental noise and interference within the embedded device. In other words, the sensor data collected by a sensor in the sleep state can be considered a baseline value reflecting noise. Subsequent sensor data collected can be removed by removing the baseline value to obtain true sensor data free of noise interference.

[0067] Therefore, the average value of the sensor data collected by the sensor in the sleep state of the first preset time period can be used to accurately determine the reference baseline value through observation of the first preset time period, which is conducive to accurately updating the baseline value used by the sensor.

[0068] Furthermore, by using the condition that the variance value is less than the second threshold, abnormal data in the sleep state can be excluded, which can further improve the accuracy of the reference baseline value, thereby facilitating a more accurate update of the baseline value used by the sensor.

[0069] In addition, the condition that the variance value is less than the second threshold as described above is used to exclude abnormal data in the sleep state. Therefore, the selection of the second threshold should reflect whether abnormal data occurs in the sleep state. Taking the accelerometer as an example, the value range of the second threshold is (32mg, 128mg), where g represents gravity acceleration and mg represents milligravity acceleration. Assuming that the gravity acceleration is 9.8m / s 2 , then 1mg=0.0098m / s 2 .

[0070] Of course, the above is only an implementation example of step 102. In some embodiments, step 102 can also be implemented by other means (such as using other statistical data or data processed by other means to replace the above mean and variance, etc.), which will not be listed here one by one.

[0071] In step 103, in some examples, determining whether the reference value currently used by the sensor needs to be updated based on the reference value currently used by the sensor and the reference reference value can be achieved as follows: determining the difference between the reference value currently used by the sensor and the reference reference value; and determining whether the difference is greater than a first threshold to determine whether the reference value currently used by the sensor needs to be updated.

[0072] When the difference is greater than a first threshold, it is determined that the reference value currently used by the sensor needs to be updated; when the difference is less than or equal to the first threshold, it is determined that the reference value currently used by the sensor does not need to be updated.

[0073] It is also understandable that when the reference baseline value is not much different from the baseline value currently used by the sensor, the baseline value currently used by the sensor may not be updated to reduce resource waste and cumbersome procedures caused by updating the baseline value currently used by the sensor.

[0074] That is to say, by using the condition that the difference between the reference value currently used by the sensor and the reference reference value is less than the first threshold value, it is determined whether the reference value currently used by the sensor needs to be updated. This can reduce the number of updates of the reference value currently used by the sensor without basically affecting the measurement accuracy, reduce energy consumption, and save resources.

[0075] Furthermore, as described above, the condition that the difference between the sensor's current baseline value and the reference baseline value is less than the first threshold is used to determine whether the sensor's current baseline value needs to be updated. Therefore, the selection of the first threshold should reflect whether the sensor's current baseline value needs to be updated. For example, using an accelerometer as an example, the first threshold has a value range of (3 mg, 20 mg), where g represents the acceleration due to gravity.

[0076] Of course, the above is only an implementation example of step 103. In some embodiments, step 103 can also be implemented by other means (such as using a reference benchmark value obtained by other processing methods to determine whether to update the currently used benchmark value based on the processing results, etc.), which will not be listed one by one here.

[0077] Based on steps 101 to 104 provided in the above embodiment, in some embodiments, as shown in FIG5 , the process of the sensor control method may further include the following steps:

[0078] Step 108 : Control the sensor to output the statistical value of the collected sensor data at a preset frequency, where the preset frequency is less than the sampling frequency of the sensor.

[0079] By setting the preset frequency lower than the sensor's sampling frequency, the sensor reports data less frequently than its original sampling frequency. By outputting the statistical values ​​of the collected sensor data at the preset frequency, the data reported by the sensor reflects the sensor's sampled data without causing any loss. This reduces the processing pressure on the sensor's upper-layer applications, alleviating the algorithmic computation burden on these applications, and conserving the storage space required for sensor uploads to applications without compromising measurement accuracy.

[0080] To facilitate those skilled in the art to better understand the above effects, the following will be described with reference to FIG6 .

[0081] In FIG6 , period T is the data output frequency of the sensor, and period T satisfies: period T * preset frequency = 1. Furthermore, the hollow points in FIG6 are the output data of the sensor in the sensor control method shown in FIG5 , and the solid points are the sensor data obtained by the sensor at the sampling frequency in the sensor control method shown in FIG5 .

[0082] If the sensor directly outputs sampled data, the upper-layer application receives data represented by solid dots. If the sensor outputs data using the control method shown in Figure 5, the upper-layer application receives data represented by hollow dots. Clearly, the latter approach yields less data. Furthermore, since the hollow dots reflect the solid dots within period T, data loss is avoided, maintaining the sensor's measurement sensitivity.

[0083] To facilitate those skilled in the art to better understand the sensor control method shown in Figure 5, the steps are explained below. Steps 103 and 104 have been described above and will not be repeated here.

[0084] In step 108, the statistical value includes at least one of the following information: mean, peak, variance, and extreme value. The statistical value is the statistical value of the data obtained by dividing the sensor data collected within a period T by the currently used reference value, where period T*preset frequency=1. For example, the mean is ((x1-b)+(x2-b)+…+(xn-b)) / n, where x1, x2,…, xn are the sensor data collected within a period T, n is the number of sensor data collected within a period T, and b is the currently used reference value. When the value of at least one of x1, x2,…, xn is greater than the currently used reference value b, the peak value includes max(x1, x2,…, xn)-b. When the value of at least one of x1, x2,…, xn is less than the currently used reference value b, the peak value includes min(x1, x2,…, xn)-b. Max(A) represents the maximum value of the data in A, and min(B) represents the minimum value of the data in B. The rest of the statistical values ​​will not be described in detail.

[0085] It should be noted that FIG5 is only an example. In some examples, step 108 may be executed simultaneously with (or before or after) any of steps 101 to 107 provided in the aforementioned related embodiments, and will not be described in detail here.

[0086] It should also be noted that in the above-mentioned different embodiments, the steps with the same labels are roughly the same. The main difference lies in the different combinations of the relevant steps in different embodiments. However, the above-mentioned embodiments are only examples provided for ease of understanding. In some embodiments, two or more of the above-mentioned embodiments can also be combined with each other, which will not be described one by one here.

[0087] The steps of the various methods above are divided only for the purpose of clear description. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0088] On the other hand, an embodiment of the present application further provides an electronic device, as shown in Figure 7, including: at least one processor 701; and a memory 702 communicatively connected to the at least one processor 701; wherein the memory 702 stores instructions that can be executed by the at least one processor 701, and the instructions are executed by the at least one processor 701 to enable the at least one processor 701 to execute the sensor control method described in any of the above method embodiments.

[0089] The memory 702 and processor 701 are connected using a bus. The bus may include any number of interconnected buses and bridges, connecting various circuits of one or more processors 701 and memory 702. The bus may also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and are therefore not described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor 701 is transmitted over a wireless medium via an antenna. Furthermore, the antenna receives data and transmits it to the processor 701.

[0090] The processor 701 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 702 can be used to store data used by the processor 701 when performing operations.

[0091] Another aspect of the present application further provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the sensor control method provided by any of the above method embodiments.

[0092] That is, those skilled in the art will understand that all or part of the steps in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a program, which is stored in a storage medium and includes a number of instructions for causing a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.

[0093] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and that in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.

Claims

1. A control method for a sensor, comprising: After the sensor enters the sleep state and the sleep state lasts for a first preset duration, acquiring the sensing data collected by the sensor in the sleep state during the first preset duration; Determining a reference baseline value of the sensor according to the acquired sensing data; Determining whether to update the baseline value currently adopted by the sensor according to the currently adopted baseline value of the sensor and the reference baseline value; When it is determined that the baseline value currently adopted by the sensor needs to be updated, controlling the sensor to update the currently adopted baseline value to the reference baseline value.

2. The control method of the sensor according to claim 1, wherein, The determining whether to update the baseline value currently adopted by the sensor according to the currently adopted baseline value of the sensor and the reference baseline value includes: Determining the difference between the currently adopted baseline value of the sensor and the reference baseline value; Determining whether the difference is less than a first threshold to determine whether to update the baseline value currently adopted by the sensor.

3. The control method of the sensor according to claim 1 or 2, wherein, The determining a reference baseline value of the sensor according to the acquired sensing data includes: Determining the mean value and variance of the acquired sensing data; When the value of the variance is less than a second threshold, determining the mean value as the reference baseline value.

4. The control method of the sensor according to any one of claims 1 to 3, wherein, Before acquiring the sensing data collected by the sensor in the sleep state during the first preset duration, the method further includes: Monitoring the sensing data collected by the sensor; When it is monitored that the growth rate of the sensing data collected by the sensor in the active state continuously is less than a third threshold within a second preset duration, controlling the sensor in the active state to enter the sleep state, where the growth rate is represented by the difference between the sensing data at two adjacent sampling moments.

5. The control method of the sensor according to claim 4, wherein, After monitoring the sensing data collected by the sensor, the method further includes: When it is monitored that the growth rate of the sensing data collected by the sensor in the sleep state continuously is greater than a fourth threshold within a third preset duration, controlling the sensor in the sleep state to enter the active state.

6. The control method of the sensor according to claim 5, wherein, The third threshold is determined by the following expression: The third threshold = the currently adopted baseline value of the sensor + (k1 * the first noise coefficient); The fourth threshold is determined by the following expression: The fourth threshold = the currently adopted baseline value of the sensor + (k2 * the second noise coefficient); Wherein, k1 and k2 are preset values, the value ranges of the first noise coefficient and the second noise coefficient are both [1, 2], and the first noise coefficient and the second noise coefficient are related to the switching situation of the sensor between the active state and the sleep state.

7. The control method of the sensor according to claim 5 or 6, wherein, The second preset duration is greater than the third preset duration.

8. The control method of the sensor according to any one of claims 1 to 7, wherein, The method further includes: Controlling the sensor to output the statistical value of the collected sensing data at a preset frequency, where the preset frequency is less than the sampling frequency of the sensor, and the statistical value includes at least one of the following information: mean value, peak value, variance, extreme value.

9. An electronic device, comprising: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the control method of the sensor according to any one of claims 1 to 8.

10. A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the control method of the sensor according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Drowning detection method and device based on multi-sensor detection and GNSS positioning

    CN110824504A

  • Pressure adaptive calibration method, terminal equipment and readable storage medium

    CN114076657A

  • Sensor control method, electronic equipment and storage medium

    CN117835382A

  • Apparatus and method for reducing noise of vehicle hands-free

    KR1020140044708A

  • Shake detection device and shake correction device of imaging device, imaging device, and shake detection method

    US20190260936A1

Cited By

  • Method for carrying out data transmission according to self-adaptive period, sending end and acquisition end

    CN120881708A