Ship trajectory prediction method and system based on kinematic reachability constraints

CN122949705APending Publication Date: 2026-10-20INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0004]本发明提供一种基于运动学可达性约束的船舶航迹预测方法及系统,用以解决现有技术中在船舶变速、变向等机动场景下的预测准确性低、鲁棒性差的缺陷,实现在机动场景下,提升船舶航迹预测的准确性及鲁棒性

Benefits of technology

[0016]本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述基于运动学可达性约束的船舶航迹预测方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention provides a method and system for ship trajectory prediction based on kinematic reachability constraints. The method includes: inputting a discrete trajectory sequence, formed by discretizing the position coordinates of each historical track point in the target ship's historical trajectory, into a trajectory prediction model to obtain the prediction confidence of the target ship's next trajectory point located in each grid cell in the geographic grid space; determining a kinematic reachability candidate domain based on the ground speed and ground heading of the last historical track point; extending the kinematic reachability candidate domain along the heading direction indicated by the ground heading of the last historical track point, using the grid cell containing the last historical track point as a reference, and scaling with the ground speed of the last historical track point; masking the prediction confidence of grid cells outside the kinematic reachability candidate domain, and predicting the position coordinates of the next trajectory point based on the masked prediction confidence. This invention can improve the accuracy and robustness of ship trajectory prediction in maneuvering scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship traffic management technology, and in particular to a method and system for predicting ship trajectories based on kinematic reachability constraints. Background Technology

[0002] The Automatic Identification System (AIS) is a shipboard broadcasting system operating in the VHF maritime band. It periodically broadcasts information such as the ship's Maritime Mobile Service Identity (MMSI), position, speed over land, heading over land, and timestamp. With the large-scale deployment of shore-based AIS base stations and satellite-based AIS systems, massive amounts of historical ship tracking data have accumulated globally, providing crucial data support for maritime surveillance and intelligent navigation applications such as ship situational awareness, collision warning, and maritime traffic flow organization. Ship tracking prediction, which infers a ship's future spatial position based on historical observation sequences, directly impacts the reliability of upper-level maritime applications due to the accuracy and reasonableness of its predictions.

[0003] Existing technologies typically discretize the continuous latitude and longitude coordinates of a ship's historical track points into discrete units on a geographic grid, and use generative networks to perform autoregressive modeling on the discrete track sequence to obtain the probability distribution of the next track point on each geographic grid. In the decoding and prediction stage, candidate grids with an index distance of less than a set radius from the grid where the last observed track point is located are retained, i.e., isotropic neighborhood filtering is performed within the grid space, and the location of the next track point is determined based on the filtered probability distribution. However, the isotropic neighborhood filtering method in this approach relies solely on the index distance between the candidate grid and the last observed grid. The candidate regions have the same extension range in all directions, resulting in low prediction accuracy and poor robustness in scenarios involving ship speed changes, course changes, and other maneuvers. Summary of the Invention

[0004] This invention provides a ship trajectory prediction method and system based on kinematic reachability constraints, which addresses the shortcomings of existing technologies in predicting ship trajectories in maneuvering scenarios such as speed changes and course changes, thereby improving the accuracy and robustness of ship trajectory prediction in maneuvering scenarios.

[0005] This invention provides a method for predicting ship tracks based on kinematic reachability constraints, comprising: Obtain the historical track of the target vessel; the historical track includes multiple historical track points sorted by time, and each historical track point includes position coordinates, speed above ground and heading above ground; The location coordinates of each historical track point are discretized into grid indices in a geographic grid space to obtain a discrete track sequence. The discrete trajectory sequence is input into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target ship in each grid in the geographic grid space. Based on the ground speed and ground heading of the last historical track point in the historical track, a kinematic reachable candidate region is determined; the kinematic reachable candidate region is based on the grid where the last historical track point is located, extends along the heading direction indicated by the ground heading of the last historical track point, and expands and contracts with the ground speed of the last historical track point. The prediction confidence of grids located outside the kinematically reachable candidate domain is masked, and the position coordinates of the next trajectory point are predicted based on the masked prediction confidence. The trajectory prediction model is obtained by training a generative sequence modeling network based on the sample historical trajectories of the sample ships. The generative sequence modeling network is used to model the probability distribution of discrete trajectory sequences in an autoregressive manner.

[0006] According to the present invention, a ship trajectory prediction method based on kinematic reachability constraints is provided, wherein the discrete trajectory sequence includes the latitude index and longitude index of each of the historical trajectory points; The step of determining the kinematically reachable candidate region based on the ground speed and ground heading of the last historical track point in the historical track includes: The ground heading and ground speed of the last historical track point are normalized to obtain normalized heading and normalized speed. Based on the normalized heading, determine the latitudinal and longitudinal heading components of the target vessel. The latitude reachable range is determined based on the latitude index of the last historical track point, the normalized speed, the preset forward reachable radius, the positive and negative parts of the heading component in the latitude direction, and the preset baseline tolerance. The longitude reachable range is determined based on the longitude index of the last historical track point, the normalized speed, the forward reachable radius, the positive and negative parts of the heading component in the longitude direction, the grid spacing correction value in the longitude direction, and the baseline tolerance. The kinematic reachable candidate domain is determined based on the latitude reachable range and the longitude reachable range.

[0007] According to the present invention, a method for predicting ship tracks based on kinematic reachability constraints, wherein determining the latitudinal and longitudinal heading components of the target ship based on the normalized heading includes: The heading component in the latitudinal direction is determined based on the cosine value of the circumferential angle corresponding to the normalized heading. The heading component of the longitude direction is determined based on the sine value of the circumferential angle.

[0008] According to the present invention, a ship track prediction method based on kinematic reachability constraints, wherein determining the latitudinal reachability interval based on the latitude index of the last historical track point, the normalized speed, a preset forward reachability radius, the positive and negative parts of the heading component in the latitudinal direction, and a preset baseline tolerance includes: The normalized speed, the forward reachable radius, and the negative part of the heading component in the latitudinal direction are multiplied to obtain the first product result; The difference between the latitude index of the last historical track point, the first product result, and the baseline tolerance is calculated to obtain the lower limit of the latitude reachable range. The normalized speed, the forward reachable radius, and the positive part of the heading component in the latitudinal direction are multiplied to obtain the second product result; The upper limit of the achievable latitude range is obtained by summing the latitude index of the last historical track point, the second product result, and the baseline tolerance.

[0009] According to the present invention, a ship track prediction method based on kinematic reachability constraints, wherein determining the longitude reachable interval based on the longitude index of the last historical track point, the normalized speed, the forward reachable radius, the positive and negative parts of the heading component in the longitude direction, the grid spacing correction value in the longitude direction, and the baseline tolerance includes: The third product result is obtained by multiplying the normalized speed, the forward reachable radius, and the ratio between the negative part of the heading component in the longitude direction and the grid spacing correction value. The difference between the longitude index of the last historical track point, the third product result, and the ratio between the baseline tolerance and the grid spacing correction value is calculated to obtain the lower limit of the longitude reachable range. The fourth product result is obtained by multiplying the normalized speed, the forward reachable radius, and the ratio of the positive part of the heading component in the longitude direction to the grid spacing correction value. The upper limit of the longitude reachable range is obtained by summing the longitude index of the last historical track point, the fourth product result, and the ratio between the baseline tolerance and the grid spacing correction value.

[0010] According to the present invention, a method for predicting ship trajectories based on kinematic reachability constraints includes the following steps: masking the prediction confidence of grids located outside the kinematic reachability candidate domain in the prediction confidence score, and predicting the position coordinates of the next trajectory point based on the masked prediction confidence score; The prediction confidence of the grid located outside the kinematically reachable candidate domain is set to negative infinity to obtain the masked prediction confidence. According to the order of prediction confidence values ​​from largest to smallest, at least one candidate prediction confidence value is retained from the masked prediction confidence values, and the remaining prediction confidence values ​​in the masked prediction confidence values ​​other than the candidate prediction confidence values ​​are set to negative infinity to obtain the truncated prediction confidence values. The truncated prediction confidence is normalized to the probability distribution on each grid in the geographic grid space; Based on the probability distribution, at least one polynomial random sampling is performed iteratively. Based on the sampling results, obtain the prediction grid index corresponding to the next trajectory point; The position coordinates of the next trajectory point are obtained based on the predicted grid index.

[0011] According to the present invention, a ship trajectory prediction method based on kinematic reachability constraints is provided. The trajectory prediction model includes a word embedding layer, a position encoding layer, a stacked encoding layer, and a classification head; the discrete trajectory sequence includes the latitude index and longitude index of each of the historical trajectory points. The step of inputting the discrete trajectory sequence into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target vessel in each grid of the geographic grid space includes: The latitude and longitude indices of each historical flight point are input into the word embedding layer to obtain word embedding vectors; The word embedding vector and the learnable positional encoding vector are input into the positional encoding layer to obtain the target input features; The target input features are input into the stacked coding layer to obtain the coded features; The encoded features are input into the classification head to obtain the prediction confidence of the next trajectory point in each grid in the geographic grid space; The stacked coding layer includes multiple stacked causal self-attention coding blocks. The causal self-attention coding blocks are used to encode the target input features based on a causal mask to obtain the encoded features. The causal mask is used to control that the encoded features at each time step depend only on the time step and the historical track points before it.

[0012] According to the present invention, a ship trajectory prediction method based on kinematic reachability constraints is provided, wherein the training steps of the trajectory prediction model include: The historical flight paths of the sample are sampled by a sliding window with a fixed window length to obtain a sample flight path sequence. A valid point mask corresponding to the sample flight path sequence is generated based on whether each sample flight path point in the sample flight path sequence is a valid point. The discrete track sequence corresponding to the sample track sequence is input into the generative sequence modeling network to obtain the sample prediction confidence level corresponding to each time step in the sample track sequence. The classification loss is determined based on the sample prediction confidence of the last preset number of time steps of the sample trajectory sequence and the target grid index corresponding to each of the last preset number of time steps. The sample prediction confidence of the last preset number of time steps is subjected to neighborhood fuzzy smoothing, and the smoothing loss is determined based on the fuzzy smoothed sample prediction confidence and the target grid index. The total loss is determined based on the classification loss, the smoothing loss, and the mask values ​​corresponding to the last preset number of time steps in the effective point mask. The generative sequence modeling network is iteratively trained based on the total loss to obtain the trajectory prediction model.

[0013] According to the present invention, a method for predicting ship trajectories based on kinematic reachability constraints includes performing neighborhood fuzzy smoothing on the prediction confidence of samples at the last preset number of time steps, and determining the smoothing loss based on the fuzzy smoothed prediction confidence and the target grid index, comprising: Log-normalize the sample prediction confidence scores of the last preset number of time steps to obtain the log probabilities; The log probability is smoothed at least once by one-dimensional neighborhood average convolution to obtain the smoothed log probability. The smoothing loss is determined based on the negative log-likelihood of the smoothed probability relative to the target grid index.

[0014] This invention also provides a ship trajectory prediction system based on kinematic reachability constraints, comprising: The acquisition unit is used to acquire the historical track of the target ship; the historical track includes multiple historical track points ordered by time, and each historical track point includes position coordinates, speed above ground and heading above ground; Discretization unit, used to discretize the position coordinates of each historical track point into a grid index in geographic grid space, to obtain a discrete track sequence; The first prediction unit is used to input the discrete trajectory sequence into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target ship in each grid in the geographic grid space. The candidate domain determination unit is used to determine the kinematically reachable candidate domain based on the ground speed and ground heading of the last historical track point in the historical track; the kinematically reachable candidate domain extends along the heading direction indicated by the ground heading of the last historical track point, with the grid where the last historical track point is located as the reference, and expands and contracts with the ground speed of the last historical track point. The second prediction unit is used to mask the prediction confidence of grids located outside the kinematically reachable candidate domain in the prediction confidence, and predict the position coordinates of the next trajectory point based on the masked prediction confidence. The trajectory prediction model is obtained by training a generative sequence modeling network based on the sample historical trajectories of the sample ships. The generative sequence modeling network is used to model the probability distribution of discrete trajectory sequences in an autoregressive manner.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the ship trajectory prediction method based on kinematic reachability constraints as described above.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the ship trajectory prediction method based on kinematic reachability constraints as described above.

[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the ship trajectory prediction method based on kinematic reachability constraints as described above.

[0018] The ship trajectory prediction method and system based on kinematic reachability constraints provided by this invention transforms the continuous trajectory prediction problem into a discrete sequence classification problem by discretizing the position coordinates of each historical trajectory point into grid indices in a geographic grid space. The trajectory prediction model, modeled in an autoregressive manner, outputs the prediction confidence of the next trajectory point on each grid, enabling the prediction results to express spatial uncertainty and overcoming the shortcomings of regression networks, which can only provide deterministic point estimates and are difficult to quantify risk. Furthermore, based on the ground speed and ground heading of the last historical trajectory point, the system determines the trajectory along the... The kinematically reachable candidate domain, which extends along the course and expands with speed, fully utilizes the instantaneous motion state of the ship naturally carried in the AIS message. By masking the prediction confidence of grids outside the candidate domain, it achieves hard exclusion of physically unreachable locations at the decoding output level. This overcomes the shortcomings of isotropic grid neighborhood constraints, which allow high-speed ships to instantly move to the side or rear and allow anchored ships to make large jumps in predictions. As a result, it significantly reduces the jump amplitude of predicted track points and improves the accuracy, physical rationality, and robustness of track prediction in maneuvering scenarios such as speed changes and course changes. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the ship trajectory prediction method based on kinematic reachability constraints provided by the present invention.

[0021] Figure 2 This is a schematic diagram of the historical flight track acquisition process provided by the present invention.

[0022] Figure 3 This is a schematic diagram of the data distribution before and after position coordinate normalization provided by the present invention.

[0023] Figure 4 This is a schematic diagram of how continuous latitude and longitude coordinates are uniformly discretized into discrete indices according to a grid, as provided by the present invention.

[0024] Figure 5 This is a schematic diagram of the kinematic reachability candidate domain distribution provided by the present invention.

[0025] Figure 6 This is a schematic diagram of the trajectory prediction model provided by the present invention.

[0026] Figure 7This is a schematic diagram of the process for generating word embedding vectors provided by the present invention.

[0027] Figure 8 This is a schematic diagram of the causal mask used in the multi-head causal self-attention provided by the present invention.

[0028] Figure 9 This is a schematic diagram of the sliding window sampling provided by the present invention.

[0029] Figure 10 This is a schematic diagram of the effective dot mask provided by the present invention.

[0030] Figure 11 This is a schematic diagram of the loss calculation range for the last preset number of time steps provided by the present invention.

[0031] Figure 12 This is a schematic diagram of the curves showing how the training loss and validation loss change with the number of iterations, as provided by this invention.

[0032] Figure 13 This is a schematic diagram of the prediction comparison results of the test set tracks provided by the present invention.

[0033] Figure 14 This is a schematic diagram of the prediction error distribution of the test set track provided by the present invention.

[0034] Figure 15 This is a schematic diagram of probabilistic fuzzy smoothing provided by the present invention.

[0035] Figure 16 This is a schematic diagram of the ship trajectory prediction system based on kinematic reachability constraints provided by the present invention. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0037] All actions involving the acquisition of signal information or data in this application are carried out in accordance with the relevant data protection laws and regulations of the locality and with the authorization of the relevant device owner.

[0038] Currently, ship trajectory prediction technology can be mainly divided into three categories.

[0039] The first category is prediction methods based on kinematic models, such as uniform velocity models, uniform acceleration models, constant turning rate models, and methods like Kalman filtering and particle filtering. These methods have clear physical meaning and low computational cost, but they usually assume that the ship is making uniform velocity or uniform turning motion. When the ship is in complex maneuvering states such as changing speed, changing direction, anchoring, berthing and unberthing, the prediction error increases rapidly, and it is difficult to learn the statistical laws of group navigation.

[0040] The second category is prediction methods based on traditional machine learning, such as Hidden Markov Models, Support Vector Regression, and Gaussian Process Regression. These methods rely on manual feature engineering, have limited model capacity, and are insufficient in characterizing long-term and nonlinear navigation patterns.

[0041] The third category is prediction methods based on deep neural networks, such as Recurrent Neural Networks (RNNs), Long Short-Term Memory (LSTM) networks, Gated Recurrent Units (GRUs), and Graph Convolutional Networks. These methods directly output future latitude and longitude coordinates through continuous value regression. While this improves prediction accuracy to some extent, it still has the following shortcomings: Regression-based networks only provide deterministic point estimates and cannot express the spatial uncertainty of the prediction results, making it difficult to meet the risk quantification needs of safety-sensitive scenarios such as collision warnings; continuous coordinate regression lacks utilization of prior knowledge such as the limited displacement between adjacent moments in ship motion and the sparse spatial distribution and clustering of track points in waterways, making the model susceptible to interference from abnormal observation points and exhibiting poor robustness; traditional recurrent structures suffer from gradient vanishing and gradient exploding problems when processing long sequences, resulting in weak long-range dependency modeling capabilities; and the training objective of the model is inconsistent with the actual evaluation requirements, namely the great circle distance between two points on the Earth's surface, leading to a misalignment between the optimization objective and the evaluation index, which restricts prediction accuracy.

[0042] Furthermore, in recent years, some technologies have proposed discrete trajectory prediction methods based on generative transformers (Transformers). These methods discretize continuous latitude and longitude coordinates into discrete terms on a geographic grid, employ a causal self-attention mechanism to perform autoregressive modeling of the discrete trajectory sequence, and train it with cross-entropy loss. These methods transform trajectory prediction into a discrete sequence classification problem, enabling the output of probability distributions on the grid to express spatial uncertainty, thus mitigating to some extent the difficulty of quantifying risks in regression-based networks.

[0043] However, these methods generally employ isotropic neighborhood constraints centered on the current grid index during the decoding and sampling phase. This means they only retain candidates whose distance from the current grid index is less than a set radius. This constraint is isotropic within the grid space, failing to utilize the ship's instantaneous motion state reflected by the ground speed and heading naturally carried in the AIS message, and also failing to distinguish the difference in the ship's motion capability along the heading direction versus perpendicular to the heading direction. When the model's confidence in the last observation is insufficient, the candidate region may cover locations that the ship cannot physically reach at all. For example, allowing a ship to instantly shift to its side or rear while traveling at high speed straight, or allowing a large jump while the ship is anchored, results in physically unreasonable prediction jumps, limiting prediction accuracy, especially in scenarios involving ship speed changes, course changes, and other maneuvers.

[0044] Furthermore, a few works have attempted to introduce kinematic constraints into trajectory prediction, but these typically use the residuals of the kinematic equations as a soft penalty loss for the output of continuous regression networks, such as kinematic loss and physical information neural networks. Within the continuous coordinate regression framework, these constraints can only be applied indirectly through gradients and cannot strictly exclude unreachable locations at the decoding output level of generative discrete probabilistic frameworks. Therefore, how to impose hard reachability constraints on candidate prediction locations during the decoding stage of generative discrete prediction is one of the urgent technical problems to be solved in this field.

[0045] In view of this, this application provides a ship trajectory prediction method based on kinematic reachability constraints. This method discretizes continuous position coordinate observations into discrete trajectory sequences according to geographic grid space, and adopts a trajectory prediction model that models the probability distribution of the discrete trajectory sequence in an autoregressive manner to output the prediction confidence of the next trajectory point on each grid. Furthermore, in the decoding prediction stage, a kinematic reachability candidate domain is determined based on the ground speed and ground heading of the last historical trajectory point, which extends along the heading direction and expands with the speed. The prediction confidence of grids outside the candidate domain is masked, and the candidate prediction positions are hard-screened from the perspective of physical reachability, thereby reducing prediction jumps, effectively expressing spatial uncertainty, and improving the prediction accuracy and robustness in maneuvering scenarios.

[0046] Figure 1 This is a flowchart illustrating the ship trajectory prediction method based on kinematic reachability constraints provided by the present invention.

[0047] The method provided in this application can be applied to the interdisciplinary field of ship traffic management and deep learning, and is particularly suitable for scenarios where ship trajectory prediction is performed in complex waters such as port waters, busy waterways, and anchorages, relying on ship trajectory data accumulated by shore-based AIS base stations or spaceborne AIS satellites. The execution subject of this method can be a server of a shore-based monitoring center, a cloud computing platform, or an electronic device with computing capabilities such as a shipborne intelligent terminal; this embodiment does not specifically limit this.

[0048] like Figure 1 As shown, the method includes steps 110, 120, 130, 140 and 150.

[0049] Step 110: Obtain the historical track of the target vessel; the historical track includes multiple historical track points sorted by time, and each historical track point includes position coordinates, speed to ground and heading to ground.

[0050] The target vessel is the vessel whose trajectory is to be predicted. It can be any mobile watercraft equipped with AIS shipboard equipment, such as a merchant ship, fishing boat, passenger ship or engineering vessel. This embodiment does not specifically limit this.

[0051] A historical track is an ordered sequence of observation records of a target vessel at multiple historical moments within the current observation window, arranged in ascending order of timestamps. It reflects the actual navigation process of the target vessel over a past period. A historical track point is an observation record corresponding to a single historical moment within the historical track, which can be obtained by parsing an AIS message broadcast by the target vessel.

[0052] Each historical track point includes at least position coordinates, speed relative to ground, and heading relative to ground. Position coordinates describe the spatial location of the target vessel at that historical moment, and can be represented as geographic coordinates composed of longitude and latitude. Speed ​​relative to ground describes the target vessel's rate of motion relative to the ground at that historical moment, reflecting its instantaneous displacement capability. Heading relative to ground describes the target vessel's direction of motion relative to the ground at that historical moment, and according to maritime convention, can be measured clockwise with true north as the reference. In addition, each historical track point may also include other fields such as timestamps and MMSI, which are not specifically limited in this embodiment.

[0053] Figure 2 This is a schematic diagram of the historical track acquisition process provided by the present invention; as shown below. Figure 2As shown, in one possible implementation, when acquiring the historical track of a target vessel, the raw AIS message data of the target vessel can be collected first. This raw AIS message data is stored in CSV file format, containing records of each historical track point of the target vessel. Each historical track point record includes at least the fields of timestamp, longitude, latitude, speed over land, and heading over land. Therefore, each field in each historical track point record can be parsed first, and the parsed fields can be cleaned. For example, records with non-numerical, missing, or non-numerical values ​​for longitude and latitude, or with abnormal coordinates, can be deleted and not included in the effective statistics; or records with Boolean false, empty, or missing values ​​can be uniformly filled with 0. Then, the cleaned records are grouped according to the MMSI of the target vessel, and sorted in ascending order of timestamp within each group to obtain the historical track of the target vessel.

[0054] The historical track of the target vessel can be stored in matrix form, with columns including latitude, longitude, speed over land, heading over land, timestamp, etc. This embodiment does not impose specific limitations on this.

[0055] In another possible implementation, the historical tracks of the target vessel can be read directly from a pre-built track database. This embodiment does not specifically limit this.

[0056] Figure 3 This is a schematic diagram of the data distribution before and after position coordinate normalization provided by the present invention; as shown. Figure 3 As shown, further, to eliminate the dimensional differences in coordinate values ​​between data from different waters and sources, the position coordinates of each historical track point in the historical track can be normalized using a globally statistical normalization method to ensure that the coordinate mappings of different files and at different times are consistent under the same reference system. For example, a maximum-minimum normalization based on global statistics can be used, and the specific calculation method is as follows: ; in, Represents the original longitude or latitude observation value; and These represent the global minimum and global maximum values ​​of the longitude or latitude column in the full track data, respectively. This represents the normalized position coordinates, with values ​​uniformly mapped to the [0,1] interval. For records with values ​​of Boolean false, empty, or missing, they can be uniformly filled with 0 before participating in normalization; for columns where the global maximum and minimum values ​​are equal, normalization can be skipped to avoid division by zero. Similarly, ground speed and ground heading can also be normalized to the [0,1] interval and retained along with historical tracks.

[0057] Step 120: Discretize the position coordinates of each historical track point into a grid index in the geographic grid space to obtain a discrete track sequence.

[0058] Here, the geographic grid space refers to the discretized space formed by dividing the geographic coordinate range corresponding to the target vessel's activity area into regular grids according to a preset spatial resolution. Each grid in this space has a specific number and geographic coverage.

[0059] The number of grids and the grid spacing in the geographic grid space can be set according to the latitude and longitude span of the target activity water area and the prediction accuracy requirements. For example, the target water area can be divided at a spacing of 0.01°. This embodiment does not specifically limit this.

[0060] A grid index refers to the number of the grid in the geographic grid space into which the location coordinates of a historical track point fall. It can be represented as a two-dimensional index composed of longitude and latitude indices, or as a one-dimensional index after uniformly numbering the grids. This embodiment does not specifically limit this.

[0061] A discrete track sequence is a discrete symbol sequence obtained by discretizing the position coordinates of each historical track point into a grid index and arranging them in chronological order. Each sequence element corresponds to a historical track point and can be regarded as a discrete term describing the position of a ship.

[0062] In one possible implementation, uniform quantization can be used to discretize the position coordinates of each historical track point into a grid index in the geographic grid space, i.e., a discrete longitude index and a latitude index, according to the number of longitude and latitude grids set in the geographic grid space, so as to transform the continuous track prediction problem into a discrete sequence classification problem.

[0063] Figure 4 This is a schematic diagram illustrating how continuous latitude and longitude coordinates are uniformly discretized into discrete indices according to a grid, as provided by the present invention; for example... Figure 4 As shown, specifically, the number of grids in the latitudinal direction of the geographic grid space is set to... The number of grids in the longitude direction is , here and It can be determined based on the actual scenario, such as , The grid spacing between the two can also be determined according to the actual scenario, such as setting both to 0.01°.

[0064] For any historical track point, the normalized position coordinates latitude and longitude It can be discretized from a continuous geographic coordinate space into a regular two-dimensional grid using the following formula: ; ; in, This represents the floor function; Provide the latitude index for this historical waypoint. Provide the longitude index for this historical track point.

[0065] In other embodiments, discretization can also be performed using non-uniform grid partitioning or adaptive grid partitioning based on waterway distribution, and this embodiment does not specifically limit this.

[0066] It should be noted that by discretizing continuous position coordinates into grid indices in a geographic grid space, the continuous track prediction problem is transformed into a classification problem on a discrete sequence. Compared to directly regressing continuous latitude and longitude coordinates, this discretization process naturally aligns with the prior characteristics of sparse spatial distribution and clustering of track points in ship motion, enabling the track prediction model to output a probability distribution on a finite discrete candidate space. This reduces the interference of outlier observations on the prediction and provides a structural basis for expressing the spatial uncertainty of the prediction results.

[0067] Step 130: Input the discrete track sequence into the track prediction model to obtain the prediction confidence of the next trajectory point of the target ship in each grid in the geographic grid space.

[0068] Here, the track prediction model is a machine learning model trained on a generative sequence modeling network based on the sample ship's historical track data. The sample ship is the vessel that broadcasts AIS messages and has its data collected during its historical operation. It can be the same vessel as the target ship, or another vessel navigating in the same or similar waters. The historical track data is a sequence of track points ordered by time, formed by the sample ship's actual navigation during its historical operation. Its acquisition and organization methods can be the same as those used in step 110 for acquiring historical tracks.

[0069] Generative sequence modeling networks are neural networks used to model the probability distribution of discrete track sequences in an autoregressive manner. Specifically, this network decomposes the joint probability distribution of the discrete track sequence into the product of the conditional probability distributions at each time step. At each time step, it predicts the probability distribution of the next sequence element in the discrete candidate space based on the sequence elements at that time step and those preceding it. This generative sequence modeling network can be implemented using a Transformer network based on a causal self-attention mechanism, or other network structures such as recurrent neural networks with autoregressive generative capabilities. This embodiment does not specifically limit its implementation.

[0070] Prediction confidence is a metric output by the trajectory prediction model for the next trajectory point, representing the probability that the next trajectory point will fall into any grid in the geographic grid space. Its specific form can be an unnormalized logistic value or a normalized probability value; this embodiment does not specifically limit this. Here, the next trajectory point refers to the trajectory point of the target vessel at the next moment after the last historical trajectory point, i.e., the trajectory point to be predicted.

[0071] Optionally, after obtaining the discrete trajectory sequence, the discrete trajectory sequence can be used as a conditional sequence to be input into the trajectory prediction model. The trajectory prediction model then outputs the prediction confidence of the next trajectory point on each grid in the geographic grid space based on the statistical laws of group navigation learned by autoregressive modeling.

[0072] It should be noted that during the training of the trajectory prediction model, the historical trajectories of the samples can be discretized into a sequence of discrete trajectories as described in step 120. The real grid index of the next time step in the sequence is used as supervision information to supervise the training of the generative sequence modeling network until the loss function converges. The generative sequence modeling network at convergence is then determined as the trajectory prediction model. The optimizer, learning rate scheduling strategy, and batch size used in training can be set according to actual training needs, and this embodiment does not impose specific limitations on them.

[0073] It should be noted that by inputting discrete trajectory sequences into a trajectory prediction model modeled in an autoregressive manner, the model output is no longer a single deterministic coordinate point estimate, but a prediction confidence distribution on a geographic grid space. This gives it the ability to express the spatial uncertainty of the prediction results, providing a probabilistic risk quantification basis for safety-sensitive scenarios such as collision warnings. This overcomes the shortcomings of regression networks, which only provide deterministic point estimates and cannot quantify risks.

[0074] Step 140: Determine the kinematically reachable candidate domain based on the ground speed and ground heading of the last historical track point in the historical track.

[0075] Here, the last historical track point refers to the historical track point with the latest timestamp and the last time sequence position in the historical track. Its speed and heading to the ground reflect the instantaneous motion state of the target ship corresponding to the most recent observation before the current prediction time.

[0076] A kinematically reachable candidate domain is a region in the geographic grid space composed of several candidate grids. It is used to characterize the spatial range that a target ship can physically reach in the next moment, under the constraints of the instantaneous motion state of the last historical track point. Specifically, the kinematically reachable candidate domain extends along the heading direction indicated by the ground heading of the last historical track point, with the grid containing the last historical track point as the reference. Its extension range expands and contracts with the ground speed of the last historical track point; that is, the greater the ground speed, the farther the candidate domain extends along the heading direction, and the smaller the ground speed, the more the coverage area of ​​the candidate domain shrinks.

[0077] Optionally, when determining the kinematically reachable candidate domain, the extension direction of the candidate domain can be determined based on the ground heading of the last historical track point, and the reachable distance of the candidate domain along the extension direction can be determined based on the ground speed of the last historical track point. A relatively small tolerance range is maintained in the direction perpendicular to the heading and in the opposite direction, thereby delineating a candidate grid set in the geographic grid space defined by the aforementioned directions and distances. The specific geometric shape of the candidate domain can be an asymmetric rectangular region defined by the reachable intervals of each coordinate direction, or it can be a fan-shaped region or an elliptical region extending along the heading, etc. This embodiment does not specifically limit this.

[0078] The physical meaning of the kinematically reachable candidate domain is as follows: the ship's position at the next moment is strongly constrained by its current speed and heading, meaning the ship has strong maneuverability along its heading; the higher the speed, the farther the distance that can be reached along the heading, so the extension range of the candidate domain along the heading increases with increasing speed. However, the ship's maneuverability in directions perpendicular to and opposite to the heading is limited, so the candidate domain retains only a small tolerance range in these directions. When the target ship is anchored or stopped, and its speed relative to ground approaches zero, the extension of the candidate domain along the heading shrinks, degenerating into a small neighborhood centered on the grid where the last historical track point is located. Thus, the kinematically reachable candidate domain exhibits an asymmetric shape in the geographic grid space that matches the ship's instantaneous motion state, excluding physically inaccessible grids such as the side and rear positions of high-speed straight-moving ships and the distant positions of anchored ships from the candidate range.

[0079] It should be noted that by determining the kinematic reachable candidate domain based on the ground speed and ground heading of the last historical track point, the instantaneous motion state information of the ship naturally carried in the AIS message is fully utilized. The difference in the ship's motion capability along the heading direction and perpendicular to the heading direction is explicitly introduced into the decoding and prediction process, overcoming the shortcomings of isotropic grid neighborhood constraints in that they cannot distinguish direction or perceive speed.

[0080] Step 150: Mask the prediction confidence of grids located outside the kinematically reachable candidate domain in the prediction confidence, and predict the position coordinates of the next trajectory point based on the masked prediction confidence.

[0081] Optionally, after obtaining the prediction confidence and the kinematic reachability candidate region, the prediction confidence of grids located outside the kinematic reachability candidate region can be masked. Masking here refers to preventing grids outside the kinematic reachability candidate region from being considered as candidate locations for the next trajectory point in subsequent predictions. Specifically, this can be achieved by setting the prediction confidence of grids outside the candidate region to negative infinity, setting it to a preset minimum value, or directly setting its corresponding probability to zero, etc. This embodiment does not specifically limit this.

[0082] It's important to note that the masking process is a hard constraint directly applied at the decoding output level of the trajectory prediction model. This means that after masking, the prediction probabilities corresponding to grids located outside the kinematically reachable candidate domain are strictly excluded. Regardless of the original confidence level of the trajectory prediction model's output for these grids, they cannot be selected as the next trajectory point. Unlike methods that use the kinematic equation residuals as a soft penalty term in the training loss and only indirectly affect the network output through gradients, this masking process can deterministically exclude physically inaccessible locations in every decoding prediction, resulting in stronger constraints and stricter guarantees of physical reachability.

[0083] Then, based on the prediction confidence after masking, the position coordinates of the next trajectory point are predicted.

[0084] For example, the grid with the highest confidence from the masked prediction confidence can be selected as the prediction grid where the next trajectory point is located; alternatively, the masked prediction confidence can be normalized to the probability distribution of each grid in the kinematically reachable candidate domain, and random sampling can be performed according to the probability distribution to obtain the prediction grid; alternatively, multiple samplings can be performed and the sampling results can be integrated to reduce the randomness of a single prediction. This embodiment does not specifically limit this.

[0085] After determining the prediction grid, the spatial location corresponding to the prediction grid, such as the coordinates of the grid center point, can be used as the location coordinates of the next trajectory point; if the aforementioned location coordinates have been normalized, they can also be denormalized into geographic coordinates expressed in latitude and longitude.

[0086] Furthermore, after obtaining the position coordinates of the next trajectory point, the predicted next trajectory point can be appended to the end of the conditional sequence, and steps 120 to 150 above can be repeated to iteratively predict trajectory points at more distant times in an autoregressive manner, thereby achieving multi-step trajectory prediction.

[0087] Furthermore, when evaluating the prediction results, the Haversine great circle distance can be used to measure the error between the predicted next trajectory point and the actual track point. The specific calculation method is as follows: ; ; in, and These represent the radian values ​​corresponding to the latitude of the actual waypoint and the predicted waypoint, respectively. This represents the difference between the latitude of the actual waypoint and the latitude of the predicted waypoint. This represents the difference between the longitude of the actual waypoint and the longitude of the predicted waypoint. This represents the Earth's radius, which can be taken as 6371 kilometers. Indicates preliminary error; Represents the arctangent function in the four quadrants; This represents the great circle distance between the actual and predicted track points on the Earth's surface. Using the great circle distance as an evaluation metric avoids the projection distortion introduced by measurements in planar coordinates, making the evaluation of prediction accuracy more closely aligned with practical maritime applications.

[0088] It should be noted that by masking the prediction confidence outside the kinematic reachability candidate domain, the prediction confidence output by the trajectory prediction model based on data statistical laws is combined with the physical reachability constraints constructed based on the instantaneous motion state of the ship at the decoding output level. This ensures that the final predicted next trajectory point not only conforms to the group navigation pattern learned by the model from massive historical trajectories, but also strictly meets the physical reachability requirements of ship motion, effectively avoiding physically unreasonable large jumps in the predicted trajectory point.

[0089] The method provided in this embodiment discretizes the position coordinates of each historical track point into a grid index in a geographic grid space, transforming the continuous track prediction problem into a discrete sequence classification problem. The track prediction model, modeled in an autoregressive manner, outputs the prediction confidence of the next trajectory point on each grid, enabling the prediction results to express spatial uncertainty. This overcomes the shortcomings of regression networks, which can only provide deterministic point estimates and are difficult to quantify risks. Based on this, the kinematically reachable candidate domains extending along the heading direction and scaling with speed are determined according to the ground speed and heading of the last historical track point. This fully utilizes the instantaneous motion state of the ship naturally carried in the AIS message. By masking the prediction confidence of grids outside the candidate domain, physically unreachable locations are hard-excluded at the decoding output level. This overcomes the shortcomings of isotropic grid neighborhood constraints, which allow high-speed ships to instantly move to the side or rear and allow anchored ships to make large jumps in prediction, thus significantly reducing the jump amplitude of predicted track points and improving the accuracy, physical rationality, and robustness of track prediction in scenarios such as speed changes and heading changes.

[0090] In some embodiments, the discrete track sequence includes the latitude index and longitude index of each of the historical track points; The step of determining the kinematically reachable candidate region based on the ground speed and ground heading of the last historical track point in the historical track includes: The ground heading and ground speed of the last historical track point are normalized to obtain normalized heading and normalized speed. Based on the normalized heading, determine the latitudinal and longitudinal heading components of the target vessel. The latitude reachable range is determined based on the latitude index of the last historical track point, the normalized speed, the preset forward reachable radius, the positive and negative parts of the heading component in the latitude direction, and the preset baseline tolerance. The longitude reachable range is determined based on the longitude index of the last historical track point, the normalized speed, the forward reachable radius, the positive and negative parts of the heading component in the longitude direction, the grid spacing correction value in the longitude direction, and the baseline tolerance. The kinematic reachable candidate domain is determined based on the latitude reachable range and the longitude reachable range.

[0091] Optionally, in determining the kinematically reachable candidate domain, the ground heading and ground speed of the last historical track point can be normalized to obtain the normalized heading. and normalized speed .

[0092] Specifically, normalized heading It can be obtained by dividing the original heading to the ground from the last historical track point by 360°, and its value ranges from [0,1); normalized speed It can be obtained by dividing the original ground speed of the last historical track point by the preset maximum speed, and its value ranges from [0,1]. A value of 0 indicates that the target vessel is stationary, and a value of 1 indicates that the target vessel is traveling at its maximum speed. It should be noted that if the ground speed and ground heading have been normalized to the [0,1) interval during the organization of historical tracks and retained along with the historical tracks, the normalized ground speed and ground heading from the last historical track point can also be directly read here. This embodiment does not specifically limit this.

[0093] Then, based on the normalized heading, the heading component of the target vessel in the latitudinal direction is determined. and the heading component in the longitude direction The heading component here is obtained by decomposing the heading direction indicated by the normalized heading in the latitude and longitude directions of the geographic grid space. It is used to quantitatively describe the projection intensity and projection direction of the instantaneous motion direction of the target ship in the two coordinate directions. The specific decomposition method can be periodic trigonometric function decomposition, etc., which is not specifically limited in this embodiment.

[0094] Furthermore, based on the latitude index of the last historical track point Normalized speed Preset forward reachable radius 1. Latitude direction heading component The positive and negative parts, and the preset baseline tolerance. Determine the latitude reachable range; and use the longitude index of the last historical track point. Normalized speed Preset forward reachable radius , longitude direction heading component Correction values ​​for positive and negative parts and grid spacing in the longitude direction and the preset baseline tolerance Determine the reachable longitude range.

[0095] Among them, the forward reachable radius This refers to the number of grid cells corresponding to the farthest distance a target vessel can reach along its course between two adjacent moments when it is traveling at maximum speed. This value can be set based on the AIS message broadcast interval, the maximum speed of the target vessel type, and the grid spacing. For example... The value can be 40, where the unit is the number of grid cells.

[0096] Baseline tolerance It is used to characterize the tolerance range corresponding to the limited maneuverability of a target ship in the direction perpendicular to the heading and in the opposite direction to the heading, and it is also expressed in units of grid cells.

[0097] For example, It can be determined based on the forward reachable radius. ,when hour, 8 is a good choice.

[0098] Grid spacing correction value This is used to compensate for the difference in physical spacing between longitude and latitudinal grids. Specifically, since the spacing between meridians on the Earth's surface decreases with increasing latitude, in high-latitude waters, the physical distance corresponding to the same angular spacing between longitude grids is less than that corresponding to the physical distance between latitudinal grids. Without correction, the number of grid cells corresponding to the same physically reachable distance in the longitude direction will be underestimated. Therefore, the grid spacing correction value can be determined by the following formula: ; in, This represents the median latitude of the target activity area. For example, when the latitude range of the target activity area is 55.5° to 58.0°, the median latitude can be 56.75°, corresponding to... Approximately 1.82; This represents the cosine function.

[0099] Finally, kinematic reachability candidate regions are determined based on the latitude and longitude reachability intervals. Specifically, the set of grids whose latitude index falls within the latitude reachability interval and whose longitude index falls within the longitude reachability interval can be determined as the kinematic reachability candidate region. That is, the kinematic reachability candidate region is an asymmetric rectangular candidate region jointly defined by the latitude and longitude reachability intervals.

[0100] Figure 5 This is a schematic diagram of the kinematic reachability candidate domain distribution provided by the present invention.

[0101] like Figure 5As shown, it should be noted that the forward projection of the kinematically reachable candidate domain is greater than 0 and less than or equal to the product of the normalized speed and the forward reachable radius, while the vertical projection is less than or equal to the baseline tolerance. Since both the latitudinal and longitude reachable intervals are controlled by the positive and negative parts of the heading component, respectively, and the extension along the heading direction scales linearly with the normalized speed, the determined kinematically reachable candidate domain exhibits an asymmetric shape in the geographic grid space that matches the instantaneous motion state of the target vessel: when the target vessel is traveling at high speed along a fixed heading, the candidate domain stretches along the heading direction, while only the baseline tolerance is retained in the reverse heading direction and the vertical heading direction; when the target vessel is at anchor or stationary, i.e., when the normalized speed approaches 0, the extension along the heading direction converges to 0, and the candidate domain degenerates into a small neighborhood centered on the grid where the last historical track point is located, with a radius equal to the baseline tolerance. When the normalized speed is high and the ship is sailing along a fixed course, the candidate domain is stretched along the course, thereby eliminating candidate positions that cannot be excluded by the isotropic grid neighborhood or that are physically inaccessible, such as those located to the side or rear.

[0102] In this embodiment, the ground speed and ground heading of the last historical track point are normalized and decomposed, and the latitude reachable range and longitude reachable range are constructed by combining the forward reachable radius, baseline tolerance and grid spacing correction value in the longitude direction, so that the kinematic reachable candidate domain can accurately characterize the difference in the ship's motion capability along the heading direction and perpendicular to the heading direction in the discrete grid space. Moreover, the reachable range distortion introduced by the inconsistency of the physical spacing of the latitude and longitude grids in high latitude waters is eliminated by the grid spacing correction value.

[0103] In some embodiments, determining the latitudinal and longitude components of the target vessel based on the normalized heading includes: The heading component in the latitudinal direction is determined based on the cosine value of the circumferential angle corresponding to the normalized heading. The heading component of the longitude direction is determined based on the sine value of the circumferential angle.

[0104] Optionally, when determining the heading component, the normalized heading can be used first. Restore it to its corresponding inscribed angle, that is Then, based on the cosine and sine values ​​of the inscribed angle, the latitudinal heading component is determined. and the heading component in the longitude direction The specific calculation formula is as follows: ; ; in, Indicates the normalized heading; and Let these represent the cosine function and the sine function, respectively. This represents the heading component in the latitudinal direction, and its value ranges from [-1, 1]. This represents the heading component in the longitude direction, and its value ranges from [-1, 1].

[0105] It should be noted that, according to maritime convention, the heading towards the ground starts at 0° for true north and increases clockwise. Therefore, when the target vessel is sailing in a true north direction, the normalized heading... =0, corresponding to , This indicates that the target ship's mobility extends entirely along the direction of increasing latitude; when the target ship is sailing due east, the corresponding... , This indicates that the target ship's mobility extends entirely along the direction of increasing longitude. For any other course, and The projection ratios of the heading direction in the latitude and longitude directions are given quantitatively, and the signs of the two indicate the direction of the projection.

[0106] In this embodiment, the heading components in the latitude and longitude directions are constructed by using the cosine and sine values ​​of the circular angle, respectively. This maps the periodic heading angle into a continuous and directionally distinguishable two-dimensional component representation. This not only maintains consistency with the navigational convention of using true north as the reference and measuring clockwise, but also avoids the impact of numerical jumps in the heading angle at the angle boundary on the calculation of the reachable region. This ensures that the kinematic reachable candidate domain can be constructed stably and accurately under any heading direction.

[0107] In some embodiments, determining the latitudinal reachability range based on the latitude index of the last historical waypoint, the normalized speed, a preset forward reachability radius, the positive and negative parts of the heading component in the latitudinal direction, and a preset baseline tolerance includes: The normalized speed, the forward reachable radius, and the negative part of the heading component in the latitudinal direction are multiplied to obtain the first product result; The difference between the latitude index of the last historical track point, the first product result, and the baseline tolerance is calculated to obtain the lower limit of the latitude reachable range. The normalized speed, the forward reachable radius, and the positive part of the heading component in the latitudinal direction are multiplied to obtain the second product result; The upper limit of the achievable latitude range is obtained by summing the latitude index of the last historical track point, the second product result, and the baseline tolerance. and Optionally, the heading component in the latitudinal direction The positive part can be represented as The negative part can be represented as Where max(·,0) is the function that takes the positive part, meaning it takes the value of the independent variable itself when the independent variable is positive, and takes the value of zero when the independent variable is negative or zero. Therefore, the latitudinal reachable interval... The specific calculation method is as follows: ; in, The first product result represents the speed-related extension of the target vessel along the direction of decreasing latitude; This is the result of the second product, which represents the speed-related extension of the target ship along the direction of increasing latitude.

[0108] It should be noted that, due to the positive part With negative part At most one of them is non-zero, therefore the reachable latitude range is asymmetrical in the direction of increasing latitude and decreasing latitude: when the target ship's course points in the direction of increasing latitude, that is... When positive, the upper limit of the interval extends along the direction of increasing latitude. Each grid cell, while the lower limit of the interval retains only the baseline tolerance. Conversely, when the heading points in the direction of decreasing latitude, the lower limit of the interval extends along the direction of decreasing latitude, while the upper limit of the interval retains only the baseline tolerance. Thus, the latitudinal reachable range ensures that the reachable range along the heading direction is commensurate with the speed, while strictly limiting the reachable range in the opposite heading direction to within the baseline tolerance.

[0109] In this embodiment, the asymmetric upper and lower limits of the latitudinal reachable range are constructed by multiplying the normalized speed, forward reachable radius, and the positive and negative parts of the heading component. This makes the candidate range linearly expand and contract with speed in the latitudinal direction and extend only in the direction indicated by the heading, thereby strictly excluding the physically inaccessible locations of the target ship in the latitudinal direction at the discrete grid level.

[0110] In some embodiments, determining the longitude reachable range based on the longitude index of the last historical waypoint, the normalized speed, the forward reachable radius, the positive and negative parts of the heading component in the longitude direction, the grid spacing correction value in the longitude direction, and the baseline tolerance includes: The third product result is obtained by multiplying the normalized speed, the forward reachable radius, and the ratio between the negative part of the heading component in the longitude direction and the grid spacing correction value. The difference between the longitude index of the last historical track point, the third product result, and the ratio between the baseline tolerance and the grid spacing correction value is calculated to obtain the lower limit of the longitude reachable range. The fourth product result is obtained by multiplying the normalized speed, the forward reachable radius, and the ratio of the positive part of the heading component in the longitude direction to the grid spacing correction value. The upper limit of the longitude reachable range is obtained by summing the longitude index of the last historical track point, the fourth product result, and the ratio between the baseline tolerance and the grid spacing correction value.

[0111] Alternatively, similar to the construction of the latitudinal reachable range, the longitude component... The positive part can be represented as The negative part can be represented as The difference lies in the fact that the extension range of the longitude reachable area must be divided by the grid spacing correction value. The correction is made, and the specific calculation method is as follows: ; in, This is the result of the third product, which represents the speed-related extension of the target ship along the direction of decreasing longitude; This is the fourth product result, which represents the speed-related extension of the target ship along the direction of increasing longitude.

[0112] For example, the latitude is 56.75°. In high-latitude active waters with a latitude of approximately 1.82, the angular span corresponding to the same physical distance in the longitude direction is approximately 1.82 times that in the latitudinal direction. This means the physical spacing of a single grid cell in the longitude direction is approximately 1 / 1.82 of that in the latitudinal direction. If no correction is made, directly defining the longitude reachable range using the same number of grid cells as in the latitudinal direction will amplify the physical distance of the longitude reachable range, causing the candidate domain to cover locations that are actually inaccessible to the target vessel. However, by dividing each extension amplitude in the longitude direction by the baseline tolerance... This ensures that the reachable range by longitude and the reachable range by latitude have a consistent reachability scale in terms of physical distance.

[0113] Furthermore, it should be noted that the above division by The method of correction is consistent with This is an implementation method that is consistent with the definition; as long as the reachable range in the longitude direction is equivalently compensated according to the latitude cosine relationship, this embodiment does not make specific limitations on this.

[0114] In this embodiment, by introducing a grid spacing correction value in the construction of the longitude reachable range, the reachability distortion caused by the inconsistency of the physical spacing between the longitude grid and the latitude grid in high-latitude waters is eliminated. This allows the kinematic reachable candidate domain to be screened based on the actual physical reachable distance in active waters at any latitude, further improving the physical accuracy and cross-water adaptability of the reachability constraint.

[0115] In some embodiments, the step of masking the prediction confidence of grids located outside the kinematically reachable candidate domain in the prediction confidence, and predicting the position coordinates of the next trajectory point based on the masked prediction confidence, includes: The prediction confidence of the grid located outside the kinematically reachable candidate domain is set to negative infinity to obtain the masked prediction confidence. According to the order of prediction confidence values ​​from largest to smallest, at least one candidate prediction confidence value is retained from the masked prediction confidence values, and the remaining prediction confidence values ​​in the masked prediction confidence values ​​other than the candidate prediction confidence values ​​are set to negative infinity to obtain the truncated prediction confidence values. The truncated prediction confidence is normalized to the probability distribution on each grid in the geographic grid space; Based on the probability distribution, at least one polynomial random sampling is performed iteratively. Based on the sampling results, obtain the prediction grid index corresponding to the next trajectory point; The position coordinates of the next trajectory point are obtained based on the predicted grid index.

[0116] Optionally, during the decoding and prediction process, the discrete track sequence corresponding to the first few historical track points can be used as a conditional sequence input into the trained track prediction model. The prediction confidence in the latitude direction and the prediction confidence in the longitude direction of the last time step are obtained through forward calculation, which are the latitude logical value and the longitude logical value.

[0117] For example, the length of the conditional sequence can be the same as the window length during the training phase. Consistency can be achieved by taking the top 10 historical track points. Furthermore, before applying constraints, the prediction confidence level can be temperature-scaled according to a preset temperature coefficient to adjust the sharpness of the prediction confidence distribution. For example, the temperature coefficient can be 1.0; this embodiment does not specifically limit this.

[0118] Then, for the latitudinal prediction confidence scores where the latitude index is outside the latitudinal reachable interval, and for the longitudinal prediction confidence scores where the longitude index is outside the longitude reachable interval, both are uniformly set to negative infinity to obtain the masked prediction confidence scores. It should be noted that setting the prediction confidence score to negative infinity ensures that its corresponding probability in the subsequent normalization process will be strictly zero. This deterministically excludes grids outside the kinematically reachable candidate domain during sampling, achieving a hard reachability constraint at the decoding output level.

[0119] Furthermore, considering that a large number of candidate grids with low confidence may still exist in the predicted confidence after masking, directly sampling all remaining candidates would result in a cumulative probability of low-confidence candidates being selected that cannot be ignored, potentially introducing unnecessary sampling noise. Therefore, candidate truncation can be performed. Specifically, according to the predicted confidence values ​​in descending order, the top_k maximum values ​​are retained from the predicted confidence values ​​in both the latitude and longitude directions after masking as candidate predicted confidence values, and the remaining predicted confidence values ​​are also set to negative infinity, resulting in the truncated predicted confidence values. The value of top_k can be set according to the balance between prediction diversity and stability requirements; for example, top_k can be 10, but this embodiment does not specifically limit this value.

[0120] Then, the predicted confidence scores of the truncated latitude and longitude directions are normalized to the probability distribution of each grid in the geographic grid space by the normalized exponential function (softmax), and at least one polynomial random sampling is performed iteratively according to the probability distribution. Based on the sampling results, the predicted grid index corresponding to the next trajectory point is obtained, including the predicted latitude index and longitude index.

[0121] It should be noted that using multinomial random sampling instead of directly selecting the grid with the highest confidence level preserves the spatial uncertainty expressed by the prediction confidence distribution. Furthermore, due to the randomness inherent in a single random sampling, the same sample can be sampled multiple times, i.e., the aforementioned multinomial random sampling is iteratively executed. The sampling results are integrated, for example, the minimum and average prediction errors corresponding to each sampling are taken as the prediction integration result of the sample, so as to reduce the impact of the randomness of a single sampling on the prediction result. This embodiment does not specifically limit the number of samplings.

[0122] Finally, the position coordinates of the next trajectory point are obtained based on the predicted grid index.

[0123] Specifically, the predicted grid index can be converted into normalized coordinates using the following formula: ; in, This indicates the predicted latitude or longitude index obtained from the sampling. This indicates the number of grid cells in the corresponding direction, i.e., the number of latitude grid cells. Or the number of longitude grids 0.5 represents the grid center offset, used to map the grid index to the center position of the grid; This represents the normalized coordinates of the next trajectory point. After obtaining the normalized coordinates, the normalized coordinates can be inversely normalized to geographic coordinates in degrees based on the global minimum and global maximum values ​​used in the aforementioned normalization process, and used as the position coordinates of the next trajectory point.

[0124] In this embodiment, by hard-shielding the prediction confidence outside the kinematically reachable candidate domain to negative infinity, truncating candidates according to confidence level, normalizing probability, and using a cascaded decoding process of multinomial random sampling, the next trajectory point obtained by the final sampling is strictly restricted to the candidate grid that is physically reachable and has high model confidence. This not only deterministically excludes unreachable locations at the decoding output level, but also preserves the spatial uncertainty expression of the prediction and suppresses sampling randomness through the integration of random sampling and multiple sampling, thus taking into account the physical rationality, accuracy, and risk quantification capability of the prediction.

[0125] In some embodiments, the trajectory prediction model includes a word embedding layer, a position encoding layer, a stacked encoding layer, and a classification head; the discrete trajectory sequence includes the latitude index and longitude index of each of the historical trajectory points; The step of inputting the discrete trajectory sequence into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target vessel in each grid of the geographic grid space includes: The latitude and longitude indices of each historical flight point are input into the word embedding layer to obtain word embedding vectors; The word embedding vector and the learnable positional encoding vector are input into the positional encoding layer to obtain the target input features; The target input features are input into the stacked coding layer to obtain the coded features; The encoded features are input into the classification head to obtain the prediction confidence of the next trajectory point in each grid in the geographic grid space.

[0126] Figure 6 This is a schematic diagram of the trajectory prediction model provided by the present invention.

[0127] like Figure 6 As shown, the trajectory prediction model consists of a word embedding layer, a position encoding layer, a stacked encoding layer, and a classification head connected in sequence.

[0128] For example, in this embodiment, the latitude range of the target activity water area is 55.5° to 58.0°, and the longitude range is 10.3° to 13.0°, corresponding to the number of latitude grids. Or the number of longitude grids .

[0129] Figure 7 This is a schematic diagram of the process for generating word embedding vectors provided by the present invention.

[0130] like Figure 7 As shown, the word embedding layer contains mutually independent dimensional embedding matrices. With longitude embedding matrix ;in, This represents the dimension of the dimension embedding vector. The dimension of the longitude embedding vector can be represented, for example, by taking... For the latitude index of each moment in the discrete track sequence. With longitude index The latitude and longitude embedding matrices are looked up separately to obtain the latitude and longitude embedding vectors for that moment. These two vectors are then concatenated along their feature dimensions to obtain the word embedding vector for that moment. .

[0131] It should be noted that the dual-path lexical embedding structure, which embeds latitude and longitude separately and then splices them together, reduces the number of parameters in the embedding space from the product of the number of latitude and longitude grids to the sum of the two, compared to the single-path embedding method that uniformly numbers the two-dimensional grid indices. This also allows the positional semantics in the latitude and longitude directions to be learned independently in the embedding space, which is beneficial for the model to separately characterize the motion patterns of ships in the two coordinate directions.

[0132] The position encoding layer is a learnable position parameter matrix. ;in, The window length is defined. The positional encoding layer adds the word embedding vector to the learnable positional encoding vector of the corresponding sequence position, and then performs random dropout processing to obtain the target input features. Since each word in the discrete track sequence does not carry temporal positional information, by superimposing learnable positional encodings, the stacked encoding layers can perceive the chronological order of each historical track point in the sequence.

[0133] Stacked coding layers comprise multiple stacked causal self-attention coding blocks, which, exemplarily, can be... The system consists of concatenated causal self-attention encoding blocks with identical structures. Each causal self-attention encoding block includes a first layer normalization (LayerNorm), a multi-head causal self-attention layer, a second layer normalization layer, and a feedforward multi-layer perceptron (MLP), with residual connections before and after the multi-head causal self-attention layer and the feedforward multi-layer perceptron. For example, the number of heads in the multi-head causal self-attention layer... Both the attention random deactivation ratio and the residual random deactivation ratio can be set to 0.3; the hidden layer dimension of the feedforward multilayer perceptron can be... The activation function can be a Gaussian Error Linear Unit (GELU). This embodiment does not specifically limit the above hyperparameters.

[0134] Figure 8 This is a schematic diagram of the causal mask used in the multi-head causal self-attention provided by the present invention.

[0135] like Figure 8 As shown, multi-head causal self-attention encodes target input features based on a causal mask. This causal mask is a lower triangular mask, used to control that the encoded features at each time step depend only on the historical track points at that time step and before it. This satisfies the constraint in autoregressive modeling that future information cannot be used, ensuring that the information visibility range is consistent between the training and decoding / prediction phases. Furthermore, to accommodate variations in input sequence length, when the input sequence length is no greater than the window length... At that time, it can be retrieved from the pre-stored data. The lower triangular mask extracts a sub-block of the corresponding size for masking; when the length of the input sequence is greater than the window length... When the input sequence is of the required length, a lower triangular mask is dynamically generated for masking.

[0136] The classification head first normalizes the encoded features output from the last causal self-attention encoding block, then linearly projects them onto a classification space whose dimensions are the sum of the number of latitude and longitude grids. For example, the dimension of this classification space is... The classification space is then split by dimension to obtain the prediction confidence scores for the latitude and longitude directions, i.e., latitude logits and longitude logits. Here, logits refers to the logical values.

[0137] In addition, the network parameters of the trajectory prediction model can be initialized using a truncated normal distribution with a mean of 0 and a standard deviation of 0.02. The bias of the layer normalization is initialized to 0 and the weight is initialized to 1 to ensure numerical stability in the early stage of training.

[0138] In this embodiment, the input representation of the discrete track sequence is constructed by dual-path lexical embedding and learnable positional encoding. The dependency between any two historical track points in the track sequence is modeled in the global receptive field by multiple stacked causal self-attention encoding blocks. This effectively overcomes the gradient vanishing and gradient explosion problems of traditional recurrent structures when processing long sequences, and enhances the ability to characterize long-range dependencies and nonlinear navigation patterns. At the same time, the classification head outputs the prediction confidence on discrete grids in both latitude and longitude directions.

[0139] In some embodiments, the training steps of the trajectory prediction model include: The historical flight paths of the sample are sampled by a sliding window with a fixed window length to obtain a sample flight path sequence. A valid point mask corresponding to the sample flight path sequence is generated based on whether each sample flight path point in the sample flight path sequence is a valid point. The discrete track sequence corresponding to the sample track sequence is input into the generative sequence modeling network to obtain the sample prediction confidence level corresponding to each time step in the sample track sequence. The classification loss is determined based on the sample prediction confidence of the last preset number of time steps of the sample trajectory sequence and the target grid index corresponding to each of the last preset number of time steps. The sample prediction confidence of the last preset number of time steps is subjected to neighborhood fuzzy smoothing, and the smoothing loss is determined based on the fuzzy smoothed sample prediction confidence and the target grid index. The total loss is determined based on the classification loss, the smoothing loss, and the mask values ​​corresponding to the last preset number of time steps in the effective point mask. The generative sequence modeling network is iteratively trained based on the total loss to obtain the trajectory prediction model.

[0140] It should be noted that the methods for collecting, parsing, cleaning, normalizing, and discretizing the historical tracks of the samples can be the same as those for processing the historical tracks of the target ships. Specifically, when performing maximum-minimum normalization on the longitude and latitude columns of the sample historical tracks based on global statistics, a two-pass scanning strategy can be adopted: The first pass scans and calculates the global minimum and maximum values ​​for the longitude and latitude columns in all sample data files. Records with Boolean values ​​of false, null, or missing are converted to 0 and included in the statistics to preserve their dimensional position. The second pass normalizes the longitude and latitude of each record based on the global statistical results. For columns where the global maximum and minimum values ​​are equal, normalization is skipped to avoid division by zero. This normalization method based on global statistics ensures that coordinate mappings across different files and at different times are consistent within the same reference system.

[0141] Figure 9This is a schematic diagram of the sliding window sampling provided by the present invention.

[0142] like Figure 9 As shown, the window length can be set during the training sample construction process. With sliding step size For each length of The sample historical flight path, along the time direction with step size Cut the length in sequence as follows Continuous track segments are used as sample track sequences. For example, the window length is set. Sliding step size Then the length of each strip is The historical flight tracks of the samples can be intercepted. The nth sample track sequence, of which the nth The sample track sequence is taken from the first sample track of the original track. To the One waypoint When the length of the sample historical track is less than the window length At that time, the flight path will not be used for sampling.

[0143] Figure 10 This is a schematic diagram of the effective dot mask provided by the present invention.

[0144] like Figure 10 As shown, simultaneously, for each position in the sample track sequence, a valid point mask is generated based on whether its corresponding sample track point is a valid point. The condition for determining a sample track point as a valid point is that its longitude and latitude are not both 0; a mask value of 1 indicates that the position is a valid observation point, and a value of 0 indicates that the position is an invalid point or a filled point with all coordinates 0; for a sample track sequence consisting entirely of valid observations, its valid point mask is all 1s.

[0145] It should be noted that the fixed window length sampling strategy ensures that the sample track sequences are of equal length, which facilitates batch training. At the same time, through the effective point masking mechanism, the historical tracks of samples containing missing or abnormal observations can also be fully utilized without discarding the entire track, which significantly improves the data utilization rate.

[0146] Then, the discrete track sequence corresponding to the sample track sequence is taken as the input and the whole is taken as the target for the next position prediction. It is then input into the generative sequence modeling network to obtain the sample prediction confidence of each time step in the sample track sequence, including the latitude logical value and longitude logical value of each time step.

[0147] Figure 11 This is a schematic diagram of the loss calculation range for the last preset number of time steps provided by the present invention.

[0148] like Figure 11 As shown, when determining the classification loss, the preset number of steps is only applied to the end of the sample track sequence. The loss is calculated at each time step, for example, when the window length... At that time, focus on the number of steps. Option 3 is acceptable. Specifically, the classification loss includes latitude classification loss and longitude classification loss; the smoothing loss includes latitude smoothing loss and longitude smoothing loss; among them, the latitude classification loss is the latitude logical value at the end. The cross-entropy loss of the sample prediction confidence at each time step relative to the latitude target index, and the longitude classification loss are the longitude logistic values ​​at the end. The cross-entropy loss of the sample prediction confidence at each time step relative to the longitude target index; the latitude smoothing loss is the latitude logical value at the end. The cross-entropy loss of the sample prediction confidence after fuzzy smoothing at each time step relative to the latitude target index, and the longitude smoothing loss are the longitude logical values ​​at the end. The cross-entropy loss of the sample prediction confidence after fuzzy smoothing at each time step relative to the longitude target index is expressed as follows: ; ; in, The latitude loss value is used to superimpose the latitude classification loss and the latitude smoothing loss. The longitude loss value is the sum of the longitude classification loss and the longitude smoothing loss. and These represent the latitude logical value and longitude logical value in the sample prediction confidence, respectively; and They represent the end. The latitude and longitude target indices corresponding to each time step are also the grid indices of the grid into which the actual track point falls at the next moment of each time step. Represents the cross-entropy loss function; This represents the smoothing coefficient, which can be set to 0.1 for example. and This indicates retrieving the data corresponding to the last K time steps.

[0149] It should be noted that this only applies to the end. Calculating the loss at each time step allows the model's optimization objective to focus on the task of making the next prediction based on sufficient historical observations, avoiding the dilution of loss caused by high uncertainty predictions in the early stages of the sequence due to insufficient conditional observations; while label smoothing can suppress the model's overconfidence in a single target grid and improve generalization ability.

[0150] Furthermore, based on the classification loss, smoothing loss, and the end of the effective point mask... The mask value corresponding to each time step determines the total loss.

[0151] For example, the smoothing loss can be first added to the corresponding classification loss, then the summed latitude and longitude losses can be calculated, and the result can be sorted by the last digit. The total loss of the sample is obtained by weighted averaging of the effective point masks at each time step: ; in, Indicates the end of the valid point mask The mask value corresponding to each time step; This indicates summation along the time step dimension; This represents the total loss for that sample. By using a weighted effective point mask, the time steps corresponding to invalid points or filled points with all zero coordinates are not included in the loss calculation, thus avoiding interference from invalid observations on model training.

[0152] Finally, the generative sequence modeling network is iteratively trained based on the total loss to obtain the trajectory prediction model.

[0153] For example, in this embodiment, an Adaptive Moment Estimation with Weight Decay (AdamW) optimizer can be used, with an initial learning rate set to 1×10⁻⁶. -4 The first-order moment decay coefficient β1 = 0.9 and the second-order moment decay coefficient β2 = 0.95; the weight decay coefficient is set to 0.1 and only applies to the weight matrices of linear and convolutional layers; bias, layer normalized weights, and positional encoding do not participate in weight decay; the gradient is clipped to 1.0 according to the global norm; the learning rate adopts a scheduling strategy of linear warm-up plus cosine annealing. During the warm-up phase, the learning rate increases linearly with the number of processed tokens to the initial learning rate, and after the warm-up, it decays according to a cosine curve to 10% of the initial learning rate; the batch size is 32, the maximum number of training epochs is 20, and the random number seed is fixed at 42 to ensure the reproducibility of the experiment. During training, the loss is calculated on the validation set after each training epoch, and the model weights with the lowest loss on the validation set are saved as the optimal trajectory prediction model. All of the above training hyperparameters can be adjusted according to actual training needs, and this embodiment does not impose specific limitations on them.

[0154] Figure 12 This is a schematic diagram of the curves showing how the training loss and validation loss change with the number of iterations, as provided by this invention.

[0155] like Figure 12As shown, when training a generative sequence modeling network using the above training strategy, the training loss and validation loss converge smoothly to a low level with each iteration, indicating that the model training process is stable and effective.

[0156] Figure 13 This is a schematic diagram of the prediction comparison results of the test set tracks provided by the present invention. Figure 14 This is a schematic diagram of the prediction error distribution of the test set track provided by the present invention.

[0157] like Figure 13 and Figure 14 As shown, the method of this embodiment is used to make predictions on the test set. The minimum prediction error corresponding to the minimum value of multiple sampling results and the average prediction error corresponding to the average value are statistically analyzed according to the Haversine great circle distance. Both converge to a low level, and the predicted points match the actual tracks well, which verifies the effectiveness of the method of this embodiment.

[0158] In this embodiment, a training sample of equal length that can make full use of missing observation tracks is constructed by using a sliding window sampling with a fixed window length and an effective point masking mechanism. The optimization objective is focused on the next prediction task by using a labeled smoothing classification loss with a preset number of steps at the end. The smoothing loss and mask weighting are superimposed to enable the track prediction model to efficiently learn the statistical laws of group navigation at time steps with reliable supervision information, which effectively improves the model's training efficiency, generalization ability and robustness to missing and abnormal observations.

[0159] In some embodiments, performing neighborhood fuzzy smoothing on the sample prediction confidence of the last preset number of time steps, and determining the smoothing loss based on the fuzzy smoothed sample prediction confidence and the target grid index, includes: Log-normalize the sample prediction confidence scores of the last preset number of time steps to obtain the log probabilities; The log probability is smoothed at least once by one-dimensional neighborhood average convolution to obtain the smoothed log probability. The smoothing loss is determined based on the negative log-likelihood of the smoothed probability relative to the target grid index.

[0160] Figure 15 This is a schematic diagram of probabilistic fuzzy smoothing provided by the present invention.

[0161] like Figure 15 As shown, when determining the smoothing loss, one can first consider the end... The latitude and longitude logical values ​​at each time step are log-normalized using a log-normalized exponential function (log softmax) to obtain the log probabilities of the latitude and longitude directions.

[0162] Then, a one-dimensional neighborhood averaging convolution is used to perform fuzzy smoothing on the aforementioned logarithmic probabilities. For example, the kernel of the one-dimensional neighborhood averaging convolution can be [1 / 3, 1 / 3, 1 / 3], and a copy edge padding method is used to handle grid boundaries. That is, values ​​at grid index boundaries are padded with their edge values ​​before performing convolution to avoid distortion of the smoothing results at the boundaries. Furthermore, the above fuzzy smoothing process can be iteratively executed at least once; for example, iterative execution... This process involves iterating multiple times to gradually expand the smooth neighborhood range, allowing the probability quality to spread to a wider range of adjacent grids.

[0163] Finally, the negative log-likelihood loss relative to the target grid index is calculated using the smoothed log probability as the smoothing loss. This smoothing loss is then added to the corresponding classification loss with a preset weight. For example, the preset weight... 1.0 is acceptable, but this embodiment does not specifically limit it.

[0164] It should be noted that due to the inherent quantization error in the grid discretization process of location coordinates, the actual waypoints may fall near the boundary between the target grid and its neighboring grids. If only strictly hitting a single target grid is used as the supervision target, the model is prone to overconfidence in that single grid and is quite sensitive to quantization errors and outlier observations. However, by performing fuzzy smoothing on the log probability through neighborhood averaging convolution before calculating the negative log likelihood, it is equivalent to encouraging the model to smoothly distribute the predicted probabilities across the target grid and its neighboring grids. In other words, as long as the predicted probabilities are concentrated within the neighborhood of the target grid, the smoothing loss can achieve a smaller value. Thus, the smoothing loss and classification loss work together: the classification loss ensures that the predicted probabilities are concentrated on the target grid, while the smoothing loss ensures a smooth transition in the probability distribution across adjacent geographic grids.

[0165] In this embodiment, a smoothing loss is constructed by log normalization, iterative fuzzy smoothing of one-dimensional neighborhood average convolution, and cascaded calculation of negative log-likelihood. This encourages a smooth transition of prediction probabilities on adjacent geographic grids and suppresses the model's overconfidence in a single grid. This effectively improves the robustness of the trajectory prediction model to grid quantization errors and anomalous observations, making the distribution of prediction confidence in the model output smoother and more reasonable. It also provides a more stable sampling basis for multinomial random sampling based on probability distribution in the decoding stage.

[0166] In summary, the method provided in this application models continuous trajectory prediction as a discrete sequence classification problem. It models long-range trajectory dependencies through dual-path word embedding and causal self-attention, improves model robustness through multi-step focusing cross-entropy and probabilistic fuzzy smoothing loss at the end, and incorporates the ship's instantaneous motion state into the decoding process by sampling based on kinematic reachability constraints of ground speed and ground heading. It also eliminates unreachable jumps from the perspective of physical reachability and uses Haversine great circle distance as a unified metric. Thus, it achieves ship trajectory prediction with small prediction jumps, high accuracy in maneuvering scenarios, and the ability to express spatial uncertainty, providing a new technical approach for ship navigation situational awareness, collision warning, and maritime supervision.

[0167] The ship trajectory prediction system based on kinematic reachability constraints provided by the present invention will be described below. The ship trajectory prediction system based on kinematic reachability constraints described below can be referred to in correspondence with the ship trajectory prediction method based on kinematic reachability constraints described above.

[0168] Figure 16 This is a schematic diagram of the ship trajectory prediction system based on kinematic reachability constraints provided by the present invention; as shown. Figure 16 As shown, the system includes: The acquisition unit 1610 is used to acquire the historical track of the target ship; the historical track includes multiple historical track points sorted by time, and each historical track point includes position coordinates, speed above ground and heading above ground; The discretization unit 1620 is used to discretize the position coordinates of each historical track point into a grid index in the geographic grid space to obtain a discrete track sequence. The first prediction unit 1630 is used to input the discrete trajectory sequence into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target ship in each grid in the geographic grid space. The candidate domain determination unit 1640 is used to determine the kinematically reachable candidate domain based on the ground speed and ground heading of the last historical track point in the historical track; the kinematically reachable candidate domain extends along the heading direction indicated by the ground heading of the last historical track point, with the grid where the last historical track point is located as a reference, and expands and contracts with the ground speed of the last historical track point. The second prediction unit 1650 is used to mask the prediction confidence of grids located outside the kinematically reachable candidate domain in the prediction confidence, and predict the position coordinates of the next trajectory point based on the masked prediction confidence. The trajectory prediction model is obtained by training a generative sequence modeling network based on the sample historical trajectories of the sample ships. The generative sequence modeling network is used to model the probability distribution of discrete trajectory sequences in an autoregressive manner.

[0169] The system provided in this embodiment discretizes the position coordinates of each historical track point into grid indices in a geographic grid space, transforming the continuous track prediction problem into a discrete sequence classification problem. The track prediction model, modeled in an autoregressive manner, outputs the prediction confidence of the next trajectory point on each grid, enabling the prediction results to express spatial uncertainty. This overcomes the shortcomings of regression networks, which can only provide deterministic point estimates and are unable to quantify risks. Furthermore, based on the ground speed and ground heading of the last historical track point, a kinematically reachable candidate domain extending along the heading direction and scaling with speed is determined. This fully utilizes the instantaneous motion state of the ship naturally carried in the AIS message. By masking the prediction confidence of grids outside the candidate domain, physically unreachable locations are hard-excluded at the decoding output level, significantly reducing the jump amplitude of predicted track points. This improves the accuracy, physical rationality, and robustness of track prediction in scenarios such as speed changes and course changes, providing a new technical approach for ship navigation situational awareness, collision warning, and maritime supervision.

[0170] The system provided by this invention is used to execute the above-described method embodiments. For specific processes and details, please refer to the above embodiments, which will not be repeated here.

[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting ship tracks based on kinematic reachability constraints, characterized in that, include: Obtain the historical track of the target vessel; the historical track includes multiple historical track points sorted by time, and each historical track point includes position coordinates, speed above ground and heading above ground; The location coordinates of each historical track point are discretized into grid indices in a geographic grid space to obtain a discrete track sequence. The discrete trajectory sequence is input into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target ship in each grid in the geographic grid space. Based on the ground speed and ground heading of the last historical track point in the historical track, a kinematic reachable candidate region is determined; the kinematic reachable candidate region is based on the grid where the last historical track point is located, extends along the heading direction indicated by the ground heading of the last historical track point, and expands and contracts with the ground speed of the last historical track point. The prediction confidence of grids located outside the kinematically reachable candidate domain is masked, and the position coordinates of the next trajectory point are predicted based on the masked prediction confidence. The trajectory prediction model is obtained by training a generative sequence modeling network based on the sample historical trajectories of the sample ships. The generative sequence modeling network is used to model the probability distribution of discrete trajectory sequences in an autoregressive manner.

2. The ship trajectory prediction method based on kinematic reachability constraints according to claim 1, characterized in that, The discrete track sequence includes the latitude index and longitude index of each of the historical track points; The step of determining the kinematically reachable candidate region based on the ground speed and ground heading of the last historical track point in the historical track includes: The ground heading and ground speed of the last historical track point are normalized to obtain normalized heading and normalized speed. Based on the normalized heading, determine the latitudinal and longitudinal heading components of the target vessel. The latitude reachable range is determined based on the latitude index of the last historical track point, the normalized speed, the preset forward reachable radius, the positive and negative parts of the heading component in the latitude direction, and the preset baseline tolerance. The longitude reachable range is determined based on the longitude index of the last historical track point, the normalized speed, the forward reachable radius, the positive and negative parts of the heading component in the longitude direction, the grid spacing correction value in the longitude direction, and the baseline tolerance. The kinematic reachable candidate domain is determined based on the latitude reachable range and the longitude reachable range.

3. The ship trajectory prediction method based on kinematic reachability constraints according to claim 2, characterized in that, The step of determining the latitudinal and longitudinal heading components of the target vessel based on the normalized heading includes: The heading component in the latitudinal direction is determined based on the cosine value of the circumferential angle corresponding to the normalized heading. The heading component of the longitude direction is determined based on the sine value of the circumferential angle.

4. The ship trajectory prediction method based on kinematic reachability constraints according to claim 2, characterized in that, The step of determining the latitudinal reachability range based on the latitude index of the last historical waypoint, the normalized speed, the preset forward reachability radius, the positive and negative parts of the heading component in the latitudinal direction, and the preset baseline tolerance includes: The normalized speed, the forward reachable radius, and the negative part of the heading component in the latitudinal direction are multiplied to obtain the first product result; The difference between the latitude index of the last historical track point, the first product result, and the baseline tolerance is calculated to obtain the lower limit of the latitude reachable range. The normalized speed, the forward reachable radius, and the positive part of the heading component in the latitudinal direction are multiplied to obtain the second product result; The upper limit of the achievable latitude range is obtained by summing the latitude index of the last historical track point, the second product result, and the baseline tolerance.

5. The ship trajectory prediction method based on kinematic reachability constraints according to claim 2, characterized in that, The step of determining the longitude reachable range based on the longitude index of the last historical waypoint, the normalized speed, the forward reachable radius, the positive and negative parts of the heading component in the longitude direction, the grid spacing correction value in the longitude direction, and the baseline tolerance includes: The third product result is obtained by multiplying the normalized speed, the forward reachable radius, and the ratio between the negative part of the heading component in the longitude direction and the grid spacing correction value. The difference between the longitude index of the last historical track point, the third product result, and the ratio between the baseline tolerance and the grid spacing correction value is calculated to obtain the lower limit of the longitude reachable range. The fourth product result is obtained by multiplying the normalized speed, the forward reachable radius, and the ratio of the positive part of the heading component in the longitude direction to the grid spacing correction value. The upper limit of the longitude reachable range is obtained by summing the longitude index of the last historical track point, the fourth product result, and the ratio between the baseline tolerance and the grid spacing correction value.

6. The ship trajectory prediction method based on kinematic reachability constraints according to any one of claims 1-5, characterized in that, The step of masking the prediction confidence of grids located outside the kinematically reachable candidate region in the prediction confidence, and predicting the position coordinates of the next trajectory point based on the masked prediction confidence, includes: The prediction confidence of the grid located outside the kinematically reachable candidate domain is set to negative infinity to obtain the masked prediction confidence. According to the order of prediction confidence values ​​from largest to smallest, at least one candidate prediction confidence value is retained from the masked prediction confidence values, and the remaining prediction confidence values ​​in the masked prediction confidence values ​​other than the candidate prediction confidence values ​​are set to negative infinity to obtain the truncated prediction confidence values. The truncated prediction confidence is normalized to the probability distribution on each grid in the geographic grid space; Based on the probability distribution, at least one polynomial random sampling is performed iteratively. Based on the sampling results, obtain the prediction grid index corresponding to the next trajectory point; The position coordinates of the next trajectory point are obtained based on the predicted grid index.

7. The ship trajectory prediction method based on kinematic reachability constraints according to any one of claims 1-5, characterized in that, The trajectory prediction model includes a word embedding layer, a position encoding layer, a stacked encoding layer, and a classification head; the discrete trajectory sequence includes the latitude index and longitude index of each of the historical trajectory points; The step of inputting the discrete trajectory sequence into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target vessel in each grid of the geographic grid space includes: The latitude and longitude indices of each historical flight point are input into the word embedding layer to obtain word embedding vectors; The word embedding vector and the learnable positional encoding vector are input into the positional encoding layer to obtain the target input features; The target input features are input into the stacked coding layer to obtain the coded features; The encoded features are input into the classification head to obtain the prediction confidence of the next trajectory point in each grid in the geographic grid space; The stacked coding layer includes multiple stacked causal self-attention coding blocks. The causal self-attention coding blocks are used to encode the target input features based on a causal mask to obtain the encoded features. The causal mask is used to control that the encoded features at each time step depend only on the time step and the historical track points before it.

8. The ship trajectory prediction method based on kinematic reachability constraints according to any one of claims 1-5, characterized in that, The training steps for the trajectory prediction model include: The historical flight paths of the sample are sampled by a sliding window with a fixed window length to obtain a sample flight path sequence. A valid point mask corresponding to the sample flight path sequence is generated based on whether each sample flight path point in the sample flight path sequence is a valid point. The discrete track sequence corresponding to the sample track sequence is input into the generative sequence modeling network to obtain the sample prediction confidence level corresponding to each time step in the sample track sequence. The classification loss is determined based on the sample prediction confidence of the last preset number of time steps of the sample trajectory sequence and the target grid index corresponding to each of the last preset number of time steps. The sample prediction confidence of the last preset number of time steps is subjected to neighborhood fuzzy smoothing, and the smoothing loss is determined based on the fuzzy smoothed sample prediction confidence and the target grid index. The total loss is determined based on the classification loss, the smoothing loss, and the mask values ​​corresponding to the last preset number of time steps in the effective point mask. The generative sequence modeling network is iteratively trained based on the total loss to obtain the trajectory prediction model.

9. The ship trajectory prediction method based on kinematic reachability constraints according to claim 8, characterized in that, The step of performing neighborhood fuzzy smoothing on the sample prediction confidence of the last preset number of time steps, and determining the smoothing loss based on the fuzzy smoothed sample prediction confidence and the target grid index, includes: Log-normalization is performed on the sample prediction confidence scores of the last preset number of time steps to obtain the log probabilities; The log probability is smoothed at least once by one-dimensional neighborhood average convolution to obtain the smoothed log probability. The smoothing loss is determined based on the negative log-likelihood of the smoothed probability relative to the target grid index.

10. A ship trajectory prediction system based on kinematic reachability constraints, characterized in that, include: The acquisition unit is used to acquire the historical track of the target ship; the historical track includes multiple historical track points ordered by time, and each historical track point includes position coordinates, speed above ground and heading above ground; Discretization unit, used to discretize the position coordinates of each historical track point into a grid index in geographic grid space, to obtain a discrete track sequence; The first prediction unit is used to input the discrete trajectory sequence into the trajectory prediction model to obtain the prediction confidence of the next trajectory point of the target ship in each grid in the geographic grid space. The candidate domain determination unit is used to determine the kinematically reachable candidate domain based on the ground speed and ground heading of the last historical track point in the historical track; the kinematically reachable candidate domain extends along the heading direction indicated by the ground heading of the last historical track point, with the grid where the last historical track point is located as the reference, and expands and contracts with the ground speed of the last historical track point. The second prediction unit is used to mask the prediction confidence of grids located outside the kinematically reachable candidate domain in the prediction confidence, and predict the position coordinates of the next trajectory point based on the masked prediction confidence. The trajectory prediction model is obtained by training a generative sequence modeling network based on the sample historical trajectories of the sample ships. The generative sequence modeling network is used to model the probability distribution of discrete trajectory sequences in an autoregressive manner.