A method and device for filtering GPS position drift points based on double queue technology
Patent Information
- Application Number
- CN202310003382.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-03
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-01-03
AI Technical Summary
针对动态漂移点问题,现有技术直接通过两点距离超过理论最大距离而进行过滤,没有考虑位置偏移发生的持续时间,以及发生漂移时刻的具体细节,因此会大大增加错误过滤的可能
[0039] The beneficial effects of this invention are as follows: This invention provides a position anomaly filtering algorithm with O(N) computational complexity that is easy to compute and easy to reproduce in code; the calculation of weight points in the algorithm reflects the inertia of driving, which can more accurately identify position offset anomalies and has a better filtering rate; in addition, compared with most point filtering algorithms that can only filter individual points, the algorithm of this invention can filter both individual points and an entire offset trajectory, and has a better filtering effect while preserving the original information of the points.
Smart Images

Figure CN115774277B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of GPS positioning and monitoring technology, and in particular to a method and apparatus for filtering GPS location drift points based on dual-queue technology. Background Technology
[0002] Because GPS satellite positioning signals are affected by complex factors such as changes in the atmospheric ionosphere, cloud cover, humidity, and multipath reflections from surrounding tall buildings, location drift frequently occurs when using vehicle-mounted GPS for positioning. This drift can range from tens to hundreds of meters in error. GPS drift can be categorized into static drift and dynamic drift. Static drift occurs when the GPS terminal is stationary, but its positioning coordinates continuously change within a certain range, sometimes even displaying speed. Since this drift mostly occurs at low vehicle speeds, existing methods for filtering GPS drift points primarily rely on speed judgment: if the speed of the current point is 0 or less than a certain threshold, the point is considered stationary and filtered out. Dynamic drift, on the other hand, refers to the drift distance of a positioning point during movement with velocity. When using continuous positioning points as a trajectory, if there are drifting points, the reflected trajectory data will appear jumpy on the map, causing significant errors in subsequent data analysis based on these positioning points.
[0003] Because static drift is characterized by its occurrence at low vehicle speeds, existing methods for filtering GPS drift points largely rely on speed judgment: if the current point's speed is 0 or less than a certain threshold, it is considered stationary and filtered out. While this method can filter out low-speed points, in traffic jams, vehicles are actually moving slowly, yet all these points will still be filtered out. For dynamic drift points, current technologies directly filter based on whether the distance between two points exceeds the theoretical maximum distance, without considering the duration of the positional drift or the specific details of when the drift occurs, thus significantly increasing the possibility of incorrect filtering. Besides dynamic drift points, mathematical calculation methods such as Kalman filtering and particle filtering can also be used for filtering based solely on time and location information. However, while Kalman filtering can filter out noisy positional anomalies, its output is a newly estimated trajectory data point after filtering, which is not user-friendly or convenient for filtering existing data points; particle filtering, on the other hand, has high computational complexity. A simpler approach is to filter based on changes in GPS signal strength or WiFi-assisted positioning signal strength. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a method and apparatus for filtering GPS location drift points based on dual-queue technology. This method can efficiently and accurately filter both static and dynamic drift points. The method utilizes dual-queue technology to divide the original GPS point dataset into multiple batches and add them to two preset queues for consideration. By combining dimensions such as distance, speed, and displacement direction, it achieves efficient filtering of abnormal location points with position drift in vehicle-mounted GPS data without relying on more extensive information.
[0005] The objective of this invention is achieved through the following technical solution: Firstly, this invention provides a method for filtering GPS location drift points based on dual-queue technology, the method comprising the following steps:
[0006] Step 1: Data Point Extraction: Obtain GPS collection points from the terminal device within a specified continuous time range, and extract the time, latitude, longitude, and speed information from the GPS collection points to form corresponding data points;
[0007] Step 2: Outlier detection: Remove data points with duplicate times as outliers, and the remaining data points are the set of valid data points;
[0008] Step 3: Drift Point Filtering: Based on the data collection time sequence, the verified valid data point set is processed using a drift point filtering algorithm. This algorithm filters out points and trajectories where positions have drifted by considering segments of the trajectory, thus selecting valid points and forming a reasonable point trajectory. The specific process of the drift point filtering algorithm is as follows:
[0009] Step 1: Initialize the algorithm: Create two lists TL1 and TL2 with capacities C1 and C2 respectively, as cache queues to store temporarily valid points when no position drift occurs and after a position drift occurs. Create a permanent valid point queue FL of variable length to store the answer results of permanently valid points after filtering. In addition, initialize two weights w1 and w2 with null values. These will be passed in with the points in the filtering batch to represent the latest position and direction of travel of the point trajectory when no position drift occurs and after a position drift occurs.
[0010] Step 2: Formal execution of the algorithm's filtering process: For a point set {P1, P2, ..., P...} with N GPS data points... N Perform individual judgments and batch filtering. When neither TL1 nor TL2 contains any elements, start a new round of filtering. For the first point P1, execute step 3; for points P that are not the first point, execute step 4. i (i.e., i∈[2,N]) Execute step 4. After all N points have been judged, execute step 20.
[0011] Step 3: Perform hypothetical processing on the first GPS point: Directly add the first GPS point P1 as a temporary valid point to the temporary valid point cache queue TL1 when no drift has occurred, and directly assign the value of P1 to the weight point w1. Then return to step 2 to execute the next point P. i+1 Filtering and judgment;
[0012] Step 4: For points P that are not the first point i First, determine if the weight w2 is null. If w2 == null, proceed to step 5; otherwise, proceed to step 10. == indicates that the two are the same.
[0013] Step 5: w2 == null indicates that no position drift point has appeared in this filtering batch at the current time. At this time, the weight w1 represents the latest position and driving direction of the point trajectory corresponding to the temporarily valid point in TL1; determine the current judgment point P. i Whether it drifts or not requires calculating the current judgment point P. i Distance difference from weight point w1 Time difference And combined with the maximum speed V max get Maximum permissible movement distance ΔD within a time period max ,if Proceed to step 6; otherwise proceed to step 7.
[0014] Step 6: Indicates the current decision point P i For the trajectory corresponding to the temporarily valid point in TL1, it is a position drift point. Without changing w1, w2 represents the position drift point P. i The position and direction of travel of the subsequent point trajectory are as follows: the position drift point P i The value of P is directly assigned to the weight w2, and P is... i The point is stored in the cache queue TL2, which stores temporarily valid points after the position shift has occurred. Then, return to step 2 to execute the next point P. i+1 Filtering and judgment;
[0015] Step 7: This indicates that P i The displacement distance from the weight point w1 is within the theoretically permissible distance, so P i Add it to TL1, and update the position value according to a certain weight ratio between the previous value of the weight point and the newly introduced GPS point, and set P i The time and speed values are assigned to the time and speed values of w1, and then step 8 is executed;
[0016] Step 8: Determine whether the number of elements in TL1 has reached C1. If Len(TL1)≥C1, perform step 9; if Len(TL1)<C1, directly return to step 2 to process the next point P i+1 for filtering judgment;
[0017] Step 9: Since Len(TL1)≥C1 has reached the preset quantity threshold, all temporarily valid points in TL1 are counted as permanently valid points and added to the permanently valid point queue FL, TL1 is cleared, and the point filtering process of the current filtering batch is completed; return to step 2 to start a new batch of filtering, and process the next point P i+1 for filtering judgment;
[0018] Step 10: w2≠null indicates that position drift points have already occurred in the current filtering batch G. At this time, w2 represents the latest position and driving direction of the point trajectory after the occurrence of temporarily valid points, that is, position drift points, in TL2. Calculate the current point P to be judged i and the distance between w2 time difference and combine with the maximum speed V max to obtain maximum allowable moving distance ΔD within the time max , if perform step 11, otherwise perform step 18;
[0019] Step 11: If there is then make the current point P to be judged i successively perform verification judgment with the weighted point w1 representing the trajectory position and direction of TL1 and the last permanently valid point in FL; first perform step 12 to perform verification judgment with the weighted point w1;
[0020] Step 12: Calculate the distance difference between the current point P to be judged i and the weighted point w1 that represents the position and driving direction of the trajectory corresponding to the temporarily valid points in TL1 time difference and combine with the maximum speed V max to obtain maximum allowable moving distance ΔD within the time max , if it is the case of , perform step 13; if , add point P i into TL1, update the position value of weighted point w1, assign the time value and speed value of P i to the time value and speed value of w1, then perform step 8 to determine whether the number of points in TL1 meets the condition;
[0021] Step 13: Since Set the current judgment point P i The function is checked against the permanent valid point queue FL. First, it checks if there is an element in FL. If there is an element in FL, proceed to step 14; otherwise, proceed to step 17.
[0022] Step 14: Calculate the current decision point P i With the last valid point P in FL last Distance difference Time difference And combined with the maximum speed V max get Maximum permissible movement distance ΔD within a time period max ,if If the condition is met, proceed to step 15; otherwise, proceed to step 16.
[0023] Step 15: If Then clear all temporarily valid points in TL1 and TL2, and start from the current judgment point P again. i To begin filtering, set w2 = null and change the current decision point P. i The value of P is assigned to w1, and P is set to 0. i Store the point in the cache queue TL1; return to step 2, with the current judgment point P. i The information begins a new batch of filtering, targeting the next point P. i+1 Perform filtering and judgment;
[0024] Step 16: If Then, without processing TL1, clear TL2 and set P. i The value of P is assigned to the weight w2, and P is... i Store P in the cache queue TL2. i As the starting point of the new displacement drift trajectory, record the subsequent trajectory using TL2; return to step 2 and proceed to the next point P. i+1 Filtering and judgment;
[0025] Step 17: Since there is no data in the permanent valid point queue FL yet, it is impossible to make a judgment based on the points in FL. Therefore, directly clear TL1 and TL2, set w2 = null, and set the current judgment point P. i The value of P is assigned to w1, and P is set to 0. i Store the point in the cache queue TL1; return to step 2, with the current judgment point P. i The information begins a new batch of filtering considerations for the next point P. i+1 Perform filtering and judgment;
[0026] Step 18: At this time P iAdd the point to the temporary valid point cache queue TL2, and use P to match the position value of w2. i The time and velocity values are assigned to the time and velocity values of w2 for updating; P is added to TL2. i After point P, determine whether TL2 has reached the preset quantity threshold C2. If Len(TL2)≥C2, proceed to step 19; otherwise, return directly to step 2 and proceed to the next point P. i+1 Filtering and judgment;
[0027] Step 19: If Len(TL2)≥C2, determine whether the number of elements in TL1 has reached the lenient quantity threshold k. c *C1, if Len(TL1)≥k c If C1 meets the condition, first add the points in the temporary valid point queue TL1 to the permanent valid point queue FL, then clear TL1; otherwise, discard all points in TL1. After processing the points in TL1, add the points in TL2 to the permanent valid point queue FL and clear TL2. Then, assign the value of w2 to w1 and set w2 to null, completing the point filtering process for the current batch. Then, return to step 2 to start filtering a new batch for the next point P. i+1 Perform filtering and judgment:
[0028] Step 20: After all N points have been filtered and judged, there are still temporarily valid points in the cache queues TL1 and TL2. Check the number of remaining points in TL1 and TL2. Since TL2 definitely cannot meet the quantity requirement C2, we only need to calculate whether the number of points in TL1 reaches the lenient quantity threshold k. c *C1, if satisfied, then the temporarily valid points in TL1 are also counted as permanently valid points and added to the permanently valid point queue FL; otherwise, they are discarded directly; finally, the point set in the permanently valid point queue FL is the truly valid point set.
[0029] Furthermore, in step two, all points with adjacent acquisition times and displacements within the distance threshold are replaced with one or two points, while other points are removed as outliers.
[0030] Furthermore, in step 5, ΔD max The maximum allowable movement distance is calculated as follows:
[0031] ΔD max =V max *Δt
[0032] in V represents the time interval between two sampling points during the calculation process. max It is the preset maximum speed limit or the maximum speed of two points.
[0033] Furthermore, the preset maximum speed limit is the maximum speed based on the road speed limit and vehicle type; the maximum value of the two speeds is set as max(V wj V Pi The maximum permissible travel distance is calculated based on the maximum driving speed.
[0034] Furthermore, in steps 7, 12, and 18: the position value update formula is as follows:
[0035] w j =(1+k) p )*P i -k p *w j , j∈(1,2)
[0036] Weight and focus w j It is P i-1 With P i Extend the line by one point, k p It is the extension ratio parameter, and the extension distance is...
[0037] Secondly, the present invention provides an apparatus for filtering GPS location drift points based on dual-queue technology, including a memory and one or more processors. The memory stores executable code, and when the processor executes the executable code, it implements the method for filtering GPS location drift points based on dual-queue technology.
[0038] Thirdly, the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the method for filtering GPS location drift points based on dual-queue technology.
[0039] The beneficial effects of this invention are as follows: This invention provides a position anomaly filtering algorithm with O(N) computational complexity that is easy to compute and easy to reproduce in code; the calculation of weight points in the algorithm reflects the inertia of driving, which can more accurately identify position offset anomalies and has a better filtering rate; in addition, compared with most point filtering algorithms that can only filter individual points, the algorithm of this invention can filter both individual points and an entire offset trajectory, and has a better filtering effect while preserving the original information of the points. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart of the method for filtering GPS location drift points based on dual-queue technology provided by the present invention;
[0042] Figure 2 This is a schematic diagram illustrating the process of filtering GPS drift points provided in an embodiment of the present invention;
[0043] Figure 3 This is a comparison chart of the filtering effect of the present invention under actual road network data and GPS data, wherein... Figure 3 (a) in the image is a diagram showing the original GPS data points. Figure 3 (b) in the figure shows the filtering effect of GPS data points after filtering;
[0044] Figure 4 The structural diagram of the device for filtering GPS location drift points based on dual-queue technology provided by the present invention is shown. Detailed Implementation
[0045] The present invention will now be described in further detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0046] like Figure 1 As shown, the present invention provides a method for filtering GPS location drift points based on dual-queue technology, the specific steps of which are as follows:
[0047] Step 1: Data Point Extraction: Obtain GPS collection points from the terminal device within a specified continuous time range, and extract information such as time, latitude and longitude, and speed from the GPS collection points to form corresponding data points.
[0048] Step 2: Outlier detection: Remove data points with repeated times as outliers. Alternatively, replace all data points with adjacent acquisition times and very close displacement distances with one or two points, and remove other points with similar distances as outliers.
[0049] Step 3: Drift Point Filtering: Based on the data collection time sequence, the verified set of valid data points is input into the drift point filtering algorithm. By comprehensively considering segments of the small trajectory, points and trajectories where positions have drifted are filtered out, and valid points are selected, thus forming a reasonable point trajectory. The specific process is as follows:
[0050] Step 1: Initialize the algorithm: Create two lists TL1 and TL2 with capacities C1 and C2 respectively, as cache queues to store temporarily valid points when no position drift occurs and after a position drift occurs. Also create a queue of permanent valid points FL of variable length to store the results of the filtered permanently valid points. C1 and C2 are preset configuration parameters. Based on experience, C2 can be set to 16 (C2=16 means that after a position drift occurs, there should be 15 reasonable temporarily valid points for this trajectory to be considered valid), and C1 can be set to 8. Additionally, initialize two weighted variables w1 and w2 with null values. These are passed in with the points in the filtering batch to represent the latest position and direction of travel of the point trajectory when no position drift occurs and after a position drift occurs.
[0051] Step 2: Formal execution of the algorithm's filtering process: For a point set {P1, P2, ..., P...} with N GPS data points... N The process involves judging and filtering each element in turn. When neither TL1 nor TL2 contains any elements, a new round of filtering is initiated. Step 3 is executed for the first point P1, and step 4 is executed for any subsequent points P1. i (i.e., i∈[2,N]) Execute step 4. After all N points have been judged, execute step 20.
[0052] Step 3: The algorithm performs a hypothetical processing on the first GPS point—it directly takes the first GPS point P1 as a temporary valid point, adds it to the temporary valid point cache queue TL1 when no drift has occurred, and directly assigns the value of P1 to the weight point w1. Then it returns to step 2 to execute the next point P. i+1 Filtering and judgment.
[0053] Step 4: For points P that are not the first point i First, determine whether the weight w2 is null. If w2 == null, proceed to step 5; otherwise, proceed to step 10. == indicates that the two are the same.
[0054] Step 5: w2 == null indicates that no position drift point has appeared in this filtering batch G at the current time. At this time, the weight w1 represents the latest position and driving direction of the point trajectory corresponding to the temporarily valid point in TL1. Determine the current judgment point P. i Whether it drifts or not requires calculating the current judgment point P. i Distance difference from weight point w1 Time difference And combined with the maximum speed V max get Maximum permissible movement distance ΔD within a time period max ,if Proceed to step 6; otherwise, proceed to step 7. ΔDmax Maximum allowable movement distance: ΔD max =V max *Δt, where V represents the time interval between two sampling points during the calculation process. max It can be a preset maximum speed limit or the maximum value of the two speeds;
[0055] The preset maximum speed limit, that is, the maximum speed based on road speed limits and vehicle type, assumes the maximum reasonable speed of the vehicle ΔD. max Using a speed of 80 km / h (22 m / s) and a positioning time interval Δt of 2 seconds, a point where the distance between the next positioning point and the weighted point is greater than 44 m will be considered an offset point. Since GPS points may fail to acquire positioning data for a period of time, it is necessary to calculate the time interval between the two points to determine the maximum permissible offset range between them.
[0056] The maximum value of the two velocities is set as follows: The maximum permissible distance P is calculated based on the maximum driving speed. i The speed of is 10 m / s, and the speed of is 11 m / s. Therefore, even if they travel at a speed of 11 m / s, given a time difference Δt = 2 m / s, ΔD max =max(10, 11)*2=22m.
[0057] Step 6: This means the current judgment point P i For the trajectory corresponding to the temporarily valid point in TL1, it is a position drift point. However, since it is not possible to directly determine whether all points in TL1 are invalid drift trajectories or the current judgment point P, i Or P i The subsequent trajectory is a drift trajectory, therefore, without changing w1, enabling w2 represents the drift point P at the occurrence location. i The position and direction of travel of the subsequent point trajectory: the position drift point P i The value of P is directly assigned to the weight w2, and P is... i The point is stored in the cache queue TL2, which stores temporarily valid points after the position shift has occurred. Then, return to step 2 to execute the next point P. i+1 Filtering and judgment.
[0058] Step 7: This indicates that P i Since the displacement distance from the weight point w1 is within the theoretically permissible distance, the current judgment point P is considered to be within the theoretically permissible distance. i This is a reasonable point where no drift occurred, therefore P is... iadded to TL1, and the position value is updated according to a certain weight proportional relationship between the value of the weight point at the previous moment and the newly input GPS point, that is, through the update formula w1=(1+k p )*P i -k p *w1 to update the position value of the weight point w1 and assign the time value and speed value of P i to the time value and speed value of w1, then perform step 8. The weight point w1 is a point on the extension line of P i-1 and P i , k p is an extension proportional parameter, which can be set as k p =0.05 based on experience, and the extension distance is The weight proportional relationship for weight point update is to balance and consider the relationship between the position and moving direction of the previous and next temporarily valid points. Subsequent points are more likely to appear in the moving direction, which can offset the possible accuracy error of the GPS signal itself to a certain extent (this assumption is wrong when turning around, but because the speed is low when turning around, the moving distance within the sampling time is small, and in addition, the value of k p itself is relatively small, so it will not cause negative effects in this case).
[0059] Step 8: Determine whether the number of elements in TL1 has reached C1. If Len(TL1)≥C1, perform step 9; if Len(TL1)<C1, it means that the number of points in TL1 is not enough to form a valid trajectory, so directly return to step 2 to perform filtering judgment on the next point P i+1 .
[0060] Step 9: Since Len(TL1)≥C1 has reached the preset quantity threshold, all temporarily valid points in TL1 are considered reasonable, all of them are counted as permanently valid points and added to the permanently valid point queue FL, TL1 is cleared, and the point filtering process of the current filtering batch G is completed. Return to step 2 to start a new batch of filtering, and perform filtering judgment on the next point P i+1 .
[0061] Step 10: w2≠null indicates that a position drift point has already occurred in the current filtering batch G. At this time, w2 represents the latest position and driving direction of the point trajectory after the occurrence of the temporarily valid point, that is, the position drift point, in TL2, so calculate the distance between the current judgment point P i and w2 time difference and combine with the maximum speed V max to obtain the maximum allowable moving distance ΔD within time max , if Proceed to step 11; otherwise, proceed to step 18.
[0062] Step 11: If there is This indicates the current judgment point P. i For the trajectory of points that have undergone a sudden positional change and are temporarily valid points in TL2, which are also position-drifting points, it is necessary to adjust the current judgment point P. i The points are sequentially checked against the weight point w1, which represents the position and direction of the TL1 trajectory, and the last permanently valid point in FL. First, step 12 is executed to check against the weight point w1.
[0063] Step 12: Calculate the current decision point P i The distance difference between the weight point w1 and the point representing the position and direction of travel of the trajectory corresponding to the temporarily valid point in TL1 Time difference And combined with the maximum speed V max get Maximum permissible movement distance ΔD within a time period max ,in the case of In the case of this, proceed to step 13. This indicates the current judgment point P. i For the trajectory corresponding to TL1, no offset has occurred, and it remains valid; therefore, P... i Add the point to TL1, and update it according to the formula w1 = (1 + k p )*P i -k p *w1 updates the position value of the weight point w1, and sets P i The time and speed values are assigned to the time and speed values of w1. Then, step 8 is executed to determine whether the number of points in TL1 has met the conditions.
[0064] Step 13: Due to This indicates the current judgment point P. i For the trajectory corresponding to the temporarily valid point in TL1, it is also a drift point. Then, continue to judge the current point P. i The function is checked against the permanent valid point queue FL. First, it checks if there is an element in FL. If there is an element in FL, proceed to step 14; otherwise, proceed to step 17.
[0065] Step 14: Calculate the current decision point P i With the last valid point P in FL last Distance difference Time difference And combined with the maximum speed V max get Maximum permissible movement distance ΔD within a time period max ,if If the condition is met, proceed to step 15; otherwise, proceed to step 16.
[0066] Step 15: This indicates that although the current judgment point P i For the trajectories corresponding to points in TL1 and TL2, these are all drift points. However, for the trajectories already counted as permanently valid points, no shift has occurred. Therefore, all temporarily valid points in TL1 and TL2 are cleared, and the current point P is re-evaluated. i To begin filtering, set w2 = null and change the current decision point P. i The value of P is assigned to w1, and P is set to 0. i Store the point in the cache queue TL1. Return to step 2, with the current judgment point P. i The information begins a new batch of filtering, targeting the next point P. i+1 Perform filtering and judgment.
[0067] Step 16: This indicates that P i Position drift has occurred for the trajectories corresponding to TL1, TL2, and FL. In this case, TL2 is cleared without processing TL1, and P is... i The value of P is assigned to the weight w2, and P is... i Store P in the cache queue TL2. i This point serves as the starting point for a new displacement drift trajectory, and TL2 is used to record the subsequent trajectory. Returning to step 2, proceed to the next point P. i+1 Filtering and judgment.
[0068] Step 17: Since there is no data in the permanent valid point queue FL yet, it is impossible to make a judgment based on the points in FL. Therefore, directly clear TL1 and TL2, set w2 = null, and set the current judgment point P. i The value of P is assigned to w1, and P is set to 0. i Store the point in the cache queue TL1. Return to step 2, with the current judgment point P. i The information begins a new batch of filtering considerations for the next point P. i+1 Perform filtering and judgment.
[0069] Step 18: At this time P i The point is added to the temporary valid point cache queue TL2, and updated according to the formula w2=(1+k p )*P i -k p *w2's position value and P i The time and velocity values are assigned to the time and velocity values of w2 for updating. Add P to TL2. iAfter point P, determine whether TL2 has reached the preset quantity threshold C2. If Len(TL2)≥C2, proceed to step 19; otherwise, return directly to step 2 and proceed to the next point P. i+1 Filtering and judgment.
[0070] Step 19: If Len(TL2)≥C2, it means that although a positional shift has occurred, the temporarily valid points in TL2 are continuous and stable, i.e., the subsequent trajectories are compliant. Therefore, it is necessary to determine whether the points before the positional shift can form a valid trajectory: determine whether the number of elements in TL1 has reached the relaxed quantity threshold k. c *C1,k c Set as This means that when TL2 is full, we need to consider whether to add points from TL1, if Len(TL1) ≥ k. c *C1 satisfies the condition. First, add the points in the temporary valid point queue TL1 to the permanent valid point queue FL, then clear TL1. Otherwise, because there are not enough points in TL1, the corresponding trajectory is considered a drift trajectory, and all points in TL1 are discarded. After processing the points in TL1, add the points in TL2 to the permanent valid point queue FL and clear TL2. Then, assign the value of w2 to w1 and set w2 to null, completing the point filtering process for the current filtering batch G. Then return to step 2 to start filtering for a new batch, processing the next point P. i+1 Perform filtering and judgment.
[0071] Step 20: After all N points have been filtered and judged, there are still temporarily valid points in the cache queues TL1 and TL2. In order to retain as much point information as possible, the number of remaining points in TL1 and TL2 is checked. Since TL2 will definitely not meet the quantity requirement C2, it is only necessary to calculate whether the number of TL1 reaches the lenient quantity threshold k. c *C1. If the condition is met, the temporarily valid points in TL1 are also counted as permanently valid points and added to the permanently valid point queue FL; otherwise, they are discarded. The final set of points in the permanently valid point queue FL consists of the truly valid points.
[0072] The filtering method proposed in this invention requires adding points to a preset queue in multiple batches. Only after verifying the points can the true valid points in each batch be identified and output to the permanent valid point queue. Points not added to the FL (Frequency Queue) are all temporarily valid; only those added to the FL are the final truly valid points. Each time the temporarily valid point queue TL is updated... jOnce the data points are added to the permanent valid point queue FL, it is considered the end of the filtering for this batch of points. When a new point is input, the filtering of the next batch of points begins. During the filtering traversal of a batch of points, only one weight point is valid at any given time; either w1 or w2 is valid. These represent the stable position points after a section of the trajectory has been temporarily determined to be valid, and also represent the points from P... i-1 To P i The position point in the inertial direction. After a position drift point occurs, w2 is enabled and its value is no longer null. When no position drift point appears in the current filtering batch, the weight point w1 is used to represent the latest position and direction of travel of the trajectory. Judgment point P i A point that has a large distance offset from the weighted point is considered a temporary offset point. If no further offset occurs at any point after this temporary offset point, then P is considered to have a temporary offset point. i If the subsequent trajectory is valid, then all these points are added to FL as the final valid trajectory points, and the weight of w1 is updated to the last point P. i Conversely, if the number of trajectory points represented by the key points is relatively small and has shifted, it indicates that the trajectory of that segment does not meet the requirement for the number of permanently valid points, and is therefore uniformly considered as an offset trajectory, which needs to be filtered out.
[0073] Example: Figure 2 The diagram shown illustrates the process of filtering GPS drift points according to an embodiment of the present invention. The specific process of this embodiment is as follows:
[0074] 1. Collect GPS point data, extract time, latitude, longitude, and speed information, and input them into the algorithm. The default configuration parameters used in the algorithm are C1=8, C2=16. k p =0.05.
[0075] 2. For the first point P1, directly treat P1 as a temporarily valid point, assign its value to w1, and add P1 to the queue TL1, which records temporarily valid points when no drift has occurred. [P1 evaluation complete; continue filtering and evaluating P2.]
[0076] 3. P2 performs the judgment process: Since w2 == null, the calculation focuses on the relationship between the weight points w1 and P2 when no drift has occurred. The distance difference ΔD between the two is obtained. w1~P2 Time difference Δt and the corresponding maximum allowable movement distance ΔD max .because Therefore, P2 is considered to have not shifted and is added to the temporary valid point queue TL1 as a temporary valid point. The time and velocity values of P2 are directly assigned to w1, and simultaneously... The formula updates the position value of w1. [P2 judgment complete, continue filtering and judging P3]
[0077] 4. P3 execution judgment process: Similarly, after filtering and judging P3, because... Add P3 as a temporary valid point to the temporary valid point queue TL1. Simultaneously, update the position, time, and velocity values of w1 based on P3 and the original value of w1. [P3 evaluation complete; continue filtering and evaluating P4.]
[0078] 5. P4 performs the judgment process: Since w2 == null, P4 still calculates the relationship between w2 and w1. It obtains the distance difference between the two. Time difference Δt and corresponding maximum allowable movement distance ΔD max Because there are Therefore, P4 is a drift point for the points in the temporarily valid point queue TL1. At this point, w2 is activated, all the values of P4 are assigned to w2, and P4 is added to the temporarily valid point queue TL2 after the drift point appears. [P3 judgment ends, continue filtering and judging P4]
[0079] 6. P5 performs the judgment process: Since w2 ≠ null, P5 calculates the relationship between w2 and w2, obtaining the distance difference between them. Time difference Δt and corresponding maximum allowable movement distance ΔD max .because Therefore, P5 is also an offset point for the points in the temporarily valid point queue TL2. Considering P... i It might be a temporary drift point, so we first verify it with the points in TL1: calculate the distance difference between the current positioning point P5 and the weight point w1 representing the trajectory of the corresponding point in TL1. Time difference Δt and corresponding maximum allowable movement distance ΔD max ,because Therefore, P5 is also an offset point relative to the temporarily valid points in the temporarily valid point queue TL1. Then, it is checked against the permanently valid point queue FL, but since FL is empty at this point, P can be directly determined. i This is yet another new drift point. Clear TL1 and TL2, replace P4, and set P5 as the new drift point, assigning the value of P5 to w2. [P4 check complete, continue filtering and checking P5]
[0080] 7. P6 performs the judgment process: At this point, w2 ≠ null, therefore the relationship between P6 and w2 is calculated. The distance difference between the two is obtained. Time difference Δt and corresponding maximum allowable movement distance ΔD max .because Therefore, P6 is directly added to the temporary valid point queue TL2 as a temporary valid point. [P6 evaluation complete, continue filtering and evaluating P7]
[0081] 8. Continue with P7, P8, P9, and P 10 P 11 P 12 P 13 P 14 P 15 P 16 P 17 P 18 P 19 P 20 After filtering and calculation, no drift occurred, so all points were added to the temporary valid point queue TL2. When P... 20 Upon addition, Len(TL2) == C2 == 16, so all points in TL2 are added as permanent valid points to the permanent valid point queue FL, then TL2 is cleared, and w2 is set to null, completing the filtering for the current batch. 【P 20 The judgment is complete. Continue with P. 21 Perform filtering and judgment.
[0082] 9.P 21 When a new batch of filters is started, since w2 is now reset to null, the relationship between w2 and w1 is calculated, yielding the distance difference between them. Time difference Δt and corresponding maximum allowable movement distance ΔD max .because Therefore, P 21 It is added as a temporary valid point to the temporary valid point queue TL1, which has also been reset and cleared. [P] 21 The judgment is complete. Continue with P. 22 Perform filtering and judgment.
[0083] 10.P 21 As the last point, P 21 After the initial checks, all points have been checked. Finally, a cleanup process is performed, checking if Len(TL1) = 1 is less than k. c *1 = 6. Since the current number of TL1 points is insufficient to form a small effective trajectory segment, the midpoint P of TL1 is directly discarded. 21 This completes the entire filtration process.
[0084] 11. After completing the entire filtering process, the answer queue FL contains points P5, P6, P7, P8, P9, and P. 10 P 11 P 12 P 13 P 14 P15 P 16 P 17 P 18 P 19 P 20 These are the valid points in the filtered output; the rest are considered invalid points.
[0085] Filtering effect comparison chart explanation: (e.g.) Figure 3 As shown in (a), the vehicle's actual valid trajectory is a point trajectory starting from point ①, moving from south to north, passing over the overpass, and reaching point ②. However, at the beginning of the trajectory, ①, the vehicle is moving at low speed or even stopped near the traffic lights, causing GPS positioning to shift and the vehicle is misaligned at point ③ on the right side of the image. Due to the long parking time, there are actually many positioning anomalies at point ③. If we consider that subsequent application requirements do not require information other than latitude and longitude, we can add a filter to merge overlapping points, thus simply approximating these points with very close or even overlapping latitude and longitude as a single point (if time and acceleration information are to be retained, they can be considered as two points, the beginning and the end). Inputting the point trajectory with the processed overlapping points into the dual-queue filtering algorithm, we can see that after combining the information of subsequent points, the positional offset point at point ③ has been filtered out. The filtered point trajectory result is as follows. Figure 3 As shown in (b) in the figure.
[0086] If the subsequent use of GPS coordinates is not sensitive to information about points at the same location, multiple points that are very close to each other can be directly replaced by a single point, thereby reducing the possibility that anomalies appear too many times at once and are all near the same location, thus being considered as valid point trajectories.
[0087] Corresponding to the aforementioned embodiments of the method for filtering GPS location drift points based on dual-queue technology, the present invention also provides embodiments of an apparatus for filtering GPS location drift points based on dual-queue technology.
[0088] See Figure 4 The present invention provides an apparatus for filtering GPS location drift points based on dual-queue technology, comprising a memory and one or more processors. The memory stores executable code, and when the processor executes the executable code, it is used to implement the method for filtering GPS location drift points based on dual-queue technology in the above embodiment.
[0089] The embodiment of the device for filtering GPS location drift points based on dual-queue technology of the present invention can be applied to any device with data processing capabilities, such as a computer. The device embodiment can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 4 The diagram shown is a hardware structure diagram of any data processing-capable device in which the device for filtering GPS location drift points based on dual-queue technology of the present invention is located. (Except for...) Figure 4 In addition to the processor, memory, network interface, and non-volatile memory shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.
[0090] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0091] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0092] This invention also provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the method for filtering GPS location drift points based on dual-queue technology described in the above embodiments.
[0093] The computer-readable storage medium can be an internal storage unit of any data processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device of any data processing device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of any data processing device. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.
[0094] The above embodiments are used to explain and illustrate the present invention, but not to limit the present invention. Any modifications and changes made to the present invention within the spirit and scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A method for filtering GPS location drift points based on dual-queue technology, characterized in that, The method includes the following steps: Step 1: Data Point Extraction: Obtain GPS collection points from the terminal device within a specified continuous time range, and extract the time, latitude, longitude, and speed information from the GPS collection points to form corresponding data points; Step 2: Outlier detection: Remove data points with duplicate times as outliers, and the remaining data points are the set of valid data points; Step 3: Drift Point Filtering: Based on the data collection time sequence, the verified valid data point set is processed using a drift point filtering algorithm. This algorithm filters out points and trajectories where positions have drifted by considering segments of the trajectory, thus selecting valid points and forming a reasonable point trajectory. The specific process of the drift point filtering algorithm is as follows: Step 1: Perform algorithm initialization: Create two arrays with capacities of [sizes to be filled in]. and list and This serves as a cache queue for storing temporarily valid points when no position drift occurs and after a position drift occurs, as well as a queue of permanent valid points of variable length. This serves as a queue for storing the permanently valid answer points after filtering; additionally, two weighted points are created during initialization. and for The value, passed in with the points in the filtering batch, represents the latest position and direction of travel of the point trajectory when no position drift occurred and the point trajectory after position drift occurred; Step 2: Formal execution of the algorithm's filtering process: For those with A set of GPS data points Perform individual judgments and batch filtering, when and If no elements are found, start a new batch of filtering; for the first point... Perform step 3 for points that are not the first point. Perform step 4. ,when After all points have been judged, proceed to step 20; Step 3: Perform hypothetical processing on the first GPS point: directly use the first point in the GPS points As a temporary valid point, it is added to the temporary valid point cache queue when no drift has occurred. In the middle, and The value is directly assigned to the weight. Then return to step 2 to execute the next point. Filtering and judgment; Step 4: For points other than the first point First determine the weight and importance Is it Value, if If the two conditions are the same, proceed to step 5; otherwise, proceed to step 10. == indicates that both conditions are the same. Step 5: This indicates that no position drift point has occurred in this filtering batch at the current moment, and the weighted points are now considered. to indicate The latest position and direction of travel of the point corresponding to the temporarily valid point; determine the current judgment point. Whether it drifts or not requires calculating the current judgment point. With emphasis Distance difference Time difference and combined maximum speed get Maximum allowed movement distance within a time period ,if Proceed to step 6; otherwise proceed to step 7. Step 6: Indicates the current decision point for The temporary valid point in the trajectory is a position drift point, which is not changed. In the case of, through This represents the location of the drift point. The position and direction of travel of the subsequent point trajectory are specifically: the position drift point The value is directly assigned to the weight. and will The point is stored in a cache queue that stores temporarily valid points after the location has shifted. In the middle, return to step 2 and execute the next point. Filtering and judgment; Step 7: show With emphasis The displacement distance is within the theoretically permissible distance. Join In the process, the location value is updated by comparing the previous value of the weighted points with the newly introduced GPS points according to a certain weight ratio, and then... Assigning time and speed values to The time value and speed value are then obtained, and then step 8 is executed; Step 8: Determine Has the number of elements in the data reached the target? ,if Then proceed to step 9, if Then return directly to step 2 and execute the next point. Filtering and judgment; Step 9: Due to The preset quantity threshold has been reached. All temporarily valid points are counted as permanently valid points and added to the permanently valid point queue. In the middle, and cleared Complete the point filtering process for the current batch; return to step 2 to start filtering for the next batch. Perform filtering and judgment; Step 10: This indicates the batch size of the filter. A positional drift point has already appeared in the middle, at this time It represents The current judgment point is calculated based on the latest position and direction of travel of the point trajectory after the position drift point appears. and distance Time difference and combined maximum speed get Maximum allowed movement distance within a time period ,if Execute step 11; otherwise, execute step 18. Step 11: If there is Then let the current judgment point In turn with representatives Weights of trajectory position and direction and The last permanently valid point in the data is checked and judged; first, step 12 is executed, and then the data is compared with the weighted points. Perform verification and judgment; Step 12: Calculate the current decision point With energy representative The weights of the position and direction of travel corresponding to the temporarily valid point in the middle. Distance difference Time difference and combined maximum speed get Maximum allowed movement distance within a time period ,in the case of In the case of this, proceed to step 13. ,Will Click to join In the middle, and on the key points of weight Update the position value and Assigning time and speed values to The time value and speed value are then used to determine the next step, step 8. Does the number of midpoints already meet the condition? Step 13: Due to , will the current judgment point With permanent valid point queue Perform verification and judgment; first check Does it contain any elements? If an element is found, proceed to step 14; otherwise, proceed to step 17. Step 14: Calculate the current decision point and The last valid point in Distance difference Time difference and combined maximum speed get Maximum allowed movement distance within a time period ,if If the condition is met, proceed to step 15; otherwise, proceed to step 16. Step 15: If Then clear and All temporarily valid points in the data are re-evaluated from the current judgment point. Begin filtering considerations, settings , will the current judgment point The value assigned to and will Store in cache queue Return to step 2, with the current decision point. The information begins a new batch of filtering, targeting the next point. Perform filtering and judgment; Step 16: If If no action is taken... Clear in the case ,Will Assigning values to weights and will Store in cache queue ,Bundle As the starting point of the new displacement drift trajectory, it is used for processing. Record the subsequent trajectory; return to step 2 and proceed to the next point. Filtering and judgment; Step 17: Due to the permanent valid point queue There is currently no data available in China, so it cannot be accessed. The points in the table are used for judgment, therefore the data is directly cleared. and ,set up , will the current judgment point The value assigned to and will Store in cache queue Return to step 2, with the current decision point. The information begins a new batch of filtering considerations, for the next point. Perform filtering and judgment; Step 18: At this time ,Will Add to the temporary valid point cache queue In the middle, and on Position value and use Assigning time and speed values to Update the time and speed values; join in After clicking, make a judgment. Has the preset quantity threshold been reached? ,if If the result is positive, proceed to step 19; otherwise, return directly to step 2 and proceed to the next step. Filtering and judgment; Step 19: If ,judge Has the number of elements in the middle reached the lenient quantity threshold? , The meaning is When the number of elements is full, consider whether to add more. The point in, if If the condition is met, first queue the temporarily valid points. The points in the queue are added to the permanent valid point queue. Clear Otherwise, discard it directly. All points in the middle; after processing After the point in the middle, then put The points in the queue are added to the permanent valid point queue. Clear and empty After that The value assigned to and set for The value completes the point filtering process for the current batch; then, return to step 2 to start filtering for a new batch, targeting the next point. Perform filtering and judgment; Step 20: When After all points have been filtered and judged, the cache queue is now complete. and There are still some temporarily effective points, for and The remaining points are counted, because It is definitely impossible to meet the quantity requirements. Therefore, only calculation is needed. Does the quantity reach the lenient quantity threshold? If the conditions are met, then Temporarily valid points are also counted as permanently valid points and added to the permanently valid point queue. If the result is a valid point, it is selected; otherwise, it is discarded. This process ultimately yields a queue of permanently valid points. The point set in the set represents the truly valid points.
2. The method for filtering GPS location drift points based on dual-queue technology according to claim 1, characterized in that, In step two, all points with adjacent acquisition times and displacements within the distance threshold will be replaced with one or two points, while other points will be removed as outliers.
3. The method for filtering GPS location drift points based on dual-queue technology according to claim 1, characterized in that, In step 5, The maximum allowable movement distance is calculated as follows: in , where is the time interval between two sampling points during the calculation process; It is the preset maximum speed limit or the maximum speed of two points.
4. The method for filtering GPS location drift points based on dual-queue technology according to claim 3, characterized in that, The preset maximum speed limit is the maximum speed based on road speed limits and vehicle type; the setting of the maximum speed at two points is... The maximum permissible travel distance is calculated based on the maximum driving speed.
5. The method for filtering GPS location drift points based on dual-queue technology according to claim 1, characterized in that, In steps 7, 12, and 18: the position value update formula is as follows: , Key Points yes and Extend the line a little, It is the extension ratio parameter, and the extension distance is... .
6. A device for filtering GPS location drift points based on dual-queue technology, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that, When the processor executes the executable code, it implements the method for filtering GPS location drift points based on dual-queue technology as described in any one of claims 1-5.
7. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the method for filtering GPS location drift points based on dual-queue technology as described in any one of claims 1-5.
Citation Information
Patent Citations
Positioning drift data filtering system and method for vehicle
CN112833877A
System and method to automatically construct a flight plan from a data set for an aerial vehicle
US20210343159A1