Motion state correction method, device, electronic device and storage medium

By obtaining the motion state characteristics of the terminal device and using the state correction model for correction, the problem of poor accuracy of motion state recognition in the existing technology is solved, and the reliability and accuracy of motion state recognition are improved.

CN115144615BActive Publication Date: 2024-09-24GUANGDONG XIAOTIANCAI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210471238.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2024-09-24
Estimated Expiration
2042-04-28

Smart Images

  • Figure CN115144615B
    Figure CN115144615B
Patent Text Reader

Abstract

The embodiment of the present application discloses a motion state correction method, device, electronic device and storage medium, the method comprising: obtaining motion state features corresponding to a terminal device at multiple moments; determining the initial motion state corresponding to each moment according to the motion state features corresponding to each moment; inputting the initial motion state corresponding to each moment into a state correction model, and determining the initial motion state associated with the first moment within the scale range corresponding to the optimal time scale according to the state correction model according to the optimal time scale corresponding to the first initial motion state corresponding to the first moment, and correcting the first initial motion state according to the associated initial motion state to obtain the target motion state corresponding to the first moment. Implementing the embodiment of the present application can improve the reliability of the corrected motion state, and thus improve the accuracy of the motion state recognition result determined according to each corrected motion state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motion monitoring technology, and in particular to a motion state correction method, device, electronic device and storage medium. Background Art

[0002] With the increasing functionality of terminal devices and the prevalence of exercise, these devices are often used to identify motion states. During this process, to ensure accurate recognition, the terminal device typically needs to correct the identified motion state. The reliability of correcting different motion states in related technologies is poor, resulting in poor accuracy in the final recognition results. Summary of the Invention

[0003] The embodiments of the present application disclose a motion state correction method, device, electronic device and storage medium, which can improve the reliability of the corrected motion state and thereby improve the accuracy of motion state recognition.

[0004] A first aspect of an embodiment of the present application provides a motion state correction method, applied to a terminal device, the method comprising:

[0005] Obtaining motion state features corresponding to the terminal device at multiple moments, wherein the motion state features are extracted based on motion state data collected by the terminal device;

[0006] Determining the initial motion state corresponding to each moment according to the motion state characteristics corresponding to each moment;

[0007] The initial motion states corresponding to the various moments are input into a state correction model, and the state correction model determines the initial motion state associated with the first moment within a scale range corresponding to the optimal time scale corresponding to the first initial motion state corresponding to the first moment, and corrects the first initial motion state according to the associated initial motion state to obtain a target motion state corresponding to the first moment; wherein the first moment is any one of the various moments, and the optimal time scale corresponding to the first initial motion state is the optimal time scale determined according to the ROC curve.

[0008] As an optional implementation manner, in the first aspect of this embodiment, determining the initial motion state corresponding to each moment according to the motion state characteristics corresponding to each moment includes:

[0009] Inputting the motion state features corresponding to the multiple moments into a state prediction model, and determining the probability that each moment corresponds to each motion state through the state prediction model;

[0010] Comparing the probabilities corresponding to the respective motion states at the respective moments with the probability thresholds corresponding to the respective motion states;

[0011] If the probability that the second moment corresponds to the first motion state is greater than the probability threshold corresponding to the first motion state, the initial motion state corresponding to the second moment is determined as the first motion state, the second moment is any one of the moments, and the first motion state is any one of the motion states.

[0012] As an optional implementation manner, in the first aspect of this embodiment, before acquiring the motion state features corresponding to the terminal device at multiple time moments, the method further includes:

[0013] Acquiring a sample motion data set for a first motion state, the sample motion data set including sample motion data corresponding to a plurality of sample moments, and a standard motion state sequence consisting of standard motion states corresponding to the plurality of sample moments, the standard motion state including belonging to the first motion state or not belonging to the first motion state; the first motion state is any motion state;

[0014] Performing motion state prediction on the sample motion data corresponding to the plurality of sample moments according to the state prediction model to obtain a predicted motion state sequence, wherein the predicted motion state sequence includes the predicted motion states corresponding to the plurality of sample moments;

[0015] Correcting the predicted motion states corresponding to the plurality of sample moments according to each time scale within the time scale interval using a state correction model, thereby obtaining a corrected motion state sequence corresponding to each time scale;

[0016] Comparing the modified motion state sequences corresponding to the respective time scales with the standard motion state sequences respectively to determine the correction results corresponding to the respective modified motion state sequences;

[0017] Constructing the ROC curves at each time scale according to the correction results corresponding to each of the corrected motion state sequences, and determining the AUC areas corresponding to the ROC curves at each time scale;

[0018] According to the AUC areas corresponding to the ROC curves at the various time scales, the time scale corresponding to the largest AUC area is determined as the optimal time scale corresponding to the first motion state.

[0019] As an optional implementation manner, in the first aspect of this embodiment, performing motion state prediction on the sample motion data corresponding to the multiple sample moments respectively according to the state prediction model to obtain a predicted motion state sequence includes:

[0020] inputting the sample motion data corresponding to the plurality of sample moments into a state prediction model, and determining, by the state prediction model, the probabilities that the plurality of sample moments correspond to the first motion state based on the sample motion data corresponding to the plurality of sample moments;

[0021] The probabilities of the first motion states corresponding to the multiple sample moments are evaluated according to the respective probability thresholds under the probability interval to obtain a predicted motion state sequence corresponding to the respective probability thresholds, wherein the predicted motion state sequence corresponding to the first probability threshold includes the predicted motion states corresponding to the multiple sample moments under the first probability threshold, and the first probability threshold is any probability threshold under the probability interval.

[0022] As an optional implementation manner, in the first aspect of this embodiment, evaluating the probabilities of the multiple sample moments corresponding to the first motion state according to each probability threshold within the probability interval to obtain a predicted motion state sequence corresponding to each probability threshold includes:

[0023] Comparing the probability of each sample moment corresponding to the first motion state with the first probability threshold;

[0024] If the probability that the first sample moment corresponds to the first motion state is greater than the first probability threshold, determining that the predicted motion state corresponding to the first sample moment belongs to the first motion state, and the first sample moment is any one of the sample moments;

[0025] If the probability that the first sample moment corresponds to the first motion state is less than or equal to the first probability threshold, it is determined that the predicted motion state corresponding to the first sample moment does not belong to the first motion state.

[0026] As an optional implementation manner, in the first aspect of this embodiment, comparing the modified motion state sequences corresponding to the respective time scales with the standard motion state sequence to determine the correction results corresponding to the respective modified motion state sequences includes:

[0027] Comparing the sample moments corresponding to the first motion state in the corrected motion state sequence corresponding to each of the probability thresholds at the first time scale with the sample moments corresponding to the first motion state in the standard motion state sequence, respectively, to determine correction results of the corrected motion state sequence corresponding to each of the probability thresholds at the first time scale;

[0028] The step of constructing the ROC curves at each time scale according to the correction results corresponding to each of the corrected motion state sequences comprises:

[0029] According to the correction results of the corrected motion state sequences corresponding to the respective probability thresholds at the first time scale, a ROC curve corresponding to the first time scale is constructed, where the first time scale is any time scale within the time scale interval.

[0030] As an optional implementation manner, in the first aspect of this embodiment, the state correction model is used to correct the predicted motion states corresponding to the multiple sample moments according to each time scale within the time scale interval, including:

[0031] The predicted motion state sequence is input into the state correction model, and the state correction model determines the predicted motion state associated with each sample moment within the scale range corresponding to the first time scale according to the first time scale within the time scale interval, and corrects the predicted motion state corresponding to each sample moment according to the associated predicted motion state to obtain a corrected motion state sequence corresponding to the first time scale, where the first time scale is any time scale within the time scale interval.

[0032] As an optional implementation manner, in the first aspect of this embodiment, before inputting the initial motion states corresponding to the respective moments into the state correction model, the method further includes:

[0033] Acquire location information of the terminal device, and determine a scene in which the terminal device is located based on the location information, each of the scenes corresponding to at least one motion state;

[0034] According to the scene in which the terminal device is located, the optimal time scale corresponding to each motion state corresponding to the scene is reduced.

[0035] A second aspect of an embodiment of the present application provides a motion state correction device, the device comprising:

[0036] A feature acquisition module is used to acquire motion state features corresponding to a terminal device at multiple moments, wherein the motion state features are extracted based on motion state data collected by the terminal device;

[0037] A state determination module, configured to determine an initial motion state corresponding to each moment according to motion state characteristics corresponding to each moment;

[0038] A state correction module is used to input the initial motion state corresponding to each moment into a state correction model, and determine the initial motion state associated with the first moment within the scale range corresponding to the optimal time scale according to the optimal time scale corresponding to the first initial motion state corresponding to the first moment through the state correction model, and correct the first initial motion state according to the associated initial motion state to obtain the target motion state corresponding to the first moment; wherein, the first moment is any one of the various moments, and the optimal time scale corresponding to the first initial motion state is the optimal time scale determined according to the ROC curve.

[0039] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements any one of the motion state correction methods disclosed in the embodiments of the present application.

[0040] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, any one of the motion state correction methods disclosed in the embodiment of the present application is implemented.

[0041] Compared with the related art, the embodiments of the present application have the following beneficial effects:

[0042] After obtaining the motion states corresponding to the terminal device at multiple moments, the initial motion state corresponding to each moment is determined. The initial motion state corresponding to each moment is input into the state correction model so that the state correction model determines the initial motion state associated with each moment within the scale range corresponding to the optimal time scale corresponding to the initial motion state corresponding to each moment, wherein the optimal time scale corresponding to each initial motion state is determined according to the ROC curve. The initial motion state corresponding to each moment is corrected according to the initial motion state associated with each moment to obtain the target motion state corresponding to each moment. The optimal time scale corresponding to different motion states can be determined according to the ROC curve, and the initial motion state associated within the corresponding scale range can be obtained according to the optimal time scale corresponding to different initial motion states to correct the initial motion state at each moment, thereby improving the reliability of the corrected motion state, and thereby improving the accuracy of the motion state recognition result determined according to the corrected motion states. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 This is a schematic diagram of an application scenario of a motion state correction method disclosed in an embodiment of the present application;

[0045] Figure 2 This is a flow chart of a motion state correction method disclosed in an embodiment of the present application;

[0046] Figure 3 is a schematic diagram of motion state prediction and motion state correction disclosed in an embodiment of the present application;

[0047] Figure 4 is a schematic diagram of the optimal time scale disclosed in the embodiments of this application;

[0048] Figure 5 It is a schematic diagram of the process of determining the initial motion state disclosed in the embodiment of the present application;

[0049] Figure 6 This is a schematic diagram of a method flow of an optimal time scale method disclosed in an embodiment of the present application;

[0050] Figure 7 Schematic diagram of ROC curves of a motion state disclosed in an embodiment of the present application at three different time scales;

[0051] Figure 8 is a flow chart of obtaining the optimal time scale corresponding to all states disclosed in an embodiment of the present application;

[0052] Figure 9 1 is a schematic diagram of a method flow of another optimal time scale method disclosed in an embodiment of the present application;

[0053] Figure 10 It is a structural schematic diagram of a motion state correction device disclosed in an embodiment of the present application;

[0054] Figure 11 It is a structural schematic diagram of another motion state correction device disclosed in an embodiment of the present application;

[0055] Figure 12 This is a structural diagram of another motion state correction device disclosed in an embodiment of the present application;

[0056] Figure 13 The present invention is a schematic structural diagram of an electronic device disclosed in an embodiment. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0058] It should be noted that the terms "including," "having," and any variations thereof in the embodiments and drawings of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.

[0059] The embodiments of the present application disclose a motion state correction method, device, electronic device, and storage medium, which can improve the reliability of the corrected motion state and thereby improve the accuracy of motion state recognition. Detailed descriptions are provided below.

[0060] See also Figure 1 , Figure 1 This is a schematic diagram of an application scenario of a motion state correction method disclosed in an embodiment of the present application. Figure 1 As shown, the terminal device 10 may be included. The terminal device 10 may collect motion state data through a sensor device and extract motion state features at each moment based on the collected motion state data. The terminal device 10 may determine the motion state corresponding to each moment based on the motion state features at each moment, input the motion state corresponding to each moment into a state correction model, and determine the initial motion state associated with each moment within the scale range corresponding to the optimal time scale according to the ROC curve based on the initial motion state corresponding to each moment through the state correction model. The initial motion state corresponding to each moment is corrected based on the associated initial motion state to obtain the target motion state corresponding to each moment.

[0061] See also Figure 2 , Figure 2 1 is a flow chart of a motion state correction method disclosed in an embodiment of the present application, which can be applied to the aforementioned terminal device 10. Figure 2 As shown, the method may include the following steps:

[0062] 210. Obtain motion state features corresponding to the terminal device at multiple moments. The motion state features are extracted based on motion state data collected by the terminal device.

[0063] In an embodiment of the present application, a user carries a terminal device while exercising. The terminal device can collect motion state data of the terminal device at multiple moments in time using a sensor device. The terminal device performs feature extraction on the collected motion state data to obtain motion state features corresponding to the terminal device at each of the multiple moments in time. The sensor device can be at least an accelerometer and a barometer, the motion state data includes at least acceleration data and air pressure data, and the motion state features can include at least acceleration data features and air pressure data features.

[0064] In some embodiments, acceleration data features may include time domain features of the acceleration data and frequency domain features of the acceleration data. Time domain features of acceleration may include mean, median, range, sum of absolute deviations, maximum, minimum, sum of absolute values, sample entropy, interquartile range, and variance. Frequency domain features of acceleration data may include mean, variance, frequency domain entropy, kurtosis, skewness, frequency band energy, etc. Pressure features may include slope, range, mean, and variance, etc. The interquartile range represents the difference between the data at the 75th percentile and the data at the 25th percentile after sorting the data from largest to smallest; the median represents the data at the 50th percentile after sorting; and the sample entropy represents a measure of the similarity of the data. Frequency domain features represent the patterns of data change in frequency, while time domain features represent the patterns of data change over time.

[0065] In the embodiments of the present application, the air pressure data reflects the height difference of the terminal device in a vertical plane. When the pressure is on the same horizontal plane or when the movement is gentle, the pressure data changes slowly or fluctuates randomly. Therefore, the pressure data is very effective for identifying vertical spatial motion. The terminal device reflects the pressure change trend by extracting at least the slope and range characteristics of the pressure data.

[0066] In an embodiment of the present application, the mean feature has different exercise intensities per unit time in different exercise states, such as sitting, standing, lying, walking, and running. Therefore, the terminal device evaluates the exercise intensity per unit time by extracting the mean feature.

[0067] When the user is in different motion states such as sitting, running, standing, sitting, and lying down, the acceleration data collected by the terminal device varies over a wide range. Therefore, the terminal device distinguishes motions with large differences in intensity through the extreme differences in the acceleration data.

[0068] When a user is in motion, such as going up or down stairs, the terminal device user's kinematics within the same cycle are all subjected to force on one foot. As a result, the center of gravity of the acceleration data will shift, and the shift directions for going up and down stairs are exactly opposite. Therefore, the shift can be evaluated using the mean and median features of the acceleration data to distinguish between symmetric and asymmetric movements.

[0069] When users are in motion, such as riding a bicycle or a scooter, the uneven road surface and the randomness of their movements usually cause the acquired acceleration data to be irregular. Therefore, the sample entropy feature can be used to distinguish between regular and irregular motions.

[0070] In the embodiment of the present application, by extracting specific motion state features, the accuracy of motion state recognition by the terminal device can be improved, and the number of motion states that can be recognized can be increased.

[0071] 220. Determine the initial motion state corresponding to each moment based on the motion state characteristics corresponding to each moment.

[0072] In some embodiments, the terminal device can determine the initial motion state corresponding to each moment based on the type and number of the characteristic values ​​of the motion state characteristics corresponding to each moment in the state characteristic interval. For example, the state characteristics of each moment include acceleration range, acceleration mean and air pressure mean. The values ​​of acceleration range, acceleration mean and air pressure mean corresponding to moment A are (1, 2, 0.1), and the values ​​of acceleration range, acceleration mean and air pressure mean corresponding to moment B are (10, 1, 0.1). The initial motion state can be set to a running motion state, and the intervals of acceleration range, acceleration mean and air pressure mean are [8, 15], [0, 3] and [0, 1] respectively. When the initial motion state is set to a walking state, the intervals of acceleration range, acceleration mean and air pressure mean are [0, 5], [0, 3] and [0, 1] respectively. At this point, it can be seen that the three motion state feature values ​​corresponding to time A are all within the three state feature intervals corresponding to the walking state and the two state feature intervals corresponding to the running state. Therefore, the terminal device can determine that the initial motion state corresponding to time A is the walking state. Similarly, the three motion state feature values ​​corresponding to time B are all within the three state feature intervals corresponding to the running state and the two state feature intervals corresponding to the walking state. Therefore, the terminal device can determine that the initial motion state corresponding to time B is the running state.

[0073] In some embodiments, the terminal device can output the probability values ​​corresponding to different motion states at each moment based on the motion state characteristics at each moment, and select the motion state corresponding to the maximum probability value as the initial motion state corresponding to that moment. For example, the terminal device determines the probability values ​​corresponding to motion state a and motion state b at moment A and moment B, respectively, based on the motion state characteristics at each moment, wherein the probability value corresponding to motion state a at moment A is 0.6, the probability value corresponding to motion state b at moment A is 0.4, the probability value corresponding to motion state a at moment B is 0.3, and the probability value corresponding to motion state b at moment B is 0.7. Then, the terminal device can determine that the initial motion state corresponding to moment A is motion state a, and the initial motion state corresponding to moment B is motion state b.

[0074] 230. Input the initial motion state corresponding to each moment into the state correction model, and determine the initial motion state associated with the first moment within the scale range corresponding to the optimal time scale according to the optimal time scale corresponding to the first initial motion state corresponding to the first moment through the state correction model, and correct the first initial motion state according to the associated initial motion state to obtain the target motion state corresponding to the first moment; wherein the first moment is any moment of each moment, and the optimal time scale corresponding to the first initial motion state is the optimal time scale determined according to the ROC curve.

[0075] In an embodiment of the present application, the terminal device inputs the initial motion state corresponding to each determined moment into the state correction model, and the input initial motion state corresponding to each moment can be arranged in chronological order according to the time sequence of each moment. For any moment, the state correction model determines the corresponding optimal time scale based on the initial motion state corresponding to the moment. Among them, the optimal time scale corresponding to each motion state can be determined based on the receiver operating characteristic (ROC) curve. The optimal time scales corresponding to different motion states may be the same or different, and the optimal time scale corresponding to each motion state may refer to the time scale with the highest correction accuracy of the state correction model.

[0076] The state correction model determines one or more initial motion states associated with the first moment based on the scale range of the optimal time scale corresponding to the initial motion state corresponding to the first moment. The scale range of the optimal time scale can be the number of moments including the first moment, and the initial motion state associated with the first moment can be the initial motion state corresponding to multiple consecutive moments including the first moment. For example, see Figure 3 and Figure 4 , Figure 3is a schematic diagram of motion state prediction and motion state correction disclosed in the embodiment of this application, Figure 4 This is a schematic diagram of the optimal time scale disclosed in the embodiment of this application. Figure 3 As shown, the initial motion state corresponding to the moment t-4 in the predicted motion state sequence is sitting, and the optimal time scale corresponding to the motion state sitting is 5, then the initial motion state associated with the moment t-4 may be the initial motion state corresponding to 5 consecutive moments including the moment t-4. For example, the initial motion state associated with the moment t-4 may be the initial motion state corresponding to the moments t-2, t-3, t-5 and t-6, respectively, or may be the initial motion state corresponding to the moments t-3, t-5, t-6 and t-7, respectively. At this time, the terminal device may select the largest number of initial motion states from the initial motion states associated with the moment t-4, that is, 3 initial motion states of lying and 1 initial motion state of sitting, to correct the initial motion state corresponding to the moment t-4. It can be seen that the initial motion state corresponding to the moment t-4 before and after the correction is all lying, and the corrected initial motion state is determined as the target motion state corresponding to the moment. The terminal device may correct the initial motion state corresponding to the corresponding moment according to the optimal time scale corresponding to the initial motion state corresponding to each moment, and obtain the following: Figure 3 The sequence of target motion states corresponding to each moment after correction is shown.

[0077] In the embodiment of the present application, since the first moment in the motion time sequence does not have a previous moment, and the last moment in the motion time sequence does not have a subsequent moment, if all the initial motion states associated with the first moment cannot be determined according to the scale range corresponding to the optimal time scale, the target motion state corresponding to the first moment may not be output. Figure 3 As shown, the optimal time scale for the lying state is 5, and according to Figure 4 The scale range method corresponding to the optimal scale in [ 1 ] determines that the initial motion state associated with time t is the initial motion state corresponding to the two moments before time t, and the initial motion state corresponding to time t-1 and time t-2. However, since the predicted motion state sequence does not contain the initial motion states corresponding to the two moments before time t, the state correction model does not output the target motion state at time t.

[0078] By adopting the above embodiment, it is possible to obtain the initial motion state within the corresponding scale range according to the optimal time scale corresponding to different initial motion states to correct each initial motion state, thereby improving the reliability of the corrected motion state, and further improving the accuracy of the motion state recognition results determined based on the corrected motion states.

[0079] In one embodiment, before inputting the initial motion states corresponding to the respective moments into the state correction model in step 210, determining, by the state correction model, the initial motion state associated with the first moment within a scale range corresponding to the optimal time scale corresponding to the first initial motion state corresponding to the first moment, and correcting the first initial motion state based on the associated initial motion state to obtain the target motion state corresponding to the first moment, the method further includes:

[0080] Obtaining location information of the terminal device, and determining the scene the terminal device is in based on the location information, where each scene corresponds to at least one initial motion state;

[0081] According to the scene in which the terminal device is located, the optimal time scale corresponding to the initial motion state corresponding to the scene is reduced.

[0082] In an embodiment of the present application, the terminal device may first obtain the current position information of the terminal device carried by the user when exercising through a positioning device before correcting the initial motion state through a state correction model, and determine the scene in which the terminal device or the user is located based on the current position information. For example, the scene in which the terminal device is located is a school classroom, and the types of movement in the school classroom are basically sitting and standing. Therefore, this scene may correspond to the initial motion state of sitting and the initial motion state of standing, wherein the initial motion state corresponding to the scene can be set by the user.

[0083] The terminal device reduces the optimal time scale corresponding to the initial motion state based on the initial motion state corresponding to the scene it is in. For example, if the optimal time scale corresponding to the initial motion state of sitting is 7 and the optimal time scale corresponding to the initial motion state of standing is 5, the terminal device can reduce the optimal time scale corresponding to the initial motion state of sitting to 5 and the optimal time scale corresponding to the initial motion state of standing to 3. In this case, when the terminal device corrects the initial motion state of sitting using the state correction model, it uses the reduced optimal time scale of 5 to correct the initial motion state of sitting, and uses the reduced optimal time scale of 3 to correct the initial motion state of standing.

[0084] In the embodiment of the present application, since the larger the time scale, the greater the delay in outputting the motion state, the embodiment of the present application can reduce the output delay without reducing the recognition accuracy.

[0085] In one embodiment, see Figure 5 , Figure 5 The process of determining the initial motion state at each moment according to the motion state characteristics at each moment in step 220 may include:

[0086] 510. Input motion state features corresponding to multiple moments into a state prediction model, and determine the probability that each moment corresponds to each motion state through the state prediction model.

[0087] In an embodiment of the present application, the terminal device inputs the motion state features corresponding to multiple moments into the state prediction model. After receiving the motion state features corresponding to multiple moments, the state prediction model can output the probability values ​​corresponding to different motion states at each moment based on the algorithm between the feature value and the probability values ​​of different motion states. For example, the state prediction model outputs the probability values ​​corresponding to moment A and motion state a, motion state b, and motion state c as 0.6, 0.3, and 0.1, respectively, based on the motion state features corresponding to each moment, and the probability values ​​corresponding to moment B and motion state a, motion state b, and motion state c as 0.1, 0.1, and 0.8, respectively. Among them, the algorithm for calculating the probability values ​​corresponding to different motion states for the motion state features at each moment is not specifically limited here.

[0088] In an embodiment of the present application, the state prediction model can be a model composed of multiple decision trees, each decision tree outputs a probability value corresponding to a motion state, and the terminal device traverses all decision trees with the motion state characteristics at each moment, and obtains a corresponding array composed of multiple probability values ​​at each moment.

[0089] In some embodiments, for each moment, the sum of the probability values ​​of the corresponding initial motion states is 1, so that the motion state corresponding to each moment must be one of the initial motion states, which can avoid identifying other motion states other than the initial motion state.

[0090] 520. Compare the probability corresponding to each motion state at each moment with the probability threshold corresponding to each motion state.

[0091] In an embodiment of the present application, the terminal device obtains the probability corresponding to each motion state at each moment, that is, for each moment, there is a probability value corresponding to each different motion state. The terminal device compares each probability value at each moment with the probability threshold corresponding to the motion state corresponding to the probability value. For example, the probability values ​​corresponding to moment A and motion state a, motion state b and motion state c are 0.6, 0.3 and 0.1 respectively, while the probability threshold corresponding to motion state a is 0.5, the probability threshold corresponding to motion state b is 0.6, and the probability threshold corresponding to motion state c is 0.5. Then the state prediction model can compare the probability 0.6 of motion state a corresponding to moment A with the probability threshold 0.5 corresponding to motion state a, the probability 0.3 of motion state b corresponding to moment A with the probability threshold 0.6 corresponding to motion state b, and the probability 0.1 of motion state c corresponding to moment A with the probability threshold 0.5 corresponding to motion state c.

[0092] In some embodiments, the probability threshold of each initial motion state corresponding to each moment is greater than 0.5, which can ensure that each subsequent moment corresponds to at most one initial motion state.

[0093] 530. If the probability that the second moment corresponds to the first motion state is greater than the probability threshold corresponding to the first motion state, then the initial motion state corresponding to the first moment is determined as the first motion state, the second moment is any one of the moments, and the first motion state is any one of the motion states.

[0094] In an embodiment of the present application, for any one of the moments, that is, the first moment, the terminal device compares each probability value in the first moment with the probability threshold corresponding to the motion state corresponding to the probability value. If the probability value corresponding to the first motion state at the first moment is greater than the probability threshold corresponding to the first motion state, then the terminal device can determine the first motion state as the initial motion state corresponding to the first moment. The first motion state is any one of the motion states. Repeat the above steps until the terminal device determines the initial motion state corresponding to each moment. For example, the probability values ​​corresponding to moment A and motion state a, initial motion state b, and initial motion state c are 0.6, 0.3, and 0.1, respectively, while the probability threshold corresponding to motion state a is 0.5, the probability threshold corresponding to motion state b is 0.6, and the probability threshold corresponding to motion state c is 0.5. It can be seen that the probability value of motion state a corresponding to moment A, 0.6, is greater than the probability threshold corresponding to motion state a, 0.5, so the terminal device determines motion state a as the initial motion state corresponding to moment A.

[0095] In an embodiment of the present application, by determining the probability of each moment corresponding to each motion state, and determining the initial motion state corresponding to each moment based on whether the probability meets the probability threshold, the initial motion state corresponding to each moment can be determined more accurately.

[0096] In one embodiment, see Figure 6 , Figure 6 This is a flow chart of an optimal time scale method disclosed in the embodiment of this application. Figure 6 As shown, before obtaining the motion state features corresponding to the terminal device at multiple moments in step 210, the following steps may be performed:

[0097] 610. Obtain a sample motion data set for the first motion state, the sample motion data set including sample motion data corresponding to multiple sample moments, and a standard motion state sequence composed of standard motion states corresponding to multiple sample moments, the standard motion state including belonging to the first motion state or not belonging to the first motion state, the first motion state being any motion state;

[0098] In an embodiment of the present application, for determining the optimal time scale corresponding to the first motion state, the terminal device may first obtain a sample motion data set for the first motion state, wherein the first motion state may be any motion state, and the sample motion data set includes sample motion data corresponding to multiple sample moments, and a standard motion state sequence composed of standard motion states corresponding to multiple sample moments, the standard motion state including belonging to the first motion state or not belonging to the first motion state, and the sample motion data set may be set by the user. For example, the motion states include walking, running, and standing. The user may use the motion state data of the four moments collected by the terminal device in the actual walking motion state as the sample motion data corresponding to the four sample moments (sample moment 1-sample moment 4); the motion state data of the three moments collected by the terminal device in the actual running motion state as the sample motion data corresponding to the three sample moments (sample moment 5-sample moment 7); the motion state data of the three moments collected by the terminal device in the actual standing motion state as the sample motion data corresponding to the three sample moments (sample moment 8-sample moment 10). When the first motion state is walking, the standard motion states corresponding to each sample time between sample time 1 and sample time 4 in the sample motion data set belong to the first motion state and can be represented by label 1. The standard motion states corresponding to each sample time between sample time 5 and sample time 10 in the sample motion data set do not belong to the first motion state and can be represented by label 0. The standard motion states corresponding to these 10 sample time points can constitute the standard motion state sequence in the sample motion data set.

[0099] 620. Perform motion state prediction on the sample motion data corresponding to the multiple sample moments according to the state prediction model to obtain a predicted motion state sequence, where the predicted motion state sequence includes the predicted motion states corresponding to the multiple sample moments.

[0100] In an embodiment of the present application, the terminal device inputs the acquired sample data set for the first motion state into a state prediction model. The state prediction model predicts the predicted motion state corresponding to each sample moment based on the sample motion data corresponding to each sample moment. Based on the predicted motion states corresponding to each sample moment, a predicted motion state sequence having the same length as the standard motion state sequence is constructed. For example, based on the motion state data corresponding to 10 sample moments in the sample motion data set, the state prediction model predicts the predicted motion states corresponding to these 10 sample moments, thereby obtaining a predicted motion state sequence consisting of the predicted motion states corresponding to these 10 sample moments.

[0101] 630. The predicted motion states corresponding to the multiple sample moments are corrected according to each time scale within the time scale interval by the state correction model to obtain a corrected motion state sequence corresponding to each time scale.

[0102] In an embodiment of the present application, the terminal device inputs the obtained predicted motion state sequence including the predicted motion state corresponding to each sample moment into the state correction model. The state correction model corrects the predicted motion state corresponding to each sample moment in the predicted motion state sequence according to any time scale in the time scale interval, and obtains the corrected predicted motion state for each sample moment, that is, the corrected motion state corresponding to each sample moment. The corrected motion state corresponding to each sample moment constitutes the corrected motion state sequence corresponding to the time scale. The state correction model corrects the predicted motion state corresponding to multiple sample moments according to each time scale in the time scale interval, thereby obtaining a corrected motion state sequence corresponding to each time scale. For example, the time scale interval is [1,10]. The predicted state model corrects the predicted motion states corresponding to 10 sample moments in the predicted motion state sequence according to time scale 1, and obtains a corrected motion state sequence corresponding to time scale 1. The correction process is performed according to different time scales to obtain 10 corrected motion state sequences corresponding to different time scales.

[0103] 640. Compare the corrected motion state sequences corresponding to each time scale with the standard motion state sequence to determine the correction results corresponding to each corrected motion state sequence.

[0104] In an embodiment of the present application, the terminal device compares the corrected motion sequences corresponding to each time scale with the standard motion state sequence in the sample motion data set. Specifically, the corrected motion state corresponding to each sample moment in the corrected motion sequence can be compared with the standard motion state in the standard motion state sequence. The correction results corresponding to each corrected motion state sequence are determined based on the number of identical and different corrected motion states at each sample moment in the corrected motion state sequence and the standard motion state at the corresponding sample moment in the standard motion state sequence.

[0105] 650. According to the correction results corresponding to each corrected motion state sequence, construct the ROC curve at each time scale respectively, and determine the AUC area corresponding to the ROC curve at each time scale.

[0106] In an embodiment of the present application, the terminal device constructs ROC curves at various time scales according to the correction results of each corrected motion state sequence, wherein one corrected motion state sequence corresponds to one time scale, that is, the terminal device can construct an ROC curve at one time scale according to the correction result corresponding to one corrected motion state sequence. After the terminal device constructs the ROC curve, it can determine the AUC (Area Under Curve) area corresponding to each ROC curve, that is, the area under the ROC curve and the coordinate axis. The ROC curves at various time scales determined by the terminal device are all predicted and corrected for the sample motion data set of the first motion state. Therefore, the ROC curves at various time scales obtained are all ROC curves at various time scales for the first motion state. For example, please refer to Figure 7 , Figure 7 Schematic diagram of ROC curves of a motion state at three different time scales disclosed in an embodiment of the present application.

[0107] 660. According to the AUC areas corresponding to the ROC curves at various time scales, determine the time scale corresponding to the largest AUC area as the optimal time scale corresponding to the first motion state.

[0108] In an embodiment of the present application, the terminal device determines the ROC curve with the largest AUC area from the ROC curves at various time scales for the first motion state, and the time scale corresponding to the ROC curve is the optimal time scale corresponding to the first motion state.

[0109] In the examples of this application, please refer to Figure 8 , Figure 8 This is a flow chart of obtaining the optimal time scale corresponding to all states disclosed in the embodiment of this application. Figure 8As shown, the terminal device can first extract the minimum time scale from the time scale interval for the first motion state, obtain the ROC curve of the first motion state at the minimum time scale and the AUC area corresponding to the ROC curve, and after obtaining the AUC area, add 1 to the time scale, that is, obtain the next time scale, and obtain the ROC curve of the first motion state at the next time scale and the AUC area corresponding to the ROC curve according to the next time scale, and repeat this process until the ROC curve of the first motion state at each time scale in the time scale interval and the AUC area corresponding to the ROC curve are obtained. The terminal device determines the optimal time scale corresponding to the first motion state based on each AUC area. Then, the terminal device can use the above method to determine the optimal time scale corresponding to another motion state. Until all motion states are traversed, the optimal time scales corresponding to all motion states are obtained. Please refer to Table 1, which is a table of the optimal time scales corresponding to each motion state output by the terminal device in an embodiment of the present application.

[0110] Table 1

[0111] Movement status Optimal time scale lie 5 sit 7 stand 5 walk 7 running 7 Go upstairs 9 Go downstairs 9 bike 5 jump rope 7 Scooter 7

[0112] In an embodiment of the present application, the predicted motion state corresponding to each sample moment is predicted by the sample data at each moment in the set sample motion data set, and the predicted motion state corresponding to each sample moment constitutes a predicted motion state sequence. The predicted motion state corresponding to each sample moment in the predicted motion state sequence is corrected according to different time scales to obtain each corrected motion state sequence. Each corrected motion state sequence is compared with the standard motion state sequence to obtain the correction results at each time scale. The ROC curve at each time scale is constructed according to each correction result, and the optimal time scale is determined according to the AUC area of ​​the ROC curve. The correction effect of different time scales can be analyzed through the ROC curve to determine the optimal time scale corresponding to each motion state, thereby improving the reliability of the corrected motion state and thereby improving the accuracy of motion state recognition.

[0113] In one embodiment, see Figure 9 , Figure 9 FIG. 1 is a flow chart of another optimal time scale method disclosed in an embodiment of the present application, which can be applied to the aforementioned terminal device 10. Figure 9 As shown, the method may include the following steps:

[0114] 910. Obtain a sample motion data set for the first motion state, the sample motion data set including sample motion data corresponding to multiple sample moments, and a standard motion state sequence consisting of standard motion states corresponding to multiple sample moments, wherein the standard motion state includes belonging to the first motion state or not belonging to the first motion state.

[0115] 920. Input the sample motion data corresponding to the multiple sample moments into a state prediction model, and determine the probabilities that the multiple sample moments correspond to the first motion state based on the sample motion data corresponding to the multiple sample moments through the state prediction model.

[0116] In an embodiment of the present application, the terminal device inputs the sample motion data corresponding to multiple sample moments into the state prediction model. After receiving the sample motion data corresponding to the multiple moments, the state prediction model can first extract the motion state feature values ​​corresponding to the multiple moments based on the sample motion data corresponding to the multiple moments, and then output the probability values ​​corresponding to the different motion states at each moment based on the algorithm between the feature values ​​and the probability values ​​of different motion states, and determine the probability values ​​corresponding to the first motion state at each moment from the probability values ​​corresponding to the different motion states. For example, based on the motion state data corresponding to each moment, the state prediction model outputs the probability values ​​of motion state a, motion state b, and motion state c corresponding to moment A as 0.6, 0.3, and 0.1, respectively, and the probability values ​​of motion state a, motion state b, and motion state c corresponding to moment B as 0.1, 0.1, and 0.9, respectively. When the first motion state is motion state a, the state prediction model determines that the probability of moment A corresponding to the first motion state is 0.6, and the probability of moment B corresponding to the first motion state is 0.1.

[0117] 930. Evaluate the probabilities of the first motion state corresponding to multiple sample moments according to each probability threshold value under the probability interval to obtain a predicted motion state sequence corresponding to each probability threshold value, wherein the predicted motion state sequence corresponding to the first probability threshold value includes the predicted motion states corresponding to multiple sample moments under the first probability threshold value, and the first probability threshold value is any probability threshold value under the probability threshold interval.

[0118] In an embodiment of the present application, the terminal device evaluates the probabilities of the first motion state corresponding to multiple sample moments based on any probability threshold value within the probability interval, namely, the first probability threshold value. Based on whether the probability value corresponding to each sample moment satisfies the first probability threshold value, the terminal device predicts whether each sample moment corresponds to the first motion state. Based on the correspondence between each sample moment and the first motion state, a predicted motion state sequence corresponding to the first probability value is obtained. Based on each probability threshold value within the probability interval, the terminal device evaluates the probabilities of the first motion state corresponding to multiple sample moments one by one, obtaining a predicted motion state sequence corresponding to each probability threshold value.

[0119] In an embodiment of the present application, by determining the probabilities that multiple sample moments correspond to the first motion state, and determining the probabilities that multiple sample moments correspond to the first motion state based on the respective probability thresholds under the probability interval, the recognition effect of the terminal device for the first motion state under different probability thresholds can be determined, which is helpful for the subsequent analysis of the correction effects under different time scales.

[0120] In one embodiment, the process of evaluating the probabilities of the first motion state corresponding to the plurality of sample moments according to the respective probability thresholds within the probability interval in step 930 to obtain the predicted motion state sequence corresponding to the respective probability thresholds may include the following steps:

[0121] Comparing the probability of each sample moment corresponding to the first motion state with a first probability threshold;

[0122] If the probability that the first sample time corresponds to the first motion state is greater than the first probability threshold, then determining that the predicted motion state corresponding to the first sample time belongs to the first motion state, and the first sample time is any one of the sample times;

[0123] If the probability that the first sample moment corresponds to the first motion state is less than or equal to the first probability threshold, it is determined that the predicted motion state corresponding to the first sample moment does not belong to the first motion state.

[0124] In an embodiment of the present application, the terminal device obtains the probability that each sample moment corresponds to the first motion state, that is, for each sample moment, there is a probability value corresponding to the first motion state. The terminal device compares each probability value corresponding to the first motion state in each sample moment with the first probability threshold. For example, the probability values ​​of sample moment A, sample moment B, and sample moment C corresponding to the first motion state a are 0.6, 0.3, and 0.2, respectively. The probability threshold interval is [0.1, 0.3], and each probability threshold is divided into intervals of 0.1 in the probability threshold interval, so the probability threshold interval contains 3 probability thresholds. The state prediction model can compare the probabilities of 0.6, 0.3 and 0.2 of the sample moments A, B and C corresponding to the first motion state a with the first probability threshold of 0.1, and compare the probabilities of 0.6, 0.3 and 0.2 of the sample moments A, B and C corresponding to the first motion state a with the probability threshold of 0.2, and compare the probabilities of 0.6, 0.3 and 0.2 of the sample moments A, B and C corresponding to the first motion state a with the probability threshold of 0.3.

[0125] In an embodiment of the present application, for any one of the sample moments, that is, the first sample moment, the terminal device compares the probability value of the first motion state corresponding to the first sample moment with the first probability threshold. If the probability value of the first motion state corresponding to the first sample moment is greater than the first probability threshold, then the terminal device can determine that the predicted motion state corresponding to the first sample moment belongs to the first motion state, which can be marked as 1. If the probability value of the first motion state corresponding to the first sample moment is less than or equal to the first probability threshold, then the terminal device can determine that the predicted motion state corresponding to the first sample moment does not belong to the first motion state, which can be marked as 0. By repeating the above steps, the terminal device can obtain a sequence of predicted motion states corresponding to each probability threshold. For example, the probability values ​​of the first motion state a corresponding to sample moment A, sample moment B, and sample moment C are 0.6, 0.3, and 0.2, respectively. The state prediction model compares the probabilities of 0.6, 0.3, and 0.2 for the first motion state a at sample times A, B, and C, respectively, with the first probability threshold of 0.1, and determines that the predicted motion state sequence corresponding to the first probability threshold of 0.1 is [1, 1, 1]. The state prediction model compares the probabilities of 0.6, 0.3, and 0.2 for the first motion state a at sample times A, B, and C, respectively, with the first probability threshold of 0.2, and determines that the predicted motion state sequence corresponding to the first probability threshold of 0.2 is [1, 1, 0]. The state prediction model compares the probabilities of 0.6, 0.3, and 0.2 for the first motion state a at sample times A, B, and C, respectively, with the first probability threshold of 0.3, and determines that the predicted motion state sequence corresponding to the first probability threshold of 0.1 is [1, 0, 0]. Here, 1 indicates that the predicted motion state corresponding to the sample time belongs to the first motion state, and 0 indicates that the predicted motion state corresponding to the sample time does not belong to the first motion state.

[0126] In an embodiment of the present application, by comparing the probability of the first motion state corresponding to each sample moment with each probability threshold, it is determined whether the predicted motion state corresponding to each sample moment under different probability thresholds belongs to the first motion state. This allows prediction to be made only for the first motion state, thereby simplifying the predicted motion state sequence.

[0127] 940. Input the predicted motion state sequence into the state correction model. The state correction model determines the predicted motion state associated with each sample moment within the scale range corresponding to the first time scale according to the first time scale within the time scale interval, and corrects the predicted motion state corresponding to each sample moment according to the associated predicted motion state to obtain a corrected motion state sequence corresponding to the first time scale, where the first time scale is any time scale within the time scale interval.

[0128] In an embodiment of the present application, the terminal device inputs the obtained predicted motion state sequence into the state correction model. The state correction model determines the predicted motion state associated with each sample moment in the predicted motion state sequence within the scale range corresponding to the first time scale, and corrects the motion state corresponding to each sample moment according to the associated predicted motion state. For example, the predicted motion state sequence corresponding to the first probability threshold is [1,1,1,0,1,1,1], and the first time scale is 5. Then the predicted motion state corresponding to the 4th sample moment is 0, that is, the corresponding predicted motion state does not belong to the first motion state. The 4th sample moment is determined to be the 2nd, 3rd, 5th and 6th sample moments according to the scale range corresponding to the first time scale of 5. Therefore, the associated predicted motion states are 1,1,1,1. According to the associated predicted motion state, the predicted motion state corresponding to the 4th sample moment can be corrected from 0 to 1. The corrected motion state sequence corresponding to the first probability threshold under the first scale is [1,1,1,1,1,1,1]. Using the above method, the modified motion state sequences corresponding to the other probability thresholds in the probability threshold interval at the first scale can be determined. The modified motion state sequences corresponding to the probability thresholds in the probability threshold interval at the first time scale are the modified motion state sequences corresponding to the first time scale. Consequently, the terminal device can also obtain the modified motion state sequences corresponding to the various time scales.

[0129] 950. Compare the sample moments corresponding to the first motion state in the corrected motion state sequence corresponding to each probability threshold at the first time scale with the sample moments corresponding to the first motion state in the standard motion state sequence to determine the correction results of the corrected motion state sequence corresponding to each probability threshold at the first time scale.

[0130] In an embodiment of the present application, for the first time scale, the terminal device compares the sample moments corresponding to the first motion state in the corrected motion state sequence corresponding to each probability threshold under the first time scale with the sample moments corresponding to the first motion state in the standard motion state sequence. If the first sample moment in the corrected motion state sequence corresponding to the first probability threshold belongs to the first motion state, and the first sample moment in the standard motion state sequence also belongs to the first motion state, then it can be considered that the first sample moment under the first probability threshold is accurately corrected according to the first time scale, otherwise it is considered that the first sample moment under the first probability is incorrectly corrected according to the first time scale. The terminal device determines the correction result of the corrected motion state sequence corresponding to the first probability threshold under the first time scale based on the number of sample moments accurately corrected according to the first time scale under the first probability threshold. The above method can be used to determine the correction result of the corrected motion state sequence corresponding to each probability threshold under each time scale. For example, for the first time scale of 5, the modified motion state sequence corresponding to the first probability threshold under the first time scale is [0, 1, 1, 1, 1, 0, 1, 1], and the standard motion state sequence is [1, 0, 1, 1, 1, 0, 1, 1], where 1 indicates that the sample moment belongs to the first motion state, and 0 indicates that the sample moment does not belong to the first motion state. The number of sample moments where the standard motion state is 1 and the modified motion state is also 1 is recorded as TP, the number of sample moments where the standard motion state is 0 and the modified motion state is also 0 is recorded as TN, the number of sample moments where the standard motion state is 0 and the modified motion state is also 1 is recorded as FP, and the number of sample moments where the standard motion state is 1 and the modified motion state is also 0 is recorded as FN. According to the following formulas (1) and (2), the number of positive classes TPR and the number of negative classes FPR can be calculated.

[0131]

[0132]

[0133] Therefore, the terminal device can calculate the correction results of the corrected motion state sequence corresponding to the first probability threshold at the first time scale as TPR = 0.93 and FPR = 0.5. The terminal device uses this to determine the correction results of the corrected motion state sequence corresponding to each probability threshold at each time scale.

[0134] 960. According to the correction results of the corrected motion state sequence corresponding to each probability threshold at the first time scale, construct a ROC curve corresponding to the first time scale, and determine the AUC area corresponding to the ROC curve at the first time scale, where the first time scale is any time scale within the time scale interval.

[0135] In an embodiment of the present application, the terminal device can determine a point in the ROC curve based on the correction result of the corrected state motion sequence corresponding to the first probability threshold at the first time scale, and can determine multiple points in the ROC curve based on the correction result of the corrected motion state sequence corresponding to each probability threshold in the probability threshold interval at the first scale. The terminal device can construct the ROC curve corresponding to the first scale based on these multiple points, and determine the AUC area corresponding to the ROC curve at the first time scale based on the ROC curve corresponding to the first scale. The terminal device can construct the ROC curve at each time scale in the same manner and determine the AUC area corresponding to the ROC curve at each time scale.

[0136] In an embodiment of the present application, by comparing the sample moments corresponding to the first motion state in the standard motion state sequence and the corrected motion state sequence, the correction results of the corrected motion state sequence corresponding to each probability threshold at each time scale are determined, and the ROC curve corresponding to the time scale is constructed according to the correction results of the corrected motion state sequence corresponding to each probability threshold at a time scale. The ROC curve corresponding to each time scale can be accurately constructed, thereby improving the reliability of the determined optimal time scale.

[0137] 970. According to the AUC areas corresponding to the ROC curves at various time scales, determine the time scale corresponding to the largest AUC area as the optimal time scale corresponding to the first motion state.

[0138] See also Figure 10 , Figure 10 This is a schematic diagram of the structure of a motion state correction device disclosed in an embodiment of the present application, which can be applied to a terminal device. Figure 10 As shown, the motion state correction device 1000 may include: a feature acquisition module 1010 , a state determination module 1020 and a state correction module 1030 .

[0139] A feature acquisition module 1010 is configured to acquire motion state features corresponding to the terminal device at multiple moments. The motion state features are extracted based on motion state data collected by the terminal device.

[0140] A state determination module 1020 is configured to determine an initial motion state corresponding to each moment based on motion state characteristics corresponding to each moment;

[0141] The state correction module 1030 is used to input the initial motion state corresponding to each moment into the state correction model, and determine the initial motion state associated with the first moment within the scale range corresponding to the optimal time scale according to the optimal time scale corresponding to the first initial motion state corresponding to the first moment through the state correction model, and correct the first initial motion state according to the associated initial motion state to obtain the target motion state corresponding to the first moment; wherein the first moment is any moment of each moment, and the optimal time scale corresponding to the first initial motion state is the optimal time scale determined according to the ROC curve.

[0142] In one embodiment, the state determination module 1020 is further configured to:

[0143] Input the motion state features corresponding to the multiple moments into the state prediction model, and determine the probability that each moment corresponds to each motion state through the state prediction model;

[0144] Compare the probability corresponding to each motion state at each moment with the probability threshold corresponding to each motion state;

[0145] If the probability that the second moment corresponds to the first motion state is greater than the probability threshold corresponding to the first motion state, the initial motion state corresponding to the first moment is determined as the first motion state, the second moment is any one of the moments, and the first motion state is any one of the motion states.

[0146] Please also refer to Figure 11 , Figure 11 This is a schematic diagram of the structure of another motion state correction device disclosed in an embodiment of the present application. Figure 11 The motion state correction device shown is composed of Figure 10 The motion state correction device shown is optimized. Figure 10 Compared with the motion state correction device shown, Figure 11 The motion state correction device 1000 may further include:

[0147] The scale determination module 1040 is configured to obtain a sample motion data set for the first motion state, the sample motion data set including sample motion data corresponding to a plurality of sample moments and a standard motion state sequence consisting of standard motion states corresponding to the plurality of sample moments, the standard motion state including either belonging to the first motion state or not belonging to the first motion state;

[0148] According to the state prediction model, motion state prediction is performed on the sample motion data corresponding to the multiple sample moments to obtain a predicted motion state sequence, wherein the predicted motion state sequence includes the predicted motion states corresponding to the multiple sample moments;

[0149] The predicted motion states corresponding to multiple sample moments are corrected according to each time scale within the time scale interval through the state correction model, and a corrected motion state sequence corresponding to each time scale is obtained;

[0150] Compare the corrected motion state sequences corresponding to each time scale with the standard motion state sequence to determine the correction results corresponding to each corrected motion state sequence;

[0151] According to the correction results corresponding to each corrected motion state sequence, the ROC curves at each time scale are constructed respectively, and the AUC area corresponding to the ROC curves at each time scale is determined;

[0152] According to the AUC areas corresponding to the ROC curves at various time scales, the time scale corresponding to the largest AUC area is determined as the optimal time scale corresponding to the first motion state.

[0153] In one embodiment, the scale determination module 1040 is further configured to:

[0154] Inputting the sample motion data corresponding to the plurality of sample moments into a state prediction model, and determining, by the state prediction model, the probabilities that the plurality of sample moments correspond to the first motion state based on the sample motion data corresponding to the plurality of sample moments;

[0155] According to each probability threshold under the probability interval, the probabilities of the first motion state corresponding to multiple sample moments are evaluated to obtain a predicted motion state sequence corresponding to each probability threshold, wherein the predicted motion state sequence corresponding to the first probability threshold includes the predicted motion states corresponding to multiple sample moments under the first probability threshold, and the first probability threshold is any probability threshold under the probability interval.

[0156] In one embodiment, the scale determination module 1040 is further configured to:

[0157] Comparing the probability of each sample moment corresponding to the first motion state with a first probability threshold;

[0158] If the probability that the first sample time corresponds to the first motion state is greater than the first probability threshold, then determining that the predicted motion state corresponding to the first sample time belongs to the first motion state, and the first sample time is any one of the sample times;

[0159] If the probability that the first sample moment corresponds to the first motion state is less than or equal to the first probability threshold, it is determined that the predicted motion state corresponding to the first sample moment does not belong to the first motion state.

[0160] In one embodiment, the scale determination module 1040 is further configured to:

[0161] Comparing the sample moments corresponding to the first motion state in the corrected motion state sequence corresponding to each probability threshold at the first time scale with the sample moments corresponding to the first motion state in the standard motion state sequence, and determining correction results of the corrected motion state sequence corresponding to each probability threshold at the first time scale;

[0162] According to the correction results corresponding to each corrected motion state sequence, ROC curves at various time scales are constructed, including:

[0163] According to the correction results of the corrected motion state sequence corresponding to each probability threshold at the first time scale, an ROC curve corresponding to the first time scale is constructed, where the first time scale is any time scale within the time scale interval.

[0164] In one embodiment, the scale determination module 1040 is further configured to:

[0165] The predicted motion state sequence is input into the state correction model. The state correction model determines the predicted motion state associated with each sample moment within the scale range corresponding to the first time scale according to the first time scale in the time scale interval, and corrects the predicted motion state corresponding to each sample moment according to the associated predicted motion state to obtain a corrected motion state sequence corresponding to the first time scale, where the first time scale is any time scale in the time scale interval.

[0166] Please also refer to Figure 12 , Figure 12 This is a schematic diagram of the structure of another motion state correction device disclosed in the embodiment of this application. Figure 12 The motion state correction device shown is composed of Figure 9 The motion state correction device shown is optimized. Figure 9 Compared with the motion state correction device shown, Figure 12 The motion state correction device 900 may further include:

[0167] The scale adjustment module 950 is used to obtain the location information of the terminal device and determine the scene of the terminal device based on the location information, where each scene corresponds to at least one motion state;

[0168] According to the scene in which the terminal device is located, the optimal time scale corresponding to each motion state corresponding to the scene is reduced.

[0169] See also Figure 13 , Figure 13 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment. The electronic device can be applied to a terminal device, which is not specifically limited here. Figure 13 As shown, the electronic device 1300 may include:

[0170] A memory 1310 storing executable program code;

[0171] a processor 1320 coupled to the memory 1310;

[0172] The processor 1320 calls the executable program code stored in the memory 1310 to execute any one of the motion state correction methods disclosed in the embodiments of the present application.

[0173] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute any one of the motion state correction methods disclosed in the embodiment of the present application.

[0174] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute any one of the motion state correction methods disclosed in the embodiments of the present application.

[0175] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.

[0176] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0177] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the objectives of this embodiment.

[0178] In addition, the functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0179] If the above-mentioned 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 computer-accessible memory. Based on this understanding, the technical solution of the present application, 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 memory and includes several requests for a computer device (which can be a personal computer, server or network device, etc., specifically a processor in a computer device) to execute some or all of the steps of the above-mentioned methods of various embodiments of the present application.

[0180] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0181] The above is a detailed introduction to a motion state correction method, device, electronic device, and storage medium disclosed in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. At the same time, for those skilled in the art, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present application.

Claims

1. A motion state correction method, characterized in that: Applied to a terminal device, the method comprises: Acquire motion state features corresponding to the terminal device at multiple times, wherein the motion state features are extracted based on motion state data collected by the terminal device; Determining the initial motion state corresponding to each moment according to the motion state characteristics corresponding to each moment; The initial motion states corresponding to the various moments are input into a state correction model, and the state correction model determines the initial motion state associated with the first moment within a scale range corresponding to the optimal time scale according to the optimal time scale corresponding to the first initial motion state corresponding to the first moment, and corrects the first initial motion state according to the associated initial motion state to obtain the target motion state corresponding to the first moment; wherein the scale range of the optimal time scale is the number of moments including the first moment, the initial motion state associated with the first moment is the initial motion state corresponding to a plurality of consecutive moments including the first moment, the first moment is any one of the various moments, the optimal time scale corresponding to the first initial motion state is the time scale corresponding to the ROC curve with the largest AUC area in the ROC curves at various time scales of the first initial motion state, and the ROC curves at various time scales are obtained by predicting and correcting the sample motion data set of the first initial motion state in advance.

2. The method according to claim 1, characterized in that The determining the initial motion state corresponding to each moment according to the motion state characteristics corresponding to each moment includes: Inputting the motion state features corresponding to the multiple moments into a state prediction model, and determining the probability that each moment corresponds to each motion state through the state prediction model; Compare the probabilities corresponding to the respective motion states at the respective moments with the probability thresholds corresponding to the respective motion states; If the probability that the second moment corresponds to the first motion state is greater than the probability threshold corresponding to the first motion state, the initial motion state corresponding to the second moment is determined as the first motion state, the second moment is any one of the moments, and the first motion state is any one of the motion states.

3. The method according to claim 1, characterized in that Before acquiring the motion state features corresponding to the terminal device at multiple moments, the method further includes: Acquire a sample motion data set for a first motion state, the sample motion data set comprising sample motion data corresponding to a plurality of sample moments, and a standard motion state sequence composed of standard motion states corresponding to the plurality of sample moments, the standard motion state comprising belonging to the first motion state or not belonging to the first motion state; the first motion state is any motion state; Performing motion state prediction on the sample motion data corresponding to the plurality of sample moments respectively according to the state prediction model to obtain a predicted motion state sequence, wherein the predicted motion state sequence includes the predicted motion states corresponding to the plurality of sample moments respectively; The predicted motion states corresponding to the plurality of sample moments are corrected according to each time scale in the time scale interval by a state correction model to obtain a corrected motion state sequence corresponding to each time scale; Comparing the modified motion state sequences corresponding to the respective time scales with the standard motion state sequences respectively to determine the correction results corresponding to the respective modified motion state sequences; According to the correction results corresponding to each of the corrected motion state sequences, construct the ROC curves at each of the time scales respectively, and determine the AUC area corresponding to the ROC curves at each of the time scales; According to the AUC areas corresponding to the ROC curves at the various time scales, the time scale corresponding to the largest AUC area is determined as the optimal time scale corresponding to the first motion state.

4. The method according to claim 3, characterized in that: The step of performing motion state prediction on the sample motion data corresponding to the plurality of sample moments respectively according to the state prediction model to obtain a predicted motion state sequence includes: Inputting the sample motion data corresponding to the multiple sample moments into a state prediction model, and determining, by the state prediction model, the probabilities that the multiple sample moments correspond to the first motion state according to the sample motion data corresponding to the multiple sample moments; The probabilities of the first motion state corresponding to the multiple sample moments are evaluated according to each probability threshold under the probability interval to obtain a predicted motion state sequence corresponding to each probability threshold, wherein the predicted motion state sequence corresponding to the first probability threshold includes the predicted motion states corresponding to the multiple sample moments under the first probability threshold, and the first probability threshold is any probability threshold under the probability interval.

5. The method according to claim 4, characterized in that The step of evaluating the probabilities of the plurality of sample moments corresponding to the first motion state according to each probability threshold value under the probability interval to obtain a predicted motion state sequence corresponding to each probability threshold value includes: Compare the probability of each sample moment corresponding to the first motion state with the first probability threshold respectively; If the probability that the first sample time corresponds to the first motion state is greater than the first probability threshold, determining that the predicted motion state corresponding to the first sample time belongs to the first motion state, and the first sample time is any one of the sample times; If the probability that the first sample moment corresponds to the first motion state is less than or equal to the first probability threshold, it is determined that the predicted motion state corresponding to the first sample moment does not belong to the first motion state.

6. The method according to claim 4, characterized in that The step of comparing the modified motion state sequences corresponding to the respective time scales with the standard motion state sequences to determine the correction results corresponding to the respective modified motion state sequences comprises: Respectively comparing the sample moments corresponding to the first motion state in the modified motion state sequence corresponding to each of the probability thresholds at the first time scale with the sample moments corresponding to the first motion state in the standard motion state sequence, to determine a correction result of the modified motion state sequence corresponding to each of the probability thresholds at the first time scale; The step of constructing the ROC curves at each time scale according to the correction results corresponding to each of the corrected motion state sequences comprises: According to the correction result of the corrected motion state sequence corresponding to the respective probability thresholds at the first time scale, a ROC curve corresponding to the first time scale is constructed, wherein the first time scale is any time scale within the time scale interval.

7. The method according to claim 3, characterized in that The state correction model is used to correct the predicted motion states corresponding to the multiple sample moments according to each time scale within the time scale interval, including: The predicted motion state sequence is input into the state correction model, and the state correction model determines the predicted motion state associated with each sample moment within the scale range corresponding to the first time scale according to a first time scale within the time scale interval, and corrects the predicted motion state corresponding to each sample moment according to the associated predicted motion state to obtain a corrected motion state sequence corresponding to the first time scale, wherein the first time scale is any time scale within the time scale interval.

8. The method according to any one of claims 1 to 7, characterized in that: Before inputting the initial motion states corresponding to the respective moments into the state correction model, the method further comprises: Acquire location information of the terminal device, and determine a scene in which the terminal device is located according to the location information, each of the scenes corresponding to at least one motion state; According to the scene in which the terminal device is located, the optimal time scale corresponding to each motion state corresponding to the scene is reduced.

9. A motion state correction device, characterized in that: The device comprises: A feature acquisition module, used to acquire motion state features corresponding to the terminal device at multiple times, wherein the motion state features are extracted based on the motion state data collected by the terminal device; A state determination module, used to determine the initial motion state corresponding to each moment according to the motion state characteristics corresponding to each moment; A state correction module is used to input the initial motion states corresponding to the various moments into a state correction model, and determine the initial motion state associated with the first moment within the scale range corresponding to the optimal time scale according to the optimal time scale corresponding to the first initial motion state corresponding to the first moment through the state correction model, and correct the first initial motion state according to the associated initial motion state to obtain the target motion state corresponding to the first moment; wherein the scale range of the optimal time scale is the number of moments including the first moment, the initial motion state associated with the first moment is the initial motion state corresponding to a plurality of consecutive moments including the first moment, the first moment is any one of the various moments, the optimal time scale corresponding to the first initial motion state is the time scale corresponding to the ROC curve with the largest AUC area in the ROC curves at various time scales of the first initial motion state, and the ROC curves at various time scales are obtained by predicting and correcting the sample motion data set of the first initial motion state in advance.

10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.