Trajectory correction method and apparatus, electronic device and readable storage medium
Through geomagnetic feature matching and similarity detection, the target historical trajectory is obtained for trajectory correction, which solves the problem of trajectory inaccuracy caused by satellite signal occlusion in the prior art, and improves the accuracy and applicability of the trajectory.
Patent Information
- Application Number
- PCT/CN2024/099779
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-28
- Filing Date
- 2024-06-18
- Publication Date
- 2025-01-02
AI Technical Summary
The prior art has inaccurate user trajectory obtained by GPS positioning in areas such as cities, canyons and indoors due to satellite signal occlusion and interference, especially in areas without road network information, which cannot accurately obtain user trajectory.
By collecting geomagnetic features, a target historical trajectory similar to the current user trajectory is obtained, and trajectory correction is performed based on geomagnetic similarity. There is no need to establish a geomagnetic fingerprint database in advance, and it is suitable for scenarios with large pose changes.
It improves the accuracy of user trajectory, is suitable for areas such as indoors and urban canyons, reduces dependence on road network information, and reduces acquisition costs and algorithm complexity.
Smart Images

Figure CN2024099779_02012025_PF_FP_ABST
Abstract
Description
Trajectory correction method, device, electronic device and readable storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 28, 2023, with application number 202310776854.8 and application name “Trajectory Correction Method, Device, Electronic Device and Readable Storage Medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of terminal technology, and in particular to a trajectory correction method, device, electronic device, and readable storage medium. Background Art
[0003] As users become more aware of their health and exercise, electronic devices used for exercise monitoring and recording are becoming increasingly popular. Electronic devices that record user trajectories can not only calculate the user's mileage and pace, but also retrace the user's path and record their progress. Currently, user trajectories can be obtained using the global positioning system (GPS) or the pedestrian dead reckoning (PDR) algorithm. However, these methods rely on satellite signals for positioning, and in cities, canyons, and indoor areas, where satellite signals are easily blocked and interfered with, resulting in inaccurate user trajectories.
[0004] Currently, user trajectories can be corrected with the help of road network information, but for areas without road network information, user trajectories cannot be accurately obtained.
[0005] Summary of the Invention
[0006] Embodiments of the present application provide a trajectory correction method, apparatus, electronic device, and readable storage medium. These methods can obtain historical trajectories of targets similar to the current user's trajectory based on magnetic characteristics, and use these historical trajectories to correct the current user's trajectory, thereby obtaining an accurate user trajectory.
[0007] In the first aspect, an embodiment of the present application provides a trajectory correction method, and the execution subject of the method can be an electronic device or a chip in an electronic device. The following embodiments are described by taking an electronic device as an example. In this method, the electronic device can obtain the current user trajectory based on the user's position collected within a preset time window. Exemplarily, the electronic device can connect the user's position collected within a preset time window to obtain the current user trajectory. When the user is in the historical walking process, the electronic device can store the user's historical trajectory. After obtaining the current user's trajectory, the electronic device can detect whether there is a target historical trajectory in the user's historical trajectory. Wherein, the target historical trajectory is within a preset distance range of the current user's trajectory.
[0008] When a target historical trajectory exists in a user's historical trajectory, the electronic device may obtain the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory to detect whether the target historical trajectory is a trajectory that the user has previously walked that is similar to the current user trajectory. When the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory is greater than or equal to a geomagnetic similarity threshold, the electronic device may determine that the target historical trajectory is a trajectory that the user has previously walked that is similar to the current user trajectory, and the electronic device may correct the current user trajectory based on the target historical trajectory.
[0009] It should be understood that when the target historical trajectory does not exist in the user's historical trajectory, the electronic device can slide the preset time window and obtain a new current user trajectory, and continue to use the method in the embodiment of the present application to correct the new current user trajectory.
[0010] In the embodiment of the present application, 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, so that it can be used immediately. The electronic device can obtain the target historical trajectory similar to the current user trajectory based on the location and magnetic characteristics. The electronic device uses the target historical trajectory to correct the current user trajectory, which can improve the accuracy of the user trajectory.
[0011] In a possible implementation, the electronic device may collect geomagnetic data, and the electronic device may obtain the geomagnetic characteristics of the current user trajectory based on the geomagnetic data collected within the preset time window.
[0012] Exemplarily, the geomagnetic data includes three-axis geomagnetic intensity values, and the geomagnetic feature is: the geomagnetic intensity value obtained by vector addition of the three-axis geomagnetic intensity values.
[0013] In the embodiment of the present application, because the geomagnetic intensity value obtained by vector addition of the three-axis geomagnetic intensity values is used instead of the three-axis geomagnetic data, and because the geomagnetic intensity value obtained by vector addition of the three-axis geomagnetic intensity values is scalar data instead of vector data, the geomagnetic characteristics in the embodiment of the present application are not sensitive to posture, and the problem of poor accuracy will not be caused by changes in posture. Therefore, the trajectory correction method provided in the embodiment of the present application can be applied to running scenarios and scenarios with large posture changes.
[0014] In one possible implementation, the electronic device can detect whether a historical track is included within a preset distance range of the current location, where the current location is on the current user's track. For example, the current location can be the starting location, ending location, or intermediate location in the current user's track. If a historical track is included within the preset distance range of the current location, the electronic device can use the historical track included within the preset distance range of the current location as the target historical track.
[0015] In one possible implementation, to improve the accuracy of detecting the target's historical trajectory and avoid the problem of historical trajectories within a preset distance range from the current location being too short, the electronic device can detect whether the preset distance range from the current location contains any historical trajectories that meet preset conditions. If the preset distance range from the current location contains any historical trajectories that meet the preset conditions, the electronic device can use the historical trajectories within the preset distance range from the current location that meet the preset conditions as the target historical trajectory.
[0016] In one possible implementation, the preset condition includes at least one of the following: the historical trajectory contained in the 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 in the preset distance range of the current location is greater than or equal to a preset number.
[0017] In this implementation, because the target historical trajectory is long enough or contains a large number of locations, it helps the electronic device accurately detect whether the target historical trajectory is a trajectory that the user has walked in the past and is similar to the current user trajectory, thereby improving the accuracy of trajectory correction.
[0018] The following describes a method for an electronic device to obtain the geomagnetic similarity between the geomagnetic characteristics of the current user trajectory and the geomagnetic characteristics of the target historical trajectory:
[0019] 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 when the user is moving, the electronic device can collect multiple geomagnetic data, and then obtain 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 historical trajectory. The electronic device can 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.
[0020] Second, before obtaining the geomagnetic similarity between the geomagnetic features of the current user's trajectory and the geomagnetic features of the target historical trajectory, the electronic device may slide the preset time window and, based on the target historical trajectory, obtain multiple trajectory segments corresponding to the target historical trajectory. For example, the electronic device may start from the starting point of the target historical trajectory and obtain a trajectory segment each time the preset time window is slid. In this way, the electronic device can obtain multiple trajectory segments corresponding to the target historical trajectory.
[0021] In this implementation, the electronic device may obtain a first geomagnetic sequence based on the geomagnetic characteristics of the current user's trajectory, and obtain multiple second geomagnetic sequences based on the geomagnetic characteristics of each trajectory segment. The electronic device may also obtain the similarity between the first geomagnetic sequence and each second geomagnetic sequence, and use the maximum similarity as the geomagnetic similarity.
[0022] In one possible implementation, the current user trajectory has multiple geomagnetic features, and the target historical trajectory has multiple geomagnetic features. The electronic device can use the following method to correct the current user trajectory based on the target historical trajectory:
[0023] First, the electronic device can use a random sampling consensus algorithm to retain matching geomagnetic features in the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory according to the chronological order of the geomagnetic features, and remove non-matching geomagnetic features. For the current user trajectory and the target historical trajectory after removing the non-matching geomagnetic features, the electronic device can use a graph optimization method to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.
[0024] In this implementation, the electronic device can match each magnetic feature in the first magnetic sequence and the second magnetic sequence, delete the magnetic features with low matching degrees, and retain the magnetic features with high matching degrees. Based on the magnetic features with high matching degrees, 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.
[0025] Second, there are multiple target historical trajectories.
[0026] The electronic device may obtain a weight for each target's historical trajectory based on the accuracy of the location on each target's historical trajectory. The electronic device may use a graph optimization approach to fuse each target's historical trajectory with the current user's trajectory based on the weight of each target's historical trajectory to correct the current user's trajectory.
[0027] In some embodiments, the electronic device may obtain the credibility of the target's historical trajectory based on the accuracy of the target's position on the historical trajectory, wherein the higher the credibility of the target's historical trajectory, the greater the weight of the target's historical trajectory.
[0028] In the embodiment of the present application, as the number of times a user walks on the same trajectory increases, the electronic device will continuously combine the historical trajectory and the current trajectory to correct and fuse the user trajectory, and the accuracy of the user trajectory will also increase.
[0029] In one possible implementation, after the electronic device corrects the current user trajectory based on the target's 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 further correct the corrected user trajectory based on the user's location with high accuracy to also improve the accuracy of the user trajectory.
[0030] In a second aspect, an embodiment of the present application provides a trajectory correction device, which may include a processing module.
[0031] The processing module is configured to obtain a current user trajectory based on the user's location collected within a preset time window; detect whether a target historical trajectory exists in the user's historical trajectory, and whether the target historical trajectory is within a preset distance range of the current user trajectory; if so, obtain the geomagnetic similarity between the geomagnetic characteristics of the current user trajectory and the geomagnetic characteristics of the target historical trajectory; and 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.
[0032] In a possible implementation, the trajectory correction device may include a geomagnetic module, which is used to collect geomagnetic data.
[0033] The processing module is further 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.
[0034] In a possible implementation, the geomagnetic data includes three-axis geomagnetic intensity values, and the geomagnetic feature is: a geomagnetic intensity value obtained by vector addition of the three-axis geomagnetic intensity values.
[0035] In one possible implementation, the processing module is specifically configured to detect whether a historical trajectory is included within a preset distance range of a current location, where the current location is on the current user trajectory; if so, the historical trajectory included within the preset distance range of the current location is used as the target historical trajectory.
[0036] In one possible implementation, the processing module is specifically configured to detect whether a historical trajectory meeting preset conditions is included within a preset distance range of a current location, where the current location is on the current user trajectory; if so, the historical trajectory included within the preset distance range of the current location and meeting the preset conditions is used as the target historical trajectory.
[0037] In one possible implementation, the preset condition includes at least one of the following: the historical trajectory contained in the 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 in the preset distance range of the current location is greater than or equal to a preset number.
[0038] In one possible implementation, the processing module is specifically used 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.
[0039] In a possible implementation, the processing module is further configured to slide the preset time window and obtain a plurality of trajectory segments corresponding to the target historical trajectory based on the target historical trajectory.
[0040] 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 use the maximum similarity as the geomagnetic similarity.
[0041] In a possible implementation, there are multiple geomagnetic features of the current user trajectory and multiple geomagnetic features of the target historical trajectory.
[0042] The processing module is specifically configured to retain matching geomagnetic features in the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory and remove non-matching geomagnetic features according to the chronological order of the geomagnetic features using a random sampling consensus algorithm; and for the current user trajectory and the target historical trajectory after removing the non-matching geomagnetic features, fuse the target historical trajectory and the current user trajectory using a graph optimization method to correct the current user trajectory.
[0043] In a possible implementation, there are multiple target history tracks.
[0044] The processing module is specifically configured to obtain a weight for each target historical trajectory based on the accuracy of the position on each target historical trajectory; and to fuse each target historical trajectory with the current user trajectory using a graph optimization method based on the weight of each target historical trajectory to correct the current user trajectory.
[0045] In a possible implementation, when there is road network information corresponding to the current location, the processing module is further configured to correct the corrected current user trajectory according to the road network information corresponding to the current location;
[0046] When there is no road network information corresponding to the current location, the processing module is further configured to correct the corrected current user trajectory according to the high-precision location of the user.
[0047] In a third aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory. The memory is configured to store computer-executable program code, the program code including instructions; when the processor executes the instructions, the instructions cause the electronic device to perform the method described in the first aspect.
[0048] In a fourth aspect, an embodiment of the present application provides an electronic device, which may be the trajectory correction device of the second aspect or the electronic device of the first aspect. The electronic device may include a unit, module, or circuit for executing the method provided in the first aspect above.
[0049] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method in the first aspect described above.
[0050] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enables the computer to execute the method in the first aspect above.
[0051] The beneficial effects of the possible implementation methods of the second to sixth aspects mentioned above can be referred to the beneficial effects brought about by the first aspect mentioned above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] FIG1A is a schematic diagram of correcting a user's trajectory based on road network information;
[0053] FIG1B is another schematic diagram of correcting a user's trajectory based on road network information;
[0054] FIG2 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0055] FIG3 is a schematic diagram of a user's location, geomagnetic characteristics, and user trajectory provided by an embodiment of the present application;
[0056] FIG4 is a flow chart of an embodiment of a trajectory correction method provided in an embodiment of the present application;
[0057] FIG5 is a schematic diagram of obtaining magnetic similarity according to an embodiment of the present application;
[0058] FIG6A is a schematic diagram of trajectory correction provided in an embodiment of the present application;
[0059] FIG6B is a flow chart of another embodiment of a trajectory correction method provided in an embodiment of the present application;
[0060] FIG6C is another schematic diagram of trajectory correction provided in an embodiment of the present application;
[0061] FIG7 is a schematic diagram of trajectory correction in a running scene provided by an embodiment of the present application;
[0062] FIG8 is a flow chart of another embodiment of a trajectory correction method provided in an embodiment of the present application;
[0063] FIG9A is a schematic diagram of a trajectory correction based on road network information provided in an embodiment of the present application;
[0064] FIG9B is a schematic diagram of a high-precision position correction trajectory of a user provided by an embodiment of the present application;
[0065] FIG10 is a flow chart of another embodiment of a trajectory correction method provided in an embodiment of the present application;
[0066] FIG11 is another schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] Since the embodiments of the present application involve a trajectory correction method, for ease of understanding, the following first introduces the relevant terms and concepts involved in the embodiments of the present application:
[0068] Road network information: includes information about multiple roads. In some embodiments, this road information may include the road name, road length, starting and ending points, and the locations of multiple points on the road. In some embodiments, this road information may also include the number of lanes, the direction of travel for each lane, and the locations of multiple points on each lane.
[0069] The electronic devices in the embodiments of the present application may be referred to as user equipment (UE), terminals, etc. For example, the electronic device may be a mobile phone, a portable Android device (PAD), a personal digital assistant (PDA), a handheld device with wireless communication capabilities, a computing device, a vehicle-mounted device, or a wearable device, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in a smart home, etc. The embodiments of the present application do not specifically limit the form of the electronic device. Wearable devices may include watches, bracelets, running beans, headphones, and other devices that can be worn on the user.
[0070] At present, a positioning module can be set in an electronic device, and the electronic device can obtain the user's position in real time through the positioning module, and obtain the user's trajectory based on the user's position. Alternatively, the electronic device can obtain the user's initial position through the positioning module, and then calculate the user's position through the pedestrian dead reckoning (PDR) algorithm, and obtain the user's trajectory based on the user's position. The positioning module may include but is not limited to: a global positioning system (GPS) positioning module, a global navigation satellite system (GNSS) positioning module, etc. In the current method for electronic devices to obtain user trajectories, it is necessary to use a positioning module to perform positioning with the help of satellite signals, but in areas such as cities, canyons, and indoors, satellite signals are easily shielded and interfered, resulting in inaccurate positioning, and therefore inaccurate user trajectories.
[0071] To improve the accuracy of user trajectories, the user trajectories can be corrected with the help of road network information. For example, referring to FIG1A , after the electronic device obtains the initial user trajectory 1 based on the positioning module, it can match the initial user trajectory 1 to the nearest road based on the road network information to obtain a corrected user trajectory 2. It should be understood that the dotted lines in FIG1A represent roads in the road network. For example, in the initial user trajectory 1 obtained by the electronic device through the positioning module, a trajectory offset occurs at position A. After the user trajectory 2 is corrected with the road network information, the trajectory at position A is consistent with the road.
[0072] However, in this method, for areas without road network information, it is impossible to correct the user trajectory with the help of road network information. In addition, if the user's position is inaccurate, then when correcting the user's trajectory with the help of road network information, the user's trajectory may be corrected to the opposite lane, resulting in a problem of low correction accuracy. For example, referring to Figure 1B, the user is walking on lane 1, and the user's position obtained by the electronic device is shown as a black dot. Some of the user's positions are biased towards the opposite lane 2. When the electronic device corrects the user's trajectory with the help of road network information, it will correct these positions to the opposite lane 2, and the user's trajectory will have a correction deviation. In addition, the method of correcting the user's trajectory with the help of road network information is applicable to scenes where there are roads outdoors, and is not applicable to scenes without roads such as indoors and canyons.
[0073] As a natural, readily available, and long-term stable parameter, magnetic fields offer inherent advantages in usability, anti-interference capabilities, and autonomy. For example, regional magnetic field distortions caused by factors such as building steel, surrounding electromagnetic devices, or man-made objects can serve as geomagnetic fingerprints to aid positioning, making them suitable for indoor positioning scenarios.
[0074] At present, in indoor scenarios, geomagnetic fingerprint data at multiple locations indoors can be collected in advance, and a geomagnetic fingerprint database can be constructed based on the geomagnetic fingerprint data at multiple locations indoors. When the user is indoors, the user's electronic device can collect geomagnetic data and use the pre-built geomagnetic fingerprint database for positioning to obtain the user's location. The electronic device can obtain the user's trajectory based on the user's location. Because the geomagnetic data at different locations is different, accurate positioning can be performed with the help of geomagnetic data. In addition, because the geomagnetic data of different lanes is different, positioning based on geomagnetic data can also accurately distinguish which lane the user is in, avoiding the problem of correcting the user's trajectory to the opposite lane when correcting the user's trajectory with the help of road network information, and the positioning accuracy is high.
[0075] However, in this method, it is necessary to collect indoor geomagnetic data in advance and build a geomagnetic fingerprint database in advance, which results in high collection costs.
[0076] Currently, electronic devices can use geomagnetic simultaneous localization and mapping (SLAM) technology. This eliminates the need to pre-build a geomagnetic fingerprint database. Instead, the database is gradually built and optimized during the positioning process. Based on this geomagnetic fingerprint database, electronic devices can locate the user and determine their location. Based on this location, they can also determine their trajectory.
[0077] In this way, although there is no need to pre-build a geomagnetic fingerprint database, it is still necessary to build and optimize the geomagnetic fingerprint database during the positioning process, and the algorithm is complex. In addition, in the current geomagnetic SLAM technology, the geomagnetic data collected by the electronic device includes three-axis geomagnetic data, and the three-axis geomagnetic data includes geomagnetic data of the X axis, geomagnetic data of the Y axis, and geomagnetic data of the Z axis. When the electronic device is positioned based on the geomagnetic fingerprint database, it is necessary to match the three-axis geomagnetic data. In order to improve the positioning accuracy, the current geomagnetic SLAM technology is only applicable to scenes with stable movement and small posture changes, such as the current geomagnetic SLAM technology is only applicable to robots. For scenes in running or scenes with large posture changes, because the three-axis geomagnetic data changes greatly, the accuracy of positioning based on the geomagnetic SLAM technology is low.
[0078] Taking into account that the current sports scenes of users are mostly high-rise residential areas, shopping malls, etc., and in daily life, the walking trajectories of users are mostly repeated, such as the route for users to go home is mostly the same, the walking trajectories of users in the office are mostly the same, and the routes of users when running are also mostly the same. Accordingly, the embodiment of the present application provides a trajectory correction method, which does not require the pre-construction of a geomagnetic fingerprint database. Instead, in the user's daily life, the electronic device collects geomagnetic data, and through the matching of geomagnetic data on the same trajectory, combines the historical trajectory and the current trajectory, corrects and fuses the user trajectory to improve the accuracy of the user trajectory. In addition, the more times the user walks on the same trajectory, the electronic device will continue to combine the historical trajectory and the current trajectory to correct and fuse the user trajectory, and the accuracy of the user trajectory will be higher.
[0079] It should be understood that because the trajectory correction method provided in the embodiments of the present application requires the use of geomagnetic data, the trajectory correction method provided in the embodiments of the present application is applicable to areas with obvious geomagnetic characteristics, such as indoor areas and urban canyons. In some embodiments, areas with obvious geomagnetic characteristics, such as indoor areas and urban canyons, can be referred to as target areas.
[0080] Before introducing the trajectory correction method provided by the embodiment of the present application, the structure of the electronic device is first introduced:
[0081] FIG2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Referring to FIG2 , the electronic device may include: a positioning module 21 , a geomagnetic module 22 , and a processing module 23 .
[0082] 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 location of the user.
[0083] 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 following: the positioning module 21 directly uses the location collected by the positioning module 21 as the location of the electronic device, or uses the location collected by the positioning module 21 as the initial location and then calculates the user's location using a PDR algorithm, etc. Reference may be made to relevant descriptions in the prior art, and the present application does not impose any limitations on this.
[0084] The processing module 23 is configured to obtain a user trajectory based on the position of the electronic device obtained by the positioning module 21 .
[0085] The geomagnetic module 22 is configured to collect geomagnetic data. In some embodiments, the geomagnetic data may include three-axis geomagnetic data, which may include three-axis geomagnetic intensity values.
[0086] The processing module 23 is further configured to obtain geomagnetic characteristics based on the geomagnetic data collected by the geomagnetic module 22. It should be understood that the three-axis geomagnetic data can be viewed as vector data in the three-axis directions, and the geomagnetic characteristics can be viewed as scalar data obtained by summing the vector data in the three-axis directions. In some embodiments, the geomagnetic characteristics can be viewed as the total amount of the three-axis geomagnetic data, and the geomagnetic characteristics can include geomagnetic intensity.
[0087] In the embodiment of the present application, because the total amount of three-axis geomagnetic data is used instead of three-axis geomagnetic data, and because the total amount of three-axis geomagnetic data is scalar data instead of vector data, the geomagnetic characteristics in the embodiment of the present application are not sensitive to posture, and will not cause poor accuracy due to changes in posture. Therefore, the trajectory correction method provided in the embodiment of the present application can be applied to running scenes and scenes with large posture changes.
[0088] In some embodiments, the processing module 23 may store the user's location, geomagnetic characteristics, and user trajectory in correspondence with each other according to time.
[0089] For example, referring to FIG3 , within a period of time, the processing module 23 can obtain multiple locations of the electronic device from the positioning module 21, as shown by the black dots in FIG3 . The processing module 23 can connect the black dots to obtain the user trajectory. In addition, during this period of time, the processing module 23 can also obtain multiple geomagnetic features based on the geomagnetic data collected by the geomagnetic module 22, as shown by the white dots in FIG3 . The processing module 23 can store the user's location, geomagnetic features, and user trajectory in correspondence with each other according to time.
[0090] In some embodiments, the periods for the electronic device to collect the user's location and to collect geomagnetic data may be the same or different.
[0091] The processing module 23 can match the current user trajectory with historical user trajectories and match geomagnetic features on similar trajectories. It then combines the historical user trajectories with the current user trajectory to correct the current user trajectory to obtain an accurate user trajectory. The steps performed by the processing module 23 can be described with reference to the embodiments shown in Figures 4, 6B, 8, and 10. The steps performed by the electronic device in Figure 3 can be considered as the steps performed by the processing module 23.
[0092] The trajectory correction method provided by the embodiments of the present application is described below in conjunction with specific embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be understood that the execution subject of the trajectory correction method provided by the embodiments of the present application can be an electronic device, a chip in an electronic device, or a processing module 23. In some embodiments, when the execution subject is a chip in an electronic device, the processing module 23 can be set in the chip in the electronic device.
[0093] FIG4 is a flow chart of an embodiment of a trajectory correction method provided by an embodiment of the present application. Referring to FIG4 , the trajectory correction method provided by an embodiment of the present application may include:
[0094] S401: Obtain the current user trajectory within a preset time window.
[0095] 2 , the electronic device can obtain the user's location in real time while the user is moving. In an embodiment of the present application, the electronic device can obtain the current user trajectory within a preset time window based on the user's location within the preset time window. In the following embodiments, the current user trajectory within the preset time window may be referred to as the current user trajectory.
[0096] For example, the electronic device may connect the positions of users within a preset time window to obtain the current user trajectory. For example, the electronic device may use an interpolation method to obtain the positions of more users within the preset time window based on the positions of users within the preset time window. The electronic device may connect the positions of more users to obtain a more accurate current user trajectory.
[0097] S402: Check whether the target historical track exists in the user's historical track, and whether the target historical track is within a preset distance range of the current user's track. If so, execute S403; if not, slide the preset time window and return to execute S401.
[0098] During the user's daily walking process, the electronic device will also obtain the user's location in real time, and obtain the user's trajectory based on the user's location. In some embodiments, the electronic device can store the user's trajectory, and in the embodiment of the present application, the user's trajectory stored by the electronic device can be used as the user's historical trajectory.
[0099] In some embodiments, the preset distance range of the current user's trajectory can be understood as the set of preset distance ranges for each location included in the current user's trajectory. The locations included in the current user's trajectory can be understood as the locations that constitute the current user's trajectory. In this embodiment, the electronic device can determine whether a target historical trajectory exists by detecting whether a historical trajectory is included within the preset distance range of the current user's trajectory.
[0100] In some embodiments, the preset distance range of the current user's trajectory can be understood as: a preset distance range of the current location. In some embodiments, the current location is on the current user's trajectory, for example, the current location can be the starting location, the ending location, or an intermediate location in the current user's trajectory. The electronic device can determine whether a target historical trajectory exists by detecting whether a historical trajectory is included within the preset distance range of the current location. For example, the preset distance range is 2 meters.
[0101] If a historical track is within a preset distance range of the current location, it can be determined that the target historical track exists. The target historical track is a historical track that is within a preset distance range of the current location. If a historical track is not within the preset distance range of the current location, it can be determined that the target historical track does not exist.
[0102] To improve the accuracy of detecting a target's historical trajectory and avoid issues where historical trajectories within a preset distance range from the current location are too short, in some embodiments, the electronic device may determine the presence of a target's historical trajectory when a historical trajectory meeting a preset condition is included within the preset distance range from the current location. In some embodiments, the preset condition may include, for example, a preset length, or a number of locations included in the historical trajectory being greater than or equal to a preset number.
[0103] In some embodiments, when a historical trajectory is included within a preset distance range of the current location, the electronic device may continue to detect whether the length of the historical trajectory included within the preset distance range of the current location is greater than or equal to the preset length. When the length of the historical trajectory included within the preset distance range of the current location is greater than or equal to the preset length, it may be determined that a target historical trajectory exists, and the electronic device may use the historical trajectory included within the preset distance range of the current location as the target historical trajectory.
[0104] In some embodiments, because a historical trajectory is obtained by connecting multiple locations by the electronic device, the historical trajectory may include multiple locations. When a historical trajectory is included within a preset distance range of the current location, the electronic device may continue to detect whether the number of locations included in the historical trajectory included within the preset distance range of the current location is greater than or equal to a preset number. When the number of locations included in the historical trajectory included within the preset distance range of the current location is greater than or equal to the preset number, it may be determined that a target historical trajectory exists, and the electronic device may use the historical trajectory included within the preset distance range of the current location as the target historical trajectory.
[0105] In some embodiments, a trajectory similarity model may be pre-stored in the electronic device. The trajectory similarity model is used to obtain trajectory similarity and output information about target historical trajectories whose similarity is greater than or equal to a similarity threshold. In embodiments of the present application, the electronic device may input the user's historical trajectory and the current user's trajectory into the trajectory similarity model. The trajectory similarity model may output information about target historical trajectories in the historical trajectory whose similarity to the current user's trajectory is greater than or equal to the similarity threshold. In some embodiments, the target historical trajectory information may include: the starting point and end point of the target historical trajectory, etc.
[0106] In some embodiments, when there is at least one historical track, the target historical track may be the entire historical track, or a portion of a historical track.
[0107] In the embodiment of the present application, the electronic device obtains the target historical trajectory from the historical trajectory in order to determine whether the historical trajectory of the user is the same as the current user's trajectory. In this way, the electronic device can correct the current user's trajectory based on the target historical trajectory belonging to the same trajectory to improve the accuracy of the user's trajectory. In other words, the electronic device can continuously make corrections based on the user's repeated walking trajectory to improve the accuracy of the user's trajectory.
[0108] In some embodiments, after the electronic device obtains the target historical trajectory from the historical trajectory, the following situations may occur: for example, the current user trajectory is in one lane, but the target historical trajectory is in the opposite lane, or the user trajectory is indoors, and the target historical trajectory is outdoors. In the embodiment of the present application, in order to accurately determine whether the user has repeated a historical trajectory similar to the current user trajectory during the historical walking process, the electronic device can also detect whether the target historical trajectory is actually a similar trajectory that the user has repeatedly walked based on the geomagnetic characteristics. Based on this, the electronic device can also execute S403-S406:
[0109] S403: Obtain the geomagnetic characteristics corresponding to the current user trajectory.
[0110] 2 , as the user moves, the electronic device can collect geomagnetic data in real time and obtain geomagnetic features based on the geomagnetic data. The geomagnetic features corresponding to the current user trajectory can be understood as the geomagnetic features obtained by the electronic device within a preset time window.
[0111] S404: Obtain the geomagnetic similarity between the geomagnetic features corresponding to the current user trajectory and the geomagnetic features corresponding to the target historical trajectory.
[0112] It is understandable that during a user's daily walking, the electronic device will also collect geomagnetic data in real time and obtain geomagnetic features based on the geomagnetic data. Referring to the relevant description in Figure 2, because the electronic device can store the user's location, user trajectory, and geomagnetic features, the geomagnetic features corresponding to the target historical trajectory can be understood as: the geomagnetic features collected by the electronic device during the collection period corresponding to the target historical trajectory.
[0113] 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 used by the electronic device to collect information from position 1 to position 10. During this period, the geomagnetic features collected by the electronic device can be used as the geomagnetic features corresponding to the target historical trajectory.
[0114] In an embodiment of the present application, the electronic device may obtain the geomagnetic similarity between the geomagnetic features corresponding to the current user trajectory and the geomagnetic features corresponding to the target historical trajectory.
[0115] In some embodiments, a geomagnetic similarity model may be pre-stored in the electronic device, and the geomagnetic similarity model is used to obtain the similarity of geomagnetic features. In an embodiment of the present application, there may be multiple geomagnetic features corresponding to the current user trajectory, and there may also be multiple geomagnetic features corresponding to the target historical trajectory. The electronic device may input the multiple geomagnetic features corresponding to the current user trajectory and the 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.
[0116] In some embodiments, there may be multiple geomagnetic features corresponding to the current user trajectory, and there may also be multiple geomagnetic features corresponding to the target historical trajectory. The electronic device may obtain a first geomagnetic sequence based on the geomagnetic features corresponding to the current user trajectory, where the first geomagnetic sequence includes multiple geomagnetic features arranged in chronological order of acquisition time. Similarly, the electronic device may obtain a second geomagnetic sequence based on the geomagnetic features corresponding to the current user trajectory, where the second geomagnetic sequence includes multiple geomagnetic features arranged in chronological order of acquisition time.
[0117] The electronic device can obtain the similarity between the first geomagnetic sequence and the second geomagnetic sequence, and the similarity between the first geomagnetic sequence and the second geomagnetic sequence can be used as the geomagnetic similarity between the geomagnetic features corresponding to the current user trajectory and the geomagnetic features corresponding to the target historical trajectory. Among them, the electronic device can regard the first geomagnetic sequence and the second geomagnetic sequence as vectors respectively to obtain the similarity between the first geomagnetic sequence and the second geomagnetic sequence. In some embodiments, the electronic device can obtain the similarity between the first geomagnetic sequence and the second geomagnetic sequence by calculating the Euclidean distance, the Manhattan distance, or the cosine of the angle. The embodiment of the present application does not limit the specific algorithm.
[0118] In some embodiments, the electronic device can also slide a preset time window to obtain multiple trajectory segments based on the target's historical trajectory. The electronic device can start from the starting point of the target's historical trajectory and obtain a trajectory segment each time the preset time window is slid. The electronic device can obtain 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's trajectory.
[0119] In this embodiment, the electronic device can obtain a second geomagnetic sequence corresponding to each trajectory segment based on the geomagnetic characteristics 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. The target trajectory segment can be used as the trajectory in the target historical trajectory that is most similar to the current user's trajectory.
[0120] Exemplarily, referring to Figure 5, the current user trajectory is trajectory 1, and the electronic device determines that there is a target historical trajectory, such as trajectory 2, within a preset distance range of the current position. In Figure 5, a black dot represents the current position, and a circle represents the preset distance range of the current position. 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 takes the acquisition of multiple trajectory segments corresponding to trajectory 2 based on a preset time window as an example, and the electronic device can obtain the first geomagnetic sequence corresponding to trajectory 1 and the similarity with the second geomagnetic sequence corresponding to each trajectory segment. It should be understood that in Figure 5, a trajectory segment is represented by a rectangular box.
[0121] It should be understood that because the geomagnetic characteristics can be regarded as scalar data obtained by adding the magnetic vector data in the three-axis directions, rather than vector data, the geomagnetic characteristics are not sensitive to posture. Therefore, in the embodiment of the present application, the magnetic similarity is obtained based on the geomagnetic characteristics, 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.
[0122] S405 , when the geomagnetic similarity is greater than or equal to the geomagnetic similarity threshold, correct the current user trajectory according to the target historical trajectory.
[0123] In an embodiment of the present application, when the geomagnetic similarity is greater than or equal to a geomagnetic similarity threshold, the electronic device may treat the target historical trajectory and the current user trajectory as repeated trajectories that the user has walked at different times, or may treat the target historical trajectory and the current user trajectory as similar trajectories that the user has walked at different times. In some embodiments, when the electronic device obtains a target trajectory segment, the electronic device may treat the target trajectory segment and the current user trajectory as repeated trajectories that the user has walked at different times.
[0124] The following embodiment uses the target historical trajectory as an example to illustrate the process of the electronic device correcting the current user trajectory:
[0125] In some embodiments, the electronic device may fuse the target historical trajectory and the current user trajectory in a graph optimization manner according to the target historical trajectory and the current user trajectory to correct the current user trajectory.
[0126] For example, referring to FIG6A , the current user trajectory is trajectory 1 and the target historical trajectory is trajectory 2. The electronic device can use a graph optimization method to fuse trajectory 1 and trajectory 2 to obtain a corrected trajectory 1. The electronic device can use a graph optimization method to converge trajectory 1 and trajectory 2 in the same direction, such as converge trajectory 1 downward and converge trajectory 2 upward, to fuse trajectory 1 and trajectory 2 to obtain a corrected trajectory.
[0127] For example, the electronic device may select a point at a predetermined distance on track 1 to obtain multiple points on track 1, and select a point at a predetermined distance on track 2 to obtain multiple points on track 2. The electronic device may connect the corresponding points on track 1 and track 2 in the order of the points to obtain multiple connecting lines. The electronic device may connect the midpoints of the multiple connecting lines to obtain a corrected track 1.
[0128] In some embodiments, when there are multiple target historical trajectories, the electronic device can determine a weight for each target historical trajectory based on the credibility of each target historical trajectory. The electronic device can use graph optimization to fuse the target historical trajectory 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. The higher the credibility of the target historical trajectory, the greater the weight of the target historical trajectory.
[0129] In some embodiments, the electronic device can obtain the credibility of the target historical trajectory based on the accuracy of the position on the target historical trajectory. The position on the target historical trajectory can be understood as the position constituting the target historical trajectory. The electronic device can determine the accuracy of the position based on parameters such as the carrier-to-noise density ratio (CN0), dilution of precision (DOP), and horizontal dilution of precision (HDOP). Among them, CN0 is a measure of the ratio of the strength of the satellite signal received by the electronic device to the noise, and can be used to characterize the accuracy of the position obtained by the electronic device.
[0130] In some embodiments, the electronic device may use the average value of the accuracy of the positions on the target historical trajectory to represent the credibility of the target historical trajectory, wherein a larger average value of the accuracy of the positions on the target historical trajectory indicates a greater credibility of the target historical trajectory.
[0131] In some embodiments, in order to improve the accuracy of correcting the user trajectory, the electronic device can match each magnetic feature in the first magnetic sequence and the second magnetic sequence, delete the magnetic features with low matching degrees, and retain the magnetic features with high matching degrees. The electronic device can use a graph optimization method based on the magnetic features with high matching degrees to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.
[0132] The process of the electronic device performing magnetic feature matching can be referred to FIG6B :
[0133] S601, remove unmatched geomagnetic features.
[0134] In an embodiment of the present application, the first geomagnetic sequence may include multiple geomagnetic features, and the second geomagnetic sequence may include multiple geomagnetic features. Based on the order in which the geomagnetic features were collected, the electronic device may use a random sample consensus (RANSAC) algorithm to retain matching geomagnetic features in the first geomagnetic sequence and the second geomagnetic sequence, and remove non-matching geomagnetic features.
[0135] The RANSAC algorithm calculates a mathematical model based on a set of sample data containing anomaly data to obtain valid sample data. Sample data can be understood as geomagnetic features in the first and second geomagnetic sequences, anomaly data can be understood as geomagnetic features that do not match between the first and second geomagnetic sequences, and valid sample data refers to matching geomagnetic features. For example, the electronic device can randomly select m groups of geomagnetic features with the same acquisition order, based on the order in which the geomagnetic features were acquired. Through continuous iteration and calculation, the mathematical model is obtained, which maximizes the 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, the mathematical model is obtained to obtain matching geomagnetic features and non-matching geomagnetic features in the first and second geomagnetic sequences. The electronic device can retain matching geomagnetic features and discard unmatched geomagnetic features.
[0136] In some embodiments, the electronic device can also calculate the similarity of the geomagnetic features with the same collection order in the first geomagnetic sequence and the second geomagnetic sequence according to the order of the time of collection of the geomagnetic features. For example, the first geomagnetic sequence can be expressed as {X1, X2, ..., XN}, and the second geomagnetic sequence can be expressed as {Y1, Y2, ..., YN}, where X1 and Y1 are both the first geomagnetic features collected in the geomagnetic sequence, and the electronic device can obtain the similarity of X1 and Y1. Similarly, the electronic device can also obtain the similarity of X2 and Y2, ..., and the similarity of XN and YN, so that the electronic device can obtain N similarities. Among the N similarities, the electronic device can regard the geomagnetic features greater than or equal to the similarity threshold as matching geomagnetic features, and the geomagnetic features less than the similarity threshold as unmatched geomagnetic features.
[0137] S602, geomagnetic map optimization matching.
[0138] For the current user trajectory and the target historical trajectory after removing the mismatched geomagnetic features, the electronic device can use a graph optimization method to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.
[0139] For example, referring to a in FIG6C , the current user trajectory is trajectory 1, and the target historical trajectory is trajectory 2. For example, trajectory 1 may correspond to 10 magnetic features, and trajectory 2 may correspond to 10 magnetic features. a in FIG6C represents the magnetic features with white dots. The electronic device may use the RANSAC algorithm to remove unmatched geomagnetic features. For example, the electronic device may remove 3 unmatched magnetic features on the current user trajectory and the target historical trajectory respectively. b in FIG6C represents the unmatched magnetic features with black dots. For trajectory 1 and trajectory 2 after removing the unmatched geomagnetic features, the electronic device may use a graph optimization method to fuse trajectory 1 and trajectory 2 to obtain a corrected user trajectory such as trajectory 3, as shown in c in FIG6C .
[0140] For example, for the seven matched geomagnetic features, the electronic device may connect the positions corresponding to the geomagnetic features on track 1 and track 2 to obtain multiple connecting lines. The electronic device may connect the midpoints of the multiple connecting lines to obtain a corrected track 1.
[0141] S406: When the geomagnetic similarity is less than the geomagnetic similarity threshold, slide the preset time window and return to S401.
[0142] It should be understood that when the geomagnetic similarity is less than the geomagnetic similarity threshold, the electronic device may determine that the target historical trajectory is not the same as the current user trajectory, and therefore the electronic device does not use the target historical trajectory to correct the current user trajectory. In this embodiment of the present application, when the geomagnetic similarity is less than the geomagnetic similarity threshold, the electronic device may slide the preset time window and return to execution S401.
[0143] It should be understood that, because the user is constantly moving, the electronic device can continuously execute the steps in the embodiment shown in FIG. 4 , slide the preset time window, and continuously correct the user's trajectory.
[0144] Taking the user running scene as an example, the user often runs along the community road, and the user trajectory will be repeated many times along the community road. During the current user's running process, the electronic device can execute the steps shown in Figure 4 to correct the current user trajectory based on the target historical trajectory to improve the accuracy of the user trajectory. Among them, the target historical trajectory can be the trajectory of the user when he last ran along the community road, or the trajectory of the user when he ran along the community road in the last lap. In the embodiment of the present application, for magnetic features, the electronic device can be used immediately without pre-building a geomagnetic fingerprint database and optimizing the geomagnetic fingerprint database, and the calculation method is simple.
[0145] For example, referring to Figure 7, let's take a running scenario as an example. The current user trajectory is Trajectory 1, and the target historical trajectory is Trajectory 2. The electronic device corrects Trajectory 1 based on Trajectory 2, resulting in Corrected Trajectory 1. In Figure 7, rectangles represent operations, solid lines represent Trajectory 1, dashed lines represent Trajectory 2, and dot-dash lines represent Corrected Trajectory 1. It's understandable that as the user runs more, the user's trajectory becomes increasingly accurate because the electronic device continuously corrects the current user trajectory based on the target historical trajectory.
[0146] In the embodiments of the present application, the electronic device does not need to pre-establish and optimize the geomagnetic fingerprint database. Instead, it collects geomagnetic data at any time during the user's daily movement, so that it can be used immediately. Among them, the electronic device can obtain the target historical trajectory of the user that is the same as the current user's trajectory in the user's historical trajectory based on the current position and the magnetic characteristics of the current user's trajectory. The electronic device can use the target historical trajectory to correct the current user's trajectory, thereby improving the accuracy of the user's trajectory.
[0147] In some embodiments, after the electronic device corrects the current user trajectory based on the target's 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 further correct the corrected user trajectory based on the user's location with high accuracy to also improve the accuracy of the user trajectory.
[0148] 8 , the trajectory correction method provided in the embodiment of the present application may further include S801 - S802 .
[0149] In some embodiments, after the electronic device executes S405, it may further execute S801-S802:
[0150] S801: When there is road network information corresponding to the current location, the corrected user trajectory is corrected according to the road network information corresponding to the current location.
[0151] The electronic device may store the road network information, or the server may store the road network information, and the electronic device may obtain the road network information from the server. Taking the example of the electronic device storing the road network information, the electronic device may determine whether the road network information corresponds to the current location based on the current location.
[0152] Because road network information may include the locations of multiple points on a road, in some embodiments, the 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 the road is included within a preset range of the current location. When the preset range of the current location includes a location on the road, it can be determined that road network information corresponding to the current location exists in the road network information. When the preset range of the current location does not include a location on the road, it can be determined that road network information corresponding to the current location does not exist in the road network information.
[0153] When there is road network information corresponding to the current location, the electronic device can correct the corrected user trajectory based on the road network information corresponding to the current location. Exemplarily, the electronic device can match the current user trajectory to a road in the road network information to correct the corrected user trajectory.
[0154] For example, a in FIG9A is the current user trajectory, such as trajectory 1. b in FIG9A is trajectory 1 corrected based on the target's historical trajectory. In an embodiment of the present application, 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 the road network information corresponding to the current location, as shown in c in FIG9A.
[0155] In an embodiment of the present application, because the road network information is an accurate trajectory collected in advance, when the electronic device contains 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 based on the road network information corresponding to the current location, and obtain an accurate user trajectory.
[0156] S802: When there is no road network information corresponding to the current location, the corrected user trajectory is corrected according to the high-precision user location.
[0157] In some embodiments, when the electronic device does not store the road network information corresponding to the current location, or when the server does not store the road network information corresponding to the current location, the electronic device cannot modify 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 modify the corrected user trajectory based on the high-precision user location.
[0158] It should be understood that because the electronic device can collect the user's position while the user is walking to obtain the current user trajectory, the current user trajectory, after being corrected by the target historical trajectory, may deviate from the current user trajectory. However, if the user position collected by the electronic device is a high-precision user position, the electronic device can determine that the collected position is accurate and can therefore correct the position in the corrected user trajectory to the corresponding position.
[0159] 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 to determine the user's location with high precision. For example, taking CN0 and HDOP as an example, in a cell scenario, if CN0 is between 22-23 dB-Hz and HDOP is less than 4, the user's location can be used as a high-precision location.
[0160] For example, a in FIG9B is the current user trajectory, such as trajectory 1. b in FIG9B is trajectory 1 corrected based on the target historical trajectory. In an embodiment of the present application, the electronic device does not include road network information corresponding to the current location, but the electronic device can correct the corrected trajectory 1 based on the high-precision location. For example, if the electronic device captures high-precision locations A and B, the electronic device can correct the corresponding positions on the corrected trajectory 1 to locations A and B, as shown in c in FIG9B.
[0161] 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 location with high precision, the electronic device may not correct the corrected user trajectory.
[0162] In the embodiment of the present application, after the electronic device corrects the current user trajectory based on the target historical trajectory, it 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 the accurate location, the accuracy of the user trajectory can be further improved.
[0163] The following describes in detail the trajectory correction method provided by the embodiment of the present application performed by the electronic device with reference to FIG10:
[0164] In some embodiments, referring to FIG. 10 , the trajectory correction method provided by the embodiment of the present application may include:
[0165] S1001, collecting geomagnetic data and the user's location.
[0166] S1002: Obtain the current user trajectory according to the user's position within a preset time window.
[0167] S1003: Correct the geomagnetic data.
[0168] S1004: Acquire geomagnetic characteristics based on magnetic data.
[0169] S1005 , correspondingly storing the magnetic characteristics, the user's location, and the user's trajectory.
[0170] S1006: Check whether the target historical track exists in the user's historical track. If so, execute S1007; if not, slide the preset time window and return to execute S1001.
[0171] It should be understood that, taking a sports scene as an example, the user's historical trajectory can be understood as: the trajectory that the user has walked during the current sports process, or the user's trajectory during historical sports processes.
[0172] S1001-S1006 may refer to the description in S401-S403.
[0173] S1007, geomagnetic loop detection, if successful, execute S1008, if failed, slide the preset time window and return to execute S1001.
[0174] Geomagnetic loop detection can be understood as: detecting whether the geomagnetic similarity between the geomagnetic features corresponding to the target historical trajectory and the geomagnetic features corresponding to the current user trajectory is greater than or equal to the geomagnetic similarity threshold. When the geomagnetic similarity is greater than or equal to the geomagnetic similarity threshold, it indicates that the geomagnetic loop detection is successful, that is, the electronic device can regard the target historical trajectory and the current user trajectory as similar trajectories that the user has walked at different times. When the geomagnetic similarity is less than the geomagnetic similarity threshold, it indicates that the geomagnetic loop detection has failed, that is, the electronic device can determine that there is no trajectory similar to the current user trajectory in the historical trajectory.
[0175] S1008, eliminating unmatched geomagnetic features.
[0176] S1009: Optimize and match the geomagnetic map to obtain a corrected user trajectory.
[0177] S1008-S1009 may refer to the description in S601-S602.
[0178] S1010: When there is road network information corresponding to the current location, the corrected user trajectory is corrected according to the road network information corresponding to the current location.
[0179] S1011: When there is no road network information corresponding to the current location, the corrected user trajectory is corrected according to the high-precision user location.
[0180] S1008-S1009 may refer to the description in S801-S802.
[0181] The trajectory correction method provided in the embodiment of the present application has the same technical effect as that in the above embodiment, and reference can be made to the relevant description in the above embodiment.
[0182] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0183] In one embodiment, the present application also provides an electronic device. Referring to FIG11 , the electronic device may include a processor 1101 (e.g., a CPU) and a memory 1102. The memory 1102 may include a high-speed random-access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. The memory 1102 may store various instructions for performing various processing functions and implementing the method steps of the present application.
[0184] 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 communication port 1105 is used to enable communication between the electronic device and other peripheral devices. In the embodiment of the present application, 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 in the above-mentioned method embodiment. The implementation principles and technical effects are similar and will not be repeated here.
[0185] It should be noted that the modules or components described in the above embodiments may 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 microprocessors (digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code through a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code, such as a controller. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0186] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. 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 includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0187] The term "plurality" in this article refers to two or more. The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0188] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
[0189] It can be understood that in the embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean 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 the present application.
Claims
1. A trajectory correction method, characterized in that: include: Obtain the current user trajectory based on the user's location collected within a preset time window; In the historical track of the user, detecting whether there is a target historical track, the target historical track is within a preset distance range of the current user track; If yes, obtaining 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, the current user trajectory is corrected according to the target historical trajectory.
2. The method according to claim 1, characterized in that Before obtaining the geomagnetic similarity between the geomagnetic feature of the current user trajectory and the geomagnetic feature of the target historical trajectory, the method further includes: The geomagnetic characteristics of the current user trajectory are obtained according to the geomagnetic data collected within the preset time window.
3. The method according to claim 2, characterized in that The geomagnetic data includes three-axis geomagnetic intensity values, and the geomagnetic characteristics are: the geomagnetic intensity values obtained by vector addition of the three-axis geomagnetic intensity values.
4. The method according to any one of claims 1 to 3, characterized in that The detecting whether there is a target historical track includes: Detecting whether a historical track is included within a preset distance range of a current position, wherein the current position is on the current user track; If so, the historical trajectory contained in the preset distance range of the current position is used as the target historical trajectory.
5. The method according to any one of claims 1 to 3, characterized in that: The detecting whether there is a target historical track includes: Detecting whether a preset distance range of a current position contains a historical track that meets a preset condition, wherein the current position is on the current user track; If so, the historical trajectory that is included in the preset distance range of the current position and meets the preset conditions is used as the target historical trajectory.
6. The method according to claim 5, characterized in that The preset condition includes at least one of the following: the historical trajectory contained in the preset distance range of the current position is greater than or equal to a preset length, and the number of positions contained in the historical trajectory contained in the preset distance range of the current position is greater than or equal to a preset number.
7. The method according to any one of claims 1 to 6, characterized in that The obtaining of the geomagnetic similarity between the geomagnetic feature of the current user trajectory and the geomagnetic feature of the target historical trajectory includes: Acquire a first geomagnetic sequence according to the geomagnetic characteristics of the current user trajectory; Acquire a second geomagnetic sequence according to the geomagnetic characteristics of the target historical trajectory; Obtaining 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 to 6, characterized in that Before obtaining the geomagnetic similarity between the geomagnetic feature of the current user trajectory and the geomagnetic feature of the target historical trajectory, the method further includes: Slide the preset time window, and acquire a plurality of trajectory segments corresponding to the target historical trajectory based on the target historical trajectory; The obtaining of the geomagnetic similarity between the geomagnetic feature of the current user trajectory and the geomagnetic feature of the target historical trajectory includes: Acquire a first geomagnetic sequence according to the geomagnetic characteristics of the current user trajectory; Acquire multiple second geomagnetic sequences according to the geomagnetic characteristics of each track segment; The similarity between the first geomagnetic sequence and each second geomagnetic sequence is obtained, and the maximum similarity is used as the geomagnetic similarity.
9. The method according to any one of claims 1 to 8, characterized in that The current user track has multiple geomagnetic features, and the target historical track has multiple geomagnetic features; The modifying the current user track according to the target historical track includes: According to the time sequence of the geomagnetic features, a random sampling consensus algorithm is used to retain the matching geomagnetic features in the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory, and to remove the unmatched geomagnetic features; With respect to the current user trajectory and the target historical trajectory after eliminating the unmatched geomagnetic features, a graph optimization method is adopted 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 history track is a plurality of tracks, and the graph optimization method is adopted to fuse the target history track and the current user track to correct the current user track, including: According to the accuracy of the position on each target historical trajectory, the weight of each target historical trajectory is obtained; According to the weight of each target historical trajectory, the graph optimization method is used to fuse each target historical trajectory and the current target historical trajectory. User trajectory to correct the current user trajectory.
11. The method according to any one of claims 4 to 6, characterized in that: After the current user track is corrected, the method further includes: When there is road network information corresponding to the current position, correcting the corrected current user trajectory according to the road network information corresponding to the current position; When there is no road network information corresponding to the current position, the corrected current user trajectory is corrected according to the high-precision position of the user.
12. A trajectory correction device, characterized in that: include: Module for performing the method according to 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 the computer instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Geomagnetic fingerprint matching algorithm-based indoor positioning method
CN106092093A
Multimodal fusion based indoor self-positioning method and device
CN106500690A
Motion trail repairing method and device, equipment and storage medium
CN111858814A
Running path display device
JP1990138813A
Metal etching stop layer in magnetic tunnel junction memory cells
KR1020200037058A
