Track correction method and device, electronic equipment and readable storage medium
Through the detection and similarity analysis of geomagnetic characteristics, the problem of inaccurate user trajectories in the road-free network information area in the prior art is solved, and the trajectory correction and accurate acquisition in various scenarios are realized, which improves the reliability of positioning and accuracy.
Patent Information
- Application Number
- CN202310776854.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2043-06-28
AI Technical Summary
The prior art has inaccurate user trajectory acquired by GPS and PDR algorithms in cities, canyons and indoor areas due to satellite signal occlusion and interference, especially in the absence of road network information.
By collecting geomagnetic features, detecting the geomagnetic similarity between the current user trajectory and the historical trajectory, using geomagnetic features to correct the current user trajectory, and achieving accurate acquisition and correction of the trajectory, suitable for scenarios with large pose changes.
It improves the accuracy of user trajectory, eliminates the need to pre-construct a geomagnetic fingerprint database, simplifies the acquisition process, is suitable for a variety of motion scenarios, and enhances the reliability and accuracy of positioning.
Smart Images

Figure CN119215394A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] As users' awareness of health and exercise increases, electronic devices for exercise monitoring and recording are becoming more and more popular among users. Among them, electronic devices record user trajectories, which can not only calculate the user's exercise mileage and pace, but also trace back the user's exercise path and record the user's exercise history. At present, user trajectories can be obtained through global positioning system (GPS) positioning, or through pedestrian dead reckoning (PDR) algorithm positioning. Because these methods require the use of satellite signals for positioning, in cities, canyons, and indoor areas, the satellite signals are easily blocked and interfered, resulting in inaccurate user trajectories.
[0003] Currently, the user trajectory can be corrected with the help of road network information, but for areas without road network information, the user trajectory cannot be accurately obtained. Summary of the invention
[0004] The embodiments of the present application provide a trajectory correction method, device, electronic device and readable storage medium, which can obtain a target historical trajectory similar to a current user trajectory based on magnetic characteristics, and use the target historical trajectory to correct the current user trajectory, so as to obtain an accurate user trajectory.
[0005] In the first aspect, the embodiments of the present application provide a trajectory correction method, and the execution subject of the method may be an electronic device or a chip in the electronic device. The electronic device is used as an example for illustration in the following embodiments. In this method, the electronic device may obtain the current user trajectory based on the user's position collected within a preset time window. Exemplarily, the electronic device may connect the positions of the users collected within the preset time window to obtain the current user trajectory. When the user is in the historical walking process, the electronic device may store the user's historical trajectory. After obtaining the current user's trajectory, the electronic device may 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.
[0006] When there is a target historical trajectory in the user's historical trajectory, the electronic device can 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 walked in history and 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 the geomagnetic similarity threshold, the electronic device can determine that the target historical trajectory is a trajectory that the user has walked in history and is similar to the current user trajectory, and the electronic device can correct the current user trajectory based on the target historical trajectory.
[0007] It should be understood that when there is no target historical trajectory 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.
[0008] In the embodiment of the present application, the electronic device does not need to pre-establish a geomagnetic fingerprint database, but 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.
[0009] 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.
[0010] Exemplarily, the geomagnetic data includes three-axis geomagnetic intensity values, and the geomagnetic characteristics are: geomagnetic intensity values obtained by vector addition of the three-axis geomagnetic intensity values.
[0011] In the embodiment of the present application, because the geomagnetic intensity value obtained by vector addition of the three-axis geomagnetic intensity value 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 value 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.
[0012] In a possible implementation, the electronic device may detect whether a historical track is included within a preset distance range of the current position, and the current position is on the current user track. For example, the current position may be a starting position, an ending position, or an intermediate position in the current user track. If the historical track is included within a preset distance range of the current position, the electronic device may use the historical track included within the preset distance range of the current position as the target historical track.
[0013] In a possible implementation, in order to improve the detection accuracy of the target historical trajectory and avoid the problem that the length of the historical trajectory contained in the preset distance range of the current position is too short, the electronic device can detect whether the preset distance range of the current position contains a historical trajectory that meets the preset conditions. If the preset distance range of the current position contains a historical trajectory that meets the preset conditions, the electronic device can use the historical trajectory contained in the preset distance range of the current position and that meets the preset conditions as the target historical trajectory.
[0014] In a possible implementation, 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.
[0015] In this implementation, because the target history trajectory is long enough or contains a sufficient number of locations, it helps the electronic device to accurately detect whether the target history 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.
[0016] The following describes a method for an electronic device to obtain the geomagnetic similarity between the geomagnetic features of the current user trajectory and the geomagnetic features of the target historical trajectory:
[0017] First, the electronic device can obtain a first geomagnetic sequence based on the geomagnetic features 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 features of the current user trajectory. Similarly, the electronic device can obtain a second geomagnetic sequence based on the geomagnetic features 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.
[0018] Second, 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 and obtain multiple trajectory segments corresponding to the target historical trajectory based on the target historical trajectory. Exemplarily, the electronic device can start from the starting point of the target historical trajectory and obtain a trajectory segment each time the preset time window is slid, so that 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 according to the geomagnetic characteristics of the current user trajectory, and obtain multiple second geomagnetic sequences according to 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 a possible implementation, the current user track has multiple geomagnetic features, and the target historical track has multiple geomagnetic features. The electronic device may correct the current user track according to the target historical track in the following manner:
[0021] First, the electronic device can use a random sampling consensus algorithm in the chronological order of the geomagnetic features 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 remove the 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.
[0022] 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 degree, and retain the magnetic features with high matching degree. The electronic device can use a graph optimization method based on the magnetic features with high matching degree 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] Second, there are multiple target historical tracks.
[0024] The electronic device may obtain the weight of each target historical trajectory according to the accuracy of the position on each target historical trajectory. The electronic device may fuse each target historical trajectory and the current user trajectory in a graph optimization manner according to the weight of each target historical trajectory to correct the current user trajectory.
[0025] In some embodiments, the electronic device may obtain the credibility of the target historical trajectory according to the accuracy of the position on the target historical trajectory, wherein the higher the credibility of the target historical trajectory, the greater the weight of the target historical trajectory.
[0026] 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 with the current trajectory to correct and fuse the user trajectory, and the accuracy of the user trajectory will also increase.
[0027] In a possible implementation, when the electronic device corrects the current user trajectory based on the target historical trajectory to obtain the corrected user trajectory, if the electronic device stores the road network information of the corresponding position, the electronic device can further correct the corrected user trajectory according to the road network information to further improve the accuracy of the user trajectory. If the electronic device does not store the road network information of the corresponding position, the electronic device can further correct the corrected user trajectory according to the position of the user with high accuracy, which can also improve the accuracy of the user trajectory.
[0028] In a second aspect, an embodiment of the present application provides a trajectory correction device, which may include a processing module.
[0029] A processing module is used to obtain a current user trajectory according to the user's position collected within a preset time window; in the user's historical trajectory, detect whether there is a target 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 according to the target historical trajectory.
[0030] In a possible implementation, the trajectory correction device may include a geomagnetic module, and the geomagnetic module is used to collect 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 a possible implementation, 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.
[0033] In a possible implementation, the processing module is specifically used to detect whether a historical trajectory is included within a preset distance range of a current position, and the current position is on the current user trajectory; if so, the historical trajectory included within the preset distance range of the current position is used as the target historical trajectory.
[0034] In a possible implementation, the processing module is specifically used to detect whether a historical trajectory that meets preset conditions is included within a preset distance range of the current position, and the current position is on the current user trajectory; if so, the historical trajectory that is included within the preset distance range of the current position and meets the preset conditions is used as the target historical trajectory.
[0035] In a possible implementation, 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.
[0036] In one possible implementation, the processing module is specifically used to obtain a first geomagnetic sequence according to the geomagnetic characteristics of the current user trajectory; obtain a second geomagnetic sequence according to 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 a possible implementation manner, 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.
[0038] The processing module is specifically used to obtain a first geomagnetic sequence according to the geomagnetic characteristics of the current user trajectory, obtain multiple second geomagnetic sequences according to 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.
[0039] In a possible implementation manner, there are multiple geomagnetic features of the current user trajectory, and there are multiple geomagnetic features of the target historical trajectory.
[0040] The processing module is specifically 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 remove unmatched geomagnetic features according to the time sequence of the geomagnetic features and by using a random sampling consensus algorithm; for the current user trajectory and the target historical trajectory after removing the unmatched 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 a possible implementation, there are multiple target history tracks.
[0042] The processing module is specifically used to obtain the weight of each target historical trajectory according to the accuracy of the position on each target historical trajectory; and according to the weight of each target historical trajectory, adopt a graph optimization method to fuse each target historical trajectory and the current user trajectory to correct the current user trajectory.
[0043] In a possible implementation, when there is road network information corresponding to the current location, the processing module is further used to correct the corrected current user trajectory according to the road network information corresponding to the current location;
[0044] When there is no road network information corresponding to the current position, the processing module is further used to correct the corrected current user trajectory according to the high-precision position of the user.
[0045] 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 used to store computer executable program code, and the program code includes instructions; when the processor executes the instructions, the instructions cause the electronic device to execute the method in the first aspect.
[0046] 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.
[0047] 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.
[0048] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the method in the first aspect above.
[0049] 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
[0050] Figure 1A A schematic diagram for correcting 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 the present application;
[0053] Figure 3A schematic diagram of the user's location, geomagnetic characteristics, and user trajectory provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of a flow chart of an embodiment of a trajectory correction method provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of obtaining magnetic similarity provided in an embodiment of the present application;
[0056] Fig. 6A A schematic diagram of trajectory correction provided in an embodiment of the present application;
[0057] Figure 6B A schematic flow chart of another embodiment of the trajectory correction method provided in the embodiment of the present application;
[0058] Figure 6C Another schematic diagram of trajectory correction provided in an embodiment of the present application;
[0059] Figure 7 A schematic diagram of trajectory correction in a running scene provided in an embodiment of the present application;
[0060] Figure 8 A schematic flow chart of another embodiment of the trajectory correction method provided in the embodiment of the present application;
[0061] Fig.9A A schematic diagram of a trajectory correction based on road network information provided in an embodiment of the present application;
[0062] Fig. 9B A schematic diagram of a high-precision user position correction trajectory provided by an embodiment of the present application;
[0063] Fig.10 A schematic flow chart of another embodiment of the trajectory correction method provided in the embodiment of the present application;
[0064] Fig.11 Another schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] Since the embodiment of the present application involves a trajectory correction method, for ease of understanding, the following first introduces the relevant terms and concepts involved in the embodiment of the present application:
[0066] Road network information: includes information about multiple roads. In some embodiments, the road information may include the road name, road length, the starting point location, the ending point location, and the locations of multiple points on the road. In some embodiments, the road information may also include: the number of lanes, the direction of travel of each lane, and the locations of multiple points on each lane.
[0067] The electronic devices in the embodiments of the present application may be referred to as user equipment (UE), terminal, 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 function, 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 form of the electronic device is not specifically limited in the embodiments of the present application. Wearable devices may be devices such as watches, bracelets, running beans, headphones, etc. that can be worn on the user.
[0068] 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 use satellite signals for positioning, but in areas such as cities, canyons, and indoors, satellite signals are easily shielded and interfered, resulting in inaccurate positioning, and thus inaccurate user trajectories.
[0069] In order to improve the accuracy of the user trajectory, the user trajectory can be corrected with the help of road network information. Figure 1A 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 according to the road network information to obtain the corrected user trajectory 2. It should be understood that Figure 1A The dotted lines in the figure represent roads in the road network. For example, in the initial user trajectory 1 acquired by the electronic device through the positioning module, a trajectory deviation occurs at position A, and the trajectory of the user trajectory 2 corrected by the road network information at position A is consistent with the road.
[0070] However, in this method, for areas without road network information, it is impossible to use road network information to correct the user's trajectory. In addition, if the user's position is inaccurate, 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 low correction accuracy. 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 be corrected. In addition, the method of correcting the user's trajectory with the help of road network information is applicable to outdoor scenes with roads, but not to scenes without roads such as indoors and canyons.
[0071] As a natural, easily accessible and long-term stable parameter, magnetic field has natural advantages in terms of availability, anti-interference capability, autonomy, etc. For example, regional magnetic field distortion caused by building steel bars, surrounding electromagnetic devices or man-made objects can be used as geomagnetic fingerprints to assist positioning and can be applied to indoor positioning scenarios.
[0072] At present, in indoor scenes, 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 with the help of a pre-built geomagnetic fingerprint database, locate the user's location, and 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.
[0073] However, in this method, it is necessary to collect indoor geomagnetic data in advance and build a geomagnetic fingerprint database in advance, which has a high collection cost.
[0074] At present, electronic devices can use geomagnetic simultaneous positioning and mapping (SLAM) technology, which does not need to pre-build a geomagnetic fingerprint database, but gradually builds and optimizes the geomagnetic fingerprint database during the positioning process. Electronic devices can locate based on the geomagnetic fingerprint database, obtain the user's location, and obtain the user's trajectory based on the user's location.
[0075] 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, such as 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.
[0076] Considering 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 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 daily life of the user, the electronic device collects geomagnetic data, matches the geomagnetic data on the same trajectory, combines the historical trajectory and the current trajectory, and 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.
[0077] It should be understood that because the trajectory correction method provided in the embodiment of the present application requires the use of geomagnetic data, the trajectory correction method provided in the embodiment of the present application is applicable to areas with obvious geomagnetic features such as indoors and urban canyons. In some embodiments, areas with obvious geomagnetic features such as indoors and urban canyons can be referred to as target areas.
[0078] Before introducing the trajectory correction method provided by the embodiment of the present application, the structure of the electronic device is first introduced:
[0079] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. 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 position of the electronic device. In some embodiments, the position of the electronic device can be used as the position of the user.
[0081] In some embodiments, the positioning module 21 may include but is not limited to: a GPS positioning module, a GNSS positioning module. In some embodiments, the method by which the positioning module 21 obtains the position of the electronic device may include but is not limited to: the positioning module 21 directly uses the position collected by the positioning module 21 as the position of the electronic device, or uses the position collected by the positioning module 21 as the initial position, and then uses the PDR algorithm, etc. to calculate the user's position, which can refer to the relevant description in the prior art, and the embodiments of the present application are not limited to this.
[0082] The processing module 23 is used to obtain the user trajectory based on the position 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 three-axis geomagnetic data, and the three-axis geomagnetic data may include three-axis geomagnetic intensity values.
[0084] The processing module 23 is also used to obtain geomagnetic features based on the geomagnetic data collected by the geomagnetic module 22. It should be understood that the three-axis geomagnetic data can be regarded as vector data in the three-axis direction, and the geomagnetic features can be regarded as scalar data after the vector data in the three-axis direction is added. In some embodiments, the geomagnetic features can be regarded as the total amount of the three-axis geomagnetic data, and the geomagnetic features can include geomagnetic intensity.
[0085] In the embodiment of the present application, because the total amount of three-axis geomagnetic data is used instead of the three-axis geomagnetic data, and because the total amount of three-axis geomagnetic data is scalar data instead of vector data, the geomagnetic features 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.
[0086] 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.
[0087] For example, refer to Figure 3 , within a period of time, the processing module 23 can obtain multiple locations of the electronic device from the positioning module 21, such as Figure 3 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, such as Figure 3 The processing module 23 can store the user's position, geomagnetic characteristics, and user trajectory in correspondence with each other according to time.
[0088] In some embodiments, the periods for the electronic device to collect the user's location and the geomagnetic data may be the same or different.
[0089] The processing module 23 can match the current user trajectory with the historical user trajectory, and match the geomagnetic features on similar trajectories, and then combine the historical user trajectory and 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 refer to Figure 4 , Figure 6B , Figure 8 as well as Fig.10 The description of the embodiment shown, Figure 3 The steps executed by the electronic device can be regarded as the steps executed by the processing module 23.
[0090] The trajectory correction method provided by the embodiment 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 embodiment 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.
[0091] Figure 4 A schematic diagram of a flow chart of an embodiment of a trajectory correction method provided in an embodiment of the present application. Figure 4 , the trajectory correction method provided in the embodiment of the present application may include:
[0092] S401, obtaining the current user trajectory within a preset time window.
[0093] Reference Figure 2 As described in, the electronic device can obtain the user's position in real time during the user's movement. In the embodiment of the present application, the electronic device can obtain the current user trajectory within the preset time window based on the user's position within the preset time window. In the following embodiments, the current user trajectory within the preset time window can be referred to as the current user trajectory.
[0094] 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, and the electronic device may connect the positions of more users to obtain a more accurate current user trajectory.
[0095] S402, in the user's historical track, detect whether there is a target 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.
[0096] During the user's daily walking process, the electronic device will also obtain the user's position in real time, and obtain the user's trajectory based on the user's position. In some embodiments, the electronic device can store the user's trajectory, and in the embodiments of the present application, the user's trajectory stored in the electronic device can be used as the user's historical trajectory.
[0097] In some embodiments, the preset distance range of the current user trajectory can be understood as: a set of preset distance ranges of each position included in the current user trajectory. The positions included in the current user trajectory can be understood as the positions constituting the current user trajectory. In this embodiment, the electronic device can determine whether there is a target historical trajectory by detecting whether the preset distance range of the current user trajectory contains a historical 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 position. In some embodiments, the current position is on the current user trajectory, such as the current position can be the starting position, the ending position or the middle position in the current user trajectory. Among them, the electronic device can determine whether there is a target historical trajectory by detecting whether the historical trajectory is included in the preset distance range of the current position. For example, the preset distance range is 2 meters.
[0099] When the preset distance range of the current position contains the historical track, it can be determined that the target historical track exists. The target historical track is: the historical track contained in the preset distance range of the current position. When the preset distance range of the current position does not contain the historical track, it can be determined that the target historical track does not exist.
[0100] In order to improve the detection accuracy of the target historical track and avoid the problem that the length of the historical track included in the preset distance range of the current position is too short, in some embodiments, when the preset distance range of the current position contains a historical track that meets the preset conditions, the electronic device can determine that the target historical track exists. In some embodiments, the preset conditions can be, for example, a preset length, or the number of positions included in the historical track is greater than or equal to a preset number.
[0101] In some embodiments, when a historical trajectory is included in a preset distance range of the current location, the electronic device may continue to detect whether the length of the historical trajectory included in 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 in the preset distance range of the current location is greater than or equal to the preset length, it can be determined that there is a target historical trajectory, and the electronic device may use the historical trajectory included in the preset distance range of the current location as the target historical trajectory.
[0102] In some embodiments, because the historical track is obtained by connecting multiple locations by the electronic device, the historical track may include multiple locations. When the historical track is included in the preset distance range of the current location, the electronic device may continue to detect whether the number of locations included in the historical track included in the preset distance range of the current location is greater than or equal to the preset number. When the number of locations included in the historical track included in the preset distance range of the current location is greater than or equal to the preset number, it can be determined that there is a target historical track, and the electronic device can use the historical track included in the preset distance range of the current location as the target historical track.
[0103] In some embodiments, a trajectory similarity model may be pre-stored in the electronic device, and the trajectory similarity model is used to obtain the similarity of the trajectory and output the information of the target historical trajectory whose similarity is greater than or equal to the similarity threshold. In an embodiment 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, and the trajectory similarity model may output the information of the target historical trajectory whose similarity with the current user's trajectory is greater than or equal to the similarity threshold in the historical trajectory. In some embodiments, the information of the target historical trajectory may include: the starting point and the ending point of the target historical trajectory, etc.
[0104] 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.
[0105] In the embodiment of the present application, the electronic device obtains the target historical trajectory from the historical trajectory, which is essentially to determine the historical trajectory that the user has walked in the past and is the same trajectory as the current user trajectory, so that the electronic device can correct the current user trajectory based on the target historical trajectory belonging to the same trajectory to improve the accuracy of the user trajectory. In other words, the electronic device can continuously make corrections based on the trajectory that the user repeatedly walks to improve the accuracy of the user trajectory.
[0106] In some embodiments, after the electronic device obtains the target historical trajectory in the historical trajectory, the following situations may still exist: 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 repeatedly walked through a historical trajectory similar to the current user trajectory during the user's historical walking process, in the embodiment of the present application, the electronic device can also detect whether the target historical trajectory is actually a similar trajectory that the user has repeatedly walked with the current user trajectory based on geomagnetic characteristics, and the electronic device can also execute S403-S406:
[0107] S403: Obtain the geomagnetic features corresponding to the current user trajectory.
[0108] Reference Figure 2 According to the relevant description in , during the user's movement, the electronic device can collect geomagnetic data in real time and obtain geomagnetic features based on the geomagnetic data. Among them, 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.
[0109] S404: Obtain the geomagnetic similarity between the geomagnetic feature corresponding to the current user trajectory and the geomagnetic feature corresponding to the target historical trajectory.
[0110] It is understandable that when users walk in their daily life, electronic devices will also collect geomagnetic data in real time and obtain geomagnetic features based on the geomagnetic data. Figure 2 As described in the related description, since the electronic device can store the user's position, user trajectory and geomagnetic features correspondingly, the geomagnetic features corresponding to the target historical trajectory can be understood as: the geomagnetic features collected by the electronic device during the collection time period corresponding to the target historical trajectory.
[0111] For example, if the target historical trajectory is obtained by connecting position 1 to position 10, the corresponding collection time period of the target historical trajectory is the time used by the electronic device to collect information from position 1 to position 10. During this period of time, the geomagnetic features collected by the electronic device can be used as the geomagnetic features corresponding to the target historical trajectory.
[0112] 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.
[0113] 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 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 of the geomagnetic features corresponding to the current user trajectory and the geomagnetic features corresponding to the target historical trajectory.
[0114] 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, and 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, and the second geomagnetic sequence includes multiple geomagnetic features arranged in chronological order of acquisition time.
[0115] 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, and the embodiments of the present application do not limit the specific algorithm.
[0116] In some embodiments, the electronic device can also slide a preset time window to obtain multiple trajectory segments based on the target historical trajectory. The electronic device can start from the starting point of the target 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 trajectory.
[0117] In this embodiment, the electronic device can obtain the second geomagnetic sequence corresponding to each trajectory segment according to 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, which can be used as the trajectory in the target historical trajectory that is most similar to the current user trajectory.
[0118] For example, refer 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. Figure 5 The black dot represents the current position, and the circle represents the preset distance range of the current position. The electronic device can obtain the similarity between the first geomagnetic sequence corresponding to track 1 and the second geomagnetic sequence corresponding to track 2. In some embodiments, Figure 5 Taking the example of obtaining multiple track segments corresponding to track 2 based on a preset time window, the electronic device can obtain the similarity between the first geomagnetic sequence corresponding to track 1 and the second geomagnetic sequence corresponding to each track segment. It should be understood that Figure 5 A trajectory segment is represented by a rectangular box.
[0119] 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. The accuracy of the obtained similarity will not be poor due to posture changes, and it can be applied to scenes 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 according to the target historical trajectory.
[0121] In an embodiment of the present application, when the geomagnetic similarity is greater than or equal to the geomagnetic similarity threshold, the electronic device may use the target history trajectory and the current user trajectory as repeated trajectories that the user has walked at different times, or may use the target history 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 use the target trajectory segment and the current user trajectory as repeated trajectories that the user has walked at different times.
[0122] The following embodiment takes the target historical trajectory as an example to illustrate the process of the electronic device correcting the current user trajectory:
[0123] 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.
[0124] For example, refer to Fig. 6A, the current user trajectory is trajectory 1, the target historical trajectory is trajectory 2, and the electronic device can use a graph optimization method to fuse trajectory 1 and trajectory 2 to obtain a corrected trajectory 1. Among them, the electronic device can use a graph optimization method to gather trajectory 1 and trajectory 2 in the same direction, such as gathering trajectory 1 downward and gathering trajectory 2 upward, to fuse trajectory 1 and trajectory 2 to obtain a corrected trajectory.
[0125] For example, the electronic device may select a point at a preset distance on track 1 to obtain multiple points of track 1, and select a point at a preset distance on track 2 to obtain multiple points of 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 connection lines. The electronic device may connect the midpoints of the multiple connection lines to obtain a corrected track 1.
[0126] In some embodiments, when there are multiple target history tracks, the electronic device can determine the weight of each target history track according to the credibility of each target history track. The electronic device can fuse the target history track and the current user track in a graph optimization manner according to the weight of each target history track and the current user track to correct the current user track. The higher the credibility of the target history track, the greater the weight of the target history track.
[0127] In some embodiments, the electronic device can obtain the credibility of the target historical trajectory according to 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, and the electronic device can determine the accuracy of the position according to parameters such as the carrier-to-noise density ratio (CN0), the dilution of precision (DOP), and the 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, which 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 of the precision of the positions on the target historical trajectory to represent the credibility of the target historical trajectory, wherein the larger the average of the precision of the positions on the target historical trajectory, the greater the credibility of the target historical trajectory.
[0129] In some embodiments, in order to improve the correction accuracy of 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 degree, and retain the magnetic features with high matching degree. The electronic device can use a graph optimization method based on the magnetic features with high matching degree to fuse the target historical trajectory and the current user trajectory to correct the current user trajectory.
[0130] The process of magnetic feature matching of electronic equipment can be referred to Figure 6B :
[0131] S601, remove unmatched geomagnetic features.
[0132] 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. According to the order of the time of collecting the geomagnetic features, 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 unmatched geomagnetic features.
[0133] The RANSAC algorithm calculates a mathematical model based on a set of sample data containing abnormal data to obtain valid sample data. Among them, the sample data can be understood as the geomagnetic features in the first geomagnetic sequence and the second geomagnetic sequence, the abnormal data can be understood as the geomagnetic features that do not match in the first geomagnetic sequence and the second geomagnetic sequence, and the valid sample data is the matching geomagnetic features. Exemplarily, the electronic device can randomly select m groups of geomagnetic features with the same collection order according to the order of the time of geomagnetic feature collection, and obtain the mathematical model through continuous iteration and calculation, in which the number of geomagnetic feature groups that can be matched is the largest. Exemplarily, taking m as 3 as an example, the first geomagnetic sequence can be expressed as {X1, X2, ..., XN}, the second geomagnetic sequence can be expressed as {Y1, Y2, ..., YN}, and the electronic device can select X1 and Y1, X2 and Y2, and X3 and Y3. The three groups of geomagnetic features are obtained through continuous iteration and calculation to obtain the mathematical model to obtain the matching geomagnetic features in the first geomagnetic sequence and the second geomagnetic sequence, as well as the unmatched geomagnetic features. The electronic device can retain matching geomagnetic features and discard unmatched geomagnetic features.
[0134] 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. Exemplarily, 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 between X1 and Y1. Similarly, the electronic device can also obtain the similarity between X2 and Y2, ..., and the similarity between 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.
[0135] S602, optimizing and matching the geomagnetic map.
[0136] With respect to the current user trajectory and the target historical trajectory after eliminating the unmatched geomagnetic features, the electronic device can adopt a graph optimization method 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 a, the current user trajectory is trajectory 1, and the target 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 The white dots in a represent magnetic features. The electronic device can use the RANSAC algorithm to remove unmatched geomagnetic features. For example, the electronic device can remove three unmatched magnetic features on the current user trajectory and the target historical trajectory respectively. Figure 6C The black dots in b represent the mismatched magnetic features. For tracks 1 and 2 after eliminating the mismatched geomagnetic features, the electronic device can use a graph optimization method to fuse tracks 1 and 2 to obtain a corrected user track such as track 3. Figure 6C As shown in c.
[0138] For example, for the seven matched geomagnetic features, the electronic device can connect the positions corresponding to the geomagnetic features on track 1 and track 2 to obtain multiple connecting lines. The electronic device can connect the midpoints of the multiple connecting lines to obtain the corrected track 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, so the electronic device does not use the target historical trajectory to correct the current user trajectory. In an embodiment of the present application, when the geomagnetic similarity is less than the geomagnetic similarity threshold, the electronic device can slide the preset time window and return to execute S401.
[0141] It should be understood that, due to the continuous movement of the user, the electronic device may continuously execute Figure 4 The steps in the illustrated embodiment slide the preset time window to continuously correct the user trajectory.
[0142] Taking the user running scenario as an example, the user often runs along the community road, and the user's trajectory will be repeated many times along the community road. During the current user's running process, the electronic device can perform Figure 4 According to the steps shown in , the current user trajectory is corrected based on the target historical trajectory to improve the accuracy of the user trajectory. The target historical trajectory may be, for example, the trajectory of the user's last run along the community road, or the trajectory of the user's last run along the community road. In the embodiment of the present application, the electronic device can be used immediately for magnetic features, without the need to pre-build a geomagnetic fingerprint database and optimize the geomagnetic fingerprint database, and the calculation method is simple.
[0143] For example, refer to Figure 7 , taking the user running scene as an example, the current user track is track 1, and the target historical track is track 2. After the electronic device corrects track 1 based on track 2, the corrected track 1 is obtained. Figure 7 In the figure, the operation is represented by a rectangle, the track 1 is represented by a solid line, the track 2 is represented by a dotted line, and the corrected track 1 is represented by a dashed line. It can be understood that as the number of times the user runs increases, the user track will become more and more accurate because the electronic device continuously corrects the current user track based on the target historical track.
[0144] In the embodiment of the present application, the electronic device does not need to pre-establish a geomagnetic fingerprint database and optimize the geomagnetic fingerprint database, but 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 same trajectory as the current user trajectory in the user's historical trajectory based on the current position and the magnetic characteristics of the current user trajectory according to the current user trajectory. The electronic device can use the target historical trajectory to correct the current user trajectory, thereby improving the accuracy of the user trajectory.
[0145] In some embodiments, when the electronic device corrects the current user trajectory based on the target historical trajectory and obtains the corrected user trajectory, if the electronic device stores the road network information of the corresponding position, the electronic device can further correct the corrected user trajectory according to the road network information to further improve the accuracy of the user trajectory. If the electronic device does not store the road network information of the corresponding position, the electronic device can further correct the corrected user trajectory according to the position of the user with high accuracy, which can also improve the accuracy of the user trajectory.
[0146] Reference Figure 8 The trajectory correction method provided in the embodiment of the present application may also include S801-S802.
[0147] In some embodiments, after the electronic device executes S405, it may further execute S801-S802:
[0148] S801, when there is road network information corresponding to the current position, correct the corrected user trajectory according to the road network information corresponding to the current position.
[0149] 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 road network information stored in the electronic device as an example, the electronic device may determine whether there is road network information corresponding to the current location in the road network information according to the current location.
[0150] Because the road network information may include the locations of multiple points on the road, in some embodiments, the electronic device may determine whether the road network information corresponding to the current location exists in the road network information by detecting whether the preset range of the current location includes the location on the road. When the preset range of the current location includes the location on the road, it may be determined that the 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 the location on the road, it may be determined that the road network information corresponding to the current location does not exist in the road network information.
[0151] When there is road network information corresponding to the current location, the electronic device can correct the corrected user trajectory according to the road network information corresponding to the current location. Exemplarily, the electronic device can match the current user trajectory to the road in the road network information to correct the corrected user trajectory.
[0152] For example, Fig.9A The a in is the current user trajectory, such as trajectory 1. Fig.9A b in the figure is the track 1 corrected based on the historical track of the target. In the embodiment of the present application, when there is road network information corresponding to the current position, the electronic device can match the corrected track 1 to the road in the road network information based on the road network information corresponding to the current position, such as Fig.9AAs shown in c.
[0153] 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.
[0154] S802: When there is no road network information corresponding to the current position, the corrected user trajectory is corrected according to the high-precision user position.
[0155] In some embodiments, 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, the electronic device cannot correct the corrected user trajectory based on the road network information. However, if the electronic device collects the user's location with high precision, the electronic device can correct the corrected user trajectory based on the user's location with high precision.
[0156] It should be understood that, because the electronic device can collect the user's position during the user's walking process to obtain the current user trajectory. The current user trajectory corrected by the target historical trajectory may deviate from the current user trajectory, but if the user's position collected by the electronic device is a high-precision user's position, the electronic device can determine that the collected position is accurate, and therefore the position in the corrected user trajectory can be corrected to the corresponding position.
[0157] In some embodiments, the electronic device can determine the accuracy of the user's position based on the parameters such as CN0, DOP, HDOP of the collected position to determine the user's position with high accuracy. For example, taking CN0 and HDOP as an example, in a cell scenario, if CN0 is between 22-23dB-Hz and HDOP is less than 4, the user's position can be used as a high-precision position.
[0158] For example, Fig. 9B The a in is the current user trajectory, such as trajectory 1. Fig. 9B b in the figure is the track 1 corrected based on the historical track of the target. In the embodiment of the present application, the electronic device does not include the road network information corresponding to the current position, but the electronic device can correct the corrected track 1 according to the high-precision position. For example, if the electronic device collects high-precision positions A and B, the electronic device can correct the corresponding positions on the corrected track 1 to positions A and B. Fig. 9B As shown in c.
[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 location with high precision, the electronic device may not correct the corrected user trajectory.
[0160] In the embodiment of the present application, after the electronic device corrects the current user trajectory based on the target historical trajectory, it can also continue to correct the user trajectory based on the road network information corresponding to the current position, or the high-precision user position. Because the road network information corresponding to the current position, or the high-precision user position, contains the accurate position, the accuracy of the user trajectory can be further improved.
[0161] Combine the following Fig.10 The electronic device performs the trajectory correction method provided in the embodiment of the present application in detail:
[0162] In some embodiments, reference Fig.10 , the trajectory correction method provided in the embodiment of the present application may include:
[0163] S1001, collecting geomagnetic data and the user's location.
[0164] S1002: Obtain the current user trajectory according to the user's position within a preset time window.
[0165] S1003, correcting the geomagnetic data.
[0166] S1004, obtaining geomagnetic characteristics according to magnetic data.
[0167] S1005, correspondingly storing the magnetic characteristics, the user's location, and the user's trajectory.
[0168] S1006, in the user's historical track, check whether there is a target historical track. If so, execute S1007, if not, slide the preset time window and return to execute S1001.
[0169] 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 the historical sports process.
[0170] S1001-S1006 may refer to the description in S401-S403.
[0171] S1007, geomagnetic loop detection, if successful, execute S1008, if failed, slide the preset time window and return to execute S1001.
[0172] 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.
[0173] S1008, remove unmatched geomagnetic features.
[0174] S1009, optimizing and matching the geomagnetic map to obtain a corrected user trajectory.
[0175] S1008-S1009 may refer to the description in S601-S602.
[0176] S1010, when there is road network information corresponding to the current position, the corrected user trajectory is corrected according to the road network information corresponding to the current position.
[0177] S1011, when there is no road network information corresponding to the current position, correct the corrected user trajectory according to the high-precision user position.
[0178] S1008-S1009 may refer to the description in S801-S802.
[0179] The trajectory correction method provided in the embodiment of the present application has the same technical effect as in the above embodiment, and reference may be made to the relevant description in the above embodiment.
[0180] 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 relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0181] In one embodiment, the present application also provides an electronic device, referring to Fig.11, the electronic device may include: a processor 1101 (such as 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 memory. The memory 1102 may store various instructions for completing various processing functions and implementing the method steps of the present application.
[0182] Optionally, the electronic device involved in the present application may further include: a power supply 1103, a communication bus 1104 and a communication port 1105. The above-mentioned communication port 1105 is used to realize the connection and communication between the electronic device and other peripherals. In the embodiment of the present application, the memory 1102 is used to store computer executable program code, and the program code includes instructions; when the processor 1101 executes the instruction, the instruction causes the processor 1101 of the electronic device to perform the action in the above-mentioned method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0183] 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), or one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes, 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).
[0184] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, 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 loading and executing computer program instructions 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 devices. 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 site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. 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 hard disk Solid State Disk (SSD)), etc.
[0185] The term "plurality" in this article refers to two or more than two. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: 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 descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0186] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0187] 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, each target historical trajectory and the current user trajectory are fused in a graph optimization manner 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
Method and device for correcting movement track information
CN107202574A
User similarity obtaining method and apparatus, device, and storage medium
CN108764951A
Coordinate correction method and device, equipment and storage medium
CN109813318A
Cited By
Multi-source heterogeneous sensor adaptive fusion positioning and mapping method and device
CN121409214A
A multi-source heterogeneous sensor adaptive fusion positioning and mapping method and device
CN121409214B
