CN112833908A - Step counting method, step counting device and computer readable storage medium - Google Patents

Step counting method, step counting device and computer readable storage medium Download PDF

Info

Publication number
CN112833908A
CN112833908A CN202110113526.0A CN202110113526A CN112833908A CN 112833908 A CN112833908 A CN 112833908A CN 202110113526 A CN202110113526 A CN 202110113526A CN 112833908 A CN112833908 A CN 112833908A
Authority
CN
China
Prior art keywords
legs
distance
user
hall sensor
magnet
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110113526.0A
Other languages
Chinese (zh)
Inventor
唐荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JRD Communication Shenzhen Ltd
Jiekai Communications Shenzhen Co Ltd
Original Assignee
Jiekai Communications Shenzhen Co Ltd
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 Jiekai Communications Shenzhen Co Ltd filed Critical Jiekai Communications Shenzhen Co Ltd
Priority to CN202110113526.0A priority Critical patent/CN112833908A/en
Publication of CN112833908A publication Critical patent/CN112833908A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C22/00Measuring distance traversed on the ground by vehicles, persons, animals or other moving solid bodies, e.g. using odometers, using pedometers
    • G01C22/006Pedometers

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Measurement Of Distances Traversed On The Ground (AREA)

Abstract

The invention provides a step counting method, a step counting device and a computer readable storage medium, wherein the step counting method comprises the following steps: detecting whether the distance between the two legs of the user is changed according to a preset rule or not; and if the distance between the two legs of the user is changed according to a preset rule, counting the steps once. According to the invention, the activity of the two legs is directly monitored, and the counting is carried out only when the user walks; by monitoring the distance between the two legs, the distance change is compared with a preset rule by utilizing the periodic change of the distance between the two legs when people walk, so as to obtain a counting result; if the user walking number meets the preset rule, the user can be judged to actually walk, and the walking number can be calculated; the step number is not calculated according to the actions of other parts of the body any longer, and the step number is calculated only according to the actions of the two legs, so that the accuracy of detecting the step number of the user is improved.

Description

Step counting method, step counting device and computer readable storage medium
Technical Field
The present invention relates to the field of electronic application technologies, and in particular, to a step counting method, a step counting device, and a computer-readable storage medium.
Background
With the development of science and technology, people pay more and more attention to the health condition of themselves, no matter the wrist-watch, the bracelet of wearing, still through the cell-phone of oneself, all can record the step number of oneself walking, this has become people's habits and customs. Through the measurement and calculation of the step number, the calorie consumption can be estimated, and the tracking of healthy life is achieved.
However, currently, wearable devices with a step counting function measure the number of steps through inertial sensors, such as an acceleration sensor or a gyroscope, and the calculation accuracy is limited. For example, some teachers wear a watch to count steps, and often shake hands many times in a class, but actually do not walk, resulting in excessive number of steps. Moreover, when a person wearing the watch sits in the automobile, the bumping of the automobile can cause the step number of the equipment to be misjudged. Therefore, the existing step counting mode is easy to misjudge, and the step counting numerical value is inaccurate.
Therefore, the prior art has defects and needs to be improved and developed.
Disclosure of Invention
The present invention provides a step counting method, a step counting device and a computer readable storage medium, aiming at solving the problem that the step counting method in the prior art is easy to misjudge, resulting in inaccurate step counting value.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a step counting method for a step counting device, comprising:
detecting whether the distance between the two legs of the user is changed according to a preset rule or not;
and if the distance between the two legs of the user is changed according to a preset rule, counting the steps once.
In a further implementation, the step counting device comprises a hall sensor for fixing on one leg of the user, and a magnet for fixing on the other leg of the user; the magnet and the Hall sensor are mutually matched, and the fixed positions of the magnet and the Hall sensor correspond to each other.
In a further implementation manner, before the step of detecting whether the distance between the two legs of the user changes according to a preset rule, the method further includes:
and presetting the range of the distance threshold between the Hall sensor and the magnet conduction circuit.
In a further implementation manner, the step of detecting whether the distance between the two legs of the user changes according to a preset rule specifically includes:
detecting whether the distance between the legs of the user is reduced to be within the distance threshold range.
In a further implementation manner, the step of detecting whether the distance between the legs of the user decreases to be within the distance threshold range specifically includes:
and detecting whether a circuit is conducted between the Hall sensor and the magnet.
In a further implementation manner, the step of counting steps once if the distance between the two legs of the user changes according to a preset rule specifically includes:
when the circuit is conducted between the Hall sensor and the magnet, the potential of the circuit is changed from low to high, and a rising edge is generated;
when the rising edge is detected, the step is counted once, and the value of the counter is controlled to be increased by 1.
In a further implementation manner, after the step of detecting whether the circuit is turned on between the hall sensor and the magnet, the method further includes:
and when the Hall sensor and the magnet are not provided with a conducting circuit, the value of the counter is kept unchanged.
In a further implementation, the step counting method further includes:
if the distance between the two legs of the user is increased to exceed the distance threshold range, a circuit is disconnected between the Hall sensor and the magnet, and a falling edge is generated;
when the falling edge is detected, the value of the counter is kept unchanged.
The invention also provides a step counting device, wherein the step counting device comprises: a memory, a processor and a step-counting program stored on the memory and executable on the processor, the step-counting program implementing the steps of the step-counting method as described above when executed by the processor.
The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable for implementing the steps of the step counting method as described above.
The invention provides a step counting method, a step counting device and a computer readable storage medium, wherein the step counting method comprises the following steps: detecting whether the distance between the two legs of the user is changed according to a preset rule or not; and if the distance between the two legs of the user is changed according to a preset rule, counting the steps once. According to the invention, the activity of the two legs is directly monitored, and the counting is carried out only when the user walks; by monitoring the distance between the two legs, the distance change is compared with a preset rule by utilizing the periodic change of the distance between the two legs when people walk, so as to obtain a counting result; if the user walking number meets the preset rule, the user can be judged to actually walk, and the walking number can be calculated; the step number is not calculated according to the actions of other parts of the body any longer, and the step number is calculated only according to the actions of the two legs, so that the accuracy of detecting the step number of the user is improved.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the step counting method of the present invention.
FIG. 2 is a flowchart illustrating the step S200 of the preferred embodiment of the step counting method of the present invention.
FIG. 3 is a functional block diagram of the step-counting device in the preferred embodiment of the step-counting method of the present invention.
FIG. 4 is a flowchart of an embodiment of the step counting method of the present invention.
FIG. 5 is a functional block diagram of a preferred embodiment of the step counter of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flow chart of a step counting method according to the present invention. As shown in fig. 1, the step counting method according to the embodiment of the present invention includes the following steps:
and S100, detecting whether the distance between the legs of the user is changed according to a preset rule.
That is to say, currently, wearable devices with a step counting function in the market measure the number of steps through an inertial sensor, such as an acceleration sensor or a gyroscope, and as long as the hand shaking times are large or the wearable devices are in a bumpy environment, the value of the step counter is increased, which is inaccurate because the user does not actually move. The invention directly monitors the activities of the two legs and determines that the user counts only when walking.
Specifically, the distance between the two legs is monitored, and the distance change is compared with a preset rule by utilizing the periodic change of the distance between the two legs when people walk, so that a counting result is obtained.
In one implementation, the step counting device comprises a hall sensor for fixing on one leg of the user, and a magnet for fixing on the other leg of the user; the magnet and the Hall sensor are mutually matched, and the fixed positions of the magnet and the Hall sensor correspond to each other.
Specifically, the step counter of the present invention includes: the device comprises a signal acquisition module, a signal processing module and an information display module. Specifically, the power supply device comprises a magnet, a low-power-consumption Hall sensor and a low-power-consumption main control CPU, and further comprises a power supply module. The magnet and other parts are arranged in a separable mode, and the Hall sensor, the main control CPU and the power supply module are integrally arranged to form a step counting device body. That is, the invention uses the periodic variation of the distance between the two legs when the person walks, and detects the variation of the distance between the two legs through the Hall sensor to count the steps. The Hall sensor is used as a magnetic control switch, and a circuit controlled by the Hall sensor is instantly conducted every time when the magnet is close to the Hall sensor and is disconnected when the magnet is far away from the Hall sensor.
Therefore, when the user uses the stepping device, the magnet is fixedly arranged on one leg, and the Hall sensor is fixedly arranged on the other leg, namely, the stepping device body where the Hall sensor is arranged is fixedly arranged on the other leg. It should be understood that the installation positions of the magnet and the hall sensor need to be the same, for example, the magnet and the hall sensor are installed at the knee parts or other parts of the legs, as long as the distance of the user when the legs cross can be ensured to be capable of conducting the circuit, and the distance of the user when the legs are stepped off can be capable of breaking the circuit. It can be understood that the fixed mounting position of the magnet and the hall sensor is not too high, for example, the fixed mounting position is higher than the knee position, and since the part of the person who walks away is below the knee and above the knee, the distance between the two legs is not too large, the magnet and the hall sensor can be always conducted, and the judgment and statistics of the step number are affected.
In a further implementation manner, the step S100 further includes, before the step S:
and step S10, presetting the distance threshold range of the Hall sensor and the magnet conduction circuit.
That is, the hall sensor and the magnet can conduct the circuit only within a distance threshold range. Therefore, the distance between the two legs does not need to be directly measured, the distance between the Hall sensor and the magnet does not need to be measured, only the circuit needs to be detected whether to be conducted or not, the detection is very convenient, and the detection efficiency is improved.
In a further implementation manner, the step S100 is specifically: detecting whether the distance between the legs of the user is reduced to be within the distance threshold range.
Specifically, when the user walks, the distance between the two legs decreases every time the two legs cross; when the two legs are stepped off, the distance between the two legs is increased. That is, the preset rule of the present invention means that the two legs are crossed once, the distance between the two legs is decreased, the two legs are stepped, and the distance between the two legs is increased. If the preset rule is met, the user can be judged to actually walk, and the number of steps can be calculated.
In further implementation manners, the step of "detecting whether the distance between the legs of the user decreases to be within the distance threshold" is specifically: and detecting whether a circuit is conducted between the Hall sensor and the magnet.
That is, the invention does not need to directly measure the distance between the two legs, does not need to measure the distance between the Hall sensor and the magnet, and only needs to detect whether the circuit is conducted between the Hall sensor and the magnet, thereby being very convenient and improving the detection efficiency.
The step S100 is followed by: and step S200, if the distance between the two legs of the user is changed according to a preset rule, counting the steps once.
That is, if the predetermined rule is satisfied, it can be determined that the user actually walks, and the number of steps can be calculated.
In an implementation manner, referring to fig. 2, the step S200 specifically includes:
step S210, when the circuit is conducted between the Hall sensor and the magnet, the electric potential of the circuit is changed from low to high, and a rising edge is generated;
and step S220, counting the step once when the rising edge is detected, and controlling the value of the counter to be increased by 1.
That is to say, the invention can control the on-off of the circuit by changing the distance between the magnet and the Hall sensor, the counter controlled by the magnet and the Hall sensor is respectively arranged on the two legs of the person, the distance between the two legs is reduced when the two legs are crossed once, the circuit is conducted, the potential is changed from low to high, and the counter is triggered by the rising edge to add 1.
In one implementation, after the step of detecting whether the circuit is turned on between the hall sensor and the magnet, the method further includes:
and when the Hall sensor and the magnet are not provided with a conducting circuit, the value of the counter is kept unchanged.
That is to say, when the legs of the user are in the stepping-on state, the step is not counted, and only one step is counted when the legs are crossed, so that the step is recorded only when the legs of the user are crossed once, and the step counting accuracy is improved. It can be understood that no matter the user shakes his hands or sits on a bumpy car, the wrong step counting is not performed, and the misjudgment is avoided.
In a further implementation, the step counting method further includes:
if the distance between the two legs of the user is increased to exceed the distance threshold range, a circuit is disconnected between the Hall sensor and the magnet, and a falling edge is generated;
when the falling edge is detected, the value of the counter is kept unchanged.
That is, as the user steps further, the distance between the legs increases, the circuit opens and the counter value remains unchanged.
The main program of the invention firstly initializes the system resource of the low-power CPU, then initializes the Hall sensor, the display module and the pedometer of the step-counting device, the low-power CPU detects the OUT output of the Hall sensor through the interrupt pin, if the CPU detects a rising edge, the pedometer carries OUT the 1-adding processing, and finishes the data acquisition, processing and display.
Referring to fig. 3, the step counting device body includes: power module 10, hall sensor 20, low-power consumption master control CPU30, in addition, for the step number of convenient display pedometer, still be provided with display module, for example, OLED display screen 40, make things convenient for the user to look over current step number at any time.
Further, the power module 10 is connected to the hall sensor 20, and the power module 10 supplies power to the hall sensor 20; the power module 10 is further connected to the low power consumption main control CPU30, and the power module 10 supplies power to the low power consumption main control CPU 30; the power module 10 is further connected with the OLED display screen 40, and the power module 10 supplies power to the OLED display screen 40; the hall sensor 20 is connected with the low-power-consumption main control CPU30, and the OUT output of the hall sensor 20 is detected by the low-power-consumption main control CPU30 through an interrupt pin; the low-power-consumption main control CPU30 is further connected to the OLED display screen 40, and if the low-power-consumption main control CPU30 detects a rising edge, the value displayed on the OLED display screen 40 is incremented by 1.
In addition, the step counting device body is connected with a terminal of a user in a communication mode, and the terminal can be a watch, a bracelet and other wearable devices and also can be a smart phone. The step counting device body can send the numerical value of the counter to a display screen on the user terminal for displaying. When a user wants to know the current step number, the user only needs to operate the terminal and obtains the numerical value of the counter on the step counting device through the terminal, and the method is very convenient. Therefore, a display module on the step counting device, namely an OLED display screen, can be omitted, and the production cost of the step counting device is saved.
An embodiment will be described with reference to fig. 4.
Step S1, initializing the system;
step S2, the system starts to count steps;
step S3, updating the system step count to S;
step S4, acquiring whether an interrupt pin of the Hall sensor OUT is updated; if yes, executing step 5; if not, go to step S7;
s5, collecting N rising edges;
step S6, calculating the number of data steps: s + N;
and step S7, outputting or displaying the step counting value.
That is, in the present invention, the number of data steps is calculated every predetermined time, and the number of rising edges in this time is added to the original data. Or when the user wants to acquire the current step data, the step calculation of the data is controlled after the user clicks the display screen, S + N is obtained, and the S + N is finally displayed on the display screen.
Further, as shown in fig. 5, based on the step counting method, the invention further provides a step counting device, which includes a processor 10 and a memory 20. Fig. 5 shows only some of the components of the step counting device, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 20 may in some embodiments be an internal storage unit of the step counting device, such as a hard disk or a memory of the step counting device. In other embodiments, the memory 20 may also be an external storage device of the pedometer, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the pedometer. Further, the memory 20 may also include both an internal storage unit of the step counting device and an external storage device. The memory 20 is used for storing application software installed in the step counting device and various types of data, such as program codes for installing the step counting device. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a step counting program 30, and the step counting program 30 can be executed by the processor 10 to implement the step counting method of the present application.
The processor 10 may be, in some embodiments, a Central Processing Unit (CPU), a microprocessor or other data Processing chip, which is used for running program codes stored in the memory 20 or Processing data, such as executing the step counting method.
In one embodiment, when the processor 10 executes the step counting program 30 in the memory 20, the following steps are implemented:
detecting whether the distance between the two legs of the user is changed according to a preset rule or not;
and if the distance between the two legs of the user is changed according to a preset rule, counting the steps once.
That is to say, currently, wearable devices with a step counting function in the market measure the number of steps through an inertial sensor, such as an acceleration sensor or a gyroscope, and as long as the hand shaking times are large or the wearable devices are in a bumpy environment, the value of the step counter is increased, which is inaccurate because the user does not actually move. The invention directly monitors the activities of the two legs and determines that the user counts only when walking. If the user's walking is in accordance with the preset rule, the user can be determined to actually walk, and the number of steps can be calculated.
Specifically, the distance between the two legs is monitored, and the distance change is compared with a preset rule by utilizing the periodic change of the distance between the two legs when people walk, so that a counting result is obtained.
The step counting device comprises a Hall sensor fixed on one leg of a user and a magnet fixed on the other leg of the user; the magnet and the Hall sensor are mutually matched, and the fixed positions of the magnet and the Hall sensor correspond to each other.
Specifically, the step counter of the present invention includes: the device comprises a signal acquisition module, a signal processing module and an information display module. Specifically, the power supply device comprises a magnet, a low-power-consumption Hall sensor and a low-power-consumption main control CPU, and further comprises a power supply module. The magnet and other parts are arranged in a separable mode, and the Hall sensor, the main control CPU and the power supply module are integrally arranged to form a step counting device body. That is, the invention uses the periodic variation of the distance between the two legs when the person walks, and detects the variation of the distance between the two legs through the Hall sensor to count the steps. The Hall sensor is used as a magnetic control switch, and a circuit controlled by the Hall sensor is instantly conducted every time when the magnet is close to the Hall sensor and is disconnected when the magnet is far away from the Hall sensor.
Therefore, when the user uses the stepping device, the magnet is fixedly arranged on one leg, and the Hall sensor is fixedly arranged on the other leg, namely, the stepping device body where the Hall sensor is arranged is fixedly arranged on the other leg. It should be understood that the installation positions of the magnet and the hall sensor need to be the same, for example, the magnet and the hall sensor are installed at the knee parts or other parts of the legs, as long as the distance of the user when the legs cross can be ensured to be capable of conducting the circuit, and the distance of the user when the legs are stepped off can be capable of breaking the circuit. It can be understood that the fixed mounting position of the magnet and the hall sensor is not too high, for example, the fixed mounting position is higher than the knee position, and since the part of the person who walks away is below the knee and above the knee, the distance between the two legs is not too large, the magnet and the hall sensor can be always conducted, and the judgment and statistics of the step number are affected.
Before the step of detecting whether the distance between the two legs of the user changes according to the preset rule, the method further comprises the following steps:
and presetting the range of the distance threshold between the Hall sensor and the magnet conduction circuit.
That is, the hall sensor and the magnet can conduct the circuit only within a distance threshold range. Therefore, the distance between the two legs does not need to be directly measured, the distance between the Hall sensor and the magnet does not need to be measured, only the circuit needs to be detected whether to be conducted or not, the detection is very convenient, and the detection efficiency is improved.
The step of detecting whether the distance between the two legs of the user changes according to a preset rule specifically comprises the following steps:
detecting whether the distance between the legs of the user is reduced to be within the distance threshold range.
Specifically, when the user walks, the distance between the two legs decreases every time the two legs cross; when the two legs are stepped off, the distance between the two legs is increased. That is, the preset rule of the present invention means that the two legs are crossed once, the distance between the two legs is decreased, the two legs are stepped, and the distance between the two legs is increased. If the preset rule is met, the user can be judged to actually walk, and the number of steps can be calculated.
The step of detecting whether the distance between the legs of the user is reduced to be within the distance threshold range specifically includes:
and detecting whether a circuit is conducted between the Hall sensor and the magnet.
That is, the invention does not need to directly measure the distance between the two legs, does not need to measure the distance between the Hall sensor and the magnet, and only needs to detect whether the circuit is conducted between the Hall sensor and the magnet, thereby being very convenient and improving the detection efficiency.
If the distance between the two legs of the user is changed according to a preset rule, the step of counting once specifically comprises the following steps:
when the circuit is conducted between the Hall sensor and the magnet, the potential of the circuit is changed from low to high, and a rising edge is generated;
when the rising edge is detected, the step is counted once, and the value of the counter is controlled to be increased by 1.
That is to say, the invention can control the on-off of the circuit by changing the distance between the magnet and the Hall sensor, the counter controlled by the magnet and the Hall sensor is respectively arranged on the two legs of the person, the distance between the two legs is reduced when the two legs are crossed once, the circuit is conducted, the potential is changed from low to high, and the counter is triggered by the rising edge to add 1.
After the step of detecting whether the circuit is conducted between the hall sensor and the magnet, the method further comprises the following steps:
and when the Hall sensor and the magnet are not provided with a conducting circuit, the value of the counter is kept unchanged.
That is to say, when the legs of the user are in the stepping-on state, the step is not counted, and only one step is counted when the legs are crossed, so that the step is recorded only when the legs of the user are crossed once, and the step counting accuracy is improved. No matter the user shakes the hands or sits on a bumpy automobile, step counting can not be carried out, and misjudgment is avoided.
In one embodiment, when the processor 10 executes the step counting program 30 in the memory 20, the following steps are also implemented:
if the distance between the two legs of the user is increased to exceed the distance threshold range, a circuit is disconnected between the Hall sensor and the magnet, and a falling edge is generated;
when the falling edge is detected, the value of the counter is kept unchanged.
That is, as the user steps further, the distance between the legs increases, the circuit opens and the counter value remains unchanged.
The main program of the invention firstly initializes the system resource of the low-power CPU, then initializes the Hall sensor, the display module and the pedometer of the step-counting device, the low-power CPU detects the OUT output of the Hall sensor through the interrupt pin, if the CPU detects a rising edge, the pedometer carries OUT the 1-adding processing, and finishes the data acquisition, processing and display.
The step counting device body comprises: power module, hall sensor, low-power consumption master control CPU in addition, for the step number of convenient display pedometer, still be provided with display module, if, OLED display screen, convenience of customers looks over current step number at any time.
Furthermore, the power supply module is connected with the Hall sensor and supplies power to the Hall sensor; the power supply module is also connected with the OLED display screen and supplies power to the OLED display screen; the Hall sensor is connected with the low-power-consumption main control CPU, and the OUT output of the Hall sensor is detected by the low-power-consumption main control CPU through an interrupt pin; and the low-power-consumption main control CPU is also connected with the OLED display screen, and when the low-power-consumption main control CPU detects a rising edge, the numerical value displayed on the OLED display screen is increased by 1.
In addition, the step counting device body is connected with a terminal of a user in a communication mode, and the terminal can be a watch, a bracelet and other wearable devices and also can be a smart phone. The step counting device body can send the numerical value of the counter to a display screen on the user terminal for displaying. When a user wants to know the current step number, the user only needs to operate the terminal and obtains the numerical value of the counter on the step counting device through the terminal, and the method is very convenient. Therefore, a display module on the step counting device, namely an OLED display screen, can be omitted, and the production cost of the step counting device is saved.
The step counting method comprises the following specific implementation flows:
initializing a system;
the system starts to count steps;
updating the step count of the system to be S;
acquiring whether an interrupt pin of a Hall sensor OUT is updated or not;
if yes, go to step S6; if not, go to step S9;
collecting the number of rising edges as N;
and (3) calculating the data step number: s + N;
and outputting or displaying the step counting value.
That is, in the present invention, the number of data steps is calculated every predetermined time, and the number of rising edges in this time is added to the original data. Or when the user wants to acquire the current step data, the step calculation of the data is controlled after the user clicks the display screen, S + N is obtained, and the S + N is finally displayed on the display screen.
The present invention also provides a computer-readable storage medium storing a computer program executable for implementing the steps of the step counting method as described above.
In an embodiment, the computer program is capable of being executed to:
detecting whether the distance between the two legs of the user is changed according to a preset rule or not;
and if the distance between the two legs of the user is changed according to a preset rule, counting the steps once.
The step counting device comprises a Hall sensor fixed on one leg of a user and a magnet fixed on the other leg of the user; the magnet and the Hall sensor are mutually matched, and the fixed positions of the magnet and the Hall sensor correspond to each other.
Before the step of detecting whether the distance between the two legs of the user changes according to the preset rule, the method further comprises the following steps:
and presetting the range of the distance threshold between the Hall sensor and the magnet conduction circuit.
The step of detecting whether the distance between the two legs of the user changes according to a preset rule specifically comprises the following steps:
detecting whether the distance between the legs of the user is reduced to be within the distance threshold range.
The step of detecting whether the distance between the legs of the user is reduced to be within the distance threshold range specifically includes:
and detecting whether a circuit is conducted between the Hall sensor and the magnet.
If the distance between the two legs of the user is changed according to a preset rule, the step of counting once specifically comprises the following steps:
when the circuit is conducted between the Hall sensor and the magnet, the potential of the circuit is changed from low to high, and a rising edge is generated;
when the rising edge is detected, the step is counted once, and the value of the counter is controlled to be increased by 1.
After the step of detecting whether the circuit is conducted between the hall sensor and the magnet, the method further comprises the following steps:
and when the Hall sensor and the magnet are not provided with a conducting circuit, the value of the counter is kept unchanged.
In an embodiment, the computer program is further capable of being executed to:
if the distance between the two legs of the user is increased to exceed the distance threshold range, a circuit is disconnected between the Hall sensor and the magnet, and a falling edge is generated;
when the falling edge is detected, the value of the counter is kept unchanged.
In summary, the step counting method, the step counting device and the computer readable storage medium disclosed by the present invention include: detecting whether the distance between the two legs of the user is changed according to a preset rule or not; and if the distance between the two legs of the user is changed according to a preset rule, counting the steps once. According to the invention, the activity of the two legs is directly monitored, and the counting is carried out only when the user walks; by monitoring the distance between the two legs, the distance change is compared with a preset rule by utilizing the periodic change of the distance between the two legs when people walk, so as to obtain a counting result; if the user walking number meets the preset rule, the user can be judged to actually walk, and the walking number can be calculated; the step number is not calculated according to the actions of other parts of the body any longer, and the step number is calculated only according to the actions of the two legs, so that the accuracy of detecting the step number of the user is improved.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. A step counting method for a step counting device, comprising:
detecting whether the distance between the two legs of the user is changed according to a preset rule or not;
and if the distance between the two legs of the user is changed according to a preset rule, counting the steps once.
2. The step counting method according to claim 1, wherein the step counting device comprises a hall sensor for fixing to one leg of the user, and a magnet for fixing to the other leg of the user; the magnet and the Hall sensor are mutually matched, and the fixed positions of the magnet and the Hall sensor correspond to each other.
3. The step counting method according to claim 2, wherein the step of detecting whether the distance between the legs of the user changes according to a preset rule is preceded by the step of:
and presetting the range of the distance threshold between the Hall sensor and the magnet conduction circuit.
4. The step counting method according to claim 3, wherein the step of detecting whether the distance between the legs of the user changes according to a preset rule is specifically:
detecting whether the distance between the legs of the user is reduced to be within the distance threshold range.
5. The step counting method according to claim 4, wherein the step of detecting whether the distance between the legs of the user decreases to within the distance threshold range comprises:
and detecting whether a circuit is conducted between the Hall sensor and the magnet.
6. The step counting method according to claim 5, wherein if the distance between the legs of the user changes according to a preset rule, the step of counting the steps once specifically comprises:
when the circuit is conducted between the Hall sensor and the magnet, the potential of the circuit is changed from low to high, and a rising edge is generated;
when the rising edge is detected, the step is counted once, and the value of the counter is controlled to be increased by 1.
7. The step counting method according to claim 4, wherein after the step of detecting whether the circuit is turned on between the hall sensor and the magnet, the step of further comprising:
and when the Hall sensor and the magnet are not provided with a conducting circuit, the value of the counter is kept unchanged.
8. The step counting method of claim 7, further comprising:
if the distance between the two legs of the user is increased to exceed the distance threshold range, a circuit is disconnected between the Hall sensor and the magnet, and a falling edge is generated;
when the falling edge is detected, the value of the counter is kept unchanged.
9. A step counter, comprising: memory, processor and a step-counting program stored on the memory and executable on the processor, the step-counting program when executed by the processor implementing the steps of the step-counting method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program executable for implementing the steps of the step counting method according to any one of claims 1 to 8.
CN202110113526.0A 2021-01-27 2021-01-27 Step counting method, step counting device and computer readable storage medium Pending CN112833908A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110113526.0A CN112833908A (en) 2021-01-27 2021-01-27 Step counting method, step counting device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110113526.0A CN112833908A (en) 2021-01-27 2021-01-27 Step counting method, step counting device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112833908A true CN112833908A (en) 2021-05-25

Family

ID=75932050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110113526.0A Pending CN112833908A (en) 2021-01-27 2021-01-27 Step counting method, step counting device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112833908A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202149782U (en) * 2011-07-28 2012-02-22 河南机电高等专科学校 Novel split-type electronic pedometer
CN103206962A (en) * 2013-03-14 2013-07-17 梅健 Electric pedometer based on approaching type sensing
CN106730646A (en) * 2015-11-24 2017-05-31 北京上方之道科技有限公司 Electric Runner Control System and step-recording method
CN110495892A (en) * 2019-08-28 2019-11-26 歌尔科技有限公司 A kind of exercise data detection method and intelligent wearable device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202149782U (en) * 2011-07-28 2012-02-22 河南机电高等专科学校 Novel split-type electronic pedometer
CN103206962A (en) * 2013-03-14 2013-07-17 梅健 Electric pedometer based on approaching type sensing
CN106730646A (en) * 2015-11-24 2017-05-31 北京上方之道科技有限公司 Electric Runner Control System and step-recording method
CN110495892A (en) * 2019-08-28 2019-11-26 歌尔科技有限公司 A kind of exercise data detection method and intelligent wearable device

Similar Documents

Publication Publication Date Title
KR102463281B1 (en) Electronic apparatus for providing mode switching and storage medium
US9700260B2 (en) Portable device and heartbeat reaching time measurement control method
Bieber et al. Sensor requirements for activity recognition on smart watches
CN107357411B (en) Electronic device
US10966658B2 (en) System for providing insightful lifestyle notifications
CN110687683A (en) Intelligent glasses control method and intelligent glasses
KR20170020085A (en) Activity Information Processing Method and electronic device supporting the same
KR20170138667A (en) Method for activating application and electronic device supporting the same
CN106161791B (en) Mutual anti-loss reminding method and system for intelligent terminals
CN107049255A (en) A kind of wearable intelligent equipment and its sleep algorithm
CN111225603B (en) Electronic device and method for providing stress index corresponding to user activity
JP6648515B2 (en) Electronic device, its angular velocity acquisition method, and angular velocity acquisition program
KR20180137915A (en) Method for determining data of barometer sensor using data obtained from motion sensor and electronic device for the same
CN110495892B (en) Motion data detection method and intelligent wearable device
CN113693565A (en) Wearable device and wearing detection method thereof
CN114421544A (en) Battery state of health determination
KR20200120105A (en) Electronic device and method for providing information to relieve stress thereof
CN112833908A (en) Step counting method, step counting device and computer readable storage medium
EP2796091B1 (en) Pulse estimation device and pulse estimation program
JP2012048530A (en) Step number measuring device
US20160085331A1 (en) Method and Apparatus for Physical Activity Tracking
CN107422830B (en) Motion determination device and motion sensor
US9997945B2 (en) Chargeable device and charger thereof
KR101566637B1 (en) Electronic device, setting method and computer readable recording medium having program thereof
US20120203496A1 (en) Acceleration detecting device, electronic apparatus, pedometer, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination