Method for improving mass position data track display efficiency
By using hash tables to store and display data filtering algorithms, the problem of low real-time trajectory display efficiency of high-frequency, massive position data in inertial navigation devices was solved, resulting in a significant improvement in display efficiency.
Patent Information
- Application Number
- CN202510994156.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-07-18
AI Technical Summary
Existing technologies struggle to effectively handle the real-time trajectory display of high-frequency, massive position data from inertial navigation equipment, resulting in low display efficiency.
A hash table is used to store location data, and a display data filtering algorithm is designed. The hash table is used to associate the mapping relationship between location data, time, and index to filter out the small amount of location data that needs to be displayed, thereby improving display efficiency.
It significantly improves the display efficiency of massive location data trajectories, especially in real-time trajectory display applications of inertial navigation, and can also be used to improve the display efficiency of massive data such as curve display.
Smart Images

Figure CN120873075A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of human-computer interaction technology, and in particular, it is a method for improving the efficiency of displaying massive location data trajectories. Background Technology
[0002] Track display is a common function for displaying and tracking targets in real time or offline, and it is widely used in navigation, monitoring and other fields.
[0003] Common application scenarios for trajectory display are generally those with low refresh rates or small data volumes. For inertial navigation systems and similar devices with data frequencies often exceeding 400Hz, real-time trajectory display presents significant challenges. Therefore, designing a method to improve the efficiency of displaying massive amounts of location data trajectories is a pressing issue that needs to be addressed. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and propose a method to improve the display efficiency of massive location data trajectories. Through the design of location data storage strategy and display data filtering algorithm, the display efficiency of massive location data trajectories is significantly improved, and the effect is good in inertial navigation real-time trajectory display applications.
[0005] The technical problem solved by this invention is achieved through the following technical solution: A method for improving the efficiency of displaying massive location data trajectories includes the following steps: Step 1: Construct a hash table to store location data, and associate the hash table with the mapping relationship between location data, location time, and location index; Step 2: Store the received or loaded location data in the hash table from Step 1 and display it; Step 3: Substitute the range of the trajectory display, the coordinate distance represented by each pixel of the trajectory display, and the point or line mode of the trajectory display into the display data filtering algorithm to filter the massive amount of location data that originally needed to be displayed, and obtain the small amount of location data that finally needs to be displayed. Step 4: Based on the small amount of location data finally filtered in Step 3, use the trajectory of the small amount of location data as the trajectory of the massive location data.
[0006] Moreover, the specific implementation method of step 1 is as follows: the hash table used to store location data includes: a hash table with key values of location data time and location data, a hash table with key values of location data index and location data time, a hash table with key values of location data time and location data index, and a hash table with key values of location data, location data time and location data index.
[0007] Furthermore, the specific implementation method of step 2 is as follows: Store the location data "info" as the value and the time "dt" as the key in the hash table "m_mapDataAll". Store the time dt as the value and the index as the key in the hash table m_mapDataAll_Index2Dt; Store the index as the value and the time dt as the key in the hash table m_mapDataAll_Dt2Index; Specify the X and Y coordinates; Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_DT_INDEX, with the X coordinate as the key. Store the index (index) as the value, time (dt) as the second-level key, and the X-coordinate as the first-level key in the hash table m_mapDataAll_X_DT_INDEX. Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_DT_INDEX, with the Y coordinate as the key. Store the index as the value, the time dt as the second-level key, and the Y coordinate as the first-level key in the hash table m_mapDataAll_Y_DT_INDEX; Use the Y-coordinate, time, and index hash table QMap <qint64,QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_Y_DT_INDEX, with the X coordinate as the key. Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_Y_DT_INDEX, with the Y coordinate as the second-level key and the X coordinate as the first-level key. Store the index as the value, the time dt as the third-level key, the Y coordinate as the second-level key, and the X coordinate as the first-level key in the hash table m_mapDataAll_X_Y_DT_INDEX; Use the X coordinate, time, and index hash table QMap <qint64,QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_X_DT_INDEX, with the Y coordinate as the key. Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_X_DT_INDEX, with the X coordinate as the second-level key and the Y coordinate as the first-level key. Store the index as the value, the time dt as the third-level key, the X coordinate as the second-level key, and the Y coordinate as the first-level key in the hash table m_mapDataAll_Y_X_DT_INDEX; Where dt represents time of type QDateTime; info represents location data of type _wtaCarTestDataInfo; index represents index; info.m_fX represents X coordinate; info.m_fY represents Y coordinate; m_mapDataAll stores all time + location data; m_mapDataAll_Index2Dt stores all index + time data; m_mapDataAll_Dt2Index stores all time + index data; m_mapDataAll_X_DT_INDEX stores all X coordinate + time + index data; m_mapDataAll_Y_DT_INDEX stores all Y coordinate + time + index data; m_mapDataAll_X_Y_DT_INDEX stores all X coordinate + (Y coordinate + time + index) data; m_mapDataAll_Y_X_DT_INDEX stores all Y coordinate + (X coordinate + time + index) data.
[0008] Furthermore, the data filtering algorithm in step 3 includes a trajectory point display data filtering algorithm and a trajectory line display data filtering algorithm.
[0009] Moreover, the trajectory point display data filtering algorithm is as follows: within the trajectory display range, the trajectory point is displayed only once on the same pixel, and only one position data is retained on the same pixel.
[0010] Furthermore, the trajectory display data filtering algorithm is as follows: using a hash table with key values representing the location data and the time and index of the location data, all data within the trajectory display range are quickly traversed to obtain the start and end times of all location data within the trajectory display range. Then, using a hash table with key values representing the time and the location data, the data between the start and end times are quickly traversed. At the same time, filtering is performed according to the principle that if two adjacent location data are on the same pixel, only one location data is retained.
[0011] Furthermore, the specific implementation method of step 4 is as follows: Set parameter fMinX: representing the minimum X coordinate of the trajectory display range; parameter fMaxX: representing the maximum X coordinate of the trajectory display range; parameter fXIntervalM: representing the coordinate distance represented by each pixel in the trajectory display in the X direction; parameter fMinY: representing the minimum Y coordinate of the trajectory display range; parameter fMaxY: representing the maximum Y coordinate of the trajectory display range; parameter fYIntervalM: representing the coordinate distance represented by each pixel in the trajectory display in the Y direction; parameter xs: representing the X coordinate of the very small amount of position data to be displayed after the data filtering algorithm; parameter ys: representing the Y coordinate of the very small amount of position data to be displayed after the data filtering algorithm. Clear the very small amount of location data that will ultimately be displayed; convert coordinate units and determine if the trajectory display parameters are correct; simultaneously check temporary variables to indicate whether display is required, and record the start and end time variables, and lock the shared data before operating on it. If data is available for manipulation, search for the hash table pointer of the smallest X coordinate within the trajectory display range by using the X coordinate as the key. If no hash table pointer of the smallest X coordinate within the trajectory display range is found, determine if the data is not found. Using the X-coordinate as the key, find the hash table pointer for the smallest X-coordinate that is greater than the trajectory display range; determine if a hash table pointer for the smallest X-coordinate that is greater than the trajectory display range is found; determine if the previous pointer of the hash table pointer for the smallest X-coordinate that is greater than the trajectory display range is not null; obtain the hash table pointer for the smallest X-coordinate that is less than the trajectory display range. If a hash table pointer is found near the minimum X coordinate within the trajectory display range; obtain the minimum X coordinate that needs to be filtered; find the hash table pointer for the maximum X coordinate within the trajectory display range, using the X coordinate as the key. Determine if a hash table pointer to the maximum X coordinate of the trajectory display range is not found; Find the hash table pointer with the largest X coordinate that is greater than the range of the trajectory display, using the X coordinate as the key. If no hash table pointer is found that corresponds to the maximum X coordinate greater than the displayed trajectory range, then obtain the hash table pointer at the end of the hash table. If a hash table pointer is found near the maximum X coordinate of the trajectory display range; obtain the maximum X coordinate to be filtered; determine if the final X coordinate to be filtered is valid; find the hash table pointer of the minimum Y coordinate of the trajectory display range from the hash table using the X coordinate as the key; If no hash table pointer for the minimum Y coordinate within the trajectory display range is found, search the hash table for a hash table pointer for the minimum Y coordinate greater than the trajectory display range, using the Y coordinate as the key. Determine if a hash table pointer to the smallest Y coordinate greater than the trajectory display range is found; determine if the preceding pointer of the hash table pointer to the smallest Y coordinate greater than the trajectory display range is not null; obtain the hash table pointer to the smallest Y coordinate less than the trajectory display range. Determine if a hash table pointer is found near the minimum Y coordinate within the trajectory display range; obtain the minimum Y coordinate that needs to be filtered; find the hash table pointer for the maximum Y coordinate within the trajectory display range, using the Y coordinate as the key. If no hash table pointer for the maximum Y coordinate within the trajectory display range is found, search the hash table for a hash table pointer for the maximum Y coordinate greater than the trajectory display range, using the Y coordinate as the key. If no hash table pointer is found that corresponds to the maximum Y coordinate greater than the displayed trajectory range, then obtain the hash table pointer at the end of the hash table. Determine if a hash table pointer is found near the maximum Y coordinate within the trajectory display range; then obtain the final maximum Y coordinate to be filtered. Determine if the Y coordinates to be filtered are valid; find the hash table pointer with the smallest X coordinate in the trajectory display range by using the X coordinate as the key. Loop through the hash table; if the key of the current hash table pointer is less than or equal to the maximum X coordinate of the trajectory display range; if the value of the current hash table pointer is not unique; filter out the time period of all data at the X coordinate of the current hash table pointer; jump to the next pointer. If the key of the current hash table pointer is greater than the maximum X coordinate of the trajectory display range; exit the loop traversal; find the hash table pointer with the minimum Y coordinate of the trajectory display range by using the Y coordinate as the key; Loop through the hash table; if the key of the current hash table pointer is less than or equal to the maximum Y coordinate of the trajectory display range; if the value of the current hash table pointer is not unique; filter out the time period of all data at the Y coordinate of the current hash table pointer; jump to the next pointer. If the key of the current hash table pointer is greater than the maximum Y coordinate of the trajectory display range; exit the loop traversal; use a temporary variable to indicate whether it needs to be displayed; unlock after operating on shared data; If filtering is required, convert coordinate units; lock before operating on shared data; if data is available for operation; obtain the hash table pointer for the end time to be filtered; temporary pointer; obtain the hash table pointer for the start time to be filtered. Check if the previous pointer of the hash table pointer that needs to be filtered for start time is not null; get the previous pointer of the hash table pointer that needs to be filtered for start time; if the hash table pointer that needs to be filtered for start time is valid; filter the current hash table pointer position to the content to be displayed; record the last hash table pointer that is filtered to be displayed; jump to the next pointer; loop through the hash table. If the hash table pointer is valid; check if the X and Y coordinates stored at the current hash table pointer are greater than or equal to 1 pixel away from the X and Y coordinates stored at the last hash table pointer that was selected for final display; select the content to be displayed at the current hash table pointer position; record the last hash table pointer that was selected for final display; jump to the next pointer; stop the loop traversal; If the hash table pointer is valid; filter the current hash table pointer position to the content to be displayed; record the last hash table pointer that was filtered to be displayed; jump to the next pointer; unlock after operating on the shared data.
[0012] The advantages and positive effects of this invention are: This invention constructs a hash table for storing location data, and the hash table establishes a mapping relationship between location data, location data time, and location data index. The received or loaded location data is stored in the hash table and displayed. The range of the displayed trajectory, the coordinate distance represented by each pixel in the displayed trajectory, and the point or line pattern of the displayed trajectory are substituted into a display data filtering algorithm to filter the massive amount of location data that would otherwise be displayed, obtaining a small number of location data that ultimately need to be displayed. Based on the small number of location data obtained after the final filtering, the trajectory of this small number of locations is used as the trajectory of the massive amount of location data. This invention, through its designed location data storage strategy and display data filtering algorithm, significantly improves the display efficiency of massive location data trajectories, and performs well in inertial navigation real-time trajectory display applications. It can also be used to improve the display efficiency of massive data such as curve displays. Attached Figure Description
[0013] Figure 1 This is a diagram showing the actual trajectory display effect of the present invention; Figure 2 This is a schematic diagram showing the actual trajectory of the present invention. Detailed Implementation
[0014] The present invention will be further described in detail below with reference to the accompanying drawings.
[0015] A method for improving the efficiency of displaying massive location data trajectories includes the following steps: Step 1: Construct a hash table to store location data, and associate the hash table with the mapping relationship between location data, location time, and location index.
[0016] The hash tables used to store location data include: hash tables with key values representing the time and location data, hash tables with key values representing the index and time of location data, hash tables with key values representing the time and index of location data, and hash tables with key values representing the location data, the time of location data, and the index of location data.
[0017] The hash table structure is as follows: QMap<QDateTime,_wtaCarTestDataInfo> m_mapDataAll; QMap<int,QDateTime> m_mapDataAll_Index2Dt; QMap<QDateTime,int> m_mapDataAll_Dt2Index; QMap <qint64, QMap<QDateTime,int> >m_mapDataAll_X_DT_INDEX; QMap <qint64, QMap<QDateTime,int> >m_mapDataAll_Y_DT_INDEX; QMap <qint64, QMap<qint64, QMap<QDateTime,int> >>m_mapDataAll_X_Y_DT_INDEX; QMap <qint64, QMap<qint64, QMap<QDateTime,int> >>m_mapDataAll_Y_X_DT_INDEX; Among them, _wtaCarTestDataInfo is the location data structure; m_mapDataAll stores all "time + location" data; m_mapDataAll_Index2Dt stores all "index + time" data; m_mapDataAll_Dt2Index stores all "time + index" data; m_mapDataAll_X_DT_INDEX stores all "X coordinate + time + index" data; m_mapDataAll_Y_DT_INDEX stores all "Y coordinate + time + index" data; m_mapDataAll_X_Y_DT_INDEX stores all "X coordinate + (Y coordinate + time + index)" data; and m_mapDataAll_Y_X_DT_INDEX stores all "Y coordinate + (X coordinate + time + index)" data.
[0018] Step 2: Store the received or loaded location data in the hash table from Step 1 and display it.
[0019] m_mapDataAll[dt] = info; / / Store the location data info as the value and the time dt as the key in the hash table m_mapDataAll m_mapDataAll_Index2Dt[index] = dt; / / Store the time dt as the value and the index as the key in the hash table m_mapDataAll_Index2Dt. m_mapDataAll_Dt2Index[dt] = index; / / Store the index as the value and the time dt as the key in the hash table m_mapDataAll_Dt2Index. qint64 x = (qint64)(info.m_fX*1000); / / X coordinate qint64 y = (qint64)(info.m_fY*1000); / / Y coordinate if(!m_mapDataAll_X_DT_INDEX.contains(x)) m_mapDataAll_X_DT_INDEX[x] = QMap<QDateTime,int> (); / / Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_DT_INDEX, with the X coordinate as the key. m_mapDataAll_X_DT_INDEX[x][dt] = index; / / Store the index as the value, time dt as the second-level key, and X coordinate as the first-level key in the hash table m_mapDataAll_X_DT_INDEX. if(!m_mapDataAll_Y_DT_INDEX.contains(y)) m_mapDataAll_Y_DT_INDEX[y] = QMap<QDateTime,int> (); / / Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_DT_INDEX, with the Y coordinate as the key. m_mapDataAll_Y_DT_INDEX[y][dt] = index; / / Store the index as the value, time dt as the second-level key, and Y coordinate as the first-level key in the hash table m_mapDataAll_Y_DT_INDEX. if(!m_mapDataAll_X_Y_DT_INDEX.contains(x)) m_mapDataAll_X_Y_DT_INDEX[x]=QMap <qint64, QMap<QDateTime,int> >(); / / Build a hash table QMap containing "Y coordinate + time and index" <qint64, QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_Y_DT_INDEX, with the X coordinate as the key. if(!m_mapDataAll_X_Y_DT_INDEX[x].contains(y)) m_mapDataAll_X_Y_DT_INDEX[x][y]= QMap<QDateTime,int> (); / / Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_Y_DT_INDEX, with the Y-coordinate as the second-level key and the X-coordinate as the first-level key. m_mapDataAll_X_Y_DT_INDEX[x][y][dt] = index; / / Store the index as the value, with time dt as the third-level key, Y coordinate as the second-level key, and X coordinate as the first-level key in the hash table m_mapDataAll_X_Y_DT_INDEX. if(!m_mapDataAll_Y_X_DT_INDEX.contains(y)) m_mapDataAll_Y_X_DT_INDEX[y]=QMap <qint64, QMap<QDateTime,int> >(); / / Restore the hash table "X coordinate + time and index" to a QMap <qint64, QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_X_DT_INDEX, with the Y coordinate as the key. if(!m_mapDataAll_Y_X_DT_INDEX[y].contains(x)) m_mapDataAll_Y_X_DT_INDEX[y][x]= QMap<QDateTime,int> (); / / Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_X_DT_INDEX, with the X coordinate as the second-level key and the Y coordinate as the first-level key. m_mapDataAll_Y_X_DT_INDEX[y][x][dt] = index; / / Store the index as the value, with time dt as the third-level key, X coordinate as the second-level key, and Y coordinate as the first-level key, into the hash table m_mapDataAll_Y_X_DT_INDEX. Where dt represents time of type QDateTime; info represents location data of type _wtaCarTestDataInfo; index represents index; info.m_fX represents X coordinate; and info.m_fY represents Y coordinate.
[0020] Step 3: Substitute the range of the trajectory display, the coordinate distance represented by each pixel in the trajectory display, and the point or line mode of the trajectory display into the display data filtering algorithm to filter the massive amount of location data that originally needed to be displayed, and obtain the small amount of location data that finally needs to be displayed.
[0021] The data filtering algorithms include trajectory point display data filtering algorithms and trajectory line display data filtering algorithms. The trajectory point display data filtering algorithm works as follows: within the trajectory display range, only one trajectory point is displayed at the same pixel, and only one location data is retained at the same pixel. The trajectory line display data filtering algorithm works as follows: using a hash table with key values representing the location data and its time and index, it quickly traverses all data within the trajectory display range to obtain the start and end times of all location data within the trajectory display range. Then, using the hash table with key values representing the time and location data, it quickly traverses the data between the start and end times, while simultaneously filtering according to the principle that if location data from two adjacent timestamps are located at the same pixel, only one location data is retained.
[0022] if(m_line.isShow()) / / Check if the line is a trajectory line and display it. getTrackData(m_tmpValueBottomX,m_tmpValueTopX,m_tmpIntervalX, m_tmpValueLeftY,m_tmpValueRightY,m_tmpIntervalY, m_tmpShowListXs, m_tmpShowListYs); / / Execute the trajectory line display data filtering algorithm else / / Check if it is a trajectory point and display it getTrackData2(m_tmpValueBottomX,m_tmpValueTopX,m_tmpIntervalX, m_tmpValueLeftY,m_tmpValueRightY,m_tmpIntervalY, m_tmpShowListXs, m_tmpShowListYs); / / Execute the trajectory point display data filtering algorithm Here, `m_line.isShow()` indicates whether the trajectory is displayed in point or line mode; `m_tmpValueTopX`, `m_tmpValueBottomX`, `m_tmpValueLeftY`, and `m_tmpValueRightY` represent the top, bottom, left, and right coordinates of the trajectory display area; `m_tmpIntervalX` and `m_tmpIntervalY` represent the coordinate distances of each pixel in the trajectory display in the X and Y directions, respectively; `m_tmpShowListXs` and `m_tmpShowListXs` represent the very small amount of position data that needs to be displayed after the data filtering algorithm; `getTrackData` represents the trajectory line display data filtering algorithm; and `getTrackData2` represents the trajectory point display data filtering algorithm. Step 4: Based on the small amount of location data finally filtered in Step 3, use the trajectory of the small amount of location data as the trajectory of the massive location data.
[0023] void getTrackData2(double fMinX,double fMaxX,double fXIntervalM, double fMinY,double fMaxY,double fYIntervalM, QList <double>&xs,QList <double>&ys) { / / Parameter fMinX: Represents the minimum X coordinate of the trajectory display range. / / Parameter fMaxX: Represents the maximum X coordinate of the trajectory display range. / / Parameter fXIntervalM: Represents the coordinate distance of each pixel in the trajectory display in the X direction. / / Parameter fMinY: Represents the minimum Y coordinate of the trajectory display range. / / Parameter fMaxY: Represents the maximum Y coordinate of the trajectory display range. / / Parameter fYIntervalM: represents the coordinate distance of each pixel in the trajectory display in the Y direction. / / Parameter xs: Represents the X-coordinate of the very small amount of location data that needs to be displayed after the data filtering algorithm. / / Parameter ys: represents the Y-coordinate of the very small amount of location data that needs to be displayed after the data filtering algorithm. xs.clear(); / / Clears the very small amount of positional data that will ultimately be displayed. ys.clear(); / / Clears the very small amount of positional data that will ultimately be displayed. m_mutexData.lock(); / / Lock the data before operating on it. if(m_mapDataAll.size()>= 1) / / If there is data available for operation { QMap<QDateTime,_wtaCarTestDataInfo> ::iterator it = m_mapDataAll.begin(); / / Get the starting pointer of the hash table m_mapDataAll QMap<QDateTime,_wtaCarTestDataInfo> ::iterator itLast; / / Define a pointer variable for the hash table xs.append(it->m_fX); / / Filter the starting position of the hash table m_mapDataAll to select the content to be displayed. ys.append(it->m_fY); / / Filter the starting position of the hash table m_mapDataAll to select the final content to be displayed. itLast = it; / / Records the pointer to the last hash table that was filtered out and is ultimately to be displayed. for(it = itLast+1;it != m_mapDataAll.end();it++) / / Iterate through the entire hash table { if( it->m_fX>= fMinX&&it->m_fX<= fMaxX &&it->m_fY>= fMinY&&it->m_fY<= fMaxY) / / Determine if the X and Y coordinates stored in the current hash table pointer are within the range of the trajectory to be filtered. { if( qAbs(itLast->m_fX-it->m_fX)>= fXIntervalM || qAbs(itLast->m_fY-it->m_fY)>= fYIntervalM) / / Check if the current hash table pointer's X and Y coordinates are greater than or equal to 1 pixel from the last hash table pointer whose X and Y coordinates were selected for final display. { xs.append(it->m_fX); / / Filters the current hash table pointer position to the content to be displayed. ys.append(it->m_fY); / / Filter the current hash table pointer position to the content to be displayed. itLast = it; / / Record the pointer to the last hash table that was selected for final display. } } } } m_mutexData.unlock(); / / Unlock after operating on shared data } The trajectory line display data filtering algorithm is as follows: Using a hash table with "key" as "location data" and "location data time and index" as "keys," all data within the trajectory display range is quickly traversed to obtain the start and end times of all location data within the trajectory display range. Then, using a hash table with "key" as "location data time" and "location data" as "keys," the data between the start and end times is quickly traversed. Simultaneously, filtering is performed according to the principle that if location data from two adjacent times are on the same pixel, only one location data is retained. This filtering principle is determined by "only one trajectory point needs to be displayed on the same pixel" and "drawing a line when the start and end points are on the same pixel is meaningless." The method implemented in this embodiment is as follows.
[0024] void getTrackData(double fMinX,double fMaxX,double fXIntervalM, double fMinY,double fMaxY,double fYIntervalM, QList <double>&xs,QList <double>&ys) { / / Parameter fMinX: Represents the minimum X coordinate of the trajectory display range. / / Parameter fMaxX: Represents the maximum X coordinate of the trajectory display range. / / Parameter fXIntervalM: Represents the coordinate distance of each pixel in the trajectory display in the X direction. / / Parameter fMinY: Represents the minimum Y coordinate of the trajectory display range. / / Parameter fMaxY: Represents the maximum Y coordinate of the trajectory display range. / / Parameter fYIntervalM: represents the coordinate distance of each pixel in the trajectory display in the Y direction. / / Parameter xs: Represents the X-coordinate of the very small amount of location data that needs to be displayed after the data filtering algorithm. / / Parameter ys: represents the Y-coordinate of the very small amount of location data that needs to be displayed after the data filtering algorithm. xs.clear(); / / Clears the very small amount of positional data that will ultimately be displayed. ys.clear(); / / Clears the very small amount of positional data that will ultimately be displayed. qint64 i64MinX = (qint64)(fMinX*1000); / / Convert coordinate units qint64 i64MaxX = (qint64)(fMaxX*1000); / / Convert coordinate units qint64 i64MinY = (qint64)(fMinY*1000); / / Convert coordinate units qint64 i64MaxY = (qint64)(fMaxY*1000); / / Convert coordinate units if( i64MinX<= i64MaxX&&i64MinY<= i64MaxY &&fXIntervalM>0&&fYIntervalM>0) / / Check if the trajectory display parameters are correct { bool bNeed = false; / / Temporary variable indicating whether to display QDateTime dtStart(QDate(2200,1,1),QTime(0,0,0)); / / Start time variable QDateTime dtEnd(QDate(1970,1,1),QTime(0,0,0)); / / End time variable m_mutexData.lock(); / / Lock the data before operating on it. if(m_mapDataAll.size()>= 1) / / If there is data available for operation { QMap <qint64, QMap<QDateTime,int> >::iterator it = m_mapDataAll_X_DT_INDEX.find(i64MinX); / / Find the hash table pointer to the smallest X coordinate within the trajectory display range, using the X coordinate as the key. if(m_mapDataAll_X_DT_INDEX.end() == it) / / Check if the hash table pointer to the minimum X coordinate of the trajectory display range is found. { it = m_mapDataAll_X_DT_INDEX.upperBound(i64MinX); / / Find the hash table pointer that retrieves the smallest X coordinate slightly larger than the displayed trajectory range, using the X coordinate as the key. if(m_mapDataAll_X_DT_INDEX.end() != it) / / Check if a hash table pointer to the smallest X coordinate slightly larger than the trajectory display range is found. { if(m_mapDataAll_X_DT_INDEX.end() != (it-1)) / / Check if the previous pointer of the hash table pointer to the minimum X coordinate slightly larger than the trajectory display range is not null it = it-1; / / Get the hash table pointer to the smallest X coordinate that is slightly smaller than the trajectory display range. } } if(m_mapDataAll_X_DT_INDEX.end() != it) / / Check if a hash table pointer is found near the minimum X coordinate of the trajectory display range. { i64MinX = it.key(); / / Get the minimum X coordinate that needs to be filtered. it = m_mapDataAll_X_DT_INDEX.find(i64MaxX); / / Find the hash table pointer to the maximum X coordinate of the trajectory display range, using the X coordinate as the key. if(m_mapDataAll_X_DT_INDEX.end() == it) / / Check if the hash table pointer to the maximum X coordinate of the trajectory display range is found. { it = m_mapDataAll_X_DT_INDEX.upperBound(i64MaxX); / / Find a hash table pointer that retrieves the maximum X coordinate slightly larger than the displayed trajectory range, using the X coordinate as the key. if(m_mapDataAll_X_DT_INDEX.end() == it) / / Check if a hash table pointer to the largest X coordinate slightly larger than the trajectory display range has been found. it = m_mapDataAll_X_DT_INDEX.end()-1; / / Get the hash table pointer at the end of the hash table } if(m_mapDataAll_X_DT_INDEX.end() != it) / / Check if a hash table pointer is found near the maximum X coordinate of the trajectory display range { i64MaxX = it.key(); / / Get the maximum X coordinate that needs to be filtered. if(i64MinX<= i64MaxX) / / Determine if the X coordinates to be filtered are valid. { it = m_mapDataAll_Y_DT_INDEX.find(i64MinY); / / Find the hash table pointer to the smallest Y coordinate within the trajectory display range, using the X coordinate as the key. if(m_mapDataAll_Y_DT_INDEX.end() == it) / / Check if the hash table pointer to the minimum Y coordinate of the trajectory display range has been found. { it = m_mapDataAll_Y_DT_INDEX.upperBound(i64MinY); / / Find the hash table pointer to the smallest Y coordinate slightly larger than the trajectory display range, using the Y coordinate as the key. if(m_mapDataAll_Y_DT_INDEX.end() != it) / / Check if a hash table pointer to the smallest Y coordinate slightly larger than the trajectory display range is found. { if(m_mapDataAll_Y_DT_INDEX.end()!=(it-1)) / / Check if the previous pointer of the hash table pointer for the smallest Y coordinate slightly larger than the trajectory display range is not null. it = it-1; / / Get the hash table pointer to the smallest Y coordinate slightly smaller than the trajectory display range. } } if(m_mapDataAll_Y_DT_INDEX.end() != it) / / Check if a hash table pointer is found near the minimum Y coordinate of the trajectory display range { i64MinY = it.key(); / / Get the minimum Y coordinate that needs to be filtered. it = m_mapDataAll_Y_DT_INDEX.find(i64MaxY); / / Find the hash table pointer to the maximum Y coordinate within the trajectory display range, using the Y coordinate as the key. if(m_mapDataAll_Y_DT_INDEX.end() == it) / / Check if the hash table pointer to the maximum Y coordinate of the trajectory display range is found. { it = m_mapDataAll_Y_DT_INDEX.upperBound(i64MaxY); / / Find a hash table pointer that retrieves the maximum Y coordinate slightly larger than the displayed trajectory range, using the Y coordinate as the key. if(m_mapDataAll_Y_DT_INDEX.end() == it) / / Check if a hash table pointer to the largest Y coordinate slightly larger than the trajectory display range has been found. it = m_mapDataAll_Y_DT_INDEX.end()-1; / / Get the hash table pointer at the end of the hash table } if(m_mapDataAll_Y_DT_INDEX.end() != it) / / Check if a hash table pointer is found near the maximum Y coordinate of the trajectory display range { i64MaxY = it.key(); / / Get the maximum Y coordinate to be filtered. if(i64MinY<= i64MaxY) / / Determine if the final Y-coordinate to be filtered is valid { it = m_mapDataAll_X_DT_INDEX.find(i64MinX); / / Find the hash table pointer to the smallest X coordinate within the trajectory display range, using the X coordinate as the key. while(m_mapDataAll_X_DT_INDEX.end() != it) / / Loop through the hash table { if(it.key()<= i64MaxX) / / If the key of the current hash table pointer is less than or equal to the maximum X coordinate of the trajectory display range. { if(it.value().size()>= 1) / / If the current hash table pointer value is not unique { / / Filter out the time period of all data at the current hash table pointer's X coordinate. if(it.value().begin().key() <dtStart) dtStart = it.value().begin().key(); if((it.value().end()-1).key()>dtEnd) dtEnd = (it.value().end()-1).key(); } it++; / / Jump the pointer to the next pointer. } else / / If the key of the current hash table pointer is greater than the maximum X coordinate of the trajectory display range break; / / Exit the loop. } it = m_mapDataAll_Y_DT_INDEX.find(i64MinY); / / Find the hash table pointer to the smallest Y coordinate within the trajectory display range, using the Y coordinate as the key. while(m_mapDataAll_Y_DT_INDEX.end() != it) / / Loop through the hash table { if(it.key()<= i64MaxY) / / If the key of the current hash table pointer is less than or equal to the maximum Y coordinate of the trajectory display range. { if(it.value().size()>= 1) / / If the current hash table pointer value is not unique { / / Filter out the time period of all data at the current hash table pointer Y coordinate. if(it.value().begin().key() <dtStart) dtStart = it.value().begin().key(); if((it.value().end()-1).key()>dtEnd) dtEnd = (it.value().end()-1).key(); } it++; / / Jump the pointer to the next pointer. } else / / If the key of the current hash table pointer is greater than the maximum Y coordinate of the trajectory display range break; / / Exit the loop. } bNeed = true; / / Temporary variable indicating whether to display. } } } } } } } m_mutexData.unlock(); / / Unlock after operating on shared data if(bNeed) / / If filtering is needed { fMinX = i64MinX*0.001; / / Convert coordinate units fMaxX = i64MaxX*0.001; / / Convert coordinate units fMinY = i64MinY*0.001; / / Convert coordinate units fMaxY = i64MaxY*0.001; / / Convert coordinate units m_mutexData.lock(); / / Lock the data before operating on it. if(m_mapDataAll.size()>= 1) / / If there is data, it can be manipulated. { QMap<QDateTime,_wtaCarTestDataInfo> ::iterator itEnd = m_mapDataAll.find(dtEnd)+1; / / Get the hash table pointer to which you want to filter by end time. QMap<QDateTime,_wtaCarTestDataInfo> ::iterator itLast; / / Temporary pointer QMap<QDateTime,_wtaCarTestDataInfo> ::iterator it = m_mapDataAll.find(dtStart); / / Get the pointer to the hash table from which you want to filter by start time. if(m_mapDataAll.end() != (it-1)) / / Check if the previous pointer of the hash table pointer for the start time is not null if filtering is required. it = it-1; / / Get the previous pointer of the hash table pointers to which the start time needs to be filtered. if (m_mapDataAll.end() != it) / / If you need to filter by start time, the hash table pointer is valid. { xs.append(it->m_fX); / / Filters the current hash table pointer position to the content to be displayed. ys.append(it->m_fY); / / Filter the current hash table pointer position to the content to be displayed. itLast = it; / / Records the pointer to the last hash table that was filtered out and is ultimately to be displayed. it++; / / Jump the pointer to the next pointer. } while(m_mapDataAll.end() != it) / / Loop through the hash table { if(it != itEnd) / / If the hash table pointer is valid { if( qAbs(itLast->m_fX-it->m_fX)>= fXIntervalM || qAbs(itLast->m_fY-it->m_fY)>= fYIntervalM) / / Check if the current hash table pointer's X and Y coordinates are greater than or equal to 1 pixel from the last hash table pointer whose X and Y coordinates were selected for final display. { xs.append(it->m_fX); / / Filters the current hash table pointer position to the content to be displayed. ys.append(it->m_fY); / / Filter the current hash table pointer position to the content to be displayed. itLast = it; / / Records the pointer to the last hash table that was filtered out and is ultimately to be displayed. } it++; / / Jump the pointer to the next pointer. } else break; / / Stop the loop iteration } if(m_mapDataAll.end() != it) / / If the hash table pointer is valid { xs.append(it->m_fX); / / Filters the current hash table pointer position to the content to be displayed. ys.append(it->m_fY); / / Filter the current hash table pointer position to the content to be displayed. itLast = it; / / Records the pointer to the last hash table that was filtered out and is ultimately to be displayed. it++; / / Jump the pointer to the next pointer. } } m_mutexData.unlock(); / / Unlock after operating on shared data } } } According to the above method for improving the efficiency of displaying massive location data trajectories, such as Figure 1 As shown, an inertial navigation system storage file containing 439,439 data points was loaded offline. Figure 2 As shown, "wtaCarTestData->loadFileData->num:439439" indicates that the amount of data to be displayed is 439439. The boxed content in the figure, "wtaCarTestTrack->testDraw->time=110ms", indicates that the time taken to display 439439 data points is 110ms, while the original display time exceeded 5000ms, showing a significant improvement in display efficiency.
[0025] It should be emphasized that the embodiments described in this invention are illustrative rather than limiting. Therefore, this invention includes, but is not limited to, the embodiments described in the specific implementation. Any other implementations derived by those skilled in the art based on the technical solutions of this invention are also within the scope of protection of this invention.< / double> < / double> < / double> < / double>
Claims
1. A method for improving the efficiency of displaying massive location data trajectories, characterized in that: Includes the following steps: Step 1: Construct a hash table to store location data, and associate the hash table with the mapping relationship between location data, location time, and location index; Step 2: Store the received or loaded location data in the hash table from Step 1 and display it; Step 3: Substitute the range of the trajectory display, the coordinate distance represented by each pixel of the trajectory display, and the point or line mode of the trajectory display into the display data filtering algorithm to filter the massive amount of location data that originally needed to be displayed, and obtain the small amount of location data that finally needs to be displayed. Step 4: Based on the small amount of location data finally filtered in Step 3, use the trajectory of the small amount of location data as the trajectory of the massive location data.
2. The method for improving the efficiency of displaying massive location data trajectories according to claim 1, characterized in that: The specific implementation method of step 1 is as follows: the hash table used to store location data includes: a hash table with key values of location data time and location data, a hash table with key values of location data index and location data time, a hash table with key values of location data time and location data index, and a hash table with key values of location data, location data time and location data index.
3. The method for improving the efficiency of displaying massive location data trajectories according to claim 1, characterized in that: The specific implementation method of step 2 is as follows: Store the location data "info" as the value and the time "dt" as the key in the hash table "m_mapDataAll". Store the time dt as the value and the index as the key in the hash table m_mapDataAll_Index2Dt; Store the index as the value and the time dt as the key in the hash table m_mapDataAll_Dt2Index; Specify the X and Y coordinates; Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_DT_INDEX, with the X coordinate as the key. Store the index (index) as the value, time (dt) as the second-level key, and the X-coordinate as the first-level key in the hash table m_mapDataAll_X_DT_INDEX. Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_DT_INDEX, with the Y coordinate as the key. Store the index as the value, the time dt as the second-level key, and the Y coordinate as the first-level key in the hash table m_mapDataAll_Y_DT_INDEX; Use the Y-coordinate, time, and index hash table QMap <qint64,QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_Y_DT_INDEX, with the X coordinate as the key. Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_X_Y_DT_INDEX, with the Y coordinate as the second-level key and the X coordinate as the first-level key. Store the index as the value, the time dt as the third-level key, the Y coordinate as the second-level key, and the X coordinate as the first-level key in the hash table m_mapDataAll_X_Y_DT_INDEX; Use the X coordinate, time, and index hash table QMap <qint64,QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_X_DT_INDEX, with the Y coordinate as the key. Use time and index hash table QMap<QDateTime,int> The values are stored in the hash table m_mapDataAll_Y_X_DT_INDEX, with the X coordinate as the second-level key and the Y coordinate as the first-level key. Store the index as the value, the time dt as the third-level key, the X coordinate as the second-level key, and the Y coordinate as the first-level key in the hash table m_mapDataAll_Y_X_DT_INDEX; Where dt represents time of type QDateTime; info represents location data of type _wtaCarTestDataInfo; index represents index; info.m_fX represents X coordinate; info.m_fY represents Y coordinate; m_mapDataAll stores all time + location data; m_mapDataAll_Index2Dt stores all index + time data; m_mapDataAll_Dt2Index stores all time + index data; m_mapDataAll_X_DT_INDEX stores all X coordinate + time + index data; m_mapDataAll_Y_DT_INDEX stores all Y coordinate + time + index data; m_mapDataAll_X_Y_DT_INDEX stores all X coordinate + (Y coordinate + time + index) data; m_mapDataAll_Y_X_DT_INDEX stores all Y coordinate + (X coordinate + time + index) data.
4. The method for improving the efficiency of displaying massive location data trajectories according to claim 1, characterized in that: The data filtering algorithm in step 3 includes a trajectory point display data filtering algorithm and a trajectory line display data filtering algorithm.
5. The method for improving the efficiency of displaying massive location data trajectories according to claim 3, characterized in that: The trajectory point display data filtering algorithm is as follows: within the trajectory display range, the trajectory point is displayed only once on the same pixel, and only one position data is retained on the same pixel.
6. The method for improving the efficiency of displaying massive location data trajectories according to claim 3, characterized in that: The trajectory display data filtering algorithm is as follows: using a hash table with key values of location data and location data time and index respectively, all data within the trajectory display range are quickly traversed to obtain the start and end times of all location data within the trajectory display range. Then, using a hash table with key values of location data time and location data respectively, the data between the start and end times are quickly traversed. At the same time, filtering is performed according to the principle that if two adjacent time points are on the same pixel, only one location data is retained.
7. The method for improving the efficiency of displaying massive location data trajectories according to claim 1, characterized in that: The specific implementation method of step 4 is as follows: Set parameter fMinX: representing the minimum X coordinate of the trajectory display range; parameter fMaxX: representing the maximum X coordinate of the trajectory display range; parameter fXIntervalM: representing the coordinate distance represented by each pixel in the trajectory display in the X direction; parameter fMinY: representing the minimum Y coordinate of the trajectory display range; parameter fMaxY: representing the maximum Y coordinate of the trajectory display range; parameter fYIntervalM: representing the coordinate distance represented by each pixel in the trajectory display in the Y direction; parameter xs: representing the X coordinate of the very small amount of position data to be displayed after the data filtering algorithm; parameter ys: representing the Y coordinate of the very small amount of position data to be displayed after the data filtering algorithm. Clear the very small amount of location data that will ultimately be displayed; Clear the very small amount of location data that will ultimately be displayed; convert coordinate units and determine if the trajectory display parameters are correct; simultaneously check temporary variables to indicate whether display is required, and record the start and end time variables, and lock the shared data before operating on it. If data is available for manipulation, search for the hash table pointer of the smallest X coordinate within the trajectory display range by using the X coordinate as the key. If no hash table pointer of the smallest X coordinate within the trajectory display range is found, determine if the data is not found. Using the X-coordinate as the key, find the hash table pointer for the smallest X-coordinate that is greater than the trajectory display range; determine if a hash table pointer for the smallest X-coordinate that is greater than the trajectory display range is found; determine if the previous pointer of the hash table pointer for the smallest X-coordinate that is greater than the trajectory display range is not null; obtain the hash table pointer for the smallest X-coordinate that is less than the trajectory display range. Determine if a hash table pointer is found near the minimum X coordinate of the trajectory display range; Obtain the minimum X coordinate that needs to be filtered; find the hash table pointer to the maximum X coordinate within the trajectory display range, using the X coordinate as the key. Determine if a hash table pointer to the maximum X coordinate of the trajectory display range is not found; Find the hash table pointer with the largest X coordinate that is greater than the range of the trajectory display, using the X coordinate as the key. If no hash table pointer is found that corresponds to the maximum X coordinate greater than the displayed trajectory range, then obtain the hash table pointer at the end of the hash table. Determine if a hash table pointer is found near the maximum X coordinate of the trajectory display range; Get the maximum X coordinate that needs to be filtered; determine if the maximum X coordinate that needs to be filtered is valid; find the hash table pointer of the minimum Y coordinate of the trajectory display range by using the X coordinate as the key. If no hash table pointer for the minimum Y coordinate within the trajectory display range is found, search the hash table for a hash table pointer for the minimum Y coordinate greater than the trajectory display range, using the Y coordinate as the key. Determine if a hash table pointer to the smallest Y coordinate greater than the trajectory display range is found; determine if the preceding pointer of the hash table pointer to the smallest Y coordinate greater than the trajectory display range is not null; obtain the hash table pointer to the smallest Y coordinate less than the trajectory display range. Determine if a hash table pointer is found near the minimum Y coordinate within the trajectory display range; Obtain the minimum Y coordinate that needs to be filtered; find the hash table pointer of the maximum Y coordinate within the trajectory display range by using the Y coordinate as the key. If no hash table pointer for the maximum Y coordinate within the trajectory display range is found, search the hash table for a hash table pointer for the maximum Y coordinate greater than the trajectory display range, using the Y coordinate as the key. If no hash table pointer is found that corresponds to the maximum Y coordinate greater than the displayed trajectory range, then obtain the hash table pointer at the end of the hash table. Determine if a hash table pointer is found near the maximum Y coordinate within the trajectory display range; Obtain the maximum Y coordinate of the final target to be filtered; Determine if the Y coordinates to be filtered are valid; find the hash table pointer with the smallest X coordinate in the trajectory display range by using the X coordinate as the key. Loop through the hash table; if the key of the current hash table pointer is less than or equal to the maximum X coordinate of the trajectory display range; if the value of the current hash table pointer is not unique; Filter out the time period for all data at the current hash table pointer's X coordinate; jump the pointer to the next pointer. If the key of the current hash table pointer is greater than the maximum X coordinate of the trajectory display range; exit the loop traversal; find the hash table pointer with the minimum Y coordinate of the trajectory display range by using the Y coordinate as the key; Loop through the hash table; if the key of the current hash table pointer is less than or equal to the maximum Y coordinate of the trajectory display range; if the value of the current hash table pointer is not unique; Filter out the time period for all data at the current hash table pointer's Y-coordinate; jump the pointer to the next pointer. If the key of the current hash table pointer is greater than the maximum Y coordinate of the trajectory display range; exit the loop traversal; A temporary variable indicating whether it needs to be displayed; it is unlocked after the shared data is accessed. If filtering is required, convert coordinate units; add a lock before operating on shared data. If there is data to manipulate; obtain the hash table pointer from the hash table to filter for the end time; Temporary pointer; Obtain the hash table pointer from the hash table that needs to be filtered by start time; Check if the previous pointer of the hash table pointers that need to be filtered by start time is not null; Get the pointer preceding the hash table pointers that need to be filtered by start time; If filtering the hash table pointers by start time is required, the current hash table pointer position is filtered to the content to be displayed. The last hash table pointer that is filtered to be displayed is recorded. Jump the pointer to the next pointer; loop through the hash table; If the hash table pointer is valid; determine if the X and Y coordinates stored at the current hash table pointer are greater than or equal to 1 pixel away from the X and Y coordinates stored at the last hash table pointer that was selected as the final content to be displayed; select the current hash table pointer position as the final content to be displayed; record the last hash table pointer that was selected as the final content to be displayed. The pointer jumps to the next pointer; the loop stops. If the hash table pointer is valid; filter the current hash table pointer position to the content to be displayed; filter the current hash table pointer position to the content to be displayed. Record the last hash table pointer that is selected as the final one to be displayed; The pointer jumps to the next pointer; the shared data is unlocked after operation.
Citation Information
Patent Citations
Method of displaying tracing points of self-adaptive map scale
CN107101641A
Spatial-temporal index constructing method oriented to massive track point data
CN107220285A
Motion track display method and system based on Beidou positioning and medium
CN119689510A