Large language-based ship lookout obstacle avoidance agent implementation method and agent
By building a ship lookout and obstacle avoidance intelligent agent based on a large language model and utilizing multi-sensor data fusion and international navigation rules training models, the problem of traditional ship lookout relying on human experience is solved, achieving high-precision navigation decision-making and safety improvement.
Patent Information
- Application Number
- CN202510836426.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-21
- Publication Date
- 2025-10-03
AI Technical Summary
Traditional ship surveillance and obstacle avoidance rely on human experience and judgment, which leads to navigation decision-making errors, easily causing collision accidents, and has limited multi-source heterogeneous data processing capabilities.
A large language model is used to build a ship's obstruction avoidance and lookout intelligent agent. Through multi-sensor data fusion, cleaning and calibration, combined with international navigation rules, the ship's large language model is trained and embedded with logical prompts to form a closed-loop decision-making process and reduce human interference.
Significantly improve the accuracy of navigation decisions, reduce the incidence of ship collision accidents, avoid interference from human factors, and improve navigation safety.
Smart Images

Figure CN120748255A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship obstacle avoidance, and in particular to a method and an intelligent agent for realizing a ship observation and obstacle avoidance based on a big language. Background Art
[0002] With the rapid development of the global shipping industry, maritime and inland waterway traffic continues to climb, and the frequency and complexity of multi-vessel encounters have significantly increased. The resulting risk of shipping accidents continues to rise. Surveys show that collisions are one of the main types of accidents, with more than half of these collisions caused by human error. As a core component of safe navigation, ship observation and obstacle avoidance require the integration of multi-source heterogeneous data to support accurate navigation decisions through comprehensive perception of the navigation environment.
[0003] Traditional navigation collision avoidance decisions mainly rely on the crew's empirical judgment based on the International Regulations for Preventing Collisions at Sea and the Inland Waterway Regulations. However, crew members' interpretation of rules and regulations often varies due to different training backgrounds. Crew members need to integrate multi-source heterogeneous data such as radar and automatic identification systems (AIS) to assess collision risks. However, due to limitations in information processing capabilities and operational proficiency, they are prone to misjudgment of target trajectories or delays in avoidance opportunities. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of the current ship lookout barriers, the present invention provides a method for realizing a ship lookout barrier intelligent agent based on a large language model, which can reduce the impact of human factors on ship lookout and obstacle avoidance through the large language model, thereby outputting efficient navigation decisions.
[0005] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:
[0006] The invention obtains ship navigation data and constructs structured ship navigation data; constructs a ship language model; establishes a ship encounter type dataset and a ship collision avoidance decision dataset based on the structured ship navigation data; inputs the ship encounter type dataset and the ship collision avoidance decision dataset into the ship language model for training, thereby obtaining a ship encounter type judgment result and a ship collision avoidance decision; obtains data from an external tool set and establishes a task selection dataset; embeds logical prompt words in the ship language model, and uses the task selection dataset for training to obtain a ship lookout and obstacle avoidance intelligent agent.
[0007] According to one aspect of the present invention, the ship navigation data is generated by multi-sensor fusion, and its data sources include: shipborne radar scanning data, ship automatic identification system dynamic data, and closed-circuit television monitoring system video data.
[0008] According to one aspect of the present invention, the ship navigation data is processed, including: calibrating the ship navigation data generated by multi-source sensor fusion; cleaning abnormal navigation data; verifying the consistency of the operating records in the captain's navigation log, monitoring the ship's navigation status parameters in real time, and performing compliance verification according to domestic and international navigation collision avoidance rules.
[0009] According to one aspect of the present invention, the large ship language model is constructed by the following steps: selecting a benchmark model; obtaining the original matrix of the benchmark model, and decomposing the original matrix into the product of three matrices through singular value decomposition; constructing two low-rank decomposition matrices and a residual matrix; cascading a long short-term memory network and constructing an LPiSSA model based on the low-rank decomposition matrix and the residual matrix; training the LPiSSA model to obtain the large ship language model.
[0010] According to one aspect of the present invention, the data of the external tool set includes: ship encounter type judgment, ship collision avoidance decision, closest encounter distance, closest encounter time, collision risk judgment and structured navigation data.
[0011] According to one aspect of the present invention, based on the ship encounter type judgment, the closest encounter distance and the closest encounter time are obtained, and based on the closest encounter distance and the closest encounter time, the collision risk judgment is obtained.
[0012] According to one aspect of the present invention, the logical prompt words are "reasoning-action" prompt words, which are composed of system prompt words, ship navigation scene description prompt words, and external tool feedback prompt words, enabling the ship's large language model to perform a closed-loop process of "thinking", "acting", and "observing".
[0013] According to one aspect of the present invention, the system prompt words are structured descriptors of ship lookout and ship obstacle avoidance tasks, including task goal definition, output data format specification and reasoning path constraint conditions.
[0014] According to one aspect of the present invention, the ship navigation scene description prompt words are textual representations of the ship navigation data, and the external tool feedback prompt words are textual representations of the data of the external tool set.
[0015] A ship observation and obstacle avoidance intelligent agent comprises: a data processing module for acquiring ship navigation data and constructing structured ship navigation data; a model construction module for constructing a ship language model; a first data set establishment module for establishing a ship encounter type data set and a ship collision avoidance decision data set based on the structured ship navigation data; a first data set training module for inputting the ship encounter type data set and the ship collision avoidance decision data set into the ship language model for training, thereby obtaining a ship encounter type judgment result and a ship collision avoidance decision; a second data set establishment module for acquiring data from an external tool set and establishing a task selection data set; and a second data set training module for embedding logical prompt words in the ship language model and using the task selection data set for training to obtain a ship observation and obstacle avoidance intelligent agent.
[0016] Advantages of this invention: By acquiring multi-source, heterogeneous ship navigation data and, after calibration, cleaning, and compliance verification, constructing a dataset of ship encounter types and collision avoidance decisions, this dataset is then fed into a pre-trained large language model for training, yielding preliminary results. The model is then further trained and optimized using international navigation regulations and logical prompts based on navigation scenarios, ultimately forming an intelligent ship observation and obstacle avoidance agent. This agent effectively avoids human interference, significantly improves navigation decision-making accuracy, and reduces the incidence of ship collision accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is a schematic flow chart of a method for implementing a ship observation and obstacle avoidance intelligent agent based on big language according to the present invention;
[0019] Figure 2 This is a structural diagram of a method for implementing a ship observation and obstacle avoidance intelligent agent based on big language according to the present invention;
[0020] Figure 3 This is a schematic diagram of the LPiSSA model of the method for implementing a ship observation and obstacle avoidance intelligent agent based on a big language according to the present invention;
[0021] Figure 4 A schematic diagram of training a large language model for a method for implementing a large language-based ship observation and obstacle avoidance intelligent agent according to the present invention;
[0022] Figure 5A schematic diagram of "reasoning-action" prompt words for the method for implementing a ship observation and obstacle avoidance agent based on a big language according to the present invention;
[0023] Figure 6 This is a schematic flow chart of a ship observation and obstacle avoidance intelligent agent described in the present invention. DETAILED DESCRIPTION
[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0025] Example 1
[0026] like Figures 1 to 5 As shown, the present invention provides a method for realizing a ship lookout and obstacle avoidance intelligent agent based on big language. The intelligent agent realization method introduces a big language model into ship lookout and obstacle avoidance, effectively reducing the interference of human factors on ship lookout and obstacle avoidance, improving the accuracy of navigation decision-making, and reducing the collision accident rate.
[0027] Specifically, such as Figure 1 and Figure 2 As shown, the agent implementation method includes:
[0028] Step 110: Acquire ship navigation data and construct structured ship navigation data;
[0029] Specifically, ship navigation data such as ship longitude, latitude, speed, heading, direction, distance, etc. are obtained from shipborne radar scanning data, ship automatic identification system dynamic data, and closed-circuit television monitoring system video data.
[0030] Specifically, the processing steps of ship navigation data include:
[0031] Step S1: calibrating the ship navigation data generated by multi-source sensor fusion, specifically including:
[0032] Perform physical calibration of multi-source sensors to ensure that the hardware equipment is in good working condition. For example, calibrate the antenna angle, gain and other parameters of the shipborne radar to ensure that it can accurately scan and measure the distance, direction and other information of the target;
[0033] Synchronize the timestamps of each sensor. For example, deploy the PTP precision clock protocol to achieve millisecond-level time alignment and eliminate timing deviations between sensors.
[0034] Unifying the coordinate systems of different sensors, for example, converting the polar coordinate system of shipborne radar to the same geographic coordinate system as the ship's automatic identification system, to facilitate comparison and analysis of data from different sources;
[0035] The Kalman filter algorithm is used, with speed and heading as state variables, to fuse multi-source longitude, latitude and azimuth data to output ship navigation data.
[0036] Step S2: Clean abnormal navigation data. Statistical analysis, machine learning, and other methods are used to detect outliers in the ship's navigation data. The data is then repaired through interpolation and context correction. For example, if the ship's longitude data at a certain moment shows an abnormal value, linear interpolation can be performed based on the longitude data at adjacent moments to estimate the reasonable longitude value at that moment. Alternatively, the abnormal data can be corrected based on the ship's heading and speed information and the ship's motion patterns to make it consistent with the actual navigation situation.
[0037] Step S3: Verify the consistency of the captain's logbook operation records, monitor the ship's navigation status parameters in real time, and conduct compliance verification according to domestic and international navigation collision avoidance regulations. Specifically including:
[0038] Verify the consistency of the operation records in the captain's logbook, for example, by comparing the operation records in the captain's logbook with the obtained ship's navigation data to check the consistency of the operation records;
[0039] Real-time monitoring of ship navigation status parameters, including longitude, latitude, speed, heading, direction, distance and other navigation status parameters, to detect abnormal situations in a timely manner;
[0040] Compliance checks are conducted against domestic and international navigation collision avoidance regulations, ultimately generating structured ship navigation data. For example, regulations require ships to maintain a certain safe distance in specific waters and situations. By monitoring distance data between ships, compliance with these regulations is checked. Furthermore, ship parameters such as course and speed are checked against these regulations to ensure that ship navigation behavior complies with regulatory requirements. These regulations include the International Regulations for Preventing Collisions at Sea and the Inland Waterway Regulations.
[0041] Step 120: construct a large ship language model;
[0042] Specifically, such as Figure 3 As shown in Figure 2, the steps for training the ship language model using the offline low-rank adaptive matrix training method are as follows:
[0043] Step S1: Select the Qwen2-72B large language model as the benchmark model;
[0044] Step S2: Get the original matrix W of the baseline model and decompose it into the product of three matrices through singular value decomposition:
[0045] Where, and are all orthogonal matrices, whose column vectors are orthogonal normalized singular vectors, It is a diagonal matrix, indicating that the singular values of the diagonal matrix S are arranged in descending order, and m and n are the matrix sizes.
[0046] Step S3: Construct two low-rank decomposition matrices A and B, and a residual matrix W res ;
[0047] Based on the singular value decomposition matrix, we intercept the components corresponding to the first r singular values and construct two low-rank decomposition matrices: The frozen residual matrix is constructed using the residual singular values and the residual vector: Where r<<min(m,n) is the rank of the low-rank matrix.
[0048] Step S4: Cascade a long short-term memory network and construct an LPiSSA model based on the low-rank decomposition matrix and the residual matrix: Y = (X (W res +ALB));
[0049] Where Y is the final output, X is the input natural language, and L is the long short-term memory network. The LPiSSA model uses the low-rank decomposition matrices A and B as initialization parameters, and a long short-term memory network is cascaded between A and B. The long short-term memory network's ability to model temporal sequences and capture long-term dependencies enables the LPiSSA model to achieve adaptive parameter adjustment and effectively capture long-range contextual dependencies.
[0050] Step S5: Train the LPiSSA model to obtain a large ship language model.
[0051] Step 130: establishing a ship encounter type dataset and a ship collision avoidance decision dataset based on the structured ship navigation data;
[0052] Specifically, the steps to establish the ship encounter type dataset are as follows:
[0053] Step S1, defining the encounter type: according to the International Regulations for Preventing Collisions at Sea and the Regulations for Preventing Collisions in Inland Waterways, common types of ship encounters are defined, such as head-on encounters, overtaking, and crossing encounters.
[0054] Step S2: Extract the following features related to encounter type determination from the structured ship navigation data:
[0055] Motion characteristics: ship's speed, heading, relative speed, relative heading, etc.
[0056] Spatial characteristics: distance between two ships, azimuth, closest approach distance, closest approach time, etc.
[0057] Some of these features can be directly obtained from structured ship navigation data, such as speed, heading, distance between two ships, and azimuth. Some features need to be calculated in combination with various formulas, such as relative speed, relative heading, closest approach distance, and closest approach time.
[0058] For example, to calculate the closest approach time and closest approach distance, we first extract the key information of the two ships from the structured ship navigation data as follows:
[0059] Own ship's position (x1, y1), speed v1, and heading θ1;
[0060] Target ship position (x2, y2), speed v2, and heading θ2.
[0061] The formula for calculating the closest encounter time is:
[0062]
[0063] The formula for calculating the closest encounter distance is:
[0064]
[0065] Where TCPA is the closest encounter time, DCPA is the closest encounter distance, and x r =x2-x1 and y r =y2-y1 is the initial relative position of the target ship relative to the own ship in the x and y directions, v rx =v2cosθ2-v1cosθ1 and v ry =v2sinθ2-v1sinθ1 is the component of the target ship's relative velocity with respect to the own ship in the x and y directions, is the relative speed.
[0066] Step S3, data annotation: for each set of structured ship data, annotation is performed according to the definition of encounter;
[0067] Step S4, data set division: divide the labeled data into training set and validation set in proportion.
[0068] Specifically, the steps to establish a ship collision avoidance decision dataset are as follows:
[0069] Step S1, defining collision avoidance decisions: clarifying collision avoidance decisions under different encounter types. For example, in a head-on encounter, both ships are usually required to turn right; in an overtaking situation, the overtaking ship should safely pass the overtaken ship from the port or starboard side.
[0070] Step S2: Extract the following features related to collision avoidance decision-making from the structured ship navigation data:
[0071] Environmental characteristics: wave height, current speed, wind direction, wind speed, visibility, etc.;
[0072] Ship characteristics: ship type, size, turning radius, stopping distance, etc.
[0073] Some of the above features can be directly obtained from structured ship data, while some features need to be calculated in combination with specific formulas.
[0074] Step S3, data annotation: for each set of structured ship data, annotation is performed according to the definition of encounter;
[0075] Step S4, data set division: divide the labeled data into training set and validation set in proportion.
[0076] Step 140: Input the ship encounter type dataset and the ship collision avoidance decision dataset into a ship language model for training, thereby obtaining a ship encounter type judgment result and a ship collision avoidance decision;
[0077] Based on the training set and validation set of the established ship encounter type dataset, the ship language model is trained to obtain the ship encounter type judgment results.
[0078] Based on the training set and validation set of the established ship collision avoidance decision dataset, the ship large language model is trained to obtain the ship collision avoidance decision.
[0079] Step 150 , obtaining data from an external tool set and establishing a task selection data set;
[0080] Specifically, the data of the external tool set includes: ship encounter type judgment, ship collision avoidance decision, closest encounter distance, closest encounter time, collision risk judgment and structured navigation data.
[0081] Among them, the closest encounter distance and the closest encounter time are calculated by formula when establishing the ship encounter type data set. The collision risk judgment needs to be made based on the results of the closest encounter distance and the closest encounter time.
[0082] Collision Risk Assessment: Set a safety threshold. If DCPA is less than the threshold, the two vessels' trajectories present a collision risk. If TCPA is less than the threshold, the collision risk is imminent and immediate avoidance measures are required. For example, assuming a DCPA of 1 nautical mile and a TCPA of 10 minutes, a DCPA of 0.5 nautical mile and a TCPA of 8 minutes indicates a high risk and requires avoidance measures. A DCPA of 1.2 nautical miles and a TCPA of 8 minutes indicates a medium risk and recommends speed monitoring and adjustment. A DCPA of 2 nautical miles and a TCPA of 15 minutes indicates a low risk and requires continued navigation. TCPA represents the time to closest approach and DCPA represents the distance to closest approach.
[0083] Specifically, the steps to establish a task selection dataset include:
[0084] Step S1, data integration and preprocessing: obtain data from external tool sets, unify data formats, complete correlation analysis and merging of multi-source data; process missing values, noisy data and redundant information through data cleaning to ensure data quality.
[0085] Step S2, feature engineering construction: Select features that are strongly related to task selection from the merged data, such as speed, azimuth, encounter distance, etc.; construct new features based on existing features to improve the model's predictive ability for task selection;
[0086] Step S3, defining task selection labels: such as "continue sailing", "adjust course", "slow down to avoid", "emergency brake", etc.;
[0087] Step S4, data set standardization processing: using the same annotation specifications as the ship encounter type judgment data set and the ship collision avoidance decision data set and dividing the data set in the same proportion.
[0088] Step 160: embed logical prompt words into the ship language model, and train the task selection dataset to obtain a ship observation and obstacle avoidance agent.
[0089] Specifically, such as Figure 4 and Figure 5 As shown in the figure, the logical prompt words adopt the "reasoning-action" prompt words. The "reasoning-action" prompt words are composed of system prompt words, ship navigation field description prompt words, and external tool feedback prompt words, which can enable the ship's large language model to perform a closed-loop process of "thinking", "acting", and "observing".
[0090] System prompts are structured descriptors for ship lookout and obstacle avoidance tasks, including task objective definitions, output data format specifications, and inference path constraints. Ship navigation scenario description prompts are textual representations of ship navigation data, and external tool feedback prompts are textual representations of data from external toolsets.
[0091] Among them, the "thinking" stage belongs to the initial action space of the large language model, which will not affect the external environment and will not receive observation feedback; the "action" stage belongs to the external tool space, which can obtain and understand the ship's navigation environment data; the "observation" stage is to obtain the textual representation of shipborne radar, ship automatic identification system, and closed-circuit television monitoring system data.
[0092] Ultimately, the process for developing a ship observation and obstacle avoidance agent involves training a large ship language model using the task selection dataset, divided into training and validation sets, along with embedded logical cues. During training, the model uses system cues from the logical cues to understand the task objectives and constraints. It then analyzes and infers the current navigation scenario based on the cues describing the navigation scenario. Based on the inference results, the model then makes corresponding decisions or actions, such as determining the type of encounter and making collision avoidance decisions. The model then receives feedback from external tools, observes the results of its decisions or actions, and evaluates whether the task objectives have been achieved. If not, the model adjusts its reasoning and decision-making process based on this feedback, continuously optimizing until it meets the training requirements. Through multiple iterations of training, the large ship language model accurately learns from the task selection dataset, ultimately developing an intelligent ship observation and obstacle avoidance agent capable of effectively performing the task.
[0093] Example 2
[0094] like Figure 6 As shown, a ship observation and obstacle avoidance intelligent agent is implemented based on the method of embodiment 1, and the intelligent agent includes:
[0095] M1, data processing module, obtains ship navigation data and constructs structured ship navigation data;
[0096] M2, model building module, builds a large language model of ships;
[0097] M3, the first data set establishment module, establishes a ship encounter type data set and a ship collision avoidance decision data set based on structured ship navigation data;
[0098] M4, the first data set training module, inputs the ship encounter type data set and the ship collision avoidance decision data set into the ship language model for training, and obtains the ship encounter type judgment result and the ship collision avoidance decision;
[0099] M5, the second dataset establishment module, obtains data from the external tool set and establishes the task selection dataset;
[0100] M6, the second dataset training module, embeds logical prompt words in the ship's large language model and uses the task selection dataset for training to obtain a ship observation and obstacle avoidance intelligent agent.
[0101] Advantages of this invention: By acquiring multi-source, heterogeneous ship navigation data and, after calibration, cleaning, and compliance verification, constructing a dataset of ship encounter types and collision avoidance decisions, this dataset is then fed into a pre-trained large language model for training, yielding preliminary results. The model is then further trained and optimized using international navigation regulations and logical prompts based on navigation scenarios, ultimately forming an intelligent ship observation and obstacle avoidance agent. This agent effectively avoids human interference, significantly improves navigation decision-making accuracy, and reduces the incidence of ship collision accidents.
[0102] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for implementing a ship observation and obstacle avoidance agent based on big language, characterized in that: include: Obtain ship navigation data and construct structured ship navigation data; Build a large language model of ships; Establishing a ship encounter type dataset and a ship collision avoidance decision dataset based on the structured ship navigation data; The ship encounter type dataset and the ship collision avoidance decision dataset are respectively input into the ship large language model for training to obtain the ship encounter type judgment result and the ship collision avoidance decision; Obtain data from external toolsets and build task selection datasets; Logical prompt words are embedded in the ship language model, and the task selection data set is used for training to obtain a ship observation and obstacle avoidance intelligent agent.
2. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 1, characterized in that: The ship navigation data is generated through multi-sensor fusion, and its data sources include: ship-borne radar scanning data, ship automatic identification system dynamic data, and closed-circuit television monitoring system video data.
3. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 2, characterized in that: Processing the ship navigation data includes: Calibrate ship navigation data generated by multi-source sensor fusion; Clean abnormal navigation data; Verify the consistency of the captain's navigation log's operational records, monitor the ship's navigation status parameters in real time, and conduct compliance checks based on domestic and international navigation collision avoidance rules.
4. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 1, characterized in that: The ship language model is constructed through the following steps: Select a baseline model; Obtain the original matrix of the benchmark model and decompose it into the product of three matrices through singular value decomposition; Construct two low-rank decomposition matrices and a residual matrix; Cascade a long short-term memory network and construct an LPiSSA model based on the low-rank decomposition matrix and the residual matrix; The LPiSSA model is trained to obtain a large ship language model.
5. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 1, characterized in that: The data of the external tool set includes: ship encounter type judgment, ship collision avoidance decision, closest encounter distance, closest encounter time, collision risk judgment and structured navigation data.
6. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 5, characterized in that: Based on the ship encounter type judgment, the closest encounter distance and the closest encounter time are obtained, and based on the closest encounter distance and the closest encounter time, the collision risk judgment is obtained.
7. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 1, characterized in that: The logical prompt words are "reasoning-action" prompt words, which are composed of system prompt words, ship navigation scene description prompt words, and external tool feedback prompt words, enabling the ship's large language model to perform a closed-loop process of "thinking", "acting" and "observing".
8. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 7, characterized in that: The system prompt words are structured descriptors of ship lookout and ship obstacle avoidance tasks, including task goal definition, output data format specification and reasoning path constraint conditions.
9. The method for realizing a ship observation and obstacle avoidance intelligent agent according to claim 7, characterized in that: The ship navigation scene description prompt words are textual representations of the structured ship navigation data, and the external tool feedback prompt words are textual representations of the data of the external tool set.
10. A ship observation and obstacle avoidance intelligent agent, characterized in that: The intelligent agent includes: Data processing module, which obtains ship navigation data and constructs structured ship navigation data; Model building module, building a large language model of ships; The first data set establishment module establishes a ship encounter type data set and a ship collision avoidance decision data set based on structured ship navigation data; The first dataset training module inputs the ship encounter type dataset and the ship collision avoidance decision dataset into the ship language model for training, and obtains the ship encounter type judgment result and the ship collision avoidance decision; The second dataset building module obtains data from the external tool set and builds the task selection dataset; The second dataset training module embeds logical prompt words in the ship's large language model and uses the task selection dataset for training to obtain a ship observation and obstacle avoidance intelligent agent.