Route and speed method for saving fuel based on trajectory prediction and environmental constraints
Patent Information
- Application Number
- CN202611087711.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-08-21
AI Technical Summary
该类方法能够满足基本连通和避障要求,但仍存在不足:候选航线与历史AIS通行走廊结合不够紧密,容易得到几何可行但不符合实际通行习惯的航线;候选筛选、环境匹配和燃油评价的时间、空间基准不一致时,不同候选方案之间的燃油结果也难以保证可比性;航线优化和速度优化分别处理或顺序处理时,还容易出现航线阶段节油而速度阶段难以满足预计到达时间的问题
(1)将预测基线航线作为目标船舶的航行趋势参考,并结合历史AIS通行走廊生成候选空间,减少偏离AIS通行走廊的候选航线。
Smart Images

Figure CN122607493A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent navigation and energy-saving optimization of shipping, and relates to a fuel-saving method for route speed based on trajectory prediction and environmental constraints. It is a fuel-saving optimization method for ship route speed that integrates trajectory prediction, navigability constraints and environmental matching on the basis of ensuring navigability safety. Background Technology
[0002] The Automatic Identification System (AIS) records a vessel's latitude and longitude position, speed over land, heading over land, timestamp, and MMSI (Maintenance, Marking, and Stamp) information during its navigation. After cleaning, segmenting, and organizing historical AIS tracks by time, a record is generated of commonly used navigation channels, speed changes, turning habits, and traffic flow distribution within the target sea area. These records are used to predict subsequent navigation trends and to determine whether candidate routes conform to the actual traffic habits in that sea area.
[0003] A ship's actual energy consumption is not solely determined by the length of the route. On the same route, under different wind, wave, and current conditions, a ship's speed relative to the water, propulsion load, and fuel consumption will all vary. Especially in areas with significant ocean currents, the AIS records the speed relative to the ground, which cannot be directly used as the speed input for fuel consumption evaluation; if ocean current vectors are not considered, downstream and upstream sections will be incorrectly treated as having the same propulsion load.
[0004] Existing ship route planning methods mostly rely on preset routes, experienced routes, grid searches, or graph searches to generate candidate paths from the origin to the destination, and avoid land, obstacles, or restricted areas. While these methods can meet basic connectivity and obstacle avoidance requirements, they still have shortcomings: the candidate routes are not closely integrated with historical AIS corridors, easily resulting in geometrically feasible routes that do not conform to actual traffic habits; when the temporal and spatial benchmarks for candidate selection, environmental matching, and fuel evaluation are inconsistent, the fuel results between different candidate schemes are difficult to compare; and when route optimization and speed optimization are handled separately or sequentially, the problem of fuel savings in the route stage but failure to meet the expected arrival time in the speed stage can easily occur.
[0005] Transformer-based ship trajectory prediction methods learn the temporal relationships between position, speed, heading, and environmental characteristics from historical AIS sequences to generate predicted trajectories that conform to historical navigation patterns. However, the predicted trajectory represents the future navigation trend of the target ship in a given context and is not equivalent to the final optimized route. Directly using the predicted trajectory as the final route requires further handling of issues such as local detours, excessively high fuel consumption in upstream sections, unreasonable speed changes, and failure to meet expected arrival times.
[0006] There is a mutual influence between route optimization and speed optimization. Changes in route geometry will alter segment distances, headings, and the direction of encountered currents; changes in speed allocation will also affect segment transit times, surface speed, and fuel assessment results. Therefore, a route and speed optimization method that can simultaneously handle trajectory prediction, AIS passage corridors, navigability constraints, wind, wave, and current matching, fuel assessment based on surface speed, and estimated arrival time constraints is still needed. Summary of the Invention
[0007] To address the aforementioned issues, this invention provides a fuel-saving route speed method based on trajectory prediction and environmental constraints. The method first generates a predicted baseline route based on the six-dimensional AIS status. Then, using the predicted baseline route as a reference, candidate routes are generated by combining the AIS passageway and navigable constraint space, and candidate routes that do not meet safety constraints are eliminated. For the retained candidate routes, a unified fuel consumption calculation method is used to obtain a fuel consumption comparison value, and routes to be refined are selected according to the fuel consumption comparison value from smallest to largest. Subsequently, problematic segments in the routes to be refined are locally refined to obtain refined candidate routes. Finally, wind, wave, and ocean current environmental data are re-matched to the refined candidate routes, fuel consumption is calculated according to the current-corrected water velocity, and segmented speed optimization is performed under the constraints of expected arrival time and speed boundaries, outputting a combined route speed scheme.
[0008] A fuel-saving method for flight speed based on trajectory prediction and environmental constraints includes the following steps: Step 1: State data construction.
[0009] Acquire AIS track point data for the target vessel, basic vessel parameters, wind and wave environmental data for the target sea area, ocean current environmental data, and navigation constraint data. The AIS track point data includes vessel identification information (MMSI), timestamp, latitude and longitude, speed over land (SOG), and heading over land (COG). Basic vessel parameters include hull type, draft, dimensions, deadweight tonnage, and other parameters required for the preset fuel consumption assessment method. Wind and wave environmental data for the target sea area includes the eastward and northward components of the wind field and significant wave height. Ocean current environmental data includes the eastward and northward components of the ocean current. Navigation constraint data includes coastline, land cover, water depth, restricted / prohibited navigation areas, and route planning data.
[0010] AIS track points are grouped according to the vessel identification information MMSI, and arranged in ascending order of timestamp within each group; AIS track points with duplicate timestamps, inverted timestamps, missing latitude and longitude, missing SOG, or missing COG are deleted; the time interval, segment distance, implicit speed, and COG change are calculated for adjacent AIS track points after cleaning. When any of these does not meet the preset continuity condition, the voyage is split between the corresponding adjacent AIS track points.
[0011] Wind speed and significant wave height are matched according to the latitude and longitude position and timestamp of the AIS trajectory points, and the latitude and longitude, SOG, COG, wind speed and significant wave height are normalized to obtain a six-dimensional AIS state sequence arranged in the order of timestamps.
[0012] The trajectory point state variables are constructed using the following formula: in, Indicates the first Status of each AIS trajectory point; superscript This represents the normalized quantity; , This represents the total number of AIS trajectory point states. , , , , and These represent the normalized latitude, longitude, speed above ground, heading above ground, wind speed, and significant wave height, respectively. Indicates by A six-dimensional AIS state sequence composed of the states of AIS trajectory points in chronological order.
[0013] Step 2: Predicting baseline route generation.
[0014] For the target voyage, the continuous AIS states observed before the prediction start time are used as the historical context, and the destination position of the target voyage is used as the target condition. The historical context and the destination position of the target voyage are input into the trained environment-enhanced trajectory prediction model to generate the predicted baseline route.
[0015] The environment-enhanced trajectory prediction model employs a decoder-only causal Transformer, without an encoder or cross-attention; specifically as follows: The single-label input is replaced with a six-dimensional AIS state input. The six-dimensional AIS state variables are normalized, discretized, and channel embedded to form state embeddings, which are then concatenated in a fixed order to form a time-step state embedding vector. The query vector mapping layer, key vector mapping layer, value vector mapping layer, attention output layer, feedforward network, layer normalization, and learnable position embedding in the causal Transformer backbone are all configured according to the dimensions of the time-step state embedding vector.
[0016] After undergoing the same normalization, discretization, and channel embedding processes, the target state is linearly mapped to obtain the target conditional embedding. The state embedding, position embedding, and target conditional embedding at each historical time step are summed and input into the causal Transformer backbone. During inference, the target conditional embedding remains unchanged.
[0017] After the causal Transformer backbone outputs the hidden states, it finally generates the total output vector, and divides it into six logits segments according to the six state channels: latitude, longitude, SOG, COG, wind speed, and significant wave height. The probability of each segment is obtained by softmax.
[0018] During training, the six-dimensional AIS state sequence is shifted to the right to form the input and supervision targets. The cross-entropy loss of the six state channels is calculated separately and then summed according to preset weights. The loss weight of the SOG channel is greater than that of other state channels, and the filling position is not included in the training loss.
[0019] During inference, the output of the last time step in the current context is used to generate the next predicted state. Latitude and longitude categories are limited to the neighborhood of the previous position, and SOG category is limited to the feasible speed range. After constraints, the latitude, longitude, SOG, and COG categories with the highest probabilities are selected and inversely normalized to obtain candidate positions, candidate SOGs, and candidate COGs. If the sum of probabilities after constraints is zero, the probabilities are redistributed within the corresponding feasible category range. Subsequently, based on the candidate positions, candidate SOGs, candidate COGs, target endpoints, and remaining prediction steps, the displacement direction and displacement distance of the current prediction step are corrected, and a coastline safety check is performed. The corrected COG is updated according to the azimuth angle from the previous point to the corrected position. The timestamp is calculated based on the spherical distance between adjacent prediction points and the average SOG of the two adjacent points. After obtaining the new position and new timestamp, the wind speed and significant wave height are rematched from the external wind and wave environment data according to the position and timestamp, and the matched wind speed and significant wave height are written into the current AIS state as input for subsequent autoregressive prediction; then, autoregression continues to generate the predicted baseline route.
[0020] Step 3: Construction of AIS access corridor and navigable constraint space.
[0021] A spatial grid is established based on the target sea area's latitude and longitude range and a preset latitude and longitude resolution. Historical AIS trajectories are mapped to this spatial grid, and AIS traffic density field, AIS corridor direction field, and adjacent grid transfer relationships are formed according to the number of times each historical AIS trajectory passes through grid cells, the direction of the flight segment, and the number of transfers to adjacent grids. The AIS corridor region is obtained by Gaussian smoothing, traffic density threshold filtering, and grid expansion of the AIS traffic density field. Coastline, land cover, water depth, restricted navigation areas, and route alignment data are mapped to the same spatial grid, and unnavigable or restricted grids are marked to form a navigable constraint space.
[0022] Step 4: Candidate route generation and safety constraint check.
[0023] The starting point, ending point, and timestamp of the predicted baseline route are used as fixed benchmarks for candidate routes, and only the latitude and longitude of intermediate route points are changed.
[0024] Candidate routes include predicted baseline candidate routes, smoothed candidate routes, and fuel screening candidate routes. Predicted baseline candidate routes are the predicted baseline routes themselves. Smoothed candidate routes are obtained by smoothing the route points within the predicted baseline routes using endpoint locking, and are corresponding to the timestamps of the predicted baseline routes.
[0025] The fuel screening candidate route is generated based on the predicted baseline route. The sailing progress of the predicted baseline route from start to finish is recorded as 01, and internal adjustment positions are selected according to a preset number. At each internal adjustment position, the original position, port side offset position, and starboard side offset position are generated in the vertical direction along the local heading, with the offset distance determined according to the preset maximum lateral offset distance and sailing progress. Then, one point is selected from the candidate points of each internal adjustment position and connected according to the sailing progress to form the fuel screening candidate route.
[0026] For each candidate fuel screening route, candidate segments are divided according to adjacent candidate points. The distance of the candidate segment, the ground speed, the projection of the ocean current along the segment direction, and the approximate value of the water speed are calculated. The approximate water speed is obtained by subtracting the projection of the ocean current along the candidate segment direction from the ground speed. A screening cost is calculated for each candidate segment, which is obtained by a weighted sum of five terms: the first term is the product of the candidate segment distance and the approximate water speed to a preset power; the second term is the deviation of the ground speed from the speed boundary; the third term is the lateral offset distance; the fourth term is the difference in lateral offset distances between adjacent adjustment positions; and the fifth term is the second-order change in the lateral offset distances of three consecutive adjustment positions. When the ground speed is within the speed boundary, the deviation from the speed boundary is taken as 0. The screening costs of each candidate segment are summed to obtain the cumulative screening cost, and a preset number of fuel screening candidate routes with the highest cumulative screening costs are retained.
[0027] The predicted baseline candidate routes, smoothed candidate routes, and retained fuel screening candidate routes are merged into a candidate route set. For each candidate route in the candidate route set, the ground speed and ground heading of each segment are recalculated according to the distance between adjacent route points and the corresponding time interval. Then, checks are performed on origin-end consistency, timestamp monotonicity, target sea area range, speed boundary, range increment, lateral deviation, turning angle, near-shore safe distance, water depth safety conditions, restricted navigation areas, and route setting constraints. Candidate routes that fail the checks are not included in the subsequent fuel consumption comparison.
[0028] For candidate routes that pass the safety constraint check, based on the AIS corridor area, AIS corridor direction field and adjacent grid transfer relationship obtained in step three, check the corridor coverage, segment direction and grid transfer of the candidate routes respectively; sort the candidate routes according to the check results of corridor coverage, segment direction and grid transfer, and retain a preset number of candidate routes as input for the initial screening of fuel consumption in step five.
[0029] Step 5: Comparison of fuel consumption of candidate routes.
[0030] A preliminary fuel consumption screening is performed on the candidate routes that pass the constraint check in step four. Wind, wave, and current environmental data are matched according to the latitude and longitude positions and timestamps of the candidate routes, and combined with the ship's basic parameters. The same fuel consumption calculation method is used to obtain comparative fuel consumption values for each candidate route. The candidate routes are then sorted from lowest to highest fuel consumption comparative values, and the top four candidate routes are selected for step six (partial refinement). If there are fewer than four candidate routes, all routes are selected for step six. These fuel consumption comparative values are not used as the final route output.
[0031] Step Six: Fine-tuning of local flight paths.
[0032] The routes selected in step five are then subject to localized refinement. First, duplicate routes are removed. For each route, segments are divided based on adjacent route points, and the degree of optimizability for each segment is calculated. This degree of optimizability is used to select segments for priority localized refinement. The calculation process is as follows: First, the fuel consumption per unit distance of the segment is compared using the same fuel consumption calculation method as in step five. Then, the surface speed is calculated based on the ground velocity vector and ocean current velocity vector of the segment. When the surface speed is greater than the ground speed, the difference represents the backflow effect; when the surface speed is not greater than the ground speed, the backflow effect is set to 0. Simultaneously, the turning angle of the segment is calculated, and the difference between the surface speed of the segment and the median surface speed of the segment is used as the speed deviation. Finally, the AIS passage corridor risk item is determined based on the grid where the midpoint of the segment is located. When the midpoint of a flight segment is not located within the AIS corridor area, the AIS corridor risk item is set to 1; when the midpoint of a flight segment is located within the AIS corridor area but the AIS traffic density of the grid is lower than the low-density judgment threshold, the AIS corridor risk item is set to 0.5; otherwise, it is set to 0. The five indicators—unit distance fuel consumption comparison value, reverse flow impact, steering angle, speed deviation, and AIS corridor risk item—are each converted into an evaluation value between 0 and 1; the five evaluation values are multiplied by their corresponding weights and then summed to obtain the optimizability of the flight segment.
[0033] The optimizability of a flight segment is converted into the optimizability of internal route points. For each internal route point, the average optimizability of its preceding and following segments is taken as the optimizability of that internal route point. A preset number of internal route points to be adjusted are selected in descending order of their optimizability.
[0034] For each internal route point to be adjusted, its original position is retained as a local candidate position. A set of candidate offset directions is determined in the local plane coordinates, centered on the problem segment where the internal route point is located. The set of candidate offset directions includes: the normal direction of the local heading of the problem segment and its reverse direction; the AIS corridor direction of the grid where the midpoint of the problem segment is located; the center direction of the high-density AIS corridor grids surrounding the midpoint of the problem segment; and the lateral direction of the ocean current velocity vector of the problem segment after removing the component along the local heading. For each candidate offset direction, the internal route point to be adjusted is moved by a preset offset distance to form a local candidate position. The original position and all local candidate positions constitute the local candidate position set for the internal route point.
[0035] After selecting a local candidate position for each internal route point to be adjusted, they are connected in the navigation sequence to form a local refinement candidate route. The original route point order is maintained between two adjacent internal route points to be adjusted. For each original route point, the displacement of the preceding and following internal route points is linearly interpolated according to the proportion of its distance between the two internal route points to be adjusted, thus obtaining the displacement of the original route point and forming a local adjustment segment. The distance increment and turning angle of the corresponding local refinement candidate route are calculated. First, they are sorted by distance increment from smallest to largest; if the distance increments are the same, they are then sorted by turning angle from smallest to largest, and the local refinement candidate routes that are ranked first are retained according to the preset retention quantity.
[0036] For the retained locally refined candidate routes, the segment distance, ground speed and ground heading are recalculated, and the route is reviewed according to the navigable constraint space, AIS passage corridor direction field and adjacent grid transfer relationship obtained in step three, as well as the speed boundary and route geometric constraints in step four. Locally refined candidate routes that fail the review will not be included in the subsequent comparison.
[0037] For the candidate routes that have passed the review for partial refinement, the fuel consumption comparison value is recalculated using the same fuel consumption calculation method as in step five. For each route to be refined, the candidate route with the lowest fuel consumption comparison value that has passed the review is selected. When its fuel consumption comparison value is lower than that of the corresponding route to be refined, it is used as the input for segment speed optimization in step seven; otherwise, the corresponding route to be refined is retained and proceeds to step seven.
[0038] Step 7: Segment speed optimization.
[0039] For the candidate routes that have passed step six, segmented speed optimization is performed while keeping the route geometry, start point, and end point unchanged.
[0040] For each candidate route, segments are formed based on adjacent route points. Ocean current environment data for each segment are acquired, and the ocean current projection along the course, cross-current speed, and fuel consumption per unit distance are calculated. Adjacent segments are compared along the course. When the adjacent changes in ocean current projection along the course, fuel consumption per unit distance, course, or cross-current speed exceed a preset threshold, a speed control segment boundary is set at the endpoint of the corresponding segment. Continuous segments between adjacent boundaries constitute a speed control segment.
[0041] For each speed control segment, calculate the fuel consumption per unit distance comparison value, average surface speed, and average ocean current projection along the course, weighted by segment distance; for each combination of preset target time and preset speed adjustment coefficients, generate the surface speed command for the speed control segment using the following formula: in, This is the speed adjustment value; This is a comparison value of fuel consumption per unit distance; Weighting for water speed; The average speed across the water before adjustment; Standardized speed adjustment value; For all speed control sections The average value; For all speed control sections Standard deviation; The command for water speed before scaling; This is the speed adjustment factor; This is a scaled-down command for water speed. To ensure a uniform scaling factor. When the value is positive, the corresponding speed control segment will reduce the speed. When the value is negative, the corresponding speed control segment accelerates.
[0042] For each segment, the scaled-down speed command of the speed control segment to which it belongs is added to the projection of the ocean current along the course of the segment to obtain the speed above the ground of the segment; then the passage time of the segment is calculated from the distance of the segment and the speed above the ground of the segment, and the updated timestamps of each route point are accumulated in the order of navigation to form a segment speed candidate scheme.
[0043] Constraint checks are performed on each segment speed candidate scheme. The check items include ground speed boundary, water speed boundary, speed change in adjacent speed control segments, speed change per unit distance, median speed change across the entire route, and expected arrival time deviation. If any check item fails to meet the preset requirements, the segment speed candidate scheme will not be included in the subsequent fuel comparison.
[0044] For the segmented speed candidate schemes that pass the constraint check, the same fuel consumption calculation method as in step five is used to calculate the fuel consumption comparison value. For the same candidate route, the segmented speed candidate scheme with the lowest fuel consumption comparison value is selected; then, from the lowest fuel consumption schemes corresponding to different candidate routes, the scheme with the lowest fuel consumption comparison value and that meets the expected arrival time constraint is selected as the route-speed joint scheme; when the fuel consumption comparison values are the same, the scheme with the smaller expected arrival time deviation is selected.
[0045] Step 8: Output the results.
[0046] Based on the evaluation and optimization results obtained in steps five to seven, output the fuel consumption comparison results, fuel saving rate comparison results, route position comparison results, and fuel evaluation result table; the fuel evaluation result table records the scheme name, formal fuel consumption, distance, flight time, and result record for each scheme; the fuel saving rate is obtained by dividing the difference between the formal fuel consumption of the baseline scheme and the formal fuel consumption of the combined route and speed scheme by the formal fuel consumption of the baseline scheme.
[0047] The beneficial effects of this invention are: (1) The predicted baseline route is used as a reference for the navigation trend of the target vessel, and candidate space is generated by combining it with the historical AIS passage corridor to reduce the number of candidate routes that deviate from the AIS passage corridor.
[0048] (2) During the candidate route evaluation stage, wind, wave and ocean current data are rematched, and fuel evaluation is performed based on the current-corrected water velocity, so that downstream and upstream routes are treated with different propulsion loads.
[0049] (3) Candidate routes that do not meet the navigation requirements are screened out by checking safety constraints such as origin and destination, land crossing, near-shore distance, speed boundary and estimated arrival time, and the coverage of AIS passage corridor and directional consistency are used as the basis for passage risk recording and pre-screening ranking.
[0050] (4) Local route refinement: Within the constraints of navigability and route setting, local routes with high pre-screening values per unit distance, significant backflow impact, insufficient AIS corridor support, or abnormal route setting are subject to constraint adjustments. Attached Figure Description
[0051] Figure 1 This is the overall flowchart of the route speed-coordinated fuel-saving optimization method of the present invention; Figure 2 This is a diagram showing the result of overlaying the AIS traffic density field and the navigable constraint space in this invention. Figure 3 This is a comparison chart of the actual route, the predicted baseline route, and the optimized route of this invention; Figure 4This is a diagram showing the segmented speed optimization results under the expected arrival time constraint of this invention; Figure 5 This is a graph showing the comprehensive comparison of fuel consumption and fuel saving rate of the present invention. Detailed Implementation
[0052] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and technical solutions.
[0053] The basic process of this invention is as follows: Figure 1 As shown, the specific steps are as follows: Step 1: State data construction.
[0054] This embodiment reads the target ship's AIS trajectory point data (MMSI 258648000), basic ship parameters, ERA5 wind and wave data, CMEMS ocean current data, coastline data, land mask data, water depth data, restricted navigation area data, and route planning data. The target voyage starts at 15:36:02 on May 21, 2025, and ends at 19:03:30 on May 21, 2025, according to the unified coordinated time.
[0055] Target ship AIS track points are filtered according to MMSI and sorted in ascending order of timestamp. For AIS track points with duplicate timestamps under the same MMSI, only one is retained; AIS track points with inverted timestamps, missing latitude and longitude, missing SOG, or missing COG are deleted. The time interval, segment distance, implied speed, and COG change are calculated for adjacent cleaned AIS track points. When the time interval between adjacent AIS track points is greater than 1800 seconds, the implied speed is greater than 80 knots, or the COG change is greater than 120 degrees, the voyage is split between the corresponding adjacent AIS track points.
[0056] The segmented voyages are retained if they meet the following conditions: there are no fewer than 50 track points, the total distance is no less than 10 nautical miles, the straight-line distance between the start and end points is no less than 5 nautical miles, the arithmetic mean of the SOG recorded by AIS is no less than 2 knots, the proportion of track points with an SOG of no less than 2 knots is no less than 0.30, the proportion of near-zero segments with a distance of less than 0.02 nautical miles is no more than 0.50, and the proportion of duplicate track points is no more than 0.50. Duplicate track points are counted after retaining 5 decimal places for latitude and longitude.
[0057] The target voyage segment for this embodiment was extracted from the retained voyage samples. The extracted starting point latitude was 57.90576171875 degrees, longitude was 10.500359535217285 degrees, and the ending point latitude was 57.913814544677734 degrees, longitude was 11.569242477416992 degrees. The eastward and northward components of the ERA5 wind field and the ERA5 significant wave height were matched point-by-point according to the latitude, longitude, and timestamp of the extracted AIS trajectory points. The wind speed was then calculated from the eastward and northward components of the wind field. The matching method was the nearest grid time and the nearest marine spatial grid.
[0058] Each captured AIS trajectory point is converted into a six-dimensional AIS state, with the six channels being latitude, longitude, SOG, COG, wind speed, and significant wave height, respectively. The six channels are then normalized using the normalization parameters saved during the training phase, resulting in a six-dimensional AIS state sequence arranged in timestamp order.
[0059] Step 2: Predicting baseline route generation.
[0060] The prediction starting point is determined from the six-dimensional AIS state sequence obtained in step one, and the 18 consecutively observed AIS states before the prediction starting point are taken as the historical context. The target state is taken from the six-channel state corresponding to the target flight endpoint in this embodiment, where the endpoint latitude is 57.913814544677734 degrees and the endpoint longitude is 11.569242477416992 degrees. The remaining state quantities are obtained from the endpoint AIS trajectory point and its matched wind speed and significant wave height according to the same rules as in step one.
[0061] Historical context and target state are input into a trained environment-enhanced trajectory prediction model. This model employs a decoder-only causal Transformer structure, discretizing latitude, longitude, SOG, COG, ERA5 wind speed, and ERA5 significant wave height into 250, 270, 60, 72, 20, and 20 classes, respectively. The embedding dimensions for the six channels are 256, 256, 128, 128, 128, and 128, respectively, with a concatenated state embedding dimension of 1024. The model contains eight causal Transformer layers, each with eight attention heads, a feedforward network dimension of 4096, a maximum sequence length of 120, learnable positional encoding, and a dropout value of 0.1. During training, the state of the previous time step is predicted to predict the state of the next time step. Cross-entropy loss is used for all six channels, with SOG loss weight set to 5 and the loss weight of the other channels set to 1. The optimizer used is AdamW, with a learning rate of 0.0006, beta parameters of 0.9 and 0.95, weight decay of 0.1, gradient clipping threshold of 1.0, 50 training epochs, batch size of 32, and random seed of 42.
[0062] The discrete and normalized ranges for the six channels are: latitude 55.5 degrees to 58.0 degrees, longitude 10.3 degrees to 13.0 degrees, SOG 0 knots to 3 knots, COG 0 degrees to 360 degrees, wind speed 0 m / s to 30 m / s, and significant wave height 0 m to 10 m; the same set of range parameters is used for inference and denormalization.
[0063] During prediction, historical context is used as the initial sequence, and subsequent AIS states are generated autoregressively. In each prediction step, latitude and longitude categories are limited to candidate cells near the previous prediction point, with top-k set to 10 and a neighborhood radius of 40 discrete cells. The retained candidate probabilities are then renormalized. SOG categories are limited to sections 6 to 18. If the sum of the candidate category probabilities for a certain channel is 0 after constraints, a uniform probability is redistributed within the corresponding feasible category range for that channel. After constraints, the latitude, longitude, SOG, and COG categories with the highest probabilities are selected, and inverse normalization is performed according to the aforementioned range parameters to obtain candidate positions, candidate SOGs, and candidate COGs.
[0064] After generating candidate positions, the candidate positions are corrected based on the candidate positions, candidate SOG, candidate COG, target endpoint, and remaining prediction steps; the last prediction step is aligned with the target endpoint position. After correction, a coastline safety check is performed. If the check fails, a nearby safe position is searched or the candidate position is reversed along the direction from the previous prediction point to the candidate point. The corrected COG is updated according to the azimuth angle from the previous prediction point to the corrected position.
[0065] The time interval for a predicted flight segment is obtained by dividing the distance between adjacent predicted points by the predicted SOG of that segment, where the predicted SOG is the average of the SOGs of two adjacent predicted points. After obtaining the new predicted position and timestamp, the ERA5 wind speed and ERA5 significant wave height are rematched according to the predicted position and timestamp, and written into the predicted AIS status for use in the next prediction. Generation stops when the predicted baseline flight path contains 1001 route points, and the predicted baseline flight path is constructed using the restored latitude, longitude, SOG, COG, and the timestamps obtained by accumulating the segments.
[0066] Step 3: Construction of AIS access corridor and navigable constraint space.
[0067] like Figure 2 As shown, the grid coverage is determined based on the latitude and longitude range of the target sea area, and a spatial grid is established with a grid resolution of 0.005 degrees. Historical AIS tracks are read from the training and validation sets of the target sea area, and adjacent AIS track points in each historical AIS track are connected to form historical AIS segments.
[0068] Sampling points are interpolated along historical AIS segments at fixed distances of 0.25 nautical miles, and these sampling points are mapped to corresponding grid cells. For each historical AIS trajectory, the grid cells containing its sampling points are counted; when multiple sampling points of the same historical AIS trajectory are located in the same grid cell, the historical AIS trajectory is counted as one passage through that grid cell. The total number of passages of all historical AIS trajectories in each grid cell is accumulated to obtain the AIS traffic density field.
[0069] The AIS traffic density field is Gaussian smoothed, with a standard deviation of 1.2 grid cells used in this embodiment. Grid cells with a smoothed traffic density greater than 0 are selected, and their 25th percentile value is compared with the minimum traffic count of 2. The larger of these two values is taken as the traffic density threshold. Grid cells with a smoothed traffic density not less than this threshold are defined as the initial AIS traffic corridor region. This initial AIS corridor region is then expanded by 3 grid cells to obtain the AIS corridor area.
[0070] For each historical AIS segment, a unit direction vector in the local plane is calculated based on the segment's start and end points, and this unit direction vector is accumulated in the grid cell containing the sampling point of that historical AIS segment. The accumulated direction vectors in each grid cell are averaged by direction count to obtain the AIS corridor direction field. For grid cells containing consecutive sampling points in the same historical AIS trajectory, the number of directed transfers is counted in the order from the previous grid cell to the next grid cell. When consecutive sampling points span multiple grid cells, intermediate transfers are completed according to the connecting paths of adjacent grid cells to obtain the transfer relationships between adjacent grid cells.
[0071] Coastline, land cover, water depth, restricted navigation areas and route data are mapped on the same spatial grid, and unnavigable or restricted grids are marked according to the rules of land, near-shore distance, water depth, restricted navigation areas and route, forming a navigable constraint space.
[0072] Step 4: Candidate route generation and safety constraint check.
[0073] The predicted baseline route generated in step two is used as a fixed benchmark for the candidate routes. The predicted baseline route contains 1001 route points; the candidate routes retain the start and end points and 1001 timestamps of the predicted baseline route, only changing the latitude and longitude positions of the intermediate route points. This embodiment generates three types of candidate routes: predicted baseline candidate routes, smoothing candidate routes, and fuel screening candidate routes, with a maximum of 8 candidate routes generated.
[0074] The candidate routes for the predicted baseline are obtained directly from the predicted baseline routes.
[0075] The smoothed candidate routes are generated while maintaining the start, end, and timestamps of the predicted baseline routes unchanged. The internal route points of the predicted baseline routes undergo polyline smoothing: first, the polyline is pre-simplified with a pre-simplification tolerance of 0.04 nautical miles, then resampled with a pre-smoothing interval of 0.12 nautical miles; subsequently, two rounds of endpoint locking smoothing are performed, generating two new points for adjacent route points in each round at ratios of 1:3 and 3:1, while keeping the start and end points unchanged; finally, resampling is performed with an output interval of 0.08 nautical miles, and the routes are re-corresponded to the 1001 timestamps of the predicted baseline routes to obtain the smoothed candidate routes. If the start, end, or timestamp changes after smoothing, no smoothed candidate routes are output.
[0076] Fuel screening candidate routes are generated based on the predicted baseline route. The sailing progress of the predicted baseline route from start to finish is denoted as 0 to 1, and adjustment positions are selected at sailing progresses of 0, 0.18, 0.32, 0.46, 0.60, 0.74, 0.88, and 1.00; the start and finish points remain fixed. For each internal adjustment position, the direction of the line connecting its preceding and following route points is used as the local heading, and candidate points are generated in the direction perpendicular to the local heading. Candidate points include the adjustment position itself, as well as points offset to the port and starboard sides; offset increments are -0.90 nautical miles, -0.675 nautical miles, -0.45 nautical miles, -0.225 nautical miles, 0 nautical miles, 0.225 nautical miles, 0.45 nautical miles, 0.675 nautical miles, and 0.90 nautical miles, where negative values indicate offset to the port side and positive values indicate offset to the starboard side. The actual offset distance of the internal adjustment position is sinusoidally scaled according to the sailing progress, so that the offset of the starting point and the ending point is 0, and the offset is the largest in the middle of the route.
[0077] One point is selected from each candidate point for adjustment, and they are connected in ascending order of sailing progress to form a fuel screening candidate route; different selection results result in different fuel screening candidate routes. For each fuel screening candidate route, candidate segments are divided according to adjacent candidate points; the ground speed is calculated based on the distance of the candidate segments and the corresponding time interval, and the projection of the ocean current along the direction of the candidate segment is subtracted from the ground speed to obtain an approximate value of the water speed; if the approximate value of the water speed is less than 0.1 knots, it is counted as 0.1 knots.
[0078] The screening cost is calculated for each candidate segment. The screening cost is obtained by a weighted sum of five factors: the first is the product of the candidate segment distance and the square of the approximate water speed; the second is the speed boundary deviation, with a weight of 25.0, where the excess is taken when the ground speed is below 8 knots or above 18 knots, and 0 is taken in the range of 8 to 18 knots; the third is the lateral offset distance penalty, with a weight of 0.08; the fourth is the lateral offset distance difference penalty between adjacent adjustment positions, with a weight of 0.25; and the fifth is the second-order change penalty of the lateral offset distance of three consecutive adjustment positions, with a weight of 0.15. The screening costs of each candidate segment in the same fuel screening candidate route are summed to obtain the cumulative screening cost. After processing each adjustment position, the top 12 offset combinations are retained in ascending order of cumulative screening cost, and the process continues. After all adjustment positions have been processed, the top 6 fuel screening candidate routes are retained in ascending order of cumulative screening cost. The screening cost and cumulative screening cost are only used for candidate screening and are not considered as fuel consumption results.
[0079] The predicted baseline candidate routes, smoothed candidate routes, and retained fuel screening candidate routes are merged into a candidate route set. For each candidate route in the candidate route set, the speed of travel (SOG) and heading of travel (COG) for each segment are recalculated based on the distance between adjacent route points and the corresponding time interval. The recalculated candidate routes are then subjected to checks for origin-endpoint consistency, timestamp monotonicity, target sea area range, geometric screening speed, range increment, maximum lateral deviation, turning angle of adjacent segments, near-shore safety distance, and configured navigability constraints. Specifically, the geometric screening speed range for candidate routes is 8 to 18 knots, the range increment does not exceed 3%, the maximum lateral deviation does not exceed 5 nautical miles, the turning angle of adjacent segments does not exceed 45 degrees, and the near-shore safety distance is not less than 0.25 nautical miles. Candidate routes that fail the above checks are recorded for the corresponding check items and are not included in subsequent candidate ranking and fuel consumption comparison.
[0080] For candidate routes that meet the constraints, based on the AIS corridor area, AIS corridor direction field and adjacent grid transfer relationship obtained in step three, check the corridor coverage, segment direction and grid transfer of the candidate routes respectively; sort the candidate routes according to the check results of corridor coverage, segment direction and grid transfer, and retain up to 8 candidate routes as input for the initial screening of fuel consumption in step five.
[0081] Step 5: Comparison of fuel consumption of candidate routes.
[0082] This embodiment receives candidate routes that have passed the constraint check in step four. The candidate routes come from the predicted baseline candidate routes, smoothed candidate routes, and fuel screening candidate routes. Each candidate route contains 1001 route points and has the same timestamp as the predicted baseline route; adjacent route points form 1000 segments.
[0083] This embodiment uses a ship fuel consumption calculation model based on water velocity as the preset fuel consumption calculation method. For each candidate route, wind, wave, and current environmental data are matched according to its latitude and longitude location and timestamp, and fuel consumption comparison values are calculated using the same ship parameters and model parameters. The candidate routes are sorted from smallest to largest fuel consumption comparison values, and four routes to be refined are selected to proceed to step six. During selection, the route with the lowest fuel consumption comparison value is retained from the predicted baseline candidate routes, smoothing candidate routes, and fuel screening candidate routes. If there are fewer than four routes, the remaining candidate routes are supplemented from smallest to largest fuel consumption comparison values. If the total number of candidate routes is less than four, the actual number is used to proceed to step six. The fuel consumption comparison value is only used to select routes to be refined.
[0084] Step Six: Fine-tuning of local flight paths.
[0085] Read the routes to be refined selected in step five, and remove duplicate routes according to the number of route points and the latitude and longitude of each point; in this embodiment, a maximum of 4 routes to be refined are retained for local refinement.
[0086] For each route to be refined, segments are formed based on adjacent route points, and the degree of optimization for each segment is calculated. The same fuel consumption calculation method as in step five is used to obtain the comparative value of fuel consumption per unit distance for that segment. The speed over water is calculated based on the ground velocity vector and ocean current velocity vector of that segment. When the speed over water is greater than the ground speed, the difference is used as the reverse current effect; otherwise, the reverse current effect is set to 0. The turning angle of that segment is calculated, and the difference between the ground speed of that segment and the median ground speed of the entire route segment is used as the speed deviation. The AIS corridor risk term is determined based on the grid where the midpoint of the segment is located. If the midpoint of the segment is not located within the AIS corridor area, the AIS corridor risk term is set to 1; if the midpoint of the segment is located within the AIS corridor area but the AIS traffic density of the grid is lower than the low-density judgment threshold, the AIS corridor risk term is set to 0.5; otherwise, it is set to 0. In this embodiment, the low-density judgment threshold is taken as the 75th percentile of the non-zero AIS traffic density of the grid where the midpoint of each segment of the route is located; when there is no non-zero AIS traffic density, the threshold is 1. The unit distance fuel consumption comparison value, reverse flow effect, turning angle, speed deviation, and AIS passage corridor risk item are converted into evaluation values between 0 and 1, and then weighted and summed according to weights of 1.00, 0.80, 0.40, 0.25, and 0.80 to obtain the optimizability of the segment.
[0087] The optimizability of a flight segment is converted into the optimizability of internal route points. Internal route points are route points in the route to be refined, excluding the origin and destination. For the k-th internal route point, the average optimizability of its preceding and following segments is taken as the optimizability of that internal route point. Internal route points are sorted from highest to lowest optimizability, and the top four are selected as the internal route points to be adjusted; if the optimizability is the same, they are selected according to the flight sequence.
[0088] For each internal route point to be adjusted, the route with the highest optimizability among its adjacent segments is designated as the problem route, and a set of candidate offset directions is determined in the local plane coordinates. The candidate offset direction set includes: the normal direction of the local heading of the problem route and its opposite direction; the AIS corridor direction of the grid containing the midpoint of the problem route; the center direction of the high-density AIS corridor grids surrounding the midpoint of the problem route; and the lateral direction of the ocean current velocity vector of the problem route after removing the component along the local heading. For each candidate offset direction, the internal route point to be adjusted is moved by a preset offset distance to form a local candidate position. In this embodiment, the preset offset distances are 0.03 nautical miles, 0.08 nautical miles, 0.15 nautical miles, and 0.25 nautical miles. The original position and each local candidate position constitute the local candidate position set for the internal route point.
[0089] After selecting a local candidate position for each internal route point to be adjusted, connect them according to the navigation sequence to form a local refinement candidate route. The original route point order is retained between two adjacent internal route points to be adjusted; for each original route point, the displacement of the two internal route points to be adjusted is linearly interpolated according to the proportion of its distance between the two internal route points to be adjusted, to obtain the displacement of the original route point, forming a local adjustment segment.
[0090] For each candidate route to be refined, calculate the corresponding distance increment and turning angle, first sorting them by distance increment from smallest to largest; if the distance increments are the same, sort them by turning angle from smallest to largest. If any two candidate routes have the same latitude and longitude at every point, or a lateral difference of less than 0.015 nautical miles, they are considered duplicate candidates, and only the one ranked higher is retained. A maximum of 8 candidate routes are retained for each route to be refined.
[0091] For the retained locally refined candidate routes, the segment distance, ground speed, and ground heading are recalculated, and the routes are verified according to the navigable constraint space, AI passage corridor direction field, and adjacent grid transfer relationships obtained in step three, as well as the velocity boundaries and route geometric constraints obtained in step four. The AIS passage corridor coverage is calculated by sampling along the candidate routes at 0.2 nautical mile intervals; locally refined candidate routes with a coverage rate lower than 0.96 are discarded. Locally refined candidate routes that fail the verification are not included in subsequent comparisons.
[0092] For the candidate routes that have passed the review for partial refinement, the fuel consumption comparison value is recalculated using the same fuel consumption calculation method as in step five. For each route to be refined, the candidate route with the lowest fuel consumption comparison value that has passed the review is selected. When its fuel consumption comparison value is lower than that of the corresponding route to be refined, it is used as the input for segment speed optimization in step seven; otherwise, the corresponding route to be refined is retained and proceeds to step seven.
[0093] Step 7: Segment speed optimization.
[0094] like Figure 4 As shown, the candidate routes, corresponding route point sequences, ERA5 wind and wave data, CMEMS ocean current data, ship speed boundaries, and estimated arrival time constraints output in step six are read. Segmental speed optimization is then performed on the candidate routes that have passed the review in step six. This step maintains the geometric shape, start point, and end point of the candidate routes unchanged, and redetermines the surface speed, surface speed, passage time, and timestamp for each segment.
[0095] For each candidate route, segments are formed based on adjacent route points. The baseline total flight time and baseline ground speed for each segment are calculated using the original timestamps. Then, following the same data matching and fuel consumption calculation methods as in step five, the wind and wave environment, ocean current environment, ocean current projection along the course, surface speed, and fuel consumption per unit distance comparison values for each segment are obtained. Adjacent segments are compared segment by segment along the course. When the difference in ocean current projection along the course reaches 0.35 knots, the normalized difference in fuel consumption per unit distance comparison values reaches 0.70, the course change reaches 12 degrees, or the surface speed difference reaches 0.75 knots, a speed control segment boundary is set at the corresponding segment endpoint. Continuous segments between adjacent boundaries constitute a speed control segment.
[0096] In this embodiment, the target number of speed control segments is 10. When the above boundaries are insufficient, they are supplemented by dividing the cumulative flight distance equally: calculate one-tenth to nine-tenths of the cumulative flight distance of the candidate route, and select the endpoint of the flight segment that is closest to each dividing position and has not yet been used as a boundary as the new boundary, until 10 speed control segments are formed.
[0097] For each speed control segment, the unit distance fuel consumption comparison value, average surface speed, and average ocean current projection along the course of the speed control segment are calculated by weighting the segment distance. The distance weighting calculation is as follows: the corresponding values of each segment within the speed control segment are multiplied by the distance of that segment, summed, and then divided by the total distance of the speed control segment.
[0098] Segmented speed candidate schemes are generated based on the estimated arrival time constraint. The target flight time is taken as the base total flight time multiplied by 1, 1.02, and 1.05, corresponding to increases in estimated arrival time of 0%, 2%, and 5%, respectively; the speed adjustment coefficients are taken as 0, 0.04, 0.08, and 0.12. For each combination of target flight time and speed adjustment coefficients, scaled-down overwater speed commands for each speed control segment are generated according to the formula described in step seven of the invention, and the total flight time is made to meet the corresponding target flight time range by using a unified scaling coefficient. A maximum of 12 segmented speed candidate schemes are generated for each candidate route.
[0099] For each segment, the scaled-down speed command of the speed control segment to which it belongs is added to the projection of the ocean current along the course of the segment to obtain the speed of the segment relative to the ground; then the distance of the segment is divided by the speed of the segment relative to the ground to obtain the passage time of the segment; starting from the start time of the route, the passage time of each segment is accumulated segment by segment in the order of navigation to obtain the updated timestamps of each route point.
[0100] Constraint checks are performed on the generated segmented speed candidate schemes. The checks include ground speed boundaries, water speed boundaries, speed changes between adjacent speed control segments, speed changes per unit distance, median speed changes across the entire route, and estimated arrival time deviations. In this embodiment, ground speeds (SOG) below 6 knots are treated as 6 knots, and above 18 knots as 18 knots; water speeds below 6 knots are treated as 6 knots, and above 22 knots as 22 knots. After speed boundary processing, the passage time for each segment, the timestamps of each route point, and the total flight time for the entire route are recalculated. If the SOG change between adjacent speed control segments exceeds 1.0 knot, the speed change per unit nautical mile exceeds 0.35 knots, the median SOG decreases from the benchmark by more than 10%, or the total flight time is 1% earlier or 5% later than the benchmark total flight time, the segmented speed candidate scheme is deemed unsuccessful. Segmented speed candidate schemes that fail the constraint checks are not included in subsequent fuel comparisons.
[0101] For the segmented speed candidate schemes that pass the constraint check, the same fuel consumption calculation method as in step five is used to calculate the fuel consumption comparison value. For the same candidate route, the segmented speed candidate scheme with the lowest fuel consumption comparison value is selected as the optimal segmented speed scheme for that candidate route; then, the optimal segmented speed schemes for different candidate routes are compared, and the one with the lowest fuel consumption comparison value that meets the estimated arrival time constraint is selected as the final route-speed joint scheme. The final route-speed joint scheme is then re-matched for wind, wave, and ocean current environments, and the official fuel consumption value is calculated using the same fuel consumption calculation method.
[0102] The final selected route and speed combination scheme includes 10 speed control segments. The scaled-down speed commands for each speed control segment are 9.617, 9.514, 9.481, 9.438, 9.451, 9.446, 9.430, 9.447, 9.544 and 9.719 knots, respectively. The final sailing time is 3.5517 hours, and the official fuel consumption is 1578.5 kg.
[0103] Step 8: Output the results.
[0104] like Figure 3 As shown, the output compares the positions of the actual route, the predicted baseline route, and the route speed joint scheme. Figure 5 As shown, the output compares the official fuel consumption values and fuel savings rates for the actual route, predicted baseline route, smoothed candidate route, and route-speed combined scheme. Table 1 is generated, recording the scheme name, official fuel consumption value, distance, flight time, and results for the actual route, predicted baseline route, smoothed candidate route, route-only optimization scheme, and route-speed combined scheme. The fuel savings rate is calculated by dividing the difference between the official fuel consumption value of the baseline scheme and the official fuel consumption value of the route-speed combined scheme by the official fuel consumption value of the baseline scheme.
[0105] Table 1. Fuel Evaluation Results of Actual Voyages
Claims
1. A method for saving fuel based on trajectory prediction and environmental constraints, characterized in that, Includes the following steps: Step 1: State data construction; Acquire AIS trajectory point data of the target vessel, basic vessel parameters, wind and wave environmental data of the target sea area, ocean current field environmental data, and navigability constraint data; Wind speed and significant wave height are matched according to the latitude and longitude position and timestamp of AIS trajectory points, and the latitude and longitude, SOG, COG, wind speed and significant wave height are normalized to obtain a six-dimensional AIS state sequence arranged in the order of timestamps. Step 2: Predicting baseline flight path generation; For the target voyage, the continuous AIS states observed before the prediction start time are used as the historical context, and the target voyage end position is used as the target condition. The historical context and the target voyage end position are input into the trained environment-enhanced trajectory prediction model to generate the predicted baseline route. Step 3: Construction of AIS access corridor and navigable constraint space; A spatial grid is established based on the latitude and longitude range of the target sea area and a preset latitude and longitude resolution. Historical AIS trajectories are mapped to the spatial grid, and AIS traffic density field, AIS corridor direction field, and adjacent grid transfer relationship are formed according to the number of times each historical AIS trajectory passes through grid cells, the direction of the flight segment, and the number of transfers to adjacent grids. The AIS corridor area is obtained by Gaussian smoothing, traffic density threshold filtering, and grid expansion of the AIS traffic density field. Coastline, land mask, water depth, restricted navigation areas, and route alignment data are mapped to the same spatial grid, and unnavigable or restricted grids are marked to form a navigable constraint space. Step 4: Candidate route generation and safety constraint check; The starting point, ending point, and timestamp of the predicted baseline route are used as fixed benchmarks for candidate routes, and only the latitude and longitude of intermediate route points are changed. Candidate routes include predicted baseline candidate routes, smoothed candidate routes, and fuel screening candidate routes; For candidate routes that pass the security constraint check, based on the AIS corridor area, AIS corridor direction field and adjacent grid transfer relationship obtained in step 3, check the corridor coverage, segment direction and grid transfer of the candidate routes respectively. Candidate routes are sorted according to the inspection results of corridor coverage, segment direction and grid transfer, and a preset number of candidate routes are retained as input for the initial screening of fuel consumption in step five. Step 5: Comparison of fuel consumption for candidate routes; For candidate routes that pass the constraint check in step four, conduct an initial screening of fuel consumption; match wind, wave, and current environmental data according to the latitude and longitude positions and timestamps of the candidate routes, and combine them with the ship's basic parameters to obtain the fuel consumption comparison value of each candidate route using the same fuel consumption calculation method; sort the candidate routes in ascending order of fuel consumption comparison value, and select the top four candidate routes to proceed to step six for detailed refinement; if there are fewer than four candidate routes, proceed to step six according to the actual number. Step Six: Fine-tuning of local flight paths; Perform localized refinement on the routes selected in step five; first, remove duplicate routes. For each route to be refined, divide it into segments according to adjacent route points and calculate the degree of optimization for each segment; Convert the optimizability of a flight segment into the optimizability of an internal route point; for each internal route point, take the average optimizability of its preceding and following flight segments as the optimizability of that internal route point; select a preset number of internal route points to be adjusted according to their optimizability from largest to smallest. For each internal route point to be adjusted, retain its original position as a local candidate position; take the problem segment where the internal route point to be adjusted is located as the center, and determine the set of candidate offset directions in the local plane coordinates; For each candidate offset direction, the internal route point to be adjusted is moved by a preset offset distance to form a local candidate position; the original position and each local candidate position constitute the local candidate position set of the internal route point; After selecting a local candidate position for each internal route point to be adjusted, connect them according to the navigation sequence to form a local refinement candidate route; For each candidate route for local refinement, calculate the distance increment and turning angle corresponding to the route to be refined. First, sort them by distance increment from smallest to largest. If the distance increments are the same, sort them by turning angle from smallest to largest. Then, retain the candidate routes that are ranked first according to the preset retention quantity. For the retained locally refined candidate routes, the segment distance, ground speed, and ground heading are recalculated, and the routes are verified according to the navigable constraint space, AIS corridor direction field, and adjacent grid transfer relationship obtained in step three, as well as the speed boundary and route geometric constraints in step four. Locally refined candidate routes that fail the verification are not included in the subsequent comparison. For the candidate routes for partial refinement that have passed the review, the fuel consumption comparison value is recalculated using the same fuel consumption calculation method as in step five. For each route to be refined, the candidate route for partial refinement with the lowest fuel consumption comparison value that has passed the review is selected. When its fuel consumption comparison value is lower than that of the corresponding route to be refined, it is used as the input for segment speed optimization in step seven. Otherwise, the corresponding route to be refined is retained and proceeded to step seven. Step 7: Segment speed optimization; For the candidate routes that have passed step six, segmented speed optimization is performed while keeping the route geometry, start point, and end point unchanged. Step 8: Output the results.
2. The method of claim 1, wherein, In step one, AIS track point data includes vessel identification information (MMSI), timestamp, latitude and longitude, speed over land (SOG), and heading over land (COG); basic vessel parameters include vessel type, draft, dimensions, deadweight tonnage, and other vessel parameters required for the preset fuel evaluation method; target sea area wind and wave environment data includes eastward and northward components of the wind field and significant wave height; ocean current environment data includes eastward and northward components of the ocean current; navigability constraint data includes coastline, land cover, water depth, restricted and prohibited navigation areas, and route planning data; AIS track points are grouped according to ship identification information MMSI, and then sorted in ascending order by timestamp within each group; Delete AIS track points with duplicate timestamps, inverted timestamps, missing latitude and longitude coordinates, missing SOG, or missing COG; calculate the time interval, segment distance, implicit speed, and COG change for adjacent AIS track points after cleaning. If any of these conditions are not met, split the flight between the corresponding adjacent AIS track points.
3. The method of claim 1, wherein, In step one, The trajectory point state variables are constructed using the following formula: where, represents the i-th AIS track point state; the superscript represents the total number of AIS track point states; represents the normalized quantity; , , , , , and represent the normalized latitude, longitude, ground speed, ground course, wind speed, and significant wave height, respectively; represents a six-dimensional AIS state sequence composed of AIS track point states in time order. 4. The method for saving fuel by adjusting flight path speed based on trajectory prediction and environmental constraints according to claim 1, characterized in that, In step two, the environment-enhanced trajectory prediction model employs a decoder-only causal Transformer, without setting an encoder or cross-attention; specifically as follows: The single-label input is changed to a six-dimensional AIS state input. The six-dimensional AIS state quantity is normalized, discretized, and channel embedded to form a state embedding. Then, it is concatenated in a fixed order to form a time-step state embedding vector. The query vector mapping layer, key vector mapping layer, value vector mapping layer, attention output layer, feedforward network, layer normalization, and learnable position embedding in the causal Transformer backbone are all configured according to the dimensions of the time-step state embedding vector. After the target state undergoes the same normalization, discretization, and channel embedding processes, the target conditional embedding is obtained through linear mapping. The state embedding, position embedding, and target conditional embedding at each historical time step are added together and input into the causal Transformer backbone. During inference, the target conditional embedding remains unchanged. After the causal Transformer backbone outputs the hidden states, it finally generates the total output vector and divides it into six logits segments according to the six state channels: latitude, longitude, SOG, COG, wind speed, and significant wave height. The probability of each segment is obtained by softmax. During training, the six-dimensional AIS state sequence is shifted to the right to form the input and supervision targets. The cross-entropy loss of the six state channels is calculated separately and then summed according to preset weights. The loss weight of the SOG channel is greater than that of other state channels, and the filling position is not included in the training loss. During inference, the output of the last time step of the current context is used to generate the next predicted state; Latitude and longitude categories are limited to the neighborhood of the previous location, and SOG categories are limited to the feasible speed range; After constraints, the latitude, longitude, SOG and COG categories with the highest probabilities are selected, and inverse normalization is performed to obtain candidate locations, candidate SOGs and candidate COGs; If the sum of the constrained probabilities is zero, then the probabilities are redistributed within the corresponding feasible category. Subsequently, based on the candidate location, candidate SOG, candidate COG, target endpoint, and remaining prediction steps, the displacement direction and displacement distance of the current prediction step are corrected, and a coastline safety check is performed. The corrected COG is updated based on the azimuth angle from the previous point to the corrected position; the timestamp is calculated based on the spherical distance between adjacent predicted points and the average SOG of the two adjacent points; after obtaining the new position and the new timestamp, the wind speed and significant wave height are rematched from the external wind and wave environment data according to the position and timestamp, and the matched wind speed and significant wave height are written into the current AIS status as input for subsequent autoregressive prediction; then the autoregressive prediction baseline route is generated.
5. The method for saving fuel by adjusting flight speed based on trajectory prediction and environmental constraints according to claim 1, characterized in that, In step four, The predicted baseline candidate routes are the predicted baseline routes; the smoothed candidate routes are obtained by smoothing the route points within the predicted baseline routes by endpoint locking, and correspond to the timestamps of the predicted baseline routes. The fuel screening candidate route is generated based on the predicted baseline route. The sailing progress of the predicted baseline route from the start point to the end point is recorded as 0 to 1, and internal adjustment positions are selected according to a preset number. At each internal adjustment position, the original position, port side offset position, and starboard side offset position are generated in the vertical direction along the local heading. The offset distance is determined according to the preset maximum lateral offset distance and sailing progress. Then, one point is selected from the candidate points of each internal adjustment position and connected according to the sailing progress to form the fuel screening candidate route. For each candidate fuel screening route, candidate segments are divided according to adjacent candidate points. The distance of the candidate segment, the speed to ground, the projection of the ocean current along the segment direction, and the approximate value of the speed to water are calculated. The approximate value of the speed to water is obtained by subtracting the projection of the ocean current along the candidate segment direction from the speed to ground. For each candidate segment, a screening cost is calculated, which is obtained by a weighted sum of five terms: the first term is the product of the candidate segment distance and the approximate value of the speed to water to a preset power; the second term is the deviation of the speed to ground from the speed boundary; the third term is the lateral offset distance; the fourth term is the difference in lateral offset distance between adjacent adjustment positions; and the fifth term is the second-order change in the lateral offset distance of three consecutive adjustment positions. When the speed to ground is within the speed boundary, the deviation of the speed boundary is taken as 0. The screening costs of each candidate segment are added together to obtain the cumulative screening cost, and a preset number of fuel screening candidate routes with the highest cumulative screening costs are retained. The predicted baseline candidate routes, smoothed candidate routes, and retained fuel screening candidate routes are merged into a candidate route set. For each candidate route in the candidate route set, the speed and heading to the ground for each segment are recalculated according to the distance between adjacent route points and the corresponding time interval. Then, checks are performed on the consistency of origin and destination, timestamp monotonicity, target sea area range, speed boundary, range increment, lateral deviation, turning angle, near-shore safe distance, water depth safety conditions, restricted navigation areas, and route setting constraints. Candidate routes that fail the checks are not included in the subsequent fuel consumption comparison.
6. The method for saving fuel by adjusting flight path speed based on trajectory prediction and environmental constraints according to claim 1, characterized in that, In step six, The optimizability level is used to select segments for priority local refinement. The calculation process is as follows: First, the fuel consumption per unit distance of the segment is compared using the same fuel consumption calculation method as in step five. Then, the water speed is calculated based on the ground velocity vector and ocean current velocity vector of the segment. When the water speed is greater than the ground speed, the difference between the two represents the reverse current effect; when the water speed is not greater than the ground speed, the reverse current effect is set to 0. Simultaneously, the turning angle of the segment is calculated, and the difference between the ground speed of the segment and the median ground speed of the current route segment is used as the speed deviation. The speed deviation is then determined based on the network where the midpoint of the segment is located. The AIS corridor risk item is determined by the grid. When the midpoint of the flight segment is not located within the AIS corridor area, the AIS corridor risk item is set to 1. When the midpoint of the flight segment is located within the AIS corridor area but the AIS traffic density of the grid is lower than the low density judgment threshold, the AIS corridor risk item is set to 0.
5. In other cases, it is set to 0. The five indicators of fuel consumption per unit distance, reverse flow effect, turning angle, speed deviation and AIS corridor risk item are converted into evaluation values between 0 and 1. The five evaluation values are multiplied by their corresponding weights and then added together to obtain the degree of optimization of the flight segment.
7. The method for saving fuel by adjusting flight path speed based on trajectory prediction and environmental constraints according to claim 1, characterized in that, In step six, The candidate offset direction set includes: the normal direction of the local heading of the problem segment and its reverse direction, the AIS corridor direction of the grid where the midpoint of the problem segment is located, the center direction of the high-density AIS corridor grid around the midpoint of the problem segment, and the lateral direction of the ocean current velocity vector of the problem segment after removing the component along the local heading.
8. The method for saving fuel by adjusting flight path speed based on trajectory prediction and environmental constraints according to claim 1, characterized in that, In step seven, For each candidate route, segments are formed based on adjacent route points. Ocean current environment data for each segment are obtained, and the ocean current projection along the course, surface speed, and fuel consumption per unit distance are calculated. When comparing adjacent segments along the navigation direction, if the projection of the ocean current along the navigation direction, the comparison value of fuel consumption per unit distance, and the adjacent changes in the navigation direction or the speed over water exceed a preset threshold, a speed control segment boundary is set at the endpoint of the corresponding segment; consecutive segments between adjacent boundaries constitute a speed control segment. For each speed control segment, the fuel consumption per unit distance comparison value, average surface speed, and average ocean current projection along the course are calculated by weighting the segment distance. For each segment, the scaled-down speed command for the waterway to which it belongs is added to the projection of the ocean current along the course of the segment to obtain the speed over land for that segment; Then, the transit time of the segment is calculated based on the distance of the segment and the speed of the segment over the ground, and the updated timestamps of each route point are accumulated according to the sailing sequence to form segment speed candidate schemes; Each segment speed candidate is subject to constraint checks, including ground speed boundaries, water speed boundaries, speed changes in adjacent speed control segments, speed changes per unit distance, median speed changes across the entire route, and estimated arrival time deviation. If any check item fails to meet the preset requirements, the segment speed candidate will not be included in the subsequent fuel comparison. For the segment speed candidate schemes that pass the constraint check, the same fuel consumption calculation method as in step five is used to calculate the fuel consumption comparison value; for the same candidate route, the segment speed candidate scheme with the lowest fuel consumption comparison value is selected. Then, from the lowest fuel consumption schemes corresponding to different candidate routes, the scheme with the lowest fuel consumption comparison value and that meets the expected arrival time constraint is selected as the route speed joint scheme; when the fuel consumption comparison values are the same, the scheme with the smaller expected arrival time deviation is selected.
9. A fuel-saving method for flight speed based on trajectory prediction and environmental constraints according to claim 8, characterized in that, In step seven, For each combination of preset target time and preset speed adjustment coefficient, the speed control segment's water speed command is generated using the following formula: in, This is the speed adjustment value; This is a comparison value of fuel consumption per unit distance; Weighting for water speed; The average speed across the water before adjustment; Standardized speed adjustment value; For all speed control sections The average value; For all speed control sections Standard deviation; The command for water speed before scaling; This is the speed adjustment factor; This is a scaled-down command for water speed. To ensure a uniform scaling factor; When the value is positive, the corresponding speed control segment will reduce the speed. When the value is negative, the corresponding speed control segment accelerates.
10. A method for saving fuel by adjusting flight path speed based on trajectory prediction and environmental constraints according to claim 1, characterized in that, In step eight, based on the evaluation and optimization results obtained in steps five to seven, output the fuel consumption comparison results, fuel saving rate comparison results, route position comparison results, and fuel evaluation result table; the fuel evaluation result table records the scheme name, formal fuel consumption, distance, flight time, and result record for each scheme; the fuel saving rate is obtained by dividing the difference between the formal fuel consumption of the baseline scheme and the formal fuel consumption of the combined route and speed scheme by the formal fuel consumption of the baseline scheme.