Mobile phone step counting system and method
Technical Field
The present invention relates to a mobile phone, and more particularly, to a system and method for counting steps of a mobile phone.
Background
Walking is a simple and effective exercise, and the pedometer is a simple instrument capable of recording the total steps, effective time, calories consumed, fat consumed and historical records of daily walking, so that a user can visually see various data about the exercise after a period of walking.
Mobile phones have components such as a CPU, a memory, a display, and a keyboard, and can transmit various information such as voice, text, and images, and have become the main communication tools of today. However, the existing mobile phone does not have the function of step counting measurement, so that people cannot calculate the calorie value which needs to be consumed every day and the required walking quantity or distance through the mobile phone, and cannot clearly count the quantity of exercise every day through the mobile phone, and therefore, the people cannot exercise purposefully. And the user is inconvenient to carry the pedometer and the mobile phone at the same time.
The utility model patent of the publication number CN 2874950Y, publication date 2007, 2, month 28 discloses a mobile phone with step counting function. It includes CPU, memory, display and keyboard connected with CPU, and electronic pedometer connected with CPU. By integrating the electronic pedometer into the mobile phone, standard values of heat consumption required every day can be stored in the memory without influencing the normal use of the mobile phone, and meanwhile, walking or running exercise results are recorded and displayed on the display.
An invention patent application with application publication number CN 103997572 a, application publication date 2014, 8, 20 discloses a step counting scheme and device based on mobile phone acceleration sensor data. A large amount of data of different environments and different users are collected through an acceleration sensor carried by the mobile phone, the data are used as samples to process the data, characteristics of the data are obtained to establish a mathematical model, and then the accuracy rate of step counting in different states is tested according to the data model, so that the effect of accurate step counting is achieved.
In the prior art, a step counting system based on a mobile phone is shown in fig. 1, wherein a step counting sensor device is connected with a mobile phone CPU, and the mobile phone CPU supplies power to the step counting sensor. Therefore, the mobile phone is firstly required to be powered on, and the step-counting sensor can normally work after the CPU of the mobile phone starts to operate. And the calculation result of the step-counting sensor also needs to be written into a mobile phone memory for storage through a mobile phone CPU. Therefore, when the mobile phone is manually turned off by a user or the mobile phone is actively turned off without power, the step counter sensor has no way to work.
Based on the mobile phone step counting system in the prior art, the walking steps of the user are not counted and counted into the total steps in the mobile phone power-off state, and even if the step counting scheme such as CN 103997572 a is adopted to improve the counting of the step counting data accurately, the step counting in the same day is inaccurate due to the missing of the step counting data in the power-off time period. Then the calculation of heat consumption, alarm reminding, health assessment and the like on the mobile phone based on the walking steps of the user are meaningless.
Disclosure of Invention
In order to solve the technical problems, the invention provides a mobile phone step counting system, which comprises a step counting sensing module, a power supply module, a step counting processing module and a storage module; in the power-off state of the mobile phone: the power supply module supplies power to the step counting sensing module, the step counting processing module and the step counting storage module, and the step counting processing module calculates the shutdown step number according to the detection data from the step counting sensing module and stores the shutdown step number in a nonvolatile storage unit of the storage module; after the mobile phone is powered on, the mobile phone processor reads the power-off step number stored in the storage module and updates the walking step number of the user.
Preferably, the power supply module comprises a backup battery; the standby battery can be charged through the mobile phone battery, and supplies power to the step counting sensing module, the step counting processing module and the step counting storage module when the mobile phone battery cannot supply power.
Preferably, the power supply module comprises a voltage division unit and a switching unit; the switching unit comprises a first input end connected with the voltage division unit, a second input end connected with the standby battery and a control input end, and the voltage division unit is used for converting a high-voltage power supply from the mobile phone battery into a low-voltage power supply and outputting the low-voltage power supply to the first input end; and the switching unit outputs the power supply input by the first input end or the second input end according to the control signal input by the control input end.
Preferably, the switching unit outputs the power of the second input terminal when the control input terminal inputs a high level; the switching unit outputs the power supply of the first input end when the control input end inputs a low level; the backup battery is connected to the control input.
Preferably, the step counting processing module clears the shutdown step number when the real-time is 24 points according to the time information input by the real-time clock module of the mobile phone; and the power supply module supplies power to the real-time clock module in a mobile phone power-off state.
Preferably, the step counting processing module calculates the number of shutdown steps according to the detection data from the step counting sensing module and stores the number of shutdown steps and the recording time in a nonvolatile storage unit of the storage module; the mobile phone processor reads the shutdown step number stored in the storage module after the mobile phone is started, and if 24 points do not cross the real-time and the recording time, the shutdown step number and the walking step number of the user are added to be used as a new walking step number of the user; and if 24 points are crossed between the real-time and the recording time, taking the shutdown step number as the new walking step number of the user.
The invention also provides a mobile phone step counting method suitable for the mobile phone step counting system, which is characterized by comprising the following steps:
step S01, in the power-off state of the mobile phone, the step counting processing module calculates the number of power-off steps according to the detection data from the step counting sensing module and stores the number of power-off steps to the nonvolatile storage unit of the storage module;
step S02, after the mobile phone is powered on, the mobile phone processor reads the power-off step number stored in the storage module and updates the walking step number of the user.
Preferably, the method further includes step S03, when the mobile phone is turned on, the mobile phone processor calculates and stores the number of steps taken by the user according to the detection data from the step-counting sensing module.
Preferably, in step S01, the step counting module clears the number of shutdown steps when the real-time is 24 o' clock, according to the real-time input by the real-time clock module of the mobile phone.
Preferably, in step S01, the step counting module stores the shutdown step count and the recording time in a nonvolatile storage unit of the storage module;
in step S02, the mobile phone processor reads the shutdown step number and the recording time stored in the storage module; if no 24 points are crossed between the real-time and the recording time, adding the shutdown step number and the walking step number of the user to be used as a new walking step number of the user; and if 24 points are crossed between the real-time and the recording time, taking the shutdown step number as the new walking step number of the user.
Drawings
FIG. 1 is a diagram of a prior art cell phone pedometer system.
Fig. 2 is a diagram of a mobile phone step counting system according to a first embodiment of the present invention.
Fig. 3 is a diagram of a mobile phone step counting system according to a second embodiment of the present invention.
Fig. 4 is a system diagram of the power supply module in fig. 2 and 3.
Fig. 5 is a system diagram of the switching unit in fig. 4.
Detailed Description
The following specific examples are given by way of illustration only and not by way of limitation, and it will be apparent to those skilled in the art from this disclosure that various changes and modifications can be made in the examples without inventive faculty, and yet still be protected by the scope of the claims.
Example one
The step counting system in the mobile phone of this embodiment further includes a step counting sensing module, a power supply module, a step counting processing module, and a storage module in addition to the mobile phone body.
The step-counting sensing module can be an acceleration sensor or a gravity sensor and is used for sensing the motion state of the user. In the embodiment, the acceleration sensor is adopted to convert the unique conversion of the user in the vertical direction into a level signal. Specifically, a MEMSIC acceleration sensor that employs thermodynamic standoff to detect changes in velocity may be employed.
The step-counting processing module is a DSP coprocessor in the mobile phone. Compared with the CPU of the mobile phone, the function of the mobile phone is single, and the mobile phone has no strong operation processing capability like the CPU of the mobile phone. However, the step counting operation in the invention is enough, and the DSP coprocessor can reduce the power consumption of the step counting. And the calculation processing module is used for receiving the level signal output by the MEMIC acceleration sensor, and performing filtering processing and sampling processing on the obtained level signal to obtain a useful value signal. Analyzing the value signal to obtain the gradient change of the value signal; and calculating the step number according to the gradient change and the duration of the signal and writing the calculation result into a storage module.
And a storage module containing a nonvolatile storage unit such as a FLASH memory.
And the power supply module comprises a standby battery, a voltage division chip connected to the mobile phone battery and a switching unit. Both the memic acceleration sensor and DSP coprocessor and memory need to provide a nominal voltage to enable them to operate. The rated voltage is usually 2.8V, which cannot be too high or lower than the voltage, so as to ensure the normal operation of each module chip. The output voltage of the mobile phone battery is usually 4V, and the output voltage cannot be directly used as the output of the power supply module to be provided for a chip module, but the voltage higher than 2.8V needs to be divided by the voltage dividing chip to be stabilized at 2.8V. The power supply module is connected to a mobile phone battery, the mobile phone battery supplies power to the voltage division chip, and the voltage division chip needs voltage input of more than 2.8V to provide 2.8V undetermined output. When the input voltage is less than 2.8V, the internal is an automatic open circuit and outputs 0V. The standby battery is connected to the mobile phone battery, and the mobile phone battery supplies power to the standby battery stably at ordinary times.
As shown in fig. 4, the switching unit includes an output terminal, a first input terminal connected to the voltage divider chip, a second input terminal connected to the backup battery, and a control input terminal. The control signal input by the control input end of the switching unit enables the switching unit to output the output power supply of the voltage division chip input by the first input end through the output end when the mobile phone battery is electrified, and the output power supply is used as the output of the power supply module, so that the mobile phone battery can output 2.8V voltage through the voltage division chip to supply power for each module chip of the step counting system; when the mobile phone battery is not enough to provide 2.8V voltage (at the moment, the voltage division chip can only output 0V voltage), the switching unit outputs the output power supply of the standby battery input by the second input end through the output end, and the output power supply is used as the output of the power supply module. The step counting system can detect and count the walking steps of the user no matter the mobile phone is in the state of active power-off of the user or in the state of power-off after the battery of the mobile phone is dead. The accuracy of information statistics of the step counting system is ensured.
In addition, the switching unit may be a Switch chip as shown in fig. 5, which includes an input pin 1, an input pin 2, an input pin 3, and an output pin 4. The input pin 3 is a selection switch pin. When a high level (such as 2.8V voltage) is input to the input pin 3, the input pin 1 and the output pin 4 are selected to be turned on, and the input pin 2 and the output pin 4 are turned off; on the other hand, when a low level (e.g., 0V voltage) is inputted to the input pin 3, the input pin 2 and the output pin 4 are selectively turned on, and the input pin 2 and the output pin 4 are turned off. Therefore, the input pin 1 of the Switch chip is connected to the voltage dividing chip as the first input terminal of the switching unit, the input pin 2 of the Switch chip is connected to the backup battery as the second input terminal of the switching unit, the input pin 3 of the Switch chip is also connected to the voltage dividing chip as the input control terminal of the switching unit, and the output pin 4 of the Switch chip is connected to the output terminal of the switching unit. In this way, the input pin 1 and the input pin 3 are connected together, so that when the voltage division chip outputs 2.8V, the signal input by the input pin 3 is also at a high level of 2.8V, and the Switch chip will turn on the input pin 1 and the output pin 4, so that when the input pin 1 (i.e. the voltage division chip) is powered on, the voltage division chip is used for supplying power; when the voltage dividing chip outputs 0V, the signal input at the input pin 3 is also at a low level of 0V, and the Switch chip will turn on the input pin 2 and the output pin 4, so as to enable the standby battery to be used for supplying power when the input pin 1 (i.e., the voltage dividing chip) cannot supply power.
The step counting method of the step counting system based on the embodiment comprises the following steps:
and step S01, in the power-off state of the mobile phone, the power supply module independent of the mobile phone CPU supplies power for the mobile phone step counting system. And the computing processing module of the mobile phone step counting system receives the level signal output by the step counting sensing module, and performs filtering processing and sampling processing on the obtained level signal to obtain a useful value signal. Analyzing the value signal to obtain the gradient change of the value signal; and calculating the step number of the user according to the gradient change and the duration of the signal and writing the calculation result (namely the shutdown step number) into a FLASH memory of the storage module.
Step S02, after the mobile phone is powered on, the mobile phone processor (i.e. the mobile phone CPU) reads the power-off step number stored in the FLASH memory of the storage module and updates the walking step number related to the user on the mobile phone. The method for updating the walking steps comprises the following steps: and taking the value obtained by adding the walking step number of the user and the shutdown step number stored before the mobile phone is shut down as the new walking step number of the user.
And step S03, in the state that the mobile phone is started, the mobile phone processor calculates and stores the walking steps of the user according to the detection data from the step counting sensing module.
Example two
The step counting system in the mobile phone of this embodiment further includes a step counting sensing module, a power supply module, a step counting processing module, and a storage module in addition to the mobile phone body.
The step-counting sensing module can be an acceleration sensor or a gravity sensor and is used for sensing the motion state of the user. In this embodiment, a gravity sensor is used to detect the change of the center of gravity of the mobile phone and output the detected change as a level signal.
The step-counting processing module is a DSP coprocessor in the mobile phone. Compared with the CPU of the mobile phone, the function of the mobile phone is single, and the mobile phone has no strong operation processing capability like the CPU of the mobile phone. However, the step counting operation in the invention is enough, and the DSP coprocessor can reduce the power consumption of the step counting. The calculation processing module is used for receiving the level signal output by the gravity sensor, filtering and sampling the obtained level signal to obtain a useful value signal, and analyzing and calculating the step number of the value signal. The calculation processing module is simultaneously connected with a real-time clock module (RTC) of the mobile phone for acquisition, so that the calculation processing module can write the calculation result thereof and the recording time (obtained by the real-time clock module) of the calculation result into the storage module. For convenience, the calculation processing module can monitor the real-time input by a pin connected with the real-time clock module, when the real-time shows that the current time is 24 points, the current time indicates that one day is past, namely the current day is a new day, and the step number information recorded before the current day is meaningless, so that the calculation processing module clears the step number stored in the storage module at the moment.
And a storage module containing a nonvolatile storage unit such as a FLASH memory.
And the power supply module comprises a standby battery, a voltage division chip connected to the mobile phone battery and a switching unit. The standby battery in the embodiment also supplies power to the real-time clock module of the mobile phone. The gravity sensor and the DSP coprocessor and the memory need to provide a nominal voltage to make them work. The rated voltage is usually 2.8V, which cannot be too high or lower than the voltage, so as to ensure the normal operation of each module chip. The output voltage of the mobile phone battery is usually 4V, and the output voltage cannot be directly used as the output of the power supply module to be provided for a chip module, but the voltage higher than 2.8V needs to be divided by the voltage dividing chip to be stabilized at 2.8V. The power supply module is connected to a mobile phone battery, the mobile phone battery supplies power to the voltage division chip, and the voltage division chip needs voltage input of more than 2.8V to provide 2.8V undetermined output. When the input voltage is less than 2.8V, the internal is an automatic open circuit and outputs 0V. The standby battery is connected to the mobile phone battery, and the mobile phone battery supplies power to the standby battery stably at ordinary times.
As shown in fig. 4, the switching unit includes an output terminal, a first input terminal connected to the voltage divider chip, a second input terminal connected to the backup battery, and a control input terminal. The control signal input by the control input end of the switching unit enables the switching unit to output the output power supply of the voltage division chip input by the first input end through the output end when the mobile phone battery is electrified, and the output power supply is used as the output of the power supply module, so that the mobile phone battery can output 2.8V voltage through the voltage division chip to supply power for each module chip of the step counting system; when the mobile phone battery is not enough to provide 2.8V voltage (at the moment, the voltage division chip can only output 0V voltage), the switching unit outputs the output power supply of the standby battery input by the second input end through the output end, and the output power supply is used as the output of the power supply module. The step counting system can detect and count the walking steps of the user no matter the mobile phone is in the state of active power-off of the user or in the state of power-off after the battery of the mobile phone is dead. The accuracy of information statistics of the step counting system is ensured.
In addition, the switching unit may be a Switch chip as shown in fig. 5, which includes an input pin 1, an input pin 2, an input pin 3, and an output pin 4. The input pin 3 is a selection switch pin. When a high level (such as 2.8V voltage) is input to the input pin 3, the input pin 1 and the output pin 4 are selected to be turned on, and the input pin 2 and the output pin 4 are turned off; on the other hand, when a low level (e.g., 0V voltage) is inputted to the input pin 3, the input pin 2 and the output pin 4 are selectively turned on, and the input pin 2 and the output pin 4 are turned off. Therefore, the input pin 1 of the Switch chip is connected to the voltage dividing chip as the first input terminal of the switching unit, the input pin 2 of the Switch chip is connected to the backup battery as the second input terminal of the switching unit, the input pin 3 of the Switch chip is also connected to the voltage dividing chip as the input control terminal of the switching unit, and the output pin 4 of the Switch chip is connected to the output terminal of the switching unit. In this way, the input pin 1 and the input pin 3 are connected together, so that when the voltage division chip outputs 2.8V, the signal input by the input pin 3 is also at a high level of 2.8V, and the Switch chip will turn on the input pin 1 and the output pin 4, so that when the input pin 1 (i.e. the voltage division chip) is powered on, the voltage division chip is used for supplying power; when the voltage dividing chip outputs 0V, the signal input at the input pin 3 is also at a low level of 0V, and the Switch chip will turn on the input pin 2 and the output pin 4, so as to enable the standby battery to be used for supplying power when the input pin 1 (i.e., the voltage dividing chip) cannot supply power.
The step counting method of the step counting system based on the embodiment comprises the following steps:
and step S01, in the power-off state of the mobile phone, the power supply module independent of the mobile phone CPU supplies power for the mobile phone step counting system. And the computing processing module of the mobile phone step counting system receives the level signal output by the step counting sensing module, and performs filtering processing and sampling processing on the obtained level signal to obtain a useful value signal. Analyzing the value signal to obtain the gradient change of the value signal; and calculating the step number of the user according to the gradient change and the duration of the signal, and writing the calculation result (namely the shutdown step number) and the recording time into a FLASH memory of the storage module.
Step S02, after the mobile phone is powered on, the mobile phone processor (i.e. the mobile phone CPU) reads the power-off step number stored in the FLASH memory of the storage module and updates the walking step number related to the user on the mobile phone. The method for updating the walking steps comprises the following steps: the mobile phone processor reads the shutdown step number and the recording time stored in the storage module; if no 24 points are crossed between the real-time and the recording time, adding the shutdown step number and the walking step number of the user to be used as a new walking step number of the user; and if 24 points are crossed between the real-time and the recording time, taking the number of the shutdown steps as the new number of the walking steps of the user.
And step S03, in the state that the mobile phone is started, the mobile phone processor calculates and stores the walking steps of the user according to the detection data from the step counting sensing module.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.