Method for obtaining motion data, and electronic device
Abstract
A method f, applied to an electronic device, a device, and a storage medium are provided. An electronic device stores at least one historical ground and a ground parameter corresponding to the historical ground. The method includes after a playground mode is enabled, obtaining a plurality of pieces of first positioning data corresponding to different locations of a user in a motion process, determining a target ground from the at least one historical ground based on the first positioning data and the ground parameter corresponding to the historical ground, and obtaining a plurality of pieces of second positioning data corresponding to different locations of the user in the motion process, and determining a motion route of the user on the target ground in the motion process based on the first positioning data, the second positioning data, a ground parameter corresponding to the target ground, and a preset error threshold.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method, applied to an electronic device, wherein the electronic device stores data representing at least one historical ground and a ground parameter corresponding to the at least one historical ground, and the method comprises:
after a playground mode is enabled:
obtaining a plurality of pieces of first positioning data corresponding to different locations of a user in a motion process, and
determining a target ground from the data representing the at least one historical ground based on the plurality of pieces of first positioning data and the ground parameter corresponding to the at least one historical ground; and
obtaining a plurality of pieces of second positioning data corresponding to different locations of the user in the motion process; and determining a motion route of the user on the target ground in the motion process based on the plurality of pieces of first positioning data, the plurality of pieces of second positioning data, a ground parameter corresponding to the target ground, and a preset error threshold, wherein a time point of obtaining the second positioning data is later than a time point of obtaining the first positioning data.
2 . The method according to claim 1 , wherein determining the target ground from the data representing the at least one historical ground based on the plurality of pieces of first positioning data and the ground parameter corresponding to the at least one historical ground comprises:
determining a location point corresponding to target first positioning data in the plurality of pieces of first positioning data; for each historical ground of the at least one historical ground:
obtaining a center point location of the historical ground based on the ground parameter corresponding to the historical ground, and
obtaining a first distance between the center point location and the location point corresponding to the target first positioning data; and
determining the at least one historical ground as the target ground in response to the first distance corresponding to a historical ground of the at least one historical ground being less than or equal to a first preset length.
3 . The method according to claim 2 , wherein determining the at least one historical ground as the target ground in response to the first distance corresponding to the historical ground of the at least one historical ground being less than or equal to the first preset length comprises:
in response to a plurality of first distances corresponding to a plurality of historical grounds being less than or equal to the first preset length, using the plurality of historical grounds as a plurality of candidate grounds; obtaining, for each candidate ground of the plurality of candidate grounds, a data error of each of the plurality of pieces of first positioning data based on a ground parameter corresponding to the candidate ground; and in response to the data error of each piece of first positioning data being less than or equal to a preset difference, determining a candidate ground of the plurality of candidate grounds as the target ground.
4 . The method according to claim 3 , wherein obtaining, for each candidate ground of the plurality of candidate grounds, the data error of each of the plurality of pieces of first positioning data based on the ground parameter corresponding to the candidate ground comprises:
for at least a candidate ground of the plurality of candidate grounds, for each piece of first positioning data, determining, based on the ground parameter corresponding to the candidate ground and the first positioning data, a determined location area, in the candidate ground, of a location point corresponding to the first positioning data, wherein the candidate ground comprises a plurality of location areas; based on the determined location area:
determining a reference location of the candidate ground,
determining a second distance between the location point corresponding to the first positioning data and the reference location, and
obtaining a third distance between the determined location area and the reference location; and
determining an absolute value of a difference between the second distance and the third distance as the data error of the first positioning data.
5 . The method according to claim 1 , wherein determining the motion route of the user on the target ground in the motion process based on the plurality of pieces of first positioning data, the plurality of pieces of second positioning data, the ground parameter corresponding to the target ground, and the preset error threshold comprises:
for the target ground, determining a data error of each piece of positioning data in the plurality of pieces of first positioning data and the plurality of pieces of second positioning data based on the ground parameter corresponding to the target ground; and in response to determining that positioning data having a data error that is less than or equal to the preset error threshold exists, aligning a location point corresponding to the positioning data with a location point corresponding to previous positioning data, and continuing to obtain a motion route; or in response to determining that the positioning data having the data error that is greater than the preset error threshold exists, connecting the location point corresponding to the positioning data to the location point corresponding to previous positioning data, and continuing to obtain the motion route.
6 . The method according to claim 1 , further comprising:
determining a target ground parameter of the target ground based on a plurality of pieces of third positioning data corresponding to different locations of the user in the motion process, wherein the plurality of pieces of third positioning data comprise the plurality of pieces of first positioning data and a part of the plurality of pieces of second positioning data; determining, based on a plurality of pieces of fourth positioning data corresponding to different locations of the user in the motion process, a first parameter error corresponding to the target ground parameter of the target ground, and a second parameter error corresponding to a stored ground parameter of the target ground, wherein a time of obtaining the fourth positioning data is later than a time of obtaining the third positioning data, and the plurality of pieces of second positioning data comprise the plurality of pieces of fourth positioning data; and in response to the first parameter error being less than the second parameter error, updating the stored ground parameter corresponding to the target ground to the target ground parameter after user motion ends.
7 . The method according to claim 1 , further comprising:
in response to no target ground being determined from the at least one historical ground based on the plurality of pieces of first positioning data and the ground parameter corresponding to the at least one historical ground, obtaining corresponding fifth positioning data of the user in the motion process, wherein a quantity of the fifth positioning data is greater than a quantity of the first positioning data; and determining, based on the fifth positioning data, a ground parameter of a ground on which the user is currently located; and after the user motion ends, storing the ground parameter of the ground on which the user is currently located.
8 . The method according to claim 1 , further comprising:
displaying, during the motion process, the motion route of the user in the motion process; or displaying the motion route after the user motion ends.
9 . An electronic device, wherein the electronic device comprises at least one memory and one or more processors, the at least one memory is coupled to the one or more processors, the at least one memory stores computer program code, and stores at least one historical ground and a ground parameter corresponding to the at least one historical ground, wherein the computer program code comprises computer instructions, and when the computer instructions are executed by the one or more processors, the electronic device is caused to:
after a playground mode is enabled:
obtain a plurality of pieces of first positioning data corresponding to different locations of a user in a motion process, and
determine a target ground from the data representing the at least one historical ground based on the plurality of pieces of first positioning data and the ground parameter corresponding to the at least one historical ground; and
obtain a plurality of pieces of second positioning data corresponding to different locations of the user in the motion process; and determine a motion route of the user on the target ground in the motion process based on the plurality of pieces of first positioning data, the plurality of pieces of second positioning data, a ground parameter corresponding to the target ground, and a preset error threshold, wherein a time point of obtaining the second positioning data is later than a time point of obtaining the first positioning data.
10 . The electronic device to claim 9 , wherein to determine the target ground from the data representing the at least one historical ground based on the plurality of pieces of first positioning data and the ground parameter corresponding to the at least one historical ground, the computer instructions cause the electronic device to:
determine a location point corresponding to target first positioning data in the plurality of pieces of first positioning data; for each historical ground of the at least one historical ground:
obtain a center point location of the historical ground based on the ground parameter corresponding to the historical ground, and
obtain a first distance between the center point location and the location point corresponding to the target first positioning data; and
determine the at least one historical ground as the target ground in response to the first distance corresponding to a historical ground of the at least one historical ground being less than or equal to a first preset length.
11 . The electronic device to claim 10 , wherein to determine the at least one historical ground as the target ground in response to the first distance corresponding to the historical ground of the at least one historical ground being less than or equal to the first preset length, the computer instructions cause the electronic device to:
in response to a plurality of first distances corresponding to a plurality of historical grounds being less than or equal to the first preset length, use the plurality of historical grounds as a plurality of candidate grounds; obtain, for each candidate ground of the plurality of candidate grounds, a data error of each of the plurality of pieces of first positioning data based on a ground parameter corresponding to the candidate ground; and in response to the data error of each piece of first positioning data being less than or equal to a preset difference, determine a candidate ground of the plurality of candidate grounds as the target ground.
12 . The electronic device to claim 11 , wherein obtaining, for each candidate ground of the plurality of candidate grounds, the data error of each of the plurality of pieces of first positioning data based on the ground parameter corresponding to the candidate ground comprises:
for at least a candidate ground of the plurality of candidate grounds, for each piece of first positioning data determine, based on the ground parameter corresponding to the candidate ground and the first positioning data, a determined location area, in the candidate ground, of a location point corresponding to the first positioning data, wherein the candidate ground comprises a plurality of location areas; based on the determined location area:
determine a reference location of the candidate ground,
determine a second distance between the location point corresponding to the first positioning data and the reference location, and
obtain a third distance between the determined location area and the reference location; and
determine an absolute value of a difference between the second distance and the third distance as the data error of the first positioning data.
13 . The electronic device to claim 9 , wherein to determine the motion route of the user on the target ground in the motion process based on the plurality of pieces of first positioning data, the plurality of pieces of second positioning data, the ground parameter corresponding to the target ground, and the preset error threshold, the computer instructions cause the electronic device to:
for the target ground, determine a data error of each piece of positioning data in the plurality of pieces of first positioning data and the plurality of pieces of second positioning data based on the ground parameter corresponding to the target ground; and in response to determining that positioning data having a data error that is less than or equal to the preset error threshold exists, align a location point corresponding to the positioning data with a location point corresponding to previous positioning data, and continuing to obtain a motion route; or in response to determining that the positioning data having the data error that is greater than the preset error threshold exists, connect the location point corresponding to the positioning data to the location point corresponding to previous positioning data, and continuing to obtain the motion route.
14 . The electronic device to claim 9 , wherein the computer instructions further cause the electronic device to:
determine a target ground parameter of the target ground based on a plurality of pieces of third positioning data corresponding to different locations of the user in the motion process, wherein the plurality of pieces of third positioning data comprise the plurality of pieces of first positioning data and a part of the plurality of pieces of second positioning data; determine, based on a plurality of pieces of fourth positioning data corresponding to different locations of the user in the motion process, a first parameter error corresponding to the target ground parameter of the target ground, and a second parameter error corresponding to a stored ground parameter of the target ground, wherein a time of obtaining the fourth positioning data is later than a time of obtaining the third positioning data, and the plurality of pieces of second positioning data comprise the plurality of pieces of fourth positioning data; and in response to the first parameter error being less than the second parameter error, update the stored ground parameter corresponding to the target ground to the target ground parameter after user motion ends.
15 . The electronic device to claim 14 , wherein to determine, based on the plurality of pieces of fourth positioning data corresponding to different locations of the user in the motion process, the first parameter error corresponding to the target ground parameter of the target ground, the computer instructions cause the electronic device to:
for each piece of fourth positioning data in the plurality of pieces of fourth positioning data, determine a first data error of the fourth positioning data based on the fourth positioning data and the target ground parameter; and determine an average error of first data errors of the plurality of pieces of fourth positioning data, and determining the average error as the first parameter error.
16 . The electronic device to claim 14 , wherein to determine, based on the plurality of pieces of fourth positioning data corresponding to different locations of the user in the motion process, the second parameter error corresponding to the stored ground parameter of the target ground, the computer instructions cause the electronic device to:
for each piece of fourth positioning data in the plurality of pieces of fourth positioning data, determine a second data error of the fourth positioning data based on the fourth positioning data and the stored ground parameter of the target ground; and determine an average error of second data errors of the plurality of pieces of fourth positioning data, and determining the average error as the second parameter error.
17 . The electronic device to claim 9 , wherein the computer instructions further cause the electronic device to:
in response to no target ground being determined from the at least one historical ground based on the plurality of pieces of first positioning data and the ground parameter corresponding to the at least one historical ground, obtain corresponding fifth positioning data of the user in the motion process, wherein a quantity of the fifth positioning data is greater than a quantity of the first positioning data; and determine, based on the fifth positioning data, a ground parameter of a ground on which the user is currently located, and after the user motion ends, storing the ground parameter of the ground on which the user is currently located.
18 . The electronic device to claim 9 , wherein the ground parameter corresponding to the at least one historical ground comprises ground center point positioning data and a ground deflection angle.
19 . The electronic device to claim 9 , wherein the computer instructions further cause the electronic device to:
display, during the motion process, the motion route of the user in the motion process; or display the motion route after the user motion ends.
20 . A computer-readable storage medium, wherein the computer-readable storage medium stores at least one historical ground, a ground parameter corresponding to the historical ground, and instructions, and when the instructions are run on at least one computer, the at least one computer is enabled to perform the steps of:
after a playground mode is enabled:
obtaining a plurality of pieces of first positioning data corresponding to different locations of a user in a motion process, and
determining a target ground from the data representing the at least one historical ground based on the plurality of pieces of first positioning data and the ground parameter corresponding to the at least one historical ground; and
obtaining a plurality of pieces of second positioning data corresponding to different locations of the user in the motion process; and determining a motion route of the user on the target ground in the motion process based on the plurality of pieces of first positioning data, the plurality of pieces of second positioning data, a ground parameter corresponding to the target ground, and a preset error threshold, wherein a time point of obtaining the second positioning data is later than a time point of obtaining the first positioning data.Join the waitlist — get patent alerts
Track US2025153003A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.