Action counting method, action counting device, electronic equipment and storage medium
By recording sensor data in electronic devices and combining European distance calculations, the problem of user-defined action recognition and counting is solved, and the recognition and counting of multiple actions is realized, which broadens the application scenarios of action recognition.
Patent Information
- Application Number
- CN202410186123.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-19
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, electronic devices cannot support user-defined action recognition and counting, and cannot temporarily add recognition and counting functions for new actions, resulting in the inability to realize action counting when facing unstored actions.
By recording sensor data in electronic devices and obtaining real-time sensor data and stored data when needed, combined with European-style distance calculation, action recognition and counting are realized, and user-defined action entry and management are supported.
The scenario of user action recognition has been broadened and the function of counting multiple actions has been realized. Users can customize actions and recognize and count without pre-training the model.
Smart Images

Figure CN120502081A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of motion recognition, and in particular to a motion counting method, a motion counting device, an electronic device, and a storage medium. Background Art
[0002] During sports training or competitions, an action counting device is often required to count the actions performed by athletes, so as to analyze and evaluate the actions performed by the athletes.
[0003] In related technologies, motion counting is typically achieved through electronic devices containing motion sensors. However, implementing motion counting requires pre-collecting data, extracting features, and training models to identify and count specific motions. However, related technologies typically identify and count specific motions and do not support user-defined motions. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides an action counting method, an action counting device, an electronic device and a storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, an action counting method is provided, comprising: in response to receiving an instruction for action counting, determining a target action corresponding to the instruction, and determining first data, wherein the first data is sensor data corresponding to the target action pre-recorded in the electronic device; obtaining second data, wherein the second data is sensor data obtained after the first prompt information is issued; determining the number of times the target action is performed based on the first data and the second data; and outputting a counting result in response to receiving an end instruction.
[0006] In one embodiment, before acquiring the second data, the method further includes: issuing a first prompt message after a preset time, wherein the first prompt message is used to prompt the start of action counting.
[0007] In one embodiment, the first data includes a single group of data or the first data includes a preset number of groups of data; determining the number of times the target action is performed based on the first data and the second data includes: in response to the first data including a single group of data, determining the number of times the target action is performed based on the single group of data and the second data; or in response to the first data including a preset number of groups of data, determining the number of times the target action is performed based on the preset number of groups of data and the second data.
[0008] In one embodiment, the second data includes multiple groups of window data, each group of window data corresponds to sensor data collected by a single action window; determining the number of times the target action is performed based on the single group of data and the second data includes: each time a group of window data is obtained, obtaining the current Euclidean distance between the most recently obtained window data and the single group of data; in response to the current Euclidean distance being less than or equal to a preset distance threshold, determining the number of times the target action is performed plus one, and determining the current number of times the target action is performed.
[0009] In one embodiment, determining the number of times the target action is performed based on the preset number of groups of data and the second data includes: each time a group of window data is obtained, for each group of data in the preset number of groups of data, obtaining the current Euclidean distance between each group of data and the window data; determining the current number of data groups in the preset number of groups of data whose current Euclidean distance is less than or equal to a preset distance threshold; in response to the ratio between the current number and the preset number being greater than a preset ratio threshold, determining the number of times the target action is performed plus one, and determining the current number of times the target action is performed.
[0010] In one embodiment, the electronic device includes sensor data corresponding to multiple types of actions; the sensor data corresponding to the multiple types of actions are recorded in the following manner: in response to receiving an instruction to record an action, determining the action to be recorded, and issuing a second prompt message, the second prompt message being used to prompt the part of the limb on which the electronic device is worn corresponding to the action to be recorded; after a preset time, issuing a third prompt message, and obtaining current sensor data at a preset frequency within a preset time period, the third prompt message being used to prompt the start of action recording; determining the sensor data obtained within the preset time period as the sensor data corresponding to the action to be recorded, and popping up a first window; in response to the user issuing an instruction to store the action in the first window, recording the sensor data corresponding to the action to be recorded based on the number of stored actions and a preset number threshold.
[0011] In one embodiment, the recording of sensor data corresponding to the action to be recorded based on the number of stored actions and a preset quantity threshold includes: in response to the number of stored actions being less than the quantity threshold, recording the current sensor data into the electronic device; in response to the number of stored actions being equal to the quantity threshold, popping up a second window, and recording the sensor data corresponding to the action to be recorded according to the processing instructions issued by the user in the second window, the second window is used to prompt the user to overwrite the sensor corresponding to the stored action or delete the sensor data corresponding to the action to be recorded.
[0012] In one embodiment, the method further includes: in response to a user issuing a re-entry instruction in the first window, deleting the sensor data corresponding to the action to be entered, and re-executing the action entry process for the action to be entered; in response to a user issuing a continue entry instruction in the first window, saving the sensor data corresponding to the action to be entered, and continuing the action entry process for the action to be entered.
[0013] In one embodiment, the method further includes: in response to receiving an instruction to supplement an existing action, popping up a list of stored actions; and based on the stored action selected by the user in the list, executing the action entry process for the stored action selected by the user.
[0014] According to a second aspect of an embodiment of the present disclosure, an action counting device is provided, including: a determination unit for determining, in response to receiving an instruction for action counting, a target action corresponding to the instruction, and determining first data, where the first data is sensor data corresponding to the target action pre-recorded in the electronic device; an acquisition unit for acquiring second data, where the second data is sensor data acquired after a first prompt message is issued; a processing unit for determining the number of times the target action is performed based on the first data and the second data; and an output unit for outputting a counting result in response to receiving an end instruction.
[0015] In one embodiment, before acquiring the second data, the determining unit is further configured to: issue a first prompt message after a preset time, where the first prompt message is used to prompt the start of action counting.
[0016] In one embodiment, the first data includes a single group of data or the first data includes a preset number of groups of data; the processing unit determines the number of times the target action is performed based on the first data and the second data in the following manner: in response to the first data including a single group of data, the number of times the target action is performed is determined based on the single group of data and the second data; or in response to the first data including a preset number of groups of data, the number of times the target action is performed is determined based on the preset number of groups of data and the second data.
[0017] In one embodiment, the second data includes multiple groups of window data, each group of window data corresponds to sensor data collected by a single action window; the processing unit determines the number of times the target action is performed based on the single group of data and the second data in the following manner: each time a group of window data is obtained, the current Euclidean distance between the most recently obtained window data and the single group of data is obtained; in response to the current Euclidean distance being less than or equal to a preset distance threshold, the number of times the target action is performed is determined to be plus one, and the number of times the target action is currently being performed is determined.
[0018] In one embodiment, the processing unit determines the number of times the target action is performed based on the preset number of groups of data and the second data in the following manner: each time a group of window data is obtained, for each group of data in the preset number of groups of data, the current Euclidean distance between each group of data and the window data is obtained; the current number of data groups in the preset number of groups of data whose current Euclidean distance is less than or equal to a preset distance threshold is determined; in response to the ratio between the current number and the preset number being greater than a preset ratio threshold, the number of times the target action is performed is determined to be plus one, and the number of times the target action is currently performed is determined.
[0019] In one embodiment, the electronic device includes sensor data corresponding to multiple types of actions; the sensor data corresponding to the multiple types of actions are recorded by the processing unit in the following manner: in response to receiving an instruction to record an action, determining the action to be recorded, and issuing a second prompt message, the second prompt message being used to prompt the part of the limb on which the electronic device is worn corresponding to the action to be recorded; after a preset time, issuing a third prompt message, and obtaining current sensor data at a preset frequency within a preset time period, the third prompt message being used to prompt the start of action recording; determining the sensor data obtained within the preset time period as the sensor data corresponding to the action to be recorded, and popping up a first window; in response to the user issuing an instruction to store the action in the first window, recording the sensor data corresponding to the action to be recorded based on the number of stored actions and a preset number threshold.
[0020] In one embodiment, the processing unit records the sensor data corresponding to the action to be recorded according to the number of stored actions and a preset quantity threshold in the following manner: in response to the number of stored actions being less than the quantity threshold, the current sensor data is recorded into the electronic device; in response to the number of stored actions being equal to the quantity threshold, a second window pops up, and the sensor data corresponding to the action to be recorded is recorded according to the processing instructions issued by the user in the second window, and the second window is used to prompt the user to overwrite the sensor corresponding to the stored action or delete the sensor data corresponding to the action to be recorded.
[0021] In one embodiment, the processing unit is also used to: in response to the user issuing a re-entry instruction in the first window, delete the sensor data corresponding to the action to be recorded, and re-execute the action recording process for the action to be recorded; in response to the user issuing a continue recording instruction in the first window, save the sensor data corresponding to the action to be recorded, and continue the action recording process for the action to be recorded.
[0022] In one embodiment, the processing unit is further used to: pop up a list of stored actions in response to receiving an instruction to supplement an existing action; and execute an action entry process for the stored action selected by the user based on the stored action selected by the user in the list.
[0023] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to: execute the action counting method described in the first aspect or any one of the embodiments of the first aspect.
[0024] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the action counting method described in the first aspect or any one of the embodiments of the first aspect.
[0025] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: when counting actions, determining the target action that needs to be counted, and determining the sensor data corresponding to the target action in the electronic device. After a preset time, a prompt message is issued to prompt the start of action counting, and sensor data is obtained after the first prompt message is issued. Based on the stored sensor data and the sensor data obtained in real time, the number of times the target action is performed is determined. After receiving the end instruction, the counting result is output. Through the present disclosure, an action counting function for multiple actions is provided to users through a single electronic device, which broadens the scenarios for user action recognition.
[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0028] Figure 1 The figure is a flowchart of an action counting method according to an exemplary embodiment.
[0029] Figure 2 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0030] Figure 3 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0031] Figure 4The present invention is a flowchart showing a method for determining the number of times a target action is performed according to first data and second data according to an exemplary embodiment.
[0032] Figure 5 The present invention is a flowchart showing a method for determining the number of times a target action is performed based on a single set of data and second data according to an exemplary embodiment.
[0033] Figure 6 The present invention is a flowchart showing a method for determining the number of times a target action is performed according to a preset number of sets of data and second data according to an exemplary embodiment.
[0034] Figure 7 The figure is a flowchart of a method for inputting sensor data according to an exemplary embodiment.
[0035] Figure 8 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0036] Figure 9 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0037] Figure 10 The flowchart of a method for recording sensor data corresponding to an action to be recorded is shown according to an exemplary embodiment.
[0038] Figure 11 A schematic diagram of a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure is shown.
[0039] Figure 12 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0040] Figure 13 The flowchart of a method for recording sensor data corresponding to an action to be recorded is shown according to an exemplary embodiment.
[0041] Figure 14 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0042] Figure 15 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0043] Figure 16 The flowchart of a method for recording sensor data corresponding to an action to be recorded is shown according to an exemplary embodiment.
[0044] Figure 17 is a schematic diagram showing a window for issuing a control instruction to an electronic device according to an exemplary embodiment of the present disclosure.
[0045] Figure 18 The figure is a flowchart of a method for entering motion data according to an exemplary embodiment of the present disclosure.
[0046] Figure 19 The figure is a block diagram of an action counting device according to an exemplary embodiment.
[0047] Figure 20 It is a block diagram showing a device for counting actions according to an exemplary embodiment. DETAILED DESCRIPTION
[0048] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different drawings represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present disclosure.
[0049] The action counting method provided by the embodiments of the present disclosure is applied to scenarios where an electronic device is used to identify and count multiple actions.
[0050] During sports training or competitions, motion counting devices are often needed to count the movements performed by athletes, allowing for analysis and evaluation. For example, in a rope skipping competition, a player's score is determined by counting the number of jumps within a certain timeframe. Another example is when training a specific movement, which requires completing multiple sets of movements, each with a fixed number of required movements. A counting device can help users complete these movements and assist them in completing their training.
[0051] In the related art, the aforementioned motion recognition or counting functions are generally implemented using electronic devices that include motion sensors. Specifically, motion recognition and counting are achieved through motion judgment models and logic pre-stored in the wearable device, as well as sensor data collected by a three-axis sensor installed in the wearable device. However, in the related art, implementing motion counting functions using electronic devices requires pre-collecting data, extracting features, and training models, or setting threshold parameters. This allows the judgment logic or model used for motion recognition and counting to be stored in the wearable device to enable recognition and counting of specific motions. However, users are unable to implement these data collection and model training processes, meaning they cannot customize motion counting and recognition functions for newly added motions in their wearable devices. This results in limited motion recognition and counting functions supported by electronic devices. For unstored motions, motion counting is impossible, and it is also impossible to add recognition and counting functions for these motions to the electronic device. Therefore, in real life, if you want to customize motions and achieve recognition and counting, the electronic devices described in the related art are not applicable. For example, an electronic device only supports the recognition and counting of dumbbell lifting movements. However, in a sports meet, one segment involves competing in the number of times dumbbells are lifted within a fixed time, and then competing in the number of times high leg raises are performed within a fixed time. An electronic device that only supports the recognition and counting of dumbbell lifting movements cannot implement the aforementioned technologies for different movements, nor can it be customized by the user to temporarily add the recognition and counting functions for high leg raises.
[0052] In view of this, the present disclosure proposes a method for motion recognition. For a single electronic device, sensor data is recorded by a motion sensor provided in the electronic device. After receiving a motion recording instruction, sensor data corresponding to the action to be recorded is obtained, and the sensor data corresponding to the action to be recorded is stored in the electronic device. When motion counting is required, the recognition and counting of the action is achieved through the real-time sensor data obtained by the motion sensor in the electronic device and the sensor data of the stored action. Through the present disclosure, the user is provided with the functions of customized action recording, action counting and action management, without the need to train the model in advance, which broadens the scenarios for user action recognition.
[0053] Figure 1 FIG. 1 is a flow chart showing an action counting method according to an exemplary embodiment. Figure 1 As shown, the method includes steps S101 to S104.
[0054] In step S101 , in response to receiving an instruction for action counting, a target action corresponding to the instruction is determined, and first data is determined. The first data is sensor data corresponding to the target action pre-recorded in the electronic device.
[0055] In step S102, second data is acquired, where the second data is sensor data acquired after the first prompt information is issued.
[0056] In step S103 , the number of times the target action is performed is determined based on the first data and the second data.
[0057] In step S104 , in response to receiving the end instruction, the counting result is output.
[0058] In the embodiments of the present disclosure, the action counting method is applied to electronic devices, including but not limited to wearable portable devices such as smart watches and sports bracelets.
[0059] In an embodiment of the present disclosure, a user issues an instruction to count actions in a window on the display interface of an electronic device regarding the action recognition and counting function, and after a preset time interval, a prompt message to start action counting is issued, prompting the user to start the action. Sensor data (second data) collected by the motion sensor in the electronic device is acquired in real time, and action counting is performed based on the real-time collected data and the sensor data (second data) corresponding to the target action stored in the electronic device. Counting ends and the counting result is output after receiving the end instruction.
[0060] It is understandable that when an electronic device is used to count actions, the electronic device may issue a prompt message during the action counting process and after the action counting is finished, prompting the user of the number of actions currently being performed and the final number of actions performed in total. For example, during the action counting process, "Number of times: n" (n is the number of actions currently being performed) is displayed on the electronic device display interface. After the user selects the end option, a voice prompt message "A total of m actions have been performed" (m is the final number of actions performed in total) is issued. It is further understandable that the action of the electronic device to end the counting may not be triggered by the user. The user may pre-set the timer duration for the action counting (such as 3 minutes, 10 minutes, etc.), start the timing after the prompt message for starting the action counting is issued, and automatically end the action counting after the timing duration reaches the timer duration.
[0061] Through the present disclosure, when action counting is required, the target action to be counted is determined, and the action is recognized and counted using real-time sensor data acquired by the motion sensor in the electronic device and the sensor data corresponding to the target action in the stored actions. Providing users with action counting functions for different actions through a single electronic device broadens the scenarios for user action recognition.
[0062] In an exemplary embodiment of the present disclosure, Figure 2As shown in the schematic diagram of the window for issuing control instructions to electronic devices, the window for motion recognition and counting functions in the electronic device includes "motion recording", "motion recognition" and "motion management" options. After the user selects the "motion recognition" function, the next level window for selecting the target action pops up, such as Figure 3 As shown in the schematic diagram of the window for issuing control instructions to electronic devices, the window for selecting the target action includes the action names "Action Name A, Action Name B, ..." corresponding to the locally stored actions. The window for selecting the target action also includes a virtual key for "Confirm" and a virtual key for "Cancel". After the user selects the action name and clicks the "Confirm" key, the subsequent action counting process is executed.
[0063] It is understandable that after receiving the instruction for action counting, the user needs a certain amount of time to prepare before performing the action. Therefore, between receiving the instruction and obtaining the second data, it is necessary to reserve time for the user to prepare. The following embodiments of this disclosure further illustrate the method for obtaining the second data.
[0064] In one implementation of the embodiment of the present disclosure, before acquiring the second data, the method further includes: issuing a first prompt message after a preset time, wherein the first prompt message is used to prompt the start of action counting.
[0065] In the disclosed embodiments, the preset time is the time reserved for the user to prepare. It is understood that the length of the preset time can be customized by the user, such as 3 seconds or 10 seconds. It is further understood that within the preset time, the electronic device can issue a prompt message to inform the user of the remaining time before the action count begins, such as by displaying a countdown on a display interface or issuing a voice prompt message to count down.
[0066] It is understandable that for the same action, the user can pre-enter a single set of sensor data (first data) in the electronic device for action recognition and counting, or can enter multiple sets of sensor data (first data) for action recognition and counting. Different action recognition logic is required for different scenarios where the sensor data (first data) corresponding to the target action in the electronic device is a single set of data or multiple sets of data. The following embodiments of the present disclosure illustrate the method for determining the number of times a target action is performed.
[0067] Figure 4 FIG. 1 is a flow chart showing a method for determining the number of times a target action is performed based on first data and second data according to an exemplary embodiment. Figure 4 As shown, the method includes step S201, step S202A and step S202B.
[0068] In step S201, second data is acquired, where the second data is sensor data acquired after the first prompt information is issued.
[0069] In step S202A, in response to the first data including a single set of data, the number of times the target action is performed is determined based on the single set of data and the second data.
[0070] In step S202B, in response to the first data including a preset number of groups of data, the number of times the target action is performed is determined according to the preset number of groups of data and the second data.
[0071] It is understandable that when users are training or competing, the different actions they perform have different difficulty coefficients, and the corresponding recognition accuracy when using electronic devices for action recognition is different. For the actions with different difficulty coefficients mentioned above, users can selectively set a single set of sensor data for action recognition or multiple sets of sensor data for action recognition in the electronic device. In one example, for relatively simple actions, the electronic device is provided with a single set of sensor data for action recognition. When counting actions, the recognition and counting of actions can be completed by performing a single logical judgment on the single set of data and the real-time collected data one by one. In another example, for relatively complex actions, the electronic device is provided with multiple sets of sensor data for action recognition. When counting actions, each set of data in the multiple sets of sensor data is logically judged with the real-time collected data. After completing multiple logical judgments, it is determined whether the action execution is recognized based on the results of the multiple logical judgments, thereby completing the recognition and counting of actions.
[0072] Through the present disclosure, a single set of sensor data or multiple sets of sensor data are pre-stored in the electronic device for different actions. When performing action recognition and counting, different action recognition logics are adopted based on the different numbers of sensor data groups corresponding to the target action in the electronic device to ensure the accuracy of action recognition and the accuracy of action counting results.
[0073] In the embodiment of the present disclosure, during the process of counting actions, each time the electronic device collects a set of sensor data corresponding to a single action, it performs action recognition and counting. The following embodiment of the present disclosure describes a method for determining the number of times a target action is performed.
[0074] Figure 5 FIG. 1 is a flow chart showing a method for determining the number of times a target action is performed based on a single set of data and a second set of data according to an exemplary embodiment. Figure 5 As shown, the method includes steps S301 to S302.
[0075] In step S301 , each time a set of window data is obtained, the current Euclidean distance between the most recently obtained window data and the single set of data is obtained.
[0076] In step S302 , in response to the current Euclidean distance being less than or equal to the preset distance threshold, the number of times the target action is performed is incremented by one, and the current number of times the target action is performed is determined.
[0077] In an embodiment of the present disclosure, when counting actions, each time the user performs a target action, the motion sensor in the electronic device can obtain a set of sensor data (i.e., window data) corresponding to the target action. It can be understood that the number of sub-data contained in the data corresponding to the target action stored in the electronic device is the same as the number of sub-data contained in the collected window data. The present disclosure can complete the recognition and counting of actions by calculating the Euclidean distance between the above-mentioned window data and the stored data. When the Euclidean distance is less than or equal to the distance threshold, it is considered that the execution of a target action is recognized, and the number of executed target actions is increased by one based on the current number. In an embodiment of the present disclosure, after the electronic device issues a prompt message, the window data is acquired one by one in a time sequence, and action recognition and counting are performed. After each recognition of the execution of the target action, the action count is accumulated to obtain the current number of executed actions.
[0078] In an exemplary embodiment of the present disclosure, action counting is performed in the following manner: in response to starting action counting, when the existing recorded duration (i.e., the execution duration corresponding to the stored action) is met, it is confirmed that a set of sensor data corresponding to the executed action has been collected, and the Euclidean distance between the executed action and the stored action is calculated. That is: D(a,b)=sqrt(sum((a_i-b_i)^2)), where D(a,b) is the Euclidean distance between the executed action and the stored action. Wherein, a is the executed action, b is the stored action, a_i is the window data corresponding to the executed action, and b_i is the single set of sensor data corresponding to the stored action. In response to D(a,b)≤thre, it is considered that an action is detected, the first pointer moves step, and waits until the next action window is full. In response to D(a,b)>thre, it is considered that no action is detected, the first pointer moves 1 sampling point, and waits until the action window is full before detecting again. Wherein, thre is the Euclidean length threshold, and step is the step size. In one example, the step size can be set to 0.7*the duration of the existing record.
[0079] The following embodiments of the present disclosure illustrate a method for determining the number of times a target action is performed based on a preset number of sets of data and second data.
[0080] Figure 6 This is a flow chart showing a method for determining the number of times a target action is performed based on a preset number of sets of data and second data according to an exemplary embodiment. Figure 6 As shown, the method includes steps S401 to S403.
[0081] In step S401 , each time a set of window data is obtained, for each set of data in a preset number of sets of data, the current Euclidean distance between each set of data and the window data is obtained.
[0082] In step S402 , the current number of data groups whose current Euclidean distance is less than or equal to a preset distance threshold among the preset number of data groups is determined.
[0083] In step S403 , in response to the ratio between the current number and the preset number being greater than the preset ratio threshold, the number of times the target action is performed is incremented by one, and the current number of times the target action is performed is determined.
[0084] In an embodiment of the present disclosure, when counting actions, each time a user performs a target action, a motion sensor in an electronic device can obtain a set of sensor data (i.e., window data) corresponding to the target action. It is understood that the number of sub-data contained in each set of data in the preset number of groups of data is the same as the number of sub-data contained in the collected window data. For each set of data in the preset number of groups of data in the present disclosure, the Euclidean distance between the above-mentioned window data and the stored data is calculated one by one, and the number of stored data whose Euclidean distance is less than or equal to the Euclidean distance threshold is determined, and the ratio between this number and the preset number is determined. When the ratio between this number and the preset number is greater than or equal to the ratio threshold, it is considered that the execution of a target action has been recognized, and the number of executed target actions is increased by one based on the current number. When the ratio between this number and the preset number is less than the distance threshold, it is considered that the execution of the target action has not been recognized, and no counting is performed. In an embodiment of the present disclosure, after the electronic device issues a prompt message, the window data is acquired one by one in a time sequence, and action recognition and counting are performed. After each recognition of the execution of the target action, the action count is accumulated to obtain the current number of executed actions.
[0085] In an exemplary embodiment of the present disclosure, action counting is performed as follows: N sets of stored data corresponding to a target action are determined within a preset number of data sets. For each set of stored data corresponding to the target action, the Euclidean distance between the root stored action and the executed action is calculated. D1(a1,b1)=sqrt(sum((a1_i–b1_i)^2)). Where a1 is the executed action, b1 is the stored action, a1_i is the window data corresponding to the executed action, and b1_i is a single set of sensor data from the preset number of data sets corresponding to the stored action. In response to greater than or equal to k*N D(a1,b1) being greater than or equal to a threshold thre, an action is considered detected, and the head pointer moves step until the next action window is full. In response to less than k*N D(a1,b1) being greater than or equal to the threshold thre, no action is considered detected, and the head pointer moves 1 sampling point until the action window is full before detecting again. Where thre is the Euclidean distance threshold, and k is the ratio threshold.
[0086] In an embodiment of the present disclosure, the electronic device includes sensor data corresponding to multiple types of actions. The following embodiments of the present disclosure describe a method for recording sensor data corresponding to multiple types of actions in the electronic device.
[0087] Figure 7 FIG. 1 is a flow chart showing a method for inputting sensor data according to an exemplary embodiment. Figure 7 As shown, the method includes steps S501 to S504.
[0088] In step S501, in response to receiving an instruction to record an action, the action to be recorded is determined, and a second prompt message is issued, the second prompt message being used to prompt the part of the limb on which the electronic device corresponding to the action to be recorded is worn.
[0089] In step S502, a third prompt message is sent after a preset time, and current sensor data is acquired at a preset frequency within a preset time period. The third prompt message is used to prompt the start of action entry.
[0090] In step S503, the sensor data acquired within a preset time period is determined as the sensor data corresponding to the action to be recorded, and a first window pops up.
[0091] In step S504 , in response to the user issuing an instruction to store an action in the first window, sensor data corresponding to the action to be recorded is recorded according to the number of stored actions and a preset number threshold.
[0092] In the embodiment of the present disclosure, the user issues an instruction to record the action in the window about the action recognition and counting function on the display interface of the electronic device, and issues a prompt message (second prompt message) about the limb position (arm, leg, etc.) on which the electronic device is worn, and issues a prompt message (third prompt message) to start recording the action and prompt the user to start the action after a preset time interval. The sensor data collected by the motion sensor in the electronic device is acquired in real time, and after a preset time (the time required to collect the sensor data), the sensor data collection is ended, and the sensor data collected within the preset time is determined as the sensor data corresponding to the action to be recorded. Then a window instructing the user to proceed to the next step of processing pops up, and according to the user's selection in the window, the sensor data corresponding to the action to be recorded is recorded in the electronic device.
[0093] In an embodiment of the present disclosure, after the action recording begins, the electronic device collects sensor data at a preset frequency fs within a preset time through a built-in sensor, and determines the collected sensor data as the sensor data corresponding to the action to be recorded. In one example, the sensor used by the present disclosure to collect data corresponding to the action to be recorded is a three-axis sensor, and the collected data is acceleration data accx, accy, and accz that are respectively parallel to the three spatial coordinate axes in the spatial coordinate system, where accx is acceleration data parallel to the x-axis, accz is acceleration data parallel to the z-axis, and accy is acceleration data parallel to the y-axis. When obtaining the sensor data corresponding to the action to be recorded, the three-axis sensor collects n sets of sensor data [(accx1, accy1, accz1)-(accxn, accyn, acczn)] within a preset time and at a preset frequency fs.
[0094] In an exemplary embodiment of the present disclosure, Figure 2 As shown in the schematic diagram of the window used to issue control instructions to electronic devices, the window for motion recognition and counting functions in electronic devices includes "motion recording", "motion recognition" and "motion management" options. After the user selects the "motion recording" function, the next level window for starting to record motions pops up. Figure 8 As shown in the schematic diagram of the window for issuing control instructions to the electronic device, the action recording window includes a virtual button of "start recording". After the user clicks the virtual button, the action recording process begins. It can be understood that when performing action recording, the electronic device can end the recording process based on the user's trigger, or automatically time and end the recording process after the timer ends. When the recording process ends based on the user's trigger, as shown in the figure, Figure 9 As shown in the schematic diagram of the window for issuing control instructions to the electronic device, the action recording window includes a virtual button of "end recording". After the user clicks the virtual button, the action recording is ended.
[0095] It is understood that there is an upper limit to the number of actions that an electronic device can store. Therefore, after obtaining the sensor data corresponding to the action to be recorded, it is necessary to determine whether the number of actions currently stored in the electronic device has reached the upper limit, and then decide whether to store the sensor data corresponding to the action to be recorded. The following embodiments of this disclosure further illustrate the method of recording sensor data corresponding to the action to be recorded.
[0096] Figure 10 FIG. 1 is a flow chart showing a method for recording sensor data corresponding to an action to be recorded according to an exemplary embodiment. Figure 10 As shown, the method includes steps S601, S602A and S602B.
[0097] In step S601 , the number of stored actions is determined.
[0098] In step S602A, in response to the number of stored actions being less than a number threshold, current sensor data is recorded into the electronic device.
[0099] In step S602B, in response to the number of stored actions being equal to the quantity threshold, a second window pops up, and sensor data corresponding to the action to be recorded is recorded according to a processing instruction issued by the user in the second window.
[0100] The second window is used to prompt the user to overwrite the sensor data corresponding to the stored action or delete the sensor data corresponding to the action to be recorded.
[0101] In the embodiment of the present disclosure, if the number of actions currently stored in the electronic device has not reached the upper limit, the sensor data corresponding to the action to be recorded is stored in the electronic device, and the action to be recorded is not named. If the number of actions currently stored in the electronic device has reached the upper limit, a window will pop up, requiring the user to choose between storing the sensor data corresponding to the action to be recorded and deleting the sensor data corresponding to the action to be recorded. If the user chooses to store the sensor data corresponding to the action to be recorded, a further window will pop up, asking the user which action to overwrite. After the user selects the action to be overwritten, the sensor data corresponding to the action to be recorded will be used to replace the sensor data corresponding to the action to be overwritten.
[0102] In an exemplary embodiment of the present disclosure, Figure 11 As shown in the diagram of the window used to issue control commands to electronic devices, if the number of actions currently stored in the electronic device has not reached the upper limit, a window for naming the action will pop up. The window includes an input box for the new action name, action record 1 for the action demonstration (i.e., the sensor data corresponding to the action to be recorded), and virtual buttons for confirming and canceling. After the user enters the action name in the input box and clicks confirm, the sensor data corresponding to the action to be recorded is stored.
[0103] The sensor data corresponding to the action to be recorded is stored in the electronic device,
[0104] In an exemplary embodiment of the present disclosure, Figure 12 As shown in the schematic diagram of the window for issuing control instructions to the electronic device, when the number of actions stored in the current electronic device reaches the upper limit, a pop-up window asks the user "Do you want to cancel saving?". If the user selects "Confirm", the sensor data corresponding to the action to be recorded is deleted. If the user selects "Cancel", the sensor data corresponding to the action to be recorded is stored, and the next level window pops up.
[0105] It is understood that after the user first obtains sensor data corresponding to the action to be recorded, if the user believes that the action does not meet the requirements, the user can re-enter the action data. It is further understood that after the user first obtains sensor data corresponding to the action to be recorded, if the user needs to enter more data to ensure the accuracy of subsequent action recognition, the user can continue to enter data.
[0106] Figure 13 FIG. 1 is a flow chart showing a method for recording sensor data corresponding to an action to be recorded according to an exemplary embodiment. Figure 13 As shown, the method includes steps S701, S702A and S702B.
[0107] In step S701, the sensor data acquired within a preset time period is determined as the sensor data corresponding to the action to be recorded, and a first window pops up.
[0108] In step S702A, in response to the user issuing a re-entry instruction in the first window, the sensor data corresponding to the action to be recorded is deleted, and the action recording process is re-executed for the action to be recorded.
[0109] In step S702B, in response to the user issuing an instruction to continue recording in the first window, the sensor data corresponding to the action to be recorded is saved, and the action recording process is continued for the action to be recorded.
[0110] In the disclosed embodiment, after the user first obtains sensor data corresponding to the action to be recorded, that is, after the user selects the end instruction operation, a pop-up may be further displayed to instruct the user to re-enter or continue recording. If the user believes that the action does not meet the requirements, the user can choose to re-enter the action data. If the user believes that more data needs to be recorded to ensure the accuracy of subsequent action recognition, the user can choose to continue recording.
[0111] Through the present disclosure, after a user obtains sensor data corresponding to an action to be recorded, the user can re-record the sensor data corresponding to the action to be recorded or continue recording the sensor data corresponding to the action to be recorded based on the user's selection. This ensures the accuracy of the action data stored in the electronic device after the action recording is completed, and ensures the accuracy of subsequent action recognition and counting.
[0112] In an exemplary embodiment of the present disclosure, the user can also process actions stored in the electronic device. Figure 14 As shown in the schematic diagram of the window for issuing control instructions to the electronic device, when the user decides to process the action stored in the electronic device, the user can edit the action name (such as action name A), and can delete the sensor data corresponding to the same action (action record 1, action record 2...). After completing the editing, the editing is ended through the save and / or return function. In another example, Figure 15 Schematic diagram of a window for issuing control instructions to an electronic device. After the user selects the delete operation, a window pops up asking the user "Are you sure to delete?" The user confirms whether to delete the action record by pressing the "Confirm" and "Cancel" buttons in the window.
[0113] The following embodiments of the present disclosure further illustrate a method for recording sensor data corresponding to an action to be recorded.
[0114] Figure 16 FIG. 1 is a flow chart showing a method for recording sensor data corresponding to an action to be recorded according to an exemplary embodiment. Figure 16 As shown, the method includes steps S801 to S802.
[0115] In step S801 , in response to receiving an instruction to supplement an existing action, a list of stored actions is popped up.
[0116] In step S802 , based on the stored action selected by the user in the list, the action entry process is executed for the stored action selected by the user.
[0117] In the embodiment of the present disclosure, when the user is recording an action, in addition to recording a new action, he or she can also supplement the sensor data corresponding to the stored action. Figure 17 A diagram of the window used to issue control commands to electronic devices. After the user selects the action entry option, a pop-up window appears, prompting the user to "enter a new action" or "add to an existing action." When the user selects "add to an existing action," a list of stored actions appears. After the user selects an action from the list, the action entry process begins.
[0118] In an exemplary embodiment of the present disclosure, Figure 18: This is a flowchart of a method for entering action data. Action data is entered in the following manner. In response to entering an action, a user option is determined. In response to the user selecting a new action to enter (or an existing new action to enter), a countdown for the entered action is performed, and subsequent actions are executed after the countdown ends. If the user selects an existing action to enter, an interface for all stored actions pops up. After the user selects an action, a countdown for entering the action is performed, and subsequent actions are executed after the countdown ends. After the countdown ends, the sensor collects data while the user performs the action. After the data is collected, the entry is terminated, and the user option is further determined. In response to the user selecting to re-enter, the data is deleted and the countdown process returns to the process for re-collection. In response to the user selecting to continue entering, the data is saved and the countdown process returns to the process for re-collection. In response to the user selecting to save the action, a new action storage information interface is created. If the user chooses not to save the action, the interface returns to the main interface. If the user selects to save the action, the number of actions (the number of stored actions) is detected, and a determination is made as to whether the number of actions exceeds the upper limit of the number of actions that can be stored. If the limit is not exceeded, the action is saved until it is successfully saved. If the limit is exceeded, the interface of all stored actions is expanded and the user's instructions are awaited. If the user chooses to abandon the save, the interface returns to the main interface. If the user selects an action on the interface of all stored actions, the user further confirms whether to overwrite. If the user does not confirm the overwrite, the interface of all stored actions is entered to reselect the action. If the user confirms the overwrite, the original record is deleted and the new record is saved.
[0119] In an embodiment of the present disclosure, for a single electronic device, sensor data is recorded by a motion sensor provided in the electronic device. After receiving an action recording instruction, sensor data corresponding to the action to be recorded is obtained, and the sensor data corresponding to the action to be recorded is stored in the electronic device. When action counting is required, the recognition and counting of actions are achieved through the real-time sensor data obtained by the motion sensor in the electronic device and the sensor data of the stored actions. Through the present disclosure, the user is provided with the functions of customized action recording, action counting and action management, without the need to train the model in advance, which broadens the scenarios for user action recognition.
[0120] Based on the same concept, the embodiment of the present disclosure further provides an action counting device 100 .
[0121] It is understood that the action counting device 100 provided in the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to achieve the above functions. In combination with the units and algorithm steps of the various examples disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software-driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0122] Figure 19 FIG. 1 is a block diagram of an action counting device 100 according to an exemplary embodiment. Figure 19 The device includes a determining unit 101, an acquiring unit 102, a processing unit 103 and an output unit 104.
[0123] The determining unit 101 is configured to, in response to receiving an instruction for action counting, determine a target action corresponding to the instruction and determine first data, where the first data is sensor data corresponding to the target action pre-recorded in the electronic device.
[0124] The acquisition unit 102 is configured to acquire second data, where the second data is sensor data acquired after the first prompt information is issued.
[0125] The processing unit 103 is configured to determine the number of times the target action is performed according to the first data and the second data.
[0126] The output unit 104 is configured to output the counting result in response to receiving the end instruction.
[0127] In one embodiment, before acquiring the second data, the determining unit is further configured to: issue a first prompt message after a preset time, where the first prompt message is used to prompt the start of action counting.
[0128] In one embodiment, the first data includes a single set of data or a preset number of sets of data. The processing unit 103 determines the number of times the target action is performed based on the first data and the second data in the following manner: in response to the first data including a single set of data, the number of times the target action is performed is determined based on the single set of data and the second data. Alternatively, in response to the first data including a preset number of sets of data, the number of times the target action is performed is determined based on the preset number of sets of data and the second data.
[0129] In one embodiment, the second data includes multiple sets of window data, each set of window data corresponding to sensor data collected by a single action window. Processing unit 103 determines the number of times the target action has been performed based on the single set of data and the second data in the following manner: Each time a set of window data is acquired, the current Euclidean distance between the most recently acquired window data and the single set of data is acquired. In response to the current Euclidean distance being less than or equal to a preset distance threshold, the number of times the target action has been performed is incremented by one, and the current number of times the target action has been performed is determined.
[0130] In one embodiment, the processing unit 103 determines the number of times the target action is performed based on a preset number of groups of data and second data in the following manner: Each time a set of window data is obtained, for each set of data in the preset number of groups of data, the current Euclidean distance between each set of data and the window data is obtained. The current number of data groups in the preset number of groups of data whose current Euclidean distance is less than or equal to a preset distance threshold is determined. In response to a ratio between the current number and the preset number being greater than a preset ratio threshold, the number of times the target action is performed is incremented by one, and the current number of times the target action is performed is determined.
[0131] In one embodiment, the electronic device includes sensor data corresponding to multiple types of actions. The sensor data corresponding to the multiple types of actions are entered by the processing unit 103 in the following manner: in response to receiving an instruction to enter an action, the action to be entered is determined, and a second prompt message is issued, the second prompt message is used to prompt the limb part on which the electronic device is worn corresponding to the action to be entered. After a preset time, a third prompt message is issued, and within a preset time period, the current sensor data is obtained at a preset frequency, and the third prompt message is used to prompt the start of action entry. The sensor data obtained within the preset time period is determined as the sensor data corresponding to the action to be entered, and a first window pops up. In response to the user issuing an instruction to store the action in the first window, the sensor data corresponding to the action to be entered is entered according to the number of stored actions and a preset number threshold.
[0132] In one embodiment, the processing unit 103 records sensor data corresponding to the action to be recorded based on the number of stored actions and a preset threshold value in the following manner: In response to the number of stored actions being less than the threshold value, the current sensor data is recorded into the electronic device. In response to the number of stored actions being equal to the threshold value, a second window pops up, and the sensor data corresponding to the action to be recorded is recorded according to a processing instruction issued by the user in the second window. The second window is used to prompt the user to overwrite the sensor data corresponding to the stored action or delete the sensor data corresponding to the action to be recorded.
[0133] In one embodiment, the processing unit 103 is further configured to: in response to a user issuing a re-entry instruction in the first window, delete the sensor data corresponding to the action to be recorded, and re-execute the action recording process for the action to be recorded. In response to a user issuing a continue recording instruction in the first window, save the sensor data corresponding to the action to be recorded, and continue the action recording process for the action to be recorded.
[0134] In one embodiment, the processing unit 103 is further configured to: in response to receiving an instruction to supplement an existing action, pop up a list of stored actions, and execute an action entry process for the stored action selected by the user based on the stored action selected by the user in the list.
[0135] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0136] Figure 20 FIG2 is a block diagram of an apparatus 200 for counting actions according to an exemplary embodiment. The apparatus 200 may be provided as a terminal. For example, the apparatus 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0137] Reference Figure 20 , apparatus 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .
[0138] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.
[0139] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0140] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 200.
[0141] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0142] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC) that is configured to receive external audio signals when the device 200 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, the audio component 210 further includes a speaker for outputting audio signals.
[0143] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.
[0144] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200. The sensor assembly 214 can also detect changes in the position of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200, and temperature changes of the device 200. The sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0145] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0146] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method.
[0147] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as the memory 204 including instructions, which can be executed by the processor 220 of the apparatus 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0148] It is understood that in this disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of related objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0149] It will be further understood that the terms "first," "second," and the like are used to describe various types of information, but such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another and do not indicate a particular order or level of importance. In fact, the terms "first," "second," and the like are fully interchangeable. For example, first information could be referred to as second information, and similarly, second information could be referred to as first information without departing from the scope of this disclosure.
[0150] It can be further understood that the terms "center", "longitudinal", "lateral", "front", "back", "up", "down", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing this embodiment and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation.
[0151] It is further understood that, unless otherwise specified, “connection” includes a direct connection where there are no other components between the two elements, and also includes an indirect connection where there are other elements between the two elements.
[0152] It is further understood that although operations are described in a particular order in the drawings in the embodiments of the present disclosure, this should not be construed as requiring that the operations be performed in the particular order shown or in a serial order, or that all of the operations shown be performed to obtain the desired results. In certain circumstances, multitasking and parallel processing may be advantageous.
[0153] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0154] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.
Claims
1. An action counting method, characterized in that: include: In response to receiving an instruction for counting actions, determining a target action corresponding to the instruction and determining first data, where the first data is sensor data corresponding to the target action pre-recorded in the electronic device; Acquiring second data, where the second data is sensor data acquired after the first prompt message is issued; determining the number of times the target action is performed based on the first data and the second data; In response to receiving the end instruction, the counting result is output.
2. The method according to claim 1, characterized in that Before acquiring the second data, the method further includes: A first prompt message is sent after a preset time, and the first prompt message is used to prompt the start of action counting.
3. The method according to claim 1, characterized in that The first data includes a single set of data or the first data includes a preset number of sets of data; The determining, based on the first data and the second data, the number of times the target action is performed includes: In response to the first data including a single set of data, determining the number of times the target action is performed based on the single set of data and the second data; or In response to the first data including a preset number of groups of data, the number of times the target action is performed is determined based on the preset number of groups of data and the second data.
4. The method according to claim 3, characterized in that The second data includes multiple groups of window data, each group of window data corresponds to sensor data collected by a single action window; The determining, based on the single set of data and the second data, the number of times the target action is performed includes: Each time a set of window data is obtained, the current Euclidean distance between the most recently obtained window data and the single set of data is obtained; In response to the current Euclidean distance being less than or equal to a preset distance threshold, the number of times the target action is performed is incremented by one, and the current number of times the target action is performed is determined.
5. The method according to claim 3, characterized in that The determining the number of times the target action is performed according to the preset number of groups of data and the second data includes: Each time a set of window data is obtained, for each set of data in the preset number of sets of data, the current Euclidean distance between each set of data and the window data is obtained respectively; Determine the current number of data groups whose current Euclidean distance is less than or equal to a preset distance threshold among the preset number of data groups; In response to a ratio between the current number and the preset number being greater than a preset ratio threshold, the number of times the target action is performed is incremented by one, and the current number of times the target action is performed is determined.
6. The method according to claim 1, characterized in that The electronic device includes sensor data corresponding to multiple types of actions; The sensor data corresponding to the various types of actions are recorded in the following manner: In response to receiving an instruction to record an action, determining an action to be recorded, and issuing a second prompt message, wherein the second prompt message is used to indicate the limb part on which the electronic device is worn corresponding to the action to be recorded; After a preset time, a third prompt message is issued, and within a preset time period, current sensor data is acquired at a preset frequency, wherein the third prompt message is used to prompt the user to start action recording; Determine the sensor data acquired within a preset time period as the sensor data corresponding to the action to be recorded, and pop up a first window; In response to a user issuing an instruction to store an action in the first window, sensor data corresponding to the action to be recorded is recorded according to the number of stored actions and a preset number threshold.
7. The method according to claim 6, characterized in that The step of recording sensor data corresponding to the action to be recorded according to the number of stored actions and a preset number threshold comprises: In response to the number of stored actions being less than the number threshold, recording the current sensor data into the electronic device; In response to the number of stored actions being equal to the quantity threshold, a second window pops up, and the sensor data corresponding to the action to be recorded is recorded according to the processing instructions issued by the user in the second window. The second window is used to prompt the user to overwrite the sensor corresponding to the stored action or delete the sensor data corresponding to the action to be recorded.
8. The method according to claim 6, characterized in that The method further comprises: In response to a re-entry instruction issued by the user in the first window, deleting the sensor data corresponding to the action to be recorded, and re-executing the action recording process for the action to be recorded; In response to the user issuing an instruction to continue recording in the first window, the sensor data corresponding to the action to be recorded is saved, and the action recording process is continued for the action to be recorded.
9. The method according to claim 6, characterized in that The method further comprises: In response to receiving an instruction to supplement an existing action, popping up a list of stored actions; Based on the stored action selected by the user in the list, a process of action entry is executed for the stored action selected by the user.
10. An action counting device, characterized in that: include: a determining unit, configured to, in response to receiving an instruction for action counting, determine a target action corresponding to the instruction, and determine first data, where the first data is sensor data corresponding to the target action pre-recorded in the electronic device; an acquiring unit, configured to acquire second data, where the second data is sensor data acquired after the first prompt information is issued; a processing unit, configured to determine a number of times the target action is performed based on the first data and the second data; The output unit is configured to output the counting result in response to receiving the end instruction.
11. An electronic device, characterized in that: include: processor: a memory for storing processor-executable instructions; The processor is configured to execute the action counting method according to any one of claims 1 to 9.
12. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions in the storage medium are executed by a processor, the processor is enabled to execute the action counting method according to any one of claims 1 to 9.