Self-adaptive ship staying identification method and system based on sliding space-time window

Through the adaptive ship retention recognition method based on sliding space-time windows and Geohash grids, parameters are dynamically adjusted, and the problem of poor dependence on manual labeled data in the existing technology is solved, efficient and accurate identification of ship retention behavior in different port environments is achieved, and the efficiency and safety of port management are improved.

CN120496364APending Publication Date: 2025-08-15NAT SPACE SCI CENT CAS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510759365.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing port ship retention behavior identification methods have problems such as strong parameter dependence, large demand for manual labeling data, poor generalization ability and insufficient real-time performance. It is difficult to adapt to the complex changes in ship behavior in different port environments, resulting in limited accuracy and practicality of retention identification.

Method used

Adaptive ship stay recognition method based on sliding space-time windows is adopted. By calculating the average velocity and spatial range of the trajectory points within the set time window, combining the Geohash grid and DBSCAN method, the speed and distance threshold are dynamically adjusted to achieve efficient and accurate identification of different types of ships in different port environments.

Benefits of technology

The identification parameters can be adjusted adaptively without manual labeling of data, which significantly improves the accuracy and robustness of staying behavior, adapts to complex and changeable port environments, supports the fine identification of multiple types of ships and diversified staying behaviors, and improves the efficiency and safety of port management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120496364A_ABST
    Figure CN120496364A_ABST
Patent Text Reader

Abstract

The invention provides a self-adaptive ship staying identification method and system based on a sliding space-time window. The method comprises the following steps: identifying ship track points in a set time window; calculating the average speed of all the track points in the window; if the average speed is lower than a first set speed threshold value, whether the space range of the track points meets the parking condition or not is judged; when the berthing condition is met, the berthing center point is set as the average position of the track points, whether the follow-up track points are still within the berthing center range or not is judged one by one till the track points not within the berthing center range are found, and the track points before the track points are the ship berthing points. The method has the advantages that the staying behaviors of different types of ships in different port environments are efficiently and accurately recognized, and the universality and robustness of the method are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of ship behavior recognition, and specifically relates to an adaptive ship stop recognition method and system based on a sliding spatiotemporal window. Background Art

[0002] Maritime transport, the artery of the global economy, carries over 80% of global international trade. Ports, as core nodes connecting sea and land supply chains, are both hubs for the flow of goods and strategic pillars of national competitiveness. However, with surging global trade volumes, increasing pressure on carbon emissions, and rising labor costs, traditional port operations are facing efficiency bottlenecks and sustainability challenges. Against this backdrop, smart ports, centered around the Internet of Things, artificial intelligence, and automation technologies, have emerged. By leveraging driverless container trucks, intelligent loading and unloading systems, and real-time big data scheduling platforms, they are reshaping port operations, improving efficiency by over 30% while significantly reducing operating costs and carbon emissions. These ports are leading the global maritime industry into a new era of digital revolution.

[0003] Accurately identifying a vessel's rest status is the core foundation for building an efficient collaborative smart port system. In port operations, ships must seamlessly connect with quay cranes, power transmission and distribution systems, and logistics chains when berthing. Anchorage waiting status must be incorporated into channel scheduling priority decisions in real time. Traditional dynamic ship reporting mechanisms, which rely on manual input, are prone to subjective misjudgments or operational delays, leading to berth resource mismatches, energy waste, and operational chain breakages. More critically, while anchored or berthing, ships are subject to the dynamic influences of water flow, wind pressure, and mooring equipment, resulting in constant minor displacements and oscillations. These position drifts far exceed the stationary threshold of land vehicles, making it difficult for traditional static monitoring systems based on fixed coordinates to distinguish between a ship's "effective mooring" and "uncontrolled breakaway." This dynamic characteristic makes single sensors susceptible to interference from signal fluctuations, resulting in false reports of vessel occupancy or docking failures of loading and unloading equipment. By integrating visual perception, high-precision positioning compensation and multi-source data verification, smart ports construct a dynamic modeling algorithm for ship motion trajectories. This algorithm not only analyzes the real-time posture change patterns of the ship, but also simultaneously calibrates the deviations of manually reported data, thereby achieving stable judgment of the ship's status under complex environmental interference, providing a reliable basis for automated scheduling, and promoting the systematic upgrade of port operations from experience-driven to data-driven.

[0004] Currently, there are three main approaches for identifying ship stop behavior: methods based on ship motion feature constraints, clustering-based methods, and deep learning-based methods. Methods based on ship motion feature constraints filter stop events from AIS data using predefined threshold rules such as speed and heading stability. While these methods offer the advantages of logical transparency and computational efficiency, they are less adaptable to environmental disturbances (such as tidal drift) and complex operational scenarios (such as multi-vessel coordination), and are prone to misjudgment due to rigid rules. Clustering-based methods (such as spatiotemporal density clustering) exploit clustering patterns of trajectory points through unsupervised learning, enabling adaptive identification of unstructured stop areas. However, these methods face challenges such as parameter sensitivity and trajectory noise, making them particularly susceptible to intermittent motion interference during short loading and unloading or dynamic anchoring. Deep learning-based methods utilize models such as CNNs and GNNs to automatically identify stop points from trajectories. These methods can capture the nonlinear motion patterns of ship drift and oscillation, but they rely heavily on labeled data, have poor model interpretability, and have limited generalization capabilities in scenarios with small sample sizes or heterogeneous data. Summary of the Invention

[0005] The purpose of this application is to overcome the defects of the existing port ship stop behavior recognition process, such as strong parameter dependence, large demand for manually labeled data, poor generalization ability and lack of real-time performance.

[0006] To achieve the above objectives, this application proposes an adaptive ship stop recognition method based on a sliding spatiotemporal window, comprising:

[0007] The process of identifying the ship's trajectory points within the set time window is as follows:

[0008] Calculate the average speed of all track points in the window; if the average speed is lower than the first set speed threshold, determine whether the spatial range of the track points meets the mooring conditions; if the mooring conditions are met, set the mooring center point as the average position of the track points, and then determine whether the subsequent track points are still within the mooring center range one by one until a track point that is not within the mooring center range is found. The track point before this track point is the ship's mooring point;

[0009] The anchoring condition is: the maximum distance the ship moves within this time window is less than a set distance threshold;

[0010] The judgment condition for whether the subsequent trajectory point is still within the parking center range is: the distance between two adjacent trajectory points is less than the set distance threshold, and the distance from the subsequent point to the parking center point is also less than the set distance threshold;

[0011] Each time the window is slid, the first set speed threshold and the set distance threshold are dynamically set according to whether the window is located inside or outside the port.

[0012] As an improvement to the above method, the method further includes:

[0013] The ship's berthing point is determined as follows:

[0014] Determine whether the vessel is berthing, anchoring or non-berthing based on the geographical location of the track point;

[0015] For different types of stop types, different sliding window sizes are selected and checked point by point from the beginning and end of the trajectory segment. The inspection is based on the speed and heading characteristics of the trajectory points, combined with the number of trajectory points that meet the stop conditions in the trajectory segment, to determine whether these trajectory points are truly in the parked state.

[0016] As an improvement to the above method, the method for determining whether the vessel is berthed, anchored or non-berthed includes:

[0017] When the ship's anchorage point is outside the 6th level Geohash grid of the coastline, it is anchored;

[0018] When the ship's anchorage is within the 6th-level Geohash grid of the coastline and within the 7th-level Geohash grid of the coastline, it is considered berthing;

[0019] When a ship's anchorage point is within the 6th-level Geohash grid of the coastline and outside the 7th-level Geohash grid of the coastline, it is considered non-anchored.

[0020] As an improvement to the above method, for different types of dwell types, corresponding sliding windows and threshold parameters are selected, and checks are performed point by point from the beginning to the end of the trajectory segment, specifically including:

[0021] Perform the following checks starting from the beginning and end of the trajectory segment:

[0022] Within a window, the number of trajectory points that meet the following conditions is obtained: if the vehicle is berthing, the trajectory points within the trajectory segment whose speed is greater than the first set speed threshold and whose direction is less than the set port turning threshold are extracted, or the trajectory points whose speed is greater than the second set speed threshold and whose direction is less than the set port turning threshold are extracted; if the vehicle is anchoring, the trajectory points whose speed is greater than the third set speed threshold and whose direction change is less than the set port turning threshold are extracted;

[0023] If the number of trajectory points that meet the conditions is greater than half of the amount of trajectory point data in the window, the status of all trajectory points from the starting trajectory point to the last trajectory point that meets the conditions in the trajectory segment is changed to non-stop;

[0024] Slide the window forward and continue the above check from the last trajectory point that meets the conditions in the current trajectory segment until there is a trajectory segment that does not meet the above conditions. In this case, it is considered that starting from this trajectory point, the subsequent trajectory points are all stop points.

[0025] As an improvement to the above method, the second set speed threshold is 0.75 times the first set speed threshold; the third set speed threshold is 0.5 times the first set speed threshold.

[0026] As an improvement to the above method, the method further includes:

[0027] The ship's berthing point is determined as follows:

[0028] The DBSCAN method is used to calculate the density of the trajectory points, and the set density threshold is used to determine whether the trajectory point is a stop point;

[0029] When the track points are in the port, if more than a first set proportion of the track points in the first track segment determined as a stop are on the shore, and the stay time is greater than the first set time threshold, it is berthing; if less than a second set proportion of the track points are on the shore, and the stay time is greater than the second set time threshold, it is anchoring; otherwise, it is other types of stop and berthing;

[0030] When the track point is outside the port, it is anchored when the stay time is greater than the third set time threshold, otherwise it is other types of anchoring.

[0031] As an improvement to the above method, the method for determining whether a trajectory point is on the shore is:

[0032] Determine whether the trajectory point is within the Geohash grid of the level 6 coastline. If it is within the grid, it is on the coast, otherwise it is not on the coast.

[0033] As an improvement to the above method, the method for determining whether the window is inside or outside the port is as follows:

[0034] When the number of trajectory points in the window located inside the port is greater than the number of trajectory points located outside the port, the window is located inside the port, otherwise the window is located outside the port.

[0035] As an improvement to the above method, the method for determining whether a trajectory point is inside or outside the port is as follows:

[0036] When the level 6 Geohash grid to which the trajectory point belongs is within the predefined coastline Geohash set, the trajectory point is located inside the port, otherwise it is located outside the port.

[0037] The present application also provides an adaptive ship stop identification system based on a sliding spatiotemporal window, which is implemented based on the above method. The system includes:

[0038] The trajectory point identification module is used to identify the ship's trajectory points within a set time window. The process includes: calculating the average speed of all trajectory points in the window; if the average speed is lower than a first set speed threshold, determining whether the spatial range of the trajectory points meets the mooring condition; when the mooring condition is met, setting the mooring center point as the average position of the trajectory points, and then determining whether subsequent trajectory points are still within the mooring center range one by one until a trajectory point that is not within the mooring center range is found. The trajectory point before the trajectory point is the ship's mooring point; the mooring condition is that the maximum distance the ship moves within this time window is less than a set distance threshold; the determination condition for whether the subsequent trajectory point is still within the mooring center range is that the distance between two adjacent trajectory points is less than the set distance threshold, and the distance from the subsequent point to the mooring center point is also less than the set distance threshold;

[0039] The threshold facility module is used to dynamically set a first set speed threshold and a set distance threshold according to whether the window is located inside or outside the port each time the window is slid.

[0040] Compared with the prior art, the advantages of this application are:

[0041] 1. This application proposes a new spatio-temporal adaptive sliding window (STAW) method. This method does not require manual data annotation and can adaptively determine the window size, speed, heading, and spatial threshold based on trajectory data. It can achieve efficient and accurate identification of the stop behavior of different types of ships in different port environments, significantly improving the versatility and robustness of the method.

[0042] 2. This application innovatively introduces multi-level Geohash spatial encoding into the stop identification process, achieving efficient association between trajectory points and the port's spatial structure. By adopting a layered parameter adaptation strategy for different areas inside and outside the port, different types of stops, such as berthing and anchoring, are automatically distinguished, improving the spatial accuracy and adaptability of stop identification.

[0043] 3. To address the sliding window method's tendency to misjudge stop segment boundaries, this application designs two flexible secondary validation methods: one is an iterative correction based on adaptive thresholds and sliding windows, suitable for high-quality data; the other is a density validation method inspired by DBSCAN, suitable for complex mixed scenarios. This mechanism effectively improves the accuracy and robustness of stop point identification, supporting the precise recognition of multiple types of vessels and diverse stop behaviors.

[0044] The above innovations not only break through the traditional methods' reliance on manual labeling and parameter tuning, and improve the automation and intelligence level of functional area extraction, but also provide solid technical support and theoretical foundation for smart port construction and maritime big data applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 The figure shows the framework of the adaptive ship stop recognition method based on sliding spatiotemporal window;

[0046] Figure 2 The figure shows the uncorrected dwell recognition results (light colors represent dwell points);

[0047] Figure 3 Shown is a schematic diagram of the results of the quadratic dwell correction method inspired by DBSCAN;

[0048] Figure 4 Shown are coastlines with different levels of geohashing (level 7 on the left and level 6 on the right);

[0049] Figure 5 Shown are heat maps of the berthing paths of three major types of vessels (tugboats, cargo ships, and oil tankers) within the port. The top image shows vessels less than 50 meters in length, while the bottom image shows vessels longer than 50 meters. Tugboats assist other vessels in port operations, so their berthing points are widely distributed within the port area.

[0050] Figure 6 Shown are heat maps of anchorage track points for three major types of vessels: tugboats, cargo ships, and oil tankers. The top image shows vessels less than 50 meters in length, while the bottom image shows vessels longer than 50 meters. Cargo ships have a greater number of anchorage track points than oil tankers. Small oil tankers primarily anchor within the port area, likely serving as service vessels, providing supplies and other services to other vessels.

[0051] Figure 7 The figure shows a schematic diagram of the geohash spatial encoding scheme. This method recursively divides the Earth's surface into rectangular grids, assigning each grid a unique alphanumeric code. Each grid can be further subdivided. The longer the code length, the higher the spatial resolution and the finer the area represented. DETAILED DESCRIPTION

[0052] The technical solution of this application is described in detail below with reference to the accompanying drawings.

[0053] This invention aims to address existing issues in identifying ship stopovers in ports, such as strong parameter dependence, a high demand for manually annotated data, poor generalization, and insufficient real-time performance. Existing methods often rely on fixed thresholds or extensive manual annotation, making them difficult to adapt to the complex variations in ship behavior in diverse port environments. This limits the accuracy and practicality of stopover identification.

[0054] In order to solve the above problems, the present invention proposes an adaptive ship stop identification method and system based on a sliding spatiotemporal window. This method automatically extracts and adaptively adjusts the key parameters required for stop identification, such as speed threshold, direction threshold, etc., by deeply analyzing the spatiotemporal distribution characteristics of ship trajectory data, without relying on manual labeling. Specifically, the method uses sliding window technology to dynamically segment the ship trajectory, and accurately identifies the ship's stop behaviors such as anchoring and berthing by statistically analyzing the speed, position changes and stop duration within the window. In addition, for different port environments and ship types, the method can adaptively adjust parameters according to the actual data distribution, ensuring robustness and generalization capabilities in a variety of application scenarios. This method not only reduces the difficulty of manual intervention and parameter tuning, but also significantly improves the accuracy and efficiency of stop behavior identification, providing a solid data foundation for the subsequent port functional area division and intelligent management.

[0055] This invention can provide a solid data foundation and technical support for the construction and operation of smart ports. Through automated and intelligent stop behavior recognition, it not only improves the efficiency and safety of port management, but also provides key support for subsequent smart port application scenarios such as functional area division, ship scheduling optimization, and abnormal behavior warning, helping to promote the development of ports towards digital, intelligent, and refined management.

[0056] The method of this application relates to the principle of geohash coding. Figure 7 Geohash (as shown in Figure 1) is a spatial indexing method that encodes longitude and latitude into short alphanumeric strings, enabling efficient storage and querying of location data. It works by recursively dividing the Earth's surface into rectangular grids, assigning each grid a unique code. Longer codes indicate higher spatial resolution and finer-grained regions. This hierarchical structure supports fast spatial queries, scalable aggregation, and efficient spatial joins. In functional area mining, Geohash grids are used to organize ship track data, enabling efficient extraction of functional areas and real-time spatial matching of AIS tracks with coastline features.

[0057] like Figure 1 As shown, the present application provides an adaptive unsupervised method based on a sliding spatiotemporal window for identifying the stay behavior of ships near a port. The stay behavior of ships is divided into mooring and anchoring. In order to improve the accuracy of the stay recognition algorithm, the present invention first pre-processes the data (such as Figure 1The data used includes ship track data and coastline data, with the coastline data stored as a sequence of longitude and latitude. When processing the track data, track points are first grouped according to the ship's unique identifier (MMSI). Next, drift points in the track data are repaired to ensure data accuracy. Finally, the coastline data and processed track data are stored as sequence data and geohash codes, respectively, significantly improving the efficiency of spatially retrieving track points.

[0058] Before introducing the detailed process of this application method, we first conduct a model analysis of the problem. The ship behavior recognition task is formulated as a multi-classification prediction problem. Its goal is to construct a mapping function The static characteristics of the ship and the extracted trajectory characteristics can be combined to infer the current behavior category of the ship. The specific mathematical expression is as follows:

[0059]

[0060] in, Represents a recognition model (such as STAW). V and T describe the static and dynamic characteristics of the ship respectively, and the output {0, 1, 2} corresponds to sailing, berthing, and anchoring respectively. Specifically, V = {type, length, width} includes the ship type, length, and width. represents a sequence of trajectory points, where x = (t, λ, φ, ν, θ) (see Table 1), i is the ship index, and I x is the sequence length. In addition, the distance δ between adjacent trajectory points is calculated to enrich the motion characteristics. All parameters are fixed constants or adaptively obtained according to the characteristics of the ship. At the same time, Figure 1 As shown, the method proposed in this application does not require data to be labeled in advance, which reduces a lot of human labeling costs and computing power costs.

[0061] Table 1 Method variables and their meanings

[0062]

[0063] The anchorage identification method is based on the assumption that the change of ship status has a certain continuity, that is, the ship will not switch status frequently in a very short time. Figure 1 As mentioned above, to avoid misjudgments caused by data anomalies, drift points need to be corrected in advance. The core idea of the spatiotemporal adaptive sliding window (STAW) method is to identify trajectory points that remain in a local area for a long time. Therefore, it is necessary to consider both the temporal window and the spatial window. This method mainly consists of two parts: algorithm design and adaptive parameter selection.

[0064] Table 2 Anchorage point recognition algorithm

[0065]

[0066] The input data to Algorithm 1 consists of a sequence of trajectory points sorted by timestamp and associated parameters. To avoid the complexity of adapting two sliding windows simultaneously, we fix the time window size ω and examine the spatial distribution of trajectory points within this window. The process first initializes the mooring window and mooring center point, converting the latitude and longitude coordinates to UTM coordinates for accurate distance calculation (steps 1-2). As the window slides, the average speed of the trajectory points within the window is calculated. If it is below a set speed threshold, the spatial extent of the trajectory points is further checked to determine whether the mooring condition is met. The mooring condition is that the maximum distance the ship travels within this time window is less than a set distance threshold. If so, the mooring center point is updated to the average position of the trajectory points, and the current mooring window is marked (steps 12-19). When the mooring window is marked, subsequent points are checked one by one to determine whether they are still within the mooring center range. The judgment criteria are: the distance between two adjacent trajectory points is less than the set distance threshold, and the distance from the subsequent point to the mooring center point is also less than the set distance threshold. If the subsequent point is not within the mooring center range, a preliminary mooring detection result is obtained (steps 5-10). Since direct detection may misjudge the navigation points immediately before and after the mooring as mooring points, a secondary check is introduced (see Algorithm 2) and the mooring points are classified as mooring or anchoring at the same time.

[0067] like Figure 2 As shown in Figure 2, without secondary verification of the trajectory, navigation points immediately before and after the ship's mooring are often misidentified as mooring points. To address this issue, we designed two secondary verification methods that can be flexibly selected based on different experimental scenarios. Algorithm 2 presents the first method, which uses an adaptive threshold and a sliding window to iteratively correct misidentified points at the beginning and end of the segment. This method is suitable for high-quality data with an adaptive threshold and no other mooring activities outside the port (such as yielding, working, etc., only anchoring). Therefore, this method is used in the baseline comparison of high-quality datasets.

[0068] Algorithm 2 aims to perform secondary verification and fine-grained classification on trajectory segments initially identified as stops, thereby improving the accuracy and robustness of stop point identification. First, the algorithm determines whether a trajectory segment is berthing, anchoring, or non-berthing based on the segment's geographic location and incorporating level-6 and level-7 Geohash grids (steps 1-11). If a trajectory point is located within a Geohash grid near the port shoreline, it is considered berthing; otherwise, it is anchoring. Specifically, if the ship's anchoring point is outside the shoreline's level-6 Geohash grid, it is considered anchoring; if the ship's anchoring point is within the shoreline's level-6 Geohash grid and within the shoreline's level-7 Geohash grid, it is considered berthing; and if the ship's anchoring point is within the shoreline's level-6 Geohash grid and outside the shoreline's level-7 Geohash grid, it is considered non-berthing. The algorithm then rechecks the speeds of the trajectory points between the beginning and end of the trajectory segment, eliminating points with abnormally high speeds (speeds exceeding a set abnormal speed threshold) to prevent navigation points from being misclassified as stop points (steps 13-21). This process effectively filters out misjudgments caused by data drift or anomalies, improving the accuracy of berthing point identification. Next, for different types of stops (berthing or anchoring), the algorithm selects corresponding sliding windows and threshold parameters, performing point-by-point checks at the beginning and end of the trajectory segment (steps 23-29). During this point-by-point verification process (point-by-point check function), the algorithm primarily determines whether these points are truly berthing based on characteristics such as speed and heading, combined with the number of points within the trajectory segment that meet the stop conditions (steps 30-44). Specifically, within a window, appropriate conditions are first selected based on the ship's stop type (steps 18 and 21). If the stop is berthing, track points within track segment P are extracted whose speed exceeds the speed threshold and whose direction change is less than the port turning threshold, or whose speed exceeds 0.75 times the speed threshold and whose direction change is less than the port turning threshold (step 28). If the stop is anchorage, track points whose speed exceeds 0.5 times the speed threshold and whose direction change is less than the port turning threshold are extracted (step 29). The indexes corresponding to these track points are then extracted (step 30). If the number of trajectory points that meet the criteria is greater than half of the total number of trajectory points in the window, this point is misjudged and the status of all trajectory points between the starting point and the last point that meets the criteria is changed to non-stop (steps 31-32). The window is then moved forward, continuing the check from the last point that meets the criteria until a trajectory segment P is found that does not meet the criteria. From this point on, all subsequent trajectory points are stop points. Furthermore, as in steps 20 and 23, after completing the check from front to back, we need to check each point from back to front.

[0069] Table 3 Anchorage point secondary inspection algorithm

[0070]

[0071] The second verification method is Figure 3 As shown, inspired by the DBSCAN idea, the density of each point is calculated in turn to determine whether correction is needed. This method is suitable for complex scenarios involving multiple ship types and sizes, as well as mixed mooring behaviors such as fishing and dredging. In this application, we apply this method to real data from a port to achieve more robust behavior correction. In actual operation, the neighborhood radius is set to the average of the distances between the two mooring points in the segment, the minimum number of points within the range is set to half the window size, and the window size is adaptively adjusted according to the location of the trajectory point. In addition, the mooring points are further classified according to their location (inside or outside the port). When mooring outside the port, it is subdivided into anchoring and other types of mooring according to the length of stay, and the one with the longest stay is anchoring. When mooring in the port, if more than 95% of the points in the trajectory segment that is first judged to be a stay are on the shore and the stay time is greater than 15 minutes, it is mooring; if less than 50% of the points are on the shore and the stay time is greater than 1 hour, it is anchoring; otherwise it is other types of mooring. The basis for judging whether a track point is on the shore is to determine whether the track point is within the geohash coding grid of the coastline with level 6. If it is within the grid, it is on the shore, otherwise it is not on the shore.

[0072] Table 4 summarizes the definitions and values of the parameters in the algorithm. The main purpose of setting two sets of parameters is to better distinguish between berthing and anchoring. Because ships only berth close to the coastline, the method is based on whether the trajectory point is on the coastline of level-6 Geohash (see Figure 4 The reason for this choice is that the level-5 Geohash range is too large, which easily includes areas far from the coast; while the level-7 Geohash range is too small to cover all berthing points. The parameter selection adopts an adaptive strategy: in each time window, the proportion of trajectory points within the level-6 Geohash coastline is first calculated. If it exceeds half, the and Otherwise, another set is used. Parameters are updated and switched in real time after a complete sliding window, avoiding frequent switching and reducing time consumption. When a ship is berthing, it basically fluctuates around a position, and a smaller time window can be used to identify it (set to 5 in this method). When it is anchored, the fluctuation range is wider, so a larger time window is set. When obtaining other parameters based on data statistics, the data is based on the level-7 Geohash coastline (see Figure 4 Left figure) division, because level-6 Geohash will include many harbor channels, when ships are sailing in the harbor, in order to avoid congestion, the speed will not be particularly low. Using more refined data division statistics can improve the accuracy of stop recognition. Speed threshold ∈ v , distance threshold∈δ and direction threshold ∈ θ Because of different functions, there are differences in acquisition,∈ ν and ∈ δ Mainly used for the initial identification of the stay trajectory, and ∈ θ It is mainly used for secondary detection, which requires identifying misjudged driving points from the trajectory points that were initially judged as stop points. Specifically, and Take the average speed of the trajectory points approaching and leaving the level-7 Geohash coastline, and Select the 99th percentile of the two sets of data respectively. The 10th percentile of the heading value is taken. This strategy ensures the robustness and adaptability of the algorithm in different operating environments.

[0073] Table 4. Parking point detection parameters. ω is the preset value, ∈ v ,∈ θ and ∈ δ Adaptive selection based on data statistics inside and outside the port

[0074]

[0075] The following uses a public dataset of labeled stop points (https: / / github.com / destiny1103 / DT-GNN) to verify and evaluate the method of this application. This dataset is a dataset of stop behaviors annotated by experts around a port, with labels including: docking, mooring, and normal navigation. This dataset has clear labels and clean data, and this study mainly uses it for comparison of recognition accuracy. In addition, we also tested our proposed algorithm with real data publicly available from NOAA (National Oceanic and Atmospheric Administration, https: / / coast.noaa.gov / htdata / CMSP / AISDataHandler / 2021 / ), and drew a heat map of the ship's stop trajectory points.

[0076] This application uses the following key indicators to evaluate the performance of ship behavior recognition: accuracy, precision, recall, and F1 value. The calculation formula for each indicator is as follows:

[0077] Accuracy: measures the proportion of correct predictions to the total number of predictions. The calculation formula is:

[0078]

[0079] Among them, T P is the number of true positives, T N is the number of true negatives, FP is the number of false positives, F N is the number of false negatives.

[0080] Precision: Quantifies the accuracy of positive predictions, reflecting the proportion of correctly predicted positive instances. The calculation formula is:

[0081]

[0082] Recall: This evaluates the model's ability to identify all positive instances, indicating the proportion of correctly identified positive instances to all actual positive instances. The calculation formula is:

[0083]

[0084] F1-score: The harmonic mean of precision and recall, providing a balance between the two. It is particularly suitable for situations where the distribution of categories is uneven. The calculation formula is:

[0085]

[0086] This paper comprehensively evaluates various approaches to ship stop behavior recognition, including threshold-based strategies, unsupervised clustering algorithms, and various graph neural network (GNN) models. The selected baseline methods represent the main technical approaches for existing ship stop behavior recognition and include the latest and most high-performing representative methods in each category. Specifically, they include:

[0087] Speed threshold-based constraint method (SBC): By setting a predefined speed threshold, trajectory points with speeds below the threshold are judged as stop behaviors, thereby realizing the identification of stop segments.

[0088] Ultra-fast and efficient single-vessel behavior recognition algorithm (FDSVBR): Combines speed and distance constraints within a sliding window, accumulates adjacent trajectory vectors and sets thresholds to determine stop points, improving recognition efficiency and accuracy.

[0089] Density-based clustering method: Stop trajectory detection is achieved by aggregating densely distributed trajectory points in space. The present invention adopts the DBSCAN algorithm to implement it, which is suitable for trajectory data with different density distributions.

[0090] Graph Attention Network (GAT): Introduces the attention mechanism to adaptively learn the importance of neighboring nodes and improve the model's ability to selectively integrate local features.

[0091] Graph Convolutional Network (GCN): Extends traditional convolution operations to non-Euclidean graph structures to achieve complex relationship modeling between nodes and global structural feature extraction.

[0092] Graphsage: Graphsage is a network that samples and aggregates features of a fixed number of neighboring nodes, making it suitable for inductive learning tasks on dynamic or large-scale graphs.

[0093] Chebyshev Spectral Convolutional Neural Network (ChebNet): implements local spectral graph convolution based on Chebyshev polynomial expansion, improving computational efficiency and capturing multi-hop dependencies.

[0094] The above method provides a comparative basis for the method of the present invention, verifying the superiority and applicability of the present invention in the field of ship stop behavior recognition.

[0095] As shown in Table 5, the STAW method performed exceptionally well, achieving an accuracy of 98.831% and an F1 score of 98.950%, the best performance among all evaluated models. In contrast, the speed constraint (SBC) method, while achieving a high accuracy of 97.258%, exhibited lower precision and a tendency to overestimate the number of stops. The DBSCAN method achieved an accuracy of 81.224%, but exhibited a low recall, primarily due to its reliance on parameter tuning and challenges in handling trajectories with large spatial density variations. Four GNN models (GCN, GAT, Graphsage, and ChebNet) performed well overall, with Graphsage achieving an accuracy of 98.807%. However, these models used 80% of the data for training, which gives them a training advantage over the STAW method, which was evaluated only on unseen samples. Most GNN methods achieved slightly lower accuracy, likely due to the gradual nature of ship behavior and the limitations of the GNN architecture in modeling long-term dependencies. In contrast, the FDSVBR and STAW methods effectively leverage local motion patterns and broader trajectory context, improving recognition performance. GNN methods rely on pre-built graph structures and cannot process new inputs in real time, while the FDSVBR method is sensitive to parameter tuning, which affects its generalization ability. Overall, the STAW framework demonstrates greater flexibility and adaptability, making it well-suited for practical maritime applications.

[0096] Table 5 Performance comparison of different methods

[0097]

[0098] The proposed STAW method achieves the highest recognition accuracy without requiring any labeled data. For the SBC and DBSCAN methods, the results presented are the best performance achieved under multiple parameter settings. For the four graph neural network models, 80% of the data was randomly sampled for training. The accuracy rates listed in Table 5 are evaluated on the full dataset.

[0099] Table 6 Accuracy of DBSCAN and SBC under different parameters

[0100]

[0101] Table 6 shows the performance of the SBC and DBSCAN methods under different parameter configurations. Although the SBC method supports efficient real-time decision-making, its performance is highly dependent on the fine-tuning of a single parameter. In this application, the speed thresholds are set to two adaptive values (0.12 m / s and 0.37 m / s) proposed by the STAW framework and an intermediate value of 0.2 m / s. The results show that when the threshold is 0.37 m / s, the SBC method achieves the highest accuracy of 97.258%. However, this method requires fine-tuning of parameters for different application scenarios. Similarly, the DBSCAN method performs best when the parameters are set to Eps = 0.0003 and MinPts = 300, with an accuracy of 81.224%. However, DBSCAN relies on a high degree of similarity between training data and real-time input data, which poses challenges to its generalization ability and transferability in different maritime areas.

[0102] Figure 5 This image shows heat maps of the berthing paths of three major types of vessels within the port: tugboats, cargo ships, and oil tankers. Tugboats, known for their powerful engines, primarily assist other vessels in berthing and maneuvering. Even smaller tugboats can provide sufficient thrust for a wide range of vessel types. Consequently, their berthing paths are widely distributed across the port's piers, demonstrating their flexible operational role. In contrast, larger tugboats, due to their greater power, primarily anchor in turning basins and deep harbor waters, providing crucial assistance for the entry and exit of larger vessels. Cargo ships exhibit different spatial distribution patterns: large cargo ships anchor more frequently and in distinct clusters, particularly in areas equipped with harbor cranes. These areas support efficient loading and unloading operations, requiring longer dwell times. Unlike cargo ships, the berthing pattern of oil tankers differs: smaller tankers are more densely packed within the port. This is because, in addition to the large oil tankers that transport oil products, the port also hosts a large number of smaller tankers serving as supply vessels, providing services such as refueling to berthed vessels. Small tankers are more maneuverable and can operate efficiently within the port area, resulting in a higher density of berthing points.

[0103] Figure 6The chart shows heat maps of anchorage trajectory points for three major types of vessels: tugboats, cargo ships, and oil tankers. For tugboats, small tugboats operate both inside and outside the port, while large tugboats primarily serve the port area. This is because large vessels face greater risks when navigating within the port, such as collisions or groundings, and therefore require more tugboat assistance. This is also reflected in the denser distribution of anchorage points for large tugboats within the port. For cargo ships, small cargo ships have more dispersed anchorage points within the port, typically stopping briefly while awaiting operations, while large cargo ships have more densely distributed anchorage points, reflecting the port's limited operational capacity and the need for longer waiting times. In contrast, large oil tankers have fewer anchorage points outside the port than large cargo ships, as some oil tankers operate within the port as supply vessels and can quickly depart after completing their missions. It is worth noting that small oil tankers anchor only within the port, indicating that their primary responsibility is to provide services such as fuel refueling to other ships, and their smaller size provides greater operational flexibility.

[0104] In summary, the STAW (Spatiotemporal Adaptive Sliding Window) method demonstrates significant advantages in the task of identifying ship stop behaviors. This method does not require manual data annotation and can adaptively determine the window size, speed, heading, and spatial threshold based on trajectory data, enabling efficient and accurate identification of the stop behaviors of different types of ships in different port environments. Experimental results show that the STAW method not only outperforms the traditional speed threshold method and density clustering method in terms of accuracy and F1 score, but also effectively balances precision and recall, significantly improving the robustness and generalization ability of mooring point identification. In addition, the STAW method has good real-time and interpretability, can adapt to complex and changing actual port scenarios, and provides a solid data foundation and technical support for intelligent port management and maritime safety.

[0105] The present application also provides an adaptive ship stop identification system based on a sliding spatiotemporal window, which is implemented based on the above method and includes:

[0106] The trajectory point identification module is used to identify the ship's trajectory points within a set time window. The process includes: calculating the average speed of all trajectory points in the window; if the average speed is lower than a first set speed threshold, determining whether the spatial range of the trajectory points meets the mooring condition; when the mooring condition is met, setting the mooring center point as the average position of the trajectory points, and then determining whether subsequent trajectory points are still within the mooring center range one by one until a trajectory point that is not within the mooring center range is found. The trajectory point before the trajectory point is the ship's mooring point; the mooring condition is: the maximum distance the ship moves within this time window is less than the set distance threshold; the judgment condition for whether the subsequent trajectory point is still within the mooring center range is: the distance between two adjacent trajectory points is less than the set distance threshold, and the distance from the subsequent point to the mooring center point is also less than the set distance threshold.

[0107] The threshold facility module is used to dynamically set a first set speed threshold and a set distance threshold according to whether the window is located inside or outside the port each time the window is slid.

[0108] The first and second judgment modules are used to make the following judgments on the ship's berthing point:

[0109] Determine whether the vessel is berthing, anchoring or non-berthing based on the geographical location of the track point;

[0110] For different types of stop types, different sliding window sizes are selected and checked point by point from the beginning and end of the trajectory segment. The inspection is based on the speed and heading characteristics of the trajectory points, combined with the number of trajectory points that meet the stop conditions in the trajectory segment, to determine whether these trajectory points are truly in the parked state.

[0111] The second secondary judgment module is used to make the following judgments on the ship's berthing point:

[0112] The DBSCAN method is used to calculate the density of the trajectory points, and the set density threshold is used to determine whether the trajectory point is a stop point;

[0113] When the track points are in the port, if more than a first set proportion of the track points in the first track segment determined as a stop are on the shore, and the stay time is greater than the first set time threshold, it is berthing; if less than a second set proportion of the track points are on the shore, and the stay time is greater than the second set time threshold, it is anchoring; otherwise, it is other types of stop and berthing;

[0114] When the track point is outside the port, it is anchored when the stay time is greater than the third set time threshold, otherwise it is other types of anchoring.

[0115] The present application proposes an adaptive ship stop identification method and system based on a sliding spatiotemporal window, which solves the problem of misjudgment of stop status caused by ship drift and oscillation in complex marine environments through a spatiotemporal coupled trajectory dynamic modeling mechanism. This method abandons traditional artificial rules and data annotation reliance, performs spatiotemporal joint slicing of ship trajectories through a sliding window, and dynamically optimizes the window scale and judgment threshold based on the motion characteristics within the window (speed distribution, heading entropy, spatial diffusion rate), thereby achieving an autonomous balance between anchor drift tolerance and stop event resolution. Its parameter adaptive mechanism significantly reduces the false detection rate in open waters and congested port areas, providing highly reliable ship status perception support for intelligent scheduling of maritime logistics and optimal allocation of port resources.

[0116] The present application may also provide a computer device comprising: at least one processor, memory, at least one network interface, and a user interface. The various components in the device are coupled together via a bus system. It will be understood that the bus system is used to enable communication between these components. In addition to a data bus, the bus system also includes a power bus, a control bus, and a status signal bus.

[0117] The user interface may include a display, a keyboard, or a pointing device, such as a mouse, a trackball, a touchpad, or a touch screen.

[0118] It is understood that the memory in the embodiments disclosed in the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DRRAM). The memories described herein are intended to include, but are not limited to, these and any other suitable types of memory.

[0119] In some embodiments, the memory stores the following elements, executable modules or data structures, or a subset or an extension thereof: an operating system and applications.

[0120] The operating system includes various system programs, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and handle hardware-based tasks. Application programs include various application programs, such as media players and browsers, which are used to implement various application services. The program that implements the method of the embodiment of the present disclosure can be included in the application program.

[0121] In the above embodiment, the processor may also call a program or instruction stored in the memory, specifically, a program or instruction stored in the application program, to:

[0122] Perform the steps of the above method.

[0123] The above method can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or by software instructions. The above processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The above-disclosed methods, steps, and logic block diagrams can be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the above-disclosed method can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0124] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, or other electronic units or combinations thereof for performing the functions described herein.

[0125] For software implementation, the technology of the present application can be implemented by executing the functional modules (e.g., procedures, functions, etc.) of the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0126] The present application may also provide a non-volatile storage medium for storing a computer program. When the computer program is executed by a processor, each step in the above method embodiment can be implemented.

[0127] Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of this application and are not intended to limit the scope of the present invention. Although this application has been described in detail with reference to the embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions to the technical solutions of this application do not depart from the spirit and scope of the technical solutions of this application and should be encompassed by the claims of this application.

Claims

1. An adaptive ship stop recognition method based on a sliding spatiotemporal window, comprising: The process of identifying the ship's trajectory points within the set time window is as follows: Calculate the average velocity of all trajectory points within the window; If the average speed is lower than the first set speed threshold, it is determined whether the spatial range of the track point meets the mooring conditions. If the mooring conditions are met, the mooring center point is set as the average position of the track points, and then the subsequent track points are determined one by one to see whether they are still within the mooring center range until a track point that is not within the mooring center range is found. The track point before the track point is the ship's mooring point. The anchoring condition is: the maximum distance the ship moves within this time window is less than a set distance threshold; The judgment condition for whether the subsequent trajectory point is still within the parking center range is: the distance between two adjacent trajectory points is less than the set distance threshold, and the distance from the subsequent point to the parking center point is also less than the set distance threshold; Each time the window is slid, the first set speed threshold and the set distance threshold are dynamically set according to whether the window is located inside or outside the port.

2. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 1 is characterized in that: Also includes: The ship's berthing point is determined as follows: Determine whether the vessel is berthing, anchoring or non-berthing based on the geographical location of the track point; For different types of stop types, different sliding window sizes are selected and checked point by point from the beginning and end of the trajectory segment. The inspection is based on the speed and heading characteristics of the trajectory points, combined with the number of trajectory points that meet the stop conditions in the trajectory segment, to determine whether these trajectory points are truly in the parked state.

3. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 2 is characterized in that: The method for determining whether the vessel is berthed, anchored or non-berthed includes: When the ship's anchorage point is outside the 6th level Geohash grid of the coastline, it is anchored; When the ship's anchorage is within the 6th-level Geohash grid of the coastline and within the 7th-level Geohash grid of the coastline, it is considered berthing; When a ship's anchorage point is within the 6th-level Geohash grid of the coastline and outside the 7th-level Geohash grid of the coastline, it is considered non-anchored.

4. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 2 is characterized in that: For different types of dwell types, corresponding sliding windows and threshold parameters are selected, and checks are performed point by point from the beginning and end of the trajectory segment, specifically including: Perform the following checks starting from the beginning and end of the trajectory segment: Within a window, the number of trajectory points that meet the following conditions is obtained: if the vehicle is berthing, the trajectory points within the trajectory segment whose speed is greater than the first set speed threshold and whose direction is less than the set port turning threshold are extracted, or the trajectory points whose speed is greater than the second set speed threshold and whose direction is less than the set port turning threshold are extracted; if the vehicle is anchoring, the trajectory points whose speed is greater than the third set speed threshold and whose direction change is less than the set port turning threshold are extracted; If the number of trajectory points that meet the conditions is greater than half of the amount of trajectory point data in the window, the status of all trajectory points from the starting trajectory point to the last trajectory point that meets the conditions in the trajectory segment is changed to non-stop; Slide the window forward and continue the above check from the last trajectory point that meets the conditions in the current trajectory segment until there is a trajectory segment that does not meet the above conditions. In this case, it is considered that starting from this trajectory point, the subsequent trajectory points are all stop points.

5. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 4 is characterized in that: The second set speed threshold is 0.75 times the first set speed threshold; the third set speed threshold is 0.5 times the first set speed threshold.

6. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 1 is characterized in that: Also includes: The ship's berthing point is determined as follows: The DBSCAN method is used to calculate the density of the trajectory points, and the set density threshold is used to determine whether the trajectory point is a stop point; When the track points are in the port, if more than a first set proportion of the track points in the first track segment determined as a stop are on the shore, and the stay time is greater than the first set time threshold, it is berthing; if less than a second set proportion of the track points are on the shore, and the stay time is greater than the second set time threshold, it is anchoring; otherwise, it is other types of stop and berthing; When the track point is outside the port, it is anchored when the stay time is greater than the third set time threshold, otherwise it is other types of anchoring.

7. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 6 is characterized in that: The method to determine whether the trajectory point is on the shore is: Determine whether the trajectory point is within the Geohash grid of the level 6 coastline. If it is within the grid, it is on the coast, otherwise it is not on the coast.

8. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 1 is characterized in that: The method to determine whether the window is inside or outside the port is: When the number of trajectory points in the window located inside the port is greater than the number of trajectory points located outside the port, the window is located inside the port, otherwise the window is located outside the port.

9. The adaptive ship stop identification method based on sliding spatiotemporal window according to claim 6 or 8, characterized in that: The method to determine whether a trajectory point is inside or outside the port is: When the level 6 Geohash grid to which the trajectory point belongs is within the predefined coastline Geohash set, the trajectory point is located inside the port, otherwise it is located outside the port.

10. An adaptive ship stop identification system based on a sliding spatiotemporal window, implemented based on the method according to any one of claims 1 to 9, characterized in that: The system comprises: The trajectory point identification module is used to identify the ship's trajectory points within a set time window. The process includes: calculating the average speed of all trajectory points in the window; if the average speed is lower than a first set speed threshold, determining whether the spatial range of the trajectory points meets the mooring condition; when the mooring condition is met, setting the mooring center point as the average position of the trajectory points, and then determining whether subsequent trajectory points are still within the mooring center range one by one until a trajectory point that is not within the mooring center range is found. The trajectory point before the trajectory point is the ship's mooring point; the mooring condition is that the maximum distance the ship moves within this time window is less than a set distance threshold; the determination condition for whether the subsequent trajectory point is still within the mooring center range is that the distance between two adjacent trajectory points is less than the set distance threshold, and the distance from the subsequent point to the mooring center point is also less than the set distance threshold; and The threshold facility module is used to dynamically set a first set speed threshold and a set distance threshold according to whether the window is located inside or outside the port each time the window is slid.