Trajectory optimization method, device, electronic device and storage medium

By generating the positioning results of the initial positioning point and the first positioning point, the problems of inaccurate positioning of electronic devices and data drift are solved, and the accuracy of the motion trajectory is improved.

CN115267856BActive Publication Date: 2025-04-01SHENZHEN DO INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110471273.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-29
Publication Date
2025-04-01
Estimated Expiration
2041-04-29

AI Technical Summary

Technical Problem

Existing electronic devices are easily affected by the environment when positioning, resulting in inaccurate positioning results and data drift, which in turn affects the accuracy of the drawn motion trajectory.

Method used

By acquiring the positioning data of the electronic device, the positioning result of the initial positioning point is generated based on the latitude and longitude of at least two continuous positioning points that meet the preset high-precision positioning point conditions, and the positioning result of the first positioning point is determined based on the positioning result of the initial positioning point to improve the accuracy of the trajectory.

Benefits of technology

The accuracy of the positioning results of the initial positioning point and the first positioning point is improved, resulting in the drawn motion trajectory being more accurate and close to the actual motion trajectory of the user.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115267856B_ABST
    Figure CN115267856B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention proposes a trajectory optimization method, device, electronic device and storage medium, the method comprising: obtaining positioning data of an electronic device, the positioning data comprising longitude and latitude; generating a positioning result of an initial positioning point according to the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions; determining the positioning result of a first positioning point and the trajectory of the electronic device according to the positioning result of the initial positioning point. Since the positioning result of the initial positioning point is generated according to the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions. The accuracy of the positioning result of the initial positioning point can be improved. The trajectory of the electronic device determined according to the positioning result of the initial positioning point and the positioning result of the first positioning point will be more accurate and close to the actual movement trajectory of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile positioning technology, and in particular to a trajectory optimization method, device, electronic equipment and storage medium. Background Art

[0002] With the development of global positioning and navigation systems such as the global navigation satellite system (GNSS) and the BeiDou navigation satellite system (BDS), a large number of electronic devices can determine the user's real-time positioning point based on the global positioning and navigation system, and thus draw the user's movement trajectory based on the user's real-time positioning point.

[0003] However, the current positioning results of electronic devices are easily affected by the environment. Specifically, if the electronic device is in an open area and can receive a good quality satellite signal, the positioning result determined by the electronic device will be relatively accurate. On the contrary, the satellite signal that can be received in a place with many obstacles is relatively limited, and the determined positioning result will have a large error. In addition, the satellite signal received by the electronic device may not be a point-to-point signal directly from the satellite to the electronic device, but the signal transmitted by the satellite is reflected and / or refracted by other objects and then received by the electronic device, which will also affect the positioning result. Although the satellite is always broadcasting its own position signal, due to power consumption considerations, the electronic device may not be receiving it all the time. The electronic device may receive satellite signals at a specific frequency, which will cause the real-time performance of the positioning result to be low, which will also affect the positioning result.

[0004] Based on the above problems, data drift often occurs in the positioning results of electronic devices through global positioning and navigation systems. That is, the positioning results obtained by electronic devices through global positioning and navigation systems are quite different from the actual position of the electronic devices. The phenomenon of data drift may occur when the user is stationary or in motion. If data drift occurs when the user is stationary, the positioning result will change, and even the speed will be displayed. This is obviously unreasonable. When the electronic device drifts, there will be a large gap between the positioning result and the actual position of the user, resulting in a large positioning error. If the user's motion trajectory is drawn according to these positioning points with large positioning errors, the drawn user's motion trajectory will appear wavy, so that the user's motion trajectory drawn is not consistent with the user's actual motion trajectory, and the smoothness of the drawn motion trajectory is also very low. Generally speaking, if the initial positioning point is not accurately positioned, the subsequent positioning results will become more and more inaccurate, and the motion trajectory thus drawn will also be more and more different from the user's actual motion trajectory. Summary of the invention

[0005] In view of this, the purpose of the present application is to provide a trajectory optimization method, device, electronic device and storage medium to improve the accuracy of the motion trajectory drawn by the electronic device.

[0006] In a first aspect, the present application provides a trajectory optimization method, which includes: obtaining positioning data of an electronic device, the positioning data including longitude and latitude; generating a positioning result of an initial positioning point based on the longitude and latitude of at least two consecutive positioning points that meet preset high-precision positioning point conditions; and determining a positioning result of a first positioning point and a trajectory of the electronic device based on the positioning result of the initial positioning point.

[0007] Since the positioning result of the initial positioning point is generated based on the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions, the accuracy of the positioning result of the initial positioning point can be improved. The positioning result of the first positioning point is obtained based on the positioning result of the initial positioning point, and the accuracy of the positioning result of the first positioning point can be improved. The trajectory of the electronic device determined based on the positioning result of the initial positioning point and the positioning result of the first positioning point will be more accurate and close to the actual running trajectory of the user.

[0008] In combination with the first aspect, in a possible implementation, in the step of acquiring the positioning data of the electronic device, the positioning data also includes one or more of altitude, position precision factor, number of satellites, positioning level, horizontal accuracy, and vertical accuracy.

[0009] In combination with the first aspect, in a possible implementation method, in the step of generating a positioning result of an initial positioning point based on the longitude and latitude of at least two consecutive positioning points that meet preset high-precision positioning point conditions, the preset high-precision positioning point conditions include: the change in altitude, one or more of the position precision factor, the number of satellites, the positioning level, the horizontal accuracy, and the vertical accuracy meets the preset conditions.

[0010] In combination with the first aspect, in a possible implementation method, in the step of generating a positioning result of an initial positioning point based on the longitude and latitude of at least two consecutive positioning points that meet a preset high-precision positioning point condition, the preset high-precision positioning point condition includes at least one of the following conditions: the change in altitude is less than or equal to a set altitude change threshold; the position accuracy factor is less than or equal to a set position accuracy factor threshold; the number of satellites is greater than or equal to a set satellite number threshold.

[0011] In combination with the first aspect, in a possible implementation method, in the step of generating a positioning result of an initial positioning point based on the longitude and latitude of at least two consecutive positioning points that meet a preset high-precision positioning point condition, the preset high-precision positioning point condition includes at least one of the following conditions: a position accuracy factor is less than or equal to a set position accuracy factor threshold; and a positioning level is within a set positioning level range.

[0012] In combination with the first aspect, in a possible implementation method, in the step of generating a positioning result of an initial positioning point based on the longitude and latitude of at least two consecutive positioning points that meet preset high-precision positioning point conditions, the preset high-precision positioning point conditions include at least one of the following conditions: the horizontal accuracy is within a set horizontal accuracy threshold range; the vertical accuracy is within a set vertical accuracy threshold range.

[0013] In combination with the first aspect, in a possible implementation method, the step of generating a positioning result of an initial positioning point based on the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions includes: using the average value of the longitude and latitude of the at least two consecutive positioning points as the positioning result of the initial positioning point of the electronic device, or using the longitude and latitude of any one of the at least two consecutive positioning points as the positioning result of the initial positioning point of the electronic device.

[0014] A second aspect of the present application provides a trajectory optimization device, which includes: an acquisition module, used to acquire positioning data of an electronic device, the positioning data including longitude and latitude; a first processing module, used to generate a positioning result of an initial positioning point based on the longitude and latitude of at least two consecutive positioning points that meet preset high-precision positioning point conditions; a second processing module, used to determine the positioning result of the first positioning point and the trajectory of the electronic device based on the positioning result of the initial positioning point.

[0015] In combination with the second aspect, in a possible implementation, the positioning data also includes one or more of altitude, position precision factor, number of satellites, positioning level, horizontal accuracy, and vertical accuracy.

[0016] In combination with the second aspect, in a possible implementation method, the preset high-precision positioning point conditions include: the change in altitude, one or more of the position precision factor, the number of satellites, the positioning level, the horizontal accuracy, and the vertical accuracy meet the preset conditions.

[0017] In combination with the second aspect, in a possible implementation method, the first processing module is specifically used to: use the average value of the longitude and latitude of at least two consecutive positioning points as the positioning result of the initial positioning point of the electronic device, or use the longitude and latitude of any one of the at least two consecutive positioning points as the positioning result of the initial positioning point of the electronic device.

[0018] A third aspect of the present application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, the trajectory optimization method in the first aspect and any possible implementation manner of the first aspect is implemented.

[0019] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the trajectory optimization method in the first aspect of the present application and any possible implementation method of the first aspect is implemented.

[0020] The present application provides a trajectory optimization method, device, electronic device and storage medium, the method comprising: obtaining positioning data of an electronic device, the positioning data comprising longitude and latitude; generating a positioning result of an initial positioning point according to the longitude and latitude of at least two consecutive positioning points that meet preset high-precision positioning point conditions; determining a positioning result of a first positioning point and a trajectory of the electronic device according to the positioning result of the initial positioning point.

[0021] Since the positioning result of the initial positioning point is generated based on the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions, the accuracy of the positioning result of the initial positioning point can be improved. The positioning result of the first positioning point is obtained by weighted average of the longitude and latitude of the first positioning point and the positioning result of the initial positioning point, so the accuracy of the positioning result of the first positioning point can be improved. The trajectory of the electronic device determined based on the positioning result of the initial positioning point and the positioning result of the first positioning point will be more accurate and close to the actual movement trajectory of the user.

[0022] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A schematic diagram of a communication scenario between an electronic device and a satellite system provided in an embodiment of the present application;

[0025] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application;

[0026] Figure 3A schematic diagram of a flow chart of a trajectory optimization method provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a process for obtaining a positioning result of an initial positioning point of an electronic device provided in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of a process for obtaining a positioning result of a first positioning point provided in an embodiment of the present application;

[0029] Figure 6 Another schematic diagram of a flow chart of a trajectory optimization method provided in an embodiment of the present application;

[0030] Figure 7 A schematic diagram of a flow chart of a trajectory optimization method for an electronic device provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of a flow chart of a trajectory optimization method for an electronic device provided in an embodiment of the present application;

[0032] Fig. 9 A functional module diagram of a trajectory optimization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0034] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0035] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0036] With the development of global positioning and navigation systems such as the Global Navigation Satellite System (GNSS) and the Beidou Navigation Satellite System (BDS), a large number of electronic devices can determine the user's real-time location point based on the global positioning and navigation system, and thus draw the user's movement trajectory based on the user's real-time location point.

[0037] See also Figure 1 , Figure 1 A schematic diagram of a communication scenario between an electronic device and a satellite system is provided. The scenario may include an electronic device 101 and a satellite system 102. In the present application, the electronic device 101 may include but is not limited to electronic devices such as mobile terminals and Internet of Things devices, and the satellite system may include but is not limited to global positioning and navigation systems such as GNSS and BDS. The mobile terminal may include wearable devices such as smart bracelets, watches, headphones, glasses, helmets, etc. that can be worn by users, and may also include terminal devices such as mobile phones, tablet computers, and personal digital assistants (PDAs). It should be noted that the mobile terminal may be based on an embedded system, may be based on an Android system, may be based on an IOS (mobile operating system developed by Apple) system, may be based on a Windows system, etc., and there is no limitation here. The Internet of Things device may include Internet of Things devices such as sweepers, robots, routers, gateways, etc.

[0038] The electronic device 101 can communicate with the satellite system 102 through a communication protocol that matches the satellite system. For example, if the satellite system is a GNSS, the communication can be performed through a communication protocol established by the National Marine Electronics Association (NMEA).

[0039] The information frame transmitted by the satellite system 102 through the NMEA protocol may include parameter information such as satellite time, longitude and latitude of the electronic device, and number of satellites. In a specific case, the information frame sent by the satellite system 102 may adopt the global positioning system fix data (GGA) format. The GGA format may include message code, standard positioning time (hours, minutes, seconds, seconds, seconds), latitude (degrees, minutes, minutes, minutes), northern hemisphere or southern hemisphere indicator (N or S), longitude (degrees, minutes, minutes, minutes), eastern hemisphere or western hemisphere indicator (E or W), number of satellites used (00 to 12), position precision factor (0.5 to 99.9 meters), altitude (-9999.9 meters to 9999.9 meters) and other parameters, which will not be repeated here.

[0040] See also Figure 2 , an embodiment of the present application provides a block diagram of an electronic device 101. The electronic device can be used to execute any trajectory optimization method provided in the present application. The electronic device 101 includes: a processor 1011, a memory 1012, a communication module 1013, and a wireless positioning module 1014.

[0041] The memory 1012, processor 1011, communication module 1013 and wireless positioning module 1014 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0042] The memory 1012 is used to store programs or data. The memory 1012 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0043] The processor 1011 is used to read / write data or programs stored in the memory 1012 and execute corresponding functions. For example, when the computer program stored in the memory 1012 is executed by the processor 1011, the trajectory optimization method provided in the embodiment of the present application can be implemented.

[0044] The communication module 1013 is used to establish a communication connection between the electronic device 101 and other devices, and to send and receive data.

[0045] In this embodiment, the communication module 1013 may include, but is not limited to, a Bluetooth module, a cellular communication module, etc. Among them, the electronic device 101 can be bound to the terminal device through the Bluetooth module. After the electronic device 101 and the terminal device establish a binding relationship, whenever the electronic device 101 and the terminal device are close to a certain distance, the Bluetooth module of the electronic device 101 can be connected to the Bluetooth module of the terminal device, thereby establishing a short-distance communication channel between the electronic device 101 and the terminal device. After the cellular communication module of the electronic device 101 is turned on, the electronic device 101 can perform remote wireless communication with the network device through the cellular communication module.

[0046] The wireless positioning module 1014 is used to provide positioning services to facilitate the implementation of navigation, map and other functions of the electronic device 101.

[0047] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the electronic device 101. The electronic device 101 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0048] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the trajectory optimization method in any one of the embodiments provided in the present application can be implemented.

[0049] The current electronic device 101 mainly relies on the wireless positioning module 1014 to achieve positioning. However, the positioning result of the wireless positioning module 1014 is easily affected by the environment. Specifically, there are at least three reasons that may cause inaccurate positioning of the electronic device:

[0050] 1) The location of the electronic device: If the electronic device is in an open area and can receive satellite signals of good quality, the positioning result determined by the electronic device will be relatively accurate. On the contrary, in a place with many obstacles, the satellite signals that can be received are relatively limited, and the determined positioning result will have a large error.

[0051] 2) Satellite signal propagation path: Satellite signals may not be direct point-to-point signals from satellite to electronic devices. Instead, the signals transmitted by satellite are received by electronic devices after being reflected and / or refracted by other objects. In this way, the signal quality of the satellite signal will deteriorate after being reflected or refracted by other objects, which will also affect the positioning results.

[0052] 3) The frequency at which electronic devices receive satellite signals: Although satellites are constantly broadcasting their location signals, electronic devices may not be receiving them all the time due to power consumption considerations. Electronic devices may receive satellite signals at a specific frequency, which may result in the positioning results not being real-time, and thus affect the positioning results.

[0053] Therefore, data drift often occurs during the positioning process of electronic devices. That is, the positioning result obtained by the electronic device through communication with the satellite system is quite different from the actual position of the electronic device. This further causes the user's motion trajectory drawn by the electronic device to appear wavy, which is not consistent with the user's actual motion trajectory, and the smoothness of the drawn motion trajectory is also low, resulting in a poor user sensory experience.

[0054] Therefore, this application provides a trajectory optimization method, see Figure 3 , the method comprising:

[0055] S201: Acquire positioning data of an electronic device.

[0056] The positioning data of the electronic device is obtained, and the positioning data includes: longitude and latitude, and one or more of altitude, position precision factor, number of satellites, positioning level, horizontal precision, and vertical precision.

[0057] Different types of electronic devices may obtain different positioning data due to different communication protocols. Specifically, for example, if the electronic device is a mobile terminal based on an embedded system, the positioning data may include: longitude and latitude, altitude, position precision factor, number of satellites, etc. For example, if the electronic device is a mobile terminal based on an Android system, the positioning data may include: longitude and latitude, position precision factor, positioning level, etc. For example, if the electronic device is a mobile terminal based on an IOS system, the positioning data may include: longitude and latitude, horizontal accuracy, vertical accuracy, etc.

[0058] Among them, in the navigation and positioning of the navigation satellite system, the geometric precision factor (DOP, dilution of precision, also translated as the precision attenuation factor) is used to measure the impact of the spatial geometric distribution of the observed satellite on the positioning accuracy. DOP is divided into the following types: PDOP (position dilution of precision) three-dimensional position precision factor, which is the square root of the sum of squares of errors such as latitude, longitude and elevation, and is related to the geometric distribution of the satellite; TDOP (time dilution of precision) clock error precision factor, which is the error value of the time table offset in the receiver; HDOP (horizontal dilution of precision) horizontal component precision factor: the square root of the sum of squares of errors such as latitude and longitude; VDOP (vertical dilution of precision) is the vertical component precision factor. The size of the DOP value is proportional to the error of GPS positioning. The larger the DOP value, the larger the positioning error, and the lower the positioning accuracy. In the present application scheme, the position precision factor refers to the DOP, the horizontal accuracy refers to the HDOP, and the vertical accuracy refers to the VDOP.

[0059] The electronic device may obtain positioning data in a manner as described in the NMEA protocol, but is not limited thereto. It should be noted that the positioning data is bound to the positioning point. Specifically, each positioning point has positioning data corresponding to the positioning point.

[0060] S202: Generate a positioning result of an initial positioning point of the electronic device.

[0061] The electronic device generates a positioning result of an initial positioning point of the electronic device. The positioning result of the initial positioning point is obtained based on the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions.

[0062] Take the electronic device as a mobile terminal based on an embedded system as an example, see Figure 4 The electronic device generating the initial positioning result may further include:

[0063] S2021. Determine whether the positioning data of each of at least two consecutive positioning points meets a preset high-precision positioning point condition.

[0064] The electronic device first obtains positioning data of at least two consecutive positioning points. As described above, the electronic device can receive satellite signals at a fixed frequency, and the positioning data of the at least two consecutive positioning points can be positioning data received continuously by the electronic device at least twice. For example, if the electronic device receives a satellite signal once every 0.1 milliseconds, the positioning data of the at least two consecutive positioning points can be positioning data received continuously by the electronic device at least two times every 0.1 milliseconds.

[0065] The electronic device may receive a data packet from a satellite system according to the aforementioned NMEA protocol. After receiving the data packet, the electronic device may parse the positioning data from the data packet. The parsed positioning data may include but is not limited to latitude and longitude, altitude, position precision factor, number of satellites, positioning level, horizontal accuracy, and vertical accuracy.

[0066] In a specific example, the data packet may be: $GPGGA, 161229.487, 3723.2475, N, 12158.3416, W, 1, 07, 1.0, 9.0, M,,,, 0000*18. In the data packet, the meanings are as follows: $GPGGA is the message code. "161229.487" is the standard positioning time, and the digits are hour, minute, second, second, second, second, that is, the time is 16 hours, 12 minutes, 29.487 seconds. "3723.2475" represents latitude, "N" represents the northern hemisphere, and "12158.3416" represents longitude. "W" represents the western hemisphere. "1" represents the positioning code indicator. "07" represents the number of satellites used. "1.0" represents the position precision factor. "9.0" represents the altitude. "M" represents the altitude in meters. "0000" represents the reference base station code identification number. "*18" represents the checksum code.

[0067] The electronic device determines that the positioning data of each positioning point of at least two consecutive positioning points obtained meets a preset high-precision positioning point condition.

[0068] The preset high-precision positioning point conditions include: one or more of the change in altitude, position precision factor, number of satellites, positioning level, horizontal accuracy, and vertical accuracy meet the preset conditions.

[0069] If the electronic device is a mobile terminal based on an embedded system, the preset high-precision positioning point condition may include at least one of the following conditions: the change in altitude is less than or equal to the set altitude change threshold; the position precision factor is less than or equal to the set position precision factor threshold; the number of satellites is greater than or equal to the set satellite number threshold. Exemplarily, the set altitude change threshold may be 10 meters, the set position precision factor threshold may be 20, and the satellite number threshold may be 4. It should be noted that the above thresholds are only examples and cannot be used as a limitation on the scope of protection of this application. The smaller the altitude change, the smaller the position precision factor, and the more satellites there are, the more accurate the positioning data can be determined. It should be noted that the altitude change of the positioning point is the difference between the altitude of the positioning point and the altitude of the positioning point adjacent to the positioning point and before the positioning time of the positioning point. The smaller the altitude change of the positioning point, the smaller the probability of positioning deviation. In addition, when the electronic device is started, the first positioning point does not have the altitude difference, and the altitude difference of the first positioning point can be regarded as 0.

[0070] If the electronic device is a mobile terminal based on the Android system, the preset high-precision positioning point condition may include at least one of the following conditions: the position accuracy factor is less than or equal to a set position accuracy factor threshold; the positioning level is within a set positioning level range.

[0071] If the electronic device is a mobile terminal based on the IOS system, the preset high-precision positioning point condition may include at least one of the following conditions: the horizontal accuracy is within a set horizontal accuracy threshold range; the vertical accuracy of the positioning point is within a set vertical accuracy threshold range.

[0072] The electronic device needs to determine that the positioning data of each positioning point in at least two consecutive positioning points meets the preset high-precision positioning point conditions. If one positioning point in the at least two consecutive positioning points does not meet the conditions, the electronic device needs to recalculate the at least two consecutive positioning points.

[0073] In one embodiment, the electronic device may be provided with a counter or a program control module with a counting function. In the dynamic process of continuously acquiring the positioning data of the positioning point, when a positioning point that meets the preset high-precision positioning point condition is determined, 1 is added to the counter. If within the set continuous positioning point number range, a positioning point that does not meet the preset high-precision positioning point condition continues to appear, the timer is cleared and the counting starts again until the number of continuous positioning points that meet the preset high-precision positioning point condition reaches the preset number range. In this way, it can be ensured that at least two continuous positioning points can be acquired, and the positioning data of each of the at least two continuous positioning points meets the preset high-precision positioning point condition. By determining that the positioning data of each of the at least two positioning points meets the preset high-precision positioning point condition, it can be determined that the positioning of the electronic device during this period of time is relatively accurate.

[0074] S2022. Generate a positioning result of an initial positioning point according to the longitude and latitude of at least two consecutive positioning points that meet preset high-precision positioning point conditions.

[0075] A positioning result of the initial positioning point is generated according to the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions.

[0076] It should be noted that if the electronic device is a mobile terminal based on an embedded system, due to the limitation of the firmware of the wireless positioning module itself in the mobile terminal, the positioning accuracy of the mobile terminal based on the embedded system is relatively limited. Preferably, when it can be determined that the positioning data of each of the five consecutive positioning points meets the preset high-precision positioning point conditions, the positioning result of the initial positioning point is generated according to the longitude and latitude of the five consecutive positioning points. Generally speaking, the performance of the wireless positioning module of the mobile terminal of the Android system or the IOS system is better than that of the wireless positioning module of the mobile terminal based on the embedded system. If the electronic device is a mobile terminal based on the Android system or the IOS system, the mobile terminal can determine that when the three consecutive positioning points meet the preset high-precision positioning point conditions, the positioning result of the initial positioning point is generated according to the longitude and latitude of the three consecutive positioning points.

[0077] If there are at least two consecutive positioning points that meet the preset high-precision positioning point conditions, it means that the positioning is relatively accurate within this period of time, and the positioning result of the initial positioning point determined according to the latitude and longitude of the at least two consecutive positioning points is relatively accurate.

[0078] In one embodiment, the electronic device may use the average value of the longitude and latitude of the at least two consecutive positioning points as the positioning result of the initial positioning point. Specifically, the average value of the longitude of the at least two consecutive positioning points may be used as the longitude of the initial positioning point, and the average value of the latitude of the at least two consecutive positioning points may be used as the latitude of the initial positioning point. Taking the average value of the longitude and latitude of the at least two consecutive positioning points as the positioning result of the initial positioning point can reduce the individual error of the longitude and latitude of each positioning point in the at least two consecutive positioning points, so as to improve the accuracy of the positioning result of the initial positioning point.

[0079] In another embodiment, the longitude and latitude of any one of the at least two continuous positioning points can be selected as the positioning result of the initial positioning point of the electronic device. Specifically, the longitude of any one of the at least two continuous positioning points can be selected as the longitude of the initial positioning point, and the latitude of the selected arbitrary positioning point can be used as the latitude of the initial positioning point. When the at least two continuous positioning points both meet the preset high-precision positioning point conditions, it means that the positioning is relatively accurate within this time range, and it can be considered that the longitude and latitude of the at least two continuous positioning points are accurate, and the longitude and latitude of any one of the at least two continuous positioning points can be taken as the positioning result of the initial positioning point.

[0080] Then the electronic device can obtain the longitude and latitude of the initial positioning point, that is, the positioning result of the initial positioning point. It can be understood that the movement speed, number of satellites, and position precision factor of the initial positioning point. It can also be obtained in the same way as the longitude and latitude of the initial positioning point. Taking the movement speed as an example, the movement speed of the initial positioning point can be the average of the movement speeds of the at least two consecutive positioning points, or the movement speed of any one of the at least two consecutive positioning points. It should be pointed out that the method for determining the longitude and latitude of the initial positioning point, the movement speed, the number of satellites, and the position precision factor can remain consistent. For example, the average of the longitude and latitude, the movement speed, the number of satellites, and the position precision factor of the at least two consecutive positioning points can be taken.

[0081] It should be noted that if the electronic device cannot determine at least two consecutive positioning points that meet the preset high-precision positioning point conditions, it means that the positioning of the electronic device during this period is relatively inaccurate, and it is possible that the current location of the electronic device is in a place with many obstacles. Then the electronic device can prompt the user to reposition in a place with less obstruction and more open to avoid positioning errors.

[0082] S203: Determine the positioning result of the first positioning point.

[0083] After the electronic device has obtained the positioning result of the initial positioning point, the electronic device can obtain the longitude and latitude of the first positioning point. It should be noted that the first positioning point is a positioning point adjacent to the last positioning point among the at least two continuous positioning points that meet the preset high-precision positioning point conditions, and the positioning time of the first positioning point is after the positioning time of the last positioning point. Specifically, if the positioning result of the initial positioning point is the average of the longitude and latitude of the first, second, third, fourth, and fifth positioning points, or the positioning result of the initial positioning point is the longitude and latitude of any one of the first to fifth positioning points. Then the first positioning point is the sixth positioning point adjacent to the fifth positioning point. The positioning time of the sixth positioning point is after the positioning time of the fifth positioning point, and the sixth positioning point and the fifth positioning point are two adjacent and continuous positioning points. The way in which the electronic device obtains the longitude and latitude of the first positioning point can be referred to above, and will not be repeated here.

[0084] After the electronic device obtains the positioning result of the initial positioning point and the longitude and latitude of the first positioning point, the electronic device performs weighted average processing on the positioning result of the initial positioning point and the longitude and latitude of the first positioning point to obtain the positioning result of the first positioning point.

[0085] It should be noted that, in the process of obtaining the positioning result of the first positioning point, the weight of the weighted average can adjust the degree of confidence between the positioning result of the initial positioning point and the longitude and latitude of the first positioning point. If the weight is larger, the electronic device can determine the longitude and latitude of the first positioning point more accurately, and the positioning result of the first positioning point has a higher degree of confidence in the longitude and latitude of the first positioning point. Conversely, if the weight is smaller, the electronic device can determine the longitude and latitude of the first positioning point less accurately, and the positioning result of the first positioning point has a lower degree of confidence in the longitude and latitude of the first positioning point, and a higher degree of confidence in the positioning result of the initial positioning point. In this way, the positioning result of the first positioning point and the degree of confidence between the positioning result of the initial positioning point and the longitude and latitude of the first positioning point can be balanced to obtain a relatively balanced and accurate positioning result.

[0086] For details, see Figure 5 According to the positioning result of the initial positioning point, the method for determining the positioning result of the first positioning point may specifically include:

[0087] S2031. Determine the weight of the weighted average.

[0088] It should be noted that the weight of the weighted average is associated with the first positioning point. In one embodiment, the electronic device can determine the weight of the weighted average processing according to at least one of the position precision factor, number of satellites, positioning level, horizontal accuracy, and vertical accuracy corresponding to the first positioning point.

[0089] In another embodiment, the electronic device may also determine the weight of the weighted average processing according to the motion state of the user corresponding to the first positioning point, and at least one of the user's motion speed. The motion state of the user can be obtained through the interaction between the electronic device and the user. For example, the electronic device can receive one of walking, running, and riding selected by the user through the graphical interface of the electronic device, thereby determining that the user has selected one of the three as the user's motion state. The user's motion speed can be generated by a motion sensor in the electronic device, for example, by calculating and determining relevant sensor data obtained by motion sensors such as accelerometers, gyroscopes, and magnetometers, which will not be described in detail here. The number of satellites and the position precision factor can be obtained from the satellite system through the above-mentioned communication protocol such as NMEA, which will not be described in detail here.

[0090] It should be noted that the electronic device can also determine the weight of the weighted average processing based on at least one of the position accuracy factor corresponding to the first positioning point, the number of satellites, the positioning level, the horizontal accuracy, the vertical accuracy, the user's motion state, and the user's motion speed.

[0091] 1. In one implementation, the weight can be determined based on any one or more of the following: motion state, motion speed, number of satellites, and position precision factor.

[0092] 1.1. It should be noted that when the motion state is the first motion state, the weight determination rule is shown in the following table (Table 1), and the first motion state may be walking:

[0093] Table 1

[0094] Value Value Movement speed First speed range Second speed range Number of satellites The first satellite number range Second satellite number range Position Dilution of Precision First Position Dilution of Precision Range Second position DOP range Weight α The first weight value The second weight

[0095] It should be explained that when it is determined that the user's motion state is the first motion state, the motion speed is within the first speed range, the number of satellites is within the first satellite number range, and the position precision factor is within the first position precision factor range, when one or more of these four conditions are met, the electronic device can determine that the weight is the first weight value. In a specific example, when the user's first motion state is walking, the first speed range is less than 1 meter per second, the first number of satellites is greater than 10, and the first position precision factor is less than 3, the weight value is 0.6. That is, when the user's motion speed state is walking, the speed is less than 1 meter per second, the number of satellites is greater than 10, and the position precision factor is less than 3, when one or more of these four conditions are met, the electronic device determines that the weight value of the current positioning point is 0.6. The above examples cannot be used as limitations on the scope of protection of this application.

[0096] When it is determined that the user's motion state is the first motion state, the motion speed is within the second speed range, the number of satellites is within the second satellite number range, and the position precision factor is within the second position precision factor range, and one or more of these four conditions are met, the electronic device can determine that the weight is the second weight value. In a specific example, when the user's first motion state is walking, the second speed range is greater than 5 meters per second, the second number of satellites is less than 4, and the first position precision factor range is greater than 20, the weight value is 0.1. That is, when the user's motion speed state is walking, the speed is greater than 5 meters per second, the number of satellites is less than 4, and the position precision factor is greater than 20, and one or more of these four conditions are met, the electronic device determines that the weight value of the current positioning point is 0.1. The above examples cannot be used as limitations on the scope of protection of this application.

[0097] For the same type of sport, the faster the user's movement speed, the less accurate the longitude and latitude of the first positioning point may be. Therefore, under the premise of the same type of sport, the faster the user's movement speed, the smaller the weight value of the current positioning point can be set, which can reduce the problem of inaccurate longitude and latitude of the current positioning point.

[0098] 1.2. When the motion state is the second motion state, the weight determination rule is shown in the following table (Table 2), and the second motion state may be running:

[0099] Table 2

[0100] Value Value Movement speed Third speed range Fourth speed range Number of satellites The third satellite number range The fourth satellite number range Position Dilution of Precision Third Position DOP Range Fourth position precision range Weight α The third weight Fourth weight value

[0101] When it is determined that the user's motion state is the second motion state, the motion speed is within the third speed range, the number of satellites is within the third satellite number range, and the position precision factor is within the third position precision factor range, and one or more of these four conditions are met, the electronic device can determine that the weight is the third weight value. In a specific example, when the user's second motion state is running, the third speed range is less than 5 meters per second, the third number of satellites is greater than 10, and the third position precision factor range is less than 3, the value of the weight is 0.7. The above examples cannot be used as limitations on the scope of protection of this application.

[0102] When it is determined that the user's motion state is the second motion state, the motion speed is in the fourth speed range, the number of satellites is within the fourth satellite number range, and the position precision factor is within the fourth position precision factor range, and one or more of these four conditions are met, the weight is determined to be the fourth weight value. In a specific example, when the user's second motion state is running, the fourth speed range is greater than 8 meters per second, the fourth satellite number range is less than 4, and the fourth position precision factor range is greater than 20, the weight value is 0.15. The above examples cannot be used as limitations on the scope of protection of this application.

[0103] 1.3. When the motion state is the third motion state, the weight determination rule is shown in the following table (Table 3), and the third motion state may be riding:

[0104] Table 3

[0105] Value Value Movement speed Fifth speed range Sixth speed range Number of satellites The fifth satellite number range The sixth satellite number range Position Dilution of Precision Fifth Position Dilution of Precision Range Sixth Position Dilution of Precision Range Weight α Fifth weight value Sixth weight value

[0106] When it is determined that the user's motion state is the third motion state, the motion speed is in the fifth speed range, the number of satellites is within the fifth satellite number range, and the position precision factor is within the fifth position precision factor range, and one or more of these four conditions are met, the weight is determined to be the fifth weight value. In a specific example, when the user's second motion state is riding, the fifth speed range is less than 15 meters per second, the fifth satellite number range is greater than 10, and the fifth position precision factor range is less than 3, the weight value is 0.8. The above examples cannot be used as limitations on the scope of protection of this application.

[0107] When it is determined that the user's motion state is the third motion state, the motion speed is in the sixth speed range, the number of satellites is within the sixth satellite number range, and the position precision factor is within the sixth position precision factor range, and one or more of these four conditions are met, the weight is determined to be the sixth weight value. In a specific example, when the user's third motion state is cycling, the sixth speed range is greater than 25 meters per second, the sixth satellite number range is less than 4, and the sixth position precision factor range is greater than 20, the weight value is 0.25. The above examples cannot be used as limitations on the scope of protection of this application.

[0108] 2. The weight may also be related to the position precision factor and / or the number of satellites.

[0109] When the user's motion state is the first motion state, and the user's motion speed is within the seventh speed range; or when the user's motion state is the second motion state, and the user's motion speed is within the eighth speed range; or when the user's motion state is the third motion state, and the user's motion speed is within the ninth speed range, the weight determination rule can also be related to the position precision factor and / or the number of satellites of the current positioning point. The first motion state, the second motion state, and the third motion state are respectively: walking, running, and riding. Three implementation methods are given below, but they are not limitations of this application:

[0110] Specifically, in one implementation, the weight α=P0 / (P1+P0), where P1 is the position accuracy factor corresponding to the first positioning point, and P0 is the position accuracy factor corresponding to the initial positioning point. In this way, the influence of the position accuracy factor on the positioning result can be considered. When the position accuracy factor of the initial positioning point is smaller (higher accuracy), the weight α is larger, the positioning result of the initial positioning point has a greater influence on the positioning result of the first positioning point, and the positioning result of the first positioning point trusts the positioning result of the initial positioning point more. On the contrary, the latitude and longitude of the first positioning point are more trusted.

[0111] In another embodiment, the weight α=Q0 / (Q1+Q0), where Q0 is the number of satellites corresponding to the initial positioning point, and Q1 is the number of satellites corresponding to the first positioning point. When the number of satellites at the initial positioning point is greater, the weight α is greater, the positioning result of the initial positioning point has a greater impact on the positioning result of the first positioning point, and the positioning result of the first positioning point trusts the positioning result of the initial positioning point more. Conversely, the latitude and longitude of the first positioning point are more trusted.

[0112] In another embodiment, the weight α=P0 / (P0+P1)×Q0 / (Q0+Q1), where P1 is the position precision factor corresponding to the first positioning point, and P0 is the position precision factor corresponding to the initial positioning point. Q0 is the number of satellites corresponding to the initial positioning point, and Q1 is the number of satellites corresponding to the first positioning point. When the position precision factor of the initial positioning point is smaller, and / or the number of satellites of the initial positioning point is more, the weight α is larger, the positioning result of the initial positioning point has a greater impact on the positioning result of the first positioning point, and the positioning result of the first positioning point trusts the positioning result of the initial positioning point more. On the contrary, the latitude and longitude of the first positioning point are more trusted.

[0113] It should be noted that the seventh speed range is different from the first speed range and the second speed range. The eighth speed range is different from the third speed range and the fourth speed range. The ninth speed range is different from the fifth speed range and the sixth speed range. Specifically, if the first speed range is less than 1 meter per second and the second speed range is greater than 5 meters per second, the seventh speed range may be greater than or equal to 1 meter per second and less than or equal to 5 meters per second. If the third speed range is less than 5 meters per second and the fourth speed range is greater than 8 meters per second, the eighth speed range may be less than or equal to 5 meters per second and less than or equal to 8 meters per second. If the fifth speed range is less than 15 meters per second and the sixth speed range is greater than 25 meters per second, the ninth speed range may be greater than or equal to 15 meters per second and less than or equal to 25 meters per second.

[0114] 3. The weight may also be related to the user's movement speed.

[0115] The weight is positively correlated with the user's movement speed. It should be noted that the faster the user's movement speed, the latitude and longitude output of the first positioning point will lag further behind the user's actual position. If the weight value is set to a relatively low value, the final positioning result of the first positioning point will be significantly different from the user's actual position. Therefore, the greater the movement speed, the more the user's movement speed can be considered. That is, the weight is set to be positively correlated with the user's movement speed.

[0116] Furthermore, generally speaking, when a user walks, runs, and rides, the average speed increases successively. Therefore, the weight value of the movement state of walking can be set to be greater than the weight value of the movement state of running, and the weight value of the movement state of running can be set to be greater than the weight value of the movement state of riding. In other words, the weight value corresponding to the movement state with a low movement speed is set to be greater than the weight value corresponding to the movement state with a high movement speed. This can reduce the problem of the lagging of the longitude and latitude of the first positioning compared to the actual position of the user. The positioning result of the first positioning point can be made more accurate in different movement states.

[0117] 4. The weight can also be directly determined to be 0 according to the movement speed or position precision factor.

[0118] In particular, in some special cases, the weight α can be directly determined to be 0. Exemplarily, if the user's movement speed is determined to be zero through a motion sensor, such as an accelerometer, a gyroscope, a magnetometer, etc., that is, when the user is in a stationary state, the weight α can be directly determined to be 0, and only the user's initial positioning result can be trusted, and the user's initial positioning result can be directly used as the positioning result of the first positioning point. For another example, when the position accuracy factor is within the range of the seventh position accuracy factor, the weight α is determined to be 0. If the position accuracy factor is within the range of the seventh position accuracy factor, it means that the position accuracy is low and the positioning accuracy is low. For example, the position accuracy factor output by the NMEA protocol ranges from 0 to 99. The lower the position accuracy factor, the more accurate the positioning. The seventh position accuracy factor can be greater than 50. A position accuracy factor greater than 50 is considered to be too large a deviation, and the weight can be directly determined to be 0.

[0119] S2032: Determine a positioning result of the first positioning point according to the weight of the weighted average.

[0120] The positioning result of the first positioning point is determined according to the weight α of the weighted average. Specifically, the positioning result of the first positioning point can be calculated using the following formula: Y1 = (1-α)Y0 + αX1, where Y1 is the positioning result of the first positioning point, Y0 is the positioning result of the first initial positioning point, X1 is the longitude and latitude of the first positioning point, and α is the weighted average weight determined in the above step S2031.

[0121] S204: Determine the trajectory of the electronic device according to the positioning result of the initial positioning point and the positioning result of the first positioning point.

[0122] The trajectory of the electronic device is determined and drawn according to the positioning result of the initial positioning point and the positioning result of the first positioning point. It should be noted that the trajectory drawn by the electronic device is drawn step by step. Connecting the initial positioning point and the first positioning point can determine a small section of the trajectory. When the next positioning point is reached, the first positioning point and the next positioning point can be connected again to determine the next section of the trajectory. Thus, a long trajectory of the electronic device over a period of time is gradually drawn.

[0123] The above embodiment provides a trajectory optimization method, in which, since the positioning result of the initial positioning point is obtained based on the longitude and latitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions, the accuracy of the positioning result of the initial positioning point can be improved, and the positioning result of the first positioning point is obtained by weighted average of the longitude and latitude of the first positioning point and the positioning result of the initial positioning point, the accuracy of the positioning result of the first positioning point can be improved. The trajectory of the electronic device drawn based on the positioning result of the initial positioning point and the positioning result of the first positioning point will be more accurate and close to the actual running trajectory of the user.

[0124] The above embodiment draws a small section of the electronic device's trajectory based on the positioning result of the initial positioning point and the positioning result of the first positioning point. After drawing the small section of the trajectory, the next small section of the trajectory can be drawn based on the positioning result of the current positioning point and the positioning result of the previous positioning point each time the positioning result of the current positioning point is determined. In this way, the complete trajectory of the electronic device is gradually drawn.

[0125] See also Figure 6 , the trajectory optimization method may further include:

[0126] S301, obtaining the positioning result of the previous positioning point and the longitude and latitude of the current positioning point.

[0127] Determine the positioning result of the previous positioning point and the longitude and latitude of the current positioning point. The previous positioning point and the current positioning point are two adjacent positioning points, and the positioning time of the previous positioning point is before the positioning time of the current positioning point.

[0128] Exemplarily, if the previous positioning point is the initial positioning point in the above embodiment, the current positioning point may be the first positioning point in the above embodiment. If the previous positioning point is the first positioning point in the above embodiment, the current positioning point may be the second positioning point, and the second positioning point may be a positioning point after the first positioning point and adjacent to the first positioning point. After the positioning result of the first positioning point is determined in the above embodiment, the positioning result of the second positioning point may be determined based on the positioning result of the first positioning point and the longitude and latitude of the second positioning point. In turn, after determining the positioning result of the second positioning point, the positioning result of the third positioning point may be determined based on the positioning result of the second positioning point and the longitude and latitude of the third positioning point, and the third positioning point may be a positioning point after the second positioning point and adjacent to the second positioning point. By analogy, the optimized positioning result is calculated based on the longitude and latitude of the subsequent positioning points.

[0129] The method of determining the longitude and latitude of the current positioning point can be understood by referring to the method of determining the longitude and latitude of the first positioning point in the above embodiment, which will not be repeated here. The method of determining the positioning result of the previous positioning point can be understood by referring to the positioning result according to the initial positioning point and the longitude and latitude of the first positioning point in the above embodiment, which will not be repeated here.

[0130] S302: Determine the weight of the weighted average.

[0131] Determine the weight α of the weighted average. It should be noted that the weight α of the weighted average corresponds to the current positioning point, that is, the weight α of each positioning point needs to be calculated based on the relevant information of the current positioning point. The process of determining the weight α can be understood with reference to the above-mentioned step S2031. In the process of determining the weight α, the current positioning point corresponds to the first positioning point in step S2031, and the previous positioning point corresponds to the initial positioning point in step S2031. They can be understood accordingly and will not be repeated here. It should be pointed out that the weight α determined here is related to at least one of the motion state, motion speed, number of satellites, position precision factor, positioning level, horizontal accuracy, and vertical accuracy corresponding to the current positioning point. The motion state, motion speed, number of satellites and position precision factor are all associated with the current positioning point.

[0132] S303: Determine the positioning result of the current positioning point.

[0133] According to the positioning result of the previous positioning point and the longitude and latitude of the current positioning point, the positioning result of the current positioning point is determined. The determination process can be understood by referring to the above step S2032. In the process of determining the weight α, the current positioning point corresponds to the first positioning point in step S2032, and the previous positioning point corresponds to the initial positioning point in step S2032. It can be understood accordingly and will not be repeated here. Specifically, the positioning result of the current positioning point can be calculated using the following formula: Y t =(1-α)Y t-1 +αX t , where Y t-1 is the positioning result of the previous location, Y t is the positioning result of the current positioning point, X t is the longitude and latitude of the current positioning point, and α is the weight of the weighted average determined in the above step S302.

[0134] S304: Draw the trajectory of the electronic device according to the positioning result of the previous positioning point and the positioning result of the current positioning point.

[0135] The trajectory of the electronic device is drawn based on the positioning result of the previous positioning point and the positioning result of the current positioning point. This can be understood by referring to the above step S204, which will not be repeated here. In this way, each time the positioning result of a positioning point is obtained, the trajectory between the current positioning point and the previous positioning point can be drawn, and the long trajectory of the electronic device over a period of time can be gradually drawn.

[0136] It should be pointed out that the trajectory optimization method provided in the embodiment of the present application can not only be applied to mobile terminals based on embedded systems, but in actual use, the method can also be applied to other electronic devices such as terminal devices based on Android systems, terminal devices based on IOS systems, and Internet of Things devices. However, the communication protocols and communication signaling used by the terminal devices and Internet of Things devices to communicate with the satellite system may be different. Therefore, the positioning results of the determined positioning points will also have some corresponding differences, but within the spirit and principles of the present invention, any modifications, equivalent substitutions, improvements, etc. made should be included in the protection scope of the present invention. The present application also provides two trajectory optimization methods based on terminal devices, one is a terminal device using the Android system, and the other is an electronic device using the Apple operating system. Please refer to the following two embodiments for details.

[0137] When the electronic device is an Android-based terminal device, please refer to Figure 7 , the trajectory optimization method may include:

[0138] S401. Obtain the positioning result of the initial positioning point of the Android mobile terminal.

[0139] Obtain the positioning result of the initial positioning point of the mobile terminal based on the Android system. Please refer to steps S201, S202, and steps S2021 to S2022 in the above embodiment for understanding.

[0140] The difference is that the positioning data of the electronic device obtained by the Android mobile terminal may be different from that of the mobile terminal based on the embedded system. Similarly, the high-precision positioning point conditions determined by the Android mobile terminal may also be different from those of the mobile terminal based on the embedded system. The positioning data of the electronic device obtained by the Android mobile terminal may include but is not limited to: longitude and latitude, positioning accuracy, and positioning level.

[0141] When the Android mobile terminal determines that the positioning data of each of the at least two consecutive positioning points meets the preset high-precision positioning point condition, it is also necessary to determine that the positioning accuracy of each of the at least two positioning points is within the set position accuracy range, and the positioning level of each positioning point is within the set positioning level range. That is, the preset high-precision threshold positioning point condition may include at least one of: the position accuracy factor is less than or equal to the set position accuracy factor threshold, and the positioning level is within the set positioning level range.

[0142] The positioning result of the initial positioning point is determined based on the latitude and longitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions, which can be referred to in step S2022. However, since the positioning accuracy of the wireless positioning module in the mobile terminal based on the Android or IOS system is generally better than that of the mobile terminal based on the embedded system, the positioning result of the initial positioning point can be determined based on only three consecutive positioning points that meet the preset high-precision positioning point conditions.

[0143] S402: Obtain the longitude and latitude of the first positioning point.

[0144] The acquisition of the longitude and latitude of the first positioning point can be understood by referring to the above step S203, which will not be repeated here.

[0145] S403: Determine the positioning result of the first positioning point.

[0146] The positioning result of the initial positioning point and the longitude and latitude of the first positioning point are weighted averaged to obtain the positioning result of the first positioning point. This can be understood by referring to step S203 and steps S2031 to S2032 in the above embodiment.

[0147] The difference is that, unlike step S2031, the weight α of the weighted average is related to at least one of the motion state, motion speed, positioning accuracy, and positioning level of the user corresponding to the positioning point.

[0148] In a specific example, when the user's motion state is walking, the motion speed is less than 3 meters per second, and the positioning accuracy is less than 3, the value of the weight α of the current positioning point is determined to be 0.6.

[0149] When the user's motion state is walking, the motion speed is greater than 5 meters per second, and the positioning accuracy is greater than 20, the value of the weight α of the current positioning point is determined to be 0.1.

[0150] When the user's motion state is running, the motion speed is less than 5 meters per second, and the positioning accuracy is less than 3, the value of the weight α of the current positioning point is determined to be 0.7.

[0151] When the user's motion state is running, the motion speed is greater than 8 meters per second, and the positioning accuracy is greater than 20, the value of the weight α of the current positioning point is determined to be 0.2.

[0152] When the user's motion state is cycling, the motion speed is less than 15 meters per second, and the positioning accuracy is less than 3, the value of the weight α of the current positioning point is determined to be 0.8.

[0153] When the user's motion state is cycling, the motion speed is greater than 25 meters per second, and the positioning accuracy is greater than 20, the value of the weight α of the current positioning point is determined to be 0.3.

[0154] When the user's accuracy is between 3 and 20, the value of the weight α may be dynamically changed. Specifically, it may be related to the positioning accuracy. For example, the weight α may be calculated by the following formula: α=P0 / (P1+P0), where P1 is the positioning accuracy corresponding to the first positioning point, and P0 is the positioning accuracy corresponding to the initial positioning point.

[0155] Referring to step S2031, in some special cases, the value of the weight may also be directly determined to be 0.

[0156] After the weight α is determined, the positioning result of the first positioning point can be determined according to the weighted average weight α. This can be understood by referring to step S2032, which will not be described in detail here.

[0157] S404: Draw a trajectory of the electronic device according to the positioning result of the initial positioning point and the positioning result of the first positioning point.

[0158] The trajectory of the electronic device is drawn according to the positioning result of the initial positioning point and the positioning result of the first positioning point. Please refer to step S204 for understanding, which will not be repeated here.

[0159] It should be noted that after drawing the trajectory of the electronic device based on the positioning result of the initial positioning point and the positioning result of the first positioning point, the longitude and latitude of the next positioning point of the first positioning point can be further determined, so as to determine the positioning result of the next positioning point based on the positioning result of the first positioning point and the longitude and latitude of the next positioning point of the first positioning point, and then draw the trajectory of the next section of the electronic device. After that, the positioning result of the current positioning point can be determined each time based on the positioning result of the previous positioning point and the longitude and latitude of the current positioning point. The trajectory of the electronic device is determined based on the positioning result of the previous positioning point and the positioning result of the current positioning point. Please refer to steps S301 to S304 of the above embodiment for understanding, which will not be repeated here.

[0160] In another embodiment, when the electronic device is a mobile terminal based on the IOS system, see Figure 8 , the trajectory optimization method may include:

[0161] S501: Obtain the positioning result of the initial positioning point of the iOS mobile terminal.

[0162] Obtain the positioning result of the initial positioning point of the mobile terminal based on the iOS system. Please refer to steps S201, S202, and steps S2021 to S2022 in the above embodiment for understanding.

[0163] The difference is that the positioning data of the electronic device obtained by the IOS mobile terminal may be different from that of the mobile terminal based on the embedded system. The positioning data of the electronic device obtained by the IOS mobile terminal may include but is not limited to: longitude and latitude, horizontal accuracy, and vertical accuracy.

[0164] When the IOS mobile terminal determines that the positioning data of each of the at least two consecutive positioning points meets the preset high-precision positioning point condition, it is also necessary to determine that the horizontal accuracy of each of the at least two positioning points is within the set horizontal accuracy threshold range, and the vertical accuracy of each positioning point is within the set vertical accuracy threshold range. That is, the preset high-precision threshold positioning point condition may include: at least one of the horizontal accuracy is within the set horizontal accuracy threshold range and the vertical accuracy is within the set vertical accuracy threshold range.

[0165] The positioning result of the initial positioning point is determined according to the latitude and longitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions, which can be referred to in step S2022. However, since the firmware of mobile terminals based on Android or IOS systems is generally better than that of mobile terminals based on embedded systems, the positioning result of the initial positioning point can be determined based on only three consecutive positioning points that meet the preset high-precision positioning point conditions.

[0166] S502: Obtain the longitude and latitude of the first positioning point.

[0167] The acquisition of the longitude and latitude of the first positioning point can be understood by referring to the above step S203, which will not be repeated here.

[0168] S503: Determine the positioning result of the first positioning point.

[0169] The positioning result of the initial positioning point and the longitude and latitude of the first positioning point are weighted averaged to obtain the positioning result of the first positioning point. This can be understood by referring to step S203, step S2031 to step S2032 in the above embodiment.

[0170] The difference is that, unlike step S2031, the weight of the weighted average is related to at least one of the user's motion state, motion speed, horizontal accuracy and positioning accuracy corresponding to the positioning point. Please refer to the above step S403 for understanding, and will not be repeated here.

[0171] S504: Draw a trajectory of the electronic device according to the positioning result of the initial positioning point and the positioning result of the first positioning point.

[0172] The trajectory of the electronic device is drawn according to the positioning result of the initial positioning point and the positioning result of the first positioning point. Please refer to step S204 for understanding, which will not be repeated here.

[0173] It should be noted that after drawing the trajectory of the electronic device based on the positioning result of the initial positioning point and the positioning result of the first positioning point, the longitude and latitude of the next positioning point of the first positioning point can be further determined, so as to determine the positioning result of the next positioning point based on the positioning result of the first positioning point and the longitude and latitude of the next positioning point of the first positioning point, and then draw the trajectory of the next section of the electronic device. After that, the positioning result of the current positioning point can be determined each time based on the positioning result of the previous positioning point and the longitude and latitude of the current positioning point. The trajectory of the electronic device is determined based on the positioning result of the previous positioning point and the positioning result of the current positioning point. Please refer to steps S301 to S304 of the above embodiment for understanding, which will not be repeated here.

[0174] The above two embodiments respectively describe two methods of trajectory optimization by taking a mobile terminal using an Android system and a mobile terminal using an IOS system as examples. In this method, since the positioning result of the initial positioning point is obtained based on the longitude and latitude of at least two positioning points that meet the preset high-precision positioning point conditions, the accuracy of the positioning result of the initial positioning point can be improved. The positioning result of the first positioning point is obtained by weighted average of the longitude and latitude of the first positioning point and the positioning result of the initial positioning point, the accuracy of the positioning result of the first positioning point can be improved. The trajectory of the electronic device drawn based on the positioning result of the initial positioning point and the positioning result of the first positioning point will be more accurate and close to the actual running trajectory of the user.

[0175] The positioning result of each current positioning point is obtained by weighted averaging the positioning result of the previous positioning point and the longitude and latitude of the current positioning point. The positioning result of the current positioning point will be more accurate than the longitude and latitude of the current positioning point, and the error of the longitude and latitude of the current positioning point can be reduced. At the same time, the weight of the weighted average processing can also be adjusted, so the trajectory of the electronic device drawn according to the positioning results of the previous positioning point and the current positioning point will be closer to the user's actual trajectory.

[0176] In order to execute each step in the above method embodiment, a trajectory optimization device is provided below. Fig. 9, the present application provides a functional module diagram of a trajectory optimization device. It should be noted that the trajectory optimization device 600 provided in this embodiment has the same basic principle and technical effects as the above-mentioned method embodiment. The trajectory optimization device provided in the embodiment of the present application is used to execute the above-mentioned trajectory optimization method. For the sake of brief description, for parts not mentioned in this embodiment, please refer to the corresponding content in the above-mentioned method embodiment, which will not be repeated here. The trajectory optimization device 600 may include:

[0177] The acquisition module 610 is used to acquire the positioning data of the electronic device, and the positioning data includes longitude and latitude. Any specific step and action in step S201 in the above method embodiment can be executed by the acquisition module 610. For details, please refer to step S201 in the above method embodiment, which will not be repeated here.

[0178] The first processing module 620 is used to generate a positioning result of the initial positioning point according to the latitude and longitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions. In the above method embodiment, any specific step and action in steps S202, S401, S501, step S2021, and step S2022 can be performed by the first processing module 620. For details, please refer to steps S202, S401, S501, step S2021, and step S2022, which will not be repeated here.

[0179] The second processing module 630 is used to determine the positioning result of the first positioning point and the trajectory of the electronic device according to the positioning result of the initial positioning point. In the above method embodiment, any specific step and action in step S203, step S204, step S2031, step S2032, step S402 to step S404, step S502 to step S504 can be performed by the second processing module 630. For details, please refer to step S203, step S204, step S2031, step S2032, step S402 to step S404, step S502 to step S504, which will not be repeated here.

[0180] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0181] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0182] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0183] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A trajectory optimization method, characterized in that: The trajectory optimization method comprises: Acquire positioning data of the electronic device, wherein the positioning data includes longitude and latitude; Generate a positioning result of an initial positioning point according to the latitude and longitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions; According to the positioning result of the initial positioning point and the longitude and latitude of the first positioning point, weighted average processing is performed on the positioning result of the initial positioning point and the longitude and latitude of the first positioning point, so as to determine the positioning result of the first positioning point; wherein the first positioning point is a positioning point adjacent to the last positioning point of the at least two continuous positioning points that meet the preset high-precision positioning point conditions, and the positioning time of the first positioning point is after the positioning time of the last positioning point; Determine the trajectory of the electronic device according to the positioning result of the initial positioning point and the positioning result of the first positioning point; In the step of acquiring positioning data of the electronic device, the positioning data further includes one or more of altitude, position precision factor, number of satellites, positioning level, horizontal accuracy, and vertical accuracy; If the electronic device is a mobile terminal based on an embedded system, the preset high-precision positioning point condition includes at least one of the following conditions: the change in altitude is less than or equal to a set altitude change threshold; the position precision factor is less than or equal to a set position precision factor threshold; the number of satellites is greater than or equal to a set satellite number threshold; If the electronic device is a mobile terminal based on the Android system, the preset high-precision positioning point condition includes at least one of the following conditions: the position accuracy factor is less than or equal to a set position accuracy factor threshold; the positioning level is within a set positioning level range; If the electronic device is a mobile terminal based on the IOS system, the preset high-precision positioning point condition includes at least one of the following conditions: the horizontal accuracy is within a set horizontal accuracy threshold range; the vertical accuracy is within a set vertical accuracy threshold range.

2. The trajectory optimization method according to claim 1, characterized in that: In the step of generating the positioning result of the initial positioning point according to the latitude and longitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions, the preset high-precision positioning point conditions include: One or more of the change in altitude, position precision factor, number of satellites, positioning level, horizontal accuracy, and vertical accuracy meets preset conditions.

3. The trajectory optimization method according to any one of claims 1 to 2, characterized in that: The step of generating a positioning result of an initial positioning point according to the latitude and longitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions comprises: The average value of the longitude and latitude of the at least two consecutive positioning points is used as the positioning result of the initial positioning point of the electronic device, or the longitude and latitude of any one positioning point of the at least two consecutive positioning points is used as the positioning result of the initial positioning point of the electronic device.

4. A trajectory optimization device, characterized in that: The method for trajectory optimization according to any one of claims 1 to 3 is implemented, comprising: An acquisition module, used to acquire positioning data of the electronic device, wherein the positioning data includes longitude and latitude; A first processing module, used to generate a positioning result of an initial positioning point according to the latitude and longitude of at least two consecutive positioning points that meet the preset high-precision positioning point conditions; The second processing module is used to determine the positioning result of the first positioning point and the trajectory of the electronic device according to the positioning result of the initial positioning point.

5. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, the trajectory optimization method according to any one of claims 1 to 3 is implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the trajectory optimization method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Positioning method, apparatus and electronic device

    CN108072886A

  • Realization method for GPS (Global Positioning System) accurate positioning of mobile terminal

    CN108445519A