CN117851655A - Ship track missing data completion method and system based on multi-algorithm coupling - Google Patents
Ship track missing data completion method and system based on multi-algorithm coupling Download PDFInfo
- Publication number
- CN117851655A CN117851655A CN202410247921.1A CN202410247921A CN117851655A CN 117851655 A CN117851655 A CN 117851655A CN 202410247921 A CN202410247921 A CN 202410247921A CN 117851655 A CN117851655 A CN 117851655A
- Authority
- CN
- China
- Prior art keywords
- ship
- track
- abnormal
- network node
- algorithm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 114
- 238000000034 method Methods 0.000 title claims abstract description 84
- 230000008878 coupling Effects 0.000 title claims abstract description 50
- 238000010168 coupling process Methods 0.000 title claims abstract description 50
- 238000005859 coupling reaction Methods 0.000 title claims abstract description 50
- 230000002159 abnormal effect Effects 0.000 claims abstract description 164
- 238000010586 diagram Methods 0.000 claims abstract description 53
- 230000006870 function Effects 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 12
- 238000004140 cleaning Methods 0.000 claims description 6
- 238000010276 construction Methods 0.000 claims description 4
- 230000000295 complement effect Effects 0.000 claims 8
- 230000001502 supplementing effect Effects 0.000 claims 4
- 230000004154 complement system Effects 0.000 claims 1
- 238000012163 sequencing technique Methods 0.000 claims 1
- 238000004364 calculation method Methods 0.000 description 6
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/907—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/909—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/20—Instruments for performing navigational calculations
- G01C21/203—Instruments for performing navigational calculations specially adapted for water-borne vessels
Landscapes
- Engineering & Computer Science (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Navigation (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种基于多算法耦合的船舶航迹缺失数据补全方法及系统,所述方法包括:获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据航行点位数据得到多段船舶轨迹子段,并得到多段异常轨迹子段;获取每段异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段异常轨迹子段的端点信息对应的网络节点信息;配置A星算法,并根据A星算法对每个网络节点信息进行路径规划操作,得到每段异常轨迹子段的最优路径,根据所有最优路径对待处理船只的船舶航迹进行补全。本发明可以快速高效地找到最优路径,提高了数据补全的效率,通过构建典型航道网络图也提高了数据补全的准确性。
The present invention discloses a method and system for completing missing data of ship tracks based on multi-algorithm coupling, the method comprising: obtaining navigation point data of a ship to be processed and all land surface elements on a map, and obtaining multiple ship track sub-segments according to the navigation point data, and obtaining multiple abnormal track sub-segments; obtaining endpoint information corresponding to each abnormal track sub-segment, and obtaining network node information corresponding to the endpoint information of each abnormal track sub-segment according to a pre-constructed typical waterway network diagram; configuring an A-star algorithm, and performing a path planning operation on each network node information according to the A-star algorithm, obtaining the optimal path of each abnormal track sub-segment, and completing the ship track of the ship to be processed according to all the optimal paths. The present invention can quickly and efficiently find the optimal path, improve the efficiency of data completion, and also improve the accuracy of data completion by constructing a typical waterway network diagram.
Description
技术领域Technical Field
本发明涉及船舶航迹数据技术领域,尤其涉及一种基于多算法耦合的船舶航迹缺失数据补全方法、系统、终端及计算机可读存储介质。The present invention relates to the field of ship track data technology, and in particular to a method, system, terminal and computer-readable storage medium for completing missing ship track data based on multi-algorithm coupling.
背景技术Background technique
当前,船舶自动定位系统(Automatic identification System,AIS)被广泛用于追踪和识别船只,在AIS中,船舶位置的更新频率在10分钟以内,但由于设备故障、通信干扰、人为操作等原因,AIS数据可能丢失或错误,导致部分海域船舶历史定位数据稀疏且不连贯,此时需要在时间间隔大或者距离远的船舶轨迹点之间进行数据补全,以便更好地了解和分析实际的船舶移动轨迹。Currently, the Automatic Identification System (AIS) is widely used to track and identify ships. In AIS, the update frequency of the ship's position is within 10 minutes. However, due to equipment failure, communication interference, human operation and other reasons, AIS data may be lost or erroneous, resulting in sparse and incoherent historical positioning data of ships in some sea areas. At this time, it is necessary to complete the data between ship trajectory points with large time intervals or long distances in order to better understand and analyze the actual ship movement trajectory.
目前AIS轨迹数据补全的主要方法包括自动补全方法与人工干预方法,前者主要包括基于航行信息插值的轨迹数据补全方法和结合数值插值的轨迹数据补全方法,这两种方法在处理轨迹数据时,往往基于一个重要的假设:船舶的轨迹点之间不横跨陆地。这一假设虽然简化了数据处理过程,但在实际应用中却具有明显的局限性,无法有效还原船舶绕行陆地情景下的实际航行情况,导致在这类区域的轨迹追踪出现明显的异常和失真,从而影响轨迹数据的真实性和可用性。At present, the main methods for AIS track data completion include automatic completion methods and manual intervention methods. The former mainly includes track data completion methods based on navigation information interpolation and track data completion methods combined with numerical interpolation. When processing track data, these two methods are often based on an important assumption: the track points of the ship do not cross the land. Although this assumption simplifies the data processing process, it has obvious limitations in practical applications. It cannot effectively restore the actual navigation situation of the ship in the scenario of bypassing the land, resulting in obvious anomalies and distortions in track tracking in such areas, thus affecting the authenticity and availability of track data.
与自动补全方法相比,人工干预方法则尝试通过结合人工设定的航道网格进行路径规划,以此来修正和补全涉及陆地区域的船舶轨迹数据。这种方法在一定程度上能够考虑到船舶绕行陆地的实际航行情况,从而提高数据补全的准确性。然而,人工干预方法不仅耗费大量时间和人力成本,在实际操作中因不考虑原始航行数据中蕴含的航行规律和模式,难以保证补全轨迹的准确性和可靠性。Compared with the automatic completion method, the manual intervention method attempts to correct and complete the ship trajectory data involving land areas by combining the manually set channel grid for path planning. This method can take into account the actual navigation situation of ships around land to a certain extent, thereby improving the accuracy of data completion. However, the manual intervention method not only consumes a lot of time and manpower costs, but also in actual operation, it is difficult to ensure the accuracy and reliability of the completed trajectory because it does not consider the navigation laws and patterns contained in the original navigation data.
因此,现有技术还有待于改进和发展。Therefore, the prior art still needs to be improved and developed.
发明内容Summary of the invention
本发明的主要目的在于提供一种基于多算法耦合的船舶航迹缺失数据补全方法、系统、终端及计算机可读存储介质,旨在解决现有技术对涉及陆地区域的船舶轨迹数据进行补全的效率低、准确性差,导致补全后的船舶轨迹异常和失真的问题。The main purpose of the present invention is to provide a method, system, terminal and computer-readable storage medium for completing missing ship track data based on multi-algorithm coupling, aiming to solve the problem of low efficiency and poor accuracy in the existing technology for completing ship track data involving land areas, resulting in abnormal and distorted ship tracks after completion.
为实现上述目的,本发明提供一种基于多算法耦合的船舶航迹缺失数据补全方法,所述基于多算法耦合的船舶航迹缺失数据补全方法包括如下步骤:To achieve the above object, the present invention provides a method for completing missing data of ship tracks based on multi-algorithm coupling, and the method for completing missing data of ship tracks based on multi-algorithm coupling comprises the following steps:
获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段;Obtaining navigation point data of the vessel to be processed and all land surface elements on the map, and obtaining multiple ship track sub-segments according to the navigation point data;
根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段;According to the spatial query method, each of the ship track sub-segments is respectively intersected with all the land surface elements to obtain multiple abnormal track sub-segments;
获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息;Acquire endpoint information corresponding to each abnormal trajectory sub-segment, and acquire network node information corresponding to the endpoint information of each abnormal trajectory sub-segment according to a pre-constructed typical waterway network diagram;
配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,根据所有所述最优路径对所述待处理船只的船舶航迹进行补全。An A-star algorithm is configured, and a path planning operation is performed on each of the network node information according to the A-star algorithm to obtain an optimal path for each of the abnormal trajectory sub-segments, and the ship track of the ship to be processed is completed according to all the optimal paths.
可选地,所述的基于多算法耦合的船舶航迹缺失数据补全方法,其中,所述获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段,具体包括:Optionally, the method for completing missing ship track data based on multi-algorithm coupling, wherein the step of obtaining navigation point data of the ship to be processed and all land surface elements on the map, and obtaining multiple ship track sub-segments according to the navigation point data, specifically includes:
从预设船舶轨迹数据库中获取所述待处理船只的航行点位数据,并从所述地图上获取所有陆地面要素;Acquire the navigation point data of the vessel to be processed from a preset ship track database, and acquire all land surface elements from the map;
获取所述航行点位数据的所有航行点位,并获取每个所述航行点位对应的时间戳;Obtain all the navigation points of the navigation point data, and obtain the timestamp corresponding to each of the navigation points;
根据所有所述时间戳对所有所述航行点位进行排序,并将相邻时间戳的两个航行点位进行连接,以得到多段船舶轨迹子段。All the navigation points are sorted according to all the timestamps, and two navigation points with adjacent timestamps are connected to obtain multiple ship track sub-segments.
可选地,所述的基于多算法耦合的船舶航迹缺失数据补全方法,其中,所述根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段,具体包括:Optionally, the method for completing missing ship track data based on multi-algorithm coupling, wherein the intersection judgment of each ship track sub-segment with all the land surface elements is performed according to the spatial query method to obtain multiple abnormal track sub-segments, specifically including:
根据所述空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行线面相交的空间查询,判断是否存在船舶轨迹子段与陆地面要素相交;According to the spatial query method, each of the ship track sub-segments is subjected to a spatial query of line-surface intersection with all the land surface elements to determine whether there is a ship track sub-segment intersecting with a land surface element;
若所述船舶轨迹子段与所述陆地面要素相交,则将对应的船舶轨迹子段进行异常标记处理;If the ship track sub-segment intersects with the land surface element, the corresponding ship track sub-segment is marked as abnormal;
当所有所述船舶轨迹子段处理完成后,将所有带有异常标记的船舶轨迹子段作为异常轨迹子段。When all the ship trajectory sub-segments are processed, all the ship trajectory sub-segments with abnormal marks are regarded as abnormal trajectory sub-segments.
可选地,所述的基于多算法耦合的船舶航迹缺失数据补全方法,其中,所述获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息,具体包括:Optionally, the method for completing missing data of ship tracks based on multi-algorithm coupling, wherein the acquiring of endpoint information corresponding to each abnormal track sub-segment, and acquiring network node information corresponding to the endpoint information of each abnormal track sub-segment according to a pre-constructed typical waterway network diagram, specifically includes:
获取每段所述异常轨迹子段对应的端点信息,其中,所述端点信息包括开始端点和结束端点;Acquire endpoint information corresponding to each abnormal trajectory sub-segment, wherein the endpoint information includes a start endpoint and an end endpoint;
根据预先构建的典型航道网络图分别对每段所述异常轨迹子段的开始端点和结束端点进行匹配操作,得到与每段所述异常轨迹子段的开始端点距离最短的开始网络节点,以及与每段所述异常轨迹子段的结束端点距离最短的结束网络节点;According to the pre-constructed typical waterway network diagram, the start endpoint and the end endpoint of each abnormal trajectory sub-segment are matched respectively to obtain the start network node with the shortest distance to the start endpoint of each abnormal trajectory sub-segment and the end network node with the shortest distance to the end endpoint of each abnormal trajectory sub-segment;
将每段所述异常轨迹子段对应的开始网络节点和结束网络节点进行整合,得到每段所述异常轨迹子段对应的网络节点信息。The starting network node and the ending network node corresponding to each abnormal trajectory sub-segment are integrated to obtain the network node information corresponding to each abnormal trajectory sub-segment.
可选地,所述的基于多算法耦合的船舶航迹缺失数据补全方法,其中,所述配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,具体包括:Optionally, the method for completing missing data of ship tracks based on multi-algorithm coupling, wherein the A-star algorithm is configured, and a path planning operation is performed on each of the network node information according to the A-star algorithm to obtain the optimal path of each abnormal track sub-segment, specifically includes:
将欧氏距离作为A星算法的代价函数,将曼哈顿距离作为A星算法的启发函数,以完成对所述A星算法的配置;Using the Euclidean distance as the cost function of the A-star algorithm and the Manhattan distance as the heuristic function of the A-star algorithm to complete the configuration of the A-star algorithm;
获取与每段所述异常轨迹子段的开始网络节点直接相连的多个第一相连节点,分别计算每段所述异常轨迹子段的开始网络节点和每个第一相连节点之间的第一欧氏距离,计算结束网络节点和每个第一相连节点之间的第一曼哈顿距离;Acquire multiple first connected nodes directly connected to the starting network node of each abnormal trajectory subsegment, respectively calculate the first Euclidean distance between the starting network node of each abnormal trajectory subsegment and each first connected node, and calculate the first Manhattan distance between the ending network node and each first connected node;
根据每个所述第一相连节点对应的第一欧氏距离和第一曼哈顿距离计算每个所述第一相连节点对应的第一总成本,根据所有所述第一总成本获取每段所述异常轨迹子段的第一目标点;Calculate the first total cost corresponding to each of the first connected nodes according to the first Euclidean distance and the first Manhattan distance corresponding to each of the first connected nodes, and obtain the first target point of each of the abnormal trajectory subsegments according to all the first total costs;
获取与每段所述异常轨迹子段的第一目标点直接相连的多个第二相连节点,……,直至到达结束网络节点,完成对每段所述异常轨迹子段的路径规划操作,得到每段所述异常轨迹子段的最优路径。Acquire multiple second connected nodes directly connected to the first target point of each abnormal trajectory sub-segment, ..., until reaching the end network node, complete the path planning operation for each abnormal trajectory sub-segment, and obtain the optimal path for each abnormal trajectory sub-segment.
可选地,所述的基于多算法耦合的船舶航迹缺失数据补全方法,其中,所述根据所有所述最优路径对所述待处理船只的船舶航迹进行补全,具体包括:Optionally, the method for completing missing ship track data based on multi-algorithm coupling, wherein the step of completing the ship track of the vessel to be processed according to all the optimal paths specifically includes:
将每段所述异常轨迹子段的开始端点与对应的最优路径的开始网络节点进行连接;Connecting the starting endpoint of each abnormal trajectory sub-segment to the starting network node of the corresponding optimal path;
将每段所述异常轨迹子段的结束端点与对应的最优路径的结束网络节点进行连接;Connecting the end endpoint of each abnormal trajectory sub-segment to the end network node of the corresponding optimal path;
当所有所述异常轨迹子段的开始端点和结束端点分别与对应的最优路径连接完成后,表示完成对所述待处理船只的船舶轨迹的补全。When the start endpoints and the end endpoints of all the abnormal trajectory sub-segments are respectively connected to the corresponding optimal paths, it means that the completion of the ship trajectory of the ship to be processed is completed.
可选地,所述的基于多算法耦合的船舶航迹缺失数据补全方法,其中,所述典型航道网络图的构建过程,具体包括:Optionally, in the method for completing missing ship track data based on multi-algorithm coupling, the process of constructing the typical waterway network diagram specifically includes:
从预设船舶轨迹数据库中获取所有船只的航行点位数据,并对所有所述航行点位数据进行数据清洗操作,得到初始航行点集;Obtaining the navigation point data of all ships from a preset ship track database, and performing data cleaning operations on all the navigation point data to obtain an initial navigation point set;
对所述初始航行点集进行空间聚类去噪操作,得到与所述初始航行点集对应的高密度航行点集;Performing a spatial clustering denoising operation on the initial navigation point set to obtain a high-density navigation point set corresponding to the initial navigation point set;
根据聚类算法将所述高密度航行点集划分为预设数量的簇类,并获取每个簇类的中心点位置信息;Dividing the high-density navigation point set into a preset number of clusters according to a clustering algorithm, and obtaining the center point position information of each cluster;
根据所有所述中心点位置信息进行三角剖分操作,得到三角网络图;Perform a triangulation operation according to the position information of all the center points to obtain a triangulated network diagram;
将所述三角网络图中的所有线要素与所有所述陆地面要素进行相交判断,将与所有所述陆地面要素不相交的线要素作为最终线要素,并根据所有所述最终线要素构建典型航道网络图。All line elements in the triangulated network diagram are judged to intersect with all the land surface elements, the line elements that do not intersect with all the land surface elements are taken as final line elements, and a typical waterway network diagram is constructed based on all the final line elements.
此外,为实现上述目的,本发明还提供一种基于多算法耦合的船舶航迹缺失数据补全系统,其中,所述基于多算法耦合的船舶航迹缺失数据补全系统包括:In addition, to achieve the above-mentioned purpose, the present invention also provides a ship track missing data completion system based on multi-algorithm coupling, wherein the ship track missing data completion system based on multi-algorithm coupling includes:
轨迹子段获取模块,用于获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段;A track sub-segment acquisition module is used to acquire the navigation point data of the ship to be processed and all land surface elements on the map, and obtain multiple ship track sub-segments according to the navigation point data;
异常轨迹判断模块,用于根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段;An abnormal trajectory judgment module is used to judge the intersection of each ship trajectory sub-segment with all the land surface elements according to a spatial query method to obtain multiple abnormal trajectory sub-segments;
节点信息获取模块,用于获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息;A node information acquisition module, used to acquire endpoint information corresponding to each abnormal trajectory sub-segment, and acquire network node information corresponding to the endpoint information of each abnormal trajectory sub-segment according to a pre-constructed typical waterway network diagram;
船舶轨迹补全模块,用于配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,根据所有所述最优路径对所述待处理船只的船舶航迹进行补全。The ship track completion module is used to configure the A-star algorithm, and perform path planning operations on each of the network node information according to the A-star algorithm to obtain the optimal path of each abnormal track sub-segment, and complete the ship track of the ship to be processed according to all the optimal paths.
此外,为实现上述目的,本发明还提供一种终端,其中,所述终端包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于多算法耦合的船舶航迹缺失数据补全程序,所述基于多算法耦合的船舶航迹缺失数据补全程序被所述处理器执行时实现如上所述的基于多算法耦合的船舶航迹缺失数据补全方法的步骤。In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a ship track missing data completion program based on multi-algorithm coupling stored in the memory and run on the processor, and when the ship track missing data completion program based on multi-algorithm coupling is executed by the processor, the steps of the ship track missing data completion method based on multi-algorithm coupling as described above are implemented.
此外,为实现上述目的,本发明还提供一种计算机可读存储介质,其中,所述计算机可读存储介质存储有基于多算法耦合的船舶航迹缺失数据补全程序,所述基于多算法耦合的船舶航迹缺失数据补全程序被处理器执行时实现如上所述的基于多算法耦合的船舶航迹缺失数据补全方法的步骤。In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a ship track missing data completion program based on multi-algorithm coupling, and when the ship track missing data completion program based on multi-algorithm coupling is executed by a processor, the steps of the ship track missing data completion method based on multi-algorithm coupling as described above are implemented.
本发明中,获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段;根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段;获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息;配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,根据所有所述最优路径对所述待处理船只的船舶航迹进行补全。本发明通过A星算法实现启发式搜索和最佳优先搜索,可以快速高效地找到最优路径,提高了对大数据量的船舶轨迹进行缺失数据补全的处理效率,并且通过构建典型航道网络图,能够为数据补全提供更准确的支持,避免因需要人工设置航道而耗费大量的时间和精力,进一步提高了数据补全的效率,也提高了数据补全的准确性。In the present invention, the navigation point data of the ship to be processed and all the land surface elements on the map are obtained, and multiple ship track sub-segments are obtained according to the navigation point data; each ship track sub-segment is intersected and judged with all the land surface elements according to the spatial query method, and multiple abnormal track sub-segments are obtained; the endpoint information corresponding to each abnormal track sub-segment is obtained, and the network node information corresponding to the endpoint information of each abnormal track sub-segment is obtained according to the pre-constructed typical waterway network diagram; the A star algorithm is configured, and the path planning operation is performed on each of the network node information according to the A star algorithm to obtain the optimal path of each abnormal track sub-segment, and the ship track of the ship to be processed is completed according to all the optimal paths. The present invention realizes heuristic search and best priority search through the A star algorithm, can quickly and efficiently find the optimal path, improves the processing efficiency of missing data completion for large amounts of ship tracks, and by constructing a typical waterway network diagram, can provide more accurate support for data completion, avoids the need to manually set the waterway and consumes a lot of time and energy, further improves the efficiency of data completion, and also improves the accuracy of data completion.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明基于多算法耦合的船舶航迹缺失数据补全方法的较佳实施例的流程图;FIG1 is a flow chart of a preferred embodiment of a method for completing missing data of a ship track based on multi-algorithm coupling according to the present invention;
图2是本发明基于多算法耦合的船舶航迹缺失数据补全系统的较佳实施例的原理示意图;FIG2 is a schematic diagram of the principle of a preferred embodiment of a ship track missing data completion system based on multi-algorithm coupling according to the present invention;
图3为本发明终端的较佳实施例的运行环境示意图。FIG. 3 is a schematic diagram of an operating environment of a preferred embodiment of the terminal of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案及优点更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
本发明较佳实施例所述的基于多算法耦合的船舶航迹缺失数据补全方法,如图1所示,所述基于多算法耦合的船舶航迹缺失数据补全方法包括以下步骤:The ship track missing data completion method based on multi-algorithm coupling described in the preferred embodiment of the present invention is shown in Figure 1. The ship track missing data completion method based on multi-algorithm coupling includes the following steps:
步骤S10、获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段。Step S10: Obtain navigation point data of the vessel to be processed and all land surface elements on the map, and obtain multiple ship track sub-segments according to the navigation point data.
具体地,在本发明优选实施例中,船舶轨迹缺失数据补全系统(以下统称补全系统)会先获取到某个待处理船只的航行点位数据,航行点位数据中包含了待处理船只的多个航行点位的位置信息和时间戳;再获取地图上的所有陆地面要素,陆地面要素实际上指的就是地图上的所有陆地,例如亚洲陆地面要素、北美洲陆地面要素等;然后再对航行点位数据进行相应的处理,得到待处理船只对应的多段船舶轨迹子段。Specifically, in a preferred embodiment of the present invention, a ship trajectory missing data completion system (hereinafter referred to as the completion system) will first obtain the navigation point data of a ship to be processed, and the navigation point data contains the location information and timestamps of multiple navigation points of the ship to be processed; then obtain all land surface elements on the map, and the land surface elements actually refer to all land on the map, such as Asian land surface elements, North American land surface elements, etc.; and then perform corresponding processing on the navigation point data to obtain multiple ship trajectory sub-segments corresponding to the ship to be processed.
进一步地,所述获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段,具体包括:Furthermore, the step of obtaining the navigation point data of the vessel to be processed and all land surface elements on the map, and obtaining a plurality of ship track sub-segments according to the navigation point data, specifically includes:
从预设船舶轨迹数据库中获取所述待处理船只的航行点位数据,并从所述地图上获取所有陆地面要素;获取所述航行点位数据的所有航行点位,并获取每个所述航行点位对应的时间戳;根据所有所述时间戳对所有所述航行点位进行排序,并将相邻时间戳的两个航行点位进行连接,以得到多段船舶轨迹子段。The navigation point data of the ship to be processed is obtained from a preset ship trajectory database, and all land surface elements are obtained from the map; all navigation points of the navigation point data are obtained, and the timestamp corresponding to each navigation point is obtained; all the navigation points are sorted according to all the timestamps, and two navigation points with adjacent timestamps are connected to obtain multiple ship trajectory sub-segments.
具体地,补全系统从预设船舶轨迹数据库(AIS数据库)中获取所有船只的航行点位数据,AIS数据库中的文件格式为csv(字符分隔值)格式,每艘船只的航行点位数据都包括了对应的多个航行点位的位置信息(船舶经纬度)、时间戳、船只编号等信息,补全系统会根据用户的需求获取到需要进行补全的待处理船只的航行点位数据;然后再从地图上获取所有陆地面要素,陆地面要素就是所有陆地(包括岛屿)的相关位置信息。Specifically, the completion system obtains the navigation point data of all ships from the preset ship track database (AIS database). The file format in the AIS database is csv (character separated value) format. The navigation point data of each ship includes the location information of multiple corresponding navigation points (ship longitude and latitude), timestamp, ship number and other information. The completion system will obtain the navigation point data of the ships to be completed according to the user's needs; then obtain all land surface elements from the map. The land surface elements are the relevant location information of all land (including islands).
然后获取待处理船只的航行点位中的所有航行点位(也就是历史船舶离散航行点位数据)对应的时间戳,然后将这些航行点位按照时间戳进行排序,并使用相邻时间戳的两个航行点位进行连接,将所有航行点位连接完成后,表示待处理船只的所有船舶轨迹子段都已构建完成,本发明通过将航行点位数据根据时间戳进行排序和连接,可以更方便地管理和分析船舶的航行轨迹,从而做出更有效的数据补全。Then, the timestamps corresponding to all the navigation points of the ship to be processed (that is, the historical discrete navigation point data of the ship) are obtained, and then these navigation points are sorted according to the timestamps, and two navigation points with adjacent timestamps are used to connect. After all the navigation points are connected, it means that all the ship trajectory subsegments of the ship to be processed have been constructed. By sorting and connecting the navigation point data according to the timestamps, the present invention can more conveniently manage and analyze the navigation trajectory of the ship, thereby making more effective data completion.
作为举例,补全系统先获取到某艘船只(记为船A)的航行数据中的所有航行点位,再根据时间戳对所有航行点位进行排序后,得到船A在某日航行的位置顺序为:(113.77°N,22.39°E),(114.48°N,22.28°E),(114.88°N,22.27°E),(115.24°N,22.29°E)……,然后将每两相邻的时间戳的航行点位进行相连,作为一个船舶轨迹子段,比如第一个时间戳和第二个时间戳对应的航行点位构成的第一个船舶轨迹子段为:(113.77°N,22.39°E)-(114.48°N,22.28°E),第二个时间戳和第三个时间戳对应的航行点位构成的第二个船舶轨迹子段为:(114.48°N,22.28°E)-(114.88°N,22.27°E),以此类推,直到船A最后一个时间戳对应的航行点位被连接后,完成对船A的船舶轨迹子段的构建。For example, the completion system first obtains all the navigation points in the navigation data of a certain ship (referred to as ship A), and then sorts all the navigation points according to the timestamps to obtain the order of the positions of ship A on a certain day: (113.77°N, 22.39°E), (114.48°N, 22.28°E), (114.88°N, 22.27°E), (115.24°N, 22.29°E)..., and then connects every two adjacent timestamp navigation points as a ship track subsegment, such as the first The first ship track sub-segment composed of the navigation points corresponding to the first timestamp and the second timestamp is: (113.77°N, 22.39°E)-(114.48°N, 22.28°E), and the second ship track sub-segment composed of the navigation points corresponding to the second timestamp and the third timestamp is: (114.48°N, 22.28°E)-(114.88°N, 22.27°E), and so on, until the navigation points corresponding to the last timestamp of ship A are connected, the construction of the ship track sub-segment of ship A is completed.
步骤S20、根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段。Step S20: According to a spatial query method, each of the ship trajectory sub-segments is respectively intersected with all the land surface elements to obtain a plurality of abnormal trajectory sub-segments.
具体地,在本发明的优选实施例中,主要使用基于空间数据索引R-Tree的空间查询方法,R-Tree是一种树形数据结构,它可以高效地存储和查询空间数据,这对于处理大量的船舶轨迹数据非常有用。Specifically, in a preferred embodiment of the present invention, a spatial query method based on a spatial data index R-Tree is mainly used. R-Tree is a tree data structure that can efficiently store and query spatial data, which is very useful for processing a large amount of ship trajectory data.
补全系统将每一段船舶轨迹子段与预先获取到的陆地面要素进行相交判断,筛选出与陆地相交的船舶轨迹子段,并将此船舶轨迹子段标记为需要进行数据补全的涉及陆地区域的数据缺失异常轨迹子段。The completion system intersects each ship trajectory sub-segment with the pre-acquired land surface elements, screens out the ship trajectory sub-segments that intersect with the land, and marks this ship trajectory sub-segment as an abnormal trajectory sub-segment with missing data involving the land area that needs data completion.
进一步地,所述根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段,具体包括:Furthermore, the spatial query method is used to determine the intersection of each of the ship track sub-segments with all the land surface elements to obtain multiple abnormal track sub-segments, specifically including:
根据所述空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行线面相交的空间查询,判断是否存在船舶轨迹子段与陆地面要素相交;若所述船舶轨迹子段与所述陆地面要素相交,则将对应的船舶轨迹子段进行异常标记处理;当所有所述船舶轨迹子段处理完成后,将所有带有异常标记的船舶轨迹子段作为异常轨迹子段。According to the spatial query method, a spatial query of line-surface intersection is performed on each of the ship trajectory sub-segments and all the land surface elements to determine whether there is a ship trajectory sub-segment intersecting with a land surface element; if the ship trajectory sub-segment intersects with the land surface element, the corresponding ship trajectory sub-segment is marked as abnormal; after all the ship trajectory sub-segments are processed, all the ship trajectory sub-segments with abnormal marks are regarded as abnormal trajectory sub-segments.
具体地,补全系统使用基于空间索引R-Tree的空间查询方法将每段船舶轨迹子段和所有陆地面要素进行线面相交的空间查询,实际上也就是将每段船舶轨迹子段作为线要素,然后再将线要素和陆地对应的面要素进行相交判断;如果船舶轨迹子段与陆地面要素相交,那么将与陆地面要素相交的船舶轨迹子段进行异常标记处理,当所有船舶轨迹子段进行相交判断完成之后,将所有带有异常标记的船舶轨迹子段作为后续需要进行缺失数据补全的异常轨迹子段,通过R-Tree空间查询方法来对船舶轨迹子段和陆地面要素的相交进行判断,可以高效地存储和查询空间数据,有利于处理大量的船舶轨迹数据,提高了判断异常轨迹子段的效率,避免了误判或漏判的情况,提高判断异常轨迹子段的准确性,并且也能应对更多复杂的船舶轨迹分析需求,提高系统的灵活性。Specifically, the completion system uses a spatial query method based on the spatial index R-Tree to perform a spatial query on the line-surface intersection of each ship trajectory sub-segment and all land surface elements. In fact, each ship trajectory sub-segment is regarded as a line element, and then the line element and the surface element corresponding to the land are judged for intersection; if the ship trajectory sub-segment intersects with the land surface element, the ship trajectory sub-segment intersecting with the land surface element will be marked as abnormal. After the intersection judgment of all ship trajectory sub-segments is completed, all ship trajectory sub-segments with abnormal marks will be regarded as abnormal trajectory sub-segments that need to be completed for missing data. The intersection of ship trajectory sub-segments and land surface elements is judged by the R-Tree spatial query method, which can efficiently store and query spatial data, is conducive to processing a large amount of ship trajectory data, improves the efficiency of judging abnormal trajectory sub-segments, avoids misjudgment or missed judgment, improves the accuracy of judging abnormal trajectory sub-segments, and can also cope with more complex ship trajectory analysis needs and improve the flexibility of the system.
作为举例,将船A的所有船舶轨迹子段分别与所有陆地面要素进行线面相交的空间查询后,发现船舶轨迹子段:(113.77°N,22.39°E)-(114.48°N,22.28°E)与陆地面要素有相交,那么认定此船舶轨迹子段异常,并对此船舶轨迹子段进行标记(例如在船舶轨迹子段的存储文件中,在这段船舶轨迹子段对应的行的“异常表示”列标记“1”)。As an example, after performing spatial query on the line-surface intersection of all ship trajectory sub-segments of ship A and all land surface elements, it is found that the ship trajectory sub-segment: (113.77°N, 22.39°E)-(114.48°N, 22.28°E) intersects with the land surface element, then this ship trajectory sub-segment is deemed abnormal and is marked (for example, in the storage file of the ship trajectory sub-segment, the "Abnormal Representation" column of the row corresponding to this ship trajectory sub-segment is marked with "1").
步骤S30、获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息。Step S30, obtaining endpoint information corresponding to each abnormal trajectory sub-segment, and obtaining network node information corresponding to the endpoint information of each abnormal trajectory sub-segment according to a pre-constructed typical waterway network diagram.
具体地,在本发明的优选实施例中,补全系统会获取每段异常轨迹子段对应的端点信息,端点信息实际上就是异常轨迹子段的开始端点(坐标)和结束端点(坐标);然后再根据预先构建的典型航道网络图获取与每段异常轨迹子段的端点信息对应的网络节点信息。Specifically, in a preferred embodiment of the present invention, the completion system will obtain the endpoint information corresponding to each abnormal trajectory sub-segment, and the endpoint information is actually the starting endpoint (coordinates) and the ending endpoint (coordinates) of the abnormal trajectory sub-segment; and then obtain the network node information corresponding to the endpoint information of each abnormal trajectory sub-segment based on the pre-constructed typical waterway network diagram.
进一步地,所述获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息,具体包括:Furthermore, the acquiring of endpoint information corresponding to each abnormal trajectory sub-segment, and acquiring network node information corresponding to the endpoint information of each abnormal trajectory sub-segment according to a pre-constructed typical waterway network diagram, specifically includes:
获取每段所述异常轨迹子段对应的端点信息,其中,所述端点信息包括开始端点和结束端点;根据预先构建的典型航道网络图分别对每段所述异常轨迹子段的开始端点和结束端点进行匹配操作,得到与每段所述异常轨迹子段的开始端点距离最短的开始网络节点,以及与每段所述异常轨迹子段的结束端点距离最短的结束网络节点;将每段所述异常轨迹子段对应的开始网络节点和结束网络节点进行整合,得到每段所述异常轨迹子段对应的网络节点信息。The endpoint information corresponding to each abnormal trajectory sub-segment is obtained, wherein the endpoint information includes a start endpoint and an end endpoint; the start endpoint and the end endpoint of each abnormal trajectory sub-segment are matched according to a pre-constructed typical waterway network diagram to obtain a start network node with the shortest distance to the start endpoint of each abnormal trajectory sub-segment and an end network node with the shortest distance to the end endpoint of each abnormal trajectory sub-segment; the start network node and the end network node corresponding to each abnormal trajectory sub-segment are integrated to obtain network node information corresponding to each abnormal trajectory sub-segment.
具体地,补全系统获取每段异常轨迹子段的开始端点和结束端点,然后通过预先构建的典型航道网络图进行匹配操作,匹配与开始端点和结束端点距离最近的两个网络节点(例如可以使用两点位置距离函数来计算与开始端点和结束端点距离最近的网络节点),与开始端点距离最近的网络节点称为开始网络节点,与结束端点距离最近的网络节点称为结束网络节点,从而能够得到每段异常轨迹子段对应的开始网络节点和结束网络节点,最终再将每段异常轨迹子段的开始网络节点和结束网络节点进行整合,得到每段异常轨迹子段对应的网络节点信息。Specifically, the completion system obtains the start endpoint and the end endpoint of each abnormal trajectory sub-segment, and then performs a matching operation through a pre-constructed typical channel network diagram to match the two network nodes closest to the start endpoint and the end endpoint (for example, the two-point position distance function can be used to calculate the network node closest to the start endpoint and the end endpoint). The network node closest to the start endpoint is called the start network node, and the network node closest to the end endpoint is called the end network node. In this way, the start network node and the end network node corresponding to each abnormal trajectory sub-segment can be obtained. Finally, the start network node and the end network node of each abnormal trajectory sub-segment are integrated to obtain the network node information corresponding to each abnormal trajectory sub-segment.
作为举例,如上述已被表示的异常轨迹子段:(113.77°N,22.39°E)-(114.48°N,22.28°E),此异常轨迹子段的开始端点为(113.77°N,22.39°E),结束端点为(114.48°N,22.28°E),补全系统在典型航道网络图上寻找与这两个端点距离最近的两个网络节点,最终搜寻到的开始网络节点为(113.80°N,22.30°E),结束网络节点为 (114.50°N,22.30°E)。As an example, the abnormal trajectory subsegment represented above is: (113.77°N, 22.39°E)-(114.48°N, 22.28°E). The starting endpoint of this abnormal trajectory subsegment is (113.77°N, 22.39°E), and the ending endpoint is (114.48°N, 22.28°E). The completion system searches for the two network nodes closest to these two endpoints on the typical waterway network diagram. The final starting network node found is (113.80°N, 22.30°E), and the ending network node is (114.50°N, 22.30°E).
需要说明的是,如果开始端点和结束端点匹配到的网络节点相同,那么会保留距离更短的匹配结果,另一端点则匹配到与其次近的网络节点。例如,假设开始端点(113.77°N,22.39°E)和结束端点(114.48°N,22.28°E)匹配到的网络节点都是(114.50°N,22.30°E),也就是此网络节点与开始端点和结束端点的距离都是最近的(相对于其余网络节点),但是该网络节点与开始端点的距离更近,那么就将此网络节点作为开始端点对应的开始网络节点,结束端点需要重新匹配新的网络节点;结束端点再次进行匹配,得到与结束端点的距离次近(第二近)的网络节点(115.00°N,22.40°E),并将此次近的网络节点作为结束网络节点。It should be noted that if the network nodes matched by the start endpoint and the end endpoint are the same, the matching result with a shorter distance will be retained, and the other endpoint will be matched to the network node that is next closest to it. For example, suppose the network nodes matched by the start endpoint (113.77°N, 22.39°E) and the end endpoint (114.48°N, 22.28°E) are both (114.50°N, 22.30°E), that is, the distance between this network node and the start endpoint and the end endpoint is the closest (relative to the other network nodes), but the distance between this network node and the start endpoint is closer, then this network node will be used as the start network node corresponding to the start endpoint, and the end endpoint needs to be re-matched with a new network node; the end endpoint is matched again to obtain the network node (115.00°N, 22.40°E) that is next closest to the end endpoint, and the closest network node will be used as the end network node.
步骤S40、配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,根据所有所述最优路径对所述待处理船只的船舶航迹进行补全。Step S40, configuring the A-star algorithm, and performing a path planning operation on each of the network node information according to the A-star algorithm to obtain the optimal path of each of the abnormal trajectory sub-segments, and completing the ship track of the ship to be processed according to all the optimal paths.
具体地,在本发明的优选实施例中,补全系统会配置A星算法,A星算法(A*算法)是一种基于采样搜索的粗略路径规划算法,在补全系统配置完A星算法后,会根据A星算法对每段异常轨迹子段的网络节点信息进行路径规划操作,从而得到每段异常轨迹子段的最优路径,最后再根据每个最优路径对待处理船只的船舶轨迹进行数据补全。Specifically, in a preferred embodiment of the present invention, the completion system will be configured with the A* algorithm, which is a rough path planning algorithm based on sampling search. After the completion system is configured with the A* algorithm, the network node information of each abnormal trajectory sub-segment will be subjected to path planning operations according to the A* algorithm, thereby obtaining the optimal path for each abnormal trajectory sub-segment, and finally completing the data of the ship trajectory of the ship to be processed according to each optimal path.
进一步地,所述配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,具体包括:Further, the configuration of the A-star algorithm and performing a path planning operation on each of the network node information according to the A-star algorithm to obtain the optimal path of each of the abnormal trajectory sub-segments specifically includes:
将欧氏距离作为A星算法的代价函数,将曼哈顿距离作为A星算法的启发函数,以完成对所述A星算法的配置;获取与每段所述异常轨迹子段的开始网络节点直接相连的多个第一相连节点,分别计算每段所述异常轨迹子段的开始网络节点和每个第一相连节点之间的第一欧氏距离,计算结束网络节点和每个第一相连节点之间的第一曼哈顿距离;根据每个所述第一相连节点对应的第一欧氏距离和第一曼哈顿距离计算每个所述第一相连节点对应的第一总成本,根据所有所述第一总成本获取每段所述异常轨迹子段的第一目标点;获取与每段所述异常轨迹子段的第一目标点直接相连的多个第二相连节点,……,直至到达结束网络节点,完成对每段所述异常轨迹子段的路径规划操作,得到每段所述异常轨迹子段的最优路径。The Euclidean distance is used as the cost function of the A-star algorithm, and the Manhattan distance is used as the heuristic function of the A-star algorithm to complete the configuration of the A-star algorithm; a plurality of first connected nodes directly connected to the starting network node of each abnormal trajectory subsegment are obtained, and the first Euclidean distance between the starting network node of each abnormal trajectory subsegment and each first connected node is calculated respectively, and the first Manhattan distance between the ending network node and each first connected node is calculated; the first total cost corresponding to each first connected node is calculated according to the first Euclidean distance and the first Manhattan distance corresponding to each first connected node, and the first target point of each abnormal trajectory subsegment is obtained according to all the first total costs; a plurality of second connected nodes directly connected to the first target point of each abnormal trajectory subsegment are obtained, ..., until the ending network node is reached, the path planning operation for each abnormal trajectory subsegment is completed, and the optimal path for each abnormal trajectory subsegment is obtained.
具体地,补全系统将欧氏距离作为A星算法的代价函数,将曼哈顿距离作为A星算法的启发函数,从而完成对A星算法的配置,在配置完成A星算法后,会根据A星算法对每段异常轨迹子段进行路径规划操作。Specifically, the completion system uses the Euclidean distance as the cost function of the A-star algorithm and the Manhattan distance as the heuristic function of the A-star algorithm, thereby completing the configuration of the A-star algorithm. After the A-star algorithm is configured, path planning operations will be performed on each abnormal trajectory sub-segment according to the A-star algorithm.
在A星算法执行的过程中,补全系统先获取与每段异常轨迹子段的开始网络节点直接相连的多个第一相连节点,实际上就是与开始网络节点相邻的多个节点,然后再计算每个第一相连节点到开始网络节点的欧氏距离,并计算每个第一相连节点到结束网络节点的曼哈顿距离,欧氏距离用来衡量开始网络节点到目标节点的实际路径距离,这个距离反映了一点到另一点的直线距离,曼哈顿距离用来估计从目标节点到结束网络节点的预计距离,曼哈顿距离作为一种启发式估计,能够提供到达结束网络节点所需的最小成本估计。During the execution of the A-star algorithm, the completion system first obtains multiple first connected nodes directly connected to the starting network node of each abnormal trajectory sub-segment, which are actually multiple nodes adjacent to the starting network node, and then calculates the Euclidean distance from each first connected node to the starting network node, and calculates the Manhattan distance from each first connected node to the ending network node. The Euclidean distance is used to measure the actual path distance from the starting network node to the target node. This distance reflects the straight-line distance from one point to another. The Manhattan distance is used to estimate the expected distance from the target node to the ending network node. As a heuristic estimate, the Manhattan distance can provide an estimate of the minimum cost required to reach the ending network node.
然后再根据每个第一相连节点的欧氏距离和曼哈顿距离计算得到每个第一相连节点的第一总成本,也就是每段异常轨迹子段会计算对应的多个第一相连节点的第一总成本,并选择第一总成本最小的第一相连节点作为第一目标点,并将第一目标点作为下一步的开始节点。Then, the first total cost of each first connected node is calculated based on the Euclidean distance and Manhattan distance of each first connected node. That is, each abnormal trajectory sub-segment will calculate the first total cost of the corresponding multiple first connected nodes, and select the first connected node with the smallest first total cost as the first target point, and the first target point is used as the starting node for the next step.
获取与每段异常轨迹子段的第一目标点直接相连的多个第二相连节点,然后再计算每个第二相连节点与第一目标点之间的第二欧氏距离,然后再计算每个第二相连节点到结束网络节点的第二曼哈顿距离,从而根据每个第二相连节点的第二欧氏距离和第二曼哈顿距离计算第二总成本,再选择每段异常轨迹子段中第二总成本最小的第二相连节点作为第二目标点,并将第二目标点作为下一步的开始节点,……,重复上述步骤,直到计算到达结束网络节点,此时,获取到的所有目标点(第一目标点、第二目标点……第N目标点)所构成的路径就是每段异常轨迹子段的最优路径。A plurality of second connected nodes directly connected to the first target point of each abnormal trajectory subsegment are obtained, and then the second Euclidean distance between each second connected node and the first target point is calculated, and then the second Manhattan distance from each second connected node to the end network node is calculated, so as to calculate the second total cost according to the second Euclidean distance and the second Manhattan distance of each second connected node, and then the second connected node with the smallest second total cost in each abnormal trajectory subsegment is selected as the second target point, and the second target point is used as the starting node of the next step, ..., and the above steps are repeated until the calculation reaches the end network node. At this time, the path formed by all the acquired target points (first target point, second target point ... Nth target point) is the optimal path of each abnormal trajectory subsegment.
作为举例,例如开始网络节点的经纬坐标为(x1,y1),结束网络节点的经纬坐标为(x2,y2),与开始网络节点直接相连的节点是A(xa,yb)、B(xb,yb)和C(xc,yc)三个点, 使用两点的投影坐标的欧氏距离作为起点(开始网络节点)移动到直接相连的节点的指定节点A、B、C(当前网络节点)的代价值,计算公式为:;然后再采用曼哈顿距离(Manhattan Distance)来作为启发函数来约束路径的走向,曼哈顿距离是使用两个网络节点之间的坐标之差的绝对值的和,即将水平方向和垂直方向的距离相加,具体计算公式为:Manhattan Distance=|xa–x2| + |ya–y2|(B点和C点做相同计算),在计算完成后,再从A、B、C三个点选择最小代价的点,例如最小代价的点为A作为第一目标点,再将A作为开始节点,获取与A直接相连的节点D、E这两个点作为第二目标点的候选点,再按照上面的方式计算选择,直到选择到结束网络节点。For example, the longitude and latitude coordinates of the starting network node are ( x1 , y1 ), the longitude and latitude coordinates of the ending network node are ( x2 , y2 ), and the nodes directly connected to the starting network node are A ( xa , yb ), B ( xb , yb ) and C ( xc , yc ). The Euclidean distance of the projected coordinates of the two points is used as the cost value of moving from the starting point (starting network node) to the specified nodes A, B, C (current network node) of the directly connected nodes. The calculation formula is: ; Then Manhattan Distance is used as the heuristic function to constrain the direction of the path. Manhattan distance is the sum of the absolute values of the difference in coordinates between two network nodes, that is, the addition of the horizontal and vertical distances. The specific calculation formula is: Manhattan Distance = |x a –x 2 | + |y a –y 2 | (point B and point C perform the same calculation). After the calculation is completed, the point with the minimum cost is selected from points A, B, and C. For example, the point with the minimum cost is A as the first target point, and then A is used as the starting node. The nodes D and E directly connected to A are obtained as candidate points for the second target point, and then the calculation and selection are performed in the above manner until the end network node is selected.
需要说明的是,上述提及的第一相连节点实际上指的是与开始网络节点直接相连的网络节点,第二相连节点实际上指的是与第一目标点直接相连的网络节点,第一和第二仅用于区分是与开始网络节点直接相连还是与第一目标点直接相连;第一欧氏距离/第一曼哈顿距离/第一总成本和第二欧氏距离/第二曼哈顿距离/第二总成本也同理。It should be noted that the first connected node mentioned above actually refers to the network node directly connected to the starting network node, and the second connected node actually refers to the network node directly connected to the first target point. The first and second are only used to distinguish whether it is directly connected to the starting network node or directly connected to the first target point; the same applies to the first Euclidean distance/first Manhattan distance/first total cost and the second Euclidean distance/second Manhattan distance/second total cost.
进一步地,所述根据所有所述最优路径对所述待处理船只的船舶航迹进行补全,具体包括:Furthermore, the completing the ship track of the ship to be processed according to all the optimal paths specifically includes:
将每段所述异常轨迹子段的开始端点与对应的最优路径的开始网络节点进行连接;将每段所述异常轨迹子段的结束端点与对应的最优路径的结束网络节点进行连接;当所有所述异常轨迹子段的开始端点和结束端点分别与对应的最优路径连接完成后,表示完成对所述待处理船只的船舶轨迹的补全。The starting endpoint of each abnormal trajectory sub-segment is connected to the starting network node of the corresponding optimal path; the ending endpoint of each abnormal trajectory sub-segment is connected to the ending network node of the corresponding optimal path; when the starting endpoints and the ending endpoints of all the abnormal trajectory sub-segments are respectively connected to the corresponding optimal paths, it means that the completion of the ship trajectory of the ship to be processed is completed.
具体地,在补全系统获取到每段异常轨迹子段的最优路径后,会将每段异常轨迹子段的开始端点与对应的最优路径的开始网络节点进行连接,并将每段异常轨迹子段的结束端点与对应的最优路径的结束网络节点进行连接,也就是将存在数据缺失情况的异常轨迹子段替换为完成数据补全的最优路径,当所有异常轨迹子段都被最优路径替换完成后,表示完成对待处理船只的船舶轨迹的补全。Specifically, after the completion system obtains the optimal path of each abnormal trajectory sub-segment, it will connect the starting endpoint of each abnormal trajectory sub-segment with the starting network node of the corresponding optimal path, and connect the ending endpoint of each abnormal trajectory sub-segment with the ending network node of the corresponding optimal path. That is, the abnormal trajectory sub-segments with missing data are replaced with the optimal path for completing the data. When all the abnormal trajectory sub-segments are replaced by the optimal path, it means that the completion of the ship trajectory of the ship to be processed is completed.
作为举例,补全系统使用配置完成的A星算法对开始网络节点(113.80°N,22.30°E)和结束网络节点为(114.50°N,22.30°E)进行路径规划操作,得到的最优路径的结果为:(113.80°N,22.30°E)-[中间若干个网络节点]-(114.50°N,22.30°E),然后再将对应的异常轨迹子段的开始端点(113.77°N,22.39°E)和结束端点(114.48°N,22.28°E)分别与开始网络节点和结束网络节点进行连接,得到数据补全后的路径为:(113.77°N,22.39°E)-(113.80°N,22.30°E)-[中间若干个网络节点]-(114.50°N,22.30°E)-(114.48°N,22.28°E),实际上也就是将异常轨迹子段的路径替换为最优路径。As an example, the completion system uses the configured A-star algorithm to perform path planning operations on the starting network node (113.80°N, 22.30°E) and the ending network node (114.50°N, 22.30°E). The optimal path obtained is: (113.80°N, 22.30°E)-[several intermediate network nodes]-(114.50°N, 22.30°E), and then the starting endpoint (113.77°N, 22. 39°E) and the end endpoint (114.48°N, 22.28°E) are connected to the start network node and the end network node respectively, and the path after data completion is: (113.77°N, 22.39°E)-(113.80°N, 22.30°E)-[several network nodes in the middle]-(114.50°N, 22.30°E)-(114.48°N, 22.28°E), which actually replaces the path of the abnormal trajectory subsegment with the optimal path.
进一步地,所述典型航道网络图的构建过程,具体包括:Furthermore, the construction process of the typical waterway network diagram specifically includes:
从预设船舶轨迹数据库中获取所有船只的航行点位数据,并对所有所述航行点位数据进行数据清洗操作,得到初始航行点集;对所述初始航行点集进行空间聚类去噪操作,得到与所述初始航行点集对应的高密度航行点集;根据聚类算法将所述高密度航行点集划分为预设数量的簇类,并获取每个簇类的中心点位置信息;根据所有所述中心点位置信息进行三角剖分操作,得到三角网络图;将所述三角网络图中的所有线要素与所有所述陆地面要素进行相交判断,将与所有所述陆地面要素不相交的线要素作为最终线要素,并根据所有所述最终线要素构建典型航道网络图。The navigation point data of all ships are obtained from a preset ship trajectory database, and data cleaning operations are performed on all the navigation point data to obtain an initial navigation point set; spatial clustering denoising operations are performed on the initial navigation point set to obtain a high-density navigation point set corresponding to the initial navigation point set; the high-density navigation point set is divided into a preset number of clusters according to a clustering algorithm, and the center point position information of each cluster is obtained; a triangulation operation is performed based on all the center point position information to obtain a triangulated network diagram; all line elements in the triangulated network diagram are judged to intersect with all the land surface elements, the line elements that do not intersect with all the land surface elements are used as final line elements, and a typical waterway network diagram is constructed based on all the final line elements.
具体地,补全系统先从预设船舶轨迹数据库中获取所有船只的航行点位数据,然后对所有航行点位数据进行数据清洗操作,这个过程包括删除重复位置点、清楚陆地偏移点和排除经纬度异常点,其中,陆地偏移点指的是航行点位数据的航行点位出现在陆地上,对所有航行点位数据完成数据清洗操作后,得到初始航行点集。Specifically, the completion system first obtains the navigation point data of all ships from the preset ship trajectory database, and then performs data cleaning operations on all the navigation point data. This process includes deleting duplicate location points, clearing land offset points, and excluding abnormal longitude and latitude points. Among them, land offset points refer to navigation points of navigation point data that appear on land. After completing the data cleaning operation on all navigation point data, the initial navigation point set is obtained.
作为举例,例如船A在某日航行的位置顺序中,航行点位的顺序为:(113.77°N,22.39°E),(114.48°N,22.28°E),(114.88°N,22.27°E),(114.88°N,22.27°E),(115.24°N,22.29°E),(115.47°N,22.82°E),(00.47°N,00.82°E)……,将重复的航行点位(114.88°N,22.27°E)删除;假如(115.47°N,22.82°E)在陆地上,将该点删除;(00.47°N,00.82°E)经纬度超出正常研究区域,也进行删除。For example, in the position sequence of ship A's sailing on a certain day, the order of the navigation points is: (113.77°N, 22.39°E), (114.48°N, 22.28°E), (114.88°N, 22.27°E), (114.88°N, 22.27°E), (115.24°N, 22.29°E), (115.47°N, 22.82°E), (00.47°N, 00.82°E)..., the repeated navigation point (114.88°N, 22.27°E) is deleted; if (115.47°N, 22.82°E) is on land, delete the point; (00.47°N, 00.82°E) is beyond the normal research area in longitude and latitude, and is also deleted.
然后补全系统再使用基于DBSCAN空间聚类算法(Density-Based SpatialClustering of Applications with Noise,基于密度的噪声应用空间聚类),用户可以选择合适的DBSCAN的参数,参数包括邻域半径和最小样本点数,然后再根据邻域半径和最小样本点数对初始航行点集进行空间聚类去噪操作,去除噪声点,从而得到与初始航行点集对应的高密度航行点集。The completion system then uses the DBSCAN spatial clustering algorithm (Density-Based Spatial Clustering of Applications with Noise). Users can select appropriate DBSCAN parameters, including the neighborhood radius and the minimum number of sample points. The initial navigation point set is then subjected to spatial clustering denoising operations based on the neighborhood radius and the minimum number of sample points to remove noise points, thereby obtaining a high-density navigation point set corresponding to the initial navigation point set.
作为举例,将DBSCAN参数中的邻域半径(EPS)和最小样本点数(minPts)分别设置为1200米和3个,通过DBSCAN空间聚类算法计算得出初始航行点集的噪声点占比为0.74%,将这些噪声点去除,并将保留下来的航行点位作为高密度航行点集。As an example, the neighborhood radius (EPS) and the minimum number of sample points (minPts) in the DBSCAN parameters are set to 1200 meters and 3 respectively. The DBSCAN spatial clustering algorithm is used to calculate that the noise points in the initial navigation point set account for 0.74%. These noise points are removed, and the remaining navigation points are used as a high-density navigation point set.
补全系统再对高密度航行点集进行二次空间聚类,在此步采用的聚类算法可以为K-Mediods(K中心点)算法,使用K中心点算法将高密度航行点集划分为预设数量的簇类,其中,预设数量为用户根据实际需要进行设置的簇类数量;每个簇类都具有一个中心点,补全系统会获取到所有簇类的中心点位置信息。The completion system then performs secondary spatial clustering on the high-density navigation point set. The clustering algorithm used in this step can be the K-Mediods (K center point) algorithm. The K center point algorithm is used to divide the high-density navigation point set into a preset number of clusters, where the preset number is the number of clusters set by the user according to actual needs; each cluster has a center point, and the completion system will obtain the center point location information of all clusters.
在获取到所有中心点位置信息后,补全系统再根据所有中心点位置信息进行三角剖分操作,具体可采用Delaunay三角剖分(狄洛尼三角剖分),从而获得对应的三角网络图,实际上三角网络图就是初步典型航道网络图。After obtaining the location information of all center points, the completion system performs triangulation operations based on the location information of all center points. Specifically, Delaunay triangulation can be used to obtain the corresponding triangulated network diagram. In fact, the triangulated network diagram is a preliminary typical waterway network diagram.
然后再将三角网络图中的所有线要素与陆地面要素进行相交判断,具体的判断方式与上述一致,在此不做过多赘述;保留与陆地不相交的线要素,并将这些与陆地不相交的线要素作为最终线要素,并根据所有最终线要素创建用于路径规划的无向网络图,此无向网络图即为最终的典型航道网络图,本发明通过DBSCAN空间聚类对初始航行点集进行去噪操作,去除船舶航行轨迹中规律弱的噪声点,保留高密度航行点集,提高了后续处理的数据质量,并且再通过K中心点算法进行空间聚类获取簇类中心,从而能够更好反映船舶的航行航道的规律,为后续的数据补全提供了有力的数据支持。Then, all line elements in the triangulated network diagram are judged to intersect with land surface elements. The specific judgment method is the same as above and will not be elaborated on here. Line elements that do not intersect with the land are retained, and these line elements that do not intersect with the land are used as final line elements. An undirected network diagram for path planning is created based on all final line elements. This undirected network diagram is the final typical waterway network diagram. The present invention performs denoising operation on the initial navigation point set through DBSCAN spatial clustering, removes noise points with weak regularity in the ship's navigation trajectory, retains a high-density navigation point set, improves the data quality of subsequent processing, and then performs spatial clustering through the K center point algorithm to obtain the cluster center, so as to better reflect the regularity of the ship's navigation channel and provide strong data support for subsequent data completion.
作为举例,在完成DBSCAN空间聚类去噪操作得到高密度航行点集后,用户可以将K中心点算法的簇类数量K设置为3000,补全系统就会将高密度航行点集按空间的聚散划分为3000个簇类,并获取3000个簇类对应的3000个中心点位置信息;然后再将3000个中心点位置信息作为三角网络图中每个三角形顶点的坐标,进行三角剖分操作,构建出三角网络图;最后再遍历三角网络图中每一条边(线要素)与陆地面要素,将每一条边都与陆地面要素进行线面相交的空间查询,筛除线面相交的715条边,保留与陆地面要素不相交的8250条边,和网络节点2966个,并根据8250条边和2966个网络节点创建用于路径规划的无向网络图。As an example, after completing the DBSCAN spatial clustering denoising operation to obtain a high-density navigation point set, the user can set the number of clusters K of the K center point algorithm to 3000, and the completion system will divide the high-density navigation point set into 3000 clusters according to spatial concentration and dispersion, and obtain the 3000 center point location information corresponding to the 3000 clusters; then use the 3000 center point location information as the coordinates of each triangle vertex in the triangular network diagram, perform triangulation operations, and construct a triangular network diagram; finally, traverse each edge (line element) and land surface element in the triangular network diagram, perform spatial queries on the intersection of each edge and the land surface element, screen out 715 edges that intersect with the line and surface, retain 8250 edges that do not intersect with the land surface elements, and 2966 network nodes, and create an undirected network diagram for path planning based on the 8250 edges and 2966 network nodes.
进一步地,如图2所示,基于上述基于多算法耦合的船舶航迹缺失数据补全方法,本发明还相应提供了一种基于多算法耦合的船舶航迹缺失数据补全系统,其中,所述基于多算法耦合的船舶航迹缺失数据补全系统包括:Further, as shown in FIG2 , based on the above-mentioned ship track missing data completion method based on multi-algorithm coupling, the present invention also provides a ship track missing data completion system based on multi-algorithm coupling, wherein the ship track missing data completion system based on multi-algorithm coupling includes:
轨迹子段获取模块51,用于获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段;The track sub-segment acquisition module 51 is used to acquire the navigation point data of the ship to be processed and all the land surface elements on the map, and obtain multiple ship track sub-segments according to the navigation point data;
异常轨迹判断模块52,用于根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段;An abnormal trajectory judgment module 52 is used to judge the intersection of each ship trajectory sub-segment with all the land surface elements according to a spatial query method to obtain multiple abnormal trajectory sub-segments;
节点信息获取模块53,用于获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息;A node information acquisition module 53 is used to acquire endpoint information corresponding to each abnormal trajectory sub-segment, and acquire network node information corresponding to the endpoint information of each abnormal trajectory sub-segment according to a pre-constructed typical waterway network diagram;
船舶轨迹补全模块54,用于配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,根据所有所述最优路径对所述待处理船只的船舶航迹进行补全。The ship track completion module 54 is used to configure the A-star algorithm, and perform path planning operations on each of the network node information according to the A-star algorithm to obtain the optimal path of each abnormal track sub-segment, and complete the ship track of the ship to be processed according to all the optimal paths.
进一步地,如图3所示,基于上述基于多算法耦合的船舶航迹缺失数据补全方法和系统,本发明还相应提供了一种终端,所述终端包括处理器10、存储器20及显示器30。图3仅示出了终端的部分组件,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Further, as shown in Fig. 3, based on the above-mentioned method and system for completing missing data of ship tracks based on multi-algorithm coupling, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Fig. 3 only shows some components of the terminal, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead.
所述存储器20在一些实施例中可以是所述终端的内部存储单元,例如终端的硬盘或内存。所述存储器20在另一些实施例中也可以是所述终端的外部存储设备,例如所述终端上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(SecureDigital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器20还可以既包括所述终端的内部存储单元也包括外部存储设备。所述存储器20用于存储安装于所述终端的应用软件及各类数据,例如所述安装终端的程序代码等。所述存储器20还可以用于暂时地存储已经输出或者将要输出的数据。在一实施例中,存储器20上存储有基于多算法耦合的船舶航迹缺失数据补全程序40,该基于多算法耦合的船舶航迹缺失数据补全程序40可被处理器10所执行,从而实现本申请中基于多算法耦合的船舶航迹缺失数据补全方法。In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a ship track missing data completion program 40 based on multi-algorithm coupling is stored on the memory 20, and the ship track missing data completion program 40 based on multi-algorithm coupling can be executed by the processor 10, thereby realizing the ship track missing data completion method based on multi-algorithm coupling in the present application.
所述处理器10在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行所述存储器20中存储的程序代码或处理数据,例如执行所述基于多算法耦合的船舶航迹缺失数据补全方法等。In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the ship track missing data completion method based on multi-algorithm coupling.
所述显示器30在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。所述显示器30用于显示在所述终端的信息以及用于显示可视化的用户界面。所述终端的部件10-30通过系统总线相互通信。In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
在一实施例中,当处理器10执行所述存储器20中基于多算法耦合的船舶航迹缺失数据补全程序40时实现以下步骤:In one embodiment, when the processor 10 executes the ship track missing data completion program 40 based on multi-algorithm coupling in the memory 20, the following steps are implemented:
获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段;Obtaining navigation point data of the vessel to be processed and all land surface elements on the map, and obtaining multiple ship track sub-segments according to the navigation point data;
根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段;According to the spatial query method, each of the ship track sub-segments is respectively intersected with all the land surface elements to obtain multiple abnormal track sub-segments;
获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息;Acquire endpoint information corresponding to each abnormal trajectory sub-segment, and acquire network node information corresponding to the endpoint information of each abnormal trajectory sub-segment according to a pre-constructed typical waterway network diagram;
配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,根据所有所述最优路径对所述待处理船只的船舶航迹进行补全。An A-star algorithm is configured, and a path planning operation is performed on each of the network node information according to the A-star algorithm to obtain an optimal path for each of the abnormal trajectory sub-segments, and the ship track of the ship to be processed is completed according to all the optimal paths.
其中,所述获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段,具体包括:The step of obtaining the navigation point data of the vessel to be processed and all land surface elements on the map, and obtaining multiple ship track sub-segments according to the navigation point data, specifically includes:
从预设船舶轨迹数据库中获取所述待处理船只的航行点位数据,并从所述地图上获取所有陆地面要素;Acquire the navigation point data of the vessel to be processed from a preset ship track database, and acquire all land surface elements from the map;
获取所述航行点位数据的所有航行点位,并获取每个所述航行点位对应的时间戳;Obtain all the navigation points of the navigation point data, and obtain the timestamp corresponding to each of the navigation points;
根据所有所述时间戳对所有所述航行点位进行排序,并将相邻时间戳的两个航行点位进行连接,以得到多段船舶轨迹子段。All the navigation points are sorted according to all the timestamps, and two navigation points with adjacent timestamps are connected to obtain multiple ship track sub-segments.
其中,所述根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段,具体包括:The method of intersecting each of the ship track sub-segments with all the land surface elements according to the spatial query method is used to obtain multiple abnormal track sub-segments, specifically including:
根据所述空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行线面相交的空间查询,判断是否存在船舶轨迹子段与陆地面要素相交;According to the spatial query method, each of the ship track sub-segments is subjected to a spatial query of line-surface intersection with all the land surface elements to determine whether there is a ship track sub-segment intersecting with a land surface element;
若所述船舶轨迹子段与所述陆地面要素相交,则将对应的船舶轨迹子段进行异常标记处理;If the ship track sub-segment intersects with the land surface element, the corresponding ship track sub-segment is marked as abnormal;
当所有所述船舶轨迹子段处理完成后,将所有带有异常标记的船舶轨迹子段作为异常轨迹子段。When all the ship trajectory sub-segments are processed, all the ship trajectory sub-segments with abnormal marks are regarded as abnormal trajectory sub-segments.
其中,所述获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息,具体包括:The step of obtaining the endpoint information corresponding to each abnormal trajectory sub-segment and obtaining the network node information corresponding to the endpoint information of each abnormal trajectory sub-segment according to a pre-constructed typical waterway network diagram specifically includes:
获取每段所述异常轨迹子段对应的端点信息,其中,所述端点信息包括开始端点和结束端点;Acquire endpoint information corresponding to each abnormal trajectory sub-segment, wherein the endpoint information includes a start endpoint and an end endpoint;
根据预先构建的典型航道网络图分别对每段所述异常轨迹子段的开始端点和结束端点进行匹配操作,得到与每段所述异常轨迹子段的开始端点距离最短的开始网络节点,以及与每段所述异常轨迹子段的结束端点距离最短的结束网络节点;According to the pre-constructed typical waterway network diagram, the start endpoint and the end endpoint of each abnormal trajectory sub-segment are matched respectively to obtain the start network node with the shortest distance to the start endpoint of each abnormal trajectory sub-segment and the end network node with the shortest distance to the end endpoint of each abnormal trajectory sub-segment;
将每段所述异常轨迹子段对应的开始网络节点和结束网络节点进行整合,得到每段所述异常轨迹子段对应的网络节点信息。The starting network node and the ending network node corresponding to each abnormal trajectory sub-segment are integrated to obtain the network node information corresponding to each abnormal trajectory sub-segment.
其中,所述配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,具体包括:The configuration of the A-star algorithm and performing a path planning operation on each of the network node information according to the A-star algorithm to obtain the optimal path of each abnormal trajectory sub-segment specifically includes:
将欧氏距离作为A星算法的代价函数,将曼哈顿距离作为A星算法的启发函数,以完成对所述A星算法的配置;Using the Euclidean distance as the cost function of the A-star algorithm and the Manhattan distance as the heuristic function of the A-star algorithm to complete the configuration of the A-star algorithm;
获取与每段所述异常轨迹子段的开始网络节点直接相连的多个第一相连节点,分别计算每段所述异常轨迹子段的开始网络节点和每个第一相连节点之间的第一欧氏距离,计算结束网络节点和每个第一相连节点之间的第一曼哈顿距离;Acquire multiple first connected nodes directly connected to the starting network node of each abnormal trajectory subsegment, respectively calculate the first Euclidean distance between the starting network node of each abnormal trajectory subsegment and each first connected node, and calculate the first Manhattan distance between the ending network node and each first connected node;
根据每个所述第一相连节点对应的第一欧氏距离和第一曼哈顿距离计算每个所述第一相连节点对应的第一总成本,根据所有所述第一总成本获取每段所述异常轨迹子段的第一目标点;Calculate the first total cost corresponding to each of the first connected nodes according to the first Euclidean distance and the first Manhattan distance corresponding to each of the first connected nodes, and obtain the first target point of each of the abnormal trajectory subsegments according to all the first total costs;
获取与每段所述异常轨迹子段的第一目标点直接相连的多个第二相连节点,……,直至到达结束网络节点,完成对每段所述异常轨迹子段的路径规划操作,得到每段所述异常轨迹子段的最优路径。Acquire multiple second connected nodes directly connected to the first target point of each abnormal trajectory sub-segment, ..., until reaching the end network node, complete the path planning operation for each abnormal trajectory sub-segment, and obtain the optimal path for each abnormal trajectory sub-segment.
其中,所述根据所有所述最优路径对所述待处理船只的船舶航迹进行补全,具体包括:The step of completing the ship track of the ship to be processed according to all the optimal paths specifically includes:
将每段所述异常轨迹子段的开始端点与对应的最优路径的开始网络节点进行连接;Connecting the starting endpoint of each abnormal trajectory sub-segment to the starting network node of the corresponding optimal path;
将每段所述异常轨迹子段的结束端点与对应的最优路径的结束网络节点进行连接;Connecting the end endpoint of each abnormal trajectory sub-segment to the end network node of the corresponding optimal path;
当所有所述异常轨迹子段的开始端点和结束端点分别与对应的最优路径连接完成后,表示完成对所述待处理船只的船舶轨迹的补全。When the start endpoints and the end endpoints of all the abnormal trajectory sub-segments are respectively connected to the corresponding optimal paths, it means that the completion of the ship trajectory of the ship to be processed is completed.
其中,所述典型航道网络图的构建过程,具体包括:The construction process of the typical waterway network diagram specifically includes:
从预设船舶轨迹数据库中获取所有船只的航行点位数据,并对所有所述航行点位数据进行数据清洗操作,得到初始航行点集;Obtaining the navigation point data of all ships from a preset ship track database, and performing data cleaning operations on all the navigation point data to obtain an initial navigation point set;
对所述初始航行点集进行空间聚类去噪操作,得到与所述初始航行点集对应的高密度航行点集;Performing a spatial clustering denoising operation on the initial navigation point set to obtain a high-density navigation point set corresponding to the initial navigation point set;
根据聚类算法将所述高密度航行点集划分为预设数量的簇类,并获取每个簇类的中心点位置信息;Dividing the high-density navigation point set into a preset number of clusters according to a clustering algorithm, and obtaining the center point position information of each cluster;
根据所有所述中心点位置信息进行三角剖分操作,得到三角网络图;Perform a triangulation operation according to the position information of all the center points to obtain a triangulated network diagram;
将所述三角网络图中的所有线要素与所有所述陆地面要素进行相交判断,将与所有所述陆地面要素不相交的线要素作为最终线要素,并根据所有所述最终线要素构建典型航道网络图。All line elements in the triangulated network diagram are judged to intersect with all the land surface elements, the line elements that do not intersect with all the land surface elements are taken as final line elements, and a typical waterway network diagram is constructed based on all the final line elements.
本发明还提供一种计算机可读存储介质,其中,所述计算机可读存储介质存储有基于多算法耦合的船舶航迹缺失数据补全程序,所述基于多算法耦合的船舶航迹缺失数据补全程序被处理器执行时实现如上所述的基于多算法耦合的船舶航迹缺失数据补全方法的步骤。The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a ship track missing data completion program based on multi-algorithm coupling, and when the ship track missing data completion program based on multi-algorithm coupling is executed by a processor, the steps of the ship track missing data completion method based on multi-algorithm coupling as described above are implemented.
综上所述,本发明提供一种基于多算法耦合的船舶航迹缺失数据补全方法及系统,所述方法包括:获取待处理船只的航行点位数据和地图上的所有陆地面要素,并根据所述航行点位数据得到多段船舶轨迹子段;根据空间查询方法分别将每段所述船舶轨迹子段与所有所述陆地面要素进行相交判断,得到多段异常轨迹子段;获取每段所述异常轨迹子段对应的端点信息,并根据预先构建的典型航道网络图获取与每段所述异常轨迹子段的端点信息对应的网络节点信息;配置A星算法,并根据所述A星算法对每个所述网络节点信息进行路径规划操作,得到每段所述异常轨迹子段的最优路径,根据所有所述最优路径对所述待处理船只的船舶航迹进行补全。本发明通过A星算法实现启发式搜索和最佳优先搜索,可以快速高效地找到最优路径,提高了对大数据量的船舶轨迹进行缺失数据补全的处理效率,并且通过构建典型航道网络图,能够为数据补全提供更准确的支持,避免因需要人工设置航道而耗费大量的时间和精力,进一步提高了数据补全的效率,也提高了数据补全的准确性。In summary, the present invention provides a method and system for completing missing data of a ship track based on multi-algorithm coupling, the method comprising: obtaining navigation point data of a ship to be processed and all land surface elements on a map, and obtaining multiple ship track sub-segments according to the navigation point data; performing intersection judgment on each of the ship track sub-segments and all the land surface elements according to a spatial query method to obtain multiple abnormal track sub-segments; obtaining endpoint information corresponding to each of the abnormal track sub-segments, and obtaining network node information corresponding to the endpoint information of each of the abnormal track sub-segments according to a pre-constructed typical waterway network diagram; configuring an A-star algorithm, and performing a path planning operation on each of the network node information according to the A-star algorithm to obtain the optimal path of each of the abnormal track sub-segments, and completing the ship track of the ship to be processed according to all the optimal paths. The present invention realizes heuristic search and best-first search through the A-star algorithm, which can quickly and efficiently find the optimal path, improve the processing efficiency of missing data completion for large amounts of ship trajectories, and by constructing a typical waterway network diagram, it can provide more accurate support for data completion, avoiding the need to manually set the waterway and consuming a lot of time and effort, further improving the efficiency of data completion, and also improving the accuracy of data completion.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者终端中还存在另外的相同要素。It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
当然,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关硬件(如处理器,控制器等)来完成,所述的程序可存储于一计算机可读取的计算机可读存储介质中,所述程序在执行时可包括如上述各方法实施例的流程。其中所述的计算机可读存储介质可为存储器、磁碟、光盘等。Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
应当理解的是,本发明的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410247921.1A CN117851655B (en) | 2024-03-05 | 2024-03-05 | Ship track missing data complement method and system based on multi-algorithm coupling |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410247921.1A CN117851655B (en) | 2024-03-05 | 2024-03-05 | Ship track missing data complement method and system based on multi-algorithm coupling |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117851655A true CN117851655A (en) | 2024-04-09 |
CN117851655B CN117851655B (en) | 2024-05-28 |
Family
ID=90536374
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410247921.1A Active CN117851655B (en) | 2024-03-05 | 2024-03-05 | Ship track missing data complement method and system based on multi-algorithm coupling |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117851655B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118885506A (en) * | 2024-09-27 | 2024-11-01 | 北京恒济引航科技股份有限公司 | Track query method, system and device based on AIS data |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111060109A (en) * | 2020-01-03 | 2020-04-24 | 东南大学 | A Global Path Planning Method for Unmanned Vehicle Based on Improved A-Star Algorithm |
CN112862156A (en) * | 2021-01-08 | 2021-05-28 | 北京工业大学 | Ship path planning method based on ship track and ant colony algorithm |
CN113032502A (en) * | 2021-02-09 | 2021-06-25 | 北京工业大学 | Ship anomaly detection method based on improved track segment DBSCAN clustering |
CN113553682A (en) * | 2021-07-12 | 2021-10-26 | 大连海事大学 | A data-driven multi-level ship route network construction method |
CN114705193A (en) * | 2022-04-06 | 2022-07-05 | 交通运输部东海航海保障中心宁波航标处 | Marine big data-based ship navigation path planning method and system |
-
2024
- 2024-03-05 CN CN202410247921.1A patent/CN117851655B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111060109A (en) * | 2020-01-03 | 2020-04-24 | 东南大学 | A Global Path Planning Method for Unmanned Vehicle Based on Improved A-Star Algorithm |
CN112862156A (en) * | 2021-01-08 | 2021-05-28 | 北京工业大学 | Ship path planning method based on ship track and ant colony algorithm |
CN113032502A (en) * | 2021-02-09 | 2021-06-25 | 北京工业大学 | Ship anomaly detection method based on improved track segment DBSCAN clustering |
CN113553682A (en) * | 2021-07-12 | 2021-10-26 | 大连海事大学 | A data-driven multi-level ship route network construction method |
CN114705193A (en) * | 2022-04-06 | 2022-07-05 | 交通运输部东海航海保障中心宁波航标处 | Marine big data-based ship navigation path planning method and system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118885506A (en) * | 2024-09-27 | 2024-11-01 | 北京恒济引航科技股份有限公司 | Track query method, system and device based on AIS data |
Also Published As
Publication number | Publication date |
---|---|
CN117851655B (en) | 2024-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
He et al. | RoadRunner: improving the precision of road network inference from GPS trajectories | |
US10866104B2 (en) | Route-deviation recognition method, terminal, and storage medium | |
CN104270714B (en) | The method and apparatus for determining user movement track | |
CN107885790B (en) | A Multi-factor Automatic Update Method for Road Spatial Networks | |
CN106767836B (en) | AUV terrain matching navigation filtering method | |
US20210207963A1 (en) | Determination of traffic checkpoint | |
CN109214314B (en) | Automatic fusion matching algorithm for lane lines | |
CN114234991B (en) | Navigation path planning method, device, computer equipment and storage medium | |
CN117851655A (en) | Ship track missing data completion method and system based on multi-algorithm coupling | |
CN113674351A (en) | A method for constructing a robot and the robot | |
CN118670407B (en) | A map matching method and system based on hidden Markov model | |
Liu et al. | M: N Object matching on multiscale datasets based on MBR combinatorial optimization algorithm and spatial district | |
Kieler et al. | Matching river datasets of different scales | |
CN117553801B (en) | Topology path diagram generation method, device, robot and storage medium | |
CN118733695A (en) | Lane boundary line generation method and device, storage medium and electronic device | |
Lei et al. | Conflating linear features using turning function distance: A new orientation‐sensitive similarity measure | |
CN115292962B (en) | Path similarity matching method and device based on track rarefaction and storage medium | |
CN114705180B (en) | Data correction method, device and equipment for high-precision map and storage medium | |
CN113390415B (en) | Positioning method, positioning device, management system and storage medium for robot | |
Lei et al. | Linear feature conflation: An optimization‐based matching model with connectivity constraints | |
CN116932668A (en) | Road junction-based map road network segmentation method, device, medium and equipment | |
JP4647217B2 (en) | Temporary map data generation apparatus and method | |
CN117931975B (en) | Port comprehensive pipe network visual management method, port comprehensive pipe network visual management system, terminal and storage medium | |
CN113761990B (en) | Road boundary detection method, device, unmanned vehicle and storage medium | |
CN119563439A (en) | Intelligent cleaning device control method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |