Mobile trajectory fitting method and electronic device

Through the mobile trajectory fitting method, the trajectory points that challenge users are mapped to the trajectory of challenged users, solving the problem of inaccurate user position presentation in mobile devices, ensuring the consistency of path trajectory and improving user experience.

CN117707368BActive Publication Date: 2024-11-08HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311131173.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2024-11-08
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

When existing mobile devices display the user's real-time location, it is difficult to accurately present the user's movement trajectory on the preset path, resulting in the user's impression that the two users do not move based on the same path, which reduces the user experience.

Method used

A moving trajectory fitting method is used to fit the challenging user's movement trajectory to the challenged user's movement trajectory. By mapping the geographical coordinate position and timestamp of the track point, the fitted trajectory is obtained and the user's real-time position is displayed. Make sure the track points are aligned in the time dimension.

Benefits of technology

It realizes the accurate presentation of the path trajectory of the challenged user and the challenged user on mobile devices to users completely overlap, avoiding user misunderstandings and improving user experience and convenience of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707368B_ABST
    Figure CN117707368B_ABST
Patent Text Reader

Abstract

The present application discloses a mobile trajectory fitting method and an electronic device, which relate to the field of terminal technology. The electronic device obtains data of a first mobile trajectory and data of a second mobile trajectory; according to the data of the first mobile trajectory and the data of the second mobile trajectory, each trajectory point on the first mobile trajectory is fitted to the corresponding position on the second mobile trajectory, and the fitted first mobile trajectory is obtained; the electronic device compares and displays the fitted first mobile trajectory and the second mobile trajectory according to the timestamps of the trajectory points. It is possible to fit the mobile trajectory of the challenging user to the mobile trajectory of the challenged user. In this way, the path trajectories of the challenged user and the challenging user presented to the user on the electronic device completely overlap, and will not give the user the misunderstanding that the two users are not moving based on the same path.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a mobile trajectory fitting method and electronic equipment. Background Art

[0002] With the rapid development of mobile devices such as mobile phones and wearable devices, mobile devices can provide users with more and more functions and services. For example, mobile devices can provide navigation functions, sports and health functions, etc. When using these functions, users can select a path on the mobile device and move along this path. The mobile device can collect the user's real-time location and present the user with the specific location of the user's real-time location on the selected path.

[0003] How to accurately present the user's real-time location to the user is a problem that needs to be solved. Summary of the invention

[0004] The embodiments of the present application provide a mobile trajectory fitting method and an electronic device, which can accurately present the real-time position of a user on a preset path.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a mobile trajectory fitting method is provided, which is applied to an electronic device, wherein the electronic device obtains data of a first mobile trajectory and data of a second mobile trajectory; wherein the first mobile trajectory and the second mobile trajectory respectively include at least one trajectory point; each trajectory point is represented as a geographic coordinate position at time t, and time t is a timestamp of the trajectory point. The electronic device fits each trajectory point on the first mobile trajectory to a corresponding position on the second mobile trajectory based on the data of the first mobile trajectory and the data of the second mobile trajectory, and obtains the fitted first mobile trajectory; the electronic device displays the fitted first mobile trajectory and the second mobile trajectory based on the comparison of the timestamps of the trajectory points.

[0007] In this method, one moving trajectory is fitted to another moving trajectory. For example, the moving trajectory of the challenging user is fitted to the moving trajectory of the challenged user. In this way, the paths of the challenged user and the challenging user presented to the user on the electronic device completely overlap, and the user will not be misled into thinking that the two users are not moving based on the same path.

[0008] In combination with the first aspect, in a possible implementation manner, the electronic device fitting each trajectory point on the first movement trajectory to a corresponding position on the second movement trajectory includes:

[0009] The electronic device obtains a first coordinate sequence (a sequence composed of the geographical coordinate position of each trajectory point on the first mobile trajectory) according to the data of the first mobile trajectory; the electronic device obtains a second coordinate sequence (a sequence composed of the geographical coordinate position of each trajectory point on the second mobile trajectory) according to the data of the second mobile trajectory; the electronic device maps the geographical coordinate position of each trajectory point on the first mobile trajectory to the corresponding geographical coordinate position on the second mobile trajectory to obtain a mapped first coordinate sequence; the electronic device adds a corresponding timestamp to each geographical coordinate position in the mapped first coordinate sequence to obtain a fitted first mobile trajectory.

[0010] In this method, the trajectory points are fitted according to the geographical coordinate position of each trajectory point.

[0011] In a possible implementation manner, the electronic device maps the geographical coordinate position of each track point on the first moving track to the corresponding geographical coordinate position on the second moving track, including:

[0012] The electronic device maps the geographic coordinate position of a first trajectory point on the first moving trajectory to the geographic coordinate position of a second trajectory point on the second moving trajectory; the first trajectory point is any trajectory point on the first moving trajectory; wherein the ratio of the distance from the starting point of the second moving trajectory to the second trajectory point to the total length of the second moving trajectory is equal to the ratio of the distance from the starting point of the first moving trajectory to the first trajectory point to the total length of the first moving trajectory.

[0013] Among them, the electronic device maps the geographical coordinate position of the first trajectory point on the first moving trajectory to the geographical coordinate position of the second trajectory point on the second moving trajectory, including: the electronic device obtains the first geographical coordinate position in the first coordinate sequence (the geographical coordinate position of the first trajectory point on the first moving trajectory); obtains the distance from the geographical coordinate position of the first trajectory point in the first coordinate sequence to the first geographical coordinate position; the electronic device obtains the distance from the geographical coordinate position of the first trajectory point in the first coordinate sequence to the geographical coordinate position of the last trajectory point in the first coordinate sequence; the electronic device obtains the distance from the geographical coordinate position of the first trajectory point in the second coordinate sequence to the geographical coordinate position of the last trajectory point in the second coordinate sequence; and then obtains the first distance length according to the following formula ; d2 = d1 / D1*D2; wherein d2 represents the first distance length, d1 is the distance from the geographical coordinate position of the first trajectory point in the first coordinate sequence to the first geographical coordinate position, D1 is the distance from the geographical coordinate position of the first trajectory point in the first coordinate sequence to the geographical coordinate position of the last trajectory point in the first coordinate sequence, and D2 is the distance from the geographical coordinate position of the first trajectory point in the second coordinate sequence to the geographical coordinate position of the last trajectory point in the second coordinate sequence; the electronic device obtains the geographical coordinate position of the second trajectory point on the second moving trajectory according to the first distance length; wherein the geographical coordinate position of the second trajectory point is the geographical coordinate position reached after the first distance length from the first geographical coordinate position in the second coordinate sequence.

[0014] In this method, after the challenge user's movement is over, the proportion of the mapped trajectory points in the total length of the second moving trajectory is equal to the proportion of the trajectory points before mapping in the total length of the first moving trajectory. That is, the trajectory points are fitted according to the proportion of the trajectory points in the moving trajectory. When the first moving trajectory includes n trajectory points, the computational complexity is o(n). Compared with the method of using the DTW algorithm to map each coordinate point in the first coordinate sequence to the second coordinate sequence, the computational complexity is greatly reduced, and the amount of calculation is reduced.

[0015] In a possible implementation manner, the electronic device maps the geographical coordinate position of each track point on the first moving track to the corresponding geographical coordinate position on the second moving track, including:

[0016] The electronic device maps the geographic coordinate position of a first trajectory point on the first moving trajectory to the geographic coordinate position of a second trajectory point on the second moving trajectory; the first trajectory point is any trajectory point on the first moving trajectory; wherein the ratio of the distance traveled from the starting point of the second moving trajectory to the second trajectory point to the total length of the second moving trajectory is equal to the ratio of the distance traveled from the starting point of the first moving trajectory to the first trajectory point to the total length of the second moving trajectory.

[0017] Among them, the electronic device maps the geographical coordinate position of the first trajectory point on the first moving trajectory to the geographical coordinate position of the second trajectory point on the second moving trajectory, including: the electronic device obtains the first geographical coordinate position in the first coordinate sequence; the first geographical coordinate position is the geographical coordinate position of the first trajectory point on the first moving trajectory; the electronic device obtains the distance from the geographical coordinate position of the first trajectory point in the first coordinate sequence to the first geographical coordinate position; obtains the first distance length according to the following formula; d2=d1; wherein d2 represents the first distance length, and d1 is the distance from the geographical coordinate position of the first trajectory point in the first coordinate sequence to the first geographical coordinate position; the electronic device obtains the geographical coordinate position of the second trajectory point on the second moving trajectory according to the first distance length; the geographical coordinate position of the second trajectory point is the geographical coordinate position reached after the first distance length from the first geographical coordinate position in the second coordinate sequence.

[0018] In this method, in the scenario where the challenging user is in motion, the complete movement trajectory of the challenging user has not yet been formed, and the total length of the challenged user's movement trajectory (second movement trajectory) is taken as the total length of the challenging user's movement trajectory (first movement trajectory). The proportion of the trajectory points after mapping to the total length of the second movement trajectory is equal to the proportion of the trajectory points before mapping to the total length of the first movement trajectory. That is, the trajectory points are fitted according to the proportion of the trajectory points in the movement trajectory. When the first movement trajectory includes n trajectory points, the computational complexity is o(n). Compared with the method of using the DTW algorithm to map each coordinate point in the first coordinate sequence to the second coordinate sequence, the computational complexity is greatly reduced, reducing the amount of calculation.

[0019] In a possible implementation manner, the electronic device maps the geographical coordinate position of each track point on the first moving track to the corresponding geographical coordinate position on the second moving track, including:

[0020] The electronic device maps the geographic coordinate position of a first trajectory point on the first moving trajectory to the geographic coordinate position of a second trajectory point on the second moving trajectory; the first trajectory point is any trajectory point on the first moving trajectory, and the second trajectory point is the trajectory point on the second moving trajectory that is closest to the first trajectory point.

[0021] In this method, the geographical coordinate position of the trajectory point A in the challenging user's mobile trajectory (first mobile trajectory) and the geographical coordinate position of each trajectory point in the challenged user's mobile trajectory (second mobile trajectory) are traversed to perform distance calculation, and a trajectory point (trajectory point B) on the challenged user's mobile trajectory that is closest to the trajectory point A is obtained, and the trajectory point A is fitted to the trajectory point B. In this method, when the challenging user's mobile trajectory (first mobile trajectory) includes m trajectory points and the challenged user's mobile trajectory (second mobile trajectory) includes n trajectory points, the amount of calculation is m×n times; the algorithm complexity is o(n2).

[0022] In combination with the first aspect, in a possible implementation manner, the first movement trajectory and the second movement trajectory are generated by two users moving based on the same path.

[0023] In combination with the first aspect, in a possible implementation, the method further includes: the electronic device obtains data of the second movement trajectory from the server.

[0024] In a second aspect, an electronic device is provided, which has the function of implementing the method described in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0025] In a third aspect, an electronic device is provided, comprising: a processor, a memory and a display; the display is used to display a user interface of the electronic device, the memory is used to store computer execution instructions, and when the electronic device is running, the processor executes the computer execution instructions stored in the memory to enable the electronic device to perform a method as described in any one of the above-mentioned first aspects.

[0026] In a fourth aspect, an electronic device is provided, comprising: a processor; the processor is used to couple with a memory, and after reading instructions in the memory, execute a method as described in any one of the above-mentioned first aspects according to the instructions.

[0027] In a fifth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer can execute any of the methods described in the first aspect.

[0028] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect.

[0029] In a seventh aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the first aspect above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.

[0030] Among them, the technical effects brought about by any design method in the second to seventh aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of a scenario applicable to the motion trajectory fitting method provided in an embodiment of the present application;

[0032] Figure 2 A schematic diagram of a scenario applicable to the motion trajectory fitting method provided in an embodiment of the present application;

[0033] Figure 3 A schematic diagram of a scenario example of the motion trajectory fitting method provided in an embodiment of the present application;

[0034] Figure 4 A schematic diagram of a scenario example of the motion trajectory fitting method provided in an embodiment of the present application;

[0035] Figure 5 A schematic diagram of a scenario example of the motion trajectory fitting method provided in an embodiment of the present application;

[0036] Figure 6 A schematic diagram of a scenario example of the motion trajectory fitting method provided in an embodiment of the present application;

[0037] Figure 7 A schematic diagram of a scenario example of the motion trajectory fitting method provided in an embodiment of the present application;

[0038] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0039] Fig. 9 A schematic diagram of modules involved in the motion trajectory fitting method provided in an embodiment of the present application;

[0040] Fig.10 A schematic diagram of module interaction in the motion trajectory fitting method provided in an embodiment of the present application;

[0041] Fig.11 A schematic diagram of module interaction in the motion trajectory fitting method provided in an embodiment of the present application;

[0042] Fig.12 A flow chart of a method for fitting each trajectory point on the challenging user's movement trajectory to the challenged user's movement trajectory provided in an embodiment of the present application;

[0043] Fig.13A A schematic diagram of a scenario example of the motion trajectory fitting method provided in an embodiment of the present application;

[0044] Fig. 13B A schematic diagram of a scenario example of the motion trajectory fitting method provided in an embodiment of the present application;

[0045] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0046] Fig.15 A schematic diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include such expressions as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.

[0048] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0049] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0050] Currently, all popular sports and health applications (applications, apps) can provide sports competition ranking functions. That is, multiple users run, walk, ride, and other sports along the same route, and the performance is ranked according to the length of time the users spend on the same sport. For example, Figure 1 As shown in (a), after the user completes an exercise, the mobile device can obtain the path trajectory of the user's exercise process, including the path starting point, path end point, and each trajectory point along the path, etc.; it can also obtain the corresponding exercise information of the user's exercise process, such as exercise time, average pace, calories consumed, etc. Further, the mobile device can save the path trajectory and exercise information of the user's exercise locally, and can also upload the path trajectory and exercise information of the user's exercise to the cloud server. In this way, other users can also obtain this path trajectory from the cloud server. Other users or users who upload the path can exercise based on the path trajectory, and upload the exercise information on the path to the cloud server. The mobile device can obtain the exercise information of these users from the cloud server, and rank the performance according to the exercise information of each user (exercise time, average pace, etc.). For example, as Figure 1As shown in (b), two users move along the path starting from "Central Park East Gate" and ending at "D1 South Gate". The mobile device obtains the movement information of the two users along the path and ranks them according to the movement information (movement time, average pace, etc.) of the two users on the path. For example, Figure 1 As shown in (b), the mobile phone shows that the exercise time (exercise duration) of user 1 is 20 minutes and 51 seconds, with an average pace of 4 minutes and 34 seconds; the exercise time of user 2 is 24 minutes and 56 seconds, with an average pace of 4 minutes and 37 seconds. In this function, users do not need to agree to exercise at the same time, as long as they exercise on the same route, they can participate in the competitive ranking.

[0051] In one scenario, a mobile device displays at least one path for selection to a user. The user can select one of the paths and exercise based on the selected path. The mobile device receives the user's selection operation for a path and determines the path as a preset path. The user can exercise based on the preset path, and the mobile device collects the user's movement trajectory and exercise information during this exercise.

[0052] The user (challenging user) can select any other user who exercises based on the preset path as the challenge object (challenged user), and the mobile device ranks the exercise performance of the two users based on the exercise information of the user (challenging user) and the challenged user.

[0053] In some embodiments, the mobile device can display the real-time ranking of the challenging user and the challenged user exercising on a preset path. For example, the mobile device can display the dynamic trajectory of the challenging user and the challenged user during the exercise process according to the time dimension. In this way, the user can dynamically and intuitively view the movement position of himself and the challenge object at the same time. It should be noted that the same moment described in the embodiments of the present application is not the same moment of absolute time, but the relative time during the exercise process. That is, the t second after the challenging user starts exercising and the t second after the challenged user starts exercising are the same moment. For example, the 1st second of the challenging user in his exercise process and the 1st second of the challenged user in the exercise process are the same moment.

[0054] Exemplary, reference Figure 2, taking the mobile device as a mobile phone as an example. The mobile phone 100 displays an "outdoor running" interface 101, and the user can set running-related parameters on the "outdoor running" interface 101. Exemplarily, the "outdoor running" interface 101 includes a path selection page 102, and the path selection page 102 is used to display information of at least one path available for the user to select. The user can select a path from multiple paths and exercise based on the selected path. Exemplarily, the path selection page 102 displays a path with a starting point of "Central Park East Gate" and an end point of "D1 South Gate". The path selection page 102 also includes a "Go Challenge" button 103, and the user can click the "Go Challenge" button 103 to view the information of the path. For example, in response to the user's click operation on the "Go Challenge" button 103, the mobile phone 100 displays an interface 104, and the interface 104 is used to display the information of the path "Central Park East Gate-D1 South Gate". Exemplarily, the interface 104 includes the starting point name of the path "Central Park East Gate", the end point name "D1 South Gate", the specific location of the starting point "Lotus Street, Futian District, Shenzhen City", etc. The interface 104 also includes the sports performance of the user who exercises based on the path. Exemplarily, the interface 104 includes an information page 105, which is used to display the sports performance of the user who exercises based on the path "Central Park East Gate-D1 South Gate". Figure 2 As shown, in response to the user clicking the top bar of the information page 105, the mobile phone 100 displays more information items in the information page 105. Exemplarily, the information page 105 includes the ranking of the sports performance of each user who exercises based on the path "Central Park East Gate-D1 South Gate". Among them, a "Challenge TA" button is displayed next to each user's sports performance. The user can choose to click a "Challenge TA" button to select the user corresponding to the "Challenge TA" button as the challenge object (challenged user).

[0055] In one example, if Figure 3 As shown in (a), the mobile phone 100 receives a user's click operation on a "Challenge TA" button, determines the user corresponding to the "Challenge TA" button as the challenged user, and displays a real-time information interface 106, which is used to display real-time information of the challenging user during exercise; for example, the length of the challenging user's exercise path, the exercise duration, the real-time positions of the challenging user and the challenged user at the tth second after starting the exercise, the real-time ranking of the challenging user and the challenged user, etc. For example, Figure 3As shown in (b), the challenging user has currently run 2.54 kilometers (the length of the motion path is 2.54 kilometers), the challenging user has run for 1 minute and 51 seconds (the motion duration is 00:01:51), the real-time position of the challenging user is position 1061, and the real-time position of the challenged user is position 1062. The challenging user is 20 seconds behind the challenged user. In this example, while the user is exercising based on the preset path, the mobile phone 100 can dynamically display the motion trajectories of the challenging user and the challenged user.

[0056] In another example, after the challenging user finishes the exercise, the user can view the dynamic tracks of the challenging user and the challenged user displayed in the time dimension during the exercise on the mobile phone. For example, after the challenging user completes an exercise based on the path "Central Park East Gate-D1 South Gate", the user can click "Road Section Results" to view the relevant information of this exercise process. Figure 4 As shown in (a), the mobile phone 100 displays a "segment performance" page 107, which includes information such as the user's pace per kilometer and exercise duration during this exercise. The "segment performance" page 107 includes a "dynamic track" button 108. In response to the user clicking the "dynamic track" button 108, the mobile phone 100 displays a dynamic track display page 109. The dynamic track display page 109 is used to dynamically display the exercise tracks of the challenging user and the challenged user at each moment during this exercise. For example, Figure 4 As shown in (b), when the challenging user's exercise mileage reaches 3.45 kilometers, the real-time location of the challenging user is location 1091, and the real-time location of the challenged user is location 1092; Figure 4 As shown in (c), when the challenging user's exercise mileage reaches 5.03 kilometers, the real-time location of the challenging user is location 1093, and the real-time location of the challenged user is location 1094. In this example, after the user finishes exercising based on the preset path, the mobile phone 100 can dynamically display the movement tracks of the challenging user and the challenged user.

[0057] In the above two examples, the mobile phone 100 dynamically displays the movement tracks of the challenging user and the challenged user; that is, when the mobile phone 100 displays the real-time position of the challenging user at each moment during the movement, the real-time position of the challenged user at that moment is also displayed. In this way, the user can easily perceive the real-time ranking of the two users during a movement.

[0058] In this scenario, the mobile device will mark the real-time locations of the challenging user and the challenged user on a map according to the time dimension for easy viewing by the user.

[0059] In actual applications, although the challenging user and the challenged user move based on the same preset path, due to the hardware limitations of the mobile device, the positioning may not be accurate enough, resulting in the movement trajectories of the two users not completely overlapping.

[0060] It can be understood that the user movement trajectory can generally be expressed as a sequence of trajectory points; wherein the i-th trajectory point can be expressed as Pi = (x, y, t), indicating that the geographic coordinate position of the trajectory point Pi at time t (for example, the tth second after the start of the movement) is (x, y), x represents the longitude value, and y represents the latitude value. Time t is the timestamp of the i-th trajectory point. In one implementation, the geographic coordinate position of the trajectory point, that is, the value of (x, y), can be obtained through a global navigation satellite system (GNSS). The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS), etc. Exemplarily, the geographic coordinate position of the i-th trajectory point is ("x":39.997761,"y":116.478928).

[0061] In one example, the challenging user and the challenged user move based on the same preset path. During the challenging user's movement, the mobile device carried by the challenging user will collect the real-time position (geographic coordinate position) of the challenging user through GNSS according to certain rules (e.g., periodically). During the challenging user's movement, the mobile device carried by the challenged user will collect the real-time position (geographic coordinate position) of the challenged user through GNSS according to certain rules (e.g., periodically). In this case, the moving trajectory of the challenging user can be drawn as trajectory 1 based on the collected sequence of trajectory points during the challenging user's movement, and the moving trajectory of the challenged user can be drawn as trajectory 2 based on the collected sequence of trajectory points during the challenging user's movement.

[0062] For example, Figure 5 As shown, due to hardware limitations (such as inaccurate GPS positioning), when the challenging user and the challenged user exercise based on the same preset path, trajectory 1 and trajectory 2 do not completely overlap.

[0063] In the scenario where the mobile device displays the real-time rankings of two users, if the movement trajectories of the challenging user and the challenged user displayed on the mobile device deviate, the user will feel that the two users are not moving along the same path, which reduces the user experience.

[0064] In one example, if Figure 6 As shown in (a), the mobile phone 100 draws the movement tracks of the challenging user and the challenged user. Since the movement tracks of the challenging user and the challenged user do not completely overlap, the user will feel that the two users are not moving based on the same path.

[0065] In another example, Figure 6 As shown in (b), the mobile phone 100 draws the path track of the challenging user's current exercise process according to the movement track of the challenged user, and marks the real-time positions of the challenging user and the challenged user at each moment. Since the movement tracks of the challenging user and the challenged user do not completely overlap, the real-time position of the challenging user may not be on the preset path track, which will make the user feel that the two users are not exercising based on the same path.

[0066] The embodiment of the present application provides a moving trajectory fitting method, which can fit one moving trajectory to another moving trajectory. For example, the moving trajectory of the challenging user is fitted to the moving trajectory of the challenged user. In other words, the corresponding position of each trajectory point on the moving trajectory of the challenging user on the moving trajectory of the challenged user is obtained. The trajectory points on the moving trajectory of the challenging user are fitted to the corresponding positions on the moving trajectory of the challenged user.

[0067] For example, Figure 7 As shown, the mobile phone 100 draws the path track of this exercise process according to the moving track of the challenged user, and marks the position of the challenging user and the challenged user at each moment (the coordinate position of the track point on the map). At a certain moment, the challenging user's movement mileage is 3.50 kilometers, and the real-time position of the challenging user is position a. The moving track fitting method provided in the embodiment of the present application fits the position a to the position b on the moving track of the challenged user. In this way, the path track passed by the challenged user and the challenging user completely overlaps, and will not cause the user to misunderstand that the two users do not exercise based on the same path.

[0068] The mobile trajectory fitting method provided in the embodiment of the present application can be applied to any electronic device with computing capabilities. For example, the electronic device can be a mobile device. The above-mentioned mobile device can include a mobile phone, a wearable device (such as a smart watch, a smart bracelet, etc.), a tablet computer, a laptop computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a handheld computer, a netbook, a personal digital assistant (personal digital assistant, PDA), a vehicle-mounted device, a virtual reality device, etc., and the embodiment of the present application does not impose any restrictions on this.

[0069] For example, please refer to Figure 8 , which shows a schematic diagram of the structure of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, an audio module 130, a speaker 130A, a microphone 130B, a display screen 140, a communication module 150, a power module 160, an input device 170, a sensor module 180, and the like.

[0070] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0071] 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 graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110.

[0072] The controller is the nerve center and command center of the electronic device 100. It can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching and executing instructions.

[0073] The application processor can run the operating system of the electronic device 100, which is used to manage the hardware and software resources of the electronic device 100. For example, it manages and configures memory, determines the priority of system resource supply and demand, controls input and output devices, operates the network, manages the file system, manages drivers, etc. The operating system can also be used to provide an operating interface for users to interact with the system. Among them, various types of software can be installed in the operating system, such as drivers, applications (applications, Apps), etc.

[0074] NPU is a neural network (NN) computing processor, which can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. NPU can realize applications such as intelligent cognition of electronic device 100.

[0075] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0076] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc.

[0077] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0078] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0079] The internal memory 121 can be used to store one or more computer programs, which include instructions. The processor 110 can enable the electronic device 100 to execute the application running method provided in some embodiments of the present application, as well as various applications and data management, etc. by running the above instructions stored in the internal memory 121. The internal memory 121 may include a code storage area and a data storage area. Among them, the data storage area can store data created during the use of the electronic device 100, 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 one or more disk storage components, a flash memory component, a universal flash storage (universal flash storage, UFS), etc. In some embodiments, the processor 110 can enable the electronic device 100 to execute the application running method provided in the embodiment of the present application, as well as other applications and data management by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor 110.

[0080] The electronic device 100 can implement audio functions through the audio module 130, the speaker 130A, the microphone 130B, and the application processor, etc. For example, music playing, recording, etc. The audio module 130 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 130 can also be used to encode and decode audio signals. In some embodiments, the audio module 130 can be arranged in the processor 110, or some functional modules of the audio module 130 can be arranged in the processor 110.

[0081] The speaker 130A, also called a "horn", is used to convert audio electrical signals into sound signals.

[0082] The microphone 130B, also called a "microphone" or "speaker", is used to convert a sound signal into an electrical signal. A user can make a sound by approaching the microphone 130B with his or her mouth, and input the sound signal into the microphone 130B.

[0083] The communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2 and the communication module 150.

[0084] The communication module 150 can provide solutions for wireless communications including cellular, Wi-Fi, Bluetooth (BT), wireless data transmission modules (for example, 433MHz, 868MHz, 915MHz) applied to the electronic device 100. The communication module 150 can be one or more devices integrating at least one communication processing module. The communication module 150 receives electromagnetic waves via antenna 1 or antenna 2, filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 110. The communication module 150 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through antenna 1 or antenna 2. For example, the electronic device 100 can obtain the source database and the destination database through the communication module 150; wherein the source database is the database before data integration, and the destination database is the database after data integration. The data of the source database is extracted and integrated to form the destination database.

[0085] The electronic device 100 implements the display function through a GPU, a display screen 140, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0086] The display screen 140 is used to display images, videos, etc. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 140, where N is a positive integer greater than 1. In an embodiment of the present application, the display screen 140 can be used to display a UI and receive user operations on the UI. For example, the difference data between the source database and the destination database obtained by the method provided in the embodiment of the present application can be displayed on the display screen 140.

[0087] In some embodiments, the display screen 140 is provided with a pressure sensor, a touch sensor, and the like. The pressure sensor is used to sense pressure signals and can convert pressure signals into electrical signals. When a touch operation is applied to the display screen 140, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor. The touch sensor, also known as a "touch panel", can form a touch screen, also known as a "touch screen", with the display screen 140. The touch sensor is used to detect touch operations applied thereto or thereabout. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can also be provided through the display screen 140.

[0088] The power module 160 can be used to supply power to various components included in the electronic device 100. In some embodiments, the power module 160 can be a battery, such as a rechargeable battery.

[0089] The input device 170 may include a keyboard, a mouse, etc. The keyboard is used to input English letters, numbers, punctuation marks, etc. into the electronic device 100, thereby issuing commands to the electronic device 100, inputting data, etc. The mouse is an indicator for the vertical and horizontal coordinates of the display system of the electronic device 100, and is used to input instructions, etc. to the electronic device 100. Among them, the input device 170 can be connected to the electronic device 100 through a wired connection, for example, the input device 170 is connected to the electronic device 100 through a GPIO interface, a USB interface, etc. The input device 170 can also be connected to the electronic device 100 wirelessly, for example, the input device 170 is connected to the electronic device 100 through Bluetooth, infrared, etc.

[0090] The sensor module 180 may include a fingerprint sensor, a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0091] In conjunction with the accompanying drawings, the movement trajectory fitting method provided in the embodiment of the present application is described in detail below, taking the sports competition ranking function of a sports health App as an example.

[0092] Exemplary, reference Fig. 9 The mobile device 100 has a sports health app installed on it, which can provide a sports ranking function, for example, Figure 1-Figure 4 In one example, the App can provide a sports interface, a sports record interface, a dynamic track interface, etc. The sports interface is used to display the user interface during the user's exercise process; Figure 3The exercise record interface is used to display the relevant information of the user during the exercise after the user completes the exercise; for example, the exercise record interface is Figure 4 The dynamic track interface is used to display the dynamic movement track of the user during a movement; for example, the movement record interface is Figure 4 The interfaces shown in (b) and (c) of the App. The App also includes a data processing module and a fitting module. The data processing module is used to obtain and process trajectory point data, and the fitting module is used to fit trajectory points on a moving trajectory to another moving trajectory. The mobile device 100 also includes a database for storing data required for use during the execution of the moving trajectory fitting method provided in an embodiment of the present application and data generated, etc. In one implementation, the mobile device 100 can communicate with the server 200 via a wired or wireless manner. For example, the mobile device 100 can send trajectory point list data of a moving trajectory generated by a user's movement process to the server 200, and the mobile device 100 can also obtain from the server 200 data of any path trajectory stored by the server 200 or trajectory point list data of a moving trajectory generated by a user's movement process.

[0093] In one embodiment, in combination Fig. 9 , Fig.10 A schematic diagram of a flow chart of a moving trajectory fitting method provided in an embodiment of the present application is shown.

[0094] S301: The mobile device obtains the movement track data of the challenged user from the server.

[0095] The mobile device can determine a preset path according to the user operation, and both the challenging user and the challenged user move based on the preset path. Figure 2 , the information page 105 includes the path information of the path "Central Park East Gate-D1 South Gate", and the sports performance ranking of each user who exercises based on the path "Central Park East Gate-D1 South Gate". Among them, a "Challenge TA" button is displayed next to each user's sports performance. The user can choose to click a "Challenge TA" button to select the user corresponding to the "Challenge TA" button as the challenge object (challenged user). When the mobile device receives the user's click operation on a "Challenge TA" button on the information page 105, it determines that the path "Central Park East Gate-D1 South Gate" displayed on the information page 105 is a preset path. The user's click operation on a "Challenge TA" button on the information page 105 is also the user's selection operation on the challenged user.

[0096] Exemplarily, the mobile device receives a user's selection operation on the challenged user (eg, reference Figure 3, the user clicks a "Challenge TA" button), and the challenged user is determined according to the selection operation of the challenged user. After the mobile device determines the challenged user, it sends a first request to the server, requesting to obtain the movement trajectory data of the challenged user. The movement trajectory data is the data of all trajectory points contained in the movement trajectory. Exemplarily, the movement trajectory data can be a set of trajectory point sequences. The server sends a first response to the mobile device, and the first response includes the movement trajectory data of the challenged user. The mobile device can obtain the movement trajectory data of the challenged user according to the first response.

[0097] S302: The mobile device stores the movement trajectory data of the challenged user in a database.

[0098] S303: After the challenging user starts exercising, the data processing module obtains the movement trajectory data of the challenging user and the movement trajectory data of the challenged user in real time.

[0099] In one implementation, the mobile device obtains the user's motion state through a sensor, and after detecting that the challenging user has started to move, the real-time location of the challenging user is periodically collected. For example, the mobile device collects the user's real-time location once per second. In this way, the real-time movement trajectory data of the challenging user can be obtained.

[0100] For example, the user's real-time location is collected 1 second after the user starts exercising (X a 1. Y a 1); 2 seconds after the user starts exercising, the user's real-time location is collected as (X a 2. Y a 2); 3 seconds after the user starts exercising, the user's real-time location is collected as (X a 3. Y a 3), ...; the data processing module obtains the real-time moving trajectory data of the challenging user as (X a 1. Y a 1,1),(X a 2. Y a 2,2),(X a 3. Y a 3,3),…….

[0101] The data processing module can obtain the movement track data of the challenged user from the database. Exemplarily, the movement track data of the challenged user is (X b 1. Y b 1,1),(X b 2. Y b 2,2),(X b 3. Y b 3,3),……,(X b i,Y bi, i),…….

[0102] S304: The data processing module sends the movement trajectory data of the challenging user and the movement trajectory data of the challenged user to the fitting module.

[0103] S305 , the fitting module fits each trajectory point on the challenging user's movement trajectory to the challenged user's movement trajectory, and obtains the fitted challenging user's movement trajectory.

[0104] For example, the first data in the challenging user's movement trajectory data is (X a 1. Y a 1,1), indicating that the geographic coordinate position of the first track point is (X a 1. Y a 1). The fitting module fits the trajectory point to the first trajectory point in the challenged user's movement trajectory data. In this way, the first data in the challenging user's movement trajectory data is updated to (X b 1. Y b 1,1).

[0105] The second data in the challenge user's movement trajectory data is (X a 2. Y a 2,2), indicating that the geographic coordinate position of the second trajectory point is (X a 2. Y a 2). The fitting module fits the trajectory point to the second trajectory point in the challenged user's movement trajectory data. In this way, the second data in the challenging user's movement trajectory data is updated to (X b 2. Y b 2,2).

[0106] The third data in the challenge user's mobile trajectory data is (X a 3. Y a 3,3), indicating that the geographic coordinate position of the third track point is (X a 3. Y a 3). The fitting module fits the trajectory point to the second trajectory point in the challenged user's movement trajectory data. In this way, the third data in the challenging user's movement trajectory data is updated to (X b 2. Y b 2, 3).

[0107] The i-th data in the challenging user's mobile trajectory data is (X a i,Y a i, i), indicating that the geographical coordinate position of the i-th trajectory point is (X a i,Y ai). The fitting module fits the trajectory point to the i'th trajectory point in the challenged user's movement trajectory data. In this way, the i'th data in the challenging user's movement trajectory data is updated to (X b i',Y b i', i). Reference Figure 7 , the real-time location of the challenge user is location a, and the geographic coordinates of location a are (X a i,Y a i); After fitting, the real-time location of the challenging user is location b, and the geographic coordinate location of location b is (X b i',Y b i').

[0108] Similarly, the fitting module fits each trajectory point on the challenging user's movement trajectory to the challenged user's movement trajectory.

[0109] Furthermore, the fitting module may also send the fitted challenging user movement trajectory data to the data processing module.

[0110] S306: Displaying the movement trajectory of the challenged user and the fitted movement trajectory of the challenging user based on the comparison of the timestamps on the movement interface.

[0111] The motion interface displays the movement trajectory of the challenged user according to the movement trajectory data of the challenged user, and displays the movement trajectory of the challenging user according to the fitted movement trajectory data of the challenging user.

[0112] In one example, during the challenging user's exercise, at the i-th second of the challenging user's exercise, the challenging user's position on the map is displayed, and the corresponding geographic coordinate position is (X b i',Y b i'); Display the location of the challenged user on the map, the corresponding geographic coordinate location is (X b i,Y b i).

[0113] Exemplarily, the motion interface displays as follows Figure 3 The real-time information interface 106 shown in (b).

[0114] S307: When the exercise duration of the challenging user during this exercise is an integer multiple of M minutes, the movement trajectory data of the challenging user generated in the latest M minutes is saved in the database.

[0115] Optionally, M (M>0) minutes are pre-configured as a cycle, and the challenging user movement trajectory data is saved every M minutes. In this way, the challenging user movement trajectory data can be stored in segments, saving storage resources in the database.

[0116] S308. When the challenging user finishes the current exercise, the remaining unsaved moving trajectory data of the challenging user is saved to the database.

[0117] In this way, the mobile device obtains the movement track data of the challenging user's movement based on the preset path this time. Optionally, the mobile device can also send the movement track data of the challenging user's movement based on the preset path this time to the server for storage.

[0118] After the challenging user finishes the exercise, the user can view the dynamic trajectories of the challenging user and the challenged user displayed along the time dimension.

[0119] Exemplary, combined Fig. 9 and Fig.10 ,like Fig.11 As shown, the movement trajectory fitting method provided in the embodiment of the present application also includes:

[0120] S401: In response to a user's operation of viewing a sports record, a mobile device displays a sports record interface.

[0121] Exemplary, reference Figure 4 In response to the user clicking the “Road Segment Results” button, the mobile phone 100 displays the “Road Segment Results” page 107. The exercise record interface is the “Road Segment Results” page 107.

[0122] In one implementation, after receiving the user's operation of viewing the exercise record, the data processing module obtains the movement trajectory data of the challenging user during the exercise from the database; the data processing module also sends the movement trajectory data of the challenging user during the exercise to the exercise record interface. In this way, the exercise record interface can display the movement trajectory of the challenging user during the exercise.

[0123] S402: The mobile device receives an operation of viewing a dynamic track by a user on a sports record page.

[0124] Exemplary, reference Figure 4 The “Road Segment Results” page 107 includes information such as the user’s pace per kilometer and exercise duration during this exercise. The “Road Segment Results” page 107 includes a “Dynamic Track” button 108. The user can click the “Dynamic Track” button 108 to view the movement tracks of the challenging user and the challenged user, which are dynamically displayed according to the time dimension during the challenging user’s exercise.

[0125] S403: After receiving the user's operation of viewing the dynamic track, the mobile device enters the dynamic track interface.

[0126] Exemplary, reference Figure 4In response to the user clicking the “dynamic track” button 108 , the mobile phone 100 displays the dynamic track display page 109 .

[0127] S404: After entering the dynamic trajectory interface, the data processing module obtains the movement trajectory data of the challenged user.

[0128] In one implementation, if the mobile device has movement track data of the challenged user in the database, the data processing module obtains the movement track data of the challenged user from the database. If the mobile device does not have movement track data of the challenged user in the database, the mobile device sends a first request to the server, requesting to obtain the movement track data of the challenged user; the server sends a first response to the mobile device, the first response including the movement track data of the challenged user; the mobile device can obtain the movement track data of the challenged user according to the first response; the mobile device saves the movement track data of the challenged user in the database; the data processing module obtains the movement track data of the challenged user from the database.

[0129] S405: The data processing module sends the movement trajectory data of the challenging user and the movement trajectory data of the challenged user to the fitting module.

[0130] S406: The fitting module fits each trajectory point on the challenging user's movement trajectory to the challenged user's movement trajectory to obtain the fitted challenging user's movement trajectory.

[0131] Furthermore, the fitting module may also send the fitted challenging user movement trajectory data to the data processing module.

[0132] S407 , the dynamic trajectory interface displays the movement trajectory of the challenged user and the fitting movement trajectory of the challenging user according to the timestamp comparison.

[0133] The dynamic trajectory interface displays the movement trajectory of the challenged user according to the movement trajectory data of the challenged user, and displays the movement trajectory of the challenging user according to the fitted movement trajectory data of the challenging user.

[0134] In one example, based on the time dimension and according to the time stamps, the moving trajectory of the challenged user and the fitted moving trajectory of the challenging user are displayed for comparison. For example, the moving trajectory of the challenged user includes p trajectory points, and the fitted moving trajectory of the challenging user includes q trajectory points; p < q. At the 1st second, the 1st trajectory point in the moving trajectory of the challenged user is displayed, and the 1st trajectory point in the fitted moving trajectory of the challenging user is displayed; at the 2nd second, the 2nd trajectory point in the moving trajectory of the challenged user is displayed, and the 2nd trajectory point in the fitted moving trajectory of the challenging user is displayed;...; at the pth second, the pth trajectory point in the moving trajectory of the challenged user is displayed, and the pth trajectory point in the fitted moving trajectory of the challenging user is displayed; at the (p + 1)th second, the pth trajectory point in the moving trajectory of the challenged user is displayed, and the (p + 1)th trajectory point in the fitted moving trajectory of the challenging user is displayed;...; at the qth second, the pth trajectory point in the moving trajectory of the challenged user is displayed, and the qth trajectory point in the fitted moving trajectory of the challenging user is displayed.

[0135] Exemplarily, the dynamic trajectory interface displays the dynamic trajectory display page 109 as shown in Figure 4 (b) or (c) of the figure.

[0136] Next, a method for fitting each trajectory point on the moving trajectory of the challenging user to the moving trajectory of the challenged user in the embodiments of the present application will be introduced.

[0137] Exemplarily, as shown in Fig.12 the figure, the method may include:

[0138] S501. Obtain the moving trajectory data of the challenging user and the moving trajectory data of the challenged user.

[0139] In one example, the user's moving trajectory is represented as a sequence of trajectory points; where the i-th trajectory point is represented as Pi = (x, y, t); t is the time stamp, and (x, y, t) represents that the geographical coordinate position of the trajectory point Pi at the t-th moment (for example, the t-th second after the start of the movement) is (x, y), x represents the longitude value, and y represents the latitude value.

[0140] Optionally, in some other examples, the geographical coordinate position of the trajectory point may be represented as (x, y, z), where z represents the altitude value.

[0141] In one implementation, the user's moving trajectory data and the moving trajectory data of the challenged user may be preprocessed, such as denoising, interpolation, normalization, etc.

[0142] S502. Obtain a first coordinate sequence according to the moving trajectory data of the challenging user, and obtain a second coordinate sequence according to the moving trajectory data of the challenged user.

[0143] The first coordinate sequence is a sequence of geographical coordinate positions of each trajectory point on the challenging user's mobile trajectory, and the second coordinate sequence is a sequence of geographical coordinate positions of each trajectory point in the challenged user's mobile trajectory data. In the embodiment of the present application, the geographical coordinate positions are exemplified in the form of coordinate points.

[0144] For example, the challenge user movement trajectory data is (X a 1. Y a 1,1),(X a 2. Y a 2,2),(X a 3. Y a 3,3),……,(X a i,Y a i, i), ...; the geographical coordinate position of the first trajectory point is (X a 1. Y a 1), the geographic coordinate position of the second trajectory point is (X a 2. Y a 2), the geographic coordinate position of the third trajectory point is (X a 3. Y a 3), ..., the geographical coordinate position of the i-th trajectory point is (X a i,Y a i), ... The first coordinate sequence is (X a 1. Y a 1), (X a 2. Y a 2), (X a 3. Y a 3), ..., (X a i,Y a i),…….

[0145] The challenged user's movement trajectory data is (X b 1. Y b 1,1),(X b 2. Y b 2,2),(X b 3. Y b 3,3),……,(X b i,Y b i, i), ...; the geographical coordinate position of the first trajectory point is (X b 1. Y b 1), the geographic coordinate position of the second trajectory point is (X b 2. Y b 2), the geographic coordinate position of the third trajectory point is (X b 3. Y b 3), ..., the geographical coordinate position of the i-th trajectory point is (Xb i,Y b i), ... The second coordinate sequence is (X b 1. Y b 1), (X b 2. Y b 2), (X b 3. Y b 3), ..., (X b i,Y b i),…….

[0146] The geographic coordinates of a track point are (x, y), where x represents the longitude of the track point and y represents the latitude of the track point. Fig.13A As shown, on track 1, track point A is located at position a, the longitude value of position a is 22.573495, and the latitude value is 114.059827, so the geographic coordinate position of track point A is (22.573495, 114.059827). On track 2, track point B is located at position b, the longitude value of position b is 22.573492, and the latitude value is 114.059822, so the geographic coordinate position of track point B is (22.573492, 114.059822).

[0147] S503: Map each coordinate point in the first coordinate sequence to the second coordinate sequence to obtain a mapped first coordinate sequence.

[0148] In some embodiments, a dynamic time warping (DTW) algorithm may be used to map each coordinate point in the first coordinate sequence to the second coordinate sequence. DTW is a method for measuring the similarity between two time series and can automatically perform flexible matching on the time axis.

[0149] In an example, a method of mapping each coordinate point in the first coordinate sequence to the second coordinate sequence using the DTW algorithm may include:

[0150] S5031. Obtain a distance matrix according to the first coordinate sequence and the second coordinate sequence.

[0151] It should be noted that, for the convenience of description, in the following embodiments, the moving trajectory of the challenging user is trajectory 1, and the first coordinate sequence corresponding to trajectory 1 is: (0, 0), (1, 1), (2, 2), (3, 3); the moving trajectory of the challenged user is trajectory 2, and the second coordinate sequence corresponding to trajectory 2 is: (0, 0), (2, 1), (3, 2), (4, 3) as an example for introduction.

[0152] In one implementation, the Euclidean distance between every two coordinate points in the first coordinate sequence and the second coordinate sequence is calculated, or other distance measurement methods are used to calculate the distance between every two coordinate points in the first coordinate sequence and the second coordinate sequence; the distance between every two coordinate points in the first coordinate sequence and the second coordinate sequence constitutes a distance matrix. Wherein, the number of coordinate points in the first coordinate sequence is m, and the number of coordinate points in the second coordinate sequence is n, then the size of the distance matrix is ​​m×n.

[0153] The calculation formula of Euclidean distance is:

[0154] d(x,y)=sqrt((x1-x2)^2+(y1-y2)^2 formula ①;

[0155] Among them, sqrt means square root, and ^2 means square.

[0156] Exemplarily, according to the first coordinate sequence: (0, 0), (1, 1), (2, 2), (3, 3); the second coordinate sequence is: (0, 0), (2, 1), (3, 2), (4, 3); the corresponding distance matrix D is obtained as follows:

[0157]

[0158] S5032. According to the distance matrix D, use dynamic programming to calculate the best path.

[0159] Dynamic programming is a general method for solving optimal solution problems, which can decompose the problem into a series of sub-problems and find the optimal solution starting from the simplest sub-problem. In the embodiment of the present application, it is necessary to obtain an optimal path, which defines the best match between trajectory 1 and trajectory 2.

[0160] In one example, a method for calculating the optimal path using dynamic programming is as follows:

[0161] Traverse the distance matrix D and use formula ② to calculate the cumulative distance of each matrix element from matrix element (1,1) to (m,n) to obtain the cumulative distance matrix C.

[0162] cumulative_distance(i,j)=distance(i,j)+min(cumulative_distance(i-1,j), cumulative_distance(i,j-1), cumulative_distance(i-1,j-1)) formula ②;

[0163] Among them, cumulative_distance represents cumulative distance, and distance represents distance.

[0164] Exemplarily, the cumulative distance matrix C calculated according to the above distance matrix D is:

[0165]

[0166] S5033. Backtrack to the best path.

[0167] The first step is to calculate the minimum cumulative distance path P according to formula ③.

[0168] P[i][j]=argmin{P[i-1][j-1],P[i-1][j],P[i][j-1]}+1Formula ③;

[0169] Where P[i][j] represents the end point of the minimum cumulative distance path from the first point in the first coordinate sequence to the (i, j)th point, and argmin represents the index of the minimum value. The boundary conditions are P[0][0] = 0, P[i][0] = i, and P[0][j] = j.

[0170] The second step is to calculate the mapping relationship M based on the minimum cumulative distance path P.

[0171] 1. Initialize an empty mapping relationship M.

[0172] 2. Starting from P[n-1][m-1], work backwards to P[0][0] according to the minimum index in formula ③.

[0173] 3. For each point (i, j), the mapping relationship M[i] is set to j, indicating that the j-th point in the second coordinate sequence is mapped to the i-th point in the first coordinate sequence.

[0174] Exemplarily, the value of the mapping relationship M is as follows:

[0175]

[0176] S5034. Map each coordinate point in the first coordinate sequence to the second coordinate sequence according to the mapping relationship M to obtain a mapped first coordinate sequence.

[0177] Exemplarily, the first coordinate sequence after mapping is (0, 0), (2, 1), (3, 2), (4, 3).

[0178] In this embodiment, the geographical coordinate position of the trajectory point A in the challenging user's mobile trajectory is traversed with the geographical coordinate position of each trajectory point in the challenged user's mobile trajectory to perform distance calculation, obtain a trajectory point (trajectory point B) on the challenged user's mobile trajectory that is closest to trajectory point A, and fit trajectory point A to trajectory point B. In this method, when the challenging user's mobile trajectory includes m trajectory points and the challenged user's mobile trajectory includes n trajectory points, the amount of calculation is m×n times; the algorithm complexity is o(n2).

[0179] In other embodiments, a proportional mapping method is used to map each coordinate point in the first coordinate sequence to the second coordinate sequence.

[0180] The following takes the mapping of coordinate point a in the first coordinate sequence (corresponding to trajectory point A in the moving trajectory of the challenging user) to the second coordinate sequence as an example for description.

[0181] S503a, obtaining the distance d1 that the challenging user travels from the first coordinate point in the first coordinate sequence (corresponding to the starting point of the challenging user's moving trajectory) to the coordinate point a.

[0182] S503b, obtain the total distance D.

[0183] During the challenging user's exercise, the challenging user's moving trajectory is the real-time moving trajectory generated during the challenging user's exercise. The challenging user has not yet completed this exercise, and the total distance D uses the total length D2 of the challenging user's moving trajectory. D2 is the distance that the user moves from the first coordinate point in the second coordinate sequence to the last coordinate point in the second coordinate sequence, that is, the distance that the challenged user moves from the starting point of the challenging user's moving trajectory to the end point of the challenging user's moving trajectory.

[0184] After the challenging user finishes the exercise, the challenging user movement trajectory is the movement trajectory generated after the challenging user completes the exercise process, and the total distance D uses the total length D1 of the challenging user movement trajectory. D1 is the distance that the user moves from the first coordinate point in the first coordinate sequence to the last coordinate point in the first coordinate sequence, that is, the distance that the challenging user moves from the starting point of the challenging user movement trajectory to the end point of the challenging user movement trajectory.

[0185] S503c, obtaining a proportional factor R, where the proportional factor R is the ratio of d1 to D.

[0186] In one implementation, R=d1 / D.

[0187] In the scenario where the user is challenged to exercise, R = d1 / D2.

[0188] In the scenario where the challenged user finishes exercising, R=d1 / D1.

[0189] S503d: Determine the distance d2 according to the proportional factor R and the total length D2 of the movement trajectory of the challenged user.

[0190] In one implementation, d2=R*D2. That is, the proportion of d1 to the total distance is equal to the proportion of d2 to the total distance; that is, d1 / D=d2 / D2.

[0191] In one example, in a scenario where the user is challenged to exercise, d2 = d1.

[0192] In one example, after the challenged user finishes exercising, d2=d1 / D1*D2.

[0193] S503e: Determine the coordinate point reached by the challenged user after traveling a distance d2 from the first coordinate point in the second coordinate sequence (corresponding to the starting point of the challenged user's moving trajectory) as coordinate point b. Coordinate point b corresponds to track point B in the challenged user's moving trajectory.

[0194] S503f, mapping coordinate point a to coordinate point b, that is, fitting track point A in the moving track of the challenging user to track point B in the moving track of the challenged user.

[0195] Exemplary, reference Fig. 13B , the moving trajectory of the challenging user is trajectory 1, and the moving trajectory of the challenged user is trajectory 2. The geographic coordinate position of trajectory point A on trajectory 1 is coordinate point a. The distance from the starting point of trajectory 1 to trajectory point A is d1, and the total length of trajectory 1 is D1. The total length of trajectory 2 is D2. It can be determined that d2 = d1 / D1*D2. After moving a distance d2 along trajectory 2 from the starting point of trajectory 2, it arrives at trajectory point B, and the geographic coordinate position of trajectory point B is coordinate point b. The ratio of the distance between trajectory point A and the starting point of trajectory 1 to the total length of trajectory 1 is equal to the ratio of the distance between trajectory point B and the starting point of trajectory 2 to the total length of trajectory 2.

[0196] By repeatedly executing S503a-S503f, each coordinate point in the first coordinate sequence can be mapped to the second coordinate sequence to obtain a mapped first coordinate sequence.

[0197] Exemplarily, the first coordinate sequence is (0, 0), (1, 1), (2, 2), (3, 3), and the second coordinate sequence is (0, 0), (1, 1), (2, 1), (3, 2), (4, 3), (5, 4), (6, 5). (0, 0) in the first coordinate sequence is mapped to (0, 0) in the second coordinate sequence; (1, 1) in the first coordinate sequence is mapped to (2, 1) in the second coordinate sequence; (2, 2) in the first coordinate sequence is mapped to (4, 3) in the second coordinate sequence; (3, 3) in the first coordinate sequence is mapped to (6, 5) in the second coordinate sequence. That is, the first coordinate sequence after mapping is (0, 0), (2, 1), (4, 3), (6, 5).

[0198] In this embodiment, a proportional mapping method is used to map each coordinate point in the first coordinate sequence to the second coordinate sequence. When the first coordinate sequence includes n coordinate points, the computational complexity is o(n). Compared with the method of using the DTW algorithm to map each coordinate point in the first coordinate sequence to the second coordinate sequence, the computational complexity is greatly reduced, and the amount of calculation is reduced.

[0199] S504: Obtain a fitted moving trajectory of the challenging user according to the mapped first coordinate sequence.

[0200] A corresponding timestamp is added to each coordinate point in the mapped first coordinate sequence to obtain the fitted moving trajectory of the challenging user.

[0201] Exemplarily, the challenge user's movement trajectory includes trajectory points (0, 0, 1), (1, 1, 2), (2, 2, 3), (3, 3, 4); the corresponding first coordinate sequence is (0, 0), (1, 1), (2, 2), (3, 3); the mapped first coordinate sequence is (0, 0), (2, 1), (4, 3), (6, 5); then the challenge user's movement trajectory after fitting includes trajectory points (0, 0, 1), (2, 1, 2), (4, 3, 3), (6, 5, 4).

[0202] The movement trajectory fitting method provided in the embodiment of the present application fits one movement trajectory to another movement trajectory. For example, the movement trajectory of the challenging user is fitted to the movement trajectory of the challenged user. In this way, the path trajectories of the challenged user and the challenging user completely overlap, and the user will not be misled into thinking that the two users are not moving based on the same path.

[0203] It should be noted that in the embodiments of the present application, the example of fitting the moving trajectory of the challenging user to the moving trajectory of the challenged user is introduced. In other embodiments, the moving trajectory of the challenged user may also be fitted to the moving trajectory of the challenging user. The specific implementation method can refer to the method of fitting the moving trajectory of the challenging user to the moving trajectory of the challenged user. The embodiments of the present application will not be repeated.

[0204] It is understandable that the electronic device (mobile device) provided in the embodiment of the present application includes a hardware structure and / or software module corresponding to each function in order to realize the above functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0205] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0206] In one example, see Fig.14 , which shows a possible structural diagram of the electronic device involved in the above embodiment. The electronic device 900 includes: a processing unit 910 and a storage unit 920.

[0207] The processing unit 910 is used to control and manage the actions of the electronic device 900. The storage unit 920 is used to store the program code and data of the electronic device 900. The processing unit 910 calls the program code stored in the storage unit 920 to execute each step in the above method embodiment.

[0208] Of course, the unit modules in the above-mentioned electronic device 900 include but are not limited to the above-mentioned processing unit 910 and storage unit 920. For example, the electronic device 900 may also include a display unit, a communication unit, a power supply unit, etc. The display unit is used to display the user interface of the electronic device 900. The communication unit is used for the electronic device 900 to communicate with other electronic devices; for example, the electronic device 900 receives the trajectory information and motion information of the path from other devices through the communication unit. The power supply unit is used to supply power to the electronic device 900.

[0209] The processing unit 910 may be a processor or a controller, such as a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The storage unit 920 may be a memory. The display unit may be a display screen, etc.

[0210] For example, the processing unit 910 is a processor (such as Figure 8 The processor 110 shown in FIG. 1 ), the storage unit 920 may be a memory (eg, Figure 8 The internal memory 121 shown in FIG. 1 ) and the display unit may be a display screen (such as Figure 8 The electronic device 900 provided in the embodiment of the present application can be Figure 8 The electronic device 100 shown in FIG. 1 is a schematic diagram of an embodiment of the present invention. The processor, memory, display screen, etc., can be connected together, for example, via a bus. The processor calls the program code stored in the memory to execute each step in the above method embodiment.

[0211] The present application also provides a chip system (eg, a system on a chip (SoC)), such as Fig.15As shown, the chip system includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1002 can be used to send signals to other devices (such as a processor 1001 or a touch screen of an electronic device). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send the instructions to the processor 1001. When the instructions are executed by the processor 1001, the electronic device can execute the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0212] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.

[0213] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step in the above method embodiment.

[0214] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0215] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0216] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0217] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0218] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0219] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A moving trajectory fitting method, applied to electronic equipment, characterized in that: The method comprises: The electronic device acquires data of a first movement trajectory and data of a second movement trajectory; the first movement trajectory and the second movement trajectory respectively include at least one trajectory point; each of the trajectory points is represented as a geographical coordinate position at time t, and the time t is a timestamp of the trajectory point; The electronic device acquires a first coordinate sequence according to the data of the first moving trajectory; the first coordinate sequence is a sequence composed of the geographical coordinate position of each trajectory point on the first moving trajectory; The electronic device acquires a second coordinate sequence according to the data of the second moving trajectory; the second coordinate sequence is a sequence composed of the geographical coordinate position of each trajectory point on the second moving trajectory; The electronic device maps the geographical coordinate position of each track point on the first moving track to the corresponding geographical coordinate position on the second moving track to obtain a mapped first coordinate sequence; The electronic device adds a corresponding timestamp to each geographic coordinate position in the mapped first coordinate sequence to obtain a fitted first movement trajectory; The electronic device compares and displays the fitted first movement trajectory and the second movement trajectory according to the timestamps of the trajectory points; The electronic device mapping the geographical coordinate position of each track point on the first moving track to the corresponding geographical coordinate position on the second moving track includes: The electronic device maps the geographical coordinate position of a first track point on the first moving track to the geographical coordinate position of a second track point on the second moving track; the first track point is any track point on the first moving track; Among them, the ratio of the distance traveled from the starting point of the second moving trajectory to the second trajectory point to the total length of the second moving trajectory is equal to the ratio of the distance traveled from the starting point of the first moving trajectory to the first trajectory point to the total length of the first moving trajectory; or, the ratio of the distance traveled from the starting point of the second moving trajectory to the second trajectory point to the total length of the second moving trajectory is equal to the ratio of the distance traveled from the starting point of the first moving trajectory to the first trajectory point to the total length of the second moving trajectory.

2. The method according to claim 1, characterized in that: The electronic device maps the geographical coordinate position of the first track point on the first moving track to the geographical coordinate position of the second track point on the second moving track, including: The electronic device acquires a first geographical coordinate position in the first coordinate sequence; the first geographical coordinate position is a geographical coordinate position of a first track point on the first moving track; The electronic device acquires the distance from the geographical coordinate position of the first track point in the first coordinate sequence to the first geographical coordinate position; The electronic device acquires a distance from a geographical coordinate position of a first track point in the first coordinate sequence to a geographical coordinate position of a last track point in the first coordinate sequence; The electronic device acquires a distance from the geographical coordinate position of the first track point in the second coordinate sequence to the geographical coordinate position of the last track point in the second coordinate sequence; Obtain the first distance length according to the following formula; d2=d1 / D1*D2; Wherein, d2 represents the first distance length, d1 represents the distance from the geographical coordinate position of the first track point in the first coordinate sequence to the first geographical coordinate position, D1 represents the distance from the geographical coordinate position of the first track point in the first coordinate sequence to the geographical coordinate position of the last track point in the first coordinate sequence, and D2 represents the distance from the geographical coordinate position of the first track point in the second coordinate sequence to the geographical coordinate position of the last track point in the second coordinate sequence; The electronic device obtains the geographic coordinate position of a second trajectory point on the second moving trajectory according to the first distance length; the geographic coordinate position of the second trajectory point is the geographic coordinate position reached after passing the first distance length from the first geographic coordinate position in the second coordinate sequence.

3. The method according to claim 1, characterized in that The electronic device maps the geographical coordinate position of the first track point on the first moving track to the geographical coordinate position of the second track point on the second moving track, including: The electronic device acquires a first geographical coordinate position in the first coordinate sequence; the first geographical coordinate position is a geographical coordinate position of a first track point on the first moving track; The electronic device acquires the distance from the geographical coordinate position of the first track point in the first coordinate sequence to the first geographical coordinate position; Obtain the first distance length according to the following formula; d2=d1; Wherein, d2 represents the first distance length, and d1 represents the distance from the geographical coordinate position of the first trajectory point in the first coordinate sequence to the first geographical coordinate position; The electronic device obtains the geographic coordinate position of a second trajectory point on the second moving trajectory according to the first distance length; the geographic coordinate position of the second trajectory point is the geographic coordinate position reached after passing the first distance length from the first geographic coordinate position in the second coordinate sequence.

4. The method according to any one of claims 1 to 3, characterized in that: The first movement trajectory and the second movement trajectory are generated by two users moving based on the same path.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The electronic device obtains data of the second movement trajectory from a server.

6. An electronic device, characterized in that: include: Processors, displays, and memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the method according to any one of claims 1 to 5.

7. A computer-readable storage medium, characterized in that: The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 5.