Optimization method and device based on trajectory data rendering and interaction and medium

By combining the improved Douglas-Puk algorithm with interpolation coding and spatial indexing, the rendering and interaction of trajectory data are optimized, solving the problems of lag in rendering massive amounts of data and low efficiency in real-time updates, and achieving efficient trajectory visualization and interactive response.

CN121478891APending Publication Date: 2026-02-06浪潮(山东)农业互联网有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511603387.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing trajectory visualization methods based on OpenLayers suffer from problems such as rendering lag with massive amounts of data, imbalance between simplification and accuracy, low efficiency in real-time updates, and delayed interactive response.

Method used

An improved Douglas-Pokal algorithm is used in conjunction with map zoom level calculation to simplify the threshold, trajectory points are compressed through interpolation encoding, trajectory data loading is optimized using spatial and temporal indexes, and dynamic rendering using WebGL and vector layers is combined to achieve local redrawing and separate management of hot and cold data.

Benefits of technology

It achieves an intelligent balance between trajectory detail and visual accuracy, significantly reducing data transmission volume and rendering overhead, ensuring real-time dynamic updates and efficient interaction, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121478891A_ABST
    Figure CN121478891A_ABST
Patent Text Reader

Abstract

The invention discloses an optimization method and device based on track data rendering and interaction and a medium, and relates to the technical field of geographic information. The method comprises the following steps: calculating a simplified threshold value by using a map reference zoom level and a corresponding basic threshold value as parameters and combining a current zoom level through an improved Douglas-Peucker algorithm; the original trajectory coordinates are simplified through the simplification threshold value, and simplified trajectory data are generated; selecting a layer according to the number of the track points and the zooming level; when the newly-added track points are received, compressing the newly-added track points in a difference value coding mode, and performing local redrawing on the corresponding track segments; and based on the spatial index and the time index, monitoring a map change event, and loading trajectory data in the current viewport. According to the method, smooth visualization and efficient interaction in a high-density track scene are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of geographic information, and in particular to a trajectory data-based rendering and interaction optimization method, device and medium. BACKGROUND

[0002] In the field of Web-based geographic information systems, dynamic visualization and interaction of massive mobile target trajectory data using front-end map libraries such as OpenLayers have become a core requirement for intelligent transportation, logistics monitoring and other applications.

[0003] However, with the development of Internet of Things technology, trajectory data has shown characteristics such as large data volume, frequent updates, and complex spatio-temporal attributes, posing serious challenges to front-end rendering and interaction. Existing technical solutions usually have the following inherent defects: first, in the data preprocessing stage, a fixed simplification threshold is usually used to thin out trajectories, which cannot balance between macroscopic overview and microscopic detail views, resulting in trajectory distortion at low zoom levels and data redundancy rendering at high zoom levels; second, at the rendering level, a single vector or WebGL rendering engine cannot adapt to different trajectory scenarios from sparse to dense, either causing serious lag at high density or losing high fidelity when fine interaction is needed; third, for real-time trajectory updates, the full refresh mechanism results in large network transmission load and high rendering delay, causing visual flicker; and finally, in interactive queries, there is a lack of effective spatio-temporal indexing of massive trajectory data, resulting in slow response of viewport filtering and joint queries, seriously affecting user experience.

[0004] Through the above analysis, the problems and defects of the existing technology are: The OpenLayers-based trajectory visualization method in the prior art has the problems of massive data rendering lag, imbalance of simplification precision, low real-time update efficiency, and interactive response delay. SUMMARY

[0005] The present application provides a trajectory data-based rendering and interaction optimization method, device and medium, which can solve the problems of massive data rendering lag, imbalance of simplification precision, low real-time update efficiency, and interactive response delay in the OpenLayers-based trajectory visualization method in the prior art.

[0006] In a first aspect, the embodiments of the present application provide an optimization method for rendering and interaction based on trajectory data, which comprises: calculating a simplification threshold by using an improved Douglas-Peucker algorithm, taking a map reference zoom level and a corresponding basic threshold as parameters, and combining a current zoom level; simplifying original trajectory coordinates by using the simplification threshold to generate simplified trajectory data; selecting a layer according to a number of trajectory points and a zoom level; when receiving a new trajectory point, compressing the new trajectory point by using a difference encoding method and locally redrawing a corresponding trajectory segment; and listening to a map change event based on a spatial index and a time index, and loading trajectory data within a current viewport.

[0007] In an implementation manner of the present application, the simplification threshold is calculated according to a current zoom level of a map by using an improved Douglas-Peucker algorithm, and the original trajectory coordinates are simplified to generate simplified trajectory data, which specifically comprises: dividing a long trajectory with a number of trajectory points exceeding a threshold in the original trajectory into a plurality of trajectory segments according to time intervals and spatial distances; establishing a spatial index based on RBush for the trajectory segments, and recording a time range of the trajectory segments.

[0008] In an implementation manner of the present application, the layer is selected according to the number of trajectory points and the zoom level, which specifically comprises: using a WebGL point layer when the number of trajectory points exceeds a first predetermined threshold or the zoom level is lower than a second predetermined level; using a vector layer when the number of trajectory points exceeds the first predetermined threshold or the zoom level is lower than the second predetermined level; using an off-screen Canvas to draw a trajectory arrow mark in vector layer rendering; calculating a display interval of the arrow mark according to a current zoom level of the map, and drawing the arrow in batches after the map is rendered.

[0009] In an implementation manner of the present application, when the new trajectory point is received, the new trajectory point is compressed by using a difference encoding method, which specifically comprises: taking the last point before the new trajectory point is received as a reference, and calculating a longitude difference value and a latitude difference value of the new trajectory point and the reference point respectively; multiplying the longitude difference value and the latitude difference value by a magnification factor to generate compressed incremental trajectory data.

[0010] In an implementation manner of the present application, the map change event is listened to based on the spatial index and the time index, the trajectory data within a current viewport is loaded, and a joint query based on a spatial range and a time range is supported, which specifically comprises: for a target trajectory to be queried, querying trajectory segments located in a specified spatial range by using the RBush spatial index; and filtering out trajectory segments located in a specified time range according to a time range pre-recorded by the trajectory segments.

[0011] In an implementation form of the present application, the method further comprises: for a target trajectory to be queried, querying trajectory segments within a specified spatial range through the RBush spatial index, calculating a spatial region covered by the trajectory segments, and screening out candidate associated trajectory segments in the spatial region; extracting pre-recorded time ranges of the candidate associated trajectory segments, and calculating time overlap intervals between the candidate associated trajectory segments; if there is a time overlap interval, marking the trajectory segments as spatio-temporal associated trajectory segments and returning; if there is no time overlap, returning a non-associated result.

[0012] In an implementation form of the present application, when a new trajectory point is received, the new trajectory point is compressed by using a difference encoding method. Then, the method further comprises: fragmenting the compressed new trajectory point, adding a fragment serial number and a check code at the end of each fragment, and recording the successfully received fragment serial number in the front-end local cache; when a network interruption is detected, marking the fragment serial number of the current unfinished receiving and the end coordinate of the received data; after the network is restored, the front-end requests the data sending end to start transmission from the marked unfinished fragment serial number; after receiving the fragments of the new trajectory point, reorganizing the data according to the fragment serial number and verifying the check code; if the verification is passed, performing local redrawing based on the reorganized new trajectory point.

[0013] In an implementation form of the present application, the method further comprises: based on the time range of the trajectory segment, marking a trajectory segment less than a preset number of days from the current time as hot data, and marking a trajectory segment more than a preset number of days from the current time as cold data; storing the hot data in the front-end memory cache, and storing the cold data in the IndexedDB local database; when listening to a map view change event or a query request, preferentially loading the hot data; if the query request is for cold data, asynchronously reading the corresponding cold data in the IndexedDB, and loading cold data adjacent to the current query spatial range through a data preloading thread; temporarily caching the cold data in the memory, and releasing the memory after a preset period of time without further access after the query ends.

[0014] In a second aspect, the embodiments of the present application also provide an optimization device for rendering and interaction based on trajectory data, the device comprising at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: calculate a simplified threshold by using an improved Douglas-Peucker algorithm, taking a map reference zoom level and a corresponding basic threshold as parameters, and combining a current zoom level; simplify original trajectory coordinates by using the simplified threshold to generate simplified trajectory data; select a layer according to a number of trajectory points and a zoom level; when receiving a new trajectory point, compress the new trajectory point by using a difference encoding mode, and locally redraw a corresponding trajectory segment; and based on spatial indexing and time indexing, listen to a map change event, and load trajectory data in a current viewport.

[0015] In a third aspect, the embodiments of the present application also provide a nonvolatile computer storage medium for optimizing rendering and interaction based on trajectory data, the medium storing computer executable instructions, and the computer executable instructions are configured to: calculate a simplified threshold by using an improved Douglas-Peucker algorithm, taking a map reference zoom level and a corresponding basic threshold as parameters, and combining a current zoom level; simplify original trajectory coordinates by using the simplified threshold to generate simplified trajectory data; select a layer according to a number of trajectory points and a zoom level; when receiving a new trajectory point, compress the new trajectory point by using a difference encoding mode, and locally redraw a corresponding trajectory segment; and based on spatial indexing and time indexing, listen to a map change event, and load trajectory data in a current viewport.

[0016] The embodiments of the present application provide a method, device and medium for optimizing rendering and interaction based on trajectory data, which realizes intelligent balance of trajectory detail level and visual precision by introducing an adaptive simplification algorithm dynamically associated with a map zoom level, takes into account the requirements of smooth rendering of large-scale data and fine interaction by designing a hybrid rendering engine based on data density and view state, greatly reduces data transmission and rendering overhead by using an incremental update mechanism combining difference encoding and local redrawing, ensures real-time performance of dynamic update, and realizes fast filtering and efficient querying of trajectories in a viewport by establishing an intelligent interaction method based on spatiotemporal indexing. In addition, the spatiotemporal correlation analysis, data sharding verification and hot and cold data layering management defined in the claims effectively improve the analysis capability, transmission robustness and data management efficiency in complex scenarios, and form a comprehensive solution taking into account performance, precision and user experience. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings: Figure 1 A flowchart of an optimization method for rendering and interaction based on trajectory data provided by an embodiment of the application; Figure 2 An internal structure schematic diagram of an optimization device based on trajectory data rendering and interaction provided by an embodiment of the application. DETAILED DESCRIPTION

[0018] To make the objectives, technical solutions and advantages of the application clearer, the technical solutions of the application will be described below in detail with the embodiments of the application and the corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the application.

[0019] The embodiments of the application provide an optimization method, device and medium for rendering and interaction based on trajectory data, which solves the problems of massive data rendering lag, imbalance of simplification precision, low real-time updating efficiency and interactive response delay in the trajectory visualization method based on OpenLayers in the prior art.

[0020] The technical solutions provided by the embodiments of the application will be described in detail below with the drawings.

[0021] Figure 1 A flowchart of an optimization method for rendering and interaction based on trajectory data provided by an embodiment of the application. As shown in Figure 1 The optimization method for rendering and interaction based on trajectory data provided by the embodiments of the application specifically includes the following steps: Step 10: The improved Douglas-Puke algorithm is used to calculate the simplification threshold with the map reference zoom level and the corresponding basic threshold as parameters and in combination with the current zoom level; In this step, the key of the improved Douglas-Puke algorithm is the dynamic threshold. With the reference zoom level, it is assumed that the reference zoom level of the embodiment of the application is 18, and the corresponding basic threshold 0.000) is the reference. The lower the current zoom level is, such as 12, the larger the simplification threshold calculated by the formula: basic threshold x 2^(18-current level) is, and more non-key trajectory points, that is, redundant points on the straight line segment, are filtered. The higher the current zoom level is, the smaller the threshold is, and more detailed points, such as key coordinates at turns, are retained.

[0022] As an optional embodiment, the simplified threshold is calculated according to the current zoom level of the map by the improved Douglas-Peucker algorithm, and the original trajectory coordinates are simplified to generate the simplified trajectory data, which can specifically include the following steps. Step 101: For a long trajectory in the original trajectory, if the number of trajectory points exceeds a threshold, the long trajectory is divided into multiple trajectory segments according to time intervals and spatial distances; Step 102: An RBush-based spatial index is established for the trajectory segments, and the time range of the trajectory segments is recorded.

[0023] In this step, in order to avoid a long trajectory, it is assumed that the truck trajectory containing 200 points is divided into two segments of 100 points each according to the threshold of more than 100 points, and the division can be performed according to time intervals of 2 hours or spatial intervals of 5 kilometers. An RBush spatial index is established for each trajectory segment, the latitude and longitude range of the segment is recorded, and the time range is recorded, such as 8:00-10:00. When querying the trajectory of a certain area + a certain time period subsequently, the target trajectory segment can be quickly located without traversing the entire long trajectory.

[0024] Step 20: Simplifying the original trajectory coordinates by the simplified threshold to generate the simplified trajectory data; Step 30: Selecting a layer according to the number of trajectory points and the zoom level; As an optional embodiment, the layer is selected according to the number of trajectory points and the zoom level, which can specifically include the following steps. Step 301: When the number of trajectory points exceeds a first predetermined threshold or the zoom level is lower than a second predetermined level, a WebGL point layer is used; Step 302: When the number of trajectory points does not exceed the first predetermined threshold or the zoom level is higher than the second predetermined level, a vector layer is used; Step 303: In the vector layer rendering, an off-screen Canvas is used to draw trajectory arrow markers; and Step 304: The display interval of the arrow markers is calculated according to the current zoom level of the map, and the arrows are batch-drawn after the map is rendered.

[0025] In this step, it is assumed that the first predetermined threshold of the number of trajectory points is 5000, and the second predetermined level of the zoom level is level 14. If a trajectory contains 10000 points or the map is zoomed to level 13, a WebGL point layer is used to quickly render a large number of points and avoid lag; if a trajectory contains 3000 points and the map is zoomed to level 15, a vector layer is used, and the trajectory line is clearer and suitable for viewing details.

[0026] Step 40: When receiving a new trajectory point, the new trajectory point is compressed by using a difference encoding method, and the corresponding trajectory segment is locally redrawn.

[0027] In this step, when receiving a new trajectory point, the data transmission amount is reduced by using the difference encoding method, and only the changed trajectory segment is redrawn to avoid the delay caused by full-redrawing, and the real-time performance and efficiency are considered.

[0028] As an optional embodiment, when receiving a new track point, the new track point is compressed in a difference coding manner, which can specifically include the following steps: step 401: taking the last point before receiving the new track point as a reference, respectively calculating the longitude difference value and the latitude difference value of the new track point and the reference point; step 402: multiplying the longitude difference value and the latitude difference value by a magnification factor to generate compressed incremental track data.

[0029] In this step, in the real-time track of a certain logistics vehicle, the last recorded point A has a longitude of 116.300000 and a latitude of 39.900000, and a new point B has a longitude of 116.300123 and a latitude of 39.900456; the difference between B and A is calculated, the longitude is +0.000123, and the latitude is +0.000456; after multiplying the magnification factor 1e6 (i.e., 10 to the power of 6), the compressed data (123, 456) is obtained, only two integers need to be transmitted; only the newly added track from A to B is updated, which does not affect the previously rendered track part, and the map does not flicker.

[0030] Step 50: based on the spatial index and the time index, listening to the map change event, loading the track data in the current viewport.

[0031] In this step, by listening to the changes of the map resolution zoom or the center point translation, the geographical range of the current visible area viewport is determined in real time, and then the spatial index and the time index are used to load only the track data in the viewport and meeting the time condition, thereby avoiding the lag caused by loading the full amount of data.

[0032] As an optional embodiment, based on the spatial index and the time index, the map change event is listened to, and the track data in the current viewport is loaded, which can specifically include the following steps: step 501: for a target track to be queried, the RBush spatial index is used to query the track segment located in the specified spatial range; step 502: according to the time range pre-recorded by the track segment, the track segment located in the specified time range is filtered out.

[0033] In this step, the RBush spatial index is used to circumscribe the spatial range, such as querying the track segment in a certain area, directly positioning to the track segment in the area, and excluding other area data; in the spatial filtering result, the time range pre-stored by the track segment, such as 9:00-11:00, is used for further filtering, and only the track segment overlapping with the query time is retained, so that the final result is more accurate.

[0034] As an optional embodiment, the method further comprises: for the target trajectory to be queried, querying the trajectory segments located in the specified spatial range through the RBush spatial index, calculating the spatial region covered by the trajectory segments, and screening out the candidate associated trajectory segments in the spatial region; extracting the pre-recorded time range of the candidate associated trajectory segments, and calculating the time overlap interval between the candidate associated trajectory segments; if there is a time overlap interval, marking the trajectory segments as spatio-temporal associated trajectory segments and returning; if there is no time overlap, returning a non-associated result.

[0035] In this step, the spatio-temporal association between multiple trajectories is analyzed, whether multiple vehicles intersect in the same region at the same time, whether people travel together, etc. The core is to find the common space first, and then check the time overlap. Query whether the trajectories of truck A and truck B in the specified spatial range from 2024-05-20 9:00-10:00 are associated: find the trajectory segments of truck A and B in the region through RBush, the trajectory segment of A is 9:10-9:30, covering the region, and the trajectory segment of B is 9:20-9:40, covering; calculate the common spatial region of both as the 500-meter range of intersection, and screen out the two segments as candidate associated trajectory segments; extract the A segment time 9:10-9:30 and the B segment time 9:20-9:40, and calculate the time overlap interval as 9:20-9:30, because there is a time overlap, mark the two segments as spatio-temporal associated trajectory segments; if the B segment time is 10:00-10:20 and there is no overlap with the A segment, return a non-associated result.

[0036] As an optional embodiment, when receiving the new trajectory point, the difference encoding method is used to compress the new trajectory point, and then the method further comprises: fragmenting the compressed new trajectory point, adding a fragment number and a check code at the end of each fragment, and recording the successfully received fragment number in the local cache of the front end; when detecting network interruption, marking the fragment number of the current unfinished receiving and the end coordinate of the received data; after the network recovers, the front end requests the data sending end to start transmission from the marked unfinished fragment number; after receiving the fragments of the new trajectory point, reorganize the data according to the fragment number and verify the check code; if the verification is passed, perform local redrawing based on the reorganized new trajectory point.

[0037] In this step, after the front end receives fragments 1 and 2, the network suddenly interrupts, the local cache records that fragments 1 and 2 have been received, and marks that fragment 3 is unfinished and the end coordinate of the received data; after the network recovers, the front end only requests fragment 3, reorganizes the data according to the number after receiving, and verifies that the check codes of the three fragments match; after the verification is passed, perform local redrawing based on the reorganized new trajectory point from point P to the new end point, ensuring that the trajectory update is complete and error-free. If fragment 3 fails the verification or is damaged during transmission, only fragment 3 needs to be requested again, without the need to retransmit fragments 1 and 2, saving traffic.

[0038] As an optional embodiment, the method further comprises: based on the time range of the track segment, marking the track segment less than a preset number of days from the current time as hot data, and marking the track segment more than the preset number of days from the current time as cold data; storing the hot data in the front-end memory cache, and storing the cold data in the IndexedDB local database; when listening to a map view change event or a query request, preferentially loading the hot data; if the query request is for cold data, asynchronously reading the corresponding cold data in the IndexedDB, and loading the cold data adjacent to the current query spatial range through a data preloading thread; temporarily caching the cold data in the memory, and releasing the memory if there is no re-access within a preset period after the query ends.

[0039] In this step, the cold and hot data are separated and stored to optimize the management of the track data, balance the access speed and the memory occupation, quickly load the track with recent high-frequency access, and save the memory for the track with long-term low-frequency access.

[0040] The above is the method embodiment provided by the present application. Based on the same inventive concept, the present application also provides an optimization device for rendering and interaction based on track data, which has a structure as shown in Figure 2 .

[0041] Figure 2 The present application provides an optimization device for rendering and interaction based on track data. As shown in Figure 2 , the device comprises: at least one processor 201; and a memory 202 in communication connection with the at least one processor; The memory 202 stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor 201 to enable the at least one processor 201 to: calculate a simplified threshold value by the improved Douglas-Peucker algorithm, taking the map reference zoom level and the corresponding basic threshold value as parameters and combining the current zoom level; simplify the original track coordinates by the simplified threshold value to generate simplified track data; select a layer according to the number of track points and the zoom level; when receiving a new track point, compress the new track point by using a difference encoding method, and locally redraw the corresponding track segment; based on the spatial index and the time index, listen to a map change event, and load the track data in the current viewport.

[0042] Some embodiments of the present application provide a corresponding Figure 1The non-volatile computer storage medium based on trajectory data rendering and interaction optimization, which stores computer executable instructions, is configured to: calculate a simplified threshold value by using an improved Douglas-Peucker algorithm, taking a map reference zoom level and a corresponding basic threshold value as parameters, and combining a current zoom level; simplify original trajectory coordinates by using the simplified threshold value to generate simplified trajectory data; select a layer according to a number of trajectory points and a zoom level; when receiving a new trajectory point, compress the new trajectory point by using a difference coding mode, and locally redraw a corresponding trajectory segment; and listen to a map change event, and load trajectory data in a current viewport based on spatial indexing and time indexing.

[0043] Each of the embodiments in the present application is described in a progressive manner, and the same or similar parts of each of the embodiments can be referred to each other. Each of the embodiments mainly describes differences from other embodiments. In particular, the IoT device and medium embodiments are basically similar to the method embodiments, and thus are described simply. The related parts can be referred to the part of the method embodiments.

[0044] The system and medium provided by the embodiments of the present application are one-to-one corresponding to the method, and thus the system and medium also have similar beneficial technical effects to the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the system and medium will not be described here.

[0045] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.

[0046] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The device for implementing the functions specified in one or more flows and / or blocks. Figure 1 The device for implementing the functions specified in one or more flows and / or blocks.

[0047] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.

[0048] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.

[0049] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0050] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory. The memory is an example of computer-readable media.

[0051] Computer-readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

[0052] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0053] The above description is merely illustrative of the application, and not restrictive. Various modifications and changes can become apparent to those skilled in the art. Incorporating any modification, equivalent substitution, improvement, etc. within the spirit and principle of the application, shall be included in the scope of the claims of the application.

Claims

1. An optimization method based on trajectory data rendering and interaction, characterized in that, The method includes: The simplified threshold is calculated using the improved Douglas-Puk algorithm, taking the map baseline zoom level and the corresponding base threshold as parameters, and combining them with the current zoom level. The original trajectory coordinates are simplified using the simplification threshold to generate simplified trajectory data; Select the layer based on the number of trajectory points and the zoom level; Upon receiving a new trajectory point, the new trajectory point is compressed using differential encoding, and the corresponding trajectory segment is locally redrawn. Based on spatial and temporal indexes, listen for map change events and load the trajectory data within the current viewport.

2. The optimization method based on trajectory data rendering and interaction according to claim 1, characterized in that, The improved Douglas-Pokal algorithm calculates a simplification threshold based on the current map zoom level and simplifies the original trajectory coordinates to generate simplified trajectory data. Specifically, this includes: For long trajectories in the original trajectory where the number of trajectory points exceeds a threshold, they are divided into multiple trajectory segments according to time interval and spatial distance; A spatial index based on RBush is established for the trajectory segment, and the time range of the trajectory segment is recorded.

3. The optimization method based on trajectory data rendering and interaction according to claim 1, characterized in that, The selection of layers based on the number of trajectory points and the zoom level specifically includes: When the number of trajectory points exceeds a first predetermined threshold or the scaling level is lower than a second predetermined level, a WebGL point layer is used. When the number of trajectory points exceeds a first predetermined threshold or the scaling level is lower than a second predetermined level, a vector layer is used; In the vector layer rendering, an off-screen Canvas is used to draw trajectory arrow markers; The display interval of the arrow markers is calculated based on the current zoom level of the map, and the arrows are drawn in batches after the map is rendered.

4. The optimization method based on trajectory data rendering and interaction according to claim 1, characterized in that, The step of compressing the newly added trajectory point using differential encoding upon receipt specifically includes: Using the last point before the newly added trajectory point was received as a reference, calculate the longitude difference and latitude difference between the newly added trajectory point and the reference point respectively; The longitude and latitude differences are multiplied by a magnification factor to generate compressed incremental trajectory data.

5. The optimization method based on trajectory data rendering and interaction according to claim 1, characterized in that, The system, based on spatial and temporal indexes, monitors map change events, loads trajectory data within the current viewport, and supports joint queries based on spatial and temporal ranges. Specifically, it includes: For the target trajectory to be queried, the RBush spatial index is used to query the trajectory segments located within the specified spatial range; Based on the pre-recorded time range of the trajectory segments, the trajectory segments located within the specified time range are selected.

6. The optimization method based on trajectory data rendering and interaction according to claim 5, characterized in that, The method further includes: For the target trajectory to be queried, the trajectory segments located within the specified spatial range are retrieved through the RBush spatial index, the spatial area commonly covered by the trajectory segments is calculated, and candidate associated trajectory segments falling within the spatial area are filtered out. Extract the pre-recorded time range of the candidate associated trajectory segments, and calculate the time overlap interval between the candidate associated trajectory segments; If the aforementioned time overlap interval exists, mark the trajectory segment as a spatiotemporally related trajectory segment and return it; If there is no time overlap, return an unrelated result.

7. The optimization method based on trajectory data rendering and interaction according to claim 1, characterized in that, Upon receiving a new trajectory point, the method further includes compressing the new trajectory point using differential encoding. The newly added trajectory points after compression are segmented, and a segment number and check code are added to the end of each segment. The segment number that has been successfully received is recorded in the local cache of the front end. When a network interruption is detected, mark the sequence number of the fragment that has not yet been received and the coordinates of the end of the received data; After the network is restored, the front end requests the data sender to start transmission from the marked incomplete fragment sequence number; After receiving the fragments of the newly added trajectory points, the data is reassembled according to the fragment sequence number, and the checksum is verified. If the verification passes, local redrawing is performed based on the newly added trajectory points after reorganization.

8. The optimization method based on trajectory data rendering and interaction according to claim 1, characterized in that, The method further includes: Based on the time range of the trajectory segment, trajectory segments that are less than a preset number of days away from the current time are marked as hot data, and trajectory segments that are more than a preset number of days away from the current time are marked as cold data. The hot data is stored in the front-end memory cache, and the cold data is stored in the IndexedDB local database. When listening for map view change events or query requests, the hot data is loaded first. If the query requests the cold data, the corresponding cold data is read asynchronously from the IndexedDB, and the cold data adjacent to the current query space range is loaded through the data preloading thread; The cold data is temporarily cached in memory, and the memory is released if there is no further access within a preset period after the query ends.

9. An optimized device based on trajectory data rendering and interaction, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: The simplified threshold is calculated using the improved Douglas-Puk algorithm, taking the map baseline zoom level and the corresponding base threshold as parameters, and combining them with the current zoom level. The original trajectory coordinates are simplified using the simplification threshold to generate simplified trajectory data; Select the layer based on the number of trajectory points and the zoom level; Upon receiving a new trajectory point, the new trajectory point is compressed using differential encoding, and the corresponding trajectory segment is locally redrawn. Based on spatial and temporal indexes, it listens for map change events, loads trajectory data within the current viewport, and supports joint queries based on spatial and temporal ranges.

10. An optimized non-volatile computer storage medium based on trajectory data rendering and interaction, storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: The simplified threshold is calculated using the improved Douglas-Puk algorithm, taking the map baseline zoom level and the corresponding base threshold as parameters, and combining them with the current zoom level. The original trajectory coordinates are simplified using the simplification threshold to generate simplified trajectory data; Select the layer based on the number of trajectory points and the zoom level; Upon receiving a new trajectory point, the new trajectory point is compressed using differential encoding, and the corresponding trajectory segment is locally redrawn. Based on spatial and temporal indexes, it listens for map change events, loads trajectory data within the current viewport, and supports joint queries based on spatial and temporal ranges.