A method and device for identifying historical ports of call based on AIS trajectory data of a ship

CN123016723APending Publication Date: 2026-10-30XIAMEN CHUANSHUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611391507.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

以船舶标识数据构建大宗货物贸易网络,停靠港识别仅作为前置步骤,未公开具体的识别算法逻辑,亦未见对数据噪声、飞点过滤、同港合并等实际问题的处理

Benefits of technology

(1)提升了停泊状态判定的可靠性。通过航行状态编码与对地航速的联合判定机制,并引入状态冲突检测与回退规则,该机制能够兼容状态编码持续上报“在航”但实际速度极低的真实停泊场景,也能够消除状态编码滞后更新导致的停泊误判,显著提升了停泊状态识别的准确率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123016723A_ABST
    Figure CN123016723A_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of ship automatic identification system data processing, and provides a historical port identification method and device based on ship AIS trajectory data. The method comprises: acquiring and standardizing ship AIS trajectory point columns, and completing missing speeds; different time interval thresholds are used for continuity detection according to whether there is an uncompleted berthing section; when the sailing state code indicates berthing and the speed exceeds the conflict threshold, the state code is ignored and the berthing state is determined according to the speed, otherwise the berthing state is determined by combining the sailing state code and the speed; a berthing section is extracted, the section is ended when the continuous sailing point exceeds the threshold, and invalid sections are discarded; the berthing section spatial representative point is used to query a port database, two-stage matching radii are used to record the berthing port, and adjacent berthing records of the same port are combined; the berthing confidence is calculated by weighting the state support rate, the berthing time length, the port matching distance and the trajectory continuity, and the berthing port sequence containing the berthing port, the arrival time, the departure time and the confidence is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology for Automatic Identification System (AIS) for ships, and in particular to a method and apparatus for identifying historical ports of call based on ship AIS trajectory data. Background Technology

[0002] Identifying historical port calls of ships based on AIS trajectory data is a key technological link in areas such as shipping history analysis, trade network construction, port service assessment, and maritime supervision.

[0003] Currently, ship berthing port identification methods are mainly divided into the following categories: (1) Port area intersection method. The port is modeled as a geofence polygon, and berthing is identified by judging whether the trajectory point falls within the area. This method is not accurate enough when the port boundary data is incomplete, and it cannot distinguish between anchored waiting in the port and actual berthing.

[0004] (2) Stop point identification method based on cluster analysis. The DBSCAN equal-density clustering algorithm is used to spatially cluster the low-speed point set and then match it with the port location. This type of method requires a large amount of historical data accumulation, has high computational complexity, is difficult to process single ship trajectories in real time, and is sensitive to clustering parameters.

[0005] (3) Mooring event discrimination method based on sliding window. A single time window threshold is used to determine the start and end of mooring events. During the mooring period, AIS data often has a sparse interval of 3 to 6 hours due to satellite signal blockage. A single threshold may easily misjudge a complete mooring as multiple segments; during navigation, it may be overly sensitive to normal data sparsity.

[0006] (4) Direct judgment method based on navigation status code. The berthing status is determined by directly reading the navigation status code in the AIS message. In actual data, there is a common problem of delayed status code updates—the ship has set sail but the code still shows that it is moored, which leads to serious misjudgments.

[0007] (5) Machine learning-based state classification method. Classifiers such as KNN and random forest are used to classify trajectory points. A large amount of labeled data is required for training, and the model's generalization ability is limited by the coverage of the training data, making it difficult to adapt to different ship types and sea areas.

[0008] (6) Trade network method based on ship identification data. A bulk cargo trade network is constructed using ship identification data. Port identification is only a preliminary step. The specific identification algorithm logic is not disclosed, nor is the treatment of practical problems such as data noise, flypoint filtering, and port merging shown.

[0009] In summary, the existing technologies have the following main shortcomings: (1) Insufficient reliability in determining the berthing status. Existing methods usually rely on a single information source for berthing determination, or only on ground speed, or only on navigation status codes, or only on spatial range. When there is noise in the AIS data, the status codes are delayed in updating, or the speed sensor is abnormal, the misjudgment rate is high, and it is difficult to be compatible with real berthing scenarios where the status code continuously reports "in operation" but the speed is extremely low.

[0010] (2) Rigid time continuity detection mechanism. Existing methods use a single time threshold to determine the start and end of a berthing event, which cannot simultaneously adapt to the two very different data sampling characteristics: navigation state (data interruption requires rapid segmentation to avoid trajectory splicing errors) and berthing state (data sparsity requires maintaining continuity to avoid a single berthing event being split into multiple events).

[0011] (3) Port matching and berthing segment representation lack refined design. Existing methods mostly use a single fixed radius to match ports, which makes it difficult to distinguish between berthing in port berths and berthing in anchorage outside port; and often use the mean center as the spatial representative point of the berthing segment. In the scenario of shifting berths in port, the mean center is easy to shift to the water area between wharves, resulting in inaccurate port matching.

[0012] (4) The post-call handling mechanism is imperfect. The existing method lacks a reasonable merging mechanism for multiple short-term calls at the same port (such as berth A → anchorage → berth B), and does not provide a quantitative confidence assessment of the identification results. This makes it impossible for downstream applications to distinguish between highly reliable calls and questionable calls, affecting the accuracy of voyage statistics and trade network construction. Summary of the Invention

[0013] This disclosure provides a method and apparatus for identifying historical ports of call based on ship AIS trajectory data, which can effectively solve the above-mentioned problems.

[0014] This disclosure is implemented as follows: In a first aspect, this disclosure provides a method for identifying historical ports of call based on ship AIS trajectory data, the method comprising: Obtain the raw AIS messages of the vessel and standardize them into a time-ordered sequence of trajectory points. , where each trajectory point It must include at least latitude, longitude, ground speed, navigation status code, and timestamp; The trajectory points that lack the required ground speed are filled in to ensure that each trajectory point has a usable ground speed. If there is an unfinished parking segment, then when the time interval between adjacent trajectory points exceeds the first maximum permissible time interval... When the time interval between adjacent trajectory points exceeds the second maximum allowable time interval, the berthing segment ends; if there are no unfinished berthing segments, the berthing segment ends when the time interval between adjacent trajectory points exceeds the second maximum allowable time interval. At that time, navigation segmentation is performed, in which... ; When the navigation status code of the trajectory point indicates a stationary state, and the available ground speed of the trajectory point exceeds the state conflict speed threshold, the system checks whether the available ground speed of the trajectory point does not exceed a second speed threshold. This serves as the basis for determining whether the trajectory point is in a stationary state; For each of the trajectory points, when the navigation status code indicates a stationary state and the available ground speed does not exceed a first speed threshold... The trajectory point is determined to be in a stationary state; when the navigation status code is missing or indicates the navigation status, and the available ground speed does not exceed... The trajectory point is determined to be in a stationary state, whereby... ; When a trajectory point is determined to be in a berthing state and its preceding trajectory point is determined to be in a sailing state, a new berthing segment is initiated, and berthing points are continuously added to the current berthing segment. The berthing points are the trajectory points determined to be in a berthing state. During the accumulation process of the current berthing segment, consecutive sailing points are counted. The sailing points are the trajectory points determined to be in a sailing state. When the number of consecutive sailing points in the current berthing segment exceeds the sailing interruption confirmation threshold, the berthing segment is terminated, resulting in an terminated berthing segment. The validity of the terminated berthing segment is confirmed. If the number of trajectory points in the terminated berthing segment is less than the minimum number of berthing points or the berthing duration is less than the minimum docking duration, the terminated berthing segment is discarded. The port database is queried using the spatial representative point of the ended berthing segment that has been verified for validity, within the first matching radius. The system searches for a matching port within the first matching radius. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and the ending berthing segment is recorded as a berthing record. If a match fails within the first matching radius, the system searches for a matching port within the second matching radius. The system searches for a matching port within the specified range. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and this ending berthing segment is recorded as a berthing record. ; When the following merging conditions are met, adjacent berthing records corresponding to the same port of call will be merged into one berthing record: the cumulative AIS trajectory from the departure of the previous berthing record to the arrival of the current berthing record does not exceed the maximum merged trajectory, and the difference between the arrival time of the current berthing record and the departure time of the previous berthing record does not exceed the maximum departure time. The berthing confidence is calculated by weighting the state support rate of the trajectory points within the berthing segment corresponding to the berthing record, the berthing duration, the port matching distance, and the trajectory continuity. The berthing port sequence is output, and each berthing record in the berthing port sequence contains at least the berthing port, the arrival time, the departure time, and the berthing confidence.

[0015] Secondly, this disclosure provides a historical port of call identification device based on ship AIS trajectory data, the device comprising: The standardization module is used to acquire the raw AIS messages of the vessel and standardize the raw AIS messages into a time-ordered sequence of trajectory points. , where each trajectory point It must include at least latitude, longitude, ground speed, navigation status code, and timestamp; The speed completion module is used to complete the trajectory points that are missing the ground speed, so that each trajectory point has a usable ground speed; The continuity detection module is used to detect if there is an unfinished berthing segment. The time interval between the trajectory points exceeds the first maximum allowed time interval. If the berthing segment ends, then the berthing segment ends; if there are no unfinished berthing segments at present, then... The time interval between the trajectory points exceeds the second maximum allowed time interval. At that time, navigation segmentation is performed, in which... ; The conflict detection module is used to determine whether the available ground speed of a trajectory point does not exceed a second speed threshold when the navigation state code of the trajectory point indicates a stationary state and the available ground speed of the trajectory point exceeds a state conflict speed threshold. This serves as the basis for determining whether the trajectory point is in a stationary state; The status determination module is used to determine the status of each trajectory point when the navigation status code indicates a stationary state and the available ground speed does not exceed a first speed threshold. The trajectory point is determined to be in a stationary state; when the navigation status code is missing or indicates the navigation status, and the available ground speed does not exceed... The trajectory point is determined to be in a stationary state, whereby... ; The berthing segment extraction module is used to: initiate a new berthing segment when a trajectory point is determined to be in a berthing state and its preceding trajectory point is determined to be in a navigation state; continuously add berthing points to the current berthing segment, where the berthing points are the trajectory points determined to be in a berthing state; during the accumulation process of the current berthing segment, count the consecutive navigation points that appear, where the navigation points are the trajectory points determined to be in a navigation state; when the number of consecutive navigation points in the current berthing segment exceeds the navigation interruption confirmation threshold, end the berthing segment to obtain an ended berthing segment; and verify the validity of the ended berthing segment. If the number of trajectory points in the ended berthing segment is less than the minimum number of berthing points or the berthing duration is less than the minimum berthing duration, discard the ended berthing segment. The port matching module is used to query the port database using the spatial representative point of the final berthing segment that has been validated, within a first matching radius. The system searches for a matching port within the first matching radius. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and the ending berthing segment is recorded as a berthing record. If a match fails within the first matching radius, the system searches for a matching port within the second matching radius. The system searches for a matching port within the specified range. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and this ending berthing segment is recorded as a berthing record. ; The record merging module is used to merge adjacent berthing records corresponding to the same port of call into one berthing record when the following merging conditions are met: the cumulative AIS trajectory from the departure of the previous berthing record to the arrival of the current berthing record does not exceed the maximum merged trajectory, and the difference between the arrival time of the current berthing record and the departure time of the previous berthing record does not exceed the maximum departure time. The sequence output module is used to calculate the berthing confidence based on the state support rate, berthing duration, port matching distance and trajectory continuity of the trajectory points within the berthing segment corresponding to the berthing record; and output the berthing port sequence, wherein each berthing record in the berthing port sequence includes at least the berthing port, arrival time, departure time and the berthing confidence.

[0016] Compared with the prior art, the beneficial effects of this disclosure are: (1) Improved reliability of berthing status determination. By using a joint determination mechanism of navigation status coding and ground speed, and introducing status conflict detection and backoff rules, this mechanism can be compatible with real berthing scenarios where the status code continuously reports "in operation" but the actual speed is extremely low. It can also eliminate berthing misjudgment caused by delayed status code updates, significantly improving the accuracy of berthing status identification.

[0017] (2) Enhanced adaptability of time continuity detection to multiple scenarios. The dual-threshold time interval continuity detection mechanism can simultaneously adapt to two very different sampling characteristics: data interruption during navigation and the need to quickly segment data, and data sparseness during docking and the need to maintain continuity data. This avoids the problems of missegmentation or oversensitivity caused by a single threshold.

[0018] (3) Improved the accuracy and spatial adaptability of port matching. The two-level matching radius strategy effectively distinguishes between berth berthing and anchorage berthing, solving the problem of missed anchorage identification or misidentification of berths caused by a single fixed radius, and reducing the dependence on accurate port boundary data.

[0019] (4) Improved post-processing and result credibility assessment of berthing events. A three-dimensional merging mechanism for the same port was introduced. By constraining the cumulative voyage of AIS trajectory between adjacent berthing records at the same port and between time intervals, adjacent berthing records that were separated due to port shifting, anchorage transfer, or short-term departure were accurately merged into the same berthing, avoiding the mistaken counting of the same berthing at the same port as multiple independent berthings. This effectively avoided the erroneous merging problem of short-term departures and re-berthings. At the same time, the berthing confidence was calculated by weighting four factors: state support rate, berthing duration, port matching distance, and trajectory continuity. This upgraded the identification results from a simple binary judgment to a credibility assessment system, enabling downstream systems to differentiate berthing records based on confidence, thus improving the data quality of voyage statistics and trade network construction.

[0020] (5) The algorithm is lightweight and can process the trajectory of a single ship. This disclosure can complete the recognition by performing a single traversal of the trajectory point series, without the need for a large amount of historical data accumulation or labeled data training. The algorithm has low complexity and is suitable for batch processing scenarios of historical trajectories of a single ship. Attached Figure Description

[0021] Figure 1 This is a flowchart of the historical port of call identification method S100 based on ship AIS trajectory data provided in this embodiment of the disclosure.

[0022] Figure 2 This is a schematic diagram of the structure of the historical port of call identification device 1000 based on ship AIS trajectory data provided in this embodiment of the disclosure. Detailed Implementation

[0023] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0024] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0025] Unless otherwise stated, the exemplary implementations / embodiments shown are to be understood as providing exemplary features of various details that provide ways in which the technical concepts of this disclosure can be implemented in practice. Therefore, unless otherwise stated, the features of various implementations / embodiments may be additionally combined, separated, interchanged and / or rearranged without departing from the technical concepts of this disclosure.

[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure. The singular forms “a,” “the,” and “the” used in the embodiments of this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0027] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0028] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0029] Example 1 Please refer to Figure 1 This disclosure provides a method for identifying historical ports of call based on ship AIS trajectory data, S100.

[0030] Specifically, method S100 includes: S102, Obtain the ship's raw AIS message and standardize the raw AIS message into a time-ordered sequence of trajectory points. , where each trajectory point It must include at least latitude, longitude, ground speed, navigation status code, and timestamp; S104, perform completion processing on the trajectory points that are missing the ground speed, so that each trajectory point has a usable ground speed; S106, if there is an unfinished berthing segment, then The time interval between the trajectory points exceeds the first maximum allowed time interval. If the berthing segment ends, then the berthing segment ends; if there are no unfinished berthing segments at present, then... The time interval between the trajectory points exceeds the second maximum allowed time interval. At that time, navigation segmentation is performed, in which... ; S108, when the navigation state code of the trajectory point indicates a stationary state, and the available ground speed of the trajectory point exceeds the state conflict speed threshold, the system checks whether the available ground speed of the trajectory point does not exceed a second speed threshold. This serves as the basis for determining whether the trajectory point is in a stationary state; S110, for each of the trajectory points, when the navigation state code indicates a stationary state and the available ground speed does not exceed a first speed threshold... The trajectory point is determined to be in a stationary state; when the navigation status code is missing or indicates the navigation status, and the available ground speed does not exceed... The trajectory point is determined to be in a stationary state, whereby... ; S112, when a trajectory point is determined to be in a berthing state and its preceding trajectory point is determined to be in a sailing state, a new berthing segment is started, and berthing points are continuously added to the current berthing segment, wherein the berthing points are the trajectory points determined to be in a berthing state; during the accumulation process of the current berthing segment, consecutive sailing points are counted, wherein the sailing points are the trajectory points determined to be in a sailing state; when the number of consecutive sailing points in the current berthing segment exceeds the sailing interruption confirmation threshold, the berthing segment is terminated, resulting in an terminated berthing segment; the validity of the terminated berthing segment is confirmed, and if the number of trajectory points in the terminated berthing segment is less than the minimum number of berthing points or the berthing duration is less than the minimum berthing duration, the terminated berthing segment is discarded. S114, query the port database using the spatial representative point of the ended berthing segment that has been verified for validity, within the first matching radius. The system searches for a matching port within the first matching radius. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and the ending berthing segment is recorded as a berthing record. If a match fails within the first matching radius, the system searches for a matching port within the second matching radius. The system searches for a matching port within the specified range. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and this ending berthing segment is recorded as a berthing record. ; S116. When the following merging conditions are met, adjacent berthing records corresponding to the same port of call will be merged into one berthing record: the cumulative AIS trajectory from the departure of the previous berthing record to the arrival of the current berthing record does not exceed the maximum merged trajectory, and the difference between the arrival time of the current berthing record and the departure time of the previous berthing record does not exceed the maximum departure time. S118, calculate the berthing confidence based on the state support rate of the trajectory points within the berthing segment corresponding to the berthing record, berthing duration, port matching distance, and trajectory continuity weighted average; output the berthing port sequence, where each berthing record in the berthing port sequence includes at least the berthing port, arrival time, departure time, and berthing confidence.

[0031] Step S102 is responsible for receiving raw dynamic messages transmitted by the Automatic Identification System (AIS). These raw dynamic messages can originate from a shore-based AIS receiving base station, a satellite AIS receiving device, or a third-party AIS data service platform. AIS dynamic messages record the ship's motion status in discrete time series format. Each message contains at least the following fields: ship identification information (e.g., MMSI), timestamp, latitude and longitude position, ground speed, and navigation status code. For real-time processing scenarios, this step continuously receives the message stream through a standard AIS data interface (e.g., UDP data stream, TCP socket, or message queue). For historical data processing scenarios, this step reads archived AIS message records from a data storage system (e.g., database, data file, or data lake).

[0032] The received raw AIS messages are parsed and standardized into a unified trajectory point data structure, with each trajectory point... Represented using quintuples:

[0033] The components are defined as follows: : No. The latitude values ​​of each trajectory point are in degrees (°) and range from -90 to 90. The WGS-84 geodetic coordinate system is used. : No. The longitude values ​​of the trajectory points are in degrees (°) and range from -180 to 180. The WGS-84 geodetic coordinate system is used. : No. Speed ​​over Ground (SOG) at each trajectory point, measured in knots. This field allows for an empty set of values. This indicates that speed information was not reported in the message; : No. The navigation status code for each trajectory point is 0, where 0 indicates underway using engine, 1 indicates at anchor, and 5 indicates moored. This indicates that no status information was reported in the message; : No. The timestamps of each trajectory point are in milliseconds, starting from 00:00:00 UTC (Unix epoch) on January 1, 1970.

[0034] AIS messages may arrive out of order due to transmission delays, data retransmissions, or merging of data from multiple sources. This step uses the timestamp as the sorting key to sort all trajectory points in ascending order of time, resulting in an ordered list of trajectory points:

[0035] If two trajectory points have the same timestamp (usually due to multiple messages within the same second), they are sorted a second time according to the receiving order or message sequence number to ensure the deterministic time order of the sequence.

[0036] After sorting, the time interval between adjacent trajectory points is defined as:

[0037] This time interval is used for time continuity detection in subsequent steps.

[0038] For any two trajectory points and Spatial distance between two points The distance is calculated using the great circle distance formula and obtained from the Haversine formula.

[0039] This distance value is used for: (1) Calculate the cumulative voyage distance of the AIS track in the navigation segment (i.e., the sum of the distances between all adjacent track points in the navigation segment, and the straight-line distance between non-port centers). (2) Determine the spatial continuity within the parking section (determine whether the trajectory points become flying points due to GPS jumps or signal drift); (3) When matching ports, the distance between the representative point of the berthing section space and the center point of the port is calculated.

[0040] The output of this step is the ordered sequence of trajectory points, which serves as the basic data input for all subsequent processing steps.

[0041] The ground speed field in AIS dynamic messages is not always complete and usable during actual transmission. Due to signal coverage limitations of the AIS equipment itself, packet collisions and losses in VHF communication, and equipment failures or temporary offline events, the timestamps and location information of some track points may be successfully reported, but the speed field may be missing (with values...). If trajectory points with missing speeds are discarded directly, the trajectory data will become sparse, potentially resulting in the loss of crucial information regarding changes in anchoring / navigation status. Furthermore, without addressing the missing speeds, all subsequent steps that rely on speed values ​​(such as anchoring status determination, status conflict detection, and statistics on average and maximum speeds during navigation segments) will fail to execute correctly. Therefore, it is necessary to complete the missing speed data in the trajectory point list before proceeding to status determination, ensuring that each trajectory point has a usable speed value.

[0042] Step S104 performs a single traversal of the ordered trajectory point sequence in chronological order. During the traversal, velocity completion processing is performed on each trajectory point sequentially, so that each trajectory point obtains a usable ground speed value. For each trajectory point... Perform the following judgment: like raw ground speed field If the message is not empty (meaning the speed information was successfully reported), then the original value will be used directly. Available ground speed ; like raw ground speed field Empty (i.e.) If the current trajectory point is located at a point in time, then it is traced back chronologically and filled with the nearest non-empty original velocity value preceding the current trajectory point. Available ground speed .

[0043] This method employs forward padding, rather than nonlinear interpolation or other complex interpolation methods, primarily based on the following three considerations: First, forward padding relies solely on historical data (i.e., trajectory points processed before the current point), completing the padding without waiting for subsequent trajectory points. This enables the method to support point-by-point processing of real-time AIS data streams, while methods such as linear interpolation require caching previous and subsequent points for calculation, failing to meet real-time requirements. Second, the sampling interval of AIS messages is extremely uneven, potentially lasting several minutes or even tens of minutes in open sea areas, while in port areas it can be as short as a few seconds. Linear interpolation experiences a sharp increase in error when the sampling interval is large, while forward padding only requires knowledge of the previous valid speed value and is unaffected by changes in the sampling interval. Furthermore, as large transport vehicles, ships are constrained by inertia, and their speed changes do not undergo abrupt changes in a short period (several seconds to several minutes). Using the previous valid speed value to approximate the currently temporarily missing speed value is physically reasonable.

[0044] After completion processing, each trajectory point obtains a usable ground speed value. This value will be used in several subsequent processing steps: (1) State conflict detection: When the navigation state code indicates that the ship is stopped and the available ground speed exceeds the conflict threshold, a state conflict is determined; (2) Joint determination of berthing status: Based on the comprehensive judgment of navigation status code and available ground speed, determine whether each trajectory point belongs to berthing status or navigation status; (3) Statistics on average speed and maximum speed of navigation segment: In the navigation segment after the berthing segment ends, the average speed and maximum speed of the segment are calculated based on the available ground speed; (4) Adaptive berthing threshold calculation: The second speed threshold is dynamically adjusted based on the 20th percentile of the ship's historical speed sample. (Parking speed threshold).

[0045] Multiple consecutive velocity missing: If the velocity field of multiple consecutive trajectory points is empty, each missing point will be filled with the same most recent non-empty velocity value until a new non-empty velocity value appears.

[0046] Missing velocity at the start of a trajectory point series: If the first trajectory point in a trajectory point series has a missing velocity, since there is no "nearest non-empty velocity value", this point remains in a missing state (still not a velocity value). (and is skipped in subsequent steps).

[0047] Marking the completed speed value: To facilitate subsequent data quality traceability, the speed value can be marked as "original report" or "completed generation" in the internal processing. However, this mark is only used for internal data quality control and does not affect the execution of core logic such as subsequent berthing status determination.

[0048] In one implementation, the method includes: traversing the trajectory point sequence and maintaining a current berthing segment status flag during the traversal. This flag indicates whether there are currently any berthing segments that have not yet ended. The flag is initialized to "no unfinished berthing segment" at the start of the traversal; when the berthing segment opening condition is met, the flag is set to "an unfinished berthing segment exists"; when the berthing segment ends, the flag is set to "no unfinished berthing segment exists". This flag provides a basis for subsequent steps (such as dual threshold selection in time continuity detection) to determine whether the current berthing state is active.

[0049] During the process of traversing the trajectory point series, the current berthing segment status flag is read, and the presence of an unfinished berthing segment is determined based on the flag. The corresponding time interval threshold is then selected for time continuity detection.

[0050] In step S106, if the current berthing segment status flag indicates that there is an unfinished berthing segment, then a preset first maximum allowable time interval is used. Perform detection. At this point, calculate the current trajectory point. Compared with the previous trajectory point time interval ,like If the data continuity is interrupted, the berthing segment is determined to be terminated, the current berthing segment ends, and the point is not added to the current berthing segment, but is used as the starting point of the subsequent new segment (new berthing segment or navigation segment).

[0051] If the current berthing segment status flag indicates that there are no unfinished berthing segments, then the preset second maximum allowable time interval is used. Perform the test. At this point, calculate... ,like If the data for that segment is discontinuous, the segment will be segmented, which means the current trajectory point will be used as the starting point of the new segment, the cumulative mileage and reference point of the segment will be reset, and the original segment will be broken at that point.

[0052] The aforementioned differentiated dual-threshold settings are based on the following considerations: During berthing (especially at anchor), AIS equipment may experience intervals of several hours (e.g., 3 to 6 hours) between adjacent messages due to satellite signal obstruction, power-saving mode, or equipment hibernation. If the same shorter threshold as in navigation is used, a complete berthing event will be incorrectly segmented into multiple short berthing segments, leading to an underestimation of berthing duration and an overestimation of the number of berthing segments. In navigation, however, an AIS signal interruption exceeding a certain duration usually indicates that the segment information is no longer continuous. The vessel may have reached the next port, entered a signal blind zone, or the equipment may be offline. In such cases, the current navigation segment should be terminated promptly to avoid incorrectly including data gaps in the navigation duration. By setting different time interval thresholds for berthing and navigation, the algorithm can adapt to the differentiated sampling characteristics of AIS data under different motion states, improving the accuracy of berthing and navigation segmentation.

[0053] When performing navigation segmentation, in addition to using the current trajectory point as the starting point of the new navigation segment, the cumulative mileage of the current navigation segment must be reset to zero, and the reference point of the current navigation segment must be cleared to ensure that the navigation segment statistics before and after segmentation do not interfere with each other.

[0054] like If the corresponding threshold is not exceeded, the data continuity is normal, the current berthing segment or the current navigation segment continues normally, no segmentation operation is performed, and the next trajectory point is processed.

[0055] In one implementation, Adaptive thresholding is used, and ,in, This is a set of historical speed samples for the vessel, consisting of historical trajectory points whose ground speed exceeds the speed screening threshold. Indicates the 20th percentile. This is the proportionality coefficient. This is the upper limit protection value. This is the lower limit protection value.

[0056] In determining the parking status, the parking speed threshold The value of the threshold directly affects the accuracy of the judgment result. If the threshold is set too high, it will misjudge ships sailing at low speed or drifting as anchored; if the threshold is set too low, it will misjudge ships that are actually anchored (especially anchored ships whose speed fluctuates due to wind and waves) as sailing. Different ships have significantly different speed characteristics: ocean-going bulk carriers usually have higher economic speeds, and their lower speed limit during low-speed navigation is also relatively high; while the normal operating speed range of near-shore fishing vessels or small tugboats is completely different from that of ocean-going vessels. Using a fixed threshold (such as...) The fixed threshold is applicable to most merchant ships, but for specific types of ships or navigation characteristics of specific sea areas, the fixed threshold may not achieve the best judgment effect.

[0057] This is used to reflect the speed distribution characteristics of the vessel under normal navigation conditions. An example filtering threshold value is 2.0 knots, meaning only historical samples with speeds greater than 2.0 knots are counted, excluding speed values ​​at anchor points. The influence of quantiles. The historical speed sample is typically selected from the ship's trajectory data over the past three days. The speed distribution of a ship during normal navigation is not symmetrical; it spends most of its time within the economic speed range, with only a small portion in the low-speed transition or high-speed sprint phase. The 20th percentile, located at the lower end of the speed distribution, reflects the ship's "typical speed level during low-speed navigation" and serves as a reasonable reference benchmark for distinguishing between "berthing" and "low-speed navigation." Proportionality coefficient. This is used to scale the 20th percentile to a reasonable range of berthing thresholds. Its physical meaning is: the berthing speed threshold is approximately [a percentage] of the ship's typical low-speed sailing speed. Times. In one implementation, Because historical speed samples may contain anomalous data (such as extremely low-speed drift, erroneous speeds due to equipment malfunction, etc.), direct use... This could cause the threshold to deviate from a reasonable range. Therefore, upper and lower limit protections are introduced for pruning. In one implementation, Section. If If the threshold is set, then the berthing threshold is taken as follows: This section aims to avoid setting the threshold too low due to a lack of low-speed navigation samples in historical data, which could lead to actual anchorage points being misidentified as navigation points. In one implementation, Section. If If the speed limit is 2.0 knots, the berthing threshold is set to 2.0 knots to avoid setting the threshold too high due to the large number of high-speed samples in historical data, which could lead to low-speed navigation points being misjudged as berthing points.

[0058] The navigation status code field in AIS messages is manually set by the ship's navigator or AIS equipment. In actual AIS data, this status code suffers from a serious update lag problem. The ship may have already departed and its speed may have increased to several knots or even tens of knots, but the status code may still be "moored" (5) or "anchored" (1), resulting in a significant contradiction between the status code and the speed information. If the navigation status code is relied upon entirely for mooring determination, these lagging points will be incorrectly identified as moored states, leading to an incorrect extension of the mooring segment and deviations in the identification of subsequent mooring events. On the other hand, if the speed is relied upon entirely for determination, the effective information of the status code under normal circumstances is wasted. Therefore, a mechanism is needed to detect the contradiction between the status code and the speed, and to correctly select a reliable information source when a contradiction occurs.

[0059] Step S108 introduces a state conflict detection mechanism: when the navigation state code of a trajectory point indicates a stationary state (i.e., code 1 or 5), and the available ground speed at that point exceeds a preset state conflict speed threshold. If a state conflict is detected at a trajectory point, the navigation state code is considered unreliable and ignored. The system then reverts to checking if the available ground speed does not exceed a preset second speed threshold. This serves as the criterion for determining whether the trajectory point is in a stationary state.

[0060] For each trajectory point The logic for state conflict detection is as follows: First, check the trajectory point. Does it explicitly indicate the berthing status (i.e.) or If not, then state conflict detection will not be triggered, and the point will proceed to the subsequent joint determination process for normal parking status.

[0061] like Then further compare the trajectory points and : like If the status code is reliable, the point will still be processed according to the normal procedure (i.e., the status code is reliable, and the joint determination of the parking status is initiated); if If a state conflict occurs, the conflict handling logic will be executed.

[0062] In one implementation, The value is greater than .For example, Festival, The threshold value balances two needs: First, during berthing, ships may experience brief periods of low-speed movement (typically 1-3 knots) due to tides, wind currents, or tugboat thrust. If the conflict threshold is set too low, these normal berthing movements will be misjudged as state conflicts, leading to a large number of normal berthing points being incorrectly stripped of their state codes. Second, when a ship actually departs, its speed typically rises to above 4 knots within a short period. Using 4.0 knots as the conflict threshold effectively captures scenarios where the state code still indicates berthing but the ship has actually departed. Simultaneously, the state conflict threshold is higher than both the first speed threshold (e.g., 2.0 knots) and the second speed threshold (1.0 knots), forming... The three-level speed threshold system is as follows: when the speed falls into the lowest range during normal berthing, the intermediate threshold is used for judgment when the state is reliable, and conflict detection is triggered when the state is obviously contradictory. The three work together to enable berthing judgment to effectively identify abnormal states while maintaining inclusiveness of normal berthing.

[0063] Through the aforementioned state conflict detection mechanism, when a vessel has departed but its status code still indicates berthing, conflict detection can identify the contradiction between the status code and the speed, automatically removing untrusted status codes and preventing erroneous extension of the berthing segment. Simultaneously, conflict detection is only triggered when the speed significantly exceeds a reasonable range (e.g., greater than 4.0 knots). Under normal speed conditions, the status code still participates in the berthing determination, avoiding the coarse judgment caused by relying solely on speed. By introducing a status credibility judgment dimension, berthing determination can maintain high accuracy even when AIS data contains noise and anomalies, improving the robustness of berthing status identification.

[0064] After speed completion and state conflict detection are completed, each trajectory point has a usable ground speed, and the reliability of its navigation status code has been evaluated. However, both usable ground speed and navigation status code have limitations when used individually as the basis for docking determination: relying solely on speed thresholds cannot distinguish whether the ship is "minorly moving in a docked state" or "moving at low speed in a navigation state"; relying solely on navigation status codes cannot solve the problem of delayed or missing status codes. Step S110 performs a joint determination of docking status based on the trajectory point's navigation status code and usable ground speed. Specifically, it is divided into the following two cases.

[0065] (1) The navigation status code clearly indicates the berthing status and is reliable. When the navigation status code of a trajectory point indicates a stationary state (i.e., code 1 or 5), and no state conflict is triggered (i.e., the speed to ground does not exceed...), When the speed reaches a certain threshold, the navigation status code at that point is considered reliable. At this time, the speed is set at a preset first speed threshold. As a basis for stopping: if the available ground speed does not exceed If the trajectory point is correctly identified as anchored, it is determined to be in a berthing state; otherwise, it is determined to be in a sailing state. This situation is applicable when the sailing status code in the AIS message correctly reflects the actual anchoring state of the ship. In this case, a more lenient threshold (such as 2.0 knots) is used to accommodate brief low-speed movements caused by tides, wind currents, or tugboat pushes during anchoring, thus avoiding the misjudgment of a normal anchoring point as sailing due to slight speed fluctuations.

[0066] (2) Missing navigation status code or navigation status indication When the navigation status code of the trajectory point is missing (i.e.) When the navigation status is explicitly indicated (i.e., coded as 0), the navigation status code does not provide valid parking instruction information. In this case, the system reverts to a preset second speed threshold. As a basis for stopping: if the available ground speed does not exceed If the trajectory point is in a stationary state, it is determined to be in a navigating state; otherwise, it is determined to be in a navigating state.

[0067] This applies to scenarios where the AIS message does not report a navigation status code, the status code is "underway" (0) but the vessel is actually moored, and the status code is another non-moored value (such as special status codes like values ​​2-4, which this method treats as non-moored status indications). In these cases, a stricter threshold (e.g., knot 1.0) is used, requiring the vessel's speed to drop to extremely low levels before it is determined to be moored, preventing the misjudgment of a slowly drifting vessel as moored due to missing status information.

[0068] State conflict detection and docking status joint determination form a two-level determination system. The two levels of determination are executed sequentially, with state conflict detection being executed first and its output serving as one of the inputs for joint determination.

[0069] The responsibilities of the two are clearly defined: state conflict detection is only responsible for "state coding credibility assessment" (outputting "credible" or "untrustworthy"), and does not directly generate berthing / navigation state labels; the joint berthing state determination is based on this credibility assessment result, combined with the available speed, to generate the final binary state label. This separation of responsibilities makes the decision logic of each level clear and independent, avoiding the mixing of multiple judgment conditions in the same logical branch.

[0070] After the aforementioned berthing status determination is completed, in step S112, the status label (berthing status or navigation status) of each trajectory point is determined based on the berthing status determination result. When a trajectory point is determined to be in a berthing state and its preceding trajectory point is determined to be in a navigation state, the ship is determined to have transitioned from a navigation state to a berthing state, a new berthing segment is initiated, and the trajectory point is added as the first berthing point of the new berthing segment. For the first trajectory point in the trajectory point series, if it is determined to be in a berthing state, a new berthing segment is also initiated. Accordingly, during the traversal of the trajectory point series, the current berthing segment status flag is updated accordingly when a berthing segment begins or ends.

[0071] Once a berthing segment is opened, subsequent berthing points will be continuously added to the current berthing segment.

[0072] During the accumulation of berthing segments, vessels may experience brief periods of navigation within the port due to reasons such as shifting berths, tugboat pushing, or cable adjustments. If the berthing segment ends immediately upon each occurrence of a navigation segment, a complete berthing event will be incorrectly divided into multiple short berthing segments. Therefore, during the accumulation of the current berthing segment, consecutive navigation points are counted. Whenever a trajectory point determined to be in a navigation segment appears within the current berthing segment, the consecutive navigation point counter is incremented by 1; if the navigation segment trajectory point is identified as a flypoint and discarded after passing through the navigation segment flypoint filter, this point is not counted in the consecutive navigation point count; if a trajectory point determined to be in a berthing segment appears within the current berthing segment, the consecutive navigation point counter is reset to zero.

[0073] The current berthing segment ends under the following three circumstances: (1) The number of consecutive waypoints exceeds the interruption confirmation threshold. When the number of consecutive navigation points within the current berthing segment exceeds the preset navigation interruption confirmation threshold When the time comes, the berthing section ends. In one implementation, .

[0074] (2) Time interval timeout As described in the aforementioned time continuity detection step, if there is an unfinished berthing segment and the time interval between adjacent trajectory points exceeds the first maximum allowable time interval, then the berthing segment is terminated.

[0075] (3) Handling of the end of the traversal After traversing all trajectory points, if there are still unfinished parking segments, output them as the last parking segment and proceed to the subsequent validity verification process.

[0076] After the berthing phase ends, the final berthing phase is determined. The validity of the final berthing phase is then verified by calculating its berthing duration. ,in, The timestamp of the first trajectory point within the ended berthing segment. The timestamp of the last track point within the final berthing segment. If the number of track points within the final berthing segment is less than the preset minimum number of berthing points. Or the berthing time is less than the preset minimum berthing time. If the event fails, the berthing segment is determined not to constitute a valid berthing event and is discarded. In one implementation, , Minutes. Through the aforementioned berthing segment extraction and confirmation mechanism, and by verifying the validity of both the number of points and the duration, false berthing segments caused by AIS signal noise, brief deceleration, etc., are eliminated. Validated berthing segments are retained for subsequent port matching and berthing record generation.

[0077] In AIS trajectory data, due to ionospheric interference, multipath effects, or equipment malfunctions, the positions of some trajectory points may drastically change (i.e., flypoints), causing them to deviate from the actual ship track by several kilometers or even tens of kilometers. If such flypoints are incorrectly added to a berthing segment during the accumulation process, the spatial range of the berthing segment will be abnormally expanded, causing the spatial representative point (median center) of the berthing segment to deviate from the actual berthing location, affecting the accuracy of subsequent port matching.

[0078] This method introduces a spatial continuity flypoint filtering mechanism before adding a berthing point to the current berthing segment. In one embodiment, before adding the berthing point to the current berthing segment, a first spatial distance (calculated using the aforementioned Haversine formula) between the berthing point and the previously added trajectory point within the current berthing segment is calculated. If the first spatial distance is greater than the preset maximum allowable distance within the berthing segment... If the trajectory point is determined to be a flypoint within the parking segment, it will not be added to the current parking segment; otherwise, it will be added to the current parking segment. In one implementation, Meters. The physical meaning of this distance threshold is: during normal berthing, the spatial position of adjacent trajectory points should remain stable within the port area. Even if shifting occurs within the port, the displacement between adjacent points is usually within a range of several hundred meters to one or two kilometers. If the distance between adjacent berthing points exceeds 3000 meters, it is highly likely to be an anomaly caused by GPS jumps or signal drift.

[0079] After the berthing phase ends, the vessel enters the navigation phase. During the accumulation of data in the navigation phase, flypoints may also occur due to GPS signal anomalies. Unlike flypoints in the berthing phase, flypoints in the navigation phase typically have a larger spatial displacement (potentially reaching tens of kilometers) and are accompanied by extremely abnormal speed estimates, requiring judgment based on kinematic plausibility.

[0080] In one embodiment, the method further includes: using the first navigation point after the end of the berthing segment as a reference point, calculating a second spatial distance and time difference between subsequent navigation points and the current reference point, and then calculating an estimated speed; if the second spatial distance is greater than a preset flight point distance threshold... Furthermore, the estimated velocity is greater than the preset flying point estimated velocity threshold. If the condition is met, the waypoint is determined to be a flight point for the flight segment and is discarded; otherwise, the waypoint is used as the new reference point.

[0081] The meaning of this judgment logic is as follows: During a normal navigation segment, the estimated speed between two adjacent track points should remain within a reasonable range consistent with the ship's actual speed. If a point is extremely far from the reference point and its estimated speed far exceeds the ship's normal navigation capability, then this track point is highly likely to be a flypoint caused by a GPS jump. When this track point passes the detection (i.e., either the distance or speed is within a reasonable range), it is used as the new reference point, allowing the reference point to gradually advance as the ship navigates normally. This ensures that flypoint detection is always based on the nearest reliable track point, rather than being fixed at the first navigation point after the berthing segment ends.

[0082] Once a trajectory point is identified as a flight point within a navigation segment, it is discarded. This trajectory point is not added to the current navigation segment, not included in the speed statistics set, not counted in the AIS trajectory cumulative distance, and not included in the valid navigation count—that is, the continuous navigation point count in the aforementioned parking segment extraction step. Regarding continuous navigation point counting, the counter increments by 1 when the trajectory point is identified as being in a navigation state and decrements by 1 when it is identified as a flight point, resulting in a net change of zero, equivalent to the trajectory point never appearing. When a navigation point is used as a new reference point, the spatial distance between it and the previous reference point is accumulated to the AIS trajectory cumulative distance, and its speed value is added to the navigation speed statistics set.

[0083] In one implementation, rice, meters per second (approximately 39 knots). The above values ​​align with the actual sailing capabilities of the vast majority of commercial vessels, effectively identifying extreme anomalies while avoiding misjudging vessels sailing at normal high speeds.

[0084] The navigation segment flypoint filtering and the berthing segment flypoint filtering form a two-layer flypoint filtering system: the berthing segment flypoint filtering is based on an absolute threshold of spatial distance (a single point deviating from the berthing cluster by more than...). The system detects and removes outliers within the berthing segment; the navigation segment flypoint filtering detects and removes outliers based on kinematic rationality (dual conditions of distance and speed). Both systems target flypoint characteristics under different motion states, with clear division of labor and no interference between them, jointly ensuring the quality of trajectory data and avoiding the negative impact of flypoints on the geometric center of the berthing segment, the accuracy of port matching, and the navigation segment distance statistics.

[0085] Through the aforementioned steps of berthing segment extraction and confirmation, valid berthing segments are obtained. Each berthing segment contains a set of trajectory points, representing a berthing event of a ship at a certain geographical location. However, the berthing segment itself only contains latitude and longitude coordinates and does not yet possess semantic information, i.e., which port the berthing occurred in. Step S114 spatially matches each berthing segment with known ports in the port database, transforming the berthing segment into a structured berthing record.

[0086] Before port matching, a spatial representative point is first determined for each berthing segment, i.e., a latitude and longitude coordinate point represents the geographical location of the entire berthing segment. In one implementation, the spatial representative point is the median center of all trajectory points within the corresponding final berthing segment. The latitude of the spatial representative point is the median of the latitude values ​​of all trajectory points within that final berthing segment, and the longitude of the spatial representative point is the median of the longitude values ​​of all trajectory points within that final berthing segment. The advantage of using the median center instead of the mean center is that: during berthing, ships may shift berths within the port (e.g., from berth A to berth B), generating trajectory points that cross waterways. The mean center, influenced by these shifting trajectory points, will shift towards the waterway, potentially deviating from the actual berthing position or even falling into the waterway between two berths, leading to port matching errors. The median center is not sensitive to extreme values ​​and always falls within the area with the highest trajectory point density, ensuring the accuracy of port matching.

[0087] The port database is queried using the coordinates of a spatial representative point. The port database contains at least the standard name and center point latitude and longitude coordinates of each port. Within the first or second matching radius, multiple ports may be matched. In this case, the method selects the port closest to the spatial representative point as the matching result, i.e., it calculates the great circle distance between the spatial representative point and the center point of each port, and selects the port with the smallest distance as the berthing port for that final berthing segment. This "nearest priority" strategy is based on the fact that the spatial representative point of the berthing segment reflects the geometric center of the ship's actual berthing position, and the port closest to this center is most likely the port where the ship will actually berth. The differentiated design of the two-level radius realizes a "berth priority, anchorage fallback" matching strategy: when the spatial representative point is closer to the port center ( Matching to berths, when the distance is far ( The system matches the berthing to anchorage, thus effectively distinguishing between the two berthing types. In one implementation, rice, The meters correspond to the typical spatial ranges for berthing at berths inside the harbor and for berthing at anchorages outside the harbor.

[0088] Through the aforementioned two-level matching mechanism, this method can complete the matching process using only the coordinates of the port's center point without relying on precise port boundary data, thus reducing the difficulty of data acquisition. The two-level radius can simultaneously adapt to ports of different spatial scales, automatically distinguishing berths and anchorages through different radii. The matching results include both port name and berthing type information, providing a richer semantic foundation for subsequent confidence assessment and voyage map construction.

[0089] If no port is matched within either the first or second matching radius, no berthing record is generated for the ended berthing segment. In one embodiment, if no port is matched within either the first or second matching radius, the ended berthing segment is marked as unknown, and a corresponding unknown node record is generated. The unknown node record includes at least the berthing time, spatial location, and berthing confidence of the ended berthing segment to preserve the vessel's berthing information in non-port areas (such as offshore platforms, fishing grounds, or unlisted small docks), avoiding the loss of trajectory information due to the direct discarding of the berthing segment because no port is matched. Simultaneously, the unknown node record is not involved in voyage map construction or included in port berthing statistics to avoid contaminating the voyage map and port statistics data with unknown nodes.

[0090] Through the aforementioned port matching steps, each valid final berthing segment has been matched to its corresponding port of call and converted into a berthing record. However, in actual shipping scenarios, a vessel's berthing process at the same port may be split into multiple adjacent berthing records due to reasons such as in-port shifting (from berth A to berth B), anchorage transfer (from anchorage to berth), prolonged AIS signal interruption, or brief departure (to seek shelter or give way and then return). If these situations are not merged, the same berthing at the same port will be incorrectly counted as multiple independent berthings, resulting in an inflated number of berthings and an underestimation of berthing duration, affecting the accuracy of subsequent voyage statistics, port service assessments, and trade network construction.

[0091] Step S116 introduces a three-dimensional merging mechanism. For adjacent docking records, when the following three conditions are met simultaneously, the adjacent docking records are merged into one docking record.

[0092] Condition 1 (Same Port): The two docking records correspond to the same port of call.

[0093] Condition 2 (Flight Constraint): The cumulative flight distance of the AIS trajectory between two adjacent stop records does not exceed the preset maximum merged flight distance. The cumulative voyage of the AIS trajectory is defined as the sum of the spatial distances between all adjacent trajectory points during the voyage from the departure of the previous berth record to the arrival of the current berth record, reflecting the actual distance traveled by the vessel between two berths. In one implementation, In the sea.

[0094] Condition 3 (Time Constraint): The time interval between two consecutive stop records does not exceed the preset maximum departure time. This time interval is defined as the difference between the arrival time of the current stop record and the departure time of the previous stop record. In one implementation, Hour.

[0095] When the above three-dimensional merging conditions are met, two adjacent berthing records are merged into one berthing record. In the merged berthing record: the port of call remains unchanged; the arrival time is taken from the arrival time of the previous berthing record (i.e., the earlier arrival time); the departure time is taken from the departure time of the next berthing record (i.e., the later departure time); the berthing duration is recalculated as the difference between the merged arrival time and departure time. Before merging, each berthing record corresponds to one or more berthing segments (newly generated berthing records correspond to only one berthing segment, and the berthing records after iterative merging correspond to the logical union of multiple berthing segments). The set of berthing segment trajectory points corresponding to the merged berthing record is taken as the union of the berthing segment trajectory point sets corresponding to the two original berthing records respectively. The navigation segment trajectory points between the berthing segments corresponding to the two original berthing records do not belong to any berthing segment and are not included in this union. If the merged record and the next adjacent record still meet the three-dimensional merging conditions, merging continues until the merging conditions are no longer met. If two adjacent docking records do not meet any of the above merging conditions, the two dockings are determined to be independent docking events and will not be merged. They will be output as independent docking port sequence elements respectively.

[0096] The aforementioned three-dimensional merging mechanism effectively distinguishes between short-term departures within the same port and actual voyages between different ports, preventing the merging of adjacent berth records that do not meet the merging criteria and improving the accuracy of voyage statistics. This mechanism also effectively avoids erroneous merging of berths at different ports in the "berth A → anchorage → berth B" scenario, and prevents the incorrect merging of voyages actually proceeding to the next port as a single berth, further enhancing the accuracy of voyage statistics.

[0097] After validity verification, port matching, and merging with other ports, structured berthing records have been generated for each berthing segment. However, the data quality varies among different berthing records. Some berthing records are generated based on complete and continuous AIS data, with berthing locations close to the port center and consistent status codes and speed information; others may have sparse AIS data, missing status codes, or berthing locations deviating from the port center. Downstream systems (such as voyage statistics, trade network construction, and port service assessment) require a quantifiable reliability indicator to filter, sort, or weight berthing records based on data quality.

[0098] In step S118, a parking confidence score is calculated for each parking record, and the confidence score of the parking record is quantitatively evaluated from the following four dimensions. For parking records generated by merging, each score is calculated based on the union of all trajectory points of the ending parking segment corresponding to the parking record; for parking records that have not been merged, each score is calculated based on the unique ending parking segment corresponding to the parking record.

[0099] (1) State support score State support rate reflects the "degree of consistency" at the state level among all trajectory points within the end-of-berth segment corresponding to a docking record. In one implementation, let the set of all trajectory points for the end-of-berth segment corresponding to a docking record be... Then the state support score The calculation method is as follows:

[0100] This refers to the proportion of all trajectory points corresponding to the end of the berthing segment in the berthing record that explicitly indicate a berthing status or a speed not exceeding the second speed threshold, out of all trajectory points. The score range is [insert range here]. The higher the score, the more consistently the trajectory points corresponding to the docking records support the "parking" state determination.

[0101] (2) Score for parking duration

[0102] Berthing duration reflects the time span of a berthing event. It is the difference between departure time and arrival time.

[0103] Parking duration score The calculation method is as follows:

[0104] in, As a preset base duration, in one implementation, Hours. A score of 1.0 is awarded when the berthing time is 2 hours or more; for berthing time less than 2 hours, the score increases linearly with the berthing time (e.g., 0.5 for 1 hour and 0.25 for 0.5 hours).

[0105] (3) Port matching distance score The port matching distance reflects the proximity between the spatial representative point of the ending berthing segment corresponding to the berthing record and the matched port center point. For a berthing record generated by merging, it may correspond to multiple ending berthing segments, each with its own port matching distance. In one implementation, the port matching distance score of each berthing segment is calculated, and the highest score (corresponding to the closest port matching distance) is taken as the port matching distance score of the berthing record.

[0106] Port matching distance score for a single end berthing segment The calculation method is as follows: If in the first matching radius If the internal match is successful, then =1.0; If only in the second matching radius If the internal match is successful, then ,in, The great circle distance between the spatial representative point and the port center point.

[0107] (4) Trajectory continuity score

[0108] Trajectory continuity reflects the uniformity of temporal sampling of AIS data across all berthing segments corresponding to a berthing record. For the set of trajectory points across all berthing segments corresponding to a berthing record, the trajectory continuity score is calculated. The calculation method is as follows:

[0109] in, The maximum time interval between adjacent trajectory points within all the ending parking segments corresponding to the parking record.

[0110] In one implementation, the parking confidence level The calculation method is a weighted average of the four scores:

[0111] in, , , , These are the weighting coefficients corresponding to the four scores, and In one implementation, all four factors have equal weights, each being 0.25.

[0112] After calculating the berthing confidence score, a berthing port sequence is output. Each berthing record in the sequence must include at least the port of call, arrival time, departure time, berthing duration, and berthing confidence score. The berthing duration can be calculated from the difference between the arrival and departure times, but it is output as an independent field for direct use by downstream systems. The berthing confidence score, as an independent quantitative indicator, allows downstream systems to filter, sort, or trigger manual review of berthing records based on a confidence threshold, thereby improving the data quality of voyage statistics and trade network construction.

[0113] In one implementation, a quality level is assigned to each docking record before outputting the docking port sequence. The quality rating is based on the berthing confidence level. Determined according to the following rules: If If the quality level is Level A, it indicates that the docking event is highly reliable; if If the quality level is Level B, it indicates that the docking event has a high degree of reliability; if If the quality level is Level C, it indicates that the reliability of the docking event is average; if If the event is rated Level A or Level B, the quality level is Level D, indicating that the credibility of the docking event is low and manual review is recommended. Through this classification, downstream systems can differentiate the processing of docking records based on the quality level. For example, Level A and Level B events can be directly used for voyage statistics and trade network construction, while Level D events can be excluded or trigger a review process.

[0114] Through the aforementioned steps, the ship's port call sequence has been obtained. However, the port call sequence only indicates "which ports the ship calls at," not the navigational connections between ports, i.e., which port the ship departs from, how long the voyage takes, and how many miles it travels to reach the next port. In applications such as shipping history analysis, trade network construction, and route efficiency evaluation, it is necessary not only to know the ship's port calls but also to understand the ship's complete navigation process between ports. In existing technologies, voyage information extraction is usually performed separately from port call identification; ports are identified first, and then voyage information is calculated separately. This separate processing method has the following problems: First, voyage information calculation requires re-traversing the trajectory data, increasing computational overhead; second, the data association between port call identification and voyage information is easily broken, leading to errors in the correspondence between voyage edge attributes and port records; third, there is a lack of a unified data structure to represent the complete voyage map of the ship.

[0115] This method constructs a voyage map simultaneously during port identification. The voyage map is a directed graph. The form of organization, in which, For the collection of port nodes, This is a set of voyage edges. Each directed voyage edge points from the previous port node to the next port node, representing a complete voyage from one port to the next.

[0116] Each directed voyage edge must include at least the departure port, arrival port, departure time (departure time of the previous berth record), arrival time (arrival time of the current berth record), cumulative AIS track distance, travel time (difference between arrival and departure times), average speed (distance divided by travel time), and maximum speed (the maximum available ground speed among all track points within the voyage segment). The cumulative AIS track distance is the sum of the spatial distances between all adjacent track points in the voyage segment from the departure of the previous berth record to the arrival of the current berth record, reflecting the actual path length of the vessel's voyage, rather than the straight-line distance between port centers.

[0117] In one implementation, during the traversal of the trajectory point sequence, a speed statistics set is maintained to accumulate the available ground speeds of trajectory points determined to be in a navigation state, for use in calculating the average and maximum speeds of the current navigation segment. The speed statistics set is cleared in the following situations: when entering a new berthing segment; when a berthing segment is discarded due to insufficient points or duration; after a berthing segment is validated and a berthing record is generated; and when the time interval between adjacent trajectory points times out, triggering segmentation processing. Through this lifecycle management, the speed statistics set always contains only the speed data of the current navigation segment, avoiding contamination of the current segment's statistics by data from the previous navigation segment, and ensuring the accuracy of the speed attributes of the voyage edges in the voyage map. The construction of the voyage map is synchronized with the port identification process. During the port sequence generation process, whenever a new berthing record is confirmed (including the final berthing record after merging with the same port), a corresponding voyage edge is automatically generated based on the berthing record and the previous berthing record. This synchronous construction method avoids the extra overhead of re-traversing the trajectory data to calculate the voyage information after the port of call is identified, and ensures the consistency of data association between the port of call record and the voyage edge.

[0118] A voyage map organized in the form of a directed graph can intuitively represent the navigational connections between ships in various ports, providing a structured data foundation for downstream applications such as route analysis, efficiency assessment, and trade network construction. It can be used in the following application scenarios: (1) Route preference analysis: By statistically analyzing the voyage frequency of ships between different port nodes, the commonly used routes of ships are identified; (2) Navigation efficiency assessment: The average speed is calculated by accumulating the distance and time on the AIS track of the voyage side, and the navigation efficiency of the ship on different routes is assessed. (3) Turnover efficiency analysis: Combine the berthing time of port nodes and the sailing time of voyage side to analyze the complete voyage cycle of the ship; (4) Trade network construction: Based on port nodes and voyage edges, construct a trade network map of ships to provide a data foundation for the analysis of bulk commodity trade flow; (5) Carbon emission estimation: Based on the cumulative distance and average speed of the AIS trajectory along the voyage, combined with the ship type and deadweight tonnage, the carbon emission of the voyage is estimated.

[0119] In one implementation, this method abstracts the ship AIS historical port identification process into a five-layer model architecture, from bottom to top: The first layer, the AIS observation layer, receives and standardizes the original AIS messages, outputting a time-ordered sequence of trajectory points; the second layer, the data reliability layer, performs velocity completion, time continuity detection, and flypoint filtering on the trajectory points, outputting a trajectory sequence with enhanced reliability; the third layer, the temporal state identification layer, determines whether each trajectory point belongs to a sailing state or a berthing state, outputting a state label sequence; the fourth layer, the berthing event identification layer, extracts continuous berthing segments from the state label sequence, confirms the validity of berthing events through dual constraints of point count and duration, and outputs a confirmed set of berthing segments; the fifth layer, the port and voyage inference layer, matches berthing segments with the port database, performs port merging, calculates berthing confidence, and simultaneously constructs a voyage map, finally outputting the port sequence and voyage map. In the five-layer architecture described above, intermediate results are exchanged between layers through explicit data interfaces. Each layer receives the output of the previous layer, processes it, and then passes it to the next layer. Each layer uses deterministic rules to complete state transitions or data filtering, without relying on external model training or historical data accumulation. This layered architecture allows each layer to be tested and optimized independently; new data processing rules can be implemented independently within the corresponding layer without affecting other layers.

[0120] This method completes velocity completion, state conflict detection, berthing status determination, and berthing segment extraction during the traversal of trajectory points. After traversal, it sequentially performs port matching, port merging, confidence assessment, and voyage map construction. Through the sequential execution and data transmission of each step, it achieves a complete transformation from raw AIS messages to a structured port berthing sequence. Compared to existing technologies that rely on single information source determination, single time threshold detection, single port matching radius, and separate processing of port berthing identification and voyage information, this method solves the problem of misjudgment in scenarios with delayed state code updates and missing information through a two-level determination system composed of state conflict detection and berthing status joint determination. It addresses the segmentation requirement due to significant differences in data sampling characteristics between navigation and berthing states through a dual-threshold time interval detection mechanism. The two-level matching radius enables automatic differentiation between berth berthing and anchorage berthing. Confidence assessment upgrades the port berthing identification result from a binary judgment to a reliable quantifiable system. Intermediate results are transmitted between steps through clear data interfaces, reducing misjudgments caused by AIS data noise and anomalies, and improving the accuracy and robustness of port berthing identification.

[0121] Example 2 This disclosure provides a historical port of call identification device 1000 based on ship AIS trajectory data. The identification device 1000 is used to perform, for example... Figure 1 The method shown is for identifying historical ports of call based on ship AIS trajectory data.

[0122] Specifically, such as Figure 2 As shown, the identification device 1000 includes: Standardization module 1002 is used to acquire the raw AIS messages of the ship and standardize the raw AIS messages into a time-ordered sequence of trajectory points. , where each trajectory point It must include at least latitude, longitude, ground speed, navigation status code, and timestamp; The speed completion module 1004 is used to complete the trajectory points that are missing the ground speed, so that each trajectory point has a usable ground speed. The continuity detection module 1006 is used to detect if there is an unfinished berthing segment. The time interval between the trajectory points exceeds the first maximum allowed time interval. If the berthing segment ends, then the berthing segment ends; if there are no unfinished berthing segments at present, then... The time interval between the trajectory points exceeds the second maximum allowed time interval. At that time, navigation segmentation is performed, in which... ; The conflict detection module 1008 is used to determine whether the available ground speed of the trajectory point does not exceed a second speed threshold when the navigation state code of the trajectory point indicates a parking state and the available ground speed of the trajectory point exceeds a state conflict speed threshold. This serves as the basis for determining whether the trajectory point is in a stationary state; The state determination module 1010 is used to determine the state of each trajectory point when the navigation state code indicates a stationary state and the available ground speed does not exceed a first speed threshold. The trajectory point is determined to be in a stationary state; when the navigation status code is missing or indicates the navigation status, and the available ground speed does not exceed... The trajectory point is determined to be in a stationary state, whereby... ; The berthing segment extraction module 1012 is used to: initiate a new berthing segment when a trajectory point is determined to be in a berthing state and its preceding trajectory point is determined to be in a navigation state; continuously add berthing points to the current berthing segment, wherein the berthing points are the trajectory points determined to be in a berthing state; during the accumulation process of the current berthing segment, count the consecutive navigation points that appear, wherein the navigation points are the trajectory points determined to be in a navigation state; when the number of consecutive navigation points in the current berthing segment exceeds the navigation interruption confirmation threshold, end the berthing segment to obtain an ended berthing segment; and verify the validity of the ended berthing segment. If the number of trajectory points in the ended berthing segment is less than the minimum number of berthing points or the berthing duration is less than the minimum berthing duration, discard the ended berthing segment. Port matching module 1014 is used to query the port database using the spatial representative point of the end berthing segment that has been verified for validity, within a first matching radius. The system searches for a matching port within the first matching radius. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and the ending berthing segment is recorded as a berthing record. If a match fails within the first matching radius, the system searches for a matching port within the second matching radius. The system searches for a matching port within the specified range. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and this ending berthing segment is recorded as a berthing record. ; The record merging module 1016 is used to merge adjacent berthing records corresponding to the same port of call into one berthing record when the following merging conditions are met: the cumulative AIS trajectory from the departure of the previous berthing record to the arrival of the current berthing record does not exceed the maximum merged trajectory, and the difference between the arrival time of the current berthing record and the departure time of the previous berthing record does not exceed the maximum departure time. The sequence output module 1018 is used to calculate the berthing confidence based on the state support rate, berthing duration, port matching distance and trajectory continuity of the trajectory points within the berthing segment corresponding to the berthing record; and output the berthing port sequence, wherein each berthing record in the berthing port sequence includes at least the berthing port, arrival time, departure time and the berthing confidence.

[0123] The hardware structure of the identification device 1000, implemented using a processor-based hardware approach, can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.

[0124] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1100 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 2The connection is represented by only one line, but this does not mean that there is only one bus or one type of bus.

[0125] Any process or method description in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain. The processor performs the various methods and processes described above. For example, the method embodiments of this disclosure may be implemented as software programs tangibly contained in a machine-readable medium, such as memory. In some embodiments, part or all of the software program may be loaded and / or installed via memory and / or a communication interface. When the software program is loaded into memory and executed by the processor, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform one of the methods described above by any other suitable means (e.g., by means of firmware).

[0126] The logic and / or steps represented in the flowchart or otherwise described herein may be specifically implemented in any readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-based system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0127] For the purposes of this specification, a "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use in or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM). Furthermore, a readable storage medium can even be paper or other suitable media on which a program can be printed, since a program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in memory.

[0128] It should be understood that various parts of this disclosure can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0129] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0130] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a single processing module, or each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a readable storage medium. The storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0131] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. A method for identifying historical ports of call based on ship AIS trajectory data, characterized in that, The method includes: Obtain the raw AIS messages of the vessel and standardize them into a time-ordered sequence of trajectory points. , where each trajectory point It must include at least latitude, longitude, ground speed, navigation status code, and timestamp; The trajectory points that lack the required ground speed are filled in to ensure that each trajectory point has a usable ground speed. If there is an unfinished parking segment, then when the time interval between adjacent trajectory points exceeds the first maximum permissible time interval... When the time interval between adjacent trajectory points exceeds the second maximum allowable time interval, the berthing segment ends; if there are no unfinished berthing segments, the berthing segment ends when the time interval between adjacent trajectory points exceeds the second maximum allowable time interval. At that time, navigation segmentation is performed, in which... ; When the navigation status code of the trajectory point indicates a stationary state, and the available ground speed of the trajectory point exceeds the state conflict speed threshold, the system checks whether the available ground speed of the trajectory point does not exceed a second speed threshold. This serves as the basis for determining whether the trajectory point is in a stationary state; For each of the trajectory points, when the navigation status code indicates a stationary state and the available ground speed does not exceed a first speed threshold... The trajectory point is determined to be in a stationary state; when the navigation status code is missing or indicates the navigation status, and the available ground speed does not exceed... The trajectory point is determined to be in a stationary state, whereby... ; When a trajectory point is determined to be in a berthing state and its preceding trajectory point is determined to be in a sailing state, a new berthing segment is initiated, and berthing points are continuously added to the current berthing segment. The berthing points are the trajectory points determined to be in a berthing state. During the accumulation process of the current berthing segment, consecutive sailing points are counted. The sailing points are the trajectory points determined to be in a sailing state. When the number of consecutive sailing points in the current berthing segment exceeds the sailing interruption confirmation threshold, the berthing segment is terminated, resulting in an terminated berthing segment. The validity of the terminated berthing segment is confirmed. If the number of trajectory points in the terminated berthing segment is less than the minimum number of berthing points or the berthing duration is less than the minimum docking duration, the terminated berthing segment is discarded. The port database is queried using the spatial representative point of the ended berthing segment that has been verified for validity, within the first matching radius. The system searches for a matching port within the first matching radius. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and the ending berthing segment is recorded as a berthing record. If a match fails within the first matching radius, the system searches for a matching port within the second matching radius. The system searches for a matching port within the specified range. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and this ending berthing segment is recorded as a berthing record. ; When the following merging conditions are met, adjacent berthing records corresponding to the same port of call will be merged into one berthing record: the cumulative AIS trajectory from the departure of the previous berthing record to the arrival of the current berthing record does not exceed the maximum merged trajectory, and the difference between the arrival time of the current berthing record and the departure time of the previous berthing record does not exceed the maximum departure time. The berthing confidence is calculated by weighting the state support rate of the trajectory points within the berthing segment corresponding to the berthing record, the berthing duration, the port matching distance, and the trajectory continuity. The berthing port sequence is output, and each berthing record in the berthing port sequence contains at least the berthing port, the arrival time, the departure time, and the berthing confidence.

2. The method according to claim 1, characterized in that, The missing ground speed of the trajectory points is filled in to ensure that each trajectory point has a usable ground speed, including: if the ground speed of the current trajectory point is not empty, then the ground speed value is used as the usable ground speed of the current trajectory point; if the ground speed of the current trajectory point is empty, then the nearest non-empty ground speed value before the current trajectory point is used as the usable ground speed of the current trajectory point.

3. The method according to claim 1, characterized in that, Adaptive thresholding is used, and ,in, This is a set of historical speed samples for the vessel, consisting of historical trajectory points whose ground speed exceeds the speed screening threshold. Indicates the 20th percentile. This is the proportionality coefficient. This is the upper limit protection value. This is the lower limit protection value.

4. The method according to claim 1, characterized in that, Before adding the mooring point to the current mooring segment, calculate the first spatial distance between the mooring point and the previously added trajectory point in the current mooring segment. If the first spatial distance is greater than the maximum allowable distance in the mooring segment, the trajectory point is determined to be a fly point in the mooring segment and is not added to the current mooring segment; otherwise, the mooring point is added to the current mooring segment.

5. The method according to claim 1, characterized in that, The method further includes: taking the first navigation point after the end of the berthing segment as a reference point, calculating the second spatial distance and time difference between the subsequent navigation points and the current reference point, and then calculating the estimated speed; if the second spatial distance is greater than the flypoint distance threshold and the estimated speed is greater than the flypoint estimated speed threshold, then the navigation point is determined to be a flight point of the navigation segment and is discarded; otherwise, the navigation point is used as a new reference point.

6. The method according to claim 1, characterized in that, The spatial representative point is the median center of all trajectory points within the corresponding final berthing segment. The latitude of the spatial representative point is the median of the latitude values ​​of all trajectory points within the final berthing segment, and the longitude of the spatial representative point is the median of the longitude values ​​of all trajectory points within the final berthing segment.

7. The method according to claim 1, characterized in that, The port matching distance score is calculated as follows: when a match is successfully made within the first matching radius, the port matching distance score is full; when a match is successfully made only within the second matching radius, the port matching distance score decreases as the distance between the corresponding spatial representative point and the port center increases.

8. The method according to claim 1, characterized in that, The trajectory continuity score The calculation method is as follows: ,in, The maximum time interval between adjacent trajectory points within all the ending parking segments corresponding to the parking record.

9. The method according to claim 1, characterized in that, The method further includes: constructing a voyage map based on the port of call sequence, wherein the voyage map consists of port of call nodes and directed voyage edges, and each directed voyage edge points from the previous port of call node to the next port of call node.

10. A historical port of call identification device based on ship AIS trajectory data, characterized in that, The device includes: The standardization module is used to acquire the raw AIS messages of the vessel and standardize the raw AIS messages into a time-ordered sequence of trajectory points. , where each trajectory point It must include at least latitude, longitude, ground speed, navigation status code, and timestamp; The speed completion module is used to complete the trajectory points that are missing the ground speed, so that each trajectory point has a usable ground speed; The continuity detection module is used to detect if there is an unfinished berthing segment. The time interval between the trajectory points exceeds the first maximum allowed time interval. If the berthing segment ends, then the berthing segment ends; if there are no unfinished berthing segments at present, then... The time interval between the trajectory points exceeds the second maximum allowed time interval. At that time, navigation segmentation is performed, in which... ; The conflict detection module is used to determine whether the available ground speed of a trajectory point does not exceed a second speed threshold when the navigation state code of the trajectory point indicates a stationary state and the available ground speed of the trajectory point exceeds a state conflict speed threshold. This serves as the basis for determining whether the trajectory point is in a stationary state; The status determination module is used to determine the status of each trajectory point when the navigation status code indicates a stationary state and the available ground speed does not exceed a first speed threshold. The trajectory point is determined to be in a stationary state; when the navigation status code is missing or indicates the navigation status, and the available ground speed does not exceed... The trajectory point is determined to be in a stationary state, whereby... ; The berthing segment extraction module is used to: initiate a new berthing segment when a trajectory point is determined to be in a berthing state and its preceding trajectory point is determined to be in a navigation state; continuously add berthing points to the current berthing segment, where the berthing points are the trajectory points determined to be in a berthing state; during the accumulation process of the current berthing segment, count the consecutive navigation points that appear, where the navigation points are the trajectory points determined to be in a navigation state; when the number of consecutive navigation points in the current berthing segment exceeds the navigation interruption confirmation threshold, end the berthing segment to obtain an ended berthing segment; and verify the validity of the ended berthing segment. If the number of trajectory points in the ended berthing segment is less than the minimum number of berthing points or the berthing duration is less than the minimum berthing duration, discard the ended berthing segment. The port matching module is used to query the port database using the spatial representative point of the final berthing segment that has been validated, within a first matching radius. The system searches for a matching port within the first matching radius. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and the ending berthing segment is recorded as a berthing record. If a match fails within the first matching radius, the system searches for a matching port within the second matching radius. The system searches for a matching port within the specified range. If a match is found, the port closest to the spatial representative point is recorded as the port of call for the ending berthing segment, and this ending berthing segment is recorded as a berthing record. ; The record merging module is used to merge adjacent berthing records corresponding to the same port of call into one berthing record when the following merging conditions are met: the cumulative AIS trajectory from the departure of the previous berthing record to the arrival of the current berthing record does not exceed the maximum merged trajectory, and the difference between the arrival time of the current berthing record and the departure time of the previous berthing record does not exceed the maximum departure time. The sequence output module is used to calculate the berthing confidence based on the state support rate, berthing duration, port matching distance and trajectory continuity of the trajectory points within the berthing segment corresponding to the berthing record; and output the berthing port sequence, wherein each berthing record in the berthing port sequence includes at least the berthing port, arrival time, departure time and the berthing confidence.