A ship trajectory hierarchical visualization method and related device
By constructing a graded slope threshold model and comprehensively judging the constraints of speed, heading, and shoreline, the problems of large volume and redundancy of ship trajectory data are solved, high-quality trajectory visualization at multiple scales is achieved, spatial logic errors are avoided, and the needs of maritime supervision are met.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU MARINE GEOLOGICAL SURVEY SANYA SOUTH CHINA SEA INST OF GEOLOGY
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-05
AI Technical Summary
The existing ship trajectory data is massive, with many redundant points and uneven spatiotemporal resolution. Traditional methods cannot adapt to multi-scale display and do not combine trajectory slope characteristics and shoreline constraints, resulting in spatial logic errors and morphological distortions after trajectory simplification.
By constructing a graded slope threshold model and combining it with changes in speed, heading, and shoreline constraints, the determination of trajectory point retention is dynamically adjusted, and vector slices are generated for multi-scale visualization, thereby achieving refined trajectory thinning.
It improves the compression rate and processing efficiency of trajectory data, ensures the spatial logic and accuracy of the trajectory, and meets the rigorous requirements of scenarios such as maritime supervision.
Smart Images

Figure CN122152958A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of maritime traffic monitoring technology, and in particular to a method for hierarchical visualization of ship trajectories and related equipment. Background Technology
[0002] AIS (Automatic Identification System) can continuously and in real time acquire dynamic information such as a ship's position (latitude and longitude), speed, course, and ship markings. It is an important data source for maritime traffic monitoring, navigation safety assurance, and marine resource management, and is widely used in maritime supervision, port operations, and maritime search and rescue.
[0003] However, due to the high-density continuous sampling mode used by the AIS system, the AIS trajectory data has the following prominent problems: 1. Huge amount of data: A single ship can generate thousands to tens of thousands of trajectory points per day. After multiple ships have been operating for a long time, they will generate massive amounts of trajectory data, which puts enormous pressure on data storage, transmission and real-time rendering.
[0004] 2. Too many redundant points: When a ship is in a stable state such as straight-line navigation or uniform speed navigation, the coordinate differences of continuously sampled trajectory points are extremely small. A large number of repeated records are invalid redundancy and waste storage resources.
[0005] 3. Uneven spatiotemporal resolution: Affected by the ship's navigation status (such as docking, low-speed navigation, high-speed navigation) and signal transmission environment, there are significant differences in the time interval and spatial spacing of AIS trajectory points, resulting in an uneven spatiotemporal distribution of trajectory data.
[0006] Trajectory simplification (thinning) is the core technology for solving the above problems. Its core goal is to reduce the number of trajectory points and the amount of data while preserving the core shape of the ship trajectory and key navigation behavior characteristics to the greatest extent possible, so as to ensure the accuracy and completeness of the visualization effect.
[0007] Currently, traditional methods for thinning ship trajectories mostly rely on geometric distance determination, without considering the slope characteristics of the ship's trajectory. Furthermore, the threshold settings are fixed, making them unsuitable for the visualization needs of maps at different scales. Specific shortcomings are as follows: 1. Fixed threshold, unable to adapt to multi-scale display: Traditional thinning methods use a single fixed threshold for judgment, while ship trajectory visualization needs to be adapted to maps of different scales (such as global sea area, port near shore, ship surrounding area, etc.). Fixed threshold will lead to oversimplification of trajectory and loss of key information at large scale, while trajectory redundancy at small scale remains unresolved.
[0008] 2. Inaccurate determination of redundant points due to lack of consideration of trajectory slope characteristics: The slope of a ship's trajectory directly reflects changes in the direction of navigation. Traditional methods do not determine redundant points based on the slope, which can easily lead to the deletion of effective inflection points or the failure to remove redundant points, making it impossible to accurately preserve the core shape of the trajectory.
[0009] 3. Failure to consider shoreline constraints can easily lead to "land crossing" phenomenon: Traditional algorithms do not take into account geographical obstacles such as shorelines and islands. During the thinning process, key inflection points may be deleted, causing the simplified trajectory to cross land areas such as shorelines and islands, resulting in spatial logic errors.
[0010] 4. Inability to integrate with map tile systems: Existing thinning methods do not incorporate GIS map vector tiling technology. The simplified trajectory data is difficult to adapt to map tiles of different levels, resulting in problems such as trajectory breakage and shape distortion during multi-scale visualization, which affects the visualization effect. Summary of the Invention
[0011] The main objective of this application is to propose a method and related equipment for hierarchical visualization of ship trajectories, which can achieve hierarchical thinning and high-quality visualization of ship trajectories, thereby improving compression ratio and processing efficiency.
[0012] To achieve the above objectives, one aspect of this application proposes a method for hierarchical visualization of ship trajectories, comprising: Obtain raw AIS data and construct a ship trajectory dataset; Based on the target visualization requirements, trajectory points within a specified time range are filtered from the ship trajectory dataset to obtain the filtered target trajectory points; Based on any two adjacent trajectory points in the target trajectory points, calculate the slope of the adjacent AIS trajectory points, and then construct a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning and construct basic slope thinning information. Based on the rate of change of speed between any two adjacent trajectory points in the target trajectory point, construct speed change constraint information; Based on the heading change of any two adjacent trajectory points in the target trajectory point, heading change constraint information is constructed; Construct shoreline or obstacle constraint information; Based on the slope-based thinning information, the speed change constraint information, the heading change constraint information, and the shoreline or obstacle constraint information, a unified trajectory point retention determination model is constructed. The trajectory point retention determination model is used to determine whether each trajectory point should be retained or removed. In response to the user's input density threshold adjustment command, the slope threshold is dynamically adjusted, and the trajectory data is thinned out based on the new slope threshold after adjustment. Vector slices are generated based on the thinned trajectory data, and then multi-scale visualization rendering is achieved based on the vector slices.
[0013] In some embodiments, acquiring raw AIS data and constructing a ship trajectory dataset includes: Obtain raw AIS data; Extract the element combination of a single trajectory point from the AIS data. The element combination includes the latitude and longitude coordinates of the trajectory point, the timestamp of the trajectory point, the ship speed corresponding to the trajectory point, and the ship heading corresponding to the trajectory point. The information representation of each trajectory point is constructed based on the combination of elements of each trajectory point, and the complete trajectory dataset of a single ship is constructed based on the information representation of each trajectory point.
[0014] In some embodiments, the step of filtering trajectory points within a specified time range from the ship trajectory dataset according to target visualization requirements to obtain the filtered target trajectory points includes: Based on the user's visualization requirements, determine the start and end times for trajectory filtering; Based on the start time and the end time, trajectory data with irrelevant times in the ship trajectory dataset are removed to obtain the filtered target trajectory points.
[0015] In some embodiments, the step of calculating the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory point, and then constructing a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning, and constructing basic slope thinning information, includes: Calculate the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory points; The slope threshold is determined based on the map scale factor and the visual error factor; wherein, the slope threshold is used to determine whether adjacent trajectory points are redundant points; Based on the slope and the slope threshold, a graded slope threshold model is constructed; Based on the graded slope threshold model, perform multi-scale adaptive trajectory thinning to obtain basic slope thinning information; The step of performing multi-scale adaptation trajectory thinning based on the graded slope threshold model to obtain basic slope thinning information includes: Traverse all adjacent trajectory points in the target trajectory, calculate the slope of each pair of adjacent points and obtain the absolute value of the slope; Get the slope threshold corresponding to the current map tile level; When the absolute value of the slope is less than the slope threshold, the corresponding trajectory point is determined to be a redundant point; when the absolute value of the slope is greater than or equal to the slope threshold, the corresponding trajectory point is determined to be a key inflection point; the redundant points are removed, and the key inflection points are retained.
[0016] In some embodiments, the construction of shoreline or obstacle constraint information includes: Based on the adjacent trajectory points to be determined during the thinning process, construct trajectory line segments; Obtain geographic obstacle data within the visualized area and construct a shoreline set; A spatial geometric intersection algorithm is used to determine whether the trajectory segment intersects with any polygon in the shoreline set. When it is determined that the two intersect, it is forbidden to delete the trajectory points in the trajectory segment.
[0017] In some embodiments, the step of dynamically adjusting the slope threshold in response to a user-input density threshold control command, and performing thinning processing on the trajectory data based on the adjusted new slope threshold, includes: Obtain the total number of trajectory points within the visualized area and the area of the visualized area, and calculate the trajectory point density within the visualized area; Based on a set density threshold, the actual visualization status information is determined by judging the difference between the density of the trajectory points and the density threshold. The slope threshold is dynamically adjusted based on the actual visualization information. Based on the adjusted new slope threshold or AIS data sampling rate, the trajectory data is thinned out.
[0018] In some embodiments, generating vector slices based on the thinned trajectory data, and then performing multi-scale visualization rendering based on the vector slices, includes: The thinned trajectory data is converted into a data format to obtain a first vector data format for lightweight display on the web and vector slices in a second vector data format for multi-scale rendering. Each vector tile is assigned a unique identifier, which includes map tile level information and the row and column number information of the current vector tile at the current tile level; The vector tiles with unique identifiers are loaded into the GIS map platform, and the corresponding trajectory tiles are called according to the current display level of the map to achieve multi-scale visualization rendering.
[0019] In some embodiments, the method further includes: Obtain the original number of trajectory points and the number of trajectory points after thinning, and calculate the compression ratio of the trajectory data; Obtain the number of turning points in the original trajectory and the number of turning points after thinning, and calculate the turning point retention rate; Based on the compression ratio and the turning point retention rate, a quantitative evaluation result of the trajectory thinning quality is generated.
[0020] Another aspect of this application embodiment provides a ship trajectory classification visualization device, including: The first module is used to acquire raw AIS data and construct a ship trajectory dataset. The second module is used to filter trajectory points within a specified time range from the ship trajectory dataset according to the target visualization requirements, and obtain the filtered target trajectory points. The third module is used to calculate the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory points, and then construct a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning and construct basic slope thinning information. The fourth module is used to construct speed change constraint information based on the speed change rate between any two adjacent trajectory points in the target trajectory point; The fifth module is used to construct heading change constraint information based on the heading change of any two adjacent trajectory points in the target trajectory point; The sixth module is used to construct shoreline or obstacle constraint information; The seventh module is used to construct a unified trajectory point retention determination model based on the slope basic thinning information, the speed change constraint information, the heading change constraint information, and the shoreline or obstacle constraint information. The trajectory point retention determination model is used to determine whether to retain or remove each trajectory point. The eighth module is used to respond to the density threshold adjustment command input by the user, dynamically adjust the slope threshold, and complete the thinning process of the trajectory data according to the new slope threshold after adjustment. The ninth module is used to generate vector slices based on the thinned trajectory data, and then to realize multi-scale visualization rendering based on the vector slices.
[0021] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0022] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.
[0023] This application also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned method.
[0024] The embodiments of this application include at least the following beneficial effects: This application provides a method and related equipment for hierarchical visualization of ship trajectories. This scheme performs multi-scale adaptive trajectory thinning by constructing a hierarchical slope threshold model, and simultaneously constructs a unified trajectory point retention determination model in conjunction with speed change constraints, heading change constraints, and shoreline or obstacle constraints, thereby achieving fine-grained control over trajectory thinning and realizing hierarchical thinning and high-quality visualization of ship trajectories. Specifically, the hierarchical slope threshold model and unified determination mechanism improve the compression rate and processing efficiency of trajectory data; by combining speed change constraint information and heading change constraint information, the accuracy of trajectory shape retention is achieved; and shoreline or obstacle constraints effectively prevent the thinned trajectory from exhibiting "land crossing" phenomena, ensuring the spatial logic and accuracy of the trajectory and meeting the stringent requirements of maritime supervision and other scenarios. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application; Figure 2 This is a flowchart of the overall steps provided in the embodiments of this application; Figure 3 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0027] It is understood that the terms "first," "second," "third," "fourth," etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0030] Before providing a detailed description of the embodiments of this application, some related technologies involved in the embodiments of this application will be described first, as follows: Currently, traditional methods for thinning ship trajectories mostly rely on geometric distance determination, without considering the slope characteristics of the ship's trajectory. Furthermore, the threshold settings are fixed, making them unsuitable for the visualization needs of maps at different scales. Specific shortcomings are as follows: 1. Fixed threshold, unable to adapt to multi-scale display: Traditional thinning methods use a single fixed threshold for judgment, while ship trajectory visualization needs to be adapted to maps of different scales (such as global sea area, port near shore, ship surrounding area, etc.). Fixed threshold will lead to oversimplification of trajectory and loss of key information at large scale, while trajectory redundancy at small scale remains unresolved. 2. Inaccurate determination of redundant points due to lack of consideration of trajectory slope characteristics: The slope of a ship's trajectory directly reflects the change in the direction of navigation. Traditional methods do not determine redundant points based on the slope, which can easily lead to the deletion of effective inflection points or the failure to remove redundant points, making it impossible to accurately preserve the core shape of the trajectory. 3. The traditional algorithm does not take into account the constraints of the shoreline and is prone to the phenomenon of "crossing the land": The traditional algorithm does not take into account the geographical obstacles such as shorelines and islands. During the thinning process, key inflection points may be deleted, which will cause the simplified trajectory to cross the shoreline, islands and other land areas, resulting in spatial logic errors. 4. Inability to integrate with map tile systems: Existing thinning methods do not incorporate GIS map vector tiling technology. The simplified trajectory data is difficult to adapt to map tiles of different levels, resulting in problems such as trajectory breakage and shape distortion during multi-scale visualization, which affects the visualization effect.
[0031] In view of this, this application provides a method for hierarchical visualization of ship trajectories, specifically achieving the following objectives: 1. Supports multi-scale display: Adapts to the display needs of maps of different scales. Based on the map tile level, it dynamically adjusts the thinning slope threshold in combination with scale factor and visual error factor to achieve efficient compression at large scales and preservation of details at small scales. 2. Retain key navigation behaviors: Based on the slope characteristics of adjacent AIS points, redundant points are identified, and key turning points such as ship turning are accurately retained to ensure that the trajectory can truly reflect the actual navigation status of the ship. 3. Avoid spatial errors: Introduce geographical obstacles such as coastlines and islands to constrain the thinned trajectory and prevent it from crossing land or obstacles, thus ensuring the spatial logic of the trajectory; 4. Suitable for massive data: It has efficient trajectory thinning capabilities, can quickly process massive AIS trajectory data, supports real-time rendering, and meets the practical application needs of scenarios such as maritime supervision and port operation.
[0032] Specifically, this application embodiment performs multi-scale adaptive trajectory thinning by constructing a graded slope threshold model. Simultaneously, it combines speed change constraints, heading change constraints, and shoreline or obstacle constraints to construct a unified trajectory point retention determination model, achieving refined control over trajectory thinning and realizing graded thinning and high-quality visualization of ship trajectories. Specifically, the graded slope threshold model and unified determination mechanism improve the compression rate and processing efficiency of trajectory data; the combination of speed change and heading change constraint information achieves high accuracy in trajectory shape retention; and shoreline or obstacle constraints effectively prevent the thinned trajectory from exhibiting "land crossing" phenomena, ensuring the spatial logic and accuracy of the trajectory and meeting the stringent requirements of maritime regulatory scenarios.
[0033] The ship trajectory hierarchical visualization method and related equipment provided in this application relate to technical fields such as maritime traffic monitoring, marine information engineering, ship data processing, ship navigation analysis, and marine management. The ship trajectory hierarchical visualization method provided in this application can be applied to a terminal, a server, or software running on a terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the ship trajectory hierarchical visualization method, but is not limited to the above forms.
[0034] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0035] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0036] likeFigure 1 The diagram shown is a schematic representation of an implementation environment provided in an embodiment of this application. (Refer to...) Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.
[0037] Server 101 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0038] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.
[0039] Terminal 102 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc. It can also be a vehicle-mounted terminal of the various device types described above, but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment does not impose any limitations.
[0040] Exemplary based on Figure 1 The implementation environment shown in this application embodiment provides a ship trajectory hierarchical visualization method. The following description uses the application of this ship trajectory hierarchical visualization method in server 101 as an example. It can be understood that this method can also be applied in terminal 102.
[0041] Reference Figure 2 , Figure 2 This flowchart illustrates a method for hierarchical visualization of ship trajectories applied to a server, as provided in this application. The execution entity of this method can be any of the aforementioned computer devices (including servers or terminals). Based on AIS trajectory data, this method achieves hierarchical thinning and high-quality visualization of ship trajectories through the steps of "trajectory modeling—time filtering—slope threshold modeling—slope determination thinning—behavioral feature constraints—spatial constraints—unified determination—density control—slice generation." The core principle is to use the slope of adjacent AIS points as the basis for thinning determination, dynamically adjusting the threshold in conjunction with the map slice level, and referring to… Figure 2 The method may include the following steps S210-S290: S210. Obtain raw AIS data and construct a ship trajectory dataset; AIS, also known as Automatic Identification System, is a new type of navigation aid system used for maritime safety and communication between ships and shore, and between ships themselves. It typically consists of a VHF radio, a GPS locator, and a communication controller connected to shipboard displays and sensors, and can automatically exchange important information such as ship position, speed, course, name, and call sign.
[0042] Specifically, step S210 above may include S2101-S2103: S2101. Obtain raw AIS data; S2102. Extract the element combination of a single trajectory point from the AIS data. The element combination includes the latitude and longitude coordinates of the trajectory point, the timestamp of the trajectory point, the ship speed corresponding to the trajectory point, and the ship heading corresponding to the trajectory point. S2103. Construct an information representation of each trajectory point based on the element combination of each trajectory point, and construct a complete trajectory dataset of a single ship based on the information representation of each trajectory point.
[0043] In some embodiments, the raw AIS data is first preprocessed to remove outliers (such as trajectory points with coordinates outside a reasonable range, abnormal speeds, or missing signals). Then, a mathematical model of the trajectory points is defined to represent the ship's trajectory in a standardized manner. This application's embodiments define a single trajectory point. For a quintuple: , in, Represents the latitude and longitude coordinates (unit: degrees) of the i-th trajectory point, corresponding to its geographic location; The timestamp (in seconds) representing the i-th trajectory point is accurate to the millisecond level and is used to characterize the time series features of the trajectory. Represents the ship's speed over ground (SOG) at the i-th trajectory point, in knots (kn). Represents the ship's course over ground (COG) corresponding to the i-th trajectory point, in degrees (°), with a range of 0° to 360°.
[0044] Based on the AIS data collected above, the final complete trajectory of a single vessel was determined. Represented as a set of trajectory points: Where n is the total number of trajectory points. The starting point of the trajectory, The endpoint of the trajectory is the trajectory point, and the trajectory point is timestamped. Arranged in ascending order.
[0045] S220. Based on the target visualization requirements, select trajectory points within a specified time range from the ship trajectory dataset to obtain the selected target trajectory points. Specifically, step S220 above may include S2201 and S2202: S2201. Determine the start and end times of trajectory filtering based on the user's visualization requirements. S2202. Based on the start time and the end time, remove trajectory data with irrelevant times from the ship trajectory dataset to obtain the filtered target trajectory points.
[0046] In some embodiments, trajectory points within a specified time range can be filtered according to actual visualization needs, eliminating trajectory data from irrelevant times to reduce data processing volume. The filtered trajectory is defined as... : ,in, Represents a single trajectory point; The start time (timestamp) representing the trajectory filtering can be set by the user according to visualization needs; Representative trajectory point Time; The end time (timestamp) of the trajectory filtering is used, which, together with the start time, forms a time window. After filtering, This refers to the target trajectory data that the current visualization task needs to process.
[0047] S230. Based on any two adjacent trajectory points in the target trajectory points, calculate the slope of the adjacent AIS trajectory points, and then construct a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning and construct basic slope thinning information. Specifically, step S230 above may include S2301-S2304: S2301. Calculate the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory points; S2302. Determine the slope threshold based on the map scale factor and the visual error factor; wherein, the slope threshold is used to determine whether adjacent trajectory points are redundant points; S2303. Construct a graded slope threshold model based on the slope and the slope threshold; S2304. Perform multi-scale adaptive trajectory thinning according to the graded slope threshold model to obtain basic slope thinning information. The step of performing multi-scale adaptation trajectory thinning based on the graded slope threshold model to obtain basic slope thinning information includes: Traverse all adjacent trajectory points in the target trajectory, calculate the slope of each pair of adjacent points and obtain the absolute value of the slope; Get the slope threshold corresponding to the current map tile level; When the absolute value of the slope is less than the slope threshold, the corresponding trajectory point is determined to be a redundant point; when the absolute value of the slope is greater than or equal to the slope threshold, the corresponding trajectory point is determined to be a key inflection point; the redundant points are removed, and the key inflection points are retained.
[0048] This application uses the slope of adjacent AIS trajectory points as the core criterion to construct a hierarchical slope threshold model. Combining map scale factors and visual error factors, the slope threshold is dynamically adjusted according to the map tile level to achieve multi-scale adaptive trajectory thinning, as detailed below: 1. Calculation of slope between adjacent trajectory points: For the filtered trajectory Any two adjacent trajectory points and (i≥2), calculate the slope between the two points. The slope calculation formula is as follows: , in, The unit is degrees (°), and the value ranges from -90° to 90°. The absolute value of the slope directly reflects the degree of change in heading between adjacent trajectory points. The smaller the absolute value of the slope, the smaller the change in heading between the two points, the gentler the trajectory, and the more likely the trajectory point is to be a redundant point. The larger the absolute value of the slope, the greater the change in heading, and the more likely the trajectory point is to be a key inflection point reflecting the ship's turning, which should be retained.
[0049] 2. Calculation of graded slope threshold: Slope threshold (The subscript L indicates the map tile level) is the core criterion for determining whether adjacent trajectory points are redundant points, and its magnitude depends on the map scale factor. and visual error factor Based on comprehensive analysis, different slope thresholds correspond to different map tile levels, and the calculation formula is as follows:
[0050] The detailed explanations of each parameter are as follows: (1) —Graded slope threshold: This represents the critical slope value (unit: degree) for determining redundant points under the current map tile level L. The smaller the threshold, the higher the thinning intensity and the fewer the number of trajectory points; the larger the threshold, the lower the thinning intensity and the more complete the trajectory details are preserved.
[0051] (2) —Slope adjustment coefficient: A dimensionless parameter used to control the overall range of the slope threshold, adapting to the navigation characteristics of different ship types (cargo ships, passenger ships, speedboats). It can be flexibly adjusted according to actual visualization accuracy requirements, and its general value range is 0.3 to 1.5. When the slope threshold is less than 1, the thinning intensity increases; When the slope threshold is greater than 1, the slope intensity decreases, and more trajectory details are preserved.
[0052] (3) —Map scale factor: Represents the spatial resolution (unit: meters / pixel) corresponding to the L-th level map tile, reflecting the map scale. The calculation formula is: Where: Parameter meaning The Earth's circumference (or projection scale constant), if the Mercator projection is used, is taken as the Earth's equatorial circumference as 40,075,000 meters; Map tile level, ranging from 0 to 20, with higher levels indicating larger map scales and higher spatial resolution. The smaller the map tile level (L), the lower the resolution; conversely, the larger the level (L), the lower the resolution. Core logic: the higher the map tile level (L), the smaller the scale and the lower the resolution. The smaller the slope threshold The larger the value, the lower the thinning intensity, preserving more turning points and ensuring the integrity of trajectory details; the lower the level L (large scale, distant visualization). The larger, The smaller the value, the higher the thinning intensity, which efficiently compresses redundant points and reduces the amount of data.
[0053] (4) —Visual error factor: Used to control the visual error after trajectory thinning to not exceed 1 screen pixel, ensuring consistency of visualization effects at different slice levels. The calculation formula is: Where: Parameter meaning Screen pixel size (unit: meters) is generally taken as 0.02 meters (i.e. 20 millimeters), but can be adjusted according to the resolution of the display device; Map resolution (unit: meters / pixel) is consistent with the map scale factor mentioned earlier. Core logic: through... The adjustment transforms the visual error of the screen into the basis for calculating the slope threshold, ensuring that the visual deviation of the heading change when the thinned trajectory is displayed on the current screen does not exceed 1 pixel, thus avoiding problems such as trajectory shape distortion and loss of turning point.
[0054] 3. Basic thinning judgment rules based on slope: Based on the above slope calculation and graded slope thresholds, basic thinning judgment rules are formulated for preliminary screening of redundant points, as follows: 1) Traverse the filtered trajectory All adjacent trajectory points Calculate the slope of each pair of adjacent points. and take its absolute value. ; 2) Obtain the slope threshold corresponding to the current map tile level L. ; 3) Judgment rules: If This indicates that the heading changes between two adjacent trajectory points are minimal, and the trajectory is flat. Therefore, the i-th trajectory point is determined. Redundant points should be deleted; if This indicates that the heading change between two adjacent trajectory points has reached a critical value, and the i-th trajectory point is determined. This is a key inflection point and should be retained. 4) In the embodiments of this application: trajectory starting point and termination point Regardless of the slope, it is forcibly preserved to ensure the integrity of the trajectory.
[0055] The basic thinning mechanism of this application takes slope as the core and combines it with hierarchical thresholds to achieve dynamic thinning at different slice levels, which ensures efficient data compression at large scales while also preserving trajectory details at small scales.
[0056] S240. Construct speed change constraint information based on the speed change rate of any two adjacent trajectory points in the target trajectory point; Specifically, in order to retain the key behavioral feature of ship speed change, this application introduces speed change constraints, identifies and retains speed change points (such as acceleration, deceleration, and stopping), and forces retention even if the absolute value of the slope at that point is less than the slope threshold. The specific definition is as follows: Define two adjacent trajectory points and rate of change of speed : ,in, Represents the ship's speed (in knots) corresponding to the i-th trajectory point; Represents the ship's speed (in knots) corresponding to the (i-1)th trajectory point; Represents the time interval (in seconds) between the i-th trajectory point and the (i-1)-th trajectory point.
[0057] Judgment criteria: Set a threshold for the rate of change of airspeed. (Unit: knots / second), this threshold can be flexibly adjusted according to the type of vessel (e.g., cargo ship, passenger ship, speedboat). Then determine the trajectory point. Points of sudden change in speed must be retained and not deleted to ensure that the ship's speed change behavior is fully recorded.
[0058] S250. Construct heading change constraint information based on the heading change of any two adjacent trajectory points in the target trajectory point; Specifically, to further accurately preserve ship turning behavior, a heading change constraint is introduced based on the slope determination to perform a secondary confirmation of the ship's turning point, avoiding the loss of the turning point due to deviations in the slope threshold setting. The specific definition is as follows: Define two adjacent trajectory points and Change in heading : ,in, Represents the ship's heading (in degrees) corresponding to the i-th trajectory point; Represents the ship's heading (in degrees) corresponding to the (i-1)th trajectory point.
[0059] Judgment criteria: Set a threshold for the change in heading. (Unit: degrees), generally ranging from 5° to 30°, can be adjusted according to actual needs. Then determine the trajectory point. The turning point must be retained and not deleted, complementing the slope determination to ensure that the ship's turning behavior is fully recorded.
[0060] S260, Construct shoreline or obstacle constraint information; Specifically, step S260 may include S2601, S2602, and S2603: S2601. Construct trajectory segments based on adjacent trajectory points to be determined during the thinning process; S2602. Obtain geographic obstacle data within the visualized area and construct a shoreline set; S2603. Using a spatial geometric intersection algorithm, determine whether the trajectory segment intersects with any polygon in the shoreline set. When it is determined that the two intersect, it is forbidden to delete the trajectory points in the trajectory segment.
[0061] In some embodiments, to avoid the "land crossing" phenomenon in the thinned trajectory, this application introduces geographical obstacles such as coastlines and islands as constraints. Through spatial intersection judgment, the spatial logic of the trajectory is ensured. Even if the absolute value of the slope of a trajectory point is less than the slope threshold, it must be retained if there is a spatial logic error. The specific definition is as follows: 1. Define trajectory segments: For adjacent trajectory points to be determined during the thinning process... and Construct trajectory segments ; 2. Define the shoreline set: Obtain data on shorelines, islands, and other geographical obstacles within the visualization area, representing them as polygons. Defined as: ,in The polygon boundary of the k-th obstacle; 3. Intersection Judgment: A spatial geometric intersection algorithm is used to determine the intersection of trajectory segments. With shoreline Whether any polygons in the array intersect, the intersection determination function is: The return value of this function is defined as: .
[0062] 4. Judgment Rules: If This indicates that the trajectory segment crosses the shoreline or an obstacle; in this case, deleting the trajectory point is prohibited. This point needs to be preserved to correct the trajectory and avoid the "land crossing" phenomenon; if If the trajectory segment has no spatial logic errors, it can be normally determined whether to delete it based on the slope threshold. .
[0063] This constraint concept has been proven through numerous experiments to effectively prevent trajectories from crossing obstacles, ensuring the spatial accuracy and logic of the trajectory, and working in synergy with slope determination and behavioral constraints.
[0064] S270. Based on the slope basic thinning information, the speed change constraint information, the heading change constraint information, and the shoreline or obstacle constraint information, a unified trajectory point retention determination model is constructed. The trajectory point retention determination model is used to determine whether to retain or remove each trajectory point. In some embodiments, this application can integrate the above-mentioned slope-based thinning, speed constraints, heading constraints, and shoreline constraints to construct a unified trajectory point retention determination model, which is used to determine whether each trajectory point needs to be retained. The specific formula is as follows: .
[0065] in, For trajectory points The retention decision function returns a boolean value (True indicates retention, False indicates deletion), and the meanings of each condition are as follows: If the absolute value of the slope of adjacent trajectory points reaches the current level slope threshold, they must be retained to ensure the trajectory geometry, which corresponds to the slope geometry constraint. The representative trajectory points are points of sudden speed changes and need to be retained to reflect the ship's speed change behavior, corresponding to dynamic change constraints. The representative trajectory point is the turning point, which needs to be retained to reflect the ship's heading change behavior, corresponding to the turning behavior constraint; This represents a trajectory line segment crossing the shoreline or obstacles, and intermediate points must be preserved to avoid spatial errors, corresponding to spatial constraints.
[0066] Based on the trajectory point retention determination model provided in this application embodiment, a trajectory point is determined to be retained if any one of the above four conditions is met; only when none of the four conditions are met is the trajectory point determined to be a redundant point and deleted. Through the joint control of the four types of conditions, the trajectory thinning goal of "geometric morphology integrity, behavioral feature preservation, and spatial logic correctness" is achieved. Among them, the slope geometric constraint is the core determination basis, and the other constraints are supplementary, ensuring the accuracy and practicality of thinning.
[0067] S280: In response to the density threshold control command input by the user, dynamically adjust the slope threshold, and complete the thinning process of the trajectory data according to the new slope threshold after adjustment. Specifically, step S280 above may include S2801-S2804: S2801. Obtain the total number of trajectory points within the visualized area and the area of the visualized area, and calculate the trajectory point density within the visualized area; S2802. Based on a set density threshold, the actual visualization status information is determined by judging the difference between the density of the trajectory points and the density threshold. S2803. Based on the actual visualization information, dynamically adjust the slope threshold; S2804. Based on the adjusted new slope threshold or AIS data sampling rate, complete the thinning process of the trajectory data.
[0068] In some embodiments, when there are multiple ships within the visualization area and the number of trajectory points is too large, trajectory overlap and visual confusion may occur. Therefore, a multi-ship density control mechanism is introduced to dynamically adjust the slope threshold and further optimize the thinning effect, as follows: Define the density of trajectory points within the visualization area. The calculation formula is: .in, Represents the total number of trajectory points within the visualized area (the sum of trajectory points for all ships); The area representing the visible region (unit: square meters) is determined by the display range set by the user.
[0069] Judgment and Adjustment Rules: Set Density Threshold (Unit: units / square meter), adjusted according to actual visualization effect; if This indicates that the density of trajectory points in the area is too high, which can easily cause visual confusion. In this case, the slope threshold needs to be reduced. (Increase the thinning intensity), reduce the number of trajectory points; if If the current slope threshold remains unchanged, the visualization effect will be clear.
[0070] S290. Generate vector slices based on the thinned trajectory data, and then realize multi-scale visualization rendering based on the vector slices.
[0071] Specifically, step S290 above may include S2901-S2903: S2901. Convert the data format of the thinned trajectory data to obtain a first vector data format for lightweight display on the Web and a vector slice under a second vector data format for multi-scale rendering. S2902. Assign a unique identifier to each vector tile, wherein the unique identifier includes map tile level information and the row and column number information of the current vector tile at the current tile level; S2903. Load the vector tiles with unique identifiers into the GIS map platform, and call the corresponding level of trajectory tiles according to the current display level of the map to achieve multi-scale visualization rendering.
[0072] In some embodiments, this application converts the thinned trajectory data into a vector format adapted to GIS maps, generates vector tiles, and realizes multi-scale visualization rendering. The specific steps are as follows: 1. Data format conversion: The thinned trajectory point set is converted into two commonly used vector data formats: GeoJSON format (for lightweight display on the web) and MVT (Mapbox Vector Tiles) format (for high-performance, multi-scale rendering). 2. Slice Association: Assign a unique identifier to each vector slice. The identifier format is , where z is the map tile level, and x and y are the row and column numbers of the tile at the current level, to achieve a one-to-one correspondence between trajectory tiles and map tiles, ensuring that different tile levels call the trajectory data thinned by the corresponding slope threshold; 3. Visualization and rendering: The generated vector tiles are loaded into the GIS map platform, and the corresponding trajectory tiles are automatically called according to the current map display level to achieve multi-scale, high-quality visualization of ship trajectories.
[0073] In addition, in some embodiments, the ship trajectory hierarchical visualization method of this application may further include the following steps: Obtain the original number of trajectory points and the number of trajectory points after thinning, and calculate the compression ratio of the trajectory data; Obtain the number of turning points in the original trajectory and the number of turning points after thinning, and calculate the turning point retention rate; Based on the compression ratio and the turning point retention rate, a quantitative evaluation result of the trajectory thinning quality is generated.
[0074] Specifically, to quantify the thinning effect and trajectory quality of the method in this application, two core evaluation metrics are introduced to verify the effectiveness of the method, as follows: 1. Compression ratio: Used to measure the compression effect of trajectory data, reflecting the proportion of data reduction. The calculation formula is: ,in, This represents the number of original trajectory points. This represents the number of trajectory points after thinning. A higher compression ratio indicates a more significant reduction in data volume and higher data processing efficiency; the compression ratio of this application can reach over 80%, balancing compression effect and trajectory quality.
[0075] 2. Turning point retention rate: This measures the degree to which the thinned trajectory retains the ship's turning behavior, and is adapted to the core logic of the slope determination in this application. The calculation formula is as follows: ,in, This represents the number of turning points in the original trajectory. This represents the number of turning points in the trajectory after thinning. A higher turning point retention rate indicates that the ship's turning behavior is more completely preserved during the thinning process, and the trajectory more accurately reflects the ship's navigation status. The turning point retention rate of this application can be controlled at over 95%, which is significantly better than traditional thinning methods.
[0076] The above two indicators are commonly used for quantitative evaluation of trajectory thinning quality. The superiority of the method of this application can be verified through specific experimental data in the embodiments. Among them, the turning point retention rate is a newly added indicator to adapt the slope thinning logic, which is more in line with the core technology of this application.
[0077] The following is a detailed description of the implementation process of the ship trajectory hierarchical visualization method provided in this application embodiment in a specific application scenario: In the fields of marine information engineering and geographic information systems (GIS), this application proposes a hierarchical visualization method for ship trajectories. This method is applicable to scenarios such as maritime traffic monitoring, ship navigation analysis, and marine management, and can achieve efficient processing and clear visualization of massive AIS trajectory data at multiple scales.
[0078] Specifically, in specific application scenarios, the following implementation steps may be included: 1. Trajectory Modeling: First, the raw AIS data is preprocessed to remove outliers (such as trajectory points with coordinates outside the reasonable range, abnormal speed, or missing signals). Then, a mathematical model of the trajectory points is defined to represent the ship's trajectory in a standardized way.
[0079] 2. Time Filtering: Based on actual visualization needs, filter trajectory points within a specified time range, remove trajectory data from irrelevant times, and reduce data processing volume.
[0080] 3. Slope threshold modeling: Using the slope of adjacent AIS trajectory points as the core criterion, a hierarchical slope threshold model is constructed. Combining map scale factors and visual error factors, the slope threshold is dynamically adjusted according to the map tile level to achieve multi-scale adaptive trajectory thinning.
[0081] 4. Slope-based thinning: Combining the slope calculation and graded slope thresholds described above, basic thinning judgment rules are formulated for preliminary screening of redundant points. This basic thinning mechanism uses slope as the core and, combined with graded thresholds, achieves dynamic thinning at different slice levels, ensuring efficient data compression at large scales while preserving trajectory details at small scales.
[0082] 5. Behavioral Feature Constraints: To preserve the key behavioral feature of ship speed changes, speed change constraints are introduced to identify and retain abrupt speed changes (such as acceleration, deceleration, and stopping). Even if the absolute value of the slope at this point is less than the slope threshold, it must still be forcibly retained. To further accurately retain ship turning behavior, based on the slope determination, heading change constraints are introduced to reconfirm the ship's turning points and avoid the loss of turning points due to deviations in the slope threshold setting.
[0083] 6. Spatial Constraints: To avoid the "land crossing" phenomenon in the thinned trajectory, geographical obstacles such as coastlines and islands are introduced as constraints. Spatial intersection judgment is used to ensure the spatial logic of the trajectory. Even if the absolute value of the slope of a trajectory point is less than the slope threshold, it must be retained if there is a spatial logic error.
[0084] 7. Unified Judgment: Integrate the above-mentioned slope thinning, speed constraints, heading constraints, and shoreline constraints to construct a unified trajectory point retention judgment model, which is used to determine whether each trajectory point needs to be retained.
[0085] 8. Density control: When there are multiple ships in the visualization area and the number of trajectory points is too large, the problem of trajectory overlap and visual confusion will occur. Therefore, a multi-ship density control mechanism is introduced to dynamically adjust the slope threshold and further optimize the thinning effect.
[0086] 9. Tile Generation: Convert the thinned trajectory data into a vector format adapted to GIS maps to generate vector tiles, enabling multi-scale visualization rendering.
[0087] It should be noted that the embodiments of this application take AIS data corresponding to ship trajectory as an example to describe in detail the process of hierarchical visualization of ship trajectory. In another embodiment, the positioning data of vehicles or spacecraft can be obtained, and then the corresponding data processing can be performed by adopting the implementation process of the trajectory hierarchical visualization method proposed in this application. This can also achieve the presentation of trajectory hierarchical visualization results for different types of vehicles and achieve the technical effect proposed in this application.
[0088] For example, taking a vehicle as a means of transportation, after obtaining the vehicle's original positioning data, a trajectory dataset of the vehicle can be constructed accordingly, and then target trajectory points that meet the time range requirements can be selected. Next, any two adjacent points are selected from the target trajectory points to calculate the slope of the adjacent trajectory points, thereby constructing basic slope thinning information. Then, by constructing vehicle speed change constraint information, vehicle steering change constraint information, and obstacle constraint information, a unified trajectory point retention determination model can be constructed. Finally, the trajectory data of the vehicle is thinned based on a dynamically adjusted slope threshold. Vector slices are generated from the thinned trajectory data, and multi-scale visualization rendering is achieved based on the vector slices.
[0089] Therefore, after obtaining the technical solution proposed in this application, those skilled in the art can apply the implementation process of the technical solution of this application to different fields such as transportation vehicles to achieve the same technical effect as proposed in this application and solve the same technical problem of trajectory visualization rendering. All of these are within the protection scope of this application and will not be elaborated here.
[0090] In summary, this application constructs a triple constraint model of "slope geometry-behavior-space," using the slope of adjacent AIS points as the core, and dynamically sets hierarchical thresholds by combining map scale factors and visual error factors. It integrates speed constraints, heading constraints, shoreline constraints, and multi-ship density control to achieve high-quality representation of ship trajectories under multi-scale conditions. Compared to traditional thinning methods and existing improved methods, this invention effectively solves problems such as fixed thresholds, inflection point loss, spatial errors, and poor multi-scale adaptability. It significantly improves data compression rate, trajectory morphology preservation, and spatial accuracy, exhibiting higher accuracy and practical value. It can be widely applied in fields such as marine information engineering, maritime supervision, and port management, and has promising prospects for widespread adoption.
[0091] Compared with existing technologies, this application has the following advantages: 1. High compression ratio and high processing efficiency: Through a graded slope threshold model and a unified judgment mechanism, a trajectory data compression ratio of over 80% can be achieved, effectively reducing the storage, transmission and rendering pressure of massive AIS data, and supporting real-time processing and visualization.
[0092] 2. Strong consistency across multiple scales: Based on map tile levels, the slope threshold is dynamically adjusted by combining scale factors and visual error factors to achieve efficient compression at large scales and preservation of details at small scales, ensuring consistent and distortion-free trajectory shapes on maps of different scales and adapting to visualization needs in multiple scenarios.
[0093] 3. Precise Trajectory Retention: Using the slope of adjacent points as the core criterion and combined with heading change constraints, it accurately retains key turning points such as ship turning, with a turning point retention rate of over 95%. This solves the problems of lost turning points and distorted trajectory in traditional methods, enabling the trajectory to truly reflect the actual navigation status of the ship.
[0094] 4. Avoid spatial errors: By constraining the shoreline or obstacles, the "land crossing" phenomenon of the thinned trajectory is effectively avoided, ensuring the spatial logic and accuracy of the trajectory and meeting the rigorous requirements of scenarios such as maritime supervision.
[0095] 5. High adaptability and practicality: The generated vector tiles can be integrated with mainstream GIS map platforms and support display on multiple terminals (Web, mobile, and desktop). They are suitable for various practical application scenarios such as maritime traffic monitoring, port operation, and ship navigation analysis.
[0096] 6. High flexibility and scalability: The slope adjustment coefficient and various thresholds can be flexibly adjusted according to the ship type and visualization accuracy requirements. At the same time, it supports multi-ship density control and can adapt to the visualization needs of different sea areas and different numbers of ships.
[0097] In some embodiments, this application also provides a ship trajectory classification visualization device, including: The first module is used to acquire raw AIS data and construct a ship trajectory dataset. The second module is used to filter trajectory points within a specified time range from the ship trajectory dataset according to the target visualization requirements, and obtain the filtered target trajectory points. The third module is used to calculate the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory points, and then construct a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning and construct basic slope thinning information. The fourth module is used to construct speed change constraint information based on the speed change rate between any two adjacent trajectory points in the target trajectory point; The fifth module is used to construct heading change constraint information based on the heading change of any two adjacent trajectory points in the target trajectory point; The sixth module is used to construct shoreline or obstacle constraint information; The seventh module is used to construct a unified trajectory point retention determination model based on the slope basic thinning information, the speed change constraint information, the heading change constraint information, and the shoreline or obstacle constraint information. The trajectory point retention determination model is used to determine whether to retain or remove each trajectory point. The eighth module is used to respond to the density threshold adjustment command input by the user, dynamically adjust the slope threshold, and complete the thinning process of the trajectory data according to the new slope threshold after adjustment. The ninth module is used to generate vector slices based on the thinned trajectory data, and then to realize multi-scale visualization rendering based on the vector slices.
[0098] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0099] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described ship trajectory hierarchical visualization method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0100] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0101] Please see Figure 3 , Figure 3 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the ship trajectory classification visualization method of the embodiments of this application. The input / output interface 903 is used to implement information input and output; The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904); The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0102] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described ship trajectory classification visualization method.
[0103] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0104] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0105] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0106] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0108] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0109] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0110] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0111] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0112] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for hierarchical visualization of ship trajectories, characterized in that, include: Obtain raw AIS data and construct a ship trajectory dataset; Based on the target visualization requirements, trajectory points within a specified time range are filtered from the ship trajectory dataset to obtain the filtered target trajectory points; Based on any two adjacent trajectory points in the target trajectory points, calculate the slope of the adjacent AIS trajectory points, and then construct a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning and construct basic slope thinning information. Based on the rate of change of speed between any two adjacent trajectory points in the target trajectory point, construct speed change constraint information; Based on the heading change of any two adjacent trajectory points in the target trajectory point, heading change constraint information is constructed; Construct shoreline or obstacle constraint information; Based on the slope-based thinning information, the speed change constraint information, the heading change constraint information, and the shoreline or obstacle constraint information, a unified trajectory point retention determination model is constructed. The trajectory point retention determination model is used to determine whether each trajectory point should be retained or removed. In response to the user's input density threshold adjustment command, the slope threshold is dynamically adjusted, and the trajectory data is thinned out based on the new slope threshold after adjustment. Vector slices are generated based on the thinned trajectory data, and then multi-scale visualization rendering is achieved based on the vector slices. The process of acquiring raw AIS data and constructing a ship trajectory dataset includes: Obtain raw AIS data; Extract the element combination of a single trajectory point from the AIS data. The element combination includes the latitude and longitude coordinates of the trajectory point, the timestamp of the trajectory point, the ship speed corresponding to the trajectory point, and the ship heading corresponding to the trajectory point. The information representation of each trajectory point is constructed based on the combination of elements of each trajectory point, and the complete trajectory dataset of a single ship is constructed based on the information representation of each trajectory point.
2. The method for hierarchical visualization of ship trajectories according to claim 1, characterized in that, The step of filtering trajectory points within a specified time range from the ship trajectory dataset according to the target visualization requirements to obtain the filtered target trajectory points includes: Based on the user's visualization requirements, determine the start and end times for trajectory filtering; Based on the start time and the end time, trajectory data with irrelevant times in the ship trajectory dataset are removed to obtain the filtered target trajectory points.
3. The method for hierarchical visualization of ship trajectories according to claim 1, characterized in that, The step involves calculating the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory point, and then constructing a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning, thereby constructing basic slope thinning information, including: Calculate the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory points; The slope threshold is determined based on the map scale factor and the visual error factor; wherein, the slope threshold is used to determine whether adjacent trajectory points are redundant points; Based on the slope and the slope threshold, a graded slope threshold model is constructed; Based on the graded slope threshold model, perform multi-scale adaptive trajectory thinning to obtain basic slope thinning information; The step of performing multi-scale adaptation trajectory thinning based on the graded slope threshold model to obtain basic slope thinning information includes: Traverse all adjacent trajectory points in the target trajectory, calculate the slope of each pair of adjacent points and obtain the absolute value of the slope; Get the slope threshold corresponding to the current map tile level; When the absolute value of the slope is less than the slope threshold, the corresponding trajectory point is determined to be a redundant point; when the absolute value of the slope is greater than or equal to the slope threshold, the corresponding trajectory point is determined to be a key inflection point; the redundant points are removed, and the key inflection points are retained.
4. The method for hierarchical visualization of ship trajectories according to claim 1, characterized in that, The constructed shoreline or obstacle constraint information includes: Based on the adjacent trajectory points to be determined during the thinning process, construct trajectory line segments; Obtain geographic obstacle data within the visualized area and construct a shoreline set; A spatial geometric intersection algorithm is used to determine whether the trajectory segment intersects with any polygon in the shoreline set. When it is determined that the two intersect, it is forbidden to delete the trajectory points in the trajectory segment.
5. The method for hierarchical visualization of ship trajectories according to claim 1, characterized in that, The process of dynamically adjusting the slope threshold in response to a user-input density threshold control command, and then performing thinning of the trajectory data based on the adjusted new slope threshold, includes: Obtain the total number of trajectory points within the visualized area and the area of the visualized area, and calculate the trajectory point density within the visualized area; Based on a set density threshold, the actual visualization status information is determined by judging the difference between the density of the trajectory points and the density threshold. The slope threshold is dynamically adjusted based on the actual visualization information. Based on the adjusted new slope threshold or AIS data sampling rate, the trajectory data is thinned out.
6. The method for hierarchical visualization of ship trajectories according to claim 1, characterized in that, The process of generating vector slices based on the thinned trajectory data, and then performing multi-scale visualization rendering based on the vector slices, includes: The thinned trajectory data is converted into a data format to obtain a first vector data format for lightweight display on the web and vector slices in a second vector data format for multi-scale rendering. Each vector tile is assigned a unique identifier, which includes map tile level information and the row and column number information of the current vector tile at the current tile level; The vector tiles with unique identifiers are loaded into the GIS map platform, and the corresponding trajectory tiles are called according to the current display level of the map to achieve multi-scale visualization rendering.
7. A method for hierarchical visualization of ship trajectories according to any one of claims 1-6, characterized in that, The method further includes: Obtain the original number of trajectory points and the number of trajectory points after thinning, and calculate the compression ratio of the trajectory data; Obtain the number of turning points in the original trajectory and the number of turning points after thinning, and calculate the turning point retention rate; Based on the compression ratio and the turning point retention rate, a quantitative evaluation result of the trajectory thinning quality is generated.
8. A ship trajectory classification visualization device, characterized in that, include: The first module is used to acquire raw AIS data and construct a ship trajectory dataset. The second module is used to filter trajectory points within a specified time range from the ship trajectory dataset according to the target visualization requirements, and obtain the filtered target trajectory points. The third module is used to calculate the slope of adjacent AIS trajectory points based on any two adjacent trajectory points in the target trajectory points, and then construct a hierarchical slope threshold model to perform multi-scale adaptive trajectory thinning and construct basic slope thinning information. The fourth module is used to construct speed change constraint information based on the speed change rate between any two adjacent trajectory points in the target trajectory point; The fifth module is used to construct heading change constraint information based on the heading change of any two adjacent trajectory points in the target trajectory point; The sixth module is used to construct shoreline or obstacle constraint information; The seventh module is used to construct a unified trajectory point retention determination model based on the slope basic thinning information, the speed change constraint information, the heading change constraint information, and the shoreline or obstacle constraint information. The trajectory point retention determination model is used to determine whether to retain or remove each trajectory point. The eighth module is used to respond to the density threshold adjustment command input by the user, dynamically adjust the slope threshold, and complete the thinning process of the trajectory data according to the new slope threshold after adjustment. The ninth module is used to generate vector slices based on the thinned trajectory data, and then to achieve multi-scale visualization rendering based on the vector slices; Specifically, the first module is used for: Obtain raw AIS data; Extract the element combination of a single trajectory point from the AIS data. The element combination includes the latitude and longitude coordinates of the trajectory point, the timestamp of the trajectory point, the ship speed corresponding to the trajectory point, and the ship heading corresponding to the trajectory point. The information representation of each trajectory point is constructed based on the combination of elements of each trajectory point, and the complete trajectory dataset of a single ship is constructed based on the information representation of each trajectory point.
9. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1 to 7.