Turn-around detection method and device, nonvolatile storage medium and wearable equipment
By acquiring and analyzing swimming movement data, combined with neural network models and counters, the swimming turn movement can be accurately judged, which solves the problem of inaccurate turn judgment in the existing technology and improves the accuracy of swimming data.
Patent Information
- Application Number
- CN202411085192.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, the accuracy of swimming turn judgment is not high, resulting in inaccurate calculation of swimming distance and calories.
By obtaining the movement data of the target object, the type of action is determined, and based on the swimming time, it is judged whether the predetermined distance has been swam, and then the accuracy of the turning action is determined. The neural network model and counter are used to record the number of turns to improve the accuracy of judgment.
It improves the accuracy of turning judgment, ensures the accuracy of swimming data, and avoids distance and energy calculation errors caused by misjudgment.
Smart Images

Figure CN118606771A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a turn detection method, device, non-volatile storage medium and wearable device. Background Art
[0002] With the continuous advancement of science and technology, more and more technologies are applied in swimming. Among them, the estimation of the number and time of swimming turns is particularly important. By judging the turns, the swimming distance, calories and other information that people are more concerned about can be calculated, providing users with more accurate sports data and improving the user experience.
[0003] At present, most swimming data statistics methods on the market analyze the user's motion data to determine the turning action. However, when the user's motion is highly similar to the turning action, for example, when the user looks back in the water to check the progress of his companions, the user's turning back action may be recorded as a turn, resulting in inaccurate calculation of swimming distance, calories and other sports data.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a turn detection method, apparatus, non-volatile storage medium and wearable device to at least solve the technical problem that the turn judgment accuracy is not high due to the analysis of only the user's motion data in the related technology, which leads to inaccurate calculation of the user's motion data.
[0006] According to one aspect of an embodiment of the present invention, a turn detection method is provided, comprising: obtaining target motion data of a target object at a current moment; determining a target action type of the target object based on the target motion data; when the target action type is a suspected turn, obtaining the swimming time of the target object from the start of swimming to the current moment; judging whether the target object has swum a predetermined distance based on the swimming time; and when the judgment result is that the target object has swum the predetermined distance, determining the suspected turn to be a turning action, otherwise, determining the suspected turn to be a non-turning action.
[0007] Optionally, obtaining the target motion data of the target object at the current moment includes: obtaining continuous motion data of the target object collected by a sensor, wherein the moment corresponding to the continuous motion data includes the current moment; based on a pre-set sliding window interval, intercepting data with a duration of a pre-set sliding window length and including the current moment in the continuous motion data as the target motion data.
[0008] Optionally, in the case where the target action type is suspected turning, the swimming duration of the target object from the start time of swimming to the current time is obtained, including: setting a timer, wherein the timer is configured to count based on the sum of the sliding window length and the sliding window interval at the start time of swimming, and the start time of swimming is the time when it is determined that the action type of the target object is swimming; in the case where the target action type is turning, the time recorded by the timer is read as the swimming duration, and the time recorded by the timer is cleared to zero.
[0009] Optionally, the target action type of the target object is determined based on the target motion data, including: extracting feature data from the target motion data; inputting the feature data into a neural network model, and the action type corresponding to the feature data output by the neural network model is the target action type, wherein the neural network model is trained using training samples, and the training samples include sample feature data and sample action types.
[0010] Optionally, judging whether the target object has swum a predetermined distance based on the swimming time includes: judging whether the swimming time is less than a predetermined time threshold, and when the swimming time is less than the time threshold, determining that the target object has not swum the predetermined distance; when the swimming time is not less than the time threshold, determining that the target object has swum the predetermined distance; or judging whether the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, and when the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, determining that the target object has not swum the predetermined distance; when the ratio of the predetermined distance to the swimming time is not greater than the predetermined speed, determining that the target object has swum the predetermined distance.
[0011] Optionally, the method also includes: using a counter to record the number of turns; when it is determined that the target object has not swam the predetermined distance, determining the suspected turn to be a non-turning action, and subtracting a preset value from the count of the counter; and determining the current swimming distance of the target object based on the number of turns recorded by the counter and the predetermined distance.
[0012] Optionally, the method also includes: obtaining a pre-set swimming training plan and historical motion data, wherein the swimming training plan includes but is not limited to a planned swimming distance and a planned swimming distance completion time; estimating the swimming speed of the target object based on the historical motion data; and determining the remaining completion time of the planned swimming distance based on the current swimming distance, the swimming training plan and the swimming speed.
[0013] According to another aspect of an embodiment of the present invention, a turning detection device is also provided, including: a first acquisition module, used to acquire target motion data of the target object at a current moment; a first determination module, used to determine the target action type of the target object based on the target motion data; a second acquisition module, used to acquire the swimming time of the target object from the start of swimming to the current moment when the target action type is a suspected turn; a judgment module, used to judge whether the target object has swam a predetermined distance based on the swimming time; a second determination module, used to determine that the suspected turn is a turning action when the judgment result is that the target object has swam the predetermined distance, otherwise, determine that the suspected turn is a non-turning action.
[0014] According to another aspect of an embodiment of the present invention, a wearable device is provided, including: a sensor, a processor and a memory, wherein the sensor is used to collect target motion data of the target object at a current moment and transmit it to the processor; the memory stores a computer program; the processor is used to execute the computer program stored in the memory, and when the computer program is running, the processor executes any one of the above-mentioned turn detection methods.
[0015] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any one of the above-mentioned turn detection methods.
[0016] According to yet another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned turn detection methods is implemented.
[0017] In an embodiment of the present invention, by acquiring the target motion data of the target object at the current moment; determining the target action type of the target object according to the target motion data; in the case where the target action type is suspected turning, acquiring the swimming time of the target object from the start time of swimming to the current moment; judging whether the target object has swum a predetermined distance according to the swimming time; in the case where the judgment result is that the target object has swum the predetermined distance, determining the suspected turning to be a turning action, otherwise, determining the suspected turning to be a non-turning action, the purpose of judging the rationality of the user's turning behavior again when determining that the user's behavior is suspected turning based on the action data is achieved, thereby achieving the technical effect of improving the accuracy of judging the user's turning action, and further solving the technical problem that the accuracy of turning judgment is not high due to only analyzing the user's action data in the related technology, and then making the user's motion data calculation inaccurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 A hardware structure block diagram of an electronic system for implementing a turn detection method is shown;
[0020] Figure 2 is a flow chart of a turn detection method provided according to an embodiment of the present invention;
[0021] Figure 3 4 is a structural block diagram of a turn detection device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] According to an embodiment of the present invention, a method embodiment of turn detection is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0025] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, an electronic system or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of an electronic system for implementing a turn detection method. Figure 1 As shown, the electronic system 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a sensor. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a wireless transceiver, a network interface, a battery and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0026] The electronic system 10 can be integrated into a wearable device, which can be worn on the user's head (forehead, back of the head, etc.), chest, back, waist, hips, shoulders, etc., so as to collect data of the user's body movements during swimming, and then obtain target motion data. The wearable device can be configured to present the output of swimming data such as the number of turns, swimming distance, etc. to the swimmer in a visual or auditory manner, such as generating a visual output through a display system, and generating an auditory output through a bone conduction headset.
[0027] Preferably, the wearable device may be a smart swimming goggles, which may also include an optical display system. The swimming data processed by the electronic system 10 provides visual data (such as text, icons, images, etc.) to the user (swimmer) through the optical display system. The optical display system may be a display system such as those in patents No. 2020216839898, 2020102950752, 2019223474797, etc., and is not specifically limited here. It is sufficient to convert the target data into image light and then project it into the user's eyes to form a virtual display image. Of course, the optical display system may also be directly replaced by a display screen, which displays the swimming data.
[0028] In addition to providing the swimmer with swimming data in real time, the wearable device can also communicate with other electronic devices (e.g., mobile phones, iPads, personal computers) to transmit the swimming data, and the electronic devices analyze the swimming data to provide the swimmer with training summaries, training plans, etc.
[0029] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the electronic system 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0030] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the turn detection method in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the turn detection method of the above-mentioned application is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the electronic system 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0031] The sensor may be a six-axis IMU sensor, which is composed of a three-axis accelerometer and a three-axis gyroscope. The accelerometer may be a micro-electromechanical system (MEMS) accelerometer, and the gyroscope may be a MEMS gyroscope. The processor receives motion information through the six-axis IMU sensor to track acceleration information, rotation information, position information, or orientation information of the wearable device in six degrees of freedom through three-dimensional space; the processor stores the sensor data and calculated information in the memory 104, thereby creating a historical record of the swimmer's athletic performance.
[0032] In the related art, when recording the motion data of a user swimming in a swimming pool, it is generally assumed that the user starts from the side wall of the swimming pool, and the user's swimming distance is obtained based on the number of times the user turns in the swimming pool and the length of the swimming pool. Therefore, determining the number of times the user turns is very important for counting the user's swimming distance. If the number of turns is counted incorrectly, it will lead to errors in the statistics of the swimming distance, which will in turn lead to large errors in the swimming segment data (each trip duration, stroke frequency), swimming efficiency, energy consumption and other motion parameters. In the related art, whether the user turns around is generally determined based on the collected user's body motion data. In this case, even if the user only turns back to look for a companion in the swimming pool and does not swim the distance of a lane, it will be determined that the user has turned around, resulting in large errors in the statistics of the swimming distance. Figure 2FIG. 1 is a flow chart of a turn detection method according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0033] Step S202, obtaining target motion data of the target object at the current moment.
[0034] In this step, the target object may be a user (swimmer) carrying a sensor, and the sensor may include at least one of an accelerometer, a gyroscope, and a magnetometer. The user's motion data collected by the sensor is continuous. In the process of processing the continuous data, the continuous motion data will be divided into multiple groups, each group of motion data indicates the user's actions within a time period. In order to determine the user's swimming time required for data processing, a certain moment within the time period can be selected as the current moment.
[0035] Step S204: determining the target action type of the target object according to the target motion data.
[0036] In this step, the target motion data extracted by the sensor can be processed to determine the user's action type corresponding to the target motion data as the target action type. Specifically, the action type may include swimming, resting, suspected turning, etc. Among them, the above-mentioned motion types can be represented by letters or numbers. It should be noted that the suspected turning in the action type here means that the motion data represents that the user's body has turned, but it cannot be specifically determined whether the action is a turning action after swimming to the end of the pool, or a body turning action during swimming.
[0037] Step S206, when the target action type is suspected turning, the swimming time of the target object from the start time of swimming to the current time is obtained.
[0038] Step S208, judging whether the target object has swum a predetermined distance according to the swimming time.
[0039] Step S210: When the result of the determination is that the target object has swum the predetermined distance, the suspected turning is determined to be a turning action.
[0040] In the above three steps, the predetermined distance is the length of the swimming lane in the swimming pool. For example, if the swimming pool is 50 meters long, the predetermined distance can be set to 50 meters. If it is determined based on the target motion data that the user's body has rotated, which is a suspected turning action, the swimming time from the time the user starts swimming to the current time can be obtained, and based on the swimming time, it can be determined whether the user can swim the length of the swimming pool; if the user can swim within the swimming time, it can be considered that the suspected turning action at this time is a real turning action.
[0041] Through the above steps, the purpose of determining based on the action data that the user's behavior is suspected of turning and then judging the rationality of the user's turning behavior again is achieved, thereby achieving the technical effect of improving the accuracy of judging the user's turning action, and further solving the technical problem of low accuracy in turning judgment and inaccurate calculation of the user's motion data caused by only analyzing the user's action data in the related technology.
[0042] As an optional embodiment, the target action type of the target object is determined based on the target motion data, including: extracting feature data from the target motion data; inputting the feature data into a neural network model, and the neural network model outputs the action type corresponding to the feature data as the target action type, wherein the neural network model is trained using training samples, and the training samples include sample feature data and sample action types.
[0043] Optionally, the target action type of the user represented by the target motion data can be determined based on a neural network model. First, feature data in the target motion data can be extracted. Specifically, the feature data can be automatically extracted by training the neural network model, or the feature data in the target motion data can be extracted according to a data processing program that is pre-set to extract feature data, such as calculating the mean, variance, standard deviation, Euler angle, frequency, extreme value, amplitude and other values of the data to obtain feature data. Secondly, the neural network model can be used to identify the feature data to determine the target action type corresponding to the feature data.
[0044] It should be noted that the neural network model is a pre-trained model, and the training samples include sample feature data that have been labeled with sample action types; if the neural network model needs to autonomously extract feature data from the target motion data, the training samples need to be converted into sample motion data that have been labeled with sample action types. During the training process, the neural network model will continuously adjust its internal weights and biases to minimize the error between the predicted action type and the actual action type.
[0045] As an optional embodiment, obtaining the target motion data of the target object at the current moment includes: obtaining continuous motion data of the target object collected by a sensor, wherein the moment corresponding to the continuous motion data includes the current moment; based on a pre-set sliding window interval, intercepting data with a duration of a pre-set sliding window length and including the current moment in the continuous motion data as the target motion data.
[0046] Optionally, when processing the user's swimming data, the continuous data can be discretized to obtain motion data within a short period of time, and the user's actions within this short period can be identified accordingly. The continuous data can be discretized according to a pre-set sliding window length and sliding window interval, wherein the sliding window length refers to the length of the data segment selected for analysis in the continuous data, and this data segment is usually called a window; the sliding window interval refers to the step length of moving the window in the continuous data, and this step length determines the duration between two adjacent windows. By setting the window length, local feature analysis can be performed in different parts of the data, which is helpful for analyzing the features of the data in different time periods, and setting a suitable window step length can reduce the amount of data to be processed, thereby reducing the amount of calculation and increasing the processing speed. Specifically, the sliding window length can be set to a data length of 3 seconds, and the sliding window interval can be set to 2 seconds or 3 seconds.
[0047] After receiving the continuous motion data of the user's swimming process collected by the sensor, the continuous motion data can be stored in segments according to the preset sliding window length and sliding window interval, and then each segment of data is recorded with a corresponding time, which can be any time within the time period of the data segment. When performing data analysis, it can be considered that the action represented by the data segment occurred at this time. The target motion data can be motion data within any period of time, and the current moment is the moment corresponding to the target motion data. It should be noted that since counting the number of turns in swimming has high requirements for real-time data processing, the continuous motion data collected by the sensor can be segmented in real time, and then the user's action type represented by the discrete motion data can be identified in real time.
[0048] As an optional embodiment, when the target action type is suspected turning, the swimming duration of the target object from the start of swimming to the current moment is obtained, including: setting a timer, wherein the timer is configured to count based on the sum of the sliding window length and the sliding window interval at the start of swimming, and the start of swimming is the moment when it is determined that the action type of the target object is swimming; when the target action type is turning, the time recorded by the timer is read as the swimming duration, and the time recorded by the timer is cleared to zero.
[0049] Optionally, the swimming duration is the duration of the user's continuous swimming this time, and the start swimming time is the time when the user's action type is first determined to be swimming. It should be noted that the first determination here refers to the time when the user's action type is first determined to be swimming after the user's action is previously determined to be resting or other non-swimming actions such as turning. For example, if the user's action type at time t1 is resting, and the action type at the next time t2 is swimming, and the action types after time t2 are all swimming, then time t2 is the start swimming time.
[0050] A timer can be set to record the swimming duration. When the user's action type is determined to be swimming for the first time, the timer is turned on. When the user's action type is determined to be turning at a certain moment later, the timer is stopped, and the result of the timer is read as the swimming duration, and the duration recorded by the timer is cleared. It should be noted that if the timer is turned on after the action is determined to be swimming, if the user's action type is detected to change to rest during the timing process, the timing can be paused, and the timing can be continued when the user's action type is detected to change from rest to swimming.
[0051] As an optional embodiment, judging whether the target object has swum a predetermined distance based on the swimming time includes: judging whether the swimming time is less than a predetermined time threshold, and when the swimming time is less than the time threshold, determining that the target object has not swum the predetermined distance; when the swimming time is not less than the time threshold, determining that the target object has swum the predetermined distance; or judging whether the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, and when the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, determining that the target object has not swum the predetermined distance; when the ratio of the predetermined distance to the swimming time is not greater than the predetermined speed, determining that the target object has swum the predetermined distance.
[0052] Optionally, it can be determined whether the user has swum the length of the pool based on the swimming time. If the user can swim the length of the pool within the swimming time, the suspected turn is considered to be a real turn; conversely, if the user cannot swim the length of the pool within the swimming time, the suspected turn is considered to be a false turn.
[0053] Specifically, two methods can be used to determine whether the user can swim the length of the pool within the swimming time. The first method is to compare the swimming time with a preset time threshold, wherein the time threshold is an empirical value determined by statistical analysis of a large amount of experimental data, or a value set by the user, and the value can be 22 seconds, 23 seconds, 24 seconds, 25 seconds or 26 seconds, or any non-integer time value between 22-26 seconds. When the swimming time is less than the preset time threshold, it is considered that the user cannot swim the length of the pool within the swimming time; conversely, when the swimming time is not less than the preset time threshold, it is considered that the user can swim the length of the pool within the swimming time.
[0054] The second method is to use the ratio of the swimming time to the predetermined distance as the user's swimming speed, and compare the user's swimming speed with the predetermined speed, wherein the predetermined speed may be an empirical value determined by statistical analysis of a large amount of experimental data, or a value set by the user. When the user's swimming speed is greater than the predetermined speed, it is considered that the user cannot swim the predetermined distance within the swimming time; conversely, when the user's swimming speed is not greater than the predetermined speed, it is considered that the user can swim the predetermined distance within the swimming time.
[0055] As an optional embodiment, the method also includes: using a counter to record the number of turns; when it is determined that the target object has not swam the predetermined distance, determining that the suspected turn is a non-turning action, and subtracting a preset value from the count of the counter; and determining the current swimming distance of the target object based on the number of turns recorded by the counter and the predetermined distance.
[0056] Optionally, after accurately determining whether the user has turned, the number of times the user has turned during swimming can be determined, and the user's swimming distance can be determined based on the number of turns. Specifically, a counter can be set to record the number of times the user has turned during swimming, and the counter will increase each time the user completes a turn. However, if it is determined that the user has not swam the predetermined distance of the swimming pool length, it can be determined that the user's suspected turning action is not a real turn, and the count of the counter is subtracted from a preset value, where the preset value can be 1. Once the actual number of turns of the user is determined, the swimmer's current swimming distance can be calculated. For example, if the predetermined distance is 50 meters and the user has completed two turns, then they have swum at least 100 meters (50 meters x 2).
[0057] Specifically, when judging whether the user's turn is a real turn, a valid turn β closest to the current turn α will be selected, and it will be calculated whether the user can swim the predetermined distance between this valid turn β and the current turn α; if the user cannot complete the swimming distance, the current turn α and the last valid turn β will be marked as invalid turns, recorded together as a turning back action, and the number of turns will be reduced by 1; if the user can complete the swimming distance, the current turn α will be recorded as a real turn, and the number of turns will be increased by 1. It should be noted that if the user performs the next turn γ after the current turn α and the last valid turn β are both marked as invalid turns and recorded as a turning back action, then when judging whether the next turn γ is valid, the last valid turn Ω before the turn β will be found to judge whether the user can swim the predetermined distance between the valid turn Ω and the turn γ. At this time, the judgment result must be that the user can swim the predetermined distance, and the turn γ is recorded as a valid turn, and the number of turns is recorded plus 1.
[0058] As an optional embodiment, the method also includes: obtaining a pre-set swimming training plan and historical motion data, wherein the swimming training plan includes but is not limited to a planned swimming distance and a planned swimming distance completion time; estimating the swimming speed of the target object based on the historical motion data; and determining the remaining completion time of the planned swimming distance based on the current swimming distance, the swimming training plan and the swimming speed.
[0059] Optionally, in order to enable users to better perform swimming training and enhance the user's smart swimming goggles experience, a training mode can be added, and a swimming time prediction can be added to the training mode. The user can set a swimming plan in advance, and the swimming time prediction can be added when the user swims according to the swimming plan, prompting the user to reach the estimated time of the set planned swimming distance, and the remaining completion time can be predicted. The time completed can be added to the remaining completion time to get the full completion time, helping the user to further improve his swimming performance.
[0060] When the user's swimming distance reaches a set node during swimming, the data of the user's swimming is analyzed, and the current swimming status is analyzed and evaluated. The time required to spend the remaining distance is comprehensively calculated and predicted. The time is updated after each swim by the user, so that the user can predict the completion time of the remaining target distance and the total completion time, thereby improving the user experience.
[0061] The training mode can include 3 training plans, 5 training stages, 25 training tasks, and 9 training groups. You can set the relevant training plan through the APP. Users can customize the training plan or choose the training plan set by the APP by default, and then send the set training plan to the goggles.
[0062] Among them, the training plan may include: the user ID implementing the plan, the plan name, the target distance, the target timing, the target calories, and the training stage list; the training stage may include: the stage number, the stage name, the total stage time, and the training task list, wherein the stage name may specifically be a warm-up stage, a training stage, etc.; the training task may include: the task number, the number of groups, the target distance, the total duration of the swimming style task (the time type includes two types: ), and the training group list, wherein the swimming style definition may include 7 types: unlimited, freestyle, backstroke, medley, kick, paddle, breaststroke, butterfly stroke, and the time type of the total duration of the swimming style task may include the target time and the lump sum time (the lump sum time is the swimming time plus the rest time); the training group may include the group number, the target time, and the rest time.
[0063] Specifically, the method for determining the remaining completion time and the full completion time is as follows: using the data of the inertial measurement unit sensor as input data, and may also include geomagnetic and heart rate data; using the input data, obtaining real-time data information such as the intensity, stroke frequency, breathing frequency, rest time, heart rate intensity and blood oxygen (including heart rate timing) of the current swimming exercise, and using the swam data to analyze the swimming speed, giving different weights to the current swimming intensity, stroke frequency, breathing frequency, heart rate intensity and blood oxygen (including heart rate timing) and other real-time data information, and using the Kalman filter as a gain factor to estimate the swimming speed to obtain a more accurate swimming speed; when it is detected that the user has turned around, using the estimated swimming speed to calculate the time required for the remaining distance, update the remaining completion time and the full completion time (the time already swam plus the remaining completion time), and display them on the smart goggles.
[0064] As a specific embodiment, firstly, a time threshold t can be set (the distance of a swimming pool length cannot be swum within a certain time, or it can be user-defined or set as a speed threshold), and the swimming time and rest time can be initialized to 0; wherein, the swimming pool length can be customized in the smart swimming goggles terminal, and the setting range of the swimming pool length can be 1 meter-255 meters. The shielding time threshold is an empirical value determined by statistical analysis of a large amount of experimental data, and can also be a user-defined setting. Specifically, the shielding time threshold can be 22s, 23s, 24s, 25s or 26s, or any non-integer time value between 22-26s.
[0065] Secondly, the inertial measurement unit sensor data can be set as input. The sensor is set inside the wearable device, and the sensor is at least one of an accelerometer, a gyroscope, and a magnetometer. Specifically, the sensor can be a six-axis inertial measurement unit sensor, which is composed of a three-axis accelerometer and a three-axis gyroscope. The accelerometer can be a micro-electromechanical system accelerometer, and the gyroscope can be a micro-electromechanical system gyroscope.
[0066] Secondly, the sliding window length and sliding window interval can be set to perform sliding window segmentation on the input continuous data to obtain motion sensing data. The sliding window length can be set to a data length of 3s, and the sliding window interval can be set to 2 seconds or 3 seconds.
[0067] Secondly, feature extraction can be performed on the above motion sensing data to obtain transformation features (calculating transformation features such as the mean, variance, standard deviation, Euler angle, frequency, extreme value, amplitude, etc. of the data).
[0068] Secondly, the above transformation features can be input into the motion state classification model for calculation to obtain the motion state classification and output the representation corresponding to each motion state; wherein the motion state classification includes three motion states: swimming, resting, and suspected turning. The representation corresponding to each motion state can be letters or numbers, without specific limitation. For example, when represented as letters, the representation corresponding to the swimming state is S, the representation corresponding to the rest is R, and the representation corresponding to the suspected turning is T; for another example, when represented as numbers, the representation corresponding to the swimming state is 1, the representation corresponding to the rest is 2, and the representation corresponding to the suspected turning is 3. Among them, the motion state classification model is a network model constructed based on neural network and Bayesian estimation theory, and the specific structure is not limited.
[0069] Finally, the current motion state is determined according to the representations corresponding to each motion state, the current motion state time is counted, and the corresponding user action is determined. The current motion state time is the set time corresponding to the sliding window length plus the time of a sliding window interval.
[0070] Specifically, when the network model result output is 1, the current state is swimming, and the swimming action time is added to obtain the swimming time ts, which is the set time corresponding to the sliding window length plus the time of a sliding window interval; if the network model result output is 2, the current state is resting, and the rest time tr is added to obtain the rest time, which is the set time corresponding to the sliding window length plus the time of a sliding window interval; if the network model result output is 3, the swimming time ts is counted, and when the swimming time is greater than the shielding time threshold, that is, ts>t, it is recorded as a turn, and the swimming distance is updated. The pool length is added to the original swimming distance to obtain a new swimming distance, and the swimming time and rest time are reset to 0; when the last turning action is recognized, the turn is recognized again, and the swimming time ts is less than the time threshold t, the turn is invalid, and the number of turns is not updated. The current turn and the last turn can be processed as a turn back, that is, the current valid number of turns is reduced by 1, and the current swimming distance is reduced by the length of the swimming pool. It should be noted that the motion state classification model can first determine the turning state based on the motion sensor data, and then distinguish the real turn 3 and the pseudo turn 4 based on the comparison between the swimming time and the time threshold; the motion state classification model can also be made to directly learn the logic of comparing the swimming time with the time threshold during the training process. At this time, the motion state classification model will directly give the turning result 3 and the pseudo turn result 4 after extracting the data.
[0071] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that the turn detection method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0073] According to an embodiment of the present invention, a turn detection device for implementing the above turn detection method is also provided. Figure 3 is a structural block diagram of a turn detection device provided according to an embodiment of the present invention. Figure 3 As shown, the turn detection device includes: a first acquisition module 31, a first determination module 32, a second acquisition module 33, a judgment module 34 and a second determination module 35. The turn detection device is described below.
[0074] The first acquisition module 31 is used to acquire the target motion data of the target object at the current moment.
[0075] The first determination module 32 is connected to the first acquisition module 31 and is used to determine the target motion type of the target object according to the target motion data.
[0076] The second acquisition module 33 is connected to the first determination module 32, and is used to obtain the swimming time of the target object from the start of swimming to the current time when the target action type is suspected turning.
[0077] The judging module 34 is connected to the second obtaining module 33 and is used to judge whether the target object has swum a predetermined distance according to the swimming time.
[0078] The second determination module 35 is connected to the judgment module 34 and is used to determine that the suspected turn is a turn action when the judgment result is that the target object has swam a predetermined distance.
[0079] It should be noted that the first acquisition module 31, the first determination module 32, the second acquisition module 33, the judgment module 34 and the second determination module 35 correspond to steps S202 to S210 in the embodiment, and the examples and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules, as part of the device, can be run in the electronic system 10 provided in the embodiment.
[0080] An embodiment of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one of a plurality of network devices of a computer network. The computer device may be a wearable device, comprising: a sensor, a processor and a memory, wherein the sensor is used to collect target motion data of the target object at the current moment and transmit it to the processor; the memory stores a computer program; the processor is used to execute the computer program stored in the memory, and when the computer program is running, the processor executes any one of the above-mentioned turn detection methods.
[0081] The processor can be used to store software programs and modules, such as the program instructions / modules corresponding to the turn detection method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned turn detection method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the electronic system via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0082] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: obtain the target motion data of the target object at the current moment; determine the target action type of the target object based on the target motion data; when the target action type is a suspected turn, obtain the swimming time of the target object from the start of swimming to the current moment; based on the swimming time, determine whether the target object has swam a predetermined distance; when the judgment result is that the target object has swam the predetermined distance, determine that the suspected turn is a turning action.
[0083] Optionally, the processor may also execute program code of the following steps: obtaining target motion data of the target object at the current moment, including: obtaining continuous motion data of the target object collected by the sensor, wherein the moment corresponding to the continuous motion data includes the current moment; based on a pre-set sliding window interval, intercepting data in the continuous motion data with a duration of a pre-set sliding window length and including the current moment as the target motion data.
[0084] Optionally, the processor may also execute program code of the following steps: when the target action type is suspected turning, obtaining the swimming duration of the target object from the start time of swimming to the current time, including: setting a timer, wherein the timer is configured to count based on the sum of the sliding window length and the sliding window interval at the start time of swimming, and the start time of swimming is the time when it is determined that the action type of the target object is swimming; when the target action type is turning, reading the time recorded by the timer as the swimming duration, and clearing the time recorded by the timer.
[0085] Optionally, the processor may also execute program code of the following steps: determining the target action type of the target object based on the target motion data, including: extracting feature data from the target motion data; inputting the feature data into a neural network model, and outputting the action type corresponding to the feature data from the neural network model as the target action type, wherein the neural network model is trained using training samples, and the training samples include sample feature data and sample action types.
[0086] Optionally, the processor may also execute the following program code: judging whether the target object has swum a predetermined distance based on the swimming time, including: judging whether the swimming time is less than a predetermined time threshold, and if the swimming time is less than the time threshold, determining that the target object has not swum the predetermined distance; if the swimming time is not less than the time threshold, determining that the target object has swum the predetermined distance; or judging whether the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, and if the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, determining that the target object has not swum the predetermined distance; and if the ratio of the predetermined distance to the swimming time is not greater than the predetermined speed, determining that the target object has swum the predetermined distance.
[0087] Optionally, the processor may also execute program code of the following steps: the method also includes: using a counter to record the number of turns; when it is determined that the target object has not swam the predetermined distance, determining the suspected turn to be a non-turning action, and subtracting a preset value from the count of the counter; determining the current swimming distance of the target object based on the number of turns recorded by the counter and the predetermined distance.
[0088] Optionally, the processor may also execute program code of the following steps: the method also includes: obtaining a pre-set planned swimming distance and historical motion data; estimating the swimming speed of the target object based on the historical motion data; determining the remaining completion time of the planned swimming distance based on the current swimming distance, the planned swimming distance and the swimming speed.
[0089] By adopting the embodiment of the present invention, a solution for turn detection is provided. By acquiring the target motion data of the target object at the current moment; determining the target action type of the target object according to the target motion data; acquiring the swimming time of the target object from the start of swimming to the current moment when the target action type is suspected turning; judging whether the target object has swum a predetermined distance according to the swimming time; and determining the suspected turning as a turning action when the judgment result is that the target object has swum the predetermined distance, the purpose of judging the rationality of the user's turning behavior again is achieved when the user's behavior is determined to be suspected turning based on the action data, thereby achieving the technical effect of improving the accuracy of judging the user's turning action, thereby solving the technical problem that the accuracy of turning judgment is not high due to only analyzing the user's action data in the related technology, and then the user's motion data calculation is inaccurate.
[0090] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a non-volatile storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0091] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the turn detection method provided in the embodiment.
[0092] Optionally, in this embodiment, the non-volatile storage medium may be located in any electronic system in a group of electronic systems in a computer network, or in any mobile terminal in a group of mobile terminals.
[0093] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining target motion data of the target object at a current moment; determining the target action type of the target object based on the target motion data; when the target action type is a suspected turn, obtaining the swimming time of the target object from the start of swimming to the current moment; based on the swimming time, determining whether the target object has swum a predetermined distance; when the judgment result is that the target object has swum the predetermined distance, determining that the suspected turn is a turning action.
[0094] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining target motion data of the target object at the current moment, including: obtaining continuous motion data of the target object collected by the sensor, wherein the moment corresponding to the continuous motion data includes the current moment; based on a pre-set sliding window interval, intercepting data with a duration of a pre-set sliding window length and including the current moment in the continuous motion data as the target motion data.
[0095] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: in the case where the target action type is suspected turning, obtaining the swimming duration of the target object from the start time of swimming to the current time, including: setting a timer, wherein the timer is configured to count based on the duration of the sum of the sliding window length and the sliding window interval at the start time of swimming, and the start time of swimming is the time when it is determined that the action type of the target object is swimming; in the case where the target action type is turning, the time recorded by the timer is read as the swimming duration, and the time recorded by the timer is cleared to zero.
[0096] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: determining the target action type of the target object based on the target motion data, including: extracting feature data from the target motion data; inputting the feature data into a neural network model, and the action type corresponding to the feature data output by the neural network model is the target action type, wherein the neural network model is trained using training samples, and the training samples include sample feature data and sample action types.
[0097] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: judging whether the target object has swum a predetermined distance based on the swimming time, including: judging whether the swimming time is less than a predetermined time threshold, and when the swimming time is less than the time threshold, determining that the judgment result is that the target object has not swum the predetermined distance; when the swimming time is not less than the time threshold, determining that the judgment result is that the target object has swum the predetermined distance; or, judging whether the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, and when the ratio of the predetermined distance to the swimming time is greater than a predetermined speed, determining that the judgment result is that the target object has not swum the predetermined distance; when the ratio of the predetermined distance to the swimming time is not greater than the predetermined speed, determining that the judgment result is that the target object has swum the predetermined distance.
[0098] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: the method also includes: using a counter to record the number of turns; when it is judged that the target object has not swam the predetermined distance, determining the suspected turn as a non-turning action, and subtracting a preset value from the count of the counter; determining the current swimming distance of the target object based on the number of turns recorded by the counter and the predetermined distance.
[0099] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: the method also includes: obtaining a pre-set planned swimming distance, and historical motion data; estimating the swimming speed of the target object based on the historical motion data; determining the remaining completion time of the planned swimming distance based on the current swimming distance, the planned swimming distance and the swimming speed.
[0100] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the turn detection method in each embodiment of the present application.
[0101] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0102] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0103] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0105] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0106] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0107] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A turn detection method, characterized in that: include: Obtain the target motion data of the target object at the current moment; Determining a target motion type of the target object according to the target motion data; When the target action type is suspected turning, obtaining the swimming time of the target object from the start of swimming to the current time; According to the swimming time, determining whether the target object has swum a predetermined distance; If the result of the determination is that the target object has swum the predetermined distance, the suspected turn is determined to be a turning action; otherwise, the suspected turn is determined to be a non-turning action.
2. The method according to claim 1, characterized in that The step of obtaining the target motion data of the target object at the current moment includes: Acquire continuous motion data of the target object collected by a sensor, wherein the time corresponding to the continuous motion data includes the current time; Based on a preset sliding window interval, data with a duration equal to the preset sliding window length and including the current moment is intercepted from the continuous motion data as the target motion data.
3. The method according to claim 2, characterized in that When the target action type is a suspected turn, obtaining the swimming time of the target object from the start of swimming to the current time includes: Setting a timer, wherein the timer is configured to count based on the sum of the sliding window length and the sliding window interval at the start swimming time, and the start swimming time is the time when the action type of the target object is determined to be swimming; When the target action type is turning, the time recorded by the timer is read as the swimming duration, and the duration recorded by the timer is cleared.
4. The method according to claim 1, characterized in that: The step of determining the target motion type of the target object according to the target motion data includes: Extracting feature data from the target motion data; The feature data is input into a neural network model, and the action type corresponding to the feature data output by the neural network model is the target action type, wherein the neural network model is trained using training samples, and the training samples include sample feature data and sample action types.
5. The method according to claim 1, characterized in that The step of judging whether the target object has swum a predetermined distance according to the swimming time includes: Determine whether the swimming time is less than a predetermined time threshold, and if the swimming time is less than the time threshold, determine that the determination result is that the target object has not swam the predetermined distance; if the swimming time is not less than the time threshold, determine that the determination result is that the target object has swam the predetermined distance; Or, determine whether the ratio of the predetermined distance to the swimming time is greater than a predetermined speed. When the ratio of the predetermined distance to the swimming time is greater than the predetermined speed, determine that the judgment result is that the target object has not swam the predetermined distance; when the ratio of the predetermined distance to the swimming time is not greater than the predetermined speed, determine that the judgment result is that the target object has swam the predetermined distance.
6. The method according to any one of claims 1 to 5, characterized in that Also includes: Use a counter to record the number of turns; If the judgment result is that the target object has not swum the predetermined distance, determining that the suspected turn is a non-turn action, and subtracting a preset value from the count of the counter; The current swimming distance of the target object is determined according to the number of turns recorded by the counter and the predetermined distance.
7. The method according to claim 6, characterized in that Also includes: Obtaining a pre-set swimming training plan and historical exercise data, wherein the swimming training plan includes but is not limited to a planned swimming distance and a planned swimming distance completion time; estimating a swimming speed of the target object based on the historical motion data; The remaining completion time of the planned swimming distance is determined according to the current swimming distance, the swimming training plan and the swimming speed.
8. A turn detection device, characterized in that: include: A first acquisition module is used to acquire target motion data of the target object at the current moment; A first determination module, configured to determine a target motion type of the target object according to the target motion data; A second acquisition module is used to acquire the swimming time of the target object from the start of swimming to the current time when the target action type is a suspected turn; A judgment module, used for judging whether the target object has swum a predetermined distance according to the swimming time; The second determination module is used to determine that the suspected turn is a turning action if the judgment result is that the target object has swam the predetermined distance, and otherwise, determine that the suspected turn is a non-turning action.
9. A wearable device, characterized in that: include: Sensors, processors and memory, where The sensor is used to collect target motion data of the target object at the current moment and transmit it to the processor; The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor executes the turn detection method according to any one of claims 1 to 7.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the turn detection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Smartwatch-based swimming motion analysis method and smartwatch
CN107376247A
Swimming information detection method and device and electronic equipment
CN108245869A
Swimming motion monitoring method, device and system as well as storage medium
CN109806568A
Motion analysis method and device, wearable equipment and storage medium
CN118416447A
Electronic timing swimmer's goggles
US5685722A
