Ship port real-time information analysis method and system based on model context protocol framework

By combining the model context protocol framework and the large language model, real-time data analysis in the shipping field is realized, which solves the problems of high cost, poor real-time performance and low retrieval hit rate in existing technologies, and generates efficient and professional real-time dynamic information analysis results of ships and ports.

CN122635532APending Publication Date: 2026-08-25COSCO SHIPPING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610644062.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-11
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing large language models used in the shipping industry suffer from problems such as high hardware costs, long training cycles, poor data real-time performance, low retrieval hit rate, and data structure corruption, making it difficult to meet the real-time and professional requirements of real-time AIS dynamic analysis of ships and real-time port congestion analysis.

Method used

The method adopts a model context protocol framework, which receives natural language queries through a large language model, identifies shipping terminology, encapsulates external real-time dynamic data interfaces of ships and ports as tool functions, decomposes queries into multiple sub-tasks using React inference mechanism, obtains and summarizes structured data, and generates accurate real-time dynamic information analysis results of ships and ports.

Benefits of technology

It enables efficient and accurate real-time data analysis of ships and ports, reduces development costs, improves data real-time performance and retrieval hit rate, and ensures the integrity of the data structure and the professionalism of the analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122635532A_ABST
    Figure CN122635532A_ABST
Patent Text Reader

Abstract

The present application relates to a ship port real-time information analysis method and system based on a model context protocol framework, which comprises: determining the user query intention and data requirement through large language model semantic analysis; identifying and labeling the ship port entity class content and shipping professional term class content according to the shipping proper noun identification rule; encapsulating multiple external ship port real-time dynamic data open interfaces into multiple tool functions through the model context protocol framework to form a tool set; the large language model adopts the React inference mechanism to decompose the single round natural language query into multiple logical subtasks, and sequentially executes the inference of the required data, generates the calling instruction, and judges whether the user intention is met; the model context protocol framework forwards the structured real-time return data, which is sequentially executed by the large language model for field analysis, feature extraction and information summarization; and finally generates the ship port real-time dynamic information analysis result, effectively improving the accuracy and timeliness of natural language question and answer and real-time data analysis in the shipping field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence large language model technology, and in particular to a method and system for real-time dynamic information analysis of ships and ports based on large language models and model context protocol framework. Background Technology

[0002] Currently, Large Language Model (LLM) technology has been widely used in intelligent search and general office scenarios. However, in specialized fields such as shipping and in scenarios with high real-time requirements, such as real-time AIS dynamic analysis of ships and real-time port congestion analysis, simply relying on traditional general-purpose large language models often fails to simultaneously meet users' comprehensive needs for accuracy, professionalism, and real-time performance.

[0003] To enhance the ability of large language models to integrate and analyze shipping knowledge and business data, the existing conventional approach is to use a general large language model as a base model, learn shipping-related professional terms and industry knowledge through fine-tuning, and combine it with retrieval augmentation generation (RAG) technology to vectorize real-time shipping business data for retrieval by the large language model.

[0004] However, such technical solutions have obvious limitations: the hardware cost of model fine-tuning is high, the training cycle is long, and the output results are easily affected by the randomness of parameters; shipping business data is mostly stored in relational databases, and in the process of converting it into a vector library and knowledge graph after RAG vectorization, the original data structure is easily damaged and key information is lost, resulting in a low retrieval matching hit rate; at the same time, the solution is highly dependent on high-performance computing power, the construction and iteration cycle of the vector knowledge base is lengthy, the overall R&D and operation and maintenance costs are high, it cannot efficiently connect to the latest external shipping and port business interface data, it is difficult to overcome the inherent data lag problem of the traditional RAG architecture, and it cannot adapt to the actual application needs of real-time dynamic data analysis of shipping and ports. Summary of the Invention

[0005] This invention addresses the problems of high development costs, poor data real-time performance, structural damage during data conversion, low retrieval hit rate, and insufficient answer basis in existing technologies for handling shipping information question-and-answer scenarios. It proposes a real-time ship and port information analysis method based on a Model Context Protocol (MTP) framework. Based on a large language model, it utilizes the MTP framework to encapsulate external ship and port interfaces into tools, decomposes multiple logical subtasks as needed, and retrieves structured business data in real time. Combined with shipping terminology recognition and data parsing and summarization, it achieves accurate retrieval and compliant analysis of real-time ship and port data, generating complete real-time dynamic information analysis results for ships and ports, thus improving the accuracy and timeliness of natural language question answering and real-time data analysis in the shipping field. This invention also relates to a real-time ship and port information analysis system based on the MTP framework.

[0006] The technical solution of the present invention is as follows:

[0007] A method for real-time ship and port information analysis based on a model context protocol framework, characterized by the following steps:

[0008] S1. Receive natural language queries input by users through a large language model, perform semantic parsing on the natural language queries, mine semantic elements, and determine the user's query intent and data requirements.

[0009] S2. The large language model identifies ship and port entity content and shipping terminology content from the natural language query according to the preset shipping terminology recognition rules, and labels and classifies the identified content according to the entity type and terminology type.

[0010] S3. Through the model context protocol framework, multiple external real-time dynamic data open interfaces of ships and ports are encapsulated into multiple utility functions that conform to the large language model function call specification, forming a toolset;

[0011] S4. Based on the query intent and data requirements determined in step S1 and the toolset formed in step S3, the large language model uses the React inference mechanism to decompose a single-round natural language query into multiple logical sub-tasks, and executes each sub-task in sequence: inferring the currently required data, generating the corresponding tool function call instructions, and determining whether the user intent is satisfied; if not satisfied, the next sub-task is executed; if satisfied, the sub-task decomposition is terminated.

[0012] S5. After terminating the subtask decomposition, the model context protocol framework summarizes the structured real-time return data generated during the execution of each subtask in step S4 and forwards it to the large language model. The large language model combines preset prompt words to sequentially perform field parsing, feature extraction and information summarization on the structured real-time return data to obtain the parsed and summarized structured real-time feature data of ships and ports.

[0013] S6. The large language model generates real-time dynamic information analysis results of ships and ports, which include natural language descriptions and / or structured data, based on the query intent determined in step S1, the ship and port entity category content and shipping professional terminology category content labeled and classified in step S2, and the structured ship and port real-time feature data obtained by parsing and summarizing in step S5.

[0014] Preferably, in step S2, the preset shipping terminology recognition rules are used to extract the following categories of information from the natural language query: ship / port / operating entity name, internationally recognized codes, and shipping industry terms; the ship / port / operating entity name includes the ship name, port name, and shipping company or organization name; the internationally recognized codes include MMSI, IMO number, and UNLOCODE; the shipping industry terms include deadweight tonnage, standard container, ship heading, international shipping carbon intensity index, and port congestion index.

[0015] The identification rule for MMSI is a consecutive 9-digit code; the identification rule for IMO number is a consecutive 7-digit code; and the identification rule for UNLOCODE is uppercase letters, where the first two digits are the country code and the last three digits are the port code.

[0016] When the identified ship and port entity types cannot be directly determined, the external knowledge base or external query interface is called sequentially in the order of ship, port, and operating organization to confirm the type.

[0017] Preferably, in step S3, multiple external real-time dynamic data open interfaces for shipping and port operations are encapsulated into multiple utility functions conforming to the large language model function call specification through the model context protocol framework, specifically including:

[0018] Based on the model context protocol framework, the interface call protocol, data transmission format and permission verification rules are uniformly defined. The multiple external real-time dynamic data open interfaces of ships and ports are standardized and encapsulated to form multiple utility functions that can be uniformly scheduled and called by the large language model.

[0019] During the encapsulation process, a corresponding generation method is adopted based on the completeness of the documentation of the external port real-time dynamic data open interface: when the documentation of the external port real-time dynamic data open interface is complete and the format is standardized, the request and response structure of the interface is automatically parsed to generate the corresponding utility function; when the documentation of the external port real-time dynamic data open interface is missing or the format is not standardized, the parameter mapping relationship is manually configured to convert the request parameters and response structure of the interface into the input parameters and output structure of the utility function, respectively.

[0020] Preferably, in step S3, the model context protocol framework includes an MCP client and an MCP server. The MCP server standardizes and encapsulates multiple external real-time dynamic data open interfaces of shipping ports to generate multiple utility functions that conform to the large language model function call specification.

[0021] In step S4, when the large language model decomposes into multiple logical subtasks using the React inference mechanism and calls the corresponding tool functions, the required call parameters are sent to the MCP client, which forwards them to the MCP server. After receiving the call parameters, the MCP server assists in completing the call interaction of the tool functions, and then obtains structured real-time return data from the external real-time dynamic data open interface of the ship port, and sends the structured real-time return data back to the MCP client.

[0022] In step S5, the MCP client forwards the structured real-time return data sent back by the MCP server to the large language model, so that the large language model can perform field parsing, feature extraction and information summarization.

[0023] Preferably, in step S4, the multiple logical subtasks are arranged in an orderly manner according to data acquisition priority and business relevance, while limiting the frequency of single-round subtask calls;

[0024] During the execution of each logical subtask, at least one of the following methods is used to determine whether the user's intent is satisfied:

[0025] Determine whether the currently retrieved structured real-time returned data contains all the key fields required by the user's query;

[0026] Determine whether the currently acquired structured real-time returned data is sufficient to calculate the derived indicators or conclusions requested in the user's query;

[0027] Determine whether the structured real-time return data obtained from two consecutive subtasks are completely identical or whether the amount of change is lower than a preset threshold, and whether no new necessary information fields appear.

[0028] If any one of the judgments is true, it is determined that the user's intent has been satisfied.

[0029] Preferably, in step S5, the preset prompt words are configured with shipping-specific constraint rules, which include field parsing rules, feature extraction rules, and information summarization rules.

[0030] The field parsing rules include: mapping the original field names returned by the real-time dynamic data open interface of shipping ports to common shipping business terms; and / or, marking missing fields or abnormal data fields with special tags and continuously executing the parsing process;

[0031] The feature extraction rules include: uniformly converting timestamps to second-level Unix timestamps and uniformly adopting the Beijing time zone standard; and / or uniformly converting ship speed units to knots and distance units to nautical miles.

[0032] The information aggregation rules include: when performing information aggregation processing on structured real-time returned data, maintaining the original data hierarchy and field association relationships.

[0033] Preferably, in step S6, the generated real-time dynamic information analysis result of the ship and port is configured with a traceability identifier, and the traceability identifier is associated with the corresponding tool function call record and the original interface data of the real-time dynamic information of the ship and port.

[0034] The results of the real-time dynamic information analysis of the ship and port are output in the form of a natural language analysis report, which includes at least one structured data display format:

[0035] Vessel status form, including vessel name, MMSI, current position, heading, speed, port of destination, and estimated time of arrival;

[0036] Port congestion indicator card, including port name, number of ships at anchor, average waiting time, and current number of ships berthed;

[0037] Trend description statements or anomaly alarm statements generated based on real-time data.

[0038] A real-time port and shipping information analysis system based on a model context protocol framework is characterized by comprising, in sequence, a semantic parsing and requirement determination module, a shipping entity terminology identification and annotation module, an interface encapsulation and toolset construction module, a subtask decomposition and tool execution module, a structured data parsing and summarizing module, and a comprehensive correlation analysis result generation module.

[0039] The semantic parsing and demand determination module is used to receive natural language queries input by users through a large language model, and to perform semantic parsing on the natural language queries, mine semantic elements, and determine the user's query intent and data requirements.

[0040] The shipping entity terminology recognition and annotation module is used to identify ship and port entity content and shipping terminology content from the natural language query through the big language model according to the preset shipping proper noun recognition rules, and to annotate and classify the identified content according to the entity type and terminology type.

[0041] The interface encapsulation and toolset construction module is used to encapsulate multiple external real-time dynamic data open interfaces of ships and ports into multiple tool functions that conform to the large language model function call specification through the model context protocol framework, forming a toolset.

[0042] The subtask decomposition and tool call execution module is used to decompose a single-round natural language query into multiple logical subtasks based on the query intent, data requirements, and toolset using the large language model and the React inference mechanism. Each subtask is executed sequentially: inferring the currently required data, generating the corresponding tool function call instructions, and determining whether the user intent is satisfied. If not satisfied, the next subtask is executed; if satisfied, the subtask decomposition is terminated.

[0043] The structured data parsing and summarizing module is used to summarize the structured real-time returned data generated during the execution of each subtask through the model context protocol framework after the subtask decomposition is terminated and forward it to the large language model. The large language model combines preset prompt words to perform field parsing, feature extraction and information summarization on the structured real-time returned data in sequence to obtain the parsed and summarized structured real-time feature data of ships and ports.

[0044] The comprehensive association analysis result generation module is used to generate real-time dynamic information analysis results of ships and ports that include natural language descriptions and / or structured data by combining the large language model with query intent, labeled and categorized entity terminology content, and parsed and summarized structured real-time ship and port feature data.

[0045] Preferably, in the interface encapsulation and toolset construction module, the interface call protocol, data transmission format, and permission verification rules are uniformly defined based on the model context protocol framework. The multiple external real-time dynamic data open interfaces for shipping and ports are standardized and encapsulated to form multiple tool functions that can be uniformly scheduled and called by the large language model. During the encapsulation process, a corresponding generation method is adopted according to the completeness of the documentation of the external real-time dynamic data open interfaces for shipping and ports: when the documentation of the external real-time dynamic data open interfaces for shipping and ports is complete and the format is standardized, the request and response structures of the interface are automatically parsed to generate the corresponding tool functions; when the documentation of the external real-time dynamic data open interfaces for shipping and ports is missing or the format is not standardized, the parameter mapping relationship is manually configured to convert the request parameters and response structures of the interface into the input parameters and output structures of the tool functions, respectively.

[0046] Preferably, in the interface encapsulation and toolset construction module, the model context protocol framework includes an MCP client and an MCP server. The MCP server is used to standardize and encapsulate multiple external real-time dynamic data open interfaces of shipping ports to generate multiple tool functions that conform to the large language model function call specification.

[0047] In the subtask decomposition and tool call execution module, when the large language model decomposes into multiple logical subtasks using the React inference mechanism and calls the corresponding tool functions, the required call parameters are sent to the MCP client, which then forwards them to the MCP server. After receiving the call parameters, the MCP server assists in completing the tool function call interaction, and then obtains structured real-time return data from the external real-time dynamic data open interface of the ship port, and sends the structured real-time return data back to the MCP client.

[0048] In the structured data parsing and summarizing module, the MCP client forwards the structured real-time returned data from the MCP server to the large language model, so that the large language model can perform field parsing, feature extraction and information summarization.

[0049] The technical effects of this invention are as follows:

[0050] This invention relates to a method for analyzing real-time ship and port information based on a model context protocol framework. By performing comprehensive semantic parsing of user natural language queries, it mines semantic elements, accurately extracts and locks in user query intent and real-time ship and port data requirements, eliminating comprehension biases caused by ambiguity and colloquialisms in natural language expression. It solves the problems of low matching accuracy and insufficient search hit rate in traditional keyword retrieval, improving query intent matching accuracy from the source and providing accurate target guidance for subsequent data retrieval and task decomposition. Based on shipping terminology recognition rules, it accurately distinguishes and identifies ship and port entity content and shipping professional terms, while simultaneously completing classification, labeling, and categorization. This approach avoids the problems of inaccurate recognition and confusing definitions of shipping-specific terms by general semantic models, further improving the semantic recognition accuracy in shipping scenarios and reducing invalid searches caused by semantic misjudgments. Through a model context protocol framework, various external port and shipping interfaces are uniformly encapsulated into utility functions adapted to large language models, forming a toolset. This breaks down the barriers between large language models and heterogeneous external data interfaces, eliminating the need for separate custom development programs for different business interfaces, significantly reducing the workload and cost of customized development. Simultaneously, it supports direct access to real-time external interface data, improving the shortcomings of insufficient data real-time performance and achieving standardization of multi-source port and shipping real-time data. Standardized call foundation; Based on the React inference mechanism, complex single-round queries are broken down into multiple logical subtasks, which are executed cyclically to generate tool call instructions and determine intent. This drives external interfaces to return structured real-time data step by step as needed, avoiding redundant data requests in batches. This achieves refined and streamlined execution of query tasks, improves the targeting of data acquisition, avoids invalid data requests, enhances the efficiency of real-time data retrieval, and further ensures data real-time performance. A model context protocol framework is used to complete cross-architecture data aggregation and forwarding. Combined with preset prompts, the original structured data is uniformly parsed, feature extracted, and information aggregated, preserving the original data completely. Based on hierarchy and relationships, this approach effectively addresses issues such as structural damage, field misalignment, and loss of key information during multi-source data format conversion. It integrates and organizes heterogeneous real-time data from multiple sources, forming well-structured and usable real-time ship and port feature data to ensure the quality of foundational data for subsequent analysis. By combining query intent, shipping entity terminology annotations, and parsed and summarized feature data, it generates multi-dimensional analysis results, balancing the readability of natural language with the intuitiveness of structured data. This addresses the shortcomings of traditional intelligent responses, such as empty content, weak data support, and insufficient evidence, ensuring that the output aligns with shipping business scenarios and improving the completeness and business adaptability of the analysis results.This invention achieves a closed-loop processing chain encompassing natural language querying, shipping-specific semantic recognition, unified multi-source interface invocation, refined task scheduling, data organization and aggregation, and scenario-based result output. It effectively addresses industry pain points in the shipping and port sector, such as inaccurate natural language understanding, difficulties in calling external data interfaces, disorganized multi-source data, rudimentary query processing logic, and insufficient professionalism in analysis results. It relies on the Model Context Protocol (MCP) framework and the Large Language Model. The Models (LLM) collaborative architecture, through a layered and step-by-step intelligent processing flow, unifies and encapsulates multi-source external real-time data interfaces, reducing customized development workload and lowering development costs. It also directly connects to open real-time interfaces to dynamically pull data, improving the overall real-time performance of shipping and port data. Simultaneously, a standardized data parsing and aggregation mechanism prevents structural damage and information loss during data conversion. Combined with shipping-specific entity terminology recognition and semantic parsing capabilities, it significantly improves query and retrieval hit rates. Finally, all analysis results are generated based on real, original interface data, strengthening the data basis and credibility of the responses. Adapting to shipping-specific business scenarios, it can efficiently and accurately acquire and process real-time dynamic data from shipping and ports, outputting standardized and professional analysis content to meet the actual business needs of daily shipping queries and operational monitoring.

[0051] Furthermore, by limiting the specific extraction categories, subdividing entity codes and industry terminology scope of the shipping terminology recognition rules, and clarifying the standardized recognition rules for various general codes, an auxiliary confirmation mechanism with external knowledge bases and query interfaces is added for ship and port entities whose types cannot be directly determined. This effectively improves the recognition accuracy of shipping-specific entities and professional terms in the shipping sub-field, avoids misjudgment and omission of shipping-specific content by general semantic recognition methods, further improves the semantic understanding ability of natural language queries, and enhances retrieval matching accuracy.

[0052] Furthermore, based on the model context protocol framework, the interface call protocol, data transmission format, and permission verification rules are uniformly defined. The multiple external real-time dynamic data open interfaces for shipping and ports are standardized and encapsulated, forming multiple utility functions that can be uniformly scheduled and called by the large language model. By standardizing the interface call protocol, data transmission format, and permission verification rules, standardized encapsulation and unified scheduling management of multiple heterogeneous shipping and port open interfaces are achieved. During the encapsulation process, the generation method of utility functions is differentiated according to the completeness of the interface documentation, balancing the automatic generation of standardized interfaces with the adaptation and modification of non-standardized interfaces. This reduces the workload of custom development for connecting multiple external interfaces, improves the universality and adaptability of interface encapsulation, and provides a reliable foundation for unified scheduling and calling of cross-interface data by the large language model.

[0053] Furthermore, by defining the model context protocol framework as a two-layer architecture of MCP client and MCP server, the division of labor and cooperation between the two in interface encapsulation, parameter forwarding, interactive calls and data return are clarified. This standardizes the transmission link and data interaction process of the large language model tool's call parameters, stably realizes the secure interaction between the large language model and the external ship and port data interface, orderly completes the acquisition and relay transmission of real-time data, and ensures the integrity and stability of the data interaction process.

[0054] Furthermore, the multiple logical subtasks are arranged in an orderly manner according to data acquisition priority and business relevance, while limiting the frequency of single-round subtask calls to achieve orderly and controlled execution of subtasks and avoid data access anomalies caused by high-frequency interface requests. At the same time, a multi-dimensional and cross-verifiable user intent comprehensive judgment method is set up to objectively and comprehensively determine whether the current data meets the query requirements, avoid data loss caused by invalid loop execution or premature termination of subtasks, and improve the rationality of multi-round subtask execution and the effectiveness of data acquisition.

[0055] Furthermore, based on preset prompts, shipping-specific constraint rules are configured, and standardized processing rules are set from three dimensions: field parsing, feature extraction, and information aggregation. This unifies the standardization of field terminology mapping, spatiotemporal and unit measurement normalization, abnormal field handling, and data structure preservation, thereby achieving standardized and regulated governance of multi-source heterogeneous port and shipping raw data. This avoids problems such as loss of key information, field confusion, structural damage, and inconsistent formats during data conversion, ensuring the integrity and business adaptability of the parsed and aggregated data.

[0056] Furthermore, a traceability identifier is configured for the generated real-time dynamic information analysis results of ships and ports. This traceability identifier is associated with the corresponding tool function call record and the original interface data of real-time dynamic information of ships and ports. The output basis is formed based on real real-time original data, which solves the problem of insufficient basis for the content of traditional analysis and answers. At the same time, the diversified output format of the analysis report is limited. The display formats such as tables, indicator cards, trends and alarm statements are configured in combination with shipping business scenarios to balance the readability of the content and the intuitiveness of the data, effectively improving the practicality and scenario adaptability of the real-time information analysis results of ships and ports.

[0057] This invention also relates to a real-time port and shipping information analysis system based on a Model Context Protocol (MCP) framework. Corresponding to the aforementioned real-time port and shipping information analysis method based on a MCP framework, this system can be understood as a system for implementing the real-time port and shipping information analysis method based on a MCP framework. It includes a semantic parsing and requirement determination module, a shipping entity terminology identification and annotation module, an interface encapsulation and toolset construction module, a subtask decomposition and tool call execution module, a structured data parsing and summarization module, and a comprehensive correlation analysis result generation module, which are connected in sequence. Each module works together to complete the task. By combining the MCP framework with the Large Language Model (LLM), the system solves the pain points of high randomness and low hit rate in data retrieval under the traditional "LLM + knowledge base retrieval" framework. The system does not require additional construction and maintenance of an AI-specific knowledge base and can directly connect to the external real-time dynamic data open interface (Open API) of ports and shipping to obtain real-time data, which significantly reduces the overall development and maintenance costs. Meanwhile, the system extends the automatic tool invocation capability of LLM through interface encapsulation and toolset construction modules. Combined with subtask decomposition and tool invocation execution modules, it realizes automatic toolchain orchestration, which can complete diverse information collection, data processing and calculation. Through structured data parsing and summarizing modules and comprehensive correlation analysis result generation modules, it realizes standardized data processing and multi-form result output, effectively improving the real-time performance, accuracy and business adaptability of real-time information analysis of ships and ports. Attached Figure Description

[0058] Figure 1 This is a flowchart of the real-time ship and port information analysis method based on the model context protocol framework of the present invention.

[0059] Figure 2 This is a schematic diagram of data interaction for the real-time ship and port information analysis method based on the model context protocol framework of this invention.

[0060] Figure 3 This is a schematic diagram illustrating the interaction principle between the MCP framework and LLM. Detailed Implementation

[0061] The present invention will now be described with reference to the accompanying drawings.

[0062] This invention provides a method for real-time ship and port information analysis based on a model context protocol framework. By collaborating with a large language model and the model context protocol framework, a processing flow suitable for real-time ship and port data analysis and natural language interaction scenarios is constructed. This method can accurately identify shipping terminology and obtain relevant data from external real-time ship and port dynamic data open interfaces. Through multi-step logical reasoning, it completes data acquisition and integration, ultimately generating a well-reasoned and evidence-based real-time ship and port dynamic information analysis report. The method flow is as follows: Figure 1 As shown, it includes the following steps:

[0063] S1. Receive natural language queries input by users through a Large Language Model (LLM), perform semantic parsing on the natural language queries, mine semantic elements (such as extracting keywords and shipping-related semantic information), and determine and lock in the user's query intent and data requirements.

[0064] Combination Figure 2 The data interaction diagram shown illustrates that after LLM receives a user's question, it first performs semantic analysis and semantic element mining. Then, it temporarily stores the user's question intent, data requirements, and auxiliary information as reusable temporary variables (i.e., environment variables / user variables) so that this information can be quickly accessed in subsequent React inference steps and tool calls without repeated parsing.

[0065] S2. The large language model, based on preset shipping terminology recognition rules, identifies ship and port entity content and shipping terminology content from the natural language query, and then labels and categorizes the identified content according to entity type and terminology type. This step essentially involves ship / port / operation entity recognition, general code recognition, and industry terminology recognition: processing the proper nouns or terms contained in the user input, extracting these nouns and terms, and categorizing them into the correct tags. This step corresponds to... Figure 2 The LLM parsing in the system identifies proprietary terms. This node combines prompt words, an industry terminology database, and a query interface to enhance the recognition rate of proprietary terms.

[0066] The preset shipping terminology recognition rules are used to extract the following categories of information from the natural language query: ship / port / operating entity names, internationally recognized codes, and shipping industry terms; the ship / port / operating entity names include ship names, port names, shipping company or organization names, etc.; the internationally recognized codes include MMSI, IMO numbers, UNLOCODE, weather event codes, etc.; the shipping industry terms include deadweight tonnage, standard container (TEU), ship heading, international shipping carbon intensity index, port congestion index, etc.

[0067] The identification rule for MMSI is a consecutive 9-digit code; the identification rule for IMO number is a consecutive 7-digit code; and the identification rule for UNLOCODE is uppercase letters, where the first two digits are the country code and the last three digits are the port code.

[0068] When the identified ship and port entity types cannot be directly determined, the external knowledge base or external query interface is called sequentially in the order of ship, port, and operating organization to confirm the type.

[0069] To improve the accuracy of shipping proper noun recognition and semantic parsing matching, this embodiment uses a large language model combined with shipping entity recognition-specific prompt words (prompt word engineering) to implement the above-mentioned shipping proper noun recognition rules. An exemplary shipping entity recognition-specific prompt word template is as follows:

[0070] "As an expert in the international maritime logistics industry, please use your knowledge to understand the following concepts:"

[0071] -MMSI is the Waterborne Mobile Service Identifier, which is generally a 9-digit consecutive numeric code;

[0072] - The IMO number is the International Maritime Organization's ship identification code, which is generally a 7-digit consecutive number code;

[0073] -UNLOCODE is generally a five-letter code, with the first two letters representing the standard country code. For example: CN represents China, and US represents the United States;

[0074] -Standardize the identification and classification of ship types. Common ship types include: dry bulk carriers, container ships, liquid bulk carriers, special-purpose ships, general cargo ships, and passenger ships.

[0075] - When a word is identified as a proper entity name, but it is impossible to determine whether it belongs to a ship, company / organization, or port name, external knowledge bases are called in the order of ship name database, company database, and port database to determine the entity identity. This process requires access to the corresponding professional knowledge base.

[0076] - When a word is identified as a proper entity name, but it's unclear whether it belongs to the category of ship, company / organization, or port, the corresponding external query interfaces are invoked sequentially in the order of ship query interface, company query interface, and port query interface to assist in confirming the entity category and identity information.

[0077] S3. Using the model context protocol framework, multiple external real-time dynamic data open interfaces for shipping and ports are encapsulated into multiple utility functions conforming to the large language model function call specification, forming a toolset. In this embodiment, for interfaces with standard OpenAPI documentation, large language model function call tools can be automatically generated based on the OpenAPI specification; for interfaces with incomplete documentation, utility functions are generated by manually configuring parameter mappings for subsequent calls by the large language model.

[0078] Furthermore, the model context protocol can be implemented in various programming languages ​​and development frameworks, such as the Spring AI framework based on Java, or the FastMCP framework based on Python and Typescript.

[0079] Specifically, this step involves standardizing and encapsulating the multiple external real-time dynamic data interfaces for shipping and ports based on a unified definition of the interface call protocol, data transmission format, and permission verification rules within a model context protocol framework. This results in multiple utility functions that can be uniformly scheduled and invoked by the large language model. Combined with... Figure 3 The diagram shown illustrates the interaction principle between the MCP framework and LLM. The Model Context Protocol framework includes an MCP client and an MCP server. The MCP server standardizes and encapsulates multiple external real-time dynamic data interfaces for shipping ports, generating multiple utility functions that conform to the large language model function call specification.

[0080] During the encapsulation process, a corresponding generation method is adopted based on the completeness of the documentation of the external port real-time dynamic data open interface: when the documentation of the external port real-time dynamic data open interface is complete and the format is standardized, the request and response structure of the interface is automatically parsed to generate the corresponding utility function; when the documentation of the external port real-time dynamic data open interface is missing or the format is not standardized, the parameter mapping relationship is manually configured to convert the request parameters and response structure of the interface into the input parameters and output structure of the utility function, respectively.

[0081] Furthermore, in this embodiment, real-time query interfaces for relevant dynamic data of international merchant ships and international trade ports can be obtained from professional shipping technology companies or commercial data service providers. These interfaces are generally in Open API format. The MCP server is responsible for interacting with the native API, while the MCP client is responsible for interacting with the LLM. Through this architecture, MCP can convert commonly available general API data interfaces into AI tool function formats, which can be actively invoked by the LLM via function calls. After the LLM connects to the MCP client, the MCP client implicitly appends the internal tool list of the MCP server at the beginning of each round of dialogue (i.e., at the location of the LLM's system prompt). The tool list includes the tool's name, parameter structure, and natural language description of the tool and its parameters.

[0082] S4. Based on the query intent and data requirements determined in step S1 and the toolset formed in step S3, the large language model uses the React inference mechanism to decompose a single-round natural language query into multiple logical subtasks, and executes each subtask in sequence: inferring the currently required data, generating the corresponding tool function call instructions, and determining whether the user intent is satisfied; if not satisfied, the next subtask is executed; if satisfied, the subtask decomposition is terminated.

[0083] The large language model (LLM) used in this invention does not necessarily have to be a finely tuned large model with expertise in the shipping field. A general-purpose LLM can fully realize and meet the functional requirements of real-time information analysis and question answering in shipping and port. The LLM used in this invention must be compatible with both React inference mechanisms and function call mechanisms.

[0084] Specifically, in combination Figure 2 The data interaction diagram shown illustrates that after recognizing the user's input words and phrases, the large language model, in conjunction with the tool list information from the model context protocol server, infers the thought steps required to achieve the user's intent and plans the tool call chain. The inference chain operates using a React mechanism, dividing the single-turn dialogue output into multiple thought / reasoning steps. Each step executes: a. Inferring the currently required data → b. Constructing tool call parameter commands → c. Calling an MCP tool → d. Obtaining the tool's return → e. Further thought and reasoning based on the data → f. Determining whether the current result satisfies the user's intent (i.e., whether the user's question goal has been achieved). When the determination result is yes (the user's question goal has been achieved), the corresponding... Figure 2 If the user's goal has been achieved, the reasoning ends and the subtask decomposition terminates; if the result is negative (user goal not achieved), the corresponding... Figure 2 For branches where the user's goal has not been achieved, generate the next tool call plan and return to step a to enter the next round of inference loop.

[0085] like Figure 3 As shown, when the large language model decomposes into multiple logical subtasks using the React inference mechanism and calls the corresponding tool functions, it sends the required call parameters to the MCP client, which then forwards them to the MCP server. After receiving the call parameters, the MCP server assists in completing the tool function call interaction, and then obtains structured real-time return data from the external real-time dynamic data open interface of the ship port, and sends the structured real-time return data back to the MCP client.

[0086] In other words, after obtaining the MCP tool list, the LLM, in conjunction with user questions, plans the inference chain and tool call chain. Before each round of inference, the LLM initiates a tool call. The MCP client receives the call structure containing tool parameters and passes it to the MCP server. The MCP server internally unpacks the parameters and repackages them into an API request format, sends these request parameters to the native API (external real-time dynamic data open interface for shipping ports), and receives the return data from the native API. Subsequently, it unpacks the API return data and repackages it into a data structure conforming to the MCP tool standard. This data structure can be accurately parsed by the LLM, and finally, the structured real-time return data is sent back to the MCP client.

[0087] The multiple logical subtasks are arranged in order of data acquisition priority and business relevance, while limiting the frequency of subtask calls in a single round; during the execution of each logical subtask, at least one of the following judgment methods is used to determine whether the user intent is met:

[0088] Determine whether the currently retrieved structured real-time returned data contains all the key fields required by the user's query;

[0089] Determine whether the currently acquired structured real-time returned data is sufficient to calculate the derived indicators or conclusions requested in the user's query;

[0090] Determine whether the structured real-time return data obtained from two consecutive subtasks are completely identical or whether the amount of change is lower than a preset threshold, and whether no new necessary information fields appear.

[0091] If any one of the judgments is true, it is determined that the user's intent has been satisfied.

[0092] S5. After terminating the subtask decomposition, the model context protocol framework aggregates the structured real-time return data generated during the execution of each subtask in step S4 and forwards it to the large language model. The large language model, in conjunction with preset prompt words, sequentially performs field parsing, feature extraction, and information aggregation on the structured real-time return data to obtain parsed and aggregated structured real-time feature data of ships and ports. In this embodiment, by transmitting the interface response data structure through the model context protocol framework, and in conjunction with prompt word engineering, the meaning of external data fields can be accurately parsed, and the returned data can be semantically understood, organized, aggregated, and feature extracted, achieving the normalization processing of multi-source heterogeneous data.

[0093] Specifically, such as Figure 3 As shown, the MCP client forwards the structured real-time data returned by the MCP server to the large language model, allowing the large language model to perform field parsing, feature extraction, and information aggregation. In this step, the preset prompt words (which can be called data processing preset prompt words) are configured with shipping-specific constraint rules, including field parsing rules, feature extraction rules, and information aggregation rules; wherein,

[0094] The field parsing rules include: mapping the original field names returned by the real-time dynamic data open interface of shipping ports to common shipping business terms; and / or, marking missing fields or abnormal data fields with special tags and continuously executing the parsing process;

[0095] The feature extraction rules include: uniformly converting timestamps to second-level Unix timestamps and uniformly adopting the Beijing time zone standard; and / or uniformly converting ship speed units to knots and distance units to nautical miles.

[0096] The information aggregation rules include: when performing information aggregation processing on structured real-time returned data, maintaining the original data hierarchy and field association relationships.

[0097] S6. The large language model generates real-time dynamic information analysis results for ships and ports, including natural language descriptions and / or structured data, based on the query intent determined in step S1, the ship and port entity content and shipping terminology content labeled and categorized in step S2, and the structured real-time ship and port feature data obtained in step S5 after parsing and summarizing. In this embodiment, the large language model combines the user's query intent with the processed API data to generate a professional and accurate real-time ship and port information analysis report, outputting it in natural language or structured format to meet the professional question-and-answer and data analysis needs in the shipping field.

[0098] Specifically, in this step, the generated real-time dynamic information analysis results of the ship and port are configured with a traceability identifier, and the traceability identifier is associated with the corresponding tool function call record and the original interface data of the real-time dynamic information of the ship and port.

[0099] The results of the real-time dynamic information analysis of the ship and port are output in the form of a natural language analysis report, which includes at least one structured data display format:

[0100] Vessel status form, including vessel name, MMSI, current position, heading, speed, port of destination, and estimated time of arrival;

[0101] Port congestion indicator card, including port name, number of ships at anchor, average waiting time, and current number of ships berthed;

[0102] Trend description statements or anomaly alarm statements generated based on real-time data.

[0103] The following is a code example of an OpenAPI to MCP conversion tool, developed using the Python + FastMCP framework:

[0104] import httpx

[0105] import FastMCP from fastmcp

[0106] client = httpx.AsyncClient(base_url=BASE_URL) # Connect to the native OpenAPI server; the URL is represented by BASE_URL.

[0107] openapi_spec = httpx.get(BASE_URL + " / openapi.json").json() # Retrieves the OpenAPI standard interface documentation

[0108] mcp = FastMCP.from_openapi(

[0109] openapi_spec=openapi_spec, # Generate MCP tool comments based on the OpenAPI standard interface documentation.

[0110] client=client, # Convert the native API service to an MCP tool server

[0111] name="Maritime Data Server" # MCP server name )

[0113] When the native interface does not conform to the OpenAPI standard or the interface documentation is incomplete, the following code can be used for manual encapsulation and conversion:

[0114] import FastMCP from fastmcp

[0115] from typing import Annotated

[0116] mcp = FastMCP("maritime-data-server") # Create a server object

[0117] @mcp.tool(description="Real-time AIS location query interface for ships.") # Update tool description

[0118] async def get_realtime_ais_data(

[0119] vessel_mmsi: Annotated[list[int],"Array of vessel MMSIs. Input example: [351248000,538010896]."] #Configuration tool input parameters

[0120] ) -> dict:

[0121] response = requests.post(url=API_URL, data={'mmsi':vessel_mmsi}) # Internal call to the API interface

[0122] return response # Return API data

[0123] The code above exemplifies two encapsulation methods, corresponding to the generation method adopted based on the completeness of the documentation of the external port real-time dynamic data open interface: for interfaces with standard OpenAPI documentation, utility functions can be automatically generated by parsing the interface documentation; for interfaces that do not apply the OpenAPI standard or have incomplete documentation, the conversion from interface to MCP utility functions can be achieved by manually configuring parameter mapping.

[0124] After completing all inference chains and tool call chains, the large language model will organize and summarize all inference results and structured real-time return data, and give the final analysis results of real-time dynamic information of ships and ports.

[0125] To facilitate understanding of the execution process of this invention, the following explanation uses the generation of a real-time dynamic report of the target vessel as an example:

[0126] The user's query aims to generate a real-time dynamic report of a target vessel. The Large Language Model (LLM) first correctly parses the user's intent and identifies and extracts the vessel's name. Then, the LLM performs entity recognition and annotation on the vessel name. Subsequently, based on the generated toolset, the React inference mechanism is used to sequentially infer and plan the tool call chain.

[0127] a. Call the tool interface for querying the ship database, pass in the ship name as the search keyword, and obtain the ship registration information, including the MMSI number;

[0128] b. Call the interface for querying the real-time navigation status of the vessel, pass in the MMSI number as the search keyword, and obtain the AIS real-time positioning and current operation status;

[0129] c. Call the interface to query detailed vessel information, pass in the MMSI number as the search keyword, and obtain in-depth detailed data such as route information, destination port, and estimated arrival time.

[0130] After executing three rounds of tool calls, LLM determines that the currently acquired data has covered all the key fields required for report generation, thus satisfying the user's intent. It then terminates the tool calls and outputs the analysis results of real-time dynamic information on ships and ports.

[0131] This invention also relates to a real-time port and shipping information analysis system based on a model context protocol framework. Corresponding to the aforementioned real-time port and shipping information analysis method based on a model context protocol framework, this system can be understood as a system for implementing the real-time port and shipping information analysis method based on a model context protocol framework. It includes, in sequence, a semantic parsing and requirement determination module, a shipping entity terminology identification and annotation module, an interface encapsulation and toolset construction module, a subtask decomposition and tool call execution module, a structured data parsing and summarizing module, and a comprehensive correlation analysis result generation module.

[0132] The semantic parsing and demand determination module is used to receive natural language queries input by users through a large language model, and to perform semantic parsing on the natural language queries, mine semantic elements, and determine the user's query intent and data requirements.

[0133] The shipping entity terminology recognition and annotation module is used to identify ship and port entity content and shipping terminology content from the natural language query through the big language model according to the preset shipping proper noun recognition rules, and to annotate and classify the identified content according to the entity type and terminology type.

[0134] The interface encapsulation and toolset construction module is used to encapsulate multiple external real-time dynamic data open interfaces of ships and ports into multiple tool functions that conform to the large language model function call specification through the model context protocol framework, forming a toolset.

[0135] The subtask decomposition and tool call execution module is used to decompose a single-round natural language query into multiple logical subtasks based on the query intent, data requirements, and toolset using the large language model and the React inference mechanism. Each subtask is executed sequentially: inferring the currently required data, generating the corresponding tool function call instructions, and determining whether the user intent is satisfied. If not satisfied, the next subtask is executed; if satisfied, the subtask decomposition is terminated.

[0136] The structured data parsing and summarizing module is used to summarize the structured real-time returned data generated during the execution of each subtask through the model context protocol framework after the subtask decomposition is terminated and forward it to the large language model. The large language model combines preset prompt words to perform field parsing, feature extraction and information summarization on the structured real-time returned data in sequence to obtain the parsed and summarized structured real-time feature data of ships and ports.

[0137] The comprehensive association analysis result generation module is used to generate real-time dynamic information analysis results of ships and ports that include natural language descriptions and / or structured data by combining the large language model with query intent, labeled and categorized entity terminology content, and parsed and summarized structured real-time ship and port feature data.

[0138] Furthermore, in the interface encapsulation and toolset construction module, the interface call protocol, data transmission format, and permission verification rules are uniformly defined based on the model context protocol framework. The multiple external real-time dynamic data open interfaces for shipping and ports are standardized and encapsulated to form multiple tool functions that can be uniformly scheduled and called by the large language model. During the encapsulation process, a corresponding generation method is adopted based on the completeness of the documentation for the external real-time dynamic data open interfaces for shipping and ports: when the documentation for the external real-time dynamic data open interfaces for shipping and ports is complete and the format is standardized, the request and response structures of the interface are automatically parsed to generate the corresponding tool functions; when the documentation for the external real-time dynamic data open interfaces for shipping and ports is missing or the format is not standardized, the parameter mapping relationship is manually configured to convert the request parameters and response structures of the interface into the input parameters and output structures of the tool functions, respectively.

[0139] Furthermore, in the interface encapsulation and toolset construction module, the model context protocol framework includes an MCP client and an MCP server. The MCP server standardizes and encapsulates multiple external real-time dynamic data open interfaces of shipping ports to generate multiple tool functions that conform to the large language model function call specification.

[0140] In the subtask decomposition and tool call execution module, when the large language model decomposes into multiple logical subtasks using the React inference mechanism and calls the corresponding tool functions, the required call parameters are sent to the MCP client, which then forwards them to the MCP server. After receiving the call parameters, the MCP server assists in completing the tool function call interaction, and then obtains structured real-time return data from the external real-time dynamic data open interface of the ship port, and sends the structured real-time return data back to the MCP client.

[0141] In the structured data parsing and summarizing module, the MCP client forwards the structured real-time returned data from the MCP server to the large language model, so that the large language model can perform field parsing, feature extraction and information summarization.

[0142] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail with reference to the accompanying drawings and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention. In short, all technical solutions and improvements that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the present invention patent.

Claims

1. A method for real-time ship and port information analysis based on a model context protocol framework, characterized in that, Includes the following steps: S1. Receive natural language queries input by users through a large language model, perform semantic parsing on the natural language queries, mine semantic elements, and determine the user's query intent and data requirements. S2. The large language model identifies ship and port entity content and shipping terminology content from the natural language query according to the preset shipping terminology recognition rules, and labels and classifies the identified content according to the entity type and terminology type. S3. Through the model context protocol framework, multiple external real-time dynamic data open interfaces of ships and ports are encapsulated into multiple utility functions that conform to the large language model function call specification, forming a toolset; S4. Based on the query intent and data requirements determined in step S1 and the toolset formed in step S3, the large language model uses the React inference mechanism to decompose a single-round natural language query into multiple logical sub-tasks, and executes each sub-task in sequence: inferring the currently required data, generating the corresponding tool function call instructions, and determining whether the user intent is satisfied. If the condition is not met, continue to execute the next subtask; if the condition is met, terminate the subtask decomposition. S5. After terminating the subtask decomposition, the model context protocol framework summarizes the structured real-time return data generated during the execution of each subtask in step S4 and forwards it to the large language model. The large language model combines preset prompt words to sequentially perform field parsing, feature extraction and information summarization on the structured real-time return data to obtain the parsed and summarized structured real-time feature data of ships and ports. S6. The large language model generates real-time dynamic information analysis results of ships and ports, which include natural language descriptions and / or structured data, based on the query intent determined in step S1, the ship and port entity category content and shipping professional terminology category content labeled and classified in step S2, and the structured ship and port real-time feature data obtained by parsing and summarizing in step S5.

2. The method for real-time ship and port information analysis based on the model context protocol framework according to claim 1, characterized in that, In step S2, the preset shipping terminology recognition rules are used to extract the following categories of information from the natural language query: ship / port / operating entity name, internationally recognized codes, and shipping industry terms; the ship / port / operating entity name includes the ship name, port name, and shipping company or organization name; the internationally recognized codes include MMSI, IMO number, and UNLOCODE; the shipping industry terms include deadweight tonnage, standard container, ship heading, international shipping carbon intensity index, and port congestion index. The identification rule for MMSI is a consecutive 9-digit code; the identification rule for IMO number is a consecutive 7-digit code; and the identification rule for UNLOCODE is uppercase letters, where the first two digits are the country code and the last three digits are the port code. When the identified ship and port entity types cannot be directly determined, the external knowledge base or external query interface is called sequentially in the order of ship, port, and operating organization to confirm the type.

3. The method for real-time ship and port information analysis based on the model context protocol framework according to claim 1, characterized in that, In step S3, multiple external real-time dynamic data interfaces for shipping and port operations are encapsulated into multiple utility functions conforming to the large language model function call specification through the model context protocol framework. Specifically, these include: Based on the model context protocol framework, the interface call protocol, data transmission format and permission verification rules are uniformly defined. The multiple external real-time dynamic data open interfaces of ships and ports are standardized and encapsulated to form multiple utility functions that can be uniformly scheduled and called by the large language model. During the encapsulation process, a corresponding generation method is adopted based on the completeness of the documentation of the external port real-time dynamic data open interface: when the documentation of the external port real-time dynamic data open interface is complete and the format is standardized, the request and response structure of the interface is automatically parsed to generate the corresponding utility function; when the documentation of the external port real-time dynamic data open interface is missing or the format is not standardized, the parameter mapping relationship is manually configured to convert the request parameters and response structure of the interface into the input parameters and output structure of the utility function, respectively.

4. The method for real-time ship and port information analysis based on a model context protocol framework according to any one of claims 1 to 3, characterized in that, In step S3, the model context protocol framework includes an MCP client and an MCP server. The MCP server standardizes and encapsulates multiple external real-time dynamic data open interfaces of shipping ports to generate multiple utility functions that conform to the large language model function call specification. In step S4, when the large language model decomposes into multiple logical subtasks using the React inference mechanism and calls the corresponding tool functions, the required call parameters are sent to the MCP client, which forwards them to the MCP server. After receiving the call parameters, the MCP server assists in completing the call interaction of the tool functions, and then obtains structured real-time return data from the external real-time dynamic data open interface of the ship port, and sends the structured real-time return data back to the MCP client. In step S5, the MCP client forwards the structured real-time return data sent back by the MCP server to the large language model, so that the large language model can perform field parsing, feature extraction and information summarization.

5. The method for real-time ship and port information analysis based on a model context protocol framework according to any one of claims 1 to 3, characterized in that, In step S4, the multiple logical subtasks are arranged in an orderly manner according to data acquisition priority and business relevance, while limiting the frequency of single-round subtask calls. During the execution of each logical subtask, at least one of the following methods is used to determine whether the user's intent is satisfied: Determine whether the currently retrieved structured real-time returned data contains all the key fields required by the user's query; Determine whether the currently acquired structured real-time returned data is sufficient to calculate the derived indicators or conclusions requested in the user's query; Determine whether the structured real-time return data obtained from two consecutive subtasks are completely identical or whether the amount of change is lower than a preset threshold, and whether no new necessary information fields appear. If any one of the judgments is true, it is determined that the user's intent has been satisfied.

6. The method for real-time ship and port information analysis based on a model context protocol framework according to any one of claims 1 to 3, characterized in that, In step S5, the preset prompt words are configured with shipping-specific constraint rules, which include field parsing rules, feature extraction rules, and information summarization rules. The field parsing rules include: mapping the original field names returned by the real-time dynamic data open interface of shipping ports to common shipping business terms; and / or, marking missing fields or abnormal data fields with special tags and continuously executing the parsing process; The feature extraction rules include: uniformly converting timestamps to second-level Unix timestamps and uniformly adopting the Beijing time zone standard; and / or uniformly converting ship speed units to knots and distance units to nautical miles. The information aggregation rules include: when performing information aggregation processing on structured real-time returned data, maintaining the original data hierarchy and field association relationships.

7. The method for real-time ship and port information analysis based on a model context protocol framework according to any one of claims 1 to 3, characterized in that, In step S6, the generated real-time dynamic information analysis result of the ship and port is configured with a traceability identifier, and the traceability identifier is associated with the corresponding tool function call record and the original interface data of the real-time dynamic information of the ship and port. The results of the real-time dynamic information analysis of the ship and port are output in the form of a natural language analysis report, which includes at least one structured data display format: Vessel status form, including vessel name, MMSI, current position, heading, speed, port of destination, and estimated time of arrival; Port congestion indicator card, including port name, number of ships at anchor, average waiting time, and current number of ships berthed; Trend description statements or anomaly alarm statements generated based on real-time data.

8. A real-time ship and port information analysis system based on a model context protocol framework, characterized in that, The module comprises, in sequence, a semantic parsing and requirements determination module, a shipping entity terminology identification and annotation module, an interface encapsulation and toolset construction module, a subtask decomposition and tool execution module, a structured data parsing and summarizing module, and a comprehensive correlation analysis result generation module. The semantic parsing and demand determination module is used to receive natural language queries input by users through a large language model, and to perform semantic parsing on the natural language queries, mine semantic elements, and determine the user's query intent and data requirements. The shipping entity terminology recognition and annotation module is used to identify ship and port entity content and shipping terminology content from the natural language query through the big language model according to the preset shipping proper noun recognition rules, and to annotate and classify the identified content according to the entity type and terminology type. The interface encapsulation and toolset construction module is used to encapsulate multiple external real-time dynamic data open interfaces of ships and ports into multiple tool functions that conform to the large language model function call specification through the model context protocol framework, forming a toolset. The subtask decomposition and tool call execution module is used to decompose a single-round natural language query into multiple logical subtasks based on the query intent, data requirements, and toolset using the large language model and the React inference mechanism. Each subtask is executed sequentially: inferring the currently required data, generating the corresponding tool function call instructions, and determining whether the user intent is satisfied. If not satisfied, the next subtask is executed; if satisfied, the subtask decomposition is terminated. The structured data parsing and summarizing module is used to summarize the structured real-time returned data generated during the execution of each subtask through the model context protocol framework after the subtask decomposition is terminated and forward it to the large language model. The large language model combines preset prompt words to perform field parsing, feature extraction and information summarization on the structured real-time returned data in sequence to obtain the parsed and summarized structured real-time feature data of ships and ports. The comprehensive association analysis result generation module is used to generate real-time dynamic information analysis results of ships and ports that include natural language descriptions and / or structured data by combining the large language model with query intent, labeled and categorized entity terminology content, and parsed and summarized structured real-time ship and port feature data.

9. The real-time ship and port information analysis system based on the model context protocol framework according to claim 8, characterized in that, In the interface encapsulation and toolset construction module, the interface call protocol, data transmission format, and permission verification rules are uniformly defined based on the model context protocol framework. This standardizes and encapsulates the multiple external real-time dynamic data open interfaces for shipping and ports, forming multiple tool functions that can be uniformly scheduled and called by the large language model. During the encapsulation process, a corresponding generation method is adopted based on the completeness of the documentation for the external real-time dynamic data open interfaces for shipping and ports: when the documentation for the external real-time dynamic data open interfaces for shipping and ports is complete and the format is standardized, the request and response structures of the interface are automatically parsed to generate the corresponding tool functions; when the documentation for the external real-time dynamic data open interfaces for shipping and ports is missing or the format is not standardized, the parameter mapping relationship is manually configured to convert the request parameters and response structures of the interface into the input parameters and output structures of the tool functions, respectively.

10. The real-time ship and port information analysis system based on the model context protocol framework according to claim 8 or 9, characterized in that, In the interface encapsulation and toolset construction module, the model context protocol framework includes an MCP client and an MCP server. The MCP server standardizes and encapsulates multiple external real-time dynamic data open interfaces of shipping ports to generate multiple tool functions that conform to the large language model function call specification. In the subtask decomposition and tool call execution module, when the large language model decomposes into multiple logical subtasks using the React inference mechanism and calls the corresponding tool functions, the required call parameters are sent to the MCP client, which then forwards them to the MCP server. After receiving the call parameters, the MCP server assists in completing the tool function call interaction, and then obtains structured real-time return data from the external real-time dynamic data open interface of the ship port, and sends the structured real-time return data back to the MCP client. In the structured data parsing and summarizing module, the MCP client forwards the structured real-time returned data from the MCP server to the large language model, so that the large language model can perform field parsing, feature extraction and information summarization.