Motion data compensation method and device
By acquiring and compensating the GPS data of electronic devices in the motion scenario, the positioning error problem caused by electromagnetic interference is solved, and the accuracy of the motion data is improved.
Patent Information
- Application Number
- CN202411024226.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-15
AI Technical Summary
When electronic devices acquire GPS data in a moving scene, the positioning accuracy is poor due to electromagnetic interference, and the positioning data cannot be obtained continuously, resulting in large errors in the motion data.
By detecting that the electronic device is in a moving scene, the first positioning data and the second positioning data are obtained, the first distance is calculated, and distance compensation is performed based on the second distance and the standard length of the moving scene when the single-lank motion condition is met, the distance is compensated based on the second distance and the standard length of the moving scene to accurately Calculate the lap motion distance.
The accuracy of the motion data of electronic devices in motion scenes is improved, positioning errors caused by electromagnetic interference are reduced, and the accuracy of motion distance is ensured.
Smart Images

Figure CN118972779A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a motion data compensation method and device thereof. Background Art
[0002] Currently, in order to check their own exercise status in real time, users can carry electronic devices when doing exercises such as running, so that the user's exercise status can be monitored in real time through the electronic devices.
[0003] In the related art, when the user is exercising, the electronic device can be set to exercise mode. At this time, the electronic device can obtain the global positioning system (GPS) data of the user at different locations in real time, and determine the user's running track, running distance, running speed and other related exercise data on the playground based on the GPS data, and finally display the determined related exercise data to the user. This makes it convenient for the user to understand his or her exercise status. For example, the electronic device can obtain GPS data every second in a sports scene (such as a playground), and then determine the exercise data by obtaining multiple consecutive GPS data in the sports scene.
[0004] However, since there may be electromagnetic interference in the environment where the electronic device is located, such as the presence of a base station near the electronic device, the GPS data obtained by the electronic device may not be accurate when acquiring GPS data. For example, when a user is running on a playground, the first positioning data obtained by the GPS data is the playground, and the second positioning data obtained is the nearby cell, resulting in the electronic device being unable to obtain multiple continuous GPS data in a sports scene through GPS data, which in turn results in errors in the sports data determined by the electronic device. As a result, the accuracy of the sports data determined by the electronic device is poor. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a motion data compensation method and device thereof, which can improve the accuracy of determining motion data.
[0006] In a first aspect, an embodiment of the present application provides a motion data compensation method, which includes: when it is detected that the electronic device is in a first motion scene, obtaining first positioning data, the first positioning data representing the current position of the electronic device during the motion process; based on the first positioning data and the second positioning data, determining a first distance, the second positioning data being a positioning data obtained before the first positioning data; when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, compensating the single-circle motion distance of the electronic device based on the second distance and the standard motion length corresponding to the first motion scene, the second distance being the sum of the distances corresponding to every two positioning data of the electronic device during the single-circle motion process.
[0007] In a second aspect, an embodiment of the present application provides a motion data compensation device, which includes: an acquisition module, a determination module and a compensation module. The acquisition module is used to acquire first positioning data when it is detected that the electronic device is in a first motion scene, and the first positioning data represents the current position of the electronic device during the motion process. The determination module is used to determine the first distance based on the first positioning data and the second positioning data, and the second positioning data is a positioning data acquired before the first positioning data. The compensation module is used to compensate for the single-circle motion distance of the electronic device based on the second distance and the standard motion length corresponding to the first motion scene when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, and the second distance is the sum of the distances corresponding to every two positioning data of the electronic device during the single-circle motion.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0012] In an embodiment of the present application, when it is detected that the electronic device is in a first motion scene, the first positioning data is obtained, and the first positioning data represents the current position of the electronic device during the motion process; based on the first positioning data and the second positioning data, the first distance is determined, and the second positioning data is a positioning data obtained before the first positioning data; when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, the single-circle motion distance of the electronic device is compensated based on the second distance and the motion standard length corresponding to the first motion scene, and the second distance is the sum of the distances corresponding to every two positioning data of the electronic device during the single-circle motion process. In this solution, when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, the electronic device can compare the single-circle total distance obtained according to the positioning data with the standard length corresponding to the first motion scene, and then determine whether there is an error between the above-mentioned single-circle total distance and the standard length. Then, when it is determined that there is an error between the single-circle total distance and the standard length, the electronic device can compensate for the single-circle motion distance to obtain a relatively accurate single-circle motion distance. That is to say, when the electronic device cannot obtain continuous positioning data in a motion scene, it can also reduce the error of the motion distance determined by the electronic device through distance compensation, so that the acquired motion distance is relatively accurate, thereby improving the accuracy of the motion data determined by the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is one of the flow charts of a motion data compensation method provided in an embodiment of the present application;
[0014] Figure 2 This is the second flowchart of a motion data compensation method provided in an embodiment of the present application;
[0015] Figure 3 This is a third flowchart of a motion data compensation method provided in an embodiment of the present application;
[0016] Figure 4 This is a fourth flowchart of a motion data compensation method provided in an embodiment of the present application;
[0017] Figure 5 It is a structural schematic diagram of a playground provided in an embodiment of the present application;
[0018] Figure 6 is a structural schematic diagram of a motion data compensation device provided in an embodiment of the present application;
[0019] Figure 7 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;
[0020] Figure 8This is the second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0022] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0023] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".
[0024] Some professional terms provided in the embodiments of the present application are explained below.
[0025] Inscribed circle: A circle that is tangent to all sides of a polygon is called the inscribed circle of a polygon. A triangle must have an inscribed circle, but other shapes may not have inscribed circles. The center of the inscribed circle of a triangle is the intersection of the triangle bisectors. The inscribed circle is inside the triangle (the inscribed circle is tangent to the three sides), and the distance from the center of the inscribed circle to the midpoint of each side of the triangle is the radius. The center of the inscribed circle of a triangle is called the incenter.
[0026] Circumcircle: The circle that intersects all the vertices of a polygon is called the circumcircle of the polygon. Triangles have circumcircles, but other shapes may not have circumcircles. The center of the circumcircle of a triangle is the intersection of the perpendicular bisectors of any two sides. The center of the circumcircle of a triangle is called the circumcenter. The circumcenter of an obtuse, acute, or right triangle is located at a different position relative to the triangle.
[0027] Absolute distance: also known as Euclidean distance or Euclidean distance, is the most common distance metric, which measures the absolute distance between two points in multidimensional space. It can also be understood as: the real distance between two points in M-dimensional space, or the natural length of a vector, that is, the distance from the point to the origin; the Euclidean distance in two-dimensional or three-dimensional space is the actual distance between two points.
[0028] Minor axis point: Relative to the major axis, the line connecting the two vertices that are closer to each other in the ellipse is called the minor axis. The two vertices are the minor axis points, and the minor axis is the perpendicular bisector segment of the major axis.
[0029] Major axis point: The major axis is the longest line segment that can be obtained by connecting two points on the ellipse. These two points are the major axis points.
[0030] The motion data compensation method and device provided by the embodiment of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0031] The motion data compensation method and device provided in the embodiments of the present application can be applied in sports scenes, such as running, swimming or cycling.
[0032] At present, in today's society, running is the simplest and most suitable leisure activity for most people. Playground running is a type of outdoor running, which has many advantages over outdoor running in ordinary environments. First, the ground of the playground is usually made of professional running track materials, which reduces the impact on the knees and ankles and helps reduce the risk of injury. Secondly, the playground has a high degree of flatness and no rugged terrain, which avoids the possibility of tripping or spraining the ankle. In addition, the playground environment is relatively closed and safe, without vehicle interference, which is especially suitable for children and the elderly. The playground is usually also equipped with clearly marked running track lines, which is convenient for accurately measuring the running distance and time, so as to better formulate and track training plans.
[0033] Usually, when a user is running, in order to check his / her own motion status in real time, he / she may carry an electronic device with him / her for running or other exercises, so that the user's motion status can be monitored in real time through the electronic device.
[0034] In the related art, when the user is exercising, the electronic device can be set to exercise mode. At this time, the electronic device can obtain the GPS data of the user at different locations in real time, and determine the user's running track, running distance, running speed and other related exercise data on the playground based on the GPS data, and finally display the determined related exercise data to the user. This makes it easier for the user to understand his or her exercise status. For example, the electronic device can obtain GPS data every second in a sports scene (such as a playground), and then determine the exercise data by obtaining multiple consecutive GPS data in the sports scene.
[0035] However, since there may be electromagnetic interference in the environment where the electronic device is located, such as the presence of a base station near the electronic device, the GPS data obtained by the electronic device may not be accurate in positioning when acquiring GPS data. For example, when the user is running on the playground, the first positioning data obtained by the GPS data is the playground, and the second positioning data obtained is the nearby community, resulting in the electronic device being unable to obtain multiple continuous GPS data in a sports scene through GPS data. For example, when the user is running on the playground, the first 5 GPS data obtained by the electronic device belong to the playground, but the user passes by the base station during the running process, resulting in the sixth GPS data obtained by the electronic device belonging to the community near the playground. At this time, the electronic device will determine that the user has left the playground and summarize the first 5 GPS data to obtain the movement distance. Then, when the user is away from the base station, the 7th GPS data obtained by the electronic device at this time belongs to the playground again, so the electronic device will start to determine the movement distance through GPS data again, and finally, the electronic device will add the two movement distances on the playground to obtain the total movement distance. It can be seen from this that the electronic device only adds the two movement distances, lacking a part of the movement distance, resulting in errors in the movement data determined by the electronic device, so that the accuracy of the movement data determined by the electronic device is poor.
[0036] In the motion data compensation method and device provided in the embodiment of the present application, when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, the electronic device can compare the single-circle total distance obtained according to the positioning data with the standard length corresponding to the first motion scene, and then determine whether there is an error between the above-mentioned single-circle total distance and the standard length. Then, when it is determined that there is an error between the single-circle total distance and the standard length, the electronic device can compensate for the single-circle motion distance to obtain a relatively accurate single-circle motion distance. In other words, when the electronic device cannot obtain continuous positioning data in a motion scene, the error of the motion distance determined by the electronic device can also be reduced by distance compensation, so that the acquired motion distance is relatively accurate, thereby improving the accuracy of the motion data determined by the electronic device.
[0037] The motion data compensation method provided in the embodiment of the present application may be executed by a motion data compensation device, which may be an electronic device or a functional module in an electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.
[0038] The present application provides a motion data compensation method. Figure 1 FIG. 2 shows a flow chart of a motion data compensation method provided by an embodiment of the present application. Figure 1 As shown, the motion data compensation method provided in the embodiment of the present application may include the following steps 201 to 203.
[0039] Step 201: When it is detected that the electronic device is in a first motion scene, the electronic device obtains first positioning data.
[0040] In the embodiment of the present application, the first positioning data represents the current position of the electronic device during movement.
[0041] In the embodiment of the present application, the first sports scene may be a running sports scene in a playground.
[0042] It should be noted that the above-mentioned first positioning data is the current positioning data of the electronic device in the playground.
[0043] In the embodiment of the present application, the electronic device can obtain the first positioning data in real time through a GPS module included in the electronic device.
[0044] Exemplarily, the first positioning data may include the longitude and latitude acquired by a GPS module in the electronic device.
[0045] Step 202: The electronic device determines a first distance based on the first positioning data and the second positioning data.
[0046] In the embodiment of the present application, the second positioning data is positioning data acquired before the first positioning data.
[0047] In the embodiment of the present application, the first distance may be the distance between the first positioning data and the second positioning data.
[0048] In the embodiment of the present application, the electronic device can obtain the first distance through the distance formula, the first positioning data and the second positioning data.
[0049] Optionally, in an embodiment of the present application, the above distance formula may be any one of the following: a Euclidean distance formula, a Manhattan distance formula or a standardized Euclidean distance formula.
[0050] Exemplarily, the electronic device may input the longitude and latitude of the first positioning data and the longitude and latitude of the second positioning data into a Euclidean distance formula to obtain the first distance.
[0051] Step 203: When the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, the electronic device compensates the single-circle motion distance of the electronic device based on the second distance and the motion standard length corresponding to the first motion scene.
[0052] In the embodiment of the present application, the second distance is the sum of distances corresponding to every two positioning data during a single-circle movement of the electronic device.
[0053] In an embodiment of the present application, the standard length of movement corresponding to the above-mentioned first movement scene is preset, for example, 400 meters, 200 meters or 600 meters.
[0054] In the embodiment of the present application, the motion trajectory of the electronic device that satisfies the single-circle motion condition of the first motion scene may be that the electronic device passes the starting point in the playground.
[0055] Exemplarily, the electronic device can obtain the positioning data corresponding to the first trajectory point with the latest acquisition time in the motion trajectory and the positioning data corresponding to the second trajectory point with the earliest acquisition time in the motion trajectory, and then the electronic device can obtain the accumulated distance of multiple trajectory points between the first trajectory point and the second trajectory point; then, when the accumulated distance of multiple trajectory points between the first trajectory point and the second trajectory point is greater than a preset first distance, such as 380M, the electronic device can calculate the distance between the first trajectory point and the second trajectory point, and finally, when the distance between the first trajectory point and the second trajectory point is less than a preset second distance, such as 1M, the electronic device can determine that the electronic device has passed the starting point in the playground.
[0056] Optionally, in the embodiment of the present application, the above step 203 can be specifically implemented by the following steps 203a and 203b.
[0057] Step 203a: The electronic device calculates the difference between the second distance and the standard motion length corresponding to the first motion scene.
[0058] In the embodiment of the present application, the electronic device may perform a difference operation on the second distance and the standard motion length corresponding to the first motion scene to obtain the above-mentioned difference.
[0059] For example, taking the second distance as 380 meters and the standard motion length as 400 meters, the electronic device may subtract 380 meters from 400 meters to obtain the difference between the second distance and the standard motion length corresponding to the first motion scene, that is, 20 meters.
[0060] Step 203b: The electronic device determines the sum of the difference and the second distance as the single-circle movement distance of the electronic device.
[0061] In the embodiment of the present application, the electronic device may perform an addition operation on the above difference and the second distance to obtain a single-circle movement distance of the electronic device.
[0062] Exemplarily, the electronic device may add 20 meters to 380 meters to obtain a single-lap movement distance of the electronic device, that is, 400 meters.
[0063] In the motion data compensation method provided in the embodiment of the present application, when it is detected that the electronic device is in the first motion scene, the first positioning data is obtained, and the first positioning data represents the current position of the electronic device during the motion process; based on the first positioning data and the second positioning data, the first distance is determined, and the second positioning data is a positioning data obtained before the first positioning data; when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, the single-circle motion distance of the electronic device is compensated based on the second distance and the motion standard length corresponding to the first motion scene, and the second distance is the sum of the distances corresponding to every two positioning data of the electronic device during the single-circle motion process. In this scheme, when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, the electronic device can compare the single-circle total distance obtained according to the positioning data with the standard length corresponding to the first motion scene, and then determine whether there is an error between the above-mentioned single-circle total distance and the standard length. Then, when it is determined that there is an error between the single-circle total distance and the standard length, the electronic device can compensate for the single-circle motion distance to obtain a relatively accurate single-circle motion distance. That is to say, when the electronic device cannot obtain continuous positioning data in a motion scene, it can also reduce the error of the motion distance determined by the electronic device through distance compensation, so that the acquired motion distance is relatively accurate, thereby improving the accuracy of the motion data determined by the electronic device.
[0064] Optionally, in the embodiment of the present application, combined with Figure 1 ,like Figure 2 As shown, before the above step 201, the motion data compensation method provided in the embodiment of the present application also includes the following steps 301 and 302.
[0065] Step 301: When a start motion instruction is detected, the electronic device obtains initial positioning data of the electronic device.
[0066] In the embodiment of the present application, the above-mentioned initial positioning data may include longitude and latitude.
[0067] In an embodiment of the present application, the electronic device can display a motion interface, which includes a motion instruction control. The user can click and input the motion instruction control so that the electronic device can detect the motion instruction and obtain the initial positioning data of the electronic device.
[0068] Exemplarily, the electronic device may obtain the initial positioning data of the electronic device through a GPS module in the electronic device.
[0069] In the embodiment of the present application, when a user wants to run a sports application, the user can click and input the application logo of the sports application on the desktop of the electronic device so that the electronic device can display the sports interface.
[0070] Step 302: When the initial positioning data matches the target positioning data in the electronic device, the electronic device determines that the electronic device is in a first motion scene associated with the target positioning data.
[0071] In the embodiment of the present application, at least one positioning data may be stored in the electronic device, and the above-mentioned target positioning data is any one of the at least one positioning data.
[0072] In an embodiment of the present application, the electronic device can calculate the distance difference between the initial positioning data and at least one positioning data in sequence to obtain at least one distance difference; then, the positioning data corresponding to the distance difference in the at least one distance difference that is less than or equal to a preset third threshold is determined as the target positioning data.
[0073] In the embodiment of the present application, each positioning data in the at least one positioning data may be associated with a motion scene.
[0074] Optionally, in the embodiment of the present application, combined with Figure 2 ,like Figure 3 As shown, after the above step 301, the motion data compensation method provided in the embodiment of the present application further includes the following steps 401 to 403.
[0075] Step 401: When the initial positioning data does not match any positioning data in the electronic device, the electronic device obtains a first motion trajectory of the electronic device.
[0076] In an embodiment of the present application, the electronic device can calculate the distance difference between the initial positioning data and at least one positioning data in sequence to obtain at least one distance difference; then, when the electronic device calculates that each distance difference in the at least one distance difference is greater than the distance difference of a preset third threshold, the electronic device can determine that the initial positioning data does not match any positioning data in the electronic device.
[0077] In the embodiment of the present application, the electronic device can obtain a plurality of second positioning data of the electronic device during the movement, and then obtain the first movement trajectory according to the plurality of second positioning data.
[0078] Exemplarily, the electronic device may connect coordinate points corresponding to a plurality of second positioning data to obtain the first motion trajectory.
[0079] Step 402: When the first motion trajectory is a closed trajectory, the electronic device obtains first information corresponding to the first motion trajectory.
[0080] In an embodiment of the present application, the above-mentioned first information includes at least one of the following: positioning data of the center point of the trajectory, radius data of the inscribed circle corresponding to the center point of the trajectory, radius data of the circumscribed circle corresponding to the center point of the trajectory, positioning data of the minor axis point of the trajectory, and trajectory deflection angle.
[0081] In an embodiment of the present application, the electronic device can obtain two long axis points corresponding to the long axis of the first motion trajectory and two short axis points corresponding to the end axis of the first motion trajectory, and then determine the positioning data of the center point of the trajectory based on the positioning data of the two long axis points and the two short axis points.
[0082] Exemplarily, the electronic device may calculate the average between two long axis points and the average between two short axis points, thereby obtaining the positioning data of the center point of the trajectory.
[0083] In the embodiment of the present application, the electronic device can calculate the vertical distance between the center point of the trajectory and the first motion trajectory to obtain the radius data of the inscribed circle corresponding to the center point of the trajectory.
[0084] In the embodiment of the present application, the electronic device can calculate the distance between the center point of the trajectory and any trajectory point corresponding to the first motion trajectory, and determine the radius data of the circumscribed circle corresponding to the center point of the trajectory.
[0085] In the embodiment of the present application, the above-mentioned trajectory deflection angle can be preset by the electronic device.
[0086] Step 403: The electronic device determines whether the electronic device is in a first motion scene based on the first information.
[0087] In the embodiment of the present application, when the above-mentioned first information satisfies the first condition, the electronic device can determine that the electronic device is in the first motion scene.
[0088] Optionally, in the embodiment of the present application, combined with Figure 3 ,like Figure 4 As shown, the above step 403 can be specifically performed through the following steps 403a to 403c.
[0089] Step 403a: The electronic device determines a first ratio, a third distance, and a first angle value based on the first information.
[0090] In an embodiment of the present application, the above-mentioned first ratio is the ratio of the inscribed circle radius data to the circumscribed circle radius data, the third distance is the distance between the trajectory center point and any trajectory point included in the first motion trajectory, and the first angle value is the angle value formed by the trajectory center point and any trajectory point, and the trajectory center point and the trajectory minor axis point.
[0091] In the embodiment of the present application, the electronic device may perform a division operation on the inscribed circle radius data and the circumscribed circle radius data to obtain a first ratio.
[0092] In the embodiment of the present application, the electronic device can determine the third distance through the positioning data of the center point of the trajectory and the positioning data of any trajectory point.
[0093] Exemplarily, the electronic device may input the positioning data of the center point of the trajectory and the positioning data of any trajectory point into the above distance formula to obtain the third distance.
[0094] Step 403b: The electronic device determines whether the trajectory shape of the first motion trajectory matches the preset trajectory shape based on the first ratio, the third distance, the first angle value and the trajectory deflection angle.
[0095] In an embodiment of the present application, the electronic device can construct a trajectory equation of the first motion trajectory through the third distance, the first angle value and the trajectory deflection angle, and determine whether the trajectory shape of the first motion trajectory matches the preset trajectory shape based on the trajectory equation of the first motion trajectory and the first ratio.
[0096] Optionally, in the embodiment of the present application, the above step 403b can be specifically implemented by the following steps 403b1 and 403b2.
[0097] Step 403b1: The electronic device determines a first value and a second value based on the third distance, the first angle value and the trajectory deflection angle.
[0098] In the embodiment of the present application, the first value represents the average distance between all trajectory points included in the first motion trajectory and the center point of the trajectory, and the second value represents the change amplitude of the distance between all trajectory points included in the first motion trajectory and the center point of the trajectory.
[0099] In an embodiment of the present application, the electronic device may input the third distance, the first angle value and the trajectory deflection angle into the above trajectory equation to obtain the first value and the second value.
[0100] Exemplarily, the electronic device may construct a least square fitting function through the third distance, the first angle value and the trajectory deflection angle, and then obtain the first value and the second value, as specifically shown in Formula 1:
[0101]
[0102] Where y is the third distance, A is the first value, ω is a constant 2π / 180, and x is the trajectory deflection angle. is the first angle value, and B is the second angle value.
[0103] Step 403b2: When the first ratio, the first value, and the second value satisfy a preset condition, the electronic device determines that the trajectory shape of the first motion trajectory matches a preset trajectory shape.
[0104] Optionally, in an embodiment of the present application, the above-mentioned preset trajectory shape may be a trajectory shape of a standard playground stored in the electronic device; or, a trajectory shape of a playground corresponding to the first historical sports scene stored in the electronic device.
[0105] In the embodiment of the present application, the electronic device can determine that the trajectory shape of the first motion trajectory matches the preset trajectory shape when it is determined that the first ratio is within the first preset numerical range, the first value is within the second preset numerical range, and the second value is within the third preset numerical range.
[0106] Step 403c: When the trajectory shape of the first motion trajectory matches the preset trajectory shape, the electronic device determines that the electronic device is in the first motion scene.
[0107] In an embodiment of the present application, when the electronic device determines that the first ratio is within a first preset numerical range, the first numerical value is within a second preset numerical range, and the second numerical value is within a third preset numerical range, the electronic device can determine that the similarity between the trajectory shape of the first motion trajectory and the preset trajectory shape is greater than or equal to 90%. At this time, the electronic device can determine that the trajectory shape of the first motion trajectory matches the preset trajectory shape.
[0108] In the embodiment of the present application, the electronic device can determine whether the current scene is the first motion scene through motion information acquired in real time, without the need for historical data, thereby improving the accuracy of the electronic device in determining the motion scene.
[0109] Optionally, in an embodiment of the present application, after the above step 401, the motion data compensation method provided in the embodiment of the present application further includes the following step 501.
[0110] Step 501: When the sum of distances of all trajectory points contained in the first motion trajectory is greater than or equal to a first threshold and the distance between two trajectory points is less than or equal to a second threshold, the electronic device determines that the first motion trajectory is a closed trajectory.
[0111] In the embodiment of the present application, the above two trajectory points may be any two trajectory points among all trajectory points included in the first motion trajectory.
[0112] Preferably, the first of the two trajectory points can be the trajectory point acquired earliest by the electronic device among all trajectory points included in the first motion trajectory; the second of the two trajectory points can be the trajectory point acquired latest by the electronic device among all trajectory points included in the first motion trajectory.
[0113] In the embodiment of the present application, the electronic device can obtain the distance between two trajectory points by using the above distance formula.
[0114] In the embodiment of the present application, when the sum of distances of all trajectory points included in the first motion trajectory is greater than or equal to 380 meters, and the distance between two trajectory points is less than or equal to 5 meters, the electronic device determines that the first motion trajectory is a closed trajectory.
[0115] For example, if the sum of the distances of all trajectory points included in the first motion trajectory is 390 meters and the distance between two trajectory points is 3 meters, the electronic device can compare 390 meters with 380 meters to determine that the sum of the distances of all trajectory points included in the first motion trajectory is greater than 380 meters, that is, the first threshold. Then, the electronic device can compare the distance between the two trajectory points of 3 meters with 5 meters to determine that the distance between the two trajectory points is less than 5 meters, and at this time the electronic device can determine that the first motion trajectory is a closed trajectory.
[0116] Optionally, in the embodiment of the present application, the electronic device may determine that the first motion trajectory is a closed trajectory through a plurality of positioning data of the first motion scene stored in the electronic device.
[0117] Exemplarily, 120 GPS data may be stored in the electronic device. The current position point is taken as 0 meters. The distance of the 120 GPS data stored in the electronic device is accumulated in reverse order. When the accumulation reaches the range of 300 to 450 meters, the absolute distance between the 120th GPS data in the 120 GPS data and the first GPS data in the current 120 GPS data is calculated. If the absolute distance is less than 25 meters, it is determined that the trajectory has a closed loop.
[0118] In the embodiment of the present application, the electronic device can determine whether the scene the electronic device is currently in is a playground by judging whether the first motion trajectory is a closed trajectory, thereby improving the flexibility of the electronic device in determining motion scenes.
[0119] Optionally, in the embodiment of the present application, the above step 202 can be specifically implemented by the following step 202a or step 202b.
[0120] Step 202a: When the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is greater than or equal to a third threshold, the electronic device calculates the straight-line distance between the positions corresponding to the first positioning data and the second positioning data to obtain a first distance.
[0121] It should be noted that the process of the electronic device determining the center point corresponding to the first motion scene can be found in the above embodiment in detail, and will not be described again here to avoid repetition.
[0122] In the embodiment of the present application, the electronic device can obtain the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene through the above distance formula.
[0123] In the embodiment of the present application, the electronic device can obtain the straight-line distance between the positions corresponding to the first positioning data and the second positioning data by using the above distance formula.
[0124] It can be understood that when the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is greater than or equal to the third threshold, the electronic device can determine that the position corresponding to the first positioning data deviates from the motion track corresponding to the first motion scene.
[0125] Exemplarily, when the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is greater than or equal to 50 meters, the electronic device can determine that the position corresponding to the first positioning data deviates from the motion track corresponding to the first motion scene.
[0126] In an embodiment of the present application, when the electronic device determines that the position corresponding to the first positioning data deviates from the motion track corresponding to the first motion scene, the electronic device can directly determine the motion distance through the positioning data obtained by the GPS module, that is, no distance compensation is required.
[0127] Optionally, in an embodiment of the present application, the first positioning data may be one or more.
[0128] Optionally, in the embodiment of the present application, the electronic device may determine that the first positioning data deviates from the motion trajectory only when multiple consecutive points are greater than a third threshold.
[0129] Optionally, in an embodiment of the present application, when the electronic device determines that the position corresponding to the first positioning data deviates from the motion trajectory corresponding to the first motion scene, the electronic device reacquires the motion trajectory based on the positioning data, and displays the reacquired motion trajectory in the electronic device.
[0130] Step 202b: When the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is less than a third threshold, the electronic device calculates the straight-line distance between the first projection point and the second projection point to obtain a first distance.
[0131] In an embodiment of the present application, the above-mentioned first projection point is the projection point of the position corresponding to the first positioning data projected onto the motion track of the first motion scene, and the above-mentioned second projection point is the projection point of the position corresponding to the second positioning data projected onto the motion track of the first motion scene.
[0132] It can be understood that when the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is less than the third threshold, the electronic device can determine that the position corresponding to the first positioning data does not deviate from the motion track corresponding to the first motion scene.
[0133] In the embodiment of the present application, the electronic device can calculate the straight-line distance between the first projection point and the second projection point by using the above distance formula.
[0134] Optionally, in an embodiment of the present application, the electronic device may determine the first projection point corresponding to the first positioning data by the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene, the angle value formed by the center point corresponding to the first motion scene and the position corresponding to the first positioning data, and the short axis point of the motion track. Alternatively, the electronic device may determine the second projection point corresponding to the second positioning data by the distance between the position corresponding to the second positioning data and the center point corresponding to the first motion scene, the angle value formed by the center point corresponding to the first motion scene and the position corresponding to the second positioning data, and the short axis point of the motion track.
[0135] For example, Figure 5 As shown, the electronic device can determine the first projection point 11 and the second projection point 12 in the motion track 10, and the distance between the first projection point 11 and the second projection point 12 is the first distance, as shown in FIG. Figure 5 Also shown is a center point 13 and a minor axis point 14 .
[0136] Optionally, in an embodiment of the present application, before "the electronic device calculates the straight-line distance between the first projection point and the second projection point to obtain the first distance" in the above step 202b, the method also includes the following steps 601 to 603.
[0137] Step 601: The electronic device determines a fourth distance based on the target positioning data, and determines a second angle value based on a center point corresponding to the first motion scene, a position corresponding to the target positioning data, and a short axis point of a motion track of the first motion scene.
[0138] In an embodiment of the present application, the target positioning data includes first positioning data; or, the target positioning data includes second positioning data.
[0139] In an embodiment of the present application, the fourth distance is the distance between the position corresponding to the target positioning data and the center point corresponding to the first motion scene, and the second angle value is the angle value formed by the center point corresponding to the first motion scene and the position corresponding to the target positioning data, and the center point corresponding to the first motion scene and the short axis point of the motion track.
[0140] In the embodiment of the present application, the electronic device can obtain the fourth distance through the above distance formula.
[0141] It can be understood that the fourth distance mentioned above may include a first sub-distance and a second sub-distance.
[0142] In an example, when the target positioning data is the first positioning data, the electronic device may obtain the distance between the first positioning data and a center point corresponding to the first motion scene to obtain a first sub-distance.
[0143] In another example, when the target positioning data is the second positioning data, the electronic device may obtain the distance between the second positioning data and a center point corresponding to the first motion scene to obtain a second sub-distance.
[0144] It can be understood that the above-mentioned second angle value may include a first sub-angle value and a second sub-angle value.
[0145] In an example, the first sub-angle value is an angle value formed by a center point corresponding to the first motion scene and a position corresponding to the first positioning data, and a center point corresponding to the first motion scene and a short axis point of the motion track.
[0146] In another example, the second sub-angle value is an angle value formed by the center point corresponding to the first motion scene and the position corresponding to the second positioning data, and the center point corresponding to the first motion scene and the short axis point of the motion track.
[0147] Step 602: The electronic device determines a fifth distance based on the second angle value.
[0148] In the embodiment of the present application, the fifth distance is the distance between the position corresponding to the target positioning data in the motion track of the first motion scene and the center point corresponding to the first motion scene.
[0149] In the embodiment of the present application, the electronic device can obtain the fifth distance based on the second angle value through trigonometric functions.
[0150] Optionally, in the embodiment of the present application, the above step 602 can be specifically implemented by the following step 602a.
[0151] Step 602a: The electronic device determines a fifth distance based on the identification information of the motion track corresponding to the first motion scene, the curve radius of the motion track, the width value of the motion track, and the second angle value.
[0152] In the embodiment of the present application, the identification information of the motion track corresponding to the first motion scene is input by the user.
[0153] Exemplarily, the identification information of the motion track may be a track number, such as 3 tracks or 4 tracks.
[0154] Optionally, in an embodiment of the present application, the curve radius of the above-mentioned motion track may be stored in the electronic device; or, the electronic device may determine the first motion track corresponding to the first motion scene.
[0155] Optionally, in an embodiment of the present application, the width value of the above-mentioned motion track may be stored in the electronic device; or, the electronic device may determine the first motion track corresponding to the first motion scene.
[0156] In the embodiment of the present application, the electronic device can obtain the fifth distance by the following formula 2, where formula 2 is specifically:
[0157] d=(35.58+1.22*n) / cosα (2)
[0158] Among them, d is the fifth distance, 35.58 is the curve radius of the motion track, 1.22 is the width value of the motion track, n is the identification information of the motion track, and α is the second angle value.
[0159] Step 603: The electronic device determines the target projection point based on the target positioning data, the center point corresponding to the first motion scene, the fourth distance and the fifth distance.
[0160] In an embodiment of the present application, the above-mentioned target projection point includes a first projection point; or, the target projection point includes a second projection point.
[0161] In the embodiment of the present application, the electronic device can obtain the target projection point by the following formula 3, where formula 3 is specifically:
[0162]
[0163] Among them, (x, ,y,) is the positioning data of the target projection point, x center is the longitude of the center point corresponding to the first motion scene, d is the fourth distance, d, is the fifth distance, x is the longitude in the target positioning data, y center is the latitude of the center point corresponding to the first motion scene, and y is the latitude in the target positioning data.
[0164] It should be noted that, for each positioning data acquired by the electronic device, the electronic device can obtain the projection point corresponding to each positioning data through the above method, and to avoid repetition, it will not be repeated here.
[0165] In the embodiment of the present application, the electronic device can obtain the movement distance through the projection point. Compared with directly using GPS data, this solution is more in line with the operation scene, and the projection point is projected onto the movement track of the movement scene, so the movement distance obtained by the electronic device is more accurate.
[0166] The above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0167] It should be noted that the motion data compensation method provided in the embodiment of the present application can be executed by a motion data compensation device. In the embodiment of the present application, the motion data compensation device executing the motion data compensation method is taken as an example to illustrate the motion data compensation device provided in the embodiment of the present application.
[0168] Figure 6 A possible structural diagram of a motion data compensation device involved in an embodiment of the present application is shown. Figure 6 As shown, the motion data compensation device 70 may include: an acquisition module 71 , a determination module 72 and a compensation module 73 .
[0169] Among them, the acquisition module 71 is used to acquire the first positioning data when it is detected that the electronic device is in the first motion scene, and the first positioning data represents the current position of the electronic device during the motion process. The determination module 72 is used to determine the first distance based on the first positioning data and the second positioning data, and the second positioning data is a positioning data acquired before the first positioning data. The compensation module 73 is used to compensate the single-circle motion distance of the electronic device based on the second distance and the standard motion length corresponding to the first motion scene when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, and the second distance is the sum of the distances corresponding to every two positioning data of the electronic device during the single-circle motion process.
[0170] In a possible implementation, the acquisition module 71 is further configured to acquire the initial positioning data of the electronic device when the electronic device is detected to be in the first motion scene and before acquiring the first positioning data, when a start motion instruction is detected. The determination module 72 is further configured to determine that the electronic device is in the first motion scene associated with the target positioning data when the initial positioning data matches the target positioning data in the electronic device.
[0171] In a possible implementation, the acquisition module 71 is further used to acquire the first motion trajectory of the electronic device after acquiring the initial positioning data of the electronic device, when the initial positioning data does not match any positioning data in the electronic device. The acquisition module 71 is also used to acquire the first information corresponding to the first motion trajectory when the first motion trajectory is a closed trajectory, and the first information includes at least one of the following: the positioning data of the center point of the trajectory, the radius data of the inscribed circle corresponding to the center point of the trajectory, the radius data of the circumscribed circle corresponding to the center point of the trajectory, the positioning data of the minor axis point of the trajectory, and the trajectory deflection angle. The determination module 72 is also used to determine whether the electronic device is in the first motion scene based on the first information.
[0172] In a possible implementation, the above-mentioned determination module 72 is specifically used to determine a first ratio, a third distance and a first angle value based on the first information, wherein the first ratio is the ratio of the inscribed circle radius data to the circumscribed circle radius data, the third distance is the distance between the trajectory center point and any trajectory point included in the first motion trajectory, and the first angle value is the angle value formed by the trajectory center point and any trajectory point, and the trajectory center point and the trajectory minor axis point; based on the first ratio, the third distance, the first angle value and the trajectory deflection angle, determine whether the trajectory shape of the first motion trajectory matches the preset trajectory shape; when the trajectory shape of the first motion trajectory matches the preset trajectory shape, determine that the electronic device is in the first motion scene.
[0173] In a possible implementation, the above-mentioned determination module 72 is specifically used to determine a first value and a second value based on the third distance, the first angle value and the trajectory deflection angle, wherein the first value represents the average distance between all trajectory points contained in the first motion trajectory and the trajectory center point, and the second value represents the change amplitude of the distance between all trajectory points contained in the first motion trajectory and the trajectory center point; when the first ratio, the first value and the second value meet the preset conditions, it is determined that the trajectory shape of the first motion trajectory matches the preset trajectory shape.
[0174] In a possible implementation, the determination module 72 is further configured to, after acquiring the first motion trajectory of the electronic device, determine that the first motion trajectory is a closed trajectory if the sum of distances of all trajectory points contained in the first motion trajectory is greater than or equal to a first threshold and the distance between any two trajectory points is less than or equal to a second threshold.
[0175] In a possible implementation, the above-mentioned determination module 72 is specifically used to calculate the straight-line distance between the first positioning data and the position corresponding to the second positioning data to obtain the first distance when the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is greater than or equal to a third threshold; or, when the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is less than the third threshold, calculate the straight-line distance between the first projection point and the second projection point to obtain the first distance, the first projection point being the projection point of the position corresponding to the first positioning data projected onto the motion track of the first motion scene, and the second projection point being the projection point of the position corresponding to the second positioning data projected onto the motion track of the first motion scene.
[0176] In a possible implementation, the above-mentioned determination module 72 is also used to calculate the straight-line distance between the first projection point and the second projection point. Before obtaining the first distance, the fourth distance is determined based on the target positioning data, and the second angle value is determined based on the center point corresponding to the first motion scene, the position corresponding to the target positioning data, and the short axis point of the motion track of the first motion scene. The fourth distance is the distance between the position corresponding to the target positioning data and the center point corresponding to the first motion scene, and the second angle value is the angle value formed by the center point corresponding to the first motion scene and the position corresponding to the target positioning data, and the center point corresponding to the first motion scene and the short axis point of the motion track; based on the second angle value, the fifth distance is determined, and the fifth distance is the distance between the position corresponding to the target positioning data in the motion track of the first motion scene and the center point corresponding to the first motion scene; based on the target positioning data, the center point corresponding to the first motion scene, the fourth distance and the fifth distance, the target projection point is determined; wherein the target positioning data includes the first positioning data, and the target projection point includes the first projection point; or, the target positioning data includes the second positioning data, and the target projection point includes the second projection point.
[0177] In a possible implementation, the determination module 72 is specifically configured to determine the fifth distance based on identification information of the motion track corresponding to the first motion scene, a curve radius of the motion track, a width value of the motion track, and a second angle value.
[0178] In a possible implementation, the compensation module 73 is specifically used to calculate the difference between the second distance and the standard length of motion corresponding to the first motion scene. The determination module 72 is also used to determine the sum of the difference and the second distance as the single-circle motion distance of the electronic device.
[0179] The embodiment of the present application provides a motion data compensation device. When the motion trajectory of the motion data compensation meets the single-circle motion condition of the first motion scene, the motion data compensation can compare the single-circle total distance obtained according to the positioning data with the standard length corresponding to the first motion scene, and then determine whether there is an error between the above-mentioned single-circle total distance and the standard length. Then, when it is determined that there is an error between the single-circle total distance and the standard length, the motion data compensation can compensate for the single-circle motion distance to obtain a relatively accurate single-circle motion distance. In other words, when the motion data compensation cannot obtain continuous positioning data in a motion scene, the error of the motion distance determined by the motion data compensation can also be reduced by distance compensation, so that the acquired motion distance is relatively accurate, thereby improving the accuracy of the motion data determined by the motion data compensation.
[0180] The motion data compensation device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0181] The motion data compensation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0182] The motion data compensation device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.
[0183] Alternatively, if Figure 7 As shown, an embodiment of the present application further provides an electronic device 90, including a processor 91 and a memory 92, wherein the memory 92 stores programs or instructions that can be executed on the processor 91, and when the program or instructions are executed by the processor 91, the various steps of the above-mentioned motion data compensation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0184] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0185] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0186] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.
[0187] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0188] Among them, the above-mentioned processor 110 is used to obtain first positioning data when it is detected that the electronic device is in a first motion scene, the first positioning data representing the current position of the electronic device during the motion process; determine the first distance based on the first positioning data and the second positioning data, the second positioning data being a positioning data obtained before the first positioning data; when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, compensate the single-circle motion distance of the electronic device based on the second distance and the standard motion length corresponding to the first motion scene, the second distance being the sum of the distances corresponding to every two positioning data of the electronic device during the single-circle motion process.
[0189] The embodiment of the present application provides an electronic device, in the case where the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, the electronic device can compare the single-circle total distance obtained according to the positioning data with the standard length corresponding to the first motion scene, and then determine whether there is an error between the above-mentioned single-circle total distance and the standard length, and then, in the case of determining that there is an error between the single-circle total distance and the standard length, the electronic device can compensate for the single-circle motion distance to obtain a relatively accurate single-circle motion distance. In other words, when the electronic device cannot obtain continuous positioning data in a motion scene, the error of the motion distance determined by the electronic device can also be reduced by distance compensation, so that the acquired motion distance is relatively accurate, thereby improving the accuracy of the motion data determined by the electronic device.
[0190] Optionally, in an embodiment of the present application, the processor 110 is further used to, when it is detected that the electronic device is in a first motion scene, obtain initial positioning data of the electronic device before obtaining the first positioning data when a start motion instruction is detected; and when the initial positioning data matches the target positioning data in the electronic device, determine that the electronic device is in the first motion scene associated with the target positioning data.
[0191] Optionally, in an embodiment of the present application, the processor 110 is further used to obtain the first motion trajectory of the electronic device after obtaining the initial positioning data of the electronic device, when the initial positioning data does not match any positioning data in the electronic device; when the first motion trajectory is a closed trajectory, obtain first information corresponding to the first motion trajectory, the first information including at least one of the following: positioning data of the center point of the trajectory, radius data of the inscribed circle corresponding to the center point of the trajectory, radius data of the circumscribed circle corresponding to the center point of the trajectory, positioning data of the minor axis point of the trajectory, and a deflection angle of the trajectory; based on the first information, determine whether the electronic device is in a first motion scene.
[0192] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to determine a first ratio, a third distance and a first angle value based on the first information, the first ratio being the ratio of the inscribed circle radius data to the circumscribed circle radius data, the third distance being the distance between the trajectory center point and any trajectory point included in the first motion trajectory, and the first angle value being the angle value formed by the trajectory center point and any trajectory point, and the trajectory center point and the trajectory minor axis point; based on the first ratio, the third distance, the first angle value and the trajectory deflection angle, determine whether the trajectory shape of the first motion trajectory matches the preset trajectory shape; when the trajectory shape of the first motion trajectory matches the preset trajectory shape, determine that the electronic device is in the first motion scene.
[0193] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to determine a first numerical value and a second numerical value based on a third distance, a first angle value and a trajectory deflection angle, wherein the first numerical value represents an average of the distances between all trajectory points contained in the first motion trajectory and the trajectory center point, and the second numerical value represents an amplitude of change in the distances between all trajectory points contained in the first motion trajectory and the trajectory center point; when the first ratio, the first numerical value and the second numerical value meet a preset condition, it is determined that the trajectory shape of the first motion trajectory matches the preset trajectory shape.
[0194] Optionally, in an embodiment of the present application, the processor 110 is further used to, after acquiring the first motion trajectory of the electronic device, determine that the first motion trajectory is a closed trajectory if the sum of distances of all trajectory points contained in the first motion trajectory is greater than or equal to a first threshold and there is a distance between two trajectory points that is less than or equal to a second threshold.
[0195] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to calculate the straight-line distance between the first positioning data and the position corresponding to the second positioning data to obtain the first distance when the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is greater than or equal to a third threshold; or, when the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is less than a third threshold, calculate the straight-line distance between the first projection point and the second projection point to obtain the first distance, the first projection point being the projection point of the position corresponding to the first positioning data projected onto the motion track of the first motion scene, and the second projection point being the projection point of the position corresponding to the second positioning data projected onto the motion track of the first motion scene.
[0196] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is also used to calculate the straight-line distance between the first projection point and the second projection point. Before obtaining the first distance, the fourth distance is determined based on the target positioning data, and the second angle value is determined based on the center point corresponding to the first motion scene, the position corresponding to the target positioning data, and the short axis point of the motion track of the first motion scene. The fourth distance is the distance between the position corresponding to the target positioning data and the center point corresponding to the first motion scene, and the second angle value is the angle value formed by the center point corresponding to the first motion scene and the position corresponding to the target positioning data, and the center point corresponding to the first motion scene and the short axis point of the motion track; based on the second angle value, the fifth distance is determined, and the fifth distance is the distance between the position corresponding to the target positioning data in the motion track of the first motion scene and the center point corresponding to the first motion scene; based on the target positioning data, the center point corresponding to the first motion scene, the fourth distance and the fifth distance, the target projection point is determined; wherein the target positioning data includes the first positioning data, and the target projection point includes the first projection point; or, the target positioning data includes the second positioning data, and the target projection point includes the second projection point.
[0197] Optionally, in an embodiment of the present application, the processor 110 is specifically configured to determine the fifth distance based on identification information of the motion track corresponding to the first motion scene, a curve radius of the motion track, a width value of the motion track, and a second angle value.
[0198] Optionally, in an embodiment of the present application, the processor 110 is specifically used to calculate the difference between the second distance and the standard length of motion corresponding to the first motion scene; and determine the sum of the difference and the second distance as the single-lap motion distance of the electronic device.
[0199] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0200] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.
[0201] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0202] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0203] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.
[0204] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0205] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0206] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0207] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0208] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned motion data compensation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0209] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0210] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0211] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A motion data compensation method, characterized in that: The method comprises: When it is detected that the electronic device is in a first motion scene, first positioning data is acquired, where the first positioning data represents a current position of the electronic device during the motion; Determine a first distance based on the first positioning data and the second positioning data, where the second positioning data is positioning data acquired before the first positioning data; When the motion trajectory of the electronic device meets the single-lap motion condition of the first motion scene, the single-lap motion distance of the electronic device is compensated based on a second distance and a standard motion length corresponding to the first motion scene, where the second distance is the sum of distances corresponding to every two positioning data of the electronic device during the single-lap motion.
2. The method according to claim 1, characterized in that: In the case where it is detected that the electronic device is in the first motion scene, before acquiring the first positioning data, the method further includes: When a start motion instruction is detected, obtaining initial positioning data of the electronic device; In a case where the initial positioning data matches the target positioning data in the electronic device, it is determined that the electronic device is in the first motion scene associated with the target positioning data.
3. The method according to claim 2, characterized in that After acquiring the initial positioning data of the electronic device, the method further includes: In a case where the initial positioning data does not match any positioning data in the electronic device, acquiring a first motion trajectory of the electronic device; When the first motion trajectory is a closed trajectory, first information corresponding to the first motion trajectory is obtained, where the first information includes at least one of the following: positioning data of a center point of the trajectory, radius data of an inscribed circle corresponding to the center point of the trajectory, radius data of a circumscribed circle corresponding to the center point of the trajectory, positioning data of a minor axis point of the trajectory, and a trajectory deflection angle; Based on the first information, determine whether the electronic device is in the first motion scene.
4. The method according to claim 3, characterized in that The determining, based on the first information, whether the electronic device is in the first motion scene includes: Based on the first information, determine a first ratio, a third distance and a first angle value, wherein the first ratio is a ratio of the inscribed circle radius data to the circumscribed circle radius data, the third distance is a distance between the trajectory center point and any trajectory point included in the first motion trajectory, and the first angle value is an angle value formed by the trajectory center point and any trajectory point, and by the trajectory center point and the trajectory minor axis point; Determining whether a trajectory shape of the first motion trajectory matches a preset trajectory shape based on the first ratio, the third distance, the first angle value, and the trajectory deflection angle; In a case where the trajectory shape of the first motion trajectory matches the preset trajectory shape, it is determined that the electronic device is in the first motion scene.
5. The method according to claim 4, characterized in that The determining, based on the first ratio, the third distance, the first angle value, and the trajectory deflection angle, whether the trajectory shape of the first motion trajectory matches a preset trajectory shape includes: Determine a first value and a second value based on the third distance, the first angle value and the trajectory deflection angle, wherein the first value represents an average of distances between all trajectory points included in the first motion trajectory and the center point of the trajectory, and the second value represents a change range of distances between all trajectory points included in the first motion trajectory and the center point of the trajectory; When the first ratio, the first value, and the second value satisfy a preset condition, it is determined that the trajectory shape of the first motion trajectory matches the preset trajectory shape.
6. The method according to claim 3, characterized in that After acquiring the first motion trajectory of the electronic device, the method further includes: When the sum of distances of all trajectory points contained in the first motion trajectory is greater than or equal to a first threshold, and the distance between two trajectory points is less than or equal to a second threshold, the first motion trajectory is determined to be a closed trajectory.
7. The method according to claim 1, characterized in that The determining a first distance based on the first positioning data and the second positioning data includes: When the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is greater than or equal to a third threshold, calculating the straight-line distance between the position corresponding to the first positioning data and the position corresponding to the second positioning data to obtain the first distance; or, When the distance between the position corresponding to the first positioning data and the center point corresponding to the first motion scene is less than a third threshold, the straight-line distance between the first projection point and the second projection point is calculated to obtain the first distance, where the first projection point is the projection point of the position corresponding to the first positioning data projected onto the motion track of the first motion scene, and the second projection point is the projection point of the position corresponding to the second positioning data projected onto the motion track of the first motion scene.
8. The method according to claim 7, characterized in that Before calculating the straight-line distance between the first projection point and the second projection point to obtain the first distance, the method further includes: Based on the target positioning data, a fourth distance is determined, and based on the center point corresponding to the first motion scene, the position corresponding to the target positioning data, and the short axis point of the motion track of the first motion scene, a second angle value is determined, wherein the fourth distance is the distance between the position corresponding to the target positioning data and the center point corresponding to the first motion scene, and the second angle value is the angle value formed by the center point corresponding to the first motion scene and the position corresponding to the target positioning data, and the center point corresponding to the first motion scene and the short axis point of the motion track; Based on the second angle value, determining a fifth distance, the fifth distance being a distance between a position corresponding to the target positioning data in the motion track of the first motion scene and a center point corresponding to the first motion scene; Determine a target projection point based on the target positioning data, a center point corresponding to the first motion scene, the fourth distance, and the fifth distance; The target positioning data includes the first positioning data, and the target projection point includes the first projection point; or the target positioning data includes the second positioning data, and the target projection point includes the second projection point.
9. The method according to claim 8, characterized in that The determining the fifth distance based on the second angle value includes: The fifth distance is determined based on identification information of the motion track corresponding to the first motion scene, a curve radius of the motion track, a width value of the motion track, and the second angle value.
10. The method according to claim 1, characterized in that The compensating the single-circle motion distance of the electronic device based on the second distance and the motion standard length corresponding to the first motion scene includes: Calculating a difference between the second distance and a standard length of motion corresponding to the first motion scene; The sum of the difference and the second distance is determined as the single-circle movement distance of the electronic device.
11. A motion data compensation device, characterized in that: The device comprises: an acquisition module, a determination module and a compensation module; The acquisition module is used to acquire first positioning data when detecting that the electronic device is in a first motion scene, wherein the first positioning data represents a current position of the electronic device during the motion; The determining module is used to determine a first distance based on the first positioning data and second positioning data, where the second positioning data is positioning data acquired before the first positioning data; The compensation module is used to compensate the single-circle motion distance of the electronic device based on a second distance and a standard motion length corresponding to the first motion scene when the motion trajectory of the electronic device meets the single-circle motion condition of the first motion scene, wherein the second distance is the sum of distances corresponding to every two positioning data of the electronic device during the single-circle motion.
