Trajectory correction method and device, electronic equipment and readable storage medium

By collecting geomagnetic data in user equipment, detecting the similarity of geomagnetic features, and combining it with graph optimization technology, the problem of inaccurate trajectory caused by satellite signal blockage is solved, and accurate trajectory correction is achieved in areas without road network information, which is applicable to a variety of motion scenarios.

CN119215394BActive Publication Date: 2026-01-27HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310776854.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2026-01-27
Estimated Expiration
2043-06-28

AI Technical Summary

Technical Problem

Existing technologies result in inaccurate user trajectory positioning in urban areas, canyons, and indoor spaces due to satellite signal obstruction and interference, and cannot accurately acquire user trajectories in areas without road network information.

Method used

By collecting users' historical geomagnetic data and detecting the similarity of geomagnetic features, the current user's trajectory is corrected using the target's historical trajectory. Combined with graph optimization technology, the trajectory is fused to improve trajectory accuracy.

Benefits of technology

Accurate correction of user trajectories was achieved in areas without satellite signal interference, making it suitable for scenarios with large attitude changes and improving the accuracy and reliability of trajectory correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119215394B_ABST
    Figure CN119215394B_ABST
Patent Text Reader

Abstract

The application provides a trajectory correction method and device, electronic equipment and a readable storage medium. The electronic equipment acquires a current user trajectory according to the position of the user collected in a preset time window. In the historical trajectory of the user, it is detected whether there is a target historical trajectory in a preset distance range of the current user trajectory. If yes, the magnetic similarity of the magnetic features of the current user trajectory and the target historical trajectory is acquired. When the magnetic similarity is greater than or equal to a magnetic similarity threshold, the current user trajectory is corrected according to the target historical trajectory. The electronic equipment does not need to establish a magnetic fingerprint database in advance, but collects magnetic data at any time in the process of daily movement of the user, so as to achieve immediate use. Moreover, the electronic equipment can acquire a target historical trajectory similar to the current user trajectory based on the magnetic features, and correct the current user trajectory by using the target historical trajectory, so as to improve the accuracy of the user trajectory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a trajectory correction method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] With increasing health and fitness awareness, electronic devices for exercise monitoring and recording are becoming increasingly popular. These devices record user trajectories, calculating not only distance and pace but also tracing movement paths and documenting the user's exercise journey. Currently, user trajectories can be obtained through Global Positioning System (GPS) or Pedestrian Dead Reckoning (PDR) algorithms. However, these methods rely on satellite signals for positioning, which are easily obstructed and interfered with in urban areas, canyons, and indoor spaces, leading to inaccurate trajectories.

[0003] Currently, user trajectories can be corrected using road network information, but in areas without road network information, user trajectories cannot be accurately obtained. Summary of the Invention

[0004] This application provides a trajectory correction method, apparatus, electronic device, and readable storage medium, which can obtain a target historical trajectory similar to the current user trajectory based on magnetic characteristics, and correct the current user trajectory using the target historical trajectory to obtain an accurate user trajectory.

[0005] Firstly, this application provides a trajectory correction method. The executing entity of this method can be an electronic device or a chip within an electronic device. The following embodiments use an electronic device as an example. In this method, the electronic device can obtain the current user trajectory based on the user's location collected within a preset time window. For example, the electronic device can connect the user's locations collected within the preset time window to obtain the current user trajectory. During the user's historical walking process, the electronic device can store the user's historical trajectory. After obtaining the current user trajectory, the electronic device can detect whether a target historical trajectory exists within the user's historical trajectory. The target historical trajectory is within a preset distance range of the current user trajectory.

[0006] When a target historical trajectory exists in a user's historical trajectory, the electronic device can obtain the geomagnetic similarity between the geomagnetic features of the current user's trajectory and the geomagnetic features of the target historical trajectory to detect whether the target historical trajectory is a trajectory similar to the current user's trajectory that the user has previously traversed. Specifically, when the geomagnetic similarity between the geomagnetic features of the current user's trajectory and the geomagnetic features of the target historical trajectory is greater than or equal to a geomagnetic similarity threshold, the electronic device can determine that the target historical trajectory is a trajectory similar to the current user's trajectory that the user has previously traversed, and the electronic device can correct the current user's trajectory based on the target historical trajectory.

[0007] It should be understood that when the target historical trajectory does not exist in the user's historical trajectory, the electronic device can slide a preset time window and obtain a new current user trajectory, and continue to use the method in the embodiments of this application to correct the new current user trajectory.

[0008] In this embodiment, the electronic device does not need to establish a geomagnetic fingerprint database in advance. Instead, it collects geomagnetic data at any time during the user's daily movement, making it available immediately. Furthermore, the electronic device can obtain a target historical trajectory similar to the current user's trajectory based on location and magnetic characteristics. The electronic device can use this target historical trajectory to correct the current user's trajectory, thereby improving the accuracy of the user's trajectory.

[0009] In one possible implementation, the electronic device can collect geomagnetic data, and the electronic device can obtain the geomagnetic characteristics of the current user trajectory based on the geomagnetic data collected within the preset time window.

[0010] For example, the geomagnetic data includes triaxial geomagnetic intensity values, and the geomagnetic feature is the geomagnetic intensity value obtained by vector summation of the triaxial geomagnetic intensity values.

[0011] In this embodiment, the geomagnetic intensity value obtained by vector summation of three-axis geomagnetic intensity values ​​is used instead of three-axis geomagnetic data. Furthermore, since the geomagnetic intensity value obtained by vector summation of three-axis geomagnetic intensity values ​​is scalar data rather than vector data, the geomagnetic features in this embodiment are not sensitive to posture and will not cause accuracy problems due to posture changes. Therefore, the trajectory correction method provided in this embodiment can be applied to running scenarios and scenarios with large posture changes.

[0012] In one possible implementation, the electronic device can detect whether a historical trajectory is contained within a preset distance range of the current location, where the current location is on the current user trajectory. For example, the current location could be the starting point, ending point, or intermediate point of the current user trajectory. If a historical trajectory is contained within the preset distance range of the current location, the electronic device can use the historical trajectory contained within that range as the target historical trajectory.

[0013] In one possible implementation, to improve the accuracy of target historical trajectory detection and avoid the problem that the length of historical trajectories within a preset distance range of the current location is too short, the electronic device can detect whether the preset distance range of the current location contains historical trajectories that meet preset conditions. Specifically, if the preset distance range of the current location contains historical trajectories that meet the preset conditions, the electronic device can use these historical trajectories, which are within the preset distance range of the current location and meet the preset conditions, as the target historical trajectory.

[0014] In one possible implementation, the preset condition includes at least one of the following: the historical trajectory contained within a preset distance range of the current location is greater than or equal to a preset length, and the number of locations contained in the historical trajectory within the preset distance range of the current location is greater than or equal to a preset number.

[0015] In this implementation, because the target historical trajectory is long enough or contains a large number of locations, it helps electronic devices accurately detect whether the target historical trajectory is a trajectory similar to the current user's trajectory that the user has previously traversed, thereby improving the accuracy of trajectory correction.

[0016] The following describes a method for an electronic device to obtain the geomagnetic similarity between the geomagnetic features of the current user's trajectory and the geomagnetic features of the target's historical trajectory:

[0017] First, the electronic device can obtain a first geomagnetic sequence based on the geomagnetic characteristics of the current user trajectory. It should be understood that during the user's movement, the electronic device can collect multiple geomagnetic data points, thereby obtaining multiple geomagnetic characteristics of the current user trajectory. Similarly, the electronic device can obtain a second geomagnetic sequence based on the geomagnetic characteristics of the target's historical trajectory. The electronic device can obtain the similarity between the first and second geomagnetic sequences, and use this similarity as the geomagnetic similarity score.

[0018] Secondly, before the electronic device obtains the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory, it can slide the preset time window to obtain multiple trajectory segments corresponding to the target historical trajectory. For example, the electronic device can start from the starting point of the target historical trajectory, and obtain one trajectory segment each time the preset time window is slid, thus the electronic device can obtain multiple trajectory segments corresponding to the target historical trajectory.

[0019] In this implementation, the electronic device can obtain a first geomagnetic sequence based on the geomagnetic characteristics of the current user trajectory, and obtain multiple second geomagnetic sequences based on the geomagnetic characteristics of each trajectory segment. The electronic device can obtain the similarity between the first geomagnetic sequence and each second geomagnetic sequence, and use the maximum similarity as the geomagnetic similarity.

[0020] In one possible implementation, the current user trajectory has multiple geomagnetic features, and the target historical trajectory also has multiple geomagnetic features. The electronic device can correct the current user trajectory based on the target historical trajectory in the following manner:

[0021] Firstly, the electronic device can employ a random sampling consensus algorithm, based on the chronological order of geomagnetic features, to retain matching geomagnetic features from the current user trajectory and the target historical trajectory, while discarding mismatched geomagnetic features. For the current user trajectory and the target historical trajectory after removing mismatched geomagnetic features, the electronic device can use graph optimization to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.

[0022] In this implementation, the electronic device can match each magnetic feature in the first magnetic sequence and the second magnetic sequence, delete magnetic features with low matching degree, and retain magnetic features with high matching degree. Based on the magnetic features with high matching degree, the electronic device can use graph optimization to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory, thereby improving the accuracy of the user trajectory.

[0023] Secondly, the target's historical trajectory consists of multiple lines.

[0024] The electronic device can obtain the weight of each target historical trajectory based on the accuracy of its position. The electronic device can then use graph optimization, combining the weights of each target historical trajectory with the current user trajectory, to correct the current user trajectory.

[0025] In some embodiments, the electronic device can obtain the reliability of a target's historical trajectory based on the accuracy of its position on the trajectory. The higher the reliability of the historical trajectory, the greater its weight.

[0026] In this embodiment, the more times a user walks on the same trajectory, the more the electronic device will continuously combine historical trajectories and the current trajectory to correct and merge the user trajectory, thus increasing the accuracy of the user trajectory.

[0027] In one possible implementation, after the electronic device corrects the current user trajectory based on the target's historical trajectory to obtain the corrected user trajectory, if the electronic device stores road network information for the corresponding location, it can further correct the corrected user trajectory based on this road network information to further improve the accuracy of the user trajectory. If the electronic device does not store road network information for the corresponding location, it can also further correct the corrected user trajectory based on the user's location with high accuracy, which can also improve the accuracy of the user trajectory.

[0028] Secondly, embodiments of this application provide a trajectory correction device, which may include a processing module.

[0029] The processing module is used to obtain the current user trajectory based on the user's location collected within a preset time window; detect whether there is a target historical trajectory in the user's historical trajectory, and the target historical trajectory is within a preset distance range of the current user trajectory; if so, obtain the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory; when the geomagnetic similarity is greater than or equal to a geomagnetic similarity threshold, correct the current user trajectory based on the target historical trajectory.

[0030] In one possible implementation, the trajectory correction device may include a geomagnetic module for acquiring geomagnetic data.

[0031] The processing module is also used to obtain the geomagnetic characteristics of the current user trajectory based on the geomagnetic data collected by the geomagnetic module within the preset time window.

[0032] In one possible implementation, the geomagnetic data includes triaxial geomagnetic intensity values, and the geomagnetic feature is the geomagnetic intensity value obtained by vector summation of the triaxial geomagnetic intensity values.

[0033] In one possible implementation, the processing module is specifically used to detect whether a historical trajectory is contained within a preset distance range of the current location, where the current location is on the current user's trajectory; if so, the historical trajectory contained within the preset distance range of the current location is taken as the target historical trajectory.

[0034] In one possible implementation, the processing module is specifically used to detect whether a historical trajectory that meets preset conditions is contained within a preset distance range of the current location, wherein the current location is on the current user trajectory; if so, the historical trajectory contained within the preset distance range of the current location and meeting the preset conditions is taken as the target historical trajectory.

[0035] In one possible implementation, the preset condition includes at least one of the following: the historical trajectory contained within a preset distance range of the current location is greater than or equal to a preset length, and the number of locations contained in the historical trajectory within the preset distance range of the current location is greater than or equal to a preset number.

[0036] In one possible implementation, the processing module is specifically configured to: obtain a first geomagnetic sequence based on the geomagnetic characteristics of the current user trajectory; obtain a second geomagnetic sequence based on the geomagnetic characteristics of the target historical trajectory; and obtain the similarity between the first geomagnetic sequence and the second geomagnetic sequence, and use the similarity between the first geomagnetic sequence and the second geomagnetic sequence as the geomagnetic similarity.

[0037] In one possible implementation, the processing module is further configured to slide the preset time window and obtain multiple trajectory segments corresponding to the target historical trajectory based on the target historical trajectory.

[0038] The processing module is specifically used to obtain a first geomagnetic sequence based on the geomagnetic characteristics of the current user trajectory, obtain multiple second geomagnetic sequences based on the geomagnetic characteristics of each trajectory segment, and obtain the similarity between the first geomagnetic sequence and each second geomagnetic sequence, and take the maximum similarity as the geomagnetic similarity.

[0039] In one possible implementation, the geomagnetic features of the current user trajectory are multiple, and the geomagnetic features of the target historical trajectory are multiple.

[0040] The processing module is specifically used to retain matching geomagnetic features and remove mismatched geomagnetic features from the geomagnetic features of the current user trajectory and the target historical trajectory, according to the chronological order of the geomagnetic features, using a random sampling consensus algorithm; and then, for the current user trajectory and the target historical trajectory after removing the mismatched geomagnetic features, a graph optimization method is used to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.

[0041] In one possible implementation, the target historical trajectory is multiple.

[0042] The processing module is specifically used to obtain the weight of each target historical trajectory based on the accuracy of the position on each target historical trajectory; and, based on the weight of each target historical trajectory, to fuse each target historical trajectory and the current user trajectory using graph optimization to correct the current user trajectory.

[0043] In one possible implementation, when road network information corresponding to the current location exists, the processing module is further configured to correct the corrected current user trajectory based on the road network information corresponding to the current location.

[0044] When there is no road network information corresponding to the current location, the processing module is also used to correct the current user trajectory based on the high-precision location of the user.

[0045] Thirdly, embodiments of this application provide an electronic device that may include a processor and a memory. The memory stores computer-executable program code, which includes instructions; when the processor executes the instructions, the instructions cause the electronic device to perform the method described in the first aspect.

[0046] Fourthly, embodiments of this application provide an electronic device, which may be the trajectory correction device of the second aspect or the electronic device described in the first aspect. The electronic device may include units, modules, or circuits for performing the methods provided in the first aspect.

[0047] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect above.

[0048] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect.

[0049] The beneficial effects of the various possible implementations of the second to sixth aspects mentioned above can be found in the beneficial effects of the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0050] Figure 1A This is a schematic diagram illustrating the correction of user trajectories based on road network information.

[0051] Figure 1B Another schematic diagram for correcting user trajectories based on road network information;

[0052] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0053] Figure 3This is a schematic diagram illustrating the user's location, geomagnetic features, and user trajectory as provided in an embodiment of this application.

[0054] Figure 4 A flowchart illustrating one embodiment of the trajectory correction method provided in this application;

[0055] Figure 5 A schematic diagram illustrating the acquisition of magnetic similarity provided in an embodiment of this application;

[0056] Figure 6A A schematic diagram of trajectory correction provided in an embodiment of this application;

[0057] Figure 6B A flowchart illustrating another embodiment of the trajectory correction method provided in this application;

[0058] Figure 6C Another schematic diagram illustrating trajectory correction provided in an embodiment of this application;

[0059] Figure 7 This is a schematic diagram of trajectory correction in a running scenario provided in an embodiment of this application;

[0060] Figure 8 A flowchart illustrating another embodiment of the trajectory correction method provided in this application;

[0061] Figure 9A A schematic diagram of trajectory correction based on road network information provided in an embodiment of this application;

[0062] Figure 9B A schematic diagram of a high-precision user position correction trajectory provided in an embodiment of this application;

[0063] Figure 10 A flowchart illustrating another embodiment of the trajectory correction method provided in this application;

[0064] Figure 11 This is another structural schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation

[0065] Since this application involves a trajectory correction method, for ease of understanding, the relevant terms and concepts involved in this application embodiment are introduced below:

[0066] Road network information: This includes information about multiple roads. In some embodiments, road information may include road name, road length, starting point location, ending point location, and the location of multiple points on the road. In some embodiments, road information may also include: number of lanes, direction of travel for each lane, and the location of multiple points on each lane.

[0067] The electronic devices in this application embodiment can be referred to as user equipment (UE), terminals, etc. For example, electronic devices can be mobile phones, portable Android devices (PADs), personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices, in-vehicle devices, or wearable devices; virtual reality (VR) terminal devices; augmented reality (AR) terminal devices; wireless terminals in industrial control; wireless terminals in smart homes, etc. This application embodiment does not specifically limit the form of the electronic devices. Wearable devices can be watches, wristbands, running beads, headphones, or other devices that can be worn on the user's body.

[0068] Currently, electronic devices can be equipped with positioning modules. These modules can acquire the user's location in real time and determine the user's trajectory based on that location. Alternatively, the electronic device can acquire the user's initial location using the positioning module, then use Pedestrian Dead Reckoning (PDR) algorithms to calculate the user's final location and determine the user's trajectory based on that location. Positioning modules can include, but are not limited to, Global Positioning System (GPS) modules and Global Navigation Satellite System (GNSS) modules. Current methods for acquiring user trajectories using electronic devices rely on satellite signals. However, satellite signals are easily blocked and interfered with in urban areas, canyons, and indoor spaces, leading to inaccurate positioning and consequently, inaccurate user trajectories.

[0069] To improve the accuracy of user trajectories, road network information can be used to correct them. For example, refer to... Figure 1A After acquiring the initial user trajectory 1 based on the positioning module, the electronic device can match the initial user trajectory 1 to the nearest road according to road network information, thus obtaining the corrected user trajectory 2. It should be understood that... Figure 1A The dashed lines in the diagram represent roads in the road network. For example, in the initial user trajectory 1 obtained by the electronic device through the positioning module, there is a trajectory deviation at position A. After correction using road network information, the user trajectory 2 at position A is consistent with the road.

[0070] However, in this method, it is impossible to correct the user's trajectory using road network information in areas without such information. Furthermore, if the user's location is inaccurate, correcting the trajectory using road network information may mistakenly place the user in the oncoming lane, resulting in low accuracy. For example, refer to... Figure 1B When a user walks in lane 1, the electronic device acquires the user's position as shown by the black dots. Some of the user's positions are biased towards the oncoming lane 2. When the electronic device corrects the user's trajectory using road network information, it will correct these positions to the oncoming lane 2, resulting in a correction deviation in the user's trajectory. Furthermore, this method of correcting the user's trajectory using road network information is suitable for outdoor scenarios with roads, but not for indoor scenarios, canyons, or other scenarios without roads.

[0071] Magnetic fields, as natural, readily available, and long-term stable parameters, possess inherent advantages in terms of availability, anti-interference capability, and autonomy. For example, regional magnetic field distortions caused by factors such as building steel reinforcement, surrounding electromagnetic devices, or man-made objects can be used as geomagnetic fingerprints to assist in positioning, and are applicable to indoor positioning scenarios.

[0072] Currently, in indoor scenarios, geomagnetic fingerprint data can be pre-collected at multiple locations within the room, and a geomagnetic fingerprint database can be constructed based on this data. When a user is indoors, their electronic devices can collect geomagnetic data and use the pre-built geomagnetic fingerprint database for positioning, obtaining the user's location. The electronic devices can then determine the user's trajectory based on this location. Because geomagnetic data differs at different locations, accurate positioning can be achieved using geomagnetic data. Furthermore, since geomagnetic data differs between lanes, positioning based on geomagnetic data can accurately identify which lane the user is in, avoiding the problem of correcting the user's trajectory to the oncoming lane when using road network information, resulting in high positioning accuracy.

[0073] However, this method requires the prior collection of indoor geomagnetic data and the pre-construction of a geomagnetic fingerprint database, resulting in high collection costs.

[0074] Currently, electronic devices can employ Simultaneous Localization and Mapping (SLAM) technology, eliminating the need for pre-built geomagnetic fingerprint databases. Instead, these databases are gradually built and optimized during the localization process. Based on this geomagnetic fingerprint database, electronic devices can determine the user's location and, consequently, their trajectory.

[0075] While this approach eliminates the need for pre-constructing a geomagnetic fingerprint database, it still requires its construction and optimization during the localization process, resulting in a complex algorithm. Furthermore, current geomagnetic SLAM technology uses three-axis geomagnetic data collected by electronic devices, including X-axis, Y-axis, and Z-axis data. When the electronic device uses this geomagnetic fingerprint database for localization, it needs to match the three-axis data. To improve accuracy, current geomagnetic SLAM technology is only suitable for stable movement and scenarios with minimal attitude changes, such as for robots. For scenarios involving running or significant attitude changes, the accuracy of localization using this geomagnetic SLAM technology is low due to the substantial variations in the three-axis geomagnetic data.

[0076] Considering that users' current exercise scenarios are mostly in high-rise residential areas, shopping malls, etc., and that users' walking trajectories are often repetitive in daily life—for example, users often take the same route home, their walking trajectories in the office are mostly the same, and their running routes are also mostly the same—this application provides a trajectory correction method. It does not require pre-constructing a geomagnetic fingerprint database. Instead, electronic devices collect geomagnetic data in the user's daily life. By matching geomagnetic data along the same trajectory and combining historical and current trajectories, the user's trajectory is corrected and fused to improve its accuracy. Furthermore, the more times a user walks along the same trajectory, the more the electronic device will continuously combine historical and current trajectories to correct and fuse the user's trajectory, resulting in higher accuracy.

[0077] It should be understood that because the trajectory correction method provided in this application requires geomagnetic data, the trajectory correction method provided in this application is applicable to areas with obvious geomagnetic characteristics, such as indoor spaces and urban canyons. In some embodiments, areas with obvious geomagnetic characteristics, such as indoor spaces and urban canyons, can be referred to as target areas.

[0078] Before introducing the trajectory correction method provided in the embodiments of this application, the structure of the electronic device is first described:

[0079] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. (Refer to...) Figure 2 The electronic device may include: a positioning module 21, a geomagnetic module 22, and a processing module 23.

[0080] The positioning module 21 is used to obtain the location of the electronic device. In some embodiments, the location of the electronic device can be used as the user's location.

[0081] In some embodiments, the positioning module 21 may include, but is not limited to, a GPS positioning module and a GNSS positioning module. In some embodiments, the method by which the positioning module 21 obtains the location of the electronic device may include, but is not limited to, the positioning module 21 directly using the location collected by the positioning module 21 as the location of the electronic device, or using the location collected by the positioning module 21 as the initial location and then calculating the user's location through PDR algorithms, etc., as can be referred to in the relevant descriptions in the prior art, and the embodiments of this application do not limit this.

[0082] The processing module 23 is used to obtain the user trajectory based on the location of the electronic device obtained by the positioning module 21.

[0083] The geomagnetic module 22 is used to collect geomagnetic data. In some embodiments, the geomagnetic data may include triaxial geomagnetic data, which may include triaxial geomagnetic intensity values.

[0084] The processing module 23 is also used to acquire geomagnetic features based on the geomagnetic data collected by the geomagnetic module 22. It should be understood that triaxial geomagnetic data can be viewed as vector data in three axes, while geomagnetic features can be viewed as scalar data obtained by summing the vector data in the three axes. In some embodiments, geomagnetic features can be viewed as the total amount of triaxial geomagnetic data, and geomagnetic features may include geomagnetic intensity.

[0085] In this embodiment, the total amount of three-axis geomagnetic data is used instead of the total amount of three-axis geomagnetic data. Since the total amount of three-axis geomagnetic data is scalar data rather than vector data, the geomagnetic features in this embodiment are not sensitive to posture and will not cause accuracy problems due to posture changes. Therefore, the trajectory correction method provided in this embodiment can be applied to running scenarios and scenarios with large posture changes.

[0086] In some embodiments, the processing module 23 can store the user's location, geomagnetic features, and user trajectory according to time.

[0087] For example, refer to Figure 3 Over a period of time, the processing module 23 can acquire multiple locations of the electronic device from the positioning module 21, such as... Figure 3 The black dots are shown in the image. Processing module 23 can connect these black dots to obtain the user's trajectory. Additionally, during this period, processing module 23 can also acquire multiple geomagnetic features based on the geomagnetic data collected by geomagnetic module 22, such as... Figure 3 As shown by the white dots in the image. Processing module 23 can store the user's location, geomagnetic features, and user trajectory according to time.

[0088] In some embodiments, the electronic device may collect the user's location and the period for collecting geomagnetic data may be the same or different.

[0089] Processing module 23 can match the current user trajectory with historical user trajectories, and perform geomagnetic feature matching on similar trajectories. Then, by combining historical and current user trajectories, it corrects the current user trajectory to obtain an accurate user trajectory. The steps performed by processing module 23 can be referred to... Figure 4 , Figure 6B , Figure 8 as well as Figure 10 The description in the illustrated embodiments, Figure 3 The steps performed by the electronic device can be viewed as the steps performed by the processing module 23.

[0090] The trajectory correction method provided in this application will be described below with reference to specific embodiments. These embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. It should be understood that the executing entity of the trajectory correction method provided in this application can be an electronic device, a chip in the electronic device, or a processing module 23. In some embodiments, when the executing entity is a chip in the electronic device, the processing module 23 can be disposed in the chip of the electronic device.

[0091] Figure 4 This is a schematic flowchart of one embodiment of the trajectory correction method provided in this application. (Refer to...) Figure 4 The trajectory correction method provided in this application embodiment may include:

[0092] S401, retrieve the current user trajectory within a preset time window.

[0093] Reference Figure 2 As described in the text, the electronic device can obtain the user's location in real time during the user's movement. In the embodiments of this application, the electronic device can obtain the current user trajectory within a preset time window based on the user's location within that preset time window. In the following embodiments, the current user trajectory within the preset time window can be simply referred to as the current user trajectory.

[0094] For example, an electronic device can connect the locations of users within a preset time window to obtain the current user trajectory. Alternatively, the electronic device can use interpolation to obtain the locations of more users within the preset time window, and then connect these more user locations to obtain a more accurate current user trajectory.

[0095] S402, In the user's historical trajectory, detect whether there is a target historical trajectory that is within a preset distance range of the current user's trajectory. If yes, execute S403; otherwise, slide the preset time window and return to execute S401.

[0096] During daily walking, electronic devices also acquire the user's location in real time and obtain the user's trajectory based on the location. In some embodiments, electronic devices can store user trajectories, and in this application embodiment, the user trajectories stored by the electronic device can be used as the user's historical trajectories.

[0097] In some embodiments, the preset distance range of the current user trajectory can be understood as the set of preset distance ranges for each location included in the current user trajectory. The locations included in the current user trajectory can be understood as the locations constituting the current user trajectory. In this embodiment, the electronic device can determine whether a target historical trajectory exists by detecting whether historical trajectories are included within the preset distance range of the current user trajectory.

[0098] In some embodiments, the preset distance range of the current user trajectory can be understood as the preset distance range of the current location. In some embodiments, the current location is on the current user trajectory, such as the starting position, ending position, or intermediate position of the current user trajectory. The electronic device can determine whether a target historical trajectory exists by detecting whether the preset distance range of the current location contains historical trajectories. For example, the preset distance range could be 2 meters.

[0099] Specifically, if a historical trajectory is included within a preset distance range of the current location, it can be determined that a target historical trajectory exists. A target historical trajectory is defined as a historical trajectory contained within the preset distance range of the current location. Conversely, if a historical trajectory is not included within the preset distance range of the current location, it can be determined that a target historical trajectory does not exist.

[0100] To improve the accuracy of target historical trajectory detection and avoid the problem of historical trajectories within a preset distance range of the current location being too short, in some embodiments, the electronic device can determine the existence of a target historical trajectory when historical trajectories meeting preset conditions are included within the preset distance range of the current location. In some embodiments, the preset conditions may be: a preset length, or the number of locations included in the historical trajectory being greater than or equal to a preset number.

[0101] In some embodiments, when a historical trajectory is contained within a preset distance range of the current location, the electronic device may continue to detect whether the length of the historical trajectory contained within the preset distance range of the current location is greater than or equal to a preset length. When the length of the historical trajectory contained within the preset distance range of the current location is greater than or equal to the preset length, it can be determined that a target historical trajectory exists, and the electronic device may use the historical trajectory contained within the preset distance range of the current location as the target historical trajectory.

[0102] In some embodiments, since the historical trajectory is obtained by connecting multiple locations via an electronic device, the historical trajectory may include multiple locations. When the historical trajectory is contained within a preset distance range of the current location, the electronic device can continue to detect whether the number of locations contained in the historical trajectory within the preset distance range of the current location is greater than or equal to a preset number. Specifically, when the number of locations contained in the historical trajectory within the preset distance range of the current location is greater than or equal to the preset number, it can be determined that a target historical trajectory exists, and the electronic device can use the historical trajectory within the preset distance range of the current location as the target historical trajectory.

[0103] In some embodiments, the electronic device may pre-store a trajectory similarity model. This model is used to obtain the similarity of trajectories and outputs information about target historical trajectories whose similarity is greater than or equal to a similarity threshold. In this embodiment, the electronic device can input the user's historical trajectory and the current user trajectory into the trajectory similarity model. The model can output information about target historical trajectories whose similarity to the current user trajectory is greater than or equal to a similarity threshold. In some embodiments, the information about the target historical trajectory may include the starting point and ending point of the target historical trajectory.

[0104] In some embodiments, when at least one historical trajectory exists, the target historical trajectory can be the entire historical trajectory or a portion of a historical trajectory.

[0105] In this embodiment, the electronic device acquires the target historical trajectory from the historical trajectory, essentially to determine the historical trajectory that the user has previously traversed that is the same trajectory as the current user's trajectory. Thus, the electronic device can correct the current user's trajectory based on the target historical trajectory belonging to the same path, thereby improving the accuracy of the user's trajectory. In other words, the electronic device can continuously correct the trajectory based on the user's repeated walking patterns to improve the accuracy of the user's trajectory.

[0106] In some embodiments, after the electronic device obtains the target historical trajectory from the historical trajectory, the following situations may also exist: such as the current user trajectory being in one lane, but the target historical trajectory being in the opposite lane, or the user trajectory being indoors, and the target historical trajectory being outdoors. In this embodiment, in order to accurately determine whether the user has indeed repeatedly walked along a historical trajectory similar to the current user trajectory during the user's historical walking process, the electronic device can also detect whether the target historical trajectory is indeed a similar trajectory that the user has repeatedly walked along based on geomagnetic characteristics. Accordingly, the electronic device can also execute S403-S406:

[0107] S403, obtain the geomagnetic features corresponding to the current user's trajectory.

[0108] Reference Figure 2 The relevant description states that during the user's movement, the electronic device can collect geomagnetic data in real time and obtain geomagnetic characteristics based on the geomagnetic data. The geomagnetic characteristics corresponding to the current user's trajectory can be understood as the geomagnetic characteristics acquired by the electronic device within a preset time window.

[0109] S404, obtain the geomagnetic similarity between the geomagnetic features corresponding to the current user's trajectory and the geomagnetic features corresponding to the target's historical trajectory.

[0110] It is understandable that electronic devices collect geomagnetic data in real time during daily walking and use this data to determine geomagnetic characteristics. (Refer to...) Figure 2 The relevant description is that since electronic devices can store the user's location, user trajectory, and geomagnetic features, the geomagnetic features corresponding to the target's historical trajectory can be understood as: the geomagnetic features collected by the electronic device during the collection period corresponding to the target's historical trajectory.

[0111] For example, if the target historical trajectory is obtained by connecting position 1 to position 10, the collection time period corresponding to the target historical trajectory is the time taken by the electronic device to collect data from position 1 to position 10. During this time period, the geomagnetic features collected by the electronic device can be used as the geomagnetic features corresponding to the target historical trajectory.

[0112] In this embodiment of the application, the electronic device can obtain the geomagnetic similarity between the geomagnetic features corresponding to the current user trajectory and the geomagnetic features corresponding to the target historical trajectory.

[0113] In some embodiments, an electronic device may pre-store a geomagnetic similarity model, which is used to obtain the similarity of geomagnetic features. In this embodiment, there may be multiple geomagnetic features corresponding to the current user trajectory and multiple geomagnetic features corresponding to the target historical trajectory. The electronic device may input multiple geomagnetic features corresponding to the current user trajectory and multiple geomagnetic features corresponding to the target historical trajectory into the geomagnetic similarity model, and the geomagnetic similarity model may output the geomagnetic similarity between the geomagnetic features corresponding to the current user trajectory and the geomagnetic features corresponding to the target historical trajectory.

[0114] In some embodiments, the geomagnetic features corresponding to the current user trajectory can be multiple, and the geomagnetic features corresponding to the target historical trajectory can also be multiple. The electronic device can obtain a first geomagnetic sequence based on the geomagnetic features corresponding to the current user trajectory. The first geomagnetic sequence includes multiple geomagnetic features arranged in chronological order of acquisition time. Similarly, the electronic device can obtain a second geomagnetic sequence based on the geomagnetic features corresponding to the current user trajectory. The second geomagnetic sequence includes multiple geomagnetic features arranged in chronological order of acquisition time.

[0115] The electronic device can obtain the similarity between a first geomagnetic sequence and a second geomagnetic sequence. This similarity can be used as the geomagnetic similarity between the geomagnetic features corresponding to the current user's trajectory and the geomagnetic features corresponding to the target's historical trajectory. Specifically, the electronic device can treat the first and second geomagnetic sequences as vectors to obtain their similarity. In some embodiments, the electronic device can use methods such as calculating Euclidean distance, Manhattan distance, or cosine similarity to obtain the similarity between the first and second geomagnetic sequences. This application does not limit the specific algorithm used.

[0116] In some embodiments, the electronic device can also slide a preset time window to acquire multiple trajectory segments based on the target historical trajectory. The electronic device can start from the starting point of the target historical trajectory, and acquire one trajectory segment with each slide of the preset time window. The electronic device can acquire the geomagnetic features corresponding to each trajectory segment. It should be understood that the number of geomagnetic features corresponding to each trajectory segment can be the same as the number of geomagnetic features corresponding to the current user trajectory.

[0117] In this embodiment, the electronic device can obtain a second geomagnetic sequence corresponding to each trajectory segment based on the geomagnetic features corresponding to each trajectory segment. The electronic device can obtain the similarity between the first geomagnetic sequence and each second geomagnetic sequence. In some embodiments, the electronic device can use the maximum similarity as the geomagnetic similarity, and use the trajectory segment to which the second geomagnetic sequence corresponding to the maximum similarity belongs as the target trajectory segment. This target trajectory segment can be the trajectory in the target historical trajectory that is most similar to the current user's trajectory.

[0118] For example, refer to Figure 5 The current user trajectory is trajectory 1. The electronic device is within a preset distance range of the current location and a target historical trajectory, such as trajectory 2, is determined to exist. Figure 5 The current position is represented by a black dot, and a preset distance range is represented by a circle. The electronic device can obtain the similarity between the first geomagnetic sequence corresponding to trajectory 1 and the second geomagnetic sequence corresponding to trajectory 2. In some embodiments, Figure 5 Taking the acquisition of multiple trajectory segments corresponding to trajectory 2 based on a preset time window as an example, the electronic device can acquire the similarity between the first geomagnetic sequence corresponding to trajectory 1 and the second geomagnetic sequence corresponding to each trajectory segment. It should be understood that... Figure 5 A rectangular frame represents a trajectory segment.

[0119] It should be understood that, since geomagnetic features can be regarded as scalar data after summing magnetic force vector data in three axes, rather than vector data, geomagnetic features are not sensitive to posture. Therefore, in the embodiments of this application, magnetic similarity is obtained based on geomagnetic features, and the accuracy of the obtained similarity will not be poor due to posture changes. It can be applied to scenarios with large posture changes, such as running.

[0120] S405: When the geomagnetic similarity is greater than or equal to the geomagnetic similarity threshold, the current user trajectory is corrected based on the target's historical trajectory.

[0121] In this embodiment of the application, when the geomagnetic similarity is greater than or equal to the geomagnetic similarity threshold, the electronic device can consider the target historical trajectory and the current user trajectory as repeated trajectories traversed by the user at different times, or it can consider the target historical trajectory and the current user trajectory as similar trajectories traversed by the user at different times. In some embodiments, when the electronic device acquires a target trajectory segment, it can consider the target trajectory segment and the current user trajectory as repeated trajectories traversed by the user at different times.

[0122] The following embodiments use the target's historical trajectory as an example to illustrate the process by which an electronic device corrects the current user's trajectory:

[0123] In some embodiments, the electronic device may use graph optimization to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.

[0124] For example, refer to Figure 6AThe current user trajectory is trajectory 1, and the target historical trajectory is trajectory 2. The electronic device can use graph optimization to merge trajectory 1 and trajectory 2 to obtain a corrected trajectory 1. Specifically, the electronic device can use graph optimization to cluster trajectory 1 and trajectory 2 in the same direction, such as clustering trajectory 1 downwards and trajectory 2 upwards, in order to merge trajectory 1 and trajectory 2 and obtain the corrected trajectory.

[0125] For example, the electronic device can select a point at preset intervals on trajectory 1 to obtain multiple points on trajectory 1, and select a point at preset intervals on trajectory 2 to obtain multiple points on trajectory 2. The electronic device can connect the corresponding points on trajectory 1 and trajectory 2 in the order of the points to obtain multiple connecting lines. The electronic device can connect the midpoints of the multiple connecting lines to obtain the corrected trajectory 1.

[0126] In some embodiments, when there are multiple target historical trajectories, the electronic device can determine the weight of each target historical trajectory based on its reliability. The electronic device can then use graph optimization to fuse the target historical trajectories and the current user trajectory, based on the weight of each target historical trajectory and the current user trajectory, to correct the current user trajectory. Specifically, the higher the reliability of the target historical trajectory, the greater its weight.

[0127] In some embodiments, the electronic device can obtain the reliability of a target's historical trajectory based on the accuracy of its position on that trajectory. The position on the historical trajectory can be understood as the location constituting that trajectory. The electronic device can determine the position accuracy based on parameters such as the carrier-to-noise density ratio (CN0), the dilution of precision (DOP), and the horizontal dilution of precision (HDOP). CN0 measures the ratio of the strength of the satellite signal received by the electronic device to noise and can be used to characterize the accuracy of the position obtained by the electronic device.

[0128] In some embodiments, the electronic device may use the average accuracy of the position on the target historical trajectory to represent the reliability of the target historical trajectory, wherein the greater the average accuracy of the position on the target historical trajectory, the greater the reliability of the target historical trajectory.

[0129] In some embodiments, in order to improve the accuracy of user trajectory correction, the electronic device can match each magnetic feature in the first magnetic sequence and the second magnetic sequence, delete magnetic features with low matching degree, and retain magnetic features with high matching degree. The electronic device can then use graph optimization to fuse the target historical trajectory and the current user trajectory based on the magnetic features with high matching degree to correct the current user trajectory.

[0130] The process of magnetic feature matching in electronic devices can be referred to as follows: Figure 6B :

[0131] S601, eliminate mismatched geomagnetic features.

[0132] In this embodiment, the first geomagnetic sequence may include multiple geomagnetic features, and the second geomagnetic sequence may include multiple geomagnetic features. Based on the chronological order of geomagnetic feature acquisition, the electronic device may employ a random sample consensus (RANSAC) algorithm to retain matching geomagnetic features in both the first and second geomagnetic sequences and discard mismatched geomagnetic features.

[0133] The RANSAC algorithm calculates a mathematical model from a set of sample data containing outliers to obtain valid sample data. The sample data can be understood as geomagnetic features in the first and second geomagnetic sequences, outliers as mismatched geomagnetic features in the first and second sequences, and valid sample data consists of matching geomagnetic features. For example, an electronic device can randomly select m groups of geomagnetic features acquired in the same order, and through continuous iteration and calculation, obtain a mathematical model with the maximum number of matching geomagnetic feature groups. For example, taking m as 3, the first geomagnetic sequence can be represented as {X1, X2, ..., XN}, and the second geomagnetic sequence can be represented as {Y1, Y2, ..., YN}. The electronic device can select three groups of geomagnetic features: X1 and Y1, X2 and Y2, and X3 and Y3. Through continuous iteration and calculation, a mathematical model is obtained to determine the matching and mismatched geomagnetic features in the first and second geomagnetic sequences. Electronic devices can retain matching geomagnetic features and discard mismatched geomagnetic features.

[0134] In some embodiments, the electronic device can also calculate the similarity of geomagnetic features acquired in the same order in the first and second geomagnetic sequences, based on the chronological order of their acquisition. For example, the first geomagnetic sequence can be represented as {X1, X2, ..., XN}, and the second geomagnetic sequence can be represented as {Y1, Y2, ..., YN}, where X1 and Y1 are the first geomagnetic features acquired in the sequence, and the electronic device can obtain the similarity between X1 and Y1. Similarly, the electronic device can also obtain the similarity between X2 and Y2, ..., and the similarity between XN and YN, thus obtaining N similarity scores. Among these N similarity scores, the electronic device can consider geomagnetic features with similarity scores greater than or equal to a similarity threshold as matching geomagnetic features, and geomagnetic features with similarity scores less than the threshold as unmatched geomagnetic features.

[0135] S602, geomagnetic map optimization matching.

[0136] For the current user trajectory and the target historical trajectory after removing mismatched geomagnetic features, electronic devices can use graph optimization to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.

[0137] For example, refer to Figure 6C In the context of 'a', the current user's trajectory is trajectory 1, and the target's historical trajectory is trajectory 2. For example, trajectory 1 can correspond to 10 magnetic features, and trajectory 2 can correspond to 10 magnetic features. Figure 6C In the diagram, 'a' represents magnetic features as white dots. Electronic devices can use the RANSAC algorithm to remove mismatched geomagnetic features. For example, an electronic device can remove three mismatched magnetic features from both the current user trajectory and the target historical trajectory. Figure 6C In the diagram, 'b' represents mismatched magnetic features as black dots. For trajectories 1 and 2 after removing mismatched geomagnetic features, the electronic device can use graph optimization to fuse trajectories 1 and 2, obtaining a corrected user trajectory as shown in trajectory 3. Figure 6C As shown in c in the figure.

[0138] For example, for the seven matched geomagnetic features, the electronic device can connect the corresponding positions of the geomagnetic features on trajectory 1 and trajectory 2 to obtain multiple connecting lines. The electronic device can then connect the midpoints of these multiple connecting lines to obtain the corrected trajectory 1.

[0139] S406, when the geomagnetic similarity is less than the geomagnetic similarity threshold, slide the preset time window and return to execute S401.

[0140] It should be understood that when the geomagnetic similarity is less than the geomagnetic similarity threshold, the electronic device can determine that the target historical trajectory is not the same trajectory as the current user trajectory. Therefore, the electronic device does not use the target historical trajectory to correct the current user trajectory. In this embodiment, when the geomagnetic similarity is less than the geomagnetic similarity threshold, the electronic device can slide a preset time window and return to execute S401.

[0141] It should be understood that electronic devices can continuously perform actions due to the user's constant movement. Figure 4 The steps in the illustrated embodiment involve sliding a preset time window to continuously correct the user's trajectory.

[0142] Taking a user running scenario as an example, if a user frequently runs along the roads in their residential community, their running trajectory will repeat this route multiple times. During the current user's run, electronic devices can perform... Figure 4 The steps shown correct the current user trajectory based on the target historical trajectory to improve the accuracy of the user trajectory. The target historical trajectory could be the user's previous running trajectory along the community road, or the user's previous lap running trajectory along the community road. In this embodiment, for magnetic features, the electronic device can collect and use them immediately without pre-building and optimizing a geomagnetic fingerprint database, and the calculation method is simple.

[0143] For example, refer to Figure 7 Taking a user running scenario as an example, the current user trajectory is trajectory 1, and the target historical trajectory is trajectory 2. After the electronic device corrects trajectory 1 based on trajectory 2, it obtains the corrected trajectory 1. Figure 7 The operation is represented by a rectangle, trajectory 1 by a solid line, trajectory 2 by a dashed line, and the corrected trajectory 1 by a dotted line. It can be understood that as the number of times a user runs increases, the user's trajectory becomes increasingly accurate because the electronic device continuously corrects the current user's trajectory based on the target's historical trajectory.

[0144] In this embodiment, the electronic device does not need to pre-establish or optimize a geomagnetic fingerprint database. Instead, it collects geomagnetic data as the user moves daily, enabling immediate use. Specifically, the electronic device can, based on the current user trajectory and its magnetic characteristics, obtain a target historical trajectory that matches the current user's trajectory from the user's historical records. The electronic device can then use this target historical trajectory to correct the current user trajectory, thereby improving its accuracy.

[0145] In some embodiments, after an electronic device corrects the current user trajectory based on a target historical trajectory to obtain a corrected user trajectory, if the electronic device stores road network information for the corresponding location, the electronic device can further correct the corrected user trajectory based on the road network information to further improve the accuracy of the user trajectory. If the electronic device does not store road network information for the corresponding location, the electronic device can also further correct the corrected user trajectory based on the location of a user with high accuracy, which can also improve the accuracy of the user trajectory.

[0146] Reference Figure 8 The trajectory correction method provided in this application embodiment may further include S801-S802.

[0147] In some embodiments, after executing S405, the electronic device may also execute S801-S802:

[0148] S801, when road network information corresponding to the current location exists, the user trajectory is corrected based on the road network information corresponding to the current location.

[0149] Electronic devices can store road network information, or servers can store road network information, and electronic devices can retrieve road network information from servers. Taking an electronic device that stores road network information as an example, the electronic device can determine whether road network information corresponding to its current location exists in the road network information based on its current location.

[0150] Because road network information can include the locations of multiple points on a road, in some embodiments, an electronic device can determine whether road network information corresponding to the current location exists in the road network information by detecting whether a location on a road is included within a preset range of the current location. Specifically, if a location on a road is included within the preset range of the current location, it can be determined that road network information corresponding to the current location exists in the road network information. If a location on a road is not included within the preset range of the current location, it can be determined that road network information corresponding to the current location does not exist in the road network information.

[0151] When road network information corresponding to the current location exists, the electronic device can correct the user's trajectory based on this information. For example, the electronic device can match the current user's trajectory to a road in the road network information to correct the trajectory.

[0152] For example, Figure 9A In this context, 'a' represents the current user's trajectory, such as trajectory 1. Figure 9A In this embodiment, 'b' represents trajectory 1 corrected based on the target's historical trajectory. When road network information corresponding to the current location exists, the electronic device can match the corrected trajectory 1 to a road in the road network information based on this information, such as... Figure 9AAs shown in c in the figure.

[0153] In this embodiment of the application, since the road network information is an accurate trajectory collected in advance, when the electronic device contains the road network information corresponding to the current location, the electronic device can match the corrected user trajectory to the road in the road network information according to the road network information corresponding to the current location, and thus obtain an accurate user trajectory.

[0154] S802: When there is no road network information corresponding to the current location, the user trajectory is corrected based on the high-precision user location.

[0155] In some embodiments, when the electronic device does not store road network information corresponding to the current location, or when the server does not store road network information corresponding to the current location, the electronic device cannot correct the corrected user trajectory based on the road network information. However, if the electronic device collects a high-precision user location, the electronic device can correct the corrected user trajectory based on that high-precision user location.

[0156] It should be understood that, as a user walks, electronic devices can collect the user's location to obtain the current user trajectory. The current user trajectory, after correction based on the target historical trajectory, may deviate from the current user trajectory. However, if the user's location collected by the electronic device is a high-precision location, the electronic device can determine that the collected location is accurate. Therefore, it can correct the position in the corrected user trajectory to the corresponding location.

[0157] In some embodiments, the electronic device can determine the accuracy of the user's location based on parameters such as CN0, DOP, and HDOP of the collected location data, thereby determining a high-precision user location. For example, taking CN0 and HDOP as examples, in a cell scenario, if CN0 is between 22-23 dB-Hz and HDOP is less than 4, the user's location can be considered a high-precision location.

[0158] For example, Figure 9B In this context, 'a' represents the current user's trajectory, such as trajectory 1. Figure 9B In this embodiment, 'b' represents trajectory 1 corrected based on the target's historical trajectory. In this application, the electronic device does not include road network information corresponding to the current location, but it can correct the corrected trajectory 1 based on high-precision location. For example, if the electronic device collects high-precision locations A and B, it can correct the corresponding location on the corrected trajectory 1 to locations A and B, such as... Figure 9B As shown in c in the figure.

[0159] It is understandable that when the electronic device does not store the road network information corresponding to the current location, or the server does not store the road network information corresponding to the current location, and the electronic device does not collect the user's high-precision location, the electronic device may not correct the corrected user trajectory.

[0160] In this embodiment, after correcting the current user trajectory based on the target historical trajectory, the electronic device can further correct the user trajectory based on the road network information corresponding to the current location or the high-precision user location. Because the road network information corresponding to the current location or the high-precision user location contains accurate location information, the accuracy of the user trajectory can be further improved.

[0161] The following is combined with Figure 10 The trajectory correction method provided in the embodiments of this application is described in detail for electronic devices:

[0162] In some embodiments, refer to Figure 10 The trajectory correction method provided in this application embodiment may include:

[0163] S1001 collects geomagnetic data and the user's location.

[0164] S1002: Obtain the current user trajectory based on the user's location within a preset time window.

[0165] S1003, corrects geomagnetic data.

[0166] S1004, obtain geomagnetic characteristics based on magnetic data.

[0167] S1005 corresponds to the storage of magnetic characteristics, user location, and user trajectory.

[0168] S1006, Detect whether the target historical trajectory exists in the user's historical trajectory. If yes, proceed to S1007; otherwise, slide the preset time window and return to S1001.

[0169] It should be understood that, taking a sports scenario as an example, a user's historical trajectory can be understood as: the trajectory that the user has walked during the current sports activity, or the user's trajectory during the historical sports activities.

[0170] S1001-S1006 can be referred to the descriptions in S401-S403.

[0171] S1007, Geomagnetic loop detection. If successful, execute S1008; if unsuccessful, slide the preset time window and return to execute S1001.

[0172] Geomagnetic loop detection can be understood as: detecting the geomagnetic similarity between the geomagnetic features corresponding to the target's historical trajectory and the geomagnetic features corresponding to the current user's trajectory, and whether this similarity is greater than or equal to a geomagnetic similarity threshold. When the geomagnetic similarity is greater than or equal to the threshold, it indicates successful geomagnetic loop detection, meaning the electronic device can consider the target's historical trajectory and the current user's trajectory as similar trajectories traversed by the user at different times. When the geomagnetic similarity is less than the threshold, it indicates that geomagnetic loop detection has failed, meaning the electronic device can determine that there is no trajectory in the historical trajectory similar to the current user's trajectory.

[0173] S1008, remove mismatched geomagnetic features.

[0174] S1009, geomagnetic map optimization matching, to obtain the corrected user trajectory.

[0175] S1008-S1009 can be referred to the descriptions in S601-S602.

[0176] S1010: When road network information corresponding to the current location exists, the user trajectory is corrected based on the road network information corresponding to the current location.

[0177] S1011, when there is no road network information corresponding to the current location, the corrected user trajectory is corrected based on the high-precision user location.

[0178] S1008-S1009 can be referred to the descriptions in S801-S802.

[0179] The trajectory correction method provided in this application has the same technical effect as that in the above embodiments, and can be referred to the relevant descriptions in the above embodiments.

[0180] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0181] In one embodiment, this application also provides an electronic device, referring to... Figure 11The electronic device may include a processor 1101 (e.g., CPU) and a memory 1102. The memory 1102 may include high-speed random-access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device. The memory 1102 may store various instructions for performing various processing functions and implementing the method steps of this application.

[0182] Optionally, the electronic device involved in this application may further include: a power supply 1103, a communication bus 1104, and a communication port 1105. The aforementioned communication port 1105 is used to enable communication between the electronic device and other peripherals. In this embodiment, the memory 1102 is used to store computer-executable program code, which includes instructions; when the processor 1101 executes the instructions, the instructions cause the processor 1101 of the electronic device to perform the actions described in the above method embodiment. The implementation principle and technical effects are similar and will not be repeated here.

[0183] It should be noted that the modules or components described in the above embodiments can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), etc. Furthermore, when a module is implemented through processing element scheduler code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors capable of calling program code, such as a controller. Additionally, these modules can be integrated together to implement a system-on-a-chip (SOC).

[0184] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).

[0185] The term "multiple" in this document refers to two or more. The term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the preceding and following related objects; in formulas, " / " indicates a "division" relationship. Additionally, it should be understood that in the description of this application, words such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.

[0186] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.

[0187] It is understood that, in the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

Claims

1. A trajectory correction method, characterized in that, include: Based on the user's location collected within a preset time window, obtain the current user's trajectory; In the user's historical trajectory, detect whether there is a target historical trajectory, which is within a preset distance range of the current user's trajectory; If so, obtain the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory; When the geomagnetic similarity is greater than or equal to the geomagnetic similarity threshold, the current user trajectory is corrected based on the target historical trajectory.

2. The method according to claim 1, characterized in that, Before obtaining the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory, the method further includes: Based on the geomagnetic data collected within the preset time window, the geomagnetic characteristics of the current user's trajectory are obtained.

3. The method according to claim 2, characterized in that, The geomagnetic data includes triaxial geomagnetic intensity values, and the geomagnetic feature is the geomagnetic intensity value obtained by vector summation of the triaxial geomagnetic intensity values.

4. The method according to any one of claims 1-3, characterized in that, The detection of whether a target's historical trajectory exists includes: Detect whether the current location contains a historical trajectory within a preset distance range, wherein the current location is on the current user's trajectory; If so, the historical trajectory contained within the preset distance range of the current location will be used as the target historical trajectory.

5. The method according to any one of claims 1-3, characterized in that, The detection of whether a target's historical trajectory exists includes: Detect whether the current location contains a historical trajectory that meets preset conditions within a preset distance range, wherein the current location is on the current user's trajectory; If so, the historical trajectory that is included within the preset distance range of the current location and meets the preset conditions will be used as the target historical trajectory.

6. The method according to claim 5, characterized in that, The preset conditions include at least one of the following: the historical trajectory contained within a preset distance range of the current location is greater than or equal to a preset length, and the number of locations contained in the historical trajectory contained within the preset distance range of the current location is greater than or equal to a preset number.

7. The method according to any one of claims 1-3 and 6, characterized in that, The step of obtaining the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory includes: Based on the geomagnetic characteristics of the current user trajectory, obtain the first geomagnetic sequence; Based on the geomagnetic characteristics of the target's historical trajectory, a second geomagnetic sequence is obtained; Obtain the similarity between the first geomagnetic sequence and the second geomagnetic sequence; The similarity between the first geomagnetic sequence and the second geomagnetic sequence is used as the geomagnetic similarity.

8. The method according to any one of claims 1-3 and 6, characterized in that, Before obtaining the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory, the method further includes: By sliding the preset time window, multiple trajectory segments corresponding to the target historical trajectory are obtained based on the target historical trajectory; The step of obtaining the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory includes: Based on the geomagnetic characteristics of the current user trajectory, obtain the first geomagnetic sequence; Based on the geomagnetic characteristics of each trajectory segment, multiple second geomagnetic sequences are obtained; The similarity between the first geomagnetic sequence and each second geomagnetic sequence is obtained, and the maximum similarity is taken as the geomagnetic similarity.

9. The method according to any one of claims 1-3 and 6, characterized in that, The current user trajectory has multiple geomagnetic features, and the target historical trajectory has multiple geomagnetic features; The step of correcting the current user trajectory based on the target historical trajectory includes: Based on the chronological order of geomagnetic features, a random sampling consensus algorithm is used to retain matching geomagnetic features in the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory, and to remove mismatched geomagnetic features. For the current user trajectory and the target historical trajectory after removing mismatched geomagnetic features, a graph optimization method is used to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.

10. The method according to claim 9, characterized in that, The target historical trajectory consists of multiple lines. The method employing graph optimization fuses the target historical trajectories and the current user trajectory to correct the current user trajectory, including: The weight of each target's historical trajectory is obtained based on the accuracy of its position on each historical trajectory. Based on the weights of each target historical trajectory, a graph optimization approach is used to fuse each target historical trajectory and the current user trajectory to correct the current user trajectory.

11. The method according to claim 4, characterized in that, After correcting the current user trajectory, the method further includes: When road network information corresponding to the current location exists, the corrected current user trajectory is adjusted according to the road network information corresponding to the current location. When there is no road network information corresponding to the current location, the current user trajectory is corrected based on the high-precision location of the user.

12. A trajectory correction device, characterized in that, include: A module for performing the method as described in any one of claims 1-11.

13. An electronic device, characterized in that, include: Processor and memory; The memory stores computer instructions; The processor executes computer instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed, implement the method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Geomagnetic fingerprint matching algorithm-based indoor positioning method

    CN106092093A

  • Multimodal fusion based indoor self-positioning method and device

    CN106500690A