Track generation method and device, storage medium and program product
By collecting sensor data and map data, the missing motion trajectories are determined and supplemented, which solves the problem of missing trajectories caused by GPS signal interference and realizes the generation of complete motion records.
Patent Information
- Application Number
- CN202410268815.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-08
- Publication Date
- 2025-09-09
AI Technical Summary
During user movement, GPS signal interference may cause partial missing tracks in the trajectory record, and existing technologies make it difficult to generate a complete movement trajectory.
By collecting sensor data from electronic devices and combining it with map data, the missing trajectory is determined and a path with a high matching degree is selected to compensate for it, thus generating a complete trajectory.
In the case of GPS signal interference, it can accurately supplement the missing movement trajectory, improve the accuracy of path selection, and generate a complete movement record.
Smart Images

Figure CN120609372A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a trajectory generation method, device, storage medium, and program product. Background Art
[0002] When a user uses an electronic device such as a mobile phone or wearable device to run outdoors, the track recording function in the sports application (APP) can receive satellite positioning signals through the global positioning system (GPS) in the electronic device to obtain the user's location information, thereby generating the user's movement track record.
[0003] However, in some cases, if the user turns on the track recording function of the sports app after exercising for a certain period of time, the track within the initial period will be missing from the final generated track record. Or, when the user is running, if there are sections of the road where the GPS cannot receive satellite positioning signals, for example, in some areas where the GPS cannot receive satellite positioning signals due to signal interference, part of the track will be missing from the final generated track record. For example, Figure 1 As shown, the user's motion trajectory record is displayed in the interface 101 of the mobile phone 10, where point A is the starting point of the user's motion and point D is the end point of the user's motion. However, due to factors such as signal interference, the GPS cannot receive satellite positioning signals on the section from point B to point C, resulting in the user's trajectory from point B to point C being missing in the motion trajectory record.
[0004] At present, how to generate missing trajectories and obtain complete user motion trajectory records is a problem that needs to be solved urgently. Summary of the Invention
[0005] To solve the above problems, embodiments of the present application provide a trajectory generation method, device, storage medium, and program product.
[0006] In a first aspect, the present application provides a trajectory generation method, the method comprising: obtaining sensor data collected during the movement of an electronic device; obtaining a first trajectory generated corresponding to the movement of the electronic device, and determining that a first missing trajectory exists in the first trajectory; and based on the sensor data, determining a first map path from multiple map paths corresponding to the first missing trajectory in map data as a compensation trajectory for compensating for the first missing trajectory.
[0007] In this application, the first trajectory may be the trajectory record mentioned later, for example, the user's motion trajectory record or the vehicle's driving trajectory record; the first missing trajectory may be the existing missing trajectory mentioned later; the first map path may be the path selected in the map mentioned later that matches the missing trajectory.
[0008] In an embodiment of the present application, the electronic device can turn on the sensors related to the trajectory generation method mentioned in the present application when a trigger condition is detected, and collect and store various sensor data related to the movement of the electronic device. When generating the first trajectory of the movement of the electronic device, the electronic device first needs to determine whether the first trajectory is a complete trajectory, for example, whether there is a first missing trajectory between the starting point and the end point of the first trajectory, or whether there is a first missing trajectory before the starting point of the first trajectory and / or after the end point of the first trajectory. If the electronic device determines that there is a first missing trajectory, it can determine the movement data of the electronic device within the time period of the first missing trajectory based on the sensor data, and match the movement data with the path data corresponding to multiple routes between the starting point and the end point of the first missing trajectory in the map, and select the route with a high degree of matching as the first missing trajectory.
[0009] In some embodiments, the trigger conditions for the electronic device to turn on the sensor may include but are not limited to one or more of the following conditions: the electronic device detects that the user opens a sports APP; the electronic device detects that the user is in motion, such as a large acceleration; the electronic device determines that the user's position has moved through GPS; or the electronic device is turned on and enters the working state, etc. This application does not limit this.
[0010] In some embodiments, during the process of generating the first trajectory, the electronic device may store the collected sensor data until the trajectory generation method mentioned in this application is completed.
[0011] In some embodiments, the electronic device may store each sensor data for a certain period of time. Thus, when the electronic device detects the starting point for generating the first trajectory, the electronic device may obtain sensor data for a certain period of time before the starting point and store the sensor data until the trajectory generation method described in this application is completed.
[0012] In this way, based on the above trajectory generation method, when the GPS cannot obtain satellite positioning signals, the missing first missing trajectory can be completed. In addition, the first missing trajectory missing before the starting point of the first trajectory and / or the first missing trajectory missing after the end point of the first trajectory can be completed to generate a complete trajectory for display to the user. At the same time, by matching the path data of multiple map paths in the map with the movement data of the electronic device during the time period of the first missing trajectory, the map path with the highest matching degree is selected as the first missing trajectory, which can improve the accuracy of path selection.
[0013] In a possible implementation of the first aspect above, the obtaining of the first trajectory generated by the movement of the corresponding electronic device and determining that there is a first missing trajectory in the first trajectory include: determining a first time corresponding to a first starting point for generating the first trajectory and a second time corresponding to a first end point for generating the first trajectory; determining that there is a first missing trajectory in the first trajectory in accordance with any one of the following conditions: the electronic device moves in a first time period before the first time; the electronic device moves in a second time period after the second time; among multiple trajectory points included in the first trajectory, a time interval between adjacent trajectory points is greater than a preset time interval; among multiple trajectory points included in the first trajectory, a distance interval between adjacent trajectory points is greater than a preset distance interval.
[0014] In the present application, the first starting point may be the recording starting point of the trajectory record mentioned later; the first time may be the time corresponding to the recording starting point mentioned later; the first end point may be the recording end point of the trajectory record mentioned later; the second time may be the time corresponding to the recording end point mentioned later; the first time period may be the period before the recording starting point mentioned later; the second time period may be the period after the recording end point mentioned later.
[0015] In an embodiment of the present application, the first missing track may be located between the first starting point and the first end point of the first track; the first missing track may also be located before the first starting point of the first track; or the first missing track may also be located after the first end point of the first track.
[0016] It is understood that the first track may contain one or more missing tracks at the same time, for example, there may be multiple missing tracks between the first starting point and the first end point, there may be a missing track before the first starting point, and there may be a missing track after the first end point. This application does not limit this.
[0017] In some embodiments, when the electronic device moves within a first time period before the first time, it is determined that a first missing trajectory exists before the first starting point of the first trajectory.
[0018] In some embodiments, when the electronic device moves within a second time period after the second time, it is determined that a first missing trajectory exists after the first end point of the first trajectory.
[0019] In some embodiments, when the time interval between adjacent trajectory points in the first trajectory is greater than a preset time interval, and / or the distance interval between adjacent trajectory points is greater than a preset distance interval, it is determined that there is a first missing trajectory between the first starting point and the first end point.
[0020] In this way, missing tracks can be determined in any situation. For example, missing tracks caused by the GPS being unable to obtain satellite positioning signals during the process of generating the first track can be determined. In addition, missing tracks caused by the user not turning on the track recording function of the sports app can also be determined; or missing tracks caused by the user turning off the track recording function of the sports app can be determined.
[0021] In a possible implementation of the first aspect, the obtaining of a first trajectory generated by movement of the corresponding electronic device and determining that a first missing trajectory exists in the first trajectory include: obtaining a trajectory point list of the first trajectory; determining, based on time information corresponding to each trajectory point in the trajectory point list, a time interval between adjacent trajectory points; determining, among the adjacent trajectory points, a first trajectory point and a second trajectory point whose time interval is greater than a preset time interval; and using the first trajectory point as a starting point of the first missing trajectory and the second trajectory point as an end point of the first missing trajectory, where the time of the first trajectory point is earlier than the time of the second trajectory point.
[0022] In the present application, the first track point may be the starting point of the missing path of the missing intermediate track mentioned later; the second track point may be the ending point of the missing path of the missing intermediate track mentioned later.
[0023] In this embodiment of the present application, the trajectory recording function acquires a trajectory point via GPS at regular intervals during the generation of the first trajectory, and connects the trajectory point with the adjacent previous trajectory point to generate the trajectory between the two trajectory points. Therefore, if the interval between two adjacent trajectory points in the first trajectory exceeds the preset time interval, it indicates that the GPS has been unable to receive satellite positioning signals for a long period of time between the adjacent trajectory points, indicating that a first missing trajectory exists between the adjacent trajectory points.
[0024] In some embodiments, the trajectory recording function stores each trajectory point of the first trajectory in a trajectory point list during the process of generating the first trajectory. Therefore, the electronic device can traverse the trajectory point data in the trajectory point list and, based on the time information of each trajectory point data, obtain the time interval between each adjacent trajectory point and select adjacent trajectory points whose time interval exceeds the preset time interval. That is, based on the trajectory point data, it is determined whether there are adjacent trajectory points whose time interval exceeds the preset time interval. If so, it indicates that there is a first missing trajectory between the adjacent trajectory points; if not, it indicates that there is no first missing trajectory between the first starting point and the first end point. Among the adjacent trajectory points, the trajectory point with the preceding time information is the starting point of the first missing trajectory, and the trajectory point with the following time information is the end point of the first missing trajectory.
[0025] In this way, it can be determined whether there is a first missing trajectory in the process of generating the first trajectory, for example, a missing trajectory caused by the GPS being unable to obtain satellite positioning signals.
[0026] In a possible implementation of the first aspect, the acquiring of a first trajectory generated by movement of the corresponding electronic device and determining that a first missing trajectory exists in the first trajectory include: acquiring a trajectory point list of the first trajectory; determining a distance interval between adjacent trajectory points based on the longitude and latitude corresponding to each trajectory point in the trajectory point list; determining that, among the adjacent trajectory points, there exists a third trajectory point and a fourth trajectory point having a distance interval greater than a preset distance interval; and using the third trajectory point as a starting point of the first missing trajectory and the fourth trajectory point as an end point of the first missing trajectory, where a time of the third trajectory point is earlier than a time of the fourth trajectory point.
[0027] In the present application, the third track point may be the starting point of the missing path of the missing intermediate track mentioned later; the fourth track point may be the ending point of the missing path of the missing intermediate track mentioned later.
[0028] In this embodiment of the present application, the trajectory recording function acquires a trajectory point via GPS at a certain interval during the generation of the first trajectory, and connects the trajectory point with the adjacent previous trajectory point to generate the trajectory between the two trajectory points. Therefore, when the distance between two adjacent trajectory points in the first trajectory exceeds the preset distance, it indicates that the GPS cannot receive satellite positioning signals for a long time between the adjacent trajectory points, indicating that a first missing trajectory exists between the adjacent trajectory points.
[0029] In some embodiments, the track recording function stores each track point of the first track in a track point list during the process of generating the first track. Therefore, the electronic device can traverse the track point data in the track point list and, based on the latitude and longitude information of each track point data, obtain the distance interval between each adjacent track point, and select adjacent track points whose distance interval exceeds the preset distance interval. That is, based on each track point data, it is determined whether there are adjacent track points whose distance interval exceeds the preset distance interval. If so, it indicates that there is a first missing track between the adjacent track points; if not, it indicates that there is no first missing track between the first starting point and the first end point. Among the adjacent track points, the track point with the time information in front is the starting point of the first missing track, and the track point with the time information in the back is the end point of the first missing track.
[0030] In this way, it can be determined whether there is a first missing trajectory in the process of generating the first trajectory, for example, a missing trajectory caused by the GPS being unable to obtain satellite positioning signals.
[0031] In a possible implementation of the first aspect above, the above-mentioned obtaining of the first trajectory generated by the movement of the corresponding electronic device and determining that there is a first missing trajectory in the first trajectory include: determining the first movement data of the electronic device from the first time to the second time based on the sensor data corresponding to the first trajectory; determining the second movement data of the electronic device in the first time period based on the sensor data collected in the first time period; corresponding to each average movement parameter in the first movement data and the second movement data satisfying a first preset condition, determining that there is a first missing trajectory before the first starting point of the first trajectory; and determining the starting point and the end point of the first missing trajectory based on the second movement data of the electronic device in the first time period.
[0032] In the present application, the first movement data may be the movement data between the recording start point and the recording end point mentioned later, such as the distance, altitude change, user calorie consumption and other motion data; the second movement data may be the movement data before the recording start point mentioned later, such as the distance, altitude change, user calorie consumption and other motion data between the recording start points.
[0033] In some embodiments, the first preset condition may be the following condition mentioned below: the difference between the average movement parameters of the first movement data and the second movement data is within a preset error range. The preset error range can be set arbitrarily and is not limited in this application.
[0034] In some embodiments, when a user performs outdoor running, cycling, or other sports, the user usually performs a uniform motion or the speed difference throughout the entire process is small. Therefore, the electronic device can determine the second movement data of the user in the first time period based on the sensor data collected in the first time period, such as movement parameters such as distance, altitude change, and calorie consumption. In addition, the electronic device can calculate the average movement parameters of each movement parameter based on time, such as the average movement parameters such as the movement distance per minute and the calorie consumption per minute. At the same time, the electronic device can compare the average movement parameters calculated above with the average movement parameters in the first trajectory (such as the movement distance per minute, the calorie consumption per minute, etc.). If the difference is small, for example, the difference is within 20%, it means that the user is performing the same running, cycling, etc. exercise before the first starting point, rather than the warm-up, starting preparation, etc. stage. At this time, it can be determined that there is still a missing first missing trajectory before the first starting point.
[0035] In this way, it can be determined whether there is a first missing track before the first starting point of the first track.
[0036] In a possible implementation of the first aspect above, determining the starting point and the end point of the first missing trajectory based on the second movement data of the electronic device in the first time period includes: obtaining the second movement data of the electronic device in the first time period; selecting a first range in the map data based on the second movement data, wherein, between each location in the first range and the first starting point of the first trajectory, there is at least one map path whose path data matches the second movement data; and using the location selected by the user in the first range as the starting point of the first missing trajectory, and using the first starting point of the first trajectory as the end point of the first missing trajectory.
[0037] In the present application, the first range may be the missing starting point range circled in the map mentioned later.
[0038] In an embodiment of the present application, the electronic device can determine the second movement data of the electronic device within the first time period based on the sensor data collected within the first time period, such as movement parameters such as distance, altitude change, and user calorie consumption. Next, on the map, the missing starting point range is identified, wherein the path data between each building or road sign in the missing starting point range and the first starting point is similar to the second movement data. Finally, the user selects the starting point of the first missing track within the missing starting point range; alternatively, the electronic device can use any location within the missing starting point range as the starting point of the first missing track, for example, the center point of the missing starting point range can be used as the starting point of the first missing track. At the same time, the first starting point of the first track is the end point of the first missing track. In this way, when there is a first missing track before the first starting point of the first track, the starting point of the first missing track and the end point of the first missing track can be determined.
[0039] In a possible implementation of the first aspect above, the above-mentioned acquisition of the first trajectory generated by the movement of the corresponding electronic device and determining that there is a first missing trajectory in the first trajectory include: determining third movement data of the electronic device from the first time to the second time based on sensor data corresponding to the first trajectory; determining fourth movement data of the electronic device in the second time period based on sensor data collected in the second time period; corresponding to each average movement parameter in the third movement data and the fourth movement data satisfying a first preset condition, determining that there is a first missing trajectory after the first end point of the first trajectory; and determining the starting point and end point of the first missing trajectory based on the fourth movement data of the electronic device in the second time period.
[0040] In the present application, the third movement data may be the movement data between the recording start point and the recording end point mentioned later, such as the distance, altitude change, user calorie consumption and other motion data; the fourth movement data may be the movement data after the recording end point mentioned later, such as the distance, altitude change, user calorie consumption and other motion data of the user after the recording end point.
[0041] In some embodiments, the first preset condition may be the following condition mentioned below: the difference between the average movement parameters in the third movement data and the fourth movement data is within a preset error range. The preset error range may be arbitrarily set and is not limited in this application.
[0042] In some embodiments, when a user performs outdoor running, cycling, or other sports, the user usually performs uniform motion or the speed difference throughout the entire process is small. Therefore, the electronic device can determine the fourth movement data of the user in the second time period based on the sensor data collected in the second time period, such as movement parameters such as distance, altitude change, and calorie consumption. In addition, the electronic device can calculate the average movement parameters of each movement parameter based on time, such as the average movement parameters such as the movement distance per minute and the calorie consumption per minute. At the same time, the electronic device can compare the average movement parameters calculated above with the average movement parameters in the first trajectory (such as the movement distance per minute, the calorie consumption per minute, etc.). If the gap is small, for example, the gap is within 20%, it means that the user is performing the same running, cycling, etc. exercise after the first end point. At this time, it can be determined that there is a missing first missing trajectory after the first end point.
[0043] In this way, it can be determined whether there is a first missing track after the first end point of the first track.
[0044] In a possible implementation of the first aspect above, determining the starting point and the end point of the first missing trajectory based on the fourth movement data of the electronic device within the second time period includes: obtaining the fourth movement data of the electronic device within the second time period; selecting a second range in the map data based on the fourth movement data, wherein, between each location in the second range and the first end point of the first trajectory, there is at least one map path whose path data matches the fourth movement data; and using the first end point of the first trajectory as the starting point of the first missing trajectory, and using the location selected by the user in the second range as the end point of the first missing trajectory.
[0045] In the present application, the second range may be the missing end point range circled in the map mentioned later.
[0046] In an embodiment of the present application, the electronic device can determine the fourth movement data of the electronic device in the second time period based on the sensor data collected in the second time period, such as movement parameters such as distance, altitude change, and user calorie consumption. Next, on the map, the missing end point range is identified, wherein each building or road sign in the missing end point range is similar to the path data and the fourth movement data between the first end point. Finally, the user selects the end point of the first missing track in the missing end point range; or, the electronic device can use any location in the missing end point range as the end point of the first missing track, for example, the center point of the missing end point range can be used as the end point of the first missing track. At the same time, the first end point of the first track is the starting point of the first missing track. In this way, when there is a first missing track after the first end point of the first track, the starting point of the first missing track and the end point of the first missing track can be determined.
[0047] In a possible implementation of the first aspect, the first preset condition includes: a difference between each average movement parameter in the first movement data and the second movement data is within a preset error range.
[0048] In an embodiment of the present application, the movement parameters in the first movement data and the second movement data may be: user movement distance, altitude change, calorie consumption, etc.; each average movement parameter may be the change amount of each movement parameter per minute, for example, movement distance per minute, altitude change per minute, calorie consumption per minute, etc.
[0049] In some embodiments, the electronic device may obtain first movement data based on sensor data within a first time period and a second time period, and divide each movement parameter by the time interval between the first time period and the second time period to obtain each average movement parameter of the first movement data. At the same time, the electronic device may obtain second movement data based on sensor data within the first time period, and divide each movement parameter by the time interval of the first time period to obtain each average movement parameter of the second movement data. If the difference corresponding to each average movement parameter is within a preset error range (e.g., within 20%), the first preset condition is met. The preset error range can be set arbitrarily and is not limited in this application.
[0050] In some embodiments, the electronic device may obtain third movement data based on sensor data from the first time period and the second time period, and divide each movement parameter by the time interval between the first time period and the second time period to obtain each average movement parameter of the third movement data. Simultaneously, the electronic device may obtain fourth movement data based on sensor data from the second time period, and divide each movement parameter by the time interval of the fourth time period to obtain each average movement parameter of the fourth movement data. If the difference between the corresponding average movement parameters is within a preset error range (e.g., within 20%), the first preset condition is satisfied.
[0051] In a possible implementation of the first aspect, the method of determining, based on sensor data, a first map path as a compensation trajectory for compensating for the first missing trajectory from a plurality of map paths corresponding to the first missing trajectory in the map data includes: determining, based on the sensor data, fifth movement data of the electronic device between a starting point of the first missing trajectory and an end point of the first missing trajectory; obtaining, from the map data, a plurality of map paths between the starting point of the first missing trajectory and an end point of the first missing trajectory, and a degree of fit between a path parameter of each map path and the fifth movement data; and determining a first map path that satisfies a second preset condition as the compensation trajectory for compensating for the first missing trajectory, the second preset condition including: a degree of fit of the first map path being a maximum value among a plurality of degree of fits, a degree of fit of the first map path being greater than one or more of a preset degree of fit threshold.
[0052] In the present application, the fifth movement data may be the movement data of the missing track time period mentioned later; the second preset condition may be the condition that the corresponding fitting degree needs to meet when the map path mentioned later is used as the first missing track.
[0053] In an embodiment of the present application, there may be multiple paths between the starting point and the end point of the first missing track on the map, and the first map path matching the fifth movement data is selected from the multiple paths as the first missing track.
[0054] In some embodiments, the electronic device may calculate the fit of each map path based on the fifth movement data and the corresponding path parameters, and select the first map path with the highest fit, or the first map path with a fit greater than a preset fit threshold, as the first missing track. In this way, the first missing track can be completed.
[0055] In a possible implementation of the first aspect above, the degree of fit between the path parameters of the above-mentioned map path and the fifth movement data is determined in the following manner: determining the relative ratios corresponding to multiple movement parameters in the fifth movement data and the corresponding path parameters in the map path; and based on the relative ratios corresponding to the multiple movement parameters and the weights corresponding to each relative ratio, performing a weighted summation of the relative ratios corresponding to the multiple movement parameters to obtain the degree of fit of the map path.
[0056] In the embodiment of the present application, the closer the ratio of the distance, altitude change, calorie change, and other movement parameters in the fifth movement data to the corresponding path parameters in the map path is to 1, the more closely the movement parameters match the corresponding path parameters. However, within the same path, the relative ratios between different movement parameters and corresponding path parameters may vary. Therefore, it is necessary to assign weights to the different relative ratios and perform a weighted sum of the relative ratios to obtain the degree of fit of the map path. That is, each relative ratio is multiplied by the corresponding weight, and finally the products are accumulated to obtain the degree of fit of the map path.
[0057] In a possible implementation of the first aspect described above, the weights corresponding to the relative ratios are obtained by: obtaining movement data of multiple electronic devices on a first map path; determining relative ratios corresponding to multiple movement parameters in the movement data and corresponding path parameters in the first map path; adjusting the weights of the relative ratios, and performing a weighted summation of the relative ratios corresponding to the multiple movement parameters and the weights corresponding to the relative ratios to obtain a fit of the first map path, wherein the fit of the first map path is greater than a preset fit threshold.
[0058] In an embodiment of the present application, the weights corresponding to each relative ratio can be determined based on a large number of data samples. For example, in each data sample of a user's movement, the user's movement data along a first map path can be obtained based on sensor data, and the path parameters of the first map path are all known data. The electronic device can then obtain the relative ratios between each movement parameter in the movement data and each path parameter in the path data, and by continuously adjusting the weights corresponding to each relative ratio, a greater degree of fit can be obtained when the relative ratios are weighted and summed. In this case, the adjusted weights corresponding to each relative ratio are the determined desired weights.
[0059] In a possible implementation of the first aspect, the first trajectory includes one or more of a user motion trajectory and a vehicle driving trajectory.
[0060] It can be understood that the trajectory generation method mentioned in this application can be applied to any scenario where trajectories are missing, and this application does not limit this.
[0061] In a possible implementation of the first aspect, the first trajectory corresponds to a vehicle driving trajectory, and the sensor data includes one or more of mileage, atmospheric pressure, and fuel consumption.
[0062] In this embodiment of the present application, based on the vehicle's mileage, atmospheric pressure, fuel consumption, and other sensor data during the first missing track period, driving data such as mileage, altitude change, and fuel consumption change can be determined. Based on this driving data, a matching first map path can be selected from the map data as the first missing track. In this way, the track generation method described in this application can complete the missing track in the driving track record.
[0063] In a possible implementation of the first aspect, corresponding to the first trajectory being a user movement trajectory, the fifth movement data includes: movement distance, altitude change, and calorie consumption.
[0064] In an embodiment of the present application, based on the user's motion data such as travel distance, altitude change, and calorie consumption during the first missing track period, a matching first map path can be selected from the map data based on the motion data as the first missing track. In this way, the missing track in the motion track record can be completed through the track generation method mentioned in this application.
[0065] In a possible implementation of the first aspect above, the sensor data includes one or more of the user's exercise steps, atmospheric pressure, and user's heart rate; the method also includes: obtaining exercise time; and determining the user's exercise stride based on the number of steps corresponding to the preset moving distance of the user; and determining the user's exercise type selected by the user from multiple exercise types.
[0066] In an embodiment of the present application, when the first trajectory is a user's motion trajectory, the electronic device can activate sensors such as a pedometer, a barometer, and an optical heart rate sensor to obtain sensor data such as the user's step count, atmospheric pressure, and heart rate. At the same time, the electronic device can also determine the user's stride length based on the user's preset movement distance and step count. For example, the stride length of each step of the user can be determined based on a portion of the movement distance and movement step count in the first trajectory. In addition, when the user starts recording the first trajectory, they can select the user's motion type, such as running, cycling, etc., and the electronic device can obtain the motion type.
[0067] In a possible implementation of the first aspect above, the method further includes: one or more of the user's exercise steps, the user's exercise time, and the user's exercise stride are used to determine the moving distance; and the atmospheric pressure is used to determine the altitude change; and one or more of the user's heart rate, the user's exercise time, and the user's exercise type are used to determine the calorie consumption.
[0068] In an embodiment of the present application, the electronic device can multiply the number of steps, exercise time and exercise stride of the user in each minute to obtain the moving distance.
[0069] In some embodiments, the electronic device can determine the altitude at different times based on the atmospheric pressure at different times, and subtract the altitudes at different times to obtain the altitude changes at different times.
[0070] In some embodiments, the electronic device can determine the user's calorie consumption based on exercise time, exercise type, and user's heart rate.
[0071] In a second aspect, the present application provides an electronic device comprising: a memory and a processor. The memory is used to store instructions executed by one or more processors of the electronic device, and the processor is one of the one or more processors of the electronic device, and is used to execute the trajectory generation method mentioned in the present application.
[0072] In a third aspect, the present application provides a readable storage medium having instructions stored thereon. When the instructions are executed on an electronic device, the electronic device executes the trajectory generation method mentioned in the present application.
[0073] In a fourth aspect, the present application provides a computer program product, comprising: computer instructions, which, when executed on an electronic device, enable the electronic device to execute the trajectory generation method mentioned in the present application.
[0074] The beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions of the first aspect and various possible implementations of the first aspect, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 According to some embodiments of the present application, a schematic diagram of a user motion trajectory record with a missing portion of the trajectory is shown;
[0076] Figure 2 According to some embodiments of the present application, a schematic diagram of constructing a trajectory using multiple trajectory points is shown;
[0077] Figure 3 According to some embodiments of the present application, a schematic diagram of a missing external trajectory is shown;
[0078] Figure 4 According to some embodiments of the present application, a schematic flow chart of a trajectory generation method is shown;
[0079] Figure 5 According to some embodiments of the present application, a specific flow diagram of a trajectory generation method is shown;
[0080] Figure 6 According to some embodiments of the present application, a schematic diagram of a scenario for supplementing a missing external trajectory is shown;
[0081] Figure 7 According to some embodiments of the present application, a schematic diagram of obtaining multiple paths in a map is shown;
[0082] Figure 8 According to some embodiments of the present application, a schematic diagram comparing the advantages of a trajectory generation method is shown;
[0083] Figure 9 According to some embodiments of the present application, a schematic diagram of the hardware structure of an electronic device is shown. DETAILED DESCRIPTION
[0084] The illustrative embodiments of the present application include, but are not limited to, a trajectory generation method, apparatus, storage medium, and program product.
[0085] The following briefly describes the background of the trajectory generation method provided in the embodiments of the present application.
[0086] As mentioned above, the track recording function in the sports APP can use the GPS in the electronic device to receive satellite positioning signals to obtain the user's location information, thereby generating the user's motion track record. Specifically, when the user uses the sports APP in the electronic device, the track recording function in the sports APP will obtain a track point every certain time interval (such as 5S) or a certain distance (such as 1 meter), and connect the track point with the adjacent previous track point to generate a track between the two track points. For example, Figure 2 As shown in the figure, path AB is a motion track record, where each black dot represents a track point obtained by the sports APP. Figure 2 In the , the motion track record AB is generated by connecting and drawing multiple adjacent track points. Among them, the sports APP usually saves the acquired track point data in a track point list, and the track point data may include the longitude and latitude acquired by GPS, the time corresponding to the longitude and latitude, and other information. Figure 2 As shown, the sports APP stores the track point data in the path AB in the track point list.
[0087] However, on some roads with more signal interference, the GPS will not be able to receive satellite positioning signals, and the sports app will not be able to obtain the track points and user location information within the road section, resulting in the sports app being unable to generate tracks on the road section.
[0088] Currently, if the final motion trajectory record is incomplete, the missing trajectory can be supplemented in the motion trajectory record through the trajectory compensation method, so that the complete motion trajectory record can be displayed to the user. Figure 1 As shown in FIG, after the user finishes exercising, the generated motion trajectory record is missing the segment from point B to point C. In this case, the trajectory from point B to point C can be completed using a trajectory compensation method. Two implementations of the trajectory compensation method are shown below.
[0089] In some examples, a trajectory compensation method for a vehicle during driving is proposed. Specifically, when a sports APP generates a driving trajectory record, it is first necessary to determine whether there is a missing trajectory in the driving trajectory record, as described above. Figure 1 The segment from point B to point C in the figure is the missing trajectory in one case. When determining the presence of a missing trajectory, it is necessary to obtain the characteristic location points and corresponding times of the vehicle's travel within the missing trajectory time period from the vehicle driving video information recorded by the on-board camera or driving recorder. The characteristic location points can be road signs or building signs, etc. Next, the characteristic location points are arranged in chronological order, and the map is determined to determine whether there is a fork in the road between each adjacent characteristic location point. For example, whether there are two roads between characteristic location point A and the adjacent characteristic location point B in the map. If there is no fork in the road, the path is directly used as the trajectory between the adjacent characteristic location points. If there is a fork in the road, it is necessary to calculate the maximum travel distance between the adjacent characteristic location points, such as the time interval multiplied by the vehicle speed limit (e.g., 60 km / h). The fork in the road with a distance less than the maximum travel distance is used as the trajectory between the adjacent characteristic location points. In this way, the trajectory between each characteristic location point within the missing trajectory time period can be obtained, thereby completing the missing trajectory.
[0090] However, the above-mentioned trajectory compensation method requires recording the vehicle driving video information through a camera, etc., so as to obtain the characteristic position points in the driving video information. Therefore, in the scenario where the user is doing outdoor sports such as running, if the above-mentioned trajectory compensation method is to be used in the motion trajectory recording, it is necessary to continuously turn on the camera function of electronic devices such as mobile phones, and the camera needs to be exposed to the air, such as holding the mobile phone all the time, resulting in a poor user experience. In addition, when there is a fork in the road, since the vehicle speed limit value is usually greater than the actual speed of the vehicle, the maximum driving distance corresponding to the vehicle speed limit value may not be able to select the correct fork road section. For example, there may be multiple forks whose distances are less than the maximum driving distance.
[0091] In other examples, the trajectory compensation method can also be implemented based on the historical motion trajectory records stored in the cloud storage or database. Specifically, when it is determined that there is a missing trajectory in the motion trajectory record, the starting position and the ending position of the missing trajectory are first obtained, as described above. Figure 1 The location of point B and point C in the database is then searched for historical motion track records, and the tracks with the same starting and ending positions are matched as missing tracks. However, if the missing track is a new route for the user's outdoor exercise, there will be no track matching the same starting and ending positions in the historical track records in the database. Alternatively, if multiple routes have the same starting and ending positions, it is impossible to determine whether the missing track is a track in the historical motion track records.
[0092] In summary, when there are missing tracks in the user's outdoor sports track record, the above two track compensation methods cannot fit the real path to complete the user's missing track.
[0093] It is understood that, as previously mentioned, when a sports app generates a track record, it will obtain a track point through GPS at a certain time interval or a certain distance, and connect the track point with the adjacent previous track point to generate a track between the two track points. Therefore, when there is a preset time interval and / or preset distance interval between two adjacent track points in the track record, it means that the GPS cannot receive satellite positioning signals for a long time between the adjacent track points, indicating that there is a missing track between the adjacent track points.
[0094] Therefore, the present application provides a trajectory generation method. In this application, when an electronic device detects the need to record a trajectory, for example, when a user opens a sports app or is in motion, the electronic device can activate sensors related to sensor data required to compensate for missing trajectories, such as pedometers and barometers, and store the data collected by the sensors for a period of time, for example, longer than the user's typical exercise time. Thus, when generating a trajectory record, the electronic device can first determine whether there are missing trajectories in the trajectory record. For example, the electronic device can determine whether there are missing trajectories based on whether the intervals between adjacent trajectory points exceed a preset time interval or distance interval, or based on whether sensor data before or after the sports app starts or ends recording changes compared to sensor data at the start or end of the sports app recording. When the electronic device determines that there are missing trajectories, the electronic device can determine movement data within the missing trajectories period based on the sensor data, such as distance, altitude change, etc. The acquired movement data is then matched with path data corresponding to multiple routes between the starting point and the end point of the missing path in a map, and the route with the highest matching degree is selected as the missing trajectories.
[0095] In this way, based on the above trajectory generation method, when the GPS cannot obtain satellite positioning signals, the missing trajectory can be completed. In addition, based on the above trajectory generation method, the missing trajectory can also be completed when the user does not turn on the trajectory recording function of the sports app, or the missing trajectory can be completed after the user turns off the trajectory recording function of the sports app, so as to generate a complete trajectory for display to the user.
[0096] It can be understood that the trajectory generation method provided in the embodiment of the present application can be applied to electronic devices and third-party applications. Among them, the applicable electronic devices include sensors such as pedometers and barometers, or the electronic device can obtain sensor data such as pedometers and barometers in other devices. The electronic device can specifically be any electronic device such as a mobile phone, a wearable device such as a smart watch, a tablet computer, a computer, a netbook, an augmented reality (AR) / virtual reality (VR) device, and an in-vehicle smart terminal. For example, the electronic device is a mobile phone, and the electronic device can obtain sensor data such as a barometer in the mobile phone, and can also obtain sensor data such as heart rate and blood pressure in a smart watch connected to the mobile phone.
[0097] In addition, the third-party application can be any third-party application that can realize the track recording function. The third-party application can be run by an electronic device including sensors such as a pedometer and a barometer, or the third-party application can obtain sensor data from other electronic devices including sensors such as a pedometer and a barometer. This application is not limited to this. For the sake of convenience, the following is an example of the trajectory generation method running on an electronic device including sensors such as a pedometer and a barometer. In addition, the electronic device can also be connected to wearable devices such as smart watches.
[0098] Moreover, for the convenience of description, the starting point of the track record may be described as "recording starting point", the end point of the track record may be described as "recording end point", the starting point of the missing track may be described as "missing path starting point", and the end point of the missing track may be described as "missing path end point". Figure 1 As shown in , the starting point A of the track record AD can be recorded as the "recording starting point", and the end point D of the track record AD can be recorded as the "recording end point". At the same time, if the missing track is between the recording starting point and the recording end point, as shown in Figure 1 As shown, the starting point B of the missing track BC can be recorded as the "missing path starting point", and the end point C of the missing track BC can be recorded as the "missing path end point".
[0099] In addition, if the missing track is before the start point of the track record or after the end point of the track record, the start point of the track record can still be described as "recording start point" and the end point of the track record can be described as "recording end point". When describing the missing track, the start point of the missing track can be described as "missing path start point" and the end point of the missing track can be described as "missing path end point". For example, Figure 3 As shown, path AB is a track record generated by a sports APP. The starting point A of the track record AB can be recorded as the "recording starting point", and the end point B of the track record AB can be recorded as the "recording end point". At the same time, if the missing track is before the recording starting point, when describing the missing track A1A, the starting point A1 of the missing track A1A can be recorded as the "missing path starting point", and the end point A of the missing track A1A can be recorded as the "missing path end point". If the missing track is after the recording end point, when describing the missing track BB1, the starting point B of the missing track BB1 can be recorded as the "missing path starting point", and the end point B1 of the missing track BB1 can be recorded as the "missing path end point". It can be understood that when the missing track is before the recording starting point, the recording starting point and the missing path end point are the same place, such as point A; when the missing track is after the recording end point, the recording end point and the missing path starting point are the same place, such as point B.
[0100] It can be understood that the trajectory generation method mentioned in the present application can be used in any scenario of missing trajectory fitting. For example, the trajectory generation method mentioned in the present application can be used in the scenario of recording the vehicle driving trajectory. Specifically, it is first possible to determine whether there is a missing trajectory in the vehicle driving trajectory record. For example, if there is a time interval or a preset distance interval between two adjacent trajectory points in the driving trajectory record, it means that there is a missing trajectory between the adjacent trajectory points; for example, the fuel volume, mileage and other data stored at the starting point of the driving trajectory record is different from the fuel volume, mileage and other data before the starting point of the record, it means that there is a missing trajectory before the starting point of the record; for example, the fuel volume, mileage and other data stored at the end point of the driving trajectory record is different from the fuel volume, mileage and other data after the end point of the record, it means that there is a missing trajectory after the end point of the record.
[0101] When the missing track is before the recorded starting point or after the recorded end point of the driving track record, the vehicle can obtain data such as mileage, air pressure, and fuel level before or after the recorded starting point or end point, thereby obtaining driving data such as the vehicle's travel distance, altitude change, and fuel consumption during the missing track. Next, the missing starting point range or missing end point range is identified on the map, where the path data between each building or road sign in the missing starting point range and the recorded starting point is similar to the driving data, and the path data between each building or road sign in the missing end point range and the recorded end point is similar to the driving data. Finally, the user selects the starting point of the missing path within the missing starting point range, or selects the end point of the missing path within the missing end point range.
[0102] Furthermore, if the time interval or distance between two adjacent track points in a driving trajectory record exceeds a preset time interval or distance interval, a missing track exists between these adjacent track points. Therefore, if a missing track is between the start and end points of a driving trajectory record, the missing path start and missing path end are the two adjacent track points, respectively. The track point corresponding to the earlier time is the missing path start, and the track point corresponding to the later time is the missing path end.
[0103] In some embodiments, for missing trajectories, it is necessary to obtain driving data for the vehicle during the missing trajectory period, such as driving distance, altitude change, fuel consumption, and other driving data. This driving data is then matched with the path data corresponding to multiple routes between the missing path start point and the missing path end point in the map, and the route with the highest matching degree is selected as the missing trajectory.
[0104] In this way, the trajectory generation method mentioned in this application can complete the missing trajectories in the driving trajectory record.
[0105] In other embodiments, the trajectory generation method mentioned in this application can also be used in scenarios where users are doing outdoor sports such as running, walking, and cycling. This application does not limit this.
[0106] For ease of description, the following embodiments take outdoor sports scenes as an example to specifically introduce the trajectory generation method mentioned in this application.
[0107] In some embodiments, when a user carries an electronic device such as a mobile phone or wearable device to perform outdoor sports such as running, walking, or cycling, the sports APP will obtain a track point through GPS every certain time interval (such as 5S) or a certain distance (such as 1 meter), and connect the track point with the adjacent previous track point to generate a track between the two track points. Therefore, if there are two adjacent track points in the motion track record that exceed the preset time interval or preset distance interval, it means that the GPS cannot receive the satellite positioning signal for a long time between the adjacent track points, and it can be determined that there is a missing track between the adjacent track points. Among them, the missing path starting point and the missing path end point are the adjacent track points of the missing track, respectively.
[0108] In other embodiments, after the electronic device is started, the pedometer, barometer and other sensors therein will continue to work in the background, so that the electronic device can continuously obtain the user's exercise steps based on the pedometer, determine the altitude of the current location based on the atmospheric pressure, and determine the user's calorie consumption based on the user's exercise steps and / or the heart rate of the smart watch, exercise time, etc. Therefore, the electronic device can store exercise data such as step count, altitude, and calorie consumption for a period of time. In this way, when the track recording function of the sports APP is turned on or off, the electronic device can obtain data such as the number of steps within a certain period of time before the recording start point or after the recording end point. If the data changes compared to the number of steps at the recording start point or the recording end point, it means that there is still a section of exercise trajectory before or after the track recording function of the sports APP is turned on or off.
[0109] Among them, when the missing track is before the recorded starting point or after the recorded end point of the motion track record, the electronic device can obtain data such as the number of steps, air pressure, and calorie consumption before or after the recorded starting point, thereby obtaining the user's motion data such as the movement distance, altitude change, and calorie consumption change during the missing track. Next, on the map, the missing starting point range or the missing end point range is identified, where the buildings or road signs in the missing starting point range are similar to the path data and motion data between the recorded starting point, and the buildings or road signs in the missing end point range are similar to the path data and motion data between the recorded end point. Finally, the user selects the starting point of the missing path in the missing starting point range, or selects the end point of the missing path in the missing end point range.
[0110] Furthermore, if the interval between two adjacent track points in a motion trajectory exceeds a preset time interval or distance, this indicates a missing path between these adjacent track points. Therefore, if the missing path is between the start and end points of the motion trajectory, the missing path start point and the missing path end point are the two adjacent track points, respectively. The track point corresponding to the earlier time is the missing path start point, and the track point corresponding to the later time is the missing path end point.
[0111] In some embodiments, for missing tracks, it is necessary to obtain the user's motion data during the missing track period. For example, the user's movement distance is obtained through a pedometer, the change in altitude is obtained through atmospheric pressure, and the calorie consumption is obtained through movement time and step count. This motion data is then matched with the path data corresponding to multiple routes between the starting point and the end point of the missing path on the map, and the route with the highest matching degree is selected as the missing track.
[0112] The following takes the trajectory generation method applied to electronic equipment as an example. Figure 4 The flow chart shown in FIG. briefly describes the trajectory generation method mentioned in this application. The method can be applied to electronic devices, such as the above Figure 1 As shown in the mobile phone 10. Figure 4 Specifically, the method includes the following steps:
[0113] S401: Acquire sensor data collected during the movement of the electronic device.
[0114] In an embodiment of the present application, the electronic device can turn on the sensors related to the trajectory generation method mentioned in the present application when moving, collect and store the sensor data, so that the electronic device can execute subsequent steps S402 and S403 through the sensor data.
[0115] In some embodiments, during the process of generating the trajectory record, the electronic device may store the collected sensor data until the trajectory generation method mentioned in this application is completed.
[0116] In some embodiments, each sensor data can be stored for a certain period of time. Thus, when the electronic device detects a starting point for generating a trajectory record, the electronic device can obtain sensor data for a certain period of time before the starting point of the record, and store this sensor data until the trajectory generation method described in this application is completed. Thus, the electronic device can obtain sensor data for the period of time before the starting point of the record, up to the time corresponding to the ending point of the record, during the movement process.
[0117] In some embodiments, the electronic device may further obtain sensor data during the movement process, from a certain time period before the recording start point to a certain time period after the recording end point.
[0118] S402: Acquire a first trajectory generated by the movement of the corresponding electronic device, and determine whether a first missing trajectory exists in the first trajectory.
[0119] In the embodiment of the present application, the first track can be a motion track record generated by the sports APP after the user finishes the exercise, as described above. Figure 1 The motion track record shown; or it can be the vehicle driving track record mentioned above, which is not limited in this application. The first missing track can be the missing track mentioned above.
[0120] In some embodiments, after generating the first track, the electronic device first needs to determine whether the first track is a complete track. For example, if the first missing track is missing in the middle of the first track, as described above Figure 1 or, the first missing track is missing before the recording start point of the first track, such as, judging the above Figure 1 Is there a missing path before point A in the first track? Or, is there a missing first track after the end point of the first track? Figure 1 Is there a missing path after point D in ?
[0121] In other embodiments, since the track recording function will obtain a track point through GPS every certain time interval or a certain distance, and connect the track point to the adjacent previous track point to generate a track between the two track points. Therefore, if there are two adjacent track points in the first track that exceed the preset time interval (e.g., 1 minute) or the preset distance interval (e.g., 500 meters), it means that between the adjacent track points, GPS cannot receive the satellite positioning signal for a long time, and it can be determined that there is a missing track between the adjacent track points. That is, the electronic device can determine that the first missing track is missing in the acquired first track. Among them, the preset time interval or preset distance interval can be set arbitrarily, and this application does not limit this.
[0122] In some embodiments, as described in step S401 above, the electronic device may store the collected sensor data for a period of time. Therefore, the electronic device may obtain sensor data for a certain period of time before the recording start point or after the recording end point. If the sensor data changes compared to the sensor data at the recording start point or the recording end point, it indicates that there may be a first missing track before the recording start point and / or after the recording end point of the first track.
[0123] S403: Determine, based on the sensor data, a first map path from a plurality of map paths corresponding to the first missing track in the map data as a compensation track for compensating the first missing track.
[0124] In this embodiment of the present application, the movement data of the electronic device between the starting point and the end point of the missing path of the first missing trajectory can be determined based on the sensor data. Then, each data point in the movement data is matched with the path data in each map path, and the matching path is selected as the first missing trajectory.
[0125] In some embodiments, there may be multiple paths between the missing path start point and the missing path end point on the map, and a first map path that matches the movement data is selected from the multiple paths as the first missing track. For example, a first map path with similar distance, altitude change, etc. is selected as the first missing track. The electronic device can call a path algorithm module in the electronic map, input the missing path start point and the missing path end point into the path algorithm module, and obtain multiple paths between the missing path start point and the missing path end point. The path algorithm module can be an electronic map (such as Amap) or a map of the same map. TM The algorithm for planning a path in the example above receives a starting point and an end point as input data and outputs the path between the starting point and the end point as output data. This application does not limit the implementation of the path algorithm module.
[0126] In some embodiments, if the first missing track is located between the recording start point and the recording end point of the first track, as described above Figure 1 The segment from point B to point C in the first trajectory indicates that there is a missing trajectory between two adjacent trajectory points in the first trajectory, and the first starting point and the first end point can be two adjacent trajectory points of the missing trajectory respectively.
[0127] In other embodiments, if the first missing track is located before the recorded starting point of the first track or after the recorded end point of the first track, a larger missing starting point range or missing end point range can be identified on the map through the first movement data in the time period corresponding to the first missing track, and the user can then select the missing path starting point or missing path end point within the range. Alternatively, the electronic device can directly determine the missing path starting point or missing path end point within a larger missing starting point range or missing end point range. For example, the center point of the missing starting point range can be used as the missing path starting point, and the center point of the missing end point range can be used as the missing path end point. This application does not limit this.
[0128] If the missing path starting point is selected, the missing path starting point is used as the missing path starting point of the first missing track, and the recording starting point of the first track is used as the missing path end point of the first missing track. Figure 3As shown, the display interface 301 of the mobile phone 10 displays the user's motion trajectory record AB path, wherein, if point A1 is selected as the missing path starting point of the motion, the electronic device can use point A1 as the missing path starting point of the first missing trajectory, and point A as the missing path end point of the first missing trajectory. Alternatively, if the missing path end point is selected, the recorded end point of the first trajectory is used as the missing path starting point of the first missing trajectory, and the selected missing path end point is used as the missing path end point of the first missing trajectory. For example, Figure 3 As shown, the sports APP generates the user's motion trajectory record AB path, where if point B1 is selected as the end point of the missing path of the motion, the electronic device can use point B as the starting point of the missing path of the first missing trajectory and point B1 as the end point of the missing path of the first missing trajectory.
[0129] In this way, based on the above trajectory generation method, missing trajectories can be completed when the GPS cannot obtain satellite positioning signals. In addition, missing trajectories can be completed when the user does not turn on or off the trajectory recording function of the sports app, thereby generating a complete trajectory for the user. At the same time, by matching the path data of each of the multiple paths in the map with the movement data of the electronic device, the accuracy of path selection can be improved.
[0130] The following takes the trajectory generation method applied to electronic equipment and the application scenario as an example, based on Figure 5 The flow chart shown in FIG. 1 is used to specifically introduce the trajectory generation method mentioned in this application. The method can be applied to electronic devices, such as the above Figure 1 As shown in the mobile phone 10. Figure 5 Specifically, the method may include the following steps:
[0131] S501: Turn on sensors related to sensor data required by the trajectory generation method.
[0132] In an embodiment of the present application, the electronic device may turn on a sensor related to the trajectory generation method mentioned in the present application when a trigger condition is detected. The sensor may include a pedometer, a barometer, an optical heart rate sensor, etc., which is not limited in the present application.
[0133] In some embodiments, the electronic device can obtain the user's step count based on a pedometer. The electronic device can also determine the user's altitude at different times based on the air pressure at different times collected by a barometer. Furthermore, the electronic device can determine the user's calorie consumption at different times based on exercise type, exercise duration, heart rate, and other factors. The exercise type can be the exercise type selected by the user when they start recording their exercise track.
[0134] In some embodiments, the electronic device may store the collected sensor data (e.g., step count, air pressure, heart rate, etc.), or the various motion data determined based on the sensor data (e.g., step count, altitude, calorie consumption, etc.), for a period of time. The storage period can be arbitrarily set, for example, it can be stored for any preset time period; or it can be stored until the electronic device detects that the user has stopped exercising; or it can be stored until the electronic device detects that the user has closed the sports app, etc., and this application is not limited to this.
[0135] In some embodiments, the trigger conditions for the electronic device to turn on the sensor may include but are not limited to one or more of the following conditions: the electronic device detects that the user opens a sports APP; the electronic device detects that the user is in motion, such as a large acceleration; the electronic device determines that the user's position has moved through GPS; or the electronic device is turned on and enters the working state, etc. This application does not limit this.
[0136] S502: It is detected that the sports APP generates a user's sports track record.
[0137] In this embodiment of the present application, when the electronic device detects that the user has turned off the track recording function in the sports app, it means that the electronic device has detected that the sports app has generated the user's sports track record. At this time, the electronic device can execute subsequent steps S503 to S511 to determine whether there are any missing tracks, and if so, complete the missing tracks.
[0138] In other embodiments, the electronic device may further execute subsequent steps S503 to S511 after detecting that the user has stopped exercising or has closed the exercise app for a preset period of time to determine whether there are any missing tracks, and complete the missing tracks if any. This application is not limited to this.
[0139] S503: Determine whether there is a missing intermediate track between the recording start point and the recording end point. If yes, proceed to step S504; if not, proceed to step S506.
[0140] In the embodiment of the present application, the missing middle track refers to a track where the missing portion is located between the recording start point and the recording end point.
[0141] In an embodiment of the present application, after the user completes outdoor exercise, the sports APP in the electronic device can display the user's exercise trajectory record to the user. Among them, since during the user's exercise, there may be sections where the GPS cannot receive satellite positioning signals, such as sections with more interference signals or mountain roads, etc., the sports APP cannot obtain the user's location information within the section, and thus cannot generate the trajectory within the section. Therefore, the electronic device needs to determine whether there is a missing intermediate trajectory between the recording start point and the recording end point of the motion trajectory record. If there is a missing intermediate trajectory, go to step S504 to obtain the missing path start point and the missing path end point, as well as the corresponding time information; if there is no missing intermediate trajectory, go to step S506 to determine whether there is a missing external trajectory.
[0142] In some embodiments, when the time interval between two adjacent track points in a motion track record exceeds a preset time interval (e.g., 1 minute) and / or a preset distance interval (e.g., 500 meters), it indicates that the GPS cannot receive satellite positioning signals for a long period of time between the adjacent track points, indicating that there is a missing track between the adjacent track points. The preset time interval or preset distance interval can be set arbitrarily and is not limited in this application.
[0143] In some embodiments, since the sports APP stores the data of each track point in a track point list (such as the list libsDataMap), the electronic device can traverse the data of each track point in the track point list, and based on the longitude and latitude information and time in each track point data, obtain the time interval and distance interval between each adjacent track point, and select the adjacent track points whose time interval exceeds the preset time interval and / or the distance interval exceeds the preset distance interval. That is, based on the data of each track point, it is determined whether there are adjacent track points that exceed the preset time interval and / or the preset distance interval. If so, it means that there is a missing track between the adjacent track points, that is, there is a missing intermediate track between the recording start point and the recording end point; if not, it means that there is no missing intermediate track between the recording start point and the recording end point. Among them, the track point data may include the longitude and latitude of each track point, as well as the time information when the track point is recorded.
[0144] In some embodiments, if there are no missing intermediate tracks, the process may proceed to step S506 to determine whether there are missing external tracks. Alternatively, the process may proceed directly to step S511 to terminate the method flow. This application does not limit this.
[0145] S504: For the missing intermediate trajectory, obtain the missing path start point and the missing path end point, as well as the corresponding time information.
[0146] In this embodiment of the present application, after the electronic device determines, in step S503, that there is a missing intermediate track between two adjacent track points, it is necessary to complete the missing intermediate track. First, the missing path starting point p1, the missing path ending point p2, the time information t1 corresponding to the missing path starting point p1, and the time information t2 corresponding to the missing path ending point p2 are obtained, so as to obtain the motion data for the missing track time period in step S505.
[0147] In some embodiments, because there is a missing intermediate track between two adjacent track points, the starting point and the end point of the missing path are the two adjacent track points, respectively. Furthermore, the track point data stored in the track point list includes the latitude and longitude of each track point, as well as the time information when the track point was recorded. Therefore, the electronic device can also obtain the time information corresponding to the starting point and the end point of the missing path through the track point data. Furthermore, the track point with the preceding time information is the starting point of the missing path, and the track point with the following time information is the end point of the missing path.
[0148] S505: For the missing intermediate trajectory, obtain motion data within the missing trajectory time period.
[0149] In an embodiment of the present application, the exercise data may include the user's exercise distance between the missing path start point and the missing path end point, the altitude change between the missing path start point and the missing path end point, the calorie change between the missing path start point and the missing path end point, etc. The exercise data may also include other more or less data, which is not limited in this application.
[0150] When a user uses a sports APP in an electronic device, the user's cadence, stride and other data can be stored in a cadence dot list (such as a stepRateList list, etc.). Among them, when the GPS cannot receive satellite positioning signals, the sports APP can still record the user's cadence and other data through the pedometer. Therefore, the electronic device can determine the user's movement distance between the missing path starting point p1 and the missing path end point p2 based on the cadence, stride, time information t1 corresponding to the missing path starting point p1, and time information t2 corresponding to the missing path end point p2. Among them, stride refers to the distance of one step; cadence refers to the number of steps per minute.
[0151] In some embodiments, the cadence dot list is typically stored once every certain time interval (e.g., 1 minute). By multiplying the cadence, stride, and time within that time period, the movement distance within that cadence dot list time period can be obtained. At the same time, the movement distances of all cadence dot list time periods between the missing path start point and the missing path end point are added together to obtain the user's movement distance between the missing path start point and the missing path end point. In this way, a more accurate distance feature value can be obtained. For details, please refer to the following formula (1).
[0152] L=∑(stepRate*stepRange*time)(1)
[0153] Where L is the calculated distance the user has traveled between the starting point and the end point of the missing path; stepRate is the cadence; stepRange is the stride length; time is the cadence dot list time period, such as 1 minute; stepRate*stepRange*time is the distance within the cadence dot list time period. By adding up the distances within multiple cadence dot list time periods, the user's distance between the starting point and the end point of the missing path can be obtained.
[0154] In addition, when the electronic device calculates the user's movement distance between the missing path starting point and the missing path end point using data such as cadence, stride length, and time, since the movement distance is an estimate, there is an error between the actual movement distance. For example, the stride length of each step of the user may be different. Therefore, in some embodiments, the electronic device may also compare the above-calculated value with the straight-line distance between the missing path starting point and the missing path end point. If the straight-line distance is greater, the straight-line distance is used as the movement distance between the missing path starting point and the missing path end point. For details, please refer to the following formula (2).
[0155] distance=max(f(p1-p2),∑(stepRate*stepRange*time))(2)
[0156] Among them, distance is the user's movement distance between the starting point and the end point of the missing path; f(p1-p2) is the straight-line distance between the starting point and the end point of the missing path; stepRate is the cadence; stepRange is the stride; time is the cadence dot list time period, such as 1 minute; stepRate*stepRange*time is the distance within the cadence dot list time period; ∑(stepRate*stepRange*time) means accumulating the distances within multiple cadence dot list time periods; max(f(p1-p2),∑(stepRate*stepRange*time)) means taking the maximum value between f(p1-p2) and ∑(stepRate*stepRange*time), that is, selecting the maximum value between the straight-line distance and the calculated value as the movement distance between the starting point and the end point of the missing path.
[0157] In some embodiments, the straight-line distance between the starting point and the end point of the missing path may not be compared, as in the above formula (1), and the calculated value may be directly used as the movement distance between the starting point and the end point of the missing path. This application does not limit this.
[0158] In other embodiments, the motion data may also include the altitude change of the missing path starting point and the missing path end point. When the user uses the sports APP in the electronic device, the sports APP can record the altitude once every certain time interval (such as 5S, etc.), and store the altitude in the altitude dot list (such as the altitude list). Among them, since the altitude is determined by measuring the atmospheric pressure by a barometer, the sports APP can still store the altitude in the altitude list when the GPS cannot receive the satellite positioning signal. In this way, the electronic device can take the difference between the altitude at the time information t2 corresponding to the missing path end point p2 and the altitude at the time information t1 corresponding to the missing path starting point p1, and obtain the altitude change of the missing path starting point p1 and the missing path end point p2. For details, please refer to the following formula (three).
[0159] climb=abs(altitude(n)-altitude(0))(three)
[0160] Where climb represents the altitude change between the starting point and the end point of the missing path; altitude(n) represents the altitude at the end point of the missing path; altitude(0) represents the altitude at the starting point of the missing path; and abs() represents taking the absolute value.
[0161] In other embodiments, the motion data may also include the calorie changes of the user at the starting point and the end point of the missing path. When the user uses the sports APP in the electronic device, the sports APP can record the user's calorie consumption once every certain time interval (such as 5S, etc.). Among them, since calorie consumption is determined by the type of exercise, exercise time, metabolic function of the user's body, etc. Therefore, when the GPS cannot receive the satellite positioning signal, the sports APP can still record the user's calorie consumption data. In this way, the electronic device can take the difference between the calorie consumption data at the time information t2 corresponding to the end point p2 of the missing path and the calorie consumption data at the time information t1 corresponding to the starting point p1 of the missing path, and obtain the calorie changes of the user at the starting point p1 of the missing path and the end point p2 of the missing path. For details, please refer to the following formula (four).
[0162] calories=abs(calories(n)-calories(0))(four)
[0163] Where calories represents the change in calories consumed by the user at the start and end of the missing path; calories(n) represents the calorie consumption at the end of the missing path; calories(0) represents the calorie consumption at the start of the missing path; and abs() represents the absolute value.
[0164] It should be understood that the motion data may also include other more or less data, and this application does not limit this.
[0165] In this embodiment of the present application, after obtaining the motion data for the missing trajectory time period in step S505, the process proceeds to step S509 to obtain a list of paths in the map based on the missing path start point and the missing path end point. From each path in the path list, the path that matches the motion data is selected as the missing trajectory.
[0166] S506: Determine whether there is a missing external track before the recording start point and / or after the recording end point.
[0167] In the embodiment of the present application, the missing external track means that the missing portion of the track is located before the recording start point or after the recording end point.
[0168] In the implementation of this application, after the user completes outdoor exercise, the sports APP in the electronic device can display the user's exercise trajectory record to the user. Among them, since the user may exercise for a certain period of time and then turn on the trajectory recording function of the sports APP, or the user turns off the trajectory recording function of the sports APP and then exercises for a period of time, the final generated motion trajectory record contains missing trajectories. Therefore, the electronic device needs to determine whether there are missing external trajectories before the recording start point and / or after the recording end point of the motion trajectory record. If there are missing external trajectories, go to step S507 to obtain the missing path start point and the missing path end point, as well as the corresponding time information; if there are no missing external trajectories, go to step S511 to end the method steps.
[0169] In some embodiments, the electronic device may determine whether there are missing external tracks before the starting point of the record immediately after the sports APP generates the motion track record. The electronic device may also determine whether there are missing external tracks before the starting point of the record and / or after the end point of the record after a period of time (e.g., 20 minutes) after the sports APP generates the motion track record; or, a feedback information option may be provided on the display interface of the motion track record, allowing the user to select whether the track before the starting point of the record and / or after the end point of the record is missing. This application does not limit this.
[0170] If the number of steps, altitude, and other data recorded at the starting point differ from the number of steps, altitude, and other data recorded before the starting point, this indicates that there are missing external tracks before the starting point of the motion trajectory record. If the number of steps, altitude, and other data recorded at the end point differ from the number of steps, altitude, and other data recorded after the end point, this indicates that there are missing external tracks after the end point of the motion trajectory record.
[0171] In some embodiments, when the electronic device determines that there is no missing intermediate track through the above step S503, it can execute step S506 to determine whether there is a missing external track. Figure 6 As shown in (a) in FIG, when the electronic device determines that there is no missing intermediate track in the motion trajectory AB through step S503, the electronic device needs to determine whether there is a missing external track in the motion trajectory AB. Figure 6 As shown in (b), after the electronic device determines that there are missing external tracks A1A and BB1, the missing external tracks can be completed through steps S507 to S510. Figure 6 As shown in (c) in FIG, the complete trajectory A1B1 can be displayed to the user.
[0172] In some embodiments, the electronic device may further perform step S506 after completing the missing intermediate track to determine whether there is a missing external track.
[0173] In some embodiments, as described in step S501 above, when the electronic device detects a trigger condition, it can turn on sensors related to the trajectory generation method mentioned in this application, such as a pedometer, a barometer, etc., to obtain motion data such as the number of steps, altitude, and calorie consumption of the user. At the same time, the electronic device can save the sensor data or the motion data obtained through the sensor data for a period of time, so as to determine whether there is a missing external trajectory through step S506 after generating the motion trajectory record. For example, when a pedometer or the like records the current number of steps and other data once every period of time (such as 1 minute, etc.), the electronic device will save the data for a period of time for subsequent viewing.
[0174] The storage time can be set arbitrarily, and this application does not limit this. For the sake of convenience, the following embodiment of this application is specifically introduced by taking the storage time as 20 minutes as an example.
[0175] In some embodiments, if the saving time is set to 20 minutes, when the electronic device detects that the track recording function of the sports APP is turned on, the data within 20 minutes before the track recording function of the sports APP is turned on can be obtained and saved until the execution of the track generation method mentioned in this application is completed, so as to determine whether there is a missing external track based on the data and complete the missing external track.
[0176] Specifically, the electronic device can search for data such as steps, calories, and air pressure within 20 minutes of the recording start point p3 based on time t3. If any of these data items remain unchanged from the recording start point p3, it indicates that there are no missing external tracks before the recording start point p3. If one or more of these data items change from the recording start point p3, a sliding window algorithm can be used to determine whether there are missing external tracks.
[0177] Specifically, 5 minutes can be used as a time window, and the data within 20 minutes can be divided into 4 time windows. In this way, based on the above formula (1), formula (3) and formula (4), the motion data such as the movement distance, altitude change, and calorie consumption in each time window can be obtained. Then the motion data in each time window is accumulated to obtain the motion data such as the movement distance, altitude change, and calorie consumption in 20 minutes. Finally, the average motion data within 20 minutes can be obtained based on the accumulated motion data, for example, average pace, average calorie consumption, average altitude change, etc. Wherein, the time range of the time window can be set arbitrarily, and this application does not limit this.
[0178] It is understandable that when users perform outdoor running, cycling and other sports, they usually perform uniform motion or the difference in speed throughout the whole process is small. Therefore, the electronic device can compare the average motion data within 20 minutes calculated above with the average motion data in the motion trajectory record (such as average pace, average calorie consumption, average height change, etc.). If the gap is small, for example, the gap is within 20%, it means that the user is performing the same running, cycling and other sports before the starting point of the record, rather than the warm-up, start preparation and other stages. At this point, it can be determined that there is still a missing motion trajectory before the starting point of the record. Among them, the gap range can be set arbitrarily, and this application does not limit it.
[0179] Similarly, the electronic device can also determine whether there are missing external tracks after the recording end point. For example, when the electronic device detects that the track recording function of the sports APP is turned off, it can then obtain the number of steps, calories, air pressure and other data within 20 minutes after the track recording function of the sports APP is turned off. If any of the data is unchanged compared to the recording end point p4, it means that there are no missing external tracks after the recording end point p4. If one or more of the data has changed compared to the recording end point p4, it can be determined based on the sliding window algorithm whether there are missing external tracks. It should be understood that the method for determining whether there are missing external tracks after the recording end point is similar to the above-mentioned method for determining whether there are missing external tracks before the recording starting point, and will not be repeated here.
[0180] S507: For the missing external trajectory, obtain motion data within the missing trajectory time period.
[0181] In the embodiment of the present application, as described in step S506 above, the electronic device can obtain data such as the number of steps, calories, and air pressure within a period of time (e.g., within 20 minutes) before the recording start point or after the recording end point. The electronic device can then select any time point within this period as the actual start time t5 of the exercise or the actual end time t6 of the exercise. The selection of the time point can be set arbitrarily and is not limited in this application.
[0182] In the embodiment of the present application, when the electronic device selects the actual start time t5, it can obtain motion data for the missing track time period, such as distance, altitude, calorie change, etc., based on the step count, calories, air pressure, and other data within the time period between the actual start time t5 and the time t3 of the recording starting point p3, using the above formulas (1), (3), and (4). The electronic device can also determine the user's stride length based on the user's preset movement distance and number of steps. For example, the stride length of each step of the user can be determined based on a portion of the movement distance and movement step count in the track record.
[0183] In some embodiments, when the electronic device selects the actual end time t6, it can obtain the motion data in the missing track time period, such as distance, altitude, calorie changes, etc., based on the actual end time t6 and the number of steps, calories, air pressure and other data in the time period t4 of the recorded end point p4 through the above formulas (1), (3) and (4).
[0184] S508: For the missing external trajectory, obtain the missing path start point and the missing path end point.
[0185] In an embodiment of the present application, after the electronic device obtains the motion data for the missing track time period in step S507, it can circle the missing start point range or the missing end point range on the map, and then the user can select the missing start point or the missing end point within the range. For example, the electronic device can use the recorded start point as a reference, and the distance and altitude change obtained in step S507 as conditions to circle multiple locations on the map that meet the conditions, and then the user can select one of the multiple locations as the missing start point.
[0186] When the user selects the actual starting point p5, the electronic device can determine that the missing path starting point is the actual starting point p5 and the missing path end point is the recorded starting point p3. When the user selects the actual end point p6, the electronic device can determine that the missing path starting point is the recorded end point p4 and the missing path end point is the actual end point p6.
[0187] It can be understood that the embodiment of the present application does not limit the execution order of steps S503 to S505 and steps S506 to S508. For example, the electronic device may first execute steps S503 to S505, and then execute steps S506 to S508. That is, the electronic device may first complete the missing intermediate trajectory, and then complete the missing external trajectory. Alternatively, the electronic device may first execute steps S506 to S508, and then execute steps S503 to S505. That is, the electronic device may first complete the missing external trajectory, and then complete the missing intermediate trajectory. Alternatively, the electronic device may also execute steps S503 to S505 and steps S506 to S508 at the same time, and the present application does not limit this. That is, the electronic device may complete the missing intermediate trajectory and the external trajectory at the same time.
[0188] Furthermore, the electronic device may also only execute steps S503 to S505, without executing steps S506 to S508. That is, the electronic device may only complete the missing intermediate track. Alternatively, the electronic device may only execute steps S506 to S508, without executing steps S503 to S505. That is, the electronic device may only complete the missing external track. This application does not limit this.
[0189] S509: Based on the missing path start point and the missing path end point, obtain a path list in the map.
[0190] In an embodiment of the present application, after the electronic device determines that there is a missing intermediate trajectory through the above steps S503 to S505, and obtains the missing path starting point, missing path end point and motion data of the missing trajectory, it can complete the missing intermediate trajectory by executing steps S509 and S510.
[0191] In some embodiments, after the electronic device determines that there is a missing external trajectory through the above steps S506 to S508, and obtains the missing path starting point, missing path end point and motion data of the missing trajectory, it can complete the missing external trajectory by executing steps S509 and S510.
[0192] In the process of completing the missing intermediate track or external track, the electronic device first needs to obtain a path list in the map based on the missing path start point and the missing path end point. For example, the electronic device can use the missing path start point and the missing path end point as input data and input them into the path algorithm module of the map. The path algorithm module will output multiple paths between the missing path start point and the missing path end point as output results. For example, the path algorithm module can output data such as the distance and altitude in each path in the form of a path list (such as a pathlist list, etc.). The path algorithm module can be an electronic map (such as a map of AutoNavi). TM The algorithm used for planning the path in the present application is not limited thereto.
[0193] For example, Figure 7 As shown in (a) in the figure, the trajectory between point B and point C is missing in the motion trajectory record AD path, while in the map, there are two paths between point B and point C. For example, Figure 7 As shown in (b) of Figure 3, the trajectory between points E1 and E and the trajectory between points F and F1 are missing from the motion trajectory record EF. However, in the map, there are three paths between points E1 and E and one path between points F and F1.
[0194] S510: Based on the motion data in the missing trajectory time period, a matching path is selected from the path list as the missing trajectory.
[0195] In an embodiment of the present application, the electronic device may compare the distance, altitude change, and calorie consumption data of the missing intermediate trajectory obtained in step S505 with the path data of each path in the path list in the map obtained in step S509, and select a path with a high degree of matching as the missing intermediate trajectory. Alternatively, the electronic device may also compare the distance, altitude change, and calorie consumption data of the missing external trajectory obtained in step S507 with the path data of each path in the path list in the map obtained in step S509, and select a path with a high degree of matching as the missing external trajectory.
[0196] In some embodiments, the path data in the path list obtained based on the map can be parameters such as the distance, altitude change, and calorie change of each path obtained by calling the path algorithm module of the electronic map. Among them, the calorie change parameter can be the estimated value of calories consumed by the user running or cycling on each path output by the path algorithm module. At the same time, the path algorithm module can be an electronic map (such as Amap) TM The algorithm used for planning the path in the present application is not limited thereto.
[0197] In some embodiments, the degree of matching between the motion data obtained in the above steps and the path data of each path in the map can be quantified as a specific degree of fit. The higher the degree of fit, the greater the degree of match. Therefore, the path with the highest degree of fit can be used as the missing track. In this way, the real path can be selected in the map as the missing track, avoiding the direct connection between the starting point of the missing path and the end point of the missing path. For example, Figure 8 As shown in (a), there is a missing track CD in the motion track record AB, where path 1 directly connects point C and point D. However, there may not be a true straight line path between point C and point D. The track generation method mentioned in this application can avoid the above problem and select the real path in the map as the missing track. For example, Figure 8 As shown in (b) in FIG, path 2 between point C and point D is the determined trajectory of the missing user.
[0198] In some embodiments, if the motion data in the above steps is distance, altitude change, or calorie change, and the path data for each path in the map is a distance parameter, an altitude parameter, or a calorie parameter, then the closer the ratio of each motion data to the corresponding parameter is to 1, the more closely the motion data matches the corresponding parameter. However, in the same path, the ratios of different motion data to corresponding parameters may be different. Therefore, it is necessary to assign weights to different ratios, multiply each ratio by the corresponding weight, and finally accumulate the products to obtain the degree of fit of the path. For details, please refer to the following formula (5).
[0199]
[0200] Among them, distance is the movement distance of the user during the time period where the track is missing, determined by the electronic device through the above step S505 or step S507; distance0 is the distance parameter of the path in the map obtained by the electronic device; a is the weight corresponding to the ratio of distance to the distance parameter; climb is the altitude change value of the user during the time period where the track is missing, determined by the electronic device through the above step S505 or step S507; climb 0 is the altitude parameter of the path in the map obtained by the electronic device; b is the weight corresponding to the ratio of the altitude change value to the altitude parameter; calories is the calorie change value of the user during the time period where the track is missing, determined by the electronic device through the above step S505 or step S507; calories0 is the calorie parameter of the path in the map obtained by the electronic device; c is the weight corresponding to the ratio of the calorie change value to the calorie parameter.
[0201] It is understandable that the motion data may also include other more or less data, and the above formula (5) may accumulate other more or less weights and ratio products, which is not limited in this application.
[0202] In some embodiments, when the degree of fit Y is greater, the path data corresponding to the path corresponding to the degree of fit Y is more closely matched with the motion data. Therefore, the path corresponding to the maximum degree of fit Y can be selected as the missing trajectory. Alternatively, the path corresponding to the degree of fit Y greater than a preset degree of fit threshold (e.g., greater than 80%) can be selected as the missing trajectory. The preset degree of fit threshold can be set arbitrarily. At the same time, when the degree of fit Y is 100%, the path data corresponding to the path corresponding to the degree of fit Y completely matches the motion data.
[0203] The weights a, b, and c in the above formula (5) can be determined based on a large number of user motion data samples. For example, in each data sample of the user's motion, the motion starting point, motion end point, motion path, and each path data parameter in the motion path are all known data. At the same time, the electronic device can calculate the motion data between the motion starting point and motion end point in each data sample based on the above formulas (1) to (4). If, in a certain data sample, the ratio of each motion data to the corresponding path data parameter is 1, then the fitness Y corresponding to the data sample is set to 100%. If, in a certain data sample, the ratio of each motion data to the corresponding path data parameter is close to 1, then the fitness Y corresponding to the data sample is set to a larger value. For example, the value of fitness Y can be set to a value greater than 80%. In this way, based on multiple fitness Ys and the values of distance / diatance0, climb / climb0, and calories / calories0 corresponding to each fitness Y, the values of a, b, and c can be calculated. Alternatively, the weights corresponding to the ratios of the motion data and the path data parameters can be continuously adjusted so that each degree of fit Y is close to 100% or greater than a preset degree of fit. For example, if a is calculated to be 50%, b is 30%, and c is 20%, then a, b, and c can be substituted into the above formula (V) to obtain the final degree of fit formula. When the electronic device substitutes the user's movement distance, altitude change value, and calorie change value determined by the above step S505 or step S507 during the missing track time period, as well as the distance parameter, altitude parameter, and calorie parameter of a path between the missing path start point and the missing path end point, into the final degree of fit formula, the degree of fit Y of the path can be obtained. Finally, the electronic device can select the path corresponding to the maximum degree of fit Y from multiple degrees of fit Y as the missing track.
[0204] It will be appreciated that the present embodiment of the present application does not limit the order in which steps S504, S505, S509, and S510 are executed. For example, the electronic device may first execute steps S504 and S505, and then execute steps S509 and S510. That is, the electronic device may first obtain the missing path start point, missing path end point, and motion data of the missing path through steps S504 and S505, and then, through steps S509 and S510, select a path in the map with a high degree of matching as the missing intermediate trajectory. For another example, the electronic device may first execute step S504 to obtain the missing path start point and missing path end point; then execute step S509 to obtain a list of paths between the missing path start point and the missing path end point; then execute step S505 to obtain motion data within the missing trajectory time period; and finally, execute step S510 to compare the motion data with the path data of each path in the path list and select a path with a high degree of matching as the missing intermediate trajectory. This application does not limit this.
[0205] In some embodiments, there may be multiple missing trajectories in the motion trajectory record at the same time. For example, there are multiple missing trajectories between the recording start point and the recording end point, there are missing external trajectories before the recording start point, and there are missing external trajectories after the recording end point. At this time, the electronic device can execute the trajectory generation method mentioned in this application multiple times to complete the multiple missing trajectories respectively. For example, the electronic device can first repeat steps S503 to S505, S509 and S510 to complete the multiple missing trajectories between the recording start point and the recording end point; then, the electronic device can execute steps S506 to S510 to complete the missing trajectories before the recording start point; finally, the electronic device can repeat and execute steps S506 to S510 to complete the missing trajectories after the recording end point. In this way, the electronic device can complete multiple missing trajectories respectively. This application does not limit this.
[0206] S511: Finish work.
[0207] In the embodiment of the present application, when the electronic device determines that there are no missing intermediate tracks through step S503 and determines that there are no missing external tracks through step S506, the method flow can be terminated.
[0208] In some embodiments, when the electronic device completes the missing intermediate track or completes the missing external track through step S510, the method flow may end.
[0209] In this way, through the above trajectory generation method, a more accurate missing trajectory can be fitted based on the three characteristic values of distance, altitude change, and calorie change. At the same time, based on the above trajectory generation method, the missing trajectory can be completed when the GPS cannot obtain the satellite positioning signal. In addition, the missing trajectory when the user does not turn on the trajectory recording function of the sports APP can be completed, or the missing trajectory after the user turns off the trajectory recording function of the sports APP can be completed to generate a complete trajectory for display to the user.
[0210] An embodiment of the present application provides a readable storage medium, on which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the trajectory generation method mentioned in the present application.
[0211] An embodiment of the present application further provides a computer program product, including: computer instructions, which, when executed on an electronic device, enable the electronic device to execute the trajectory generation method mentioned in the present application.
[0212] In addition, an embodiment of the present application further provides an electronic device comprising: a memory and a processor. The memory is used to store instructions executed by one or more processors of the electronic device, and the processor is one of the one or more processors of the electronic device, and is used to execute the trajectory generation method mentioned in the present application.
[0213] The trajectory generation method provided in the embodiments of this application can be applied to electronic devices and third-party applications. Applicable electronic devices include, but are not limited to, mobile phones, wearable devices such as smart watches, tablet computers, computers, netbooks, augmented reality (AR) / virtual reality (VR) devices, and in-vehicle smart terminals, and any other electronic devices. Third-party applications can be any third-party applications that can implement trajectory recording functions. This application does not impose any restrictions on this.
[0214] The following takes the mobile phone 10 as an example to illustrate the hardware structure diagram of the electronic device according to an embodiment of the present application.
[0215] like Figure 9 As shown in FIG, a hardware structure diagram of a mobile phone 10 according to an embodiment of the present application is exemplified. Figure 9As shown, the mobile phone 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0216] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the mobile phone 10. In other embodiments of the present application, the mobile phone 10 may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0217] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a controller, a digital signal processor (DSP), a baseband processor, a display processing unit (DPU), and a graphics processing unit (GPU). The different processing units may be independent devices or integrated into one or more processors. The processor 110 may be used to execute the trajectory generation method described herein.
[0218] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0219] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0220] In an embodiment of the present application, the screen 194 can be used to display the trajectory of the user's movement.
[0221] The wireless communication function of the mobile phone 10 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0222] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 10 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0223] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the mobile phone 10. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0224] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), etc. applied to the mobile phone 10. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0225] In some embodiments, antenna 1 of mobile phone 10 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that mobile phone 10 can communicate with the network and other devices through wireless communication technology.
[0226] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, at least one application required for a function, etc. The data storage area can store data created during the use of the mobile phone 10 (such as audio data, phone book, etc.). In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the mobile phone 10 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor 110.
[0227] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0228] SIM card interface 195 is used to connect a SIM card. A SIM card can be connected to and disconnected from mobile phone 10 by inserting or removing it from SIM card interface 195. Mobile phone 10 may support one or N SIM card interfaces, where N is a positive integer greater than 1. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. These multiple cards can be of the same or different types. SIM card interface 195 is also compatible with different types of SIM cards. SIM card interface 195 is also compatible with external memory cards. Mobile phone 10 interacts with the network through the SIM card to implement functions such as calls and data communications.
[0229] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the mobile phone 10. While charging the battery 142, the charging management module 140 can also provide power to the mobile phone 10 via the power management module 141.
[0230] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0231] The various embodiments disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0232] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application processor, or a microprocessor.
[0233] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0234] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable storage media (e.g., computer-readable storage media), which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to a floppy disk, an optical disk, a read-only memory (ROM), a magnetic or optical card, or a tangible machine-readable memory for transmitting information (e.g., a carrier wave, an infrared signal, a digital signal, etc.) using the Internet in an electrical, optical, acoustic, or other form of propagation signal. Therefore, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
[0235] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.
[0236] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.
[0237] It should be noted that, in the examples and description of the present application, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further qualifications, an element defined by the statement "comprises a" does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0238] While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.
Claims
1. A trajectory generation method, characterized in that: The method comprises: Acquire sensor data collected during the movement of electronic devices; Acquire a first trajectory generated corresponding to the movement of the electronic device, and determine that a first missing trajectory exists in the first trajectory; Based on the sensor data, a first map path is determined from a plurality of map paths corresponding to the first missing track in the map data as a compensation track for compensating the first missing track.
2. The method according to claim 1, characterized in that The acquiring a first trajectory generated corresponding to the movement of the electronic device and determining that a first missing trajectory exists in the first trajectory includes: Determining a first time corresponding to a first starting point of the first trajectory and a second time corresponding to a first end point of the first trajectory; Corresponding to any one of the following conditions, it is determined that the first track has a first missing track: The electronic device moves within a first time period before the first time; The electronic device moves within a second time period after the second time; Among the plurality of track points included in the first track, a time interval between adjacent track points is greater than a preset time interval; Among the plurality of track points included in the first track, a distance interval between adjacent track points is greater than a preset distance interval.
3. The method according to claim 2, characterized in that The acquiring a first trajectory generated by the movement of the corresponding electronic device and determining that a first missing trajectory exists in the first trajectory includes: Obtaining a list of trajectory points of the first trajectory; Determining the time interval between adjacent track points based on the time information corresponding to each track point in the track point list; Determine that among the adjacent track points, there is a first track point and a second track point whose time interval is greater than a preset time interval; The first track point is used as the starting point of the first missing track, and the second track point is used as the ending point of the first missing track. The time of the first track point is earlier than the time of the second track point.
4. The method according to claim 2, characterized in that The acquiring a first trajectory generated by the movement of the corresponding electronic device and determining that a first missing trajectory exists in the first trajectory includes: Obtaining a list of trajectory points of the first trajectory; Determining the distance between adjacent track points based on the longitude and latitude corresponding to each track point in the track point list; Determining that, among the adjacent track points, there is a third track point and a fourth track point whose distance interval is greater than a preset distance interval; The third track point is used as the starting point of the first missing track, and the fourth track point is used as the ending point of the first missing track. The time of the third track point is earlier than the time of the fourth track point.
5. The method according to claim 2, characterized in that The acquiring a first trajectory generated by the movement of the corresponding electronic device and determining that a first missing trajectory exists in the first trajectory includes: determining, based on sensor data corresponding to the first trajectory, first movement data of the electronic device from the first time to the second time; Determining second movement data of the electronic device within the first time period based on the sensor data collected within the first time period; Corresponding to each average movement parameter in the first movement data and the second movement data satisfying a first preset condition, it is determined that the first missing trajectory exists before the first starting point of the first trajectory; and Based on the second movement data of the electronic device in the first time period, a start point of the first missing track and an end point of the first missing track are determined.
6. The method according to claim 5, characterized in that The determining, based on the second movement data of the electronic device in the first time period, a start point of the first missing track and an end point of the first missing track includes: Acquiring the second movement data of the electronic device within the first time period; selecting a first range in map data based on the second movement data, wherein path data of at least one map path between each location in the first range and a first starting point of the first trajectory matches the second movement data; The location selected by the user in the first range is used as the starting point of the first missing track, and the first starting point of the first track is used as the end point of the first missing track.
7. The method according to claim 2, characterized in that The acquiring a first trajectory generated by the movement of the corresponding electronic device and determining that a first missing trajectory exists in the first trajectory includes: determining, based on sensor data corresponding to the first trajectory, third movement data of the electronic device from the first time to the second time; determining fourth movement data of the electronic device within the second time period based on the sensor data collected within the second time period; Corresponding to each average movement parameter in the third movement data and the fourth movement data satisfying a first preset condition, it is determined that the first missing trajectory exists after the first end point of the first trajectory; and Based on fourth movement data of the electronic device in the second time period, a start point of the first missing track and an end point of the first missing track are determined.
8. The method according to claim 7, characterized in that The determining, based on fourth movement data of the electronic device in the second time period, a start point of the first missing track and an end point of the first missing track, includes: Acquiring fourth movement data of the electronic device within the second time period; selecting a second range in the map data based on the fourth movement data, wherein path data of at least one map path between each location in the second range and the first end point of the first trajectory matches the fourth movement data; The first end point of the first track is used as the starting point of the first missing track, and the location selected by the user in the second range is used as the end point of the first missing track.
9. The method according to any one of claims 5 to 8, characterized in that The first preset condition includes: the difference between the average movement parameters in the first movement data and the second movement data is within a preset error range.
10. The method according to claim 1, characterized in that The determining, based on the sensor data, a first map path from a plurality of map paths corresponding to the first missing track in the map data as a compensation track for compensating the first missing track includes: determining, based on the sensor data, fifth movement data of the electronic device between a start point of the first missing trajectory and an end point of the first missing trajectory; acquiring, from the map data, a plurality of map paths between a starting point of the first missing trajectory and an end point of the first missing trajectory, and a degree of fit between a path parameter of each map path and the fifth movement data; A first map path that satisfies a second preset condition is determined as a compensation trajectory for compensating the first missing trajectory, where the second preset condition includes one or more of: a fit degree of the first map path is a maximum value among a plurality of fit degrees, and a fit degree of the first map path is greater than a preset fit degree threshold.
11. The method according to claim 10, characterized in that The degree of fit between the path parameters of the map path and the fifth movement data is determined in the following manner: determining corresponding relative ratios between a plurality of movement parameters in the fifth movement data and corresponding path parameters in the map path; Based on the relative ratios corresponding to the multiple movement parameters and the weights corresponding to the relative ratios, a weighted sum is performed on the relative ratios corresponding to the multiple movement parameters to obtain a fitting degree of the map path.
12. The method according to claim 11, characterized in that The weights corresponding to the relative ratios are obtained in the following manner: Acquiring movement data of multiple electronic devices along a first map path; determining relative ratios corresponding to a plurality of movement parameters in the movement data and corresponding path parameters in the first map path; The weights of the relative ratios are adjusted, and the relative ratios corresponding to the multiple movement parameters and the weights corresponding to the relative ratios are weighted summed to obtain a fit of the first map path, wherein the fit of the first map path is greater than a preset fit threshold.
13. The method according to claim 1, wherein The first trajectory includes one or more of a user motion trajectory and a vehicle driving trajectory.
14. The method according to claim 1, wherein Corresponding to the first trajectory being a vehicle driving trajectory, the sensor data includes one or more of mileage, atmospheric pressure, and fuel consumption.
15. The method according to claim 10 or 11, characterized in that Corresponding to the first trajectory being a user movement trajectory, the fifth movement data includes: movement distance, altitude change, and calorie consumption.
16. The method according to claim 15, characterized in that The sensor data includes one or more of the user's steps, atmospheric pressure, and user's heart rate; The method further comprises: Obtaining user exercise time; and, Determining the user's movement stride based on the number of steps the user takes over a preset movement distance; and A user exercise type selected by the user from among multiple exercise types is determined.
17. The method according to claim 16, characterized in that The method further comprises: One or more of the number of user movement steps, the user movement time, and the user movement stride is used to determine the movement distance; and The atmospheric pressure is used to determine the altitude change; and One or more of the user's heart rate, the user's exercise time, and the user's exercise type are used to determine the calorie consumption.
18. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store instructions executed by one or more processors of the electronic device, and the processor is one of the one or more processors of the electronic device, and is used to execute the trajectory generation method according to any one of claims 1 to 17.
19. A readable storage medium, characterized in that The readable storage medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the trajectory generation method according to any one of claims 1 to 17.
20. A computer program product, characterized in that include: Computer instructions, when the computer instructions are executed on an electronic device, enable the electronic device to execute the trajectory generation method according to any one of claims 1 to 17.