Running track algorithm based on satellite positioning

文档序号:861473 发布日期:2021-03-16 浏览:28次 中文

阅读说明:本技术 一种基于卫星定位的跑步轨迹算法 (Running track algorithm based on satellite positioning ) 是由 陈雪峰 凌振黄 沈鸿 于 2020-11-10 设计创作,主要内容包括:一种基于卫星定位的跑步轨迹算法,计算包括如下步骤:步骤A、经GPS获取稳定的定位点;步骤B、计算定位是否暂定;步骤C、计算是否定位刚暂停结束;步骤D、计算是否刚恢复定位点;步骤E、跑步定位点计算过滤;步骤F、计算过滤定位点实现光滑曲线;步骤G、计算对应的配速和距离等数据;步骤H、绘制地图。本发明让首点出现在接近真实的位置上,提高了首点的准确性、跑步轨迹长度误差减小;避免了大幅轨迹失真出现;如果存在一段时间没有定位,对已获的稳定点再次进行一次平滑计算,在一定范围内改变定位点位置,从而APP界面显示的跑步轨迹从肉眼中观察更加平滑美观,而在总里程上各更加接近真实值,为保证跑步APP有效应用提供了有力技术支撑。(A running track algorithm based on satellite positioning comprises the following steps: step A, acquiring a stable positioning point through a GPS; b, calculating whether the positioning is tentative or not; c, calculating whether the positioning is just finished in pause or not; step D, calculating whether the positioning point is just recovered or not; e, calculating and filtering running positioning points; step F, calculating a filtering positioning point to realize a smooth curve; g, calculating corresponding data such as matching speed, distance and the like; and H, drawing a map. The invention leads the first point to appear at a position close to the real position, improves the accuracy of the first point and reduces the length error of the running track; the occurrence of large-scale track distortion is avoided; if there is a period of time and not fix a position, carry out a smooth calculation once more to the stable point that has obtained, change the locating point position in certain extent to the running track that APP interface demonstration observes more smoothly beautifully from the naked eye, and respectively more is close to the true value on total mileage, provides powerful technical support for guaranteeing running APP effective application.)

1. A running track algorithm based on satellite positioning is characterized in that the calculation comprises the following steps: step A, acquiring a stable positioning point through a GPS; b, calculating whether the positioning is tentative or not; c, calculating whether the positioning is just finished in pause or not; step D, calculating whether the positioning point is just recovered or not; e, calculating and filtering running positioning points; step F, calculating a filtering positioning point to realize a smooth curve; g, calculating corresponding data such as matching speed, distance and the like; step H, drawing a map; in the step B, the step C, the step D and the step E, the filtered GPS positioning points are obtained in four steps, after the positioning points are judged, if the end points are in accordance with each other, a smoothing algorithm is introduced immediately, in the step F, the filtered positioning points are calculated to realize a smooth running track curve, and if the end points are not in accordance with each other, the step B, the step C, the step D and the step E are carried out again until the end points are in accordance with each other; the step A, acquiring stable positioning points through a GPS, and comprising the following calculation process of firstly, transmitting positioning point data; step two, calculating and judging whether the positioning point data meets the precision threshold value; step three, calculating and judging whether the positioning point data conforms to the latest interval; step four, calculating the speeds of the two points; and step five, calculating and judging whether the speed is reasonable, deleting the first point if the speed is reasonable, keeping the point two and the point three, deleting the end point if the speed is not reasonable, and finally obtaining the required stable point.

2. The running track algorithm based on satellite positioning as claimed in claim 1, wherein step F calculates the filtered locating points to realize a smooth running track curve, and the calculation adopts a polynomial smoothing algorithm based on the least square principle, and 5 points with equal wavelength intervals in a section of spectrum are recorded as an X set and used as polynomial smoothing, and the polynomial smoothing uses the fitting value of each window to replace the coordinate value in the original window, so as to obtain each locating point of the smooth track.

3. The running track algorithm based on satellite positioning as claimed in claim 1, wherein step F calculates the filtered anchor points to realize a smooth running track curve, polynomial smoothing is implemented by replacing Xk with polynomial fitting values of data with wavelength points Xk-2, Xk-1, Xk +1, Xk +2, where k represents the kth point on the trace point, and then sequentially moving until the spectrum is traversed.

4. The running track algorithm based on satellite positioning as claimed in claim 1, wherein in the step a, stable positioning points are obtained through GPS, and if the steps one, two, three, four and five are completed, the interface of APP needs to be updated or not is returned.

Technical Field

The invention relates to the technical field of algorithms used in positioning technology of mobile phone APP application, in particular to a running track algorithm based on satellite positioning.

Background

With the popularization of smart phones, various applications APP of the mobile phones are increasing, and sports APP is one of the applications. In order to ensure the effective application of the motion APP, the motion trajectory measuring and calculating method is widely applied to the motion APP. The existing sport APP is limited by the adopted calculation method, and in practical application of the APP, the problem that the accuracy of a sport positioning point of a user is not good when the sport APP is monitored based on satellite positioning due to the influence of the problems of bad weather of the surrounding environment, buildings, mountains and other obstacles exists. The main manifestations include the following three types: 1. the first point positioning is not accurate enough, when a user opens the APP and the GPS of the APP works, if a high-rise building or cloudy weather exists around, the positioning of the GPS has larger deviation with the actual real positioning point; 2. during running, if the GPS signal is suddenly weakened, occasional large-amplitude track distortion occurs, which may cause a large deviation in running mileage. 3. The running track generated by the APP interface has a rectangular-tooth-shaped track, so that the track is not smooth enough, if a straight line is drawn between two points according to a point given by the GPS, a broken line segment appears on the motion track due to the existence of more than two points, and the whole track looks like a rectangular-tooth-shaped multi-point graph. Above three problems that exist, because can't obtain optimization processing based on current algorithm, the orbit distortion that the APP interface was drawn (was shown) is comparatively serious, and the mileage deviation is big, has caused the restriction to the effective application of motion APP.

Disclosure of Invention

In order to overcome the defects of the prior algorithm applied to the sport APP, which is limited by the technology, as described in the background, the invention provides the method for optimizing the algorithm by adopting a first point positioning method, and the accuracy of the first point is greatly improved by testing the first point by a three-point positioning method; the stable points are obtained in the running process by setting a filtering precision threshold value and a spacing distance threshold value, so that the stability and the reasonability of the relative position of each point and the two previous points are ensured; in the algorithm, if positioning does not exist for a period of time, the stable points are automatically obtained again through the three-point positioning method, the obtained stable points are subjected to one-time smooth calculation again, the positions of the positioning points are changed within a certain range, so that the running track displayed on the APP interface is observed more smoothly from the naked eye, the running track is closer to the true value on the display of the total mileage, and the running track algorithm based on satellite positioning, which is effectively applied to running APPs, is ensured.

The technical scheme adopted by the invention for solving the technical problems is as follows:

a running track algorithm based on satellite positioning is characterized in that the calculation comprises the following steps: step A, acquiring a stable positioning point through a GPS; b, calculating whether the positioning is tentative or not; c, calculating whether the positioning is just finished in pause or not; step D, calculating whether the positioning point is just recovered or not; e, calculating and filtering running positioning points; step F, calculating a filtering positioning point to realize a smooth curve; g, calculating corresponding data such as matching speed, distance and the like; step H, drawing a map; in the step B, the step C, the step D and the step E, the filtered GPS positioning points are obtained in four steps, after the positioning points are judged, if the end points are in accordance with each other, a smoothing algorithm is introduced immediately, in the step F, the filtered positioning points are calculated to realize a smooth running track curve, and if the end points are not in accordance with each other, the step B, the step C, the step D and the step E are carried out again until the end points are in accordance with each other; the step A, acquiring stable positioning points through a GPS, and comprising the following calculation process of firstly, transmitting positioning point data; step two, calculating and judging whether the positioning point data meets the precision threshold value; step three, calculating and judging whether the positioning point data conforms to the latest interval; step four, calculating the speeds of the two points; and step five, calculating and judging whether the speed is reasonable, deleting the first point if the speed is reasonable, keeping the point two and the point three, deleting the end point if the speed is not reasonable, and finally obtaining the required stable point.

Further, in the step F, the filtered positioning points are calculated to realize a smooth running track curve, a polynomial smoothing algorithm based on the least square principle is adopted for calculation, 5 points with equal wavelength intervals in a section of spectrum are recorded as an X set and used as polynomial smoothing, and the polynomial smoothing uses the fitting value of each window to replace the coordinate value in the original window, so that each positioning point of the smooth track is obtained.

Further, in the step F, the filtering locating points are calculated to realize a smooth running track curve, polynomial smoothing is to replace Xk by using polynomial fitting values of data with wavelength points of Xk-2, Xk-1, Xk +1 and Xk +2, wherein k represents the kth point on the track point, and then sequentially move until the spectrum is traversed.

Further, in the step a, in the stable positioning point obtained by the GPS, if the step one, two, three, four, and five are completed, whether the interface of the APP needs to be updated is returned.

The invention has the beneficial effects that: according to the method, a first point positioning method optimization algorithm is adopted, and through eight steps, a test first point is calculated through a three-point positioning method, so that the first point appears at a position close to the real position, the accuracy of the first point is greatly improved, and the length error of the running track displayed on an APP interface is reduced; the stable points are obtained in the running process by setting a filtering precision threshold value and a spacing distance threshold value, so that the stability and the reasonability of the relative position of each point and the two former points are ensured, and the occurrence of large-scale track distortion is avoided; in the algorithm, if the positioning is not carried out for a period of time, the stable points are automatically obtained again through the three-point positioning method, the obtained stable points are subjected to one-time smooth calculation again, and the positions of the positioning points are changed within a certain range, so that the running track displayed on the APP interface is smoother and more attractive when observed by naked eyes, the running track is closer to a true value on the total mileage, and powerful technical support is provided for ensuring the effective application of running APP. Based on the above, so this novel application prospect that has.

Drawings

FIG. 1 is a block diagram illustration of the overall flow of the algorithm of the present invention.

FIG. 2 is a block diagram of the process of obtaining stable positioning points via GPS according to the present invention.

FIG. 3 is a schematic diagram of running track obtained by the algorithm of the present invention displayed on an APP interface.

Detailed Description

As shown in fig. 1, 2 and 3, a running track algorithm based on satellite positioning comprises the following steps: step A, acquiring a stable positioning point through a GPS; the method comprises the following specific steps of step one, entering positioning points, wherein the specific entering is positioning point (also called endpoint data) data taken from an entrance of a GPS or a base station and the like. And step two, calculating and judging whether the positioning point data meets the precision threshold value according to different positioning point types (generally comprising a satellite, a base station, WIFI and the like). Step three, calculating and judging whether the positioning point data in the step two accords with the latest interval (the distance between the two points, the unit is calculated by m); the calculation is as shown in fig. 2, L > (0.2 × t +1) (unit of L is m, t represents interval time); step four, calculating the speed of two points (the latest two positioning points); and step five, calculating and judging whether the speed is reasonable (see speed matching reasonability rules in detail), namely, checking whether the speed meets the speed adaptation limit in calculation, if so, deleting the first point (the earliest point in the three points), keeping the second point and the third point (the points appearing for the second time and the third time in the three points), and if not, deleting the last point, and finally obtaining the required stable positioning point. And in the stable positioning points acquired by the GPS, if the steps I, II, III, IV and V are completed, returning whether the APP needs to update the interface or not.

Fig. 1, 2 and 3 show a running track algorithm based on satellite positioning, step B, calculating whether the positioning is tentative. And C, calculating whether the positioning is just finished in pause or not. And D, calculating whether the positioning point is just recovered. And E, calculating and filtering running positioning points.

As shown in fig. 1, 2, and 3, a running track algorithm based on satellite positioning, step F, calculates filter positioning points to implement a smooth curve. In the calculation, a polynomial smoothing algorithm based on the least square principle is adopted, 5 points with equal wavelength intervals in a section of the spectrum of the APP track interface are marked as an X set to be used as polynomial smoothing, polynomial smoothing is to replace the kth point on the spectrum track point of the APP interface represented by Xk and k by using a polynomial fitting value of data with the wavelength points of Xk-2, Xk-1, Xk +1 and Xk +2, and then the k point is moved in sequence until the spectrum is traversed. In the calculation, assuming that the width of a filtering window (also called a filter or a convolution kernel) is n ═ 2m +1, and each measurement point x ═ m +0, -m +1, -m +2 …, m-1, m), data points in the window are fitted by a k-1 th order polynomial, and the above n equations constitute a k element linear equation set. To have a solution to the system of equations, n should be equal to or greater than k, n > k is typically chosen, and then the parameter A is determined by a least squares fit. Based on the algorithm, the fitting value of each window is finally used for replacing the coordinate value in the original window, and therefore each positioning point of the smooth track is obtained. The positioning point data enter step G, corresponding data such as pace and distance are calculated, finally, a track curve is formed through step H, a map is drawn on an APP interface, and a running motion track after smooth processing is shown in the map of the APP interface (as shown in fig. 3, the motion track is realized in the APP).

As shown in fig. 1, 2 and 3, the invention adopts an optimization algorithm of a first point positioning method, calculates a test first point by a three-point positioning method through eight steps, and enables the first point to appear at a position close to a real position, thereby greatly improving the accuracy of the first point and reducing the error of the track length; the stable points are obtained in the running process by setting a filtering precision threshold value and a spacing distance threshold value, so that the stability and the reasonability of the relative position of each point and the two former points are ensured, and the occurrence of large-scale track distortion is avoided; in the algorithm, if positioning does not exist for a period of time, the stable points are automatically obtained again through the three-point positioning method, the obtained stable points are subjected to one-time smooth calculation again, the positions of the positioning points are changed within a certain range, so that the track is more smooth and attractive when observed by naked eyes, the total mileage is closer to a true value, and powerful technical support is provided for ensuring the effective application of running APP.

In the running track algorithm based on satellite positioning according to the present invention, as shown in fig. 1, 2 and 3, the track verification logic uses the following data (function: the main point in the logic is to filter unreasonable points). : 1. running and walking reasonable speed range (10.5m/s speed of hundreds of meters in the world at present). 2. The method comprises the following steps of riding within a reasonable speed range (the average speed per hour of a looping bike race is 40 kilometers per hour; the speed per hour when the cycling bike race goes downhill exceeds 100 kilometers per hour, and can reach 70 kilometers per hour when the cycling race is timed), 3, determining a precision threshold (the size of the precision threshold is set, namely the radius value given by a GPS is set to be 20 if only a GPS positioning point needs to be reserved, and is set to be 100 if GPS and Wi-Fi positioning points need to be reserved, and base station positioning points are removed), 4, setting a speed difference threshold (between three points, namely the speed difference between the point 1 and the point 2, and the speed difference between the point 2 and the point 3 is less than 5m/s)5, and spacing point distance (0.2 m).

In the running track algorithm based on satellite positioning according to the present invention, as shown in fig. 1, 2 and 3, the average pace rationality rule data is as follows (effect: excluding the track of illogical exercise speeds). 1. According to the single-kilometer speed distribution, under any condition, the speed distribution of 1 kilometer is less than 2.0min/km, which is invalid data. 2. And according to the average speed distribution, the total distance is 3-5 kilometers, and the average speed distribution is less than 2min and 20SEC/km is invalid data. 3. And according to the average speed distribution, the total distance is 5-10 kilometers, and the average speed distribution is less than 2min and 30SEC/km is invalid data. 4. And according to the average speed distribution, the total distance is 10-21 kilometers, and the average speed distribution is less than 2min and 40SEC/km is invalid data. 5. According to the number of steps of a single kilometer, in any case, the number of steps of 1 kilometer is less than 500 steps, and the data are invalid

While there have been shown and described what are at present considered the fundamental principles and essential features of the invention and its advantages, it will be apparent to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, but is capable of other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

Furthermore, it should be understood that although the present description refers to embodiments, the embodiments do not include only one independent technical solution, and such description is only for clarity, and those skilled in the art should take the description as a whole, and the technical solutions in the embodiments may be appropriately combined to form other embodiments that can be understood by those skilled in the art.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:通话的建立方法、装置、电子设备及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类