System and method for measuring target motion amount with low power consumption

文档序号:1626936 发布日期:2020-01-14 浏览:29次 中文

阅读说明:本技术 一种低功耗测量目标运动量的系统和方法 (System and method for measuring target motion amount with low power consumption ) 是由 苏鹏 骆光前 吴晓文 于 2019-09-24 设计创作,主要内容包括:本发明公开了一种低功耗测量目标运动量的系统和方法。系统包括MCU和加速度传感器,两者间通过通讯端口和中断端口连接。测试方法包括:MCU接收配置信息,配置自身和加速度传感器;配置完成后,主动进入休眠状态,等待被唤醒;加速度传感器监测目标运动情况,在目标加速度达到阈值时,唤醒MCU进行计数,过程中,MCU判断记录是否应当被输出,在判断通过后,输出所记录的数据,进入休眠以循环执行上述流程。本发明的方案,进行对达到阈值的运动状态进行计数,可以使MCU快速进入休眠状态,由于不需要读取操作,传感器无需配置较多功能,可以使禁用FIFO等功能,以最大限度降低系统功耗。非常适用于仅需大体掌握目标运动状态和靠电池长时间供电的场景。(The invention discloses a system and a method for measuring target motion quantity with low power consumption. The system comprises an MCU and an acceleration sensor which are connected through a communication port and an interrupt port. The test method comprises the following steps: the MCU receives the configuration information, and configures the acceleration sensor and the MCU; after configuration is completed, the mobile terminal actively enters a dormant state and waits to be awakened; the acceleration sensor monitors the motion condition of the target, wakes up the MCU to count when the target acceleration reaches a threshold value, judges whether the record should be output by the MCU in the process, outputs the recorded data after the judgment is passed, and enters the dormancy to circularly execute the process. According to the scheme of the invention, the motion state reaching the threshold is counted, the MCU can rapidly enter the sleep state, and the sensor does not need to be configured with more functions because reading operation is not needed, so that the functions of FIFO (first in first out) and the like can be disabled, and the power consumption of the system can be reduced to the maximum extent. The method is very suitable for scenes in which only the motion state of the target needs to be generally mastered and power is supplied by a battery for a long time.)

1. The system for measuring the target exercise amount with low power consumption is characterized by comprising an MCU and an acceleration sensor, wherein the MCU is connected with the acceleration sensor through a communication port and an interrupt port;

the MCU is configured to:

receiving configuration information, and executing initialization operation corresponding to the configuration information: configuring a first response action to an interrupt signal, and initializing the acceleration sensor through a communication port, wherein the initialization of the acceleration sensor at least comprises the configuration of an acceleration threshold;

after the initialization operation is executed and the first response action to the interrupt signal is executed, entering a dormant state;

and in a sleep state, waiting for receiving an interrupt signal sent by the acceleration sensor, and executing a first response action to the interrupt signal when the interrupt signal is received, wherein the first response action comprises: counting the target amount of motion;

judging whether the record of the target motion amount data reaches a preset condition or not, and executing a second response action when the preset condition is reached;

the acceleration sensor is configured to: receiving the initialization of the MCU; and monitoring acceleration data of target activity, and sending an interrupt signal to the MCU through the interrupt port when the detected acceleration reaches the acceleration threshold.

2. The system for measuring a target amount of motion with low power consumption of claim 1, wherein the initializing acceleration sensor further comprises:

1. configuring an acceleration sensor working mode: the lowest power consumption mode meeting acceleration measurement and acceleration threshold judgment;

2. and configuring the working frequency of the acceleration sensor.

3. Configuring an acceleration sensor function: only the acceleration monitoring and acceleration threshold determination functions are retained.

3. The system for measuring a target amount of motion with low power consumption according to claim 1, wherein the predetermined condition is: the continuous recording time for the target amount of motion reaches a predetermined length of time, or the count for the target amount of motion reaches a predetermined amount.

4. The system for measuring a target amount of motion with low power consumption of claim 3, wherein the second response action is: at least the target movement amount counted since the last execution of the second response motion is output.

5. A method for measuring a target motion amount with low power consumption, comprising:

A. initializing a system:

the MCU receives the configuration instruction and executes an initialization process:

configuring a response mechanism for an interrupt signal in a sleep state, and initializing an acceleration sensor, wherein the initialization of the acceleration sensor at least comprises the configuration of an acceleration threshold;

b, the MCU enters a sleep state and executes the following steps;

C. the acceleration sensor monitors acceleration motion data of a target, sends an interrupt signal to the MCU when the detected acceleration reaches a configured acceleration threshold value so as to wake up the MCU, and enables the MCU to execute a response mechanism to the interrupt signal, wherein the response mechanism comprises: counting the target amount of motion;

d, judging whether the record of the target motion amount data reaches a preset condition or not by the MCU, executing a third response action when the preset condition is reached, and executing E, otherwise, executing E;

E. jump to B.

6. The method for measuring a target amount of motion with low power consumption according to claim 5, wherein in A, initializing the acceleration sensor further comprises:

1. configuring an acceleration sensor working mode: the lowest power consumption mode meeting acceleration measurement and acceleration threshold judgment;

2. and configuring the working frequency of the acceleration sensor.

3. Configuring an acceleration sensor function: only the acceleration monitoring and acceleration threshold determination functions are retained.

7. The method for measuring a target quantity of motion with low power consumption according to claim 5, wherein the MCU of step D judges whether the recording of the data of the target quantity of motion meets a predetermined condition as follows: during the steps B-C, it is judged whether the continuous recording time period of the target motion amount reaches a predetermined time period, or after the target motion amount is counted in the step C, it is judged whether the count of the target motion amount reaches a predetermined amount.

8. The method of measuring a target amount of motion with low power consumption according to claim 7, wherein the third response action is: at least the target movement amount counted since the last execution of the third response motion is output.

Technical Field

The invention relates to the field of sensor monitoring, in particular to a system and a method for monitoring target motion amount with low power consumption in motion amount statistics.

Background

Conventional methods for measuring the amount of target motion include:

1. and the state of the acceleration sensor is inquired in a rapid and cyclic mode, and very detailed motion data is obtained.

2. And setting an acceleration threshold, generating interruption when the acceleration threshold exceeds the acceleration threshold, and immediately reading the state of the sensor by the MCU to obtain relatively detailed motion data.

Both the above two methods can effectively obtain more detailed motion data, but both methods have operations of querying and reading the sensor, so that no matter how the system flow is designed, the power consumption of the system is not very low, and the method is not suitable for a scene in which the battery supplies power to run for a long time, and at the same time, not all scenes need detailed motion data.

Disclosure of Invention

The invention aims to: in view of the above-mentioned existing problems, a system and method for measuring a target amount of motion with low power consumption are provided. The function of effectively monitoring the target motion quantity with extremely low system power consumption is realized.

The technical scheme adopted by the invention is as follows:

a system for measuring target exercise amount with low power consumption comprises an MCU and an acceleration sensor, wherein the MCU is connected with the acceleration sensor through a communication port and an interrupt port;

the MCU is configured to:

receiving configuration information, and executing initialization operation corresponding to the configuration information: configuring a first response action to an interrupt signal, and initializing the acceleration sensor through a communication port, wherein the initialization of the acceleration sensor at least comprises the configuration of an acceleration threshold;

after the initialization operation is executed and the first response action to the interrupt signal is executed, entering a dormant state;

and in a sleep state, waiting for receiving an interrupt signal sent by the acceleration sensor, and executing a first response action to the interrupt signal when the interrupt signal is received, wherein the first response action comprises: counting the target amount of motion;

judging whether the record of the target motion amount data reaches a preset condition or not, and executing a second response action when the preset condition is reached;

the acceleration sensor is configured to: receiving the initialization of the MCU; and monitoring acceleration data of target activity, and sending an interrupt signal to the MCU through the interrupt port when the detected acceleration reaches the acceleration threshold.

The system only counts the target motion amount, does not read detailed data of the sensor corresponding to the interruption times, and can enable the system to sleep again more quickly, thereby reducing the power consumption of the system to the maximum extent. In addition, the MCU only counts and does not need to read detailed data of the sensor, the sensor only needs the simplest function, and the functions of FIFO and the like of the sensor can be forbidden during initialization, so that the power consumption of the system is further reduced. For the monitoring data, although detailed movement data cannot be monitored, the movement data of the target reaching the threshold value can be recorded, and the movement condition of the target can be accurately and comprehensively mastered by adjusting and configuring the threshold value.

Further, the initializing the acceleration sensor further includes:

1. configuring an acceleration sensor working mode: the lowest power consumption mode meeting acceleration measurement and acceleration threshold judgment;

2. and configuring the working frequency of the acceleration sensor.

3. Configuring an acceleration sensor function: only the acceleration monitoring and acceleration threshold determination functions are retained.

By the above initialization operation, the power consumption of the sensor can be greatly reduced.

Further, the predetermined condition is: the continuous recording time for the target amount of motion reaches a predetermined length of time, or the count for the target amount of motion reaches a predetermined amount.

For outputting the recorded data, a timing or metering manner may be employed. The timing mode is awakened by a timer, and the metering mode is judged after being awakened, and both the two modes belong to low-power-consumption judging modes.

Further, the second response action is: at least the target movement amount counted since the last execution of the second response motion is output. That is, data recorded from the start of recording until the predetermined condition is reached for the first time, or from the last output until the predetermined condition is reached this time is output. After the second response action is made, the MCU may explicitly record.

The invention provides a method for measuring target motion quantity with low power consumption, which comprises the following steps:

A. initializing a system:

the MCU receives the configuration instruction and executes an initialization process:

configuring a response mechanism for an interrupt signal in a sleep state, and initializing an acceleration sensor, wherein the initialization of the acceleration sensor at least comprises the configuration of an acceleration threshold;

b, the MCU enters a sleep state and executes the following steps;

C. the acceleration sensor monitors acceleration motion data of a target, sends an interrupt signal to the MCU when the detected acceleration reaches a configured acceleration threshold value so as to wake up the MCU, and enables the MCU to execute a response mechanism to the interrupt signal, wherein the response mechanism comprises: counting the target amount of motion;

d, judging whether the record of the target motion amount data reaches a preset condition or not by the MCU, executing a third response action when the preset condition is reached, and executing E, otherwise, executing E;

E. jump to B.

According to the method, only the number of times that the target movement reaches the threshold is counted, and detailed movement data are not read and recorded, so that on one hand, the movement condition of the target can be generally mastered, on the other hand, the power consumption of the MCU and the sensor can be reduced because reading operation is not needed, and meanwhile, the MCU can quickly enter a dormant state to reduce the power consumption of the system to the maximum extent.

Further, in the step a, initializing the acceleration sensor further includes:

1. configuring an acceleration sensor working mode: the lowest power consumption mode meeting acceleration measurement and acceleration threshold judgment;

2. and configuring the working frequency of the acceleration sensor.

3. Configuring an acceleration sensor function: only the acceleration monitoring and acceleration threshold determination functions are retained.

Further, the MCU in step D determines whether the recording of the target motion amount data meets the predetermined conditions: during the steps B-C, it is judged whether the continuous recording time period of the target motion amount reaches a predetermined time period, or after the target motion amount is counted in the step C, it is judged whether the count of the target motion amount reaches a predetermined amount.

Further, the third response action is: at least the target movement amount counted since the last execution of the third response motion is output.

The terms "first", "second", "third", and the like in the present invention are only used for describing the corresponding actions distinctively, and are not specific limitations on the corresponding actions.

In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that:

1. according to the method and the system, the acceleration threshold is set, only the active state reaching the acceleration threshold needs to be counted, detailed motion data of the sensor does not need to be read, and the MCU can be enabled to rapidly enter the dormant state so as to reduce the power consumption of the system. Meanwhile, reading operation is not needed, the sensor does not need to be configured with too many functions, only detection and threshold judgment are needed, and functions of data FIFO and the like of the sensor can be forbidden during initialization, so that the power consumption of the system is reduced to the maximum extent.

2. The method and the system can master the motion condition of the target in general, and are particularly suitable for scenes without recording the motion condition of the target in detail.

3. The method and the system can keep the low power consumption state of the system for a long time, and are particularly suitable for scenes requiring a battery to supply power for a long time.

Drawings

The invention will now be described, by way of example, with reference to the accompanying drawings, in which:

fig. 1 is one embodiment of a method of measuring a target motion amount with low power consumption.

Fig. 2 is another embodiment of a method of measuring a target amount of motion with low power consumption.

Fig. 3 is a system configuration diagram.

Fig. 4 is a test result of measuring power consumption by live pig exercise amount.

Detailed Description

All of the features disclosed in this specification, or all of the steps in any method or process so disclosed, may be combined in any combination, except combinations of features and/or steps that are mutually exclusive.

Any feature disclosed in this specification (including any accompanying claims, abstract) may be replaced by alternative features serving equivalent or similar purposes, unless expressly stated otherwise. That is, unless expressly stated otherwise, each feature is only an example of a generic series of equivalent or similar features.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:无线低功耗崩塌计及其使用方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!