Ship trade system based on RAG architecture, electronic equipment and storage medium

The intelligent shipping and trading system based on the RAG architecture enables precise breakdown of user needs and efficient integration of multi-source information, generating precise transportation solutions adapted to complex navigation scenarios. This solves the problems of information redundancy and decision-making delays in existing systems, and improves shipping efficiency and safety.

CN121543623APending Publication Date: 2026-02-17GUANGZHOU ZHENHUA AVIATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511661152.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing intelligent shipping and trading systems lack efficient information filtering and integration mechanisms, resulting in information redundancy, information confusion, and delays in decision-making, failing to meet the needs of modern shipping for precise decision-making and dynamic adaptation.

Method used

The shipping and trading system adopts a RAG-based architecture, which includes a main intelligent agent and multiple sub-intelligent agents, such as an intent parsing intelligent agent, an information retrieval intelligent agent, and a transportation plan generation intelligent agent. Through natural language understanding and multi-source data integration, it generates accurate transportation plans.

Benefits of technology

It improves decision-making accuracy and system efficiency, reduces labor costs, adapts to complex navigation scenarios, and reduces information confusion and delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543623A_ABST
    Figure CN121543623A_ABST
Patent Text Reader

Abstract

The invention relates to a ship trade system based on an RAG architecture, electronic equipment and a storage medium. The system comprises a main agent and a plurality of sub-agents, wherein the sub-agents at least comprise an intention analysis agent; the sub-agents further comprise an information retrieval agent and / or a transportation scheme generation agent; the main agent is used for scheduling the corresponding sub-agents to work cooperatively according to user input requirements; the intention analysis agent is used for performing intention analysis on the user input demand when the complexity of the user input demand is greater than a reference standard, and determining a task demand; the information retrieval agent is used for querying the corresponding ship information and / or transportation information when the task demand contains the information query request; and the transportation scheme generation agent is used for generating a transportation scheme based on the ship information and the transportation information when the task demand contains the transportation scheme generation request. Thus, through cooperation of the intelligent agents, the overall efficiency and quality of ship and cargo transaction are improved, and business turnover is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a shipping and trading system, electronic equipment and storage medium based on RAG architecture. Background Technology

[0002] With the continuous expansion of global shipping and the iterative upgrading of ship technology, intelligent shipping systems have become a core development direction for improving the quality and efficiency of the shipping industry and ensuring navigation safety. However, current mainstream systems generally suffer from the limitation of single-technology application, focusing on isolated technical modules (such as single path planning algorithms and basic navigation functions), lacking comprehensive integration and deep collaboration of next-generation shipping technologies. This makes it difficult for the systems to break through bottlenecks in terms of safety, operational efficiency, and intelligence in complex navigation scenarios, and fails to fully meet the needs of modern shipping for precise decision-making and dynamic adaptation.

[0003] Currently, with the surge in the number and types of ship sensors, multi-source navigation information, such as ship dynamic data, real-time weather forecast data, and ship's own condition monitoring data, is experiencing explosive growth. However, existing systems lack efficient information filtering and fusion mechanisms, resulting in a continuous stream of numerous, repetitive, and redundant information being pushed to the driver. This not only easily causes information confusion and cognitive overload for the driver but may also delay the timeliness and accuracy of their maneuvering decisions, posing a potential threat to navigation safety. Summary of the Invention

[0004] Therefore, it is necessary to provide a shipping and trading system, electronic equipment, and storage medium based on the RAG architecture to address the aforementioned technical problems.

[0005] In a first aspect, this application provides a shipping and trading system based on the RAG architecture, the system comprising a main intelligent agent and multiple sub-intelligent agents: wherein the sub-intelligent agents include at least an intent parsing intelligent agent; the sub-intelligent agents also include an information retrieval intelligent agent and / or a transportation plan generation intelligent agent; The main intelligent agent is used to schedule the corresponding sub-intelligent agents to work collaboratively according to user input requirements; The intent parsing agent is used to parse the user input request and determine the task requirement when the complexity of the user input request is greater than the reference standard. The information retrieval agent is used to query corresponding ship information and / or transportation information when the task requirements include an information query request. The transportation plan generation agent is used to generate a transportation plan based on the ship information and the transportation information when the task requirements include a transportation plan generation request.

[0006] In one embodiment, the sub-agent further includes a tool agent; The tool agent integrates the Model Context Protocol (MCP) toolkit and is used to invoke the corresponding tool components based on the task requirements.

[0007] In one embodiment, the sub-agent further includes a reflective agent; The reflective agent is used to evaluate the output of each of the sub-agents to obtain an evaluation result, and to feed back the evaluation result to the main agent if the evaluation result is inconsistent with the expected result. The main intelligent agent is used to initiate a feedback adjustment mechanism based on the evaluation result to correct the output content until the evaluation result corresponding to the corrected content is consistent with the expected result.

[0008] In one embodiment, when the task requirement includes an information query request, querying the corresponding ship information and / or transportation information includes: Based on the information query request, construct a graph database query statement; Based on the graph database query statement, the ship information and the transportation information are obtained by matching from the knowledge graph of the shipping trade field constructed based on GFM-RAG; The invocation of the corresponding tool component based on the task requirements includes: If the information query request includes a real-time information query request, the information retrieval tool is invoked based on the real-time information query request to send a target query request to the ship information database, obtain real-time ship information, and return it to the information retrieval agent.

[0009] In one embodiment, generating a transportation plan based on the ship information and the transportation information includes: Real-time meteorological information acquisition; Based on predefined constraints and optimization objectives, a genetic algorithm is used to analyze and iterate the ship information and the transportation information to generate an initial transportation plan. Using a reinforcement learning module, the transportation path in the initial transportation plan is fine-tuned based on the current Automatic Identification System (AIS) data and the meteorological information to obtain the transportation plan. The invocation of the corresponding tool component based on the task requirements includes: Based on the transportation plan generation requirements, the text generation tool in the MCP toolkit is invoked to generate the transportation plan text.

[0010] In one embodiment, the sub-agent further includes an order evaluation agent; The order evaluation agent is used to parse the order to obtain key information when the task requirements include an order evaluation request; perform semantic retrieval of the key information with the domain knowledge graph to obtain target retrieval results; and generate correction suggestions for the order based on the target retrieval results.

[0011] In one embodiment, the system further includes a ship berthing scheduling intelligent agent; The intelligent agent for ship berthing is used to obtain basic port information, ship information, and real-time port operation status when the task requirements include a port information query request; and to generate ship berthing plans and cargo loading and unloading plans based on the basic port information, the ship information, and / or the real-time operation status.

[0012] In one embodiment, the step of parsing the user input request to determine the task requirement includes: The user input content is filtered and eliminated based on TokenSkip to obtain the user input requirements; Based on a large-scale language model in the shipping trade field, semantic understanding of the user input requirements is performed to determine the intent category; Based on the intent category, extract the core information related to the intent category; Based on the intent category and the core information, the task requirements in a predetermined format are generated.

[0013] Secondly, this application also provides an electronic device, including a processor and a memory; wherein the memory is used to store a computer program; and the processor is configured to, when executing the computer program, implement the process steps of the system execution described in any embodiment of this application.

[0014] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the process steps of the system execution described in any embodiment of this application.

[0015] In the aforementioned shipping trade system based on the RAG architecture, on the one hand, the intent parsing agent can accurately break down the core demands, constraints, and additional requirements in user input through natural language understanding. The main agent then directly dispatches the information retrieval agent and / or the transportation solution generation agent based on the parsing results, without user intervention. This significantly shortens the time from demand submission to response initiation, making it suitable for time-sensitive scenarios in shipping trade. On the other hand, the information retrieval agent, relying on the retrieval enhancement capabilities of the RAG (Retrieval-Augmented Generation) architecture, can connect in real-time to multiple data sources such as ship databases, port information systems, and freight rate platforms, quickly filtering out accurate information that meets user needs. This efficient integration of multi-source information improves the accuracy and reliability of decision-making. Furthermore, the transportation solution generation agent can automatically generate multiple differentiated solutions based on the ship and transportation information obtained by the information retrieval agent, combined with the RAG architecture's learning of shipping trade transportation rules, adapting to the complexity of shipping trade operations. Through the collaborative cooperation of multiple agents, the overall efficiency and quality of shipping transactions can be improved, labor costs reduced, and business turnover accelerated. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of a shipping trading system based on the RAG architecture, according to an exemplary embodiment. Figure 2 This is a schematic diagram of a shipping trading system integrating the MCP toolset, according to an exemplary embodiment. Figure 3 This is an internal structural diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0018] The terms "first," "second," and "third" used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0019] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] In some embodiments, the shipping and trading system based on the RAG architecture provided in this application can be applied to electronic devices. These electronic devices can be any mobile terminal or fixed terminal. A terminal can be a device that provides voice and / or data connectivity to a user. For example, a terminal can be an Internet of Things (IoT) terminal, such as a sensor device, a mobile phone or so-called "cellular" phone, or a computer with an IoT terminal; for example, it can be a fixed, portable, pocket-sized, handheld, or computer-embedded device.

[0021] In some embodiments, such as Figure 1 As shown, a shipping and trading system based on the RAG architecture is provided. The system includes a main intelligent agent 10 and multiple sub-intelligent agents 20. The sub-intelligent agents 20 include at least an intent parsing intelligent agent 21. The sub-intelligent agents also include an information retrieval intelligent agent 22 and / or a transportation plan generation intelligent agent 23. The main intelligent agent 20 is used to schedule the corresponding sub-intelligent agents to work collaboratively according to user input requirements; The intent parsing agent 21 is used to parse the user input request and determine the task requirement when the complexity of the user input request is greater than the reference standard. The information retrieval agent 22 is used to query the corresponding ship information and / or transportation information when the task requirements include an information query request. The transportation plan generation agent 23 is used to generate a transportation plan based on the ship information and the transportation information when the task requirements include a transportation plan generation request.

[0022] In this embodiment, RAG is a language processing technology that combines information retrieval and text generation. The RAG architecture may include a retrieval unit and a generator.

[0023] For example, the retrieval tool can be a dense retrieval based on vector similarity. The generator can be a Transformer-based language model, such as BART or T5.

[0024] For example, the RAG architecture can be an Agentic RAG architecture. The Agentic RAG architecture integrates the autonomous decision-making, planning, and execution capabilities of the AI ​​agent (Artificial Intelligence Agent) into the retrieval enhancement generation process, enabling the system to no longer passively respond to queries, but to proactively, dynamically, and strategically complete complex knowledge tasks.

[0025] In this embodiment of the application, the task requirements may include, but are not limited to, at least one of the following: task content, task complexity, and task type.

[0026] In this embodiment, the main intelligent agent can be the main agent router. As the central coordinating core of the shipping and trading system based on the RAG architecture, the main agent router undertakes the key functions of overall task allocation, process control, and multi-sub-agent collaborative scheduling.

[0027] In some embodiments, the main agent first accurately determines the task type and complexity corresponding to the task requirements based on the preliminary analysis results of the user input: For simple queries that only require a single piece of information feedback (such as "query the age and deadweight tonnage of the ship 'COSCO XX'" or "today's berthing fee standard at Shanghai Port"), the complex collaborative process can be skipped directly, and the task can be assigned to the ship information retrieval agent or port information retrieval agent (matching the corresponding sub-agent on demand) to achieve rapid and direct access to demand and response, reducing unnecessary process losses; while for complex tasks involving multi-dimensional information integration and multi-step reasoning (such as "customizing a transportation plan from Guangzhou Port to Hamburg Port for 500 tons of cold chain fresh food, requiring ship age ≤ 8 years, total transit time ≤ 25 days, including temperature control and cargo insurance"), a multi-sub-agent collaborative mode is activated, and an efficient task execution link is constructed by dynamically adjusting the agent scheduling order and combination logic; for example, the user intent parsing agent is first called to decompose the "core objective (cold chain transportation)", "constraints (ship age / transit time)", and "additional services (temperature control / )" in the requirements. The system first analyzes the data (including insurance), then uses a ship information retrieval agent to filter vessels that meet the age and temperature control requirements, and simultaneously obtains dynamic information about ports along the route (such as congestion and temperature-controlled warehousing facilities). Finally, it calls a transportation plan generation agent to integrate the above information and generate multiple customized plans with timeliness, cost, and risk comparisons. Throughout the scheduling process, the main agent router can monitor the task execution progress and feedback results of each sub-agent in real time. If information is updated at any stage (such as the target vessel temporarily adjusting its sailing schedule), the scheduling logic is immediately optimized, and the relevant sub-agents are re-coordinated to supplement the search or iterate the plan. This ensures that complex tasks always proceed along an efficient and accurate path, reducing problems such as bottlenecks and information gaps that occur in traditional fixed processes.

[0028] In this embodiment, the intent parsing agent serves as the entry point for understanding the needs of the shipping and trading system. It undertakes the core function of converting the user's natural language input into structured information that the system can recognize and execute, and is the prerequisite support for the main agent to achieve precise scheduling.

[0029] In one embodiment, the intent parsing agent relies on large-scale language models (LLMs) in the shipping and trade domain. These large-scale language models can fine-tune specific corpora such as shipping transportation, port scheduling, and trade contracts based on general large models, and have the ability to understand the semantics of expressions unique to shipping and trade scenarios. Furthermore, the refined prompt word engineering optimizes the model output logic, and the standardized prompt word template is designed to guide the model to output results in a fixed format, ensuring that the information is structured and can be directly called by subsequent sub-agents.

[0030] In some embodiments, the step of parsing the user input request to determine the task requirement includes: The user input content is filtered and eliminated based on TokenSkip to obtain the user input requirements; Based on a large-scale language model in the shipping trade field, semantic understanding of the user input requirements is performed to determine the intent category; Based on the intent category, extract the core information related to the intent category; Based on the intent category and the core information, the task requirements in a predetermined format are generated.

[0031] In this embodiment, TokenSkip is a controllable chain-of-thought (CoT) compression technology for large language models (LLMs), aiming to improve the efficiency and readability of the reasoning process while maintaining logical integrity. Its core mechanism involves evaluating the semantic importance of each token during CoT generation, identifying and retaining tokens that play a crucial role in the reasoning conclusion, and selectively skipping redundant, padding, or low-information tokens, thereby achieving intelligent compression of the reasoning path.

[0032] For example, the intent parsing agent analyzes user input and selects a unique matching intent category from preset categories (such as ship information query, transportation plan customization, contract evaluation, freight rate consultation, port status query, cargo tracking, and insurance processing). Based on the determined intent category, it extracts core information related to the intent from the input (such as ship name / IMO number for ship information query, and cargo type, weight / volume, port of loading, port of destination, timeliness requirements, and special transportation needs for transportation plan customization). The agent outputs the results strictly according to a predetermined format, such as JSON format, which must contain two fields: 'intention_type' (intent category) and 'key_information' (key information, presented in key-value pair format).

[0033] In this embodiment of the application, the information retrieval agent is used to retrieve ship information and transportation information. It optimizes the knowledge base based on GFM-RAG (Graph-based Filtering and Memory-Retrieval Augmented Generation), uses a graph structure to represent ship information and its relationships, and uses an efficient filtering mechanism to filter and query the most relevant ship information.

[0034] In this embodiment, GFM-RAG is a technique that integrates graph structure, filtering mechanism, and memory retrieval to enhance generation. GFM-RAG can intuitively represent entities and relationships using graph structure, filter out the most relevant information for the task through an efficient filtering mechanism, and quickly and accurately extract useful content from large-scale storage with the help of powerful memory retrieval capabilities.

[0035] In one embodiment, the ship knowledge base in the shipping trade sector is optimized using GFM-RAG technology. This involves deeply integrating scattered basic ship data (such as ship name, IMO number, ship age, deadweight tonnage, and cabin structure), operational data (such as historical routes, on-time performance, and maintenance records), and compliance data (such as ship certificate validity and environmental ratings) to form a knowledge base that combines structured and unstructured data. A graph structure model is introduced to model the knowledge base as a knowledge graph, using entities to represent ship information and edges to represent relationships. For example, "ship" is used as the core node, and "route," "port," "operating company," and "cargo type" are used as related nodes, connected by edges to establish a multi-dimensional knowledge graph. When a user inputs an information query request, the system first parses out the corresponding key entities and intent, and then performs a multi-hop subgraph retrieval within the knowledge graph to obtain ship information relevant to the query request.

[0036] For example, the transportation plan generation agent generates transportation plans based on ship information and transportation information. A heuristic search algorithm (such as a genetic algorithm) is used to find the optimal solution under constraints. For instance, factors such as ship load, route, and cargo loading / unloading time are comprehensively considered to generate ship scheduling plans and transportation route plans.

[0037] For example, when it is necessary to balance the three objectives of "shortest transportation time", "lowest cost" and "lowest risk of cargo damage" at the same time, and to meet constraints such as "ship load not exceeding limits", "matching port berthing time windows" and "special transportation requirements for cargo (such as refrigerated temperature control)", the genetic algorithm can gradually screen out the optimal solution that takes into account multiple objectives and multiple constraints by simulating the process of "initializing population, fitness evaluation, selection-crossover-mutation iteration" of biological evolution.

[0038] In some embodiments, in a shipping and trading system based on the RAG architecture, collaborative communication between sub-agents is achieved through a message queue. This message queue strictly follows the first-in-first-out (FIFO) principle to ensure that various task messages are transmitted in the order they are sent, avoiding collaborative gaps or task execution deviations caused by message disorder, and providing stable communication support for the efficient operation of the system.

[0039] The specific communication process is as follows: After an Agent completes its task, it encapsulates the processing result into a standardized message (the message format includes fields such as "sending Agent ID, receiving Agent ID, message type, core data, and timestamp") and sends it to the message queue. The message queue stores messages in order according to the FIFO principle to prevent later-sent messages from being processed first. At the same time, the Agent that needs to receive the message will continuously listen for messages in the message queue that match its own receiving Agent ID. Once the target message is captured, it will immediately parse the core data in the message and perform subsequent operations based on its own task requirements.

[0040] In the aforementioned shipping trade system based on the RAG architecture, on the one hand, the intent parsing agent can accurately break down the core demands, constraints, and additional requirements in user input through natural language understanding. The main agent then directly dispatches the information retrieval agent and / or the transportation solution generation agent based on the parsing results, without user intervention. This significantly shortens the time from demand submission to response initiation, making it suitable for time-sensitive scenarios in shipping trade. On the other hand, the information retrieval agent, relying on the retrieval enhancement capabilities of the RAG (Retrieval-Augmented Generation) architecture, can connect in real-time to multiple data sources such as ship databases, port information systems, and freight rate platforms, quickly filtering out accurate information that meets user needs. This efficient integration of multi-source information improves the accuracy and reliability of decision-making. Furthermore, the transportation solution generation agent can automatically generate multiple differentiated solutions based on the ship and transportation information obtained by the information retrieval agent, combined with the RAG architecture's learning of shipping trade transportation rules, adapting to the complexity of shipping trade operations. Through the collaborative cooperation of multiple agents, the overall efficiency and quality of shipping transactions can be improved, labor costs reduced, and business turnover accelerated.

[0041] In some embodiments, the sub-agent further includes a tool agent; The tool agent integrates the Model Context Protocol (MCP) toolkit and is used to invoke the corresponding tool components based on the task requirements.

[0042] In this embodiment, the tool agent integrates the MCP toolset, providing support for tools such as information retrieval, text generation, and model evaluation. The tool agent invokes corresponding tools based on the needs of other agents, such as invoking an information retrieval tool to obtain real-time ship location data.

[0043] In this embodiment of the application, the Model Context Protocol (MCP) toolset provides a series of modular tools and functional components that fully support the construction, optimization and practical application of the Retrieval Enhancement Generation (RAG) architecture.

[0044] In this embodiment, the tool components may include, but are not limited to, at least one of information retrieval tools, text generation tools, and model evaluation tools. Each tool component has a clearly defined functional description and calling interface.

[0045] For example, such as Figure 2 As shown, Figure 2 This is a schematic diagram of a shipping and trading system that integrates the MCP toolset.

[0046] In some embodiments, when the main agent or other sub-agents generate tool requirements while performing tasks, they send a call request to the tool agent containing the requirement type, core parameters, and output format requirements. After receiving the request, the tool agent first parses the nature of the requirement (e.g., "obtaining the real-time location of the ship" belongs to the information retrieval category, and "generating a transportation plan report" belongs to the text generation category), then matches the most suitable tool from the MCP toolset, automatically fills in the core parameters, executes the tool operation, and then feeds back the results to the agent that initiated the request in the format required by the request (e.g., JSON, PDF, structured text).

[0047] In some embodiments, in a shipping and trading system based on the RAG architecture, the Agent tool can periodically or on demand evaluate the performance of various core models (such as large language models, cargo matching models, transportation plan generation models, order compliance judgment models, etc.) in the MCP toolset by calling the model evaluation tools in the MCP toolset. This ensures the output accuracy and reliability of the models in specific tasks in the field of shipping and cargo transportation, and provides data support for continuous system optimization.

[0048] In some embodiments, when the tool agent receives a model evaluation request from the task requirements—for example, a monthly model performance inspection triggered by the main agent router or a targeted evaluation triggered by the feasibility deviation of the transportation plan generation agent—it will call an adapted model evaluation tool from the MCP toolset. This tool is designed with a multi-dimensional evaluation index system tailored to the characteristics of shipping and trading businesses. In addition to basic metrics such as accuracy, recall, and F1 score, it also includes business adaptability indicators, such as the constraint satisfaction rate of the transportation plan generation model and the accuracy of ship-cargo matching in the cargo matching model.

[0049] In some embodiments, the sub-agent further includes a reflective agent; The reflective agent is used to evaluate the output of each of the sub-agents to obtain an evaluation result, and to feed back the evaluation result to the main agent if the evaluation result is inconsistent with the expected result. The main intelligent agent is used to initiate a feedback adjustment mechanism based on the evaluation result to correct the output content until the evaluation result corresponding to the corrected content is consistent with the expected result.

[0050] In some embodiments, evaluation dimensions can be set differently for the output characteristics of different sub-Agents, and different evaluation metrics can be used for different agents.

[0051] Optionally, for the intent parsing agent, the evaluation metrics may include, but are not limited to, at least one of intent classification accuracy and key information extraction completeness / accuracy.

[0052] Optionally, for information retrieval agents, evaluation metrics may include, but are not limited to, at least one of information matching accuracy, information timeliness, and information completeness.

[0053] Optionally, for the transportation scheme generation agent, the evaluation metrics may include, but are not limited to, at least one of constraint satisfaction rate, scheme feasibility, and optimization degree.

[0054] Optionally, for the tool agent, the evaluation metrics may include, but are not limited to, at least one of the following: tool call matching degree, tool output accuracy, and call response time.

[0055] In some embodiments, the reflexive agent can pre-set rule scripts to perform structured checks on the output of the sub-agents to be evaluated. For example, for the output of the transportation plan generating agent, the rule script automatically extracts core fields, such as comparing the ship's deadweight and cargo weight. If the cargo weight is greater than the ship's deadweight, it can be determined that the constraint is not met and the result is inconsistent with expectations. Alternatively, it can compare the port berthing time with the port time window field. If the berthing time is not within the window, it can be determined that the berthing plan needs to be adjusted and is inconsistent with expectations. If the evaluation result is inconsistent with expectations, a feedback adjustment mechanism is triggered. The reflexive agent sends a problem report to the main agent. The problem report includes the name of the problematic sub-agent, the problem type, and the specific deviation. The main agent initiates the corresponding processing flow according to the severity of the problem.

[0056] For example, if the problem severity is mild, the main agent directly schedules the sub-agent to re-execute the task without adjusting the model parameters. After the sub-agent outputs the corrected result, it re-enters the evaluation process. If the problem severity is moderate, after rescheduling the corresponding sub-agent to output the result, the output result can be further corrected manually before entering the evaluation process. If the problem severity is severe, the main agent suspends the task execution of the sub-agent and starts the model parameter optimization process: it calls the model evaluation tool of the tool agent to analyze the cause of the deviation, and then uses the model fine-tuning tool to supplement relevant data and adjust the pre-trained model parameters. After optimization, it conducts testing and verification, and can only be put back into use after passing the test.

[0057] In this embodiment, the reflective agent independently evaluates the output of each sub-agent, identifying factual errors, logical flaws, or deviations from user intent. By continuously comparing the actual output with the expected results, the system ensures high accuracy and credibility of the final generated content. When the evaluation result differs from the expectation, the system initiates a feedback adjustment mechanism, allowing the main agent to reschedule or guide relevant sub-agents to correct the content based on the reflective feedback. This process supports multiple rounds of iterative optimization until the output meets quality standards. Furthermore, for tasks involving multi-step reasoning and cross-domain knowledge fusion, the reflective agent can review intermediate results stage by stage to ensure that each step of reasoning conforms to logic and business rules. The main agent then dynamically adjusts the task flow or parameter configuration accordingly, achieving fine-grained control over complex tasks.

[0058] In some embodiments, when the task requirement includes an information query request, querying the corresponding ship information and / or transportation information includes: Based on the information query request, construct a graph database query statement; Based on the graph database query statement, the ship information and the transportation information are obtained by matching from the knowledge graph of the shipping trade field constructed based on GFM-RAG; The invocation of the corresponding tool component based on the task requirements includes: If the information query request includes a real-time information query request, the information retrieval tool is invoked based on the real-time information query request to send a target query request to the ship information database, obtain real-time ship information, and return it to the information retrieval agent.

[0059] For example, when the information retrieval agent receives an information query request (such as the main agent issuing a query instruction for "ship name: COSCO XX, route: Shanghai-Rotterdam" based on the user intent parsing result, i.e., an information query request), firstly, based on the key conditions such as "ship name" and "route" in the information query request, it constructs a graph database query statement in combination with the graph structure model to accurately locate the "COSCO XX" node and its associated "Shanghai-Rotterdam route" node; secondly, it extracts related information from the knowledge graph through this query statement, including basic ship parameters (ship age 5 years, deadweight 20,000 tons, refrigerated hold volume 5,000 cubic meters), route operation data (historical on-time rate 98%, one-way travel time 22 days, ports passed and stop times), and compliance information (ship certificate validity until 2027, etc.); finally, it structures and organizes the extracted information into a standardized data format (such as JSON) and feeds it back to the main agent router, providing data support for the subsequent transportation plan generation agent to formulate customized solutions.

[0060] For example, when an information query request includes a real-time information query request, the tool agent invokes an information retrieval tool to send a query request to the ship information database and obtain information such as the ship's real-time location and technical parameters. The information retrieval tool adopts a RESTful API architecture, supporting multiple query methods (such as querying by ship name, IMO number, etc.). The information retrieval tool returns the query results to the tool agent in JSON format, including information such as ship name, location coordinates (longitude, latitude), and navigation status. The tool agent parses the returned results, converts them into a format that the information retrieval agent can recognize, and sends them to the information retrieval agent to update the ship information in the knowledge graph (knowledge base).

[0061] In this embodiment, for static or highly correlated knowledge, a graph database query statement is constructed to perform semantic matching and multi-hop reasoning from the knowledge graph of the shipping and trade field built based on GFM-RAG to mine deep-seated related information; for dynamic real-time data, an information retrieval tool is called to access the ship dynamic database to obtain the latest status, which improves information integrity, information query efficiency and system response speed.

[0062] In some embodiments, generating a transportation plan based on the ship information and the transportation information includes: Real-time meteorological information acquisition; Based on predefined constraints and optimization objectives, a genetic algorithm is used to analyze and iterate the ship information and the transportation information to generate an initial transportation plan. Using a reinforcement learning module, the transportation path in the initial transportation plan is fine-tuned based on the current Automatic Identification System (AIS) data and the meteorological information to obtain the transportation plan. The invocation of the corresponding tool component based on the task requirements includes: Based on the transportation plan generation requirements, the text generation tool in the MCP toolkit is invoked to generate the transportation plan text.

[0063] In some embodiments, the system uses the Agent tool to call the meteorological information retrieval tool in the MCP toolkit to obtain real-time meteorological data for the transportation route coverage area, including wind direction, wind speed, wave height, visibility, typhoon / rainstorm warnings, and marine meteorological change trends. At the same time, it simultaneously obtains real-time data from the Automatic Identification System (AIS) (including the ship's current position, speed, course, remaining fuel, and the dynamics of surrounding ships) and ship information and transportation information from the map database.

[0064] In some embodiments, the transportation scheme generation agent, based on the real-time information obtained above and predefined constraints, such as avoiding restricted navigation areas, ensuring the ship's draft does not exceed the port's depth, and matching cargo loading and unloading time windows, as well as optimization objectives, such as minimizing total transportation time, minimizing fuel consumption, and minimizing cargo damage risk, and with the weights of each objective dynamically adjusted according to business needs, initiates a genetic algorithm for multiple rounds of iterative computation: the algorithm first initializes a batch of potential transportation schemes (covering different route paths, speed planning, and port berthing order), then selects high-quality schemes through a fitness function (comprehensively evaluating the degree to which the scheme satisfies the constraints and achieves the optimization objectives), and iteratively optimizes through selection, crossover, mutation, and other operations, finally generating an initial transportation scheme that takes into account both global constraints and multi-objective optimization. Based on the initial transportation plan, and combined with real-time updated AIS data and meteorological information, the transportation route of the initial plan is fine-tuned locally: through continuous interaction of real-time monitoring of the correlation between ship position, weather changes and route deviation, action selection, and reward feedback (for example, if the adjusted route is closer to the timeliness target without increasing costs, a positive reward is given; if it deviates from the core constraints, a negative reward is given), the local route details are gradually optimized to obtain the final transportation plan; and the text generation tool in the MCP toolset is called to convert the final transportation plan into text output.

[0065] In this embodiment, by comprehensively analyzing ship information, transportation information, and constraints, the generated initial transportation plan meets the requirements of multiple constraints and multiple objectives. By combining meteorological information and using reinforcement learning to fine-tune the path of the initial transportation plan, it can dynamically adapt to real-time environmental changes and improve the flexibility and feasibility of the plan.

[0066] In some embodiments, the sub-agent further includes an order evaluation agent; The order evaluation agent is used to parse the order to obtain key information when the task requirements include an order evaluation request; perform semantic retrieval of the key information with the domain knowledge graph to obtain target retrieval results; and generate correction suggestions for the order based on the target retrieval results.

[0067] In one embodiment, when the task requirements include an order evaluation request, the order evaluation agent first performs structured parsing of the order content to accurately extract key information, covering cargo type (e.g., general dry goods, frozen fresh goods, dangerous goods, etc.), origin and destination / transfer ports, transportation time requirements (including loading deadline and estimated arrival time), price terms (e.g., FOB, CIF, CFR, etc.), cargo weight / volume, and special transportation requirements (e.g., temperature control, moisture protection, dangerous goods escort), laying a data foundation for subsequent evaluation. Subsequently, relying on a graph database built using GFM-RAG technology, which stores marketing management regulations in the shipping trade sector (e.g., company freight rate system, customer tiered preferential policies, order acceptance authority standards) and a domain knowledge graph (e.g., international maritime regulations, dangerous goods transport safety conventions, port access requirements of various countries, etc.), and where nodes and edges in the knowledge graph are clearly linked, the order evaluation agent generates graph database query statements to perform deep semantic retrieval of order terms and regulations / policy requirements, accurately identifying potential violations or areas for optimization (e.g., orders using FOB). If the terms do not clearly specify the details of risk transfer after shipment, supplementary stipulations can be added to reduce the probability of disputes. Finally, combining the search results with the preset rule engine (the rules cover "violation level judgment standards" and "optimization suggestion priority", such as "the absence of UN number is a high-risk violation, and customers should be asked to supplement it first; missing details in FOB terms are a medium-risk optimization item, and standard supplementary clause templates can be provided simultaneously"), targeted order modification suggestions are generated. The suggestions include "description of violation / optimization item, the relevant legal / policy clauses, specific modification plan (such as supplementing UN number, adding risk transfer clauses), and expected effects after modification", ensuring that the order fully complies with industry norms and policies after adjustment, reducing legal disputes and additional operating costs caused by flawed terms while ensuring compliance.

[0068] In this embodiment, the order evaluation agent evaluates the order. Compared with the traditional shipping trade order evaluation which requires manual review of the order terms word by word, the semantic retrieval capability of the GFM-RAG graph database can be used to accurately match the order terms with massive domain knowledge in a short time, thereby improving the efficiency of order evaluation and shortening the business response cycle. In addition, it can also reduce the risks caused by insufficient experience and omissions in terms of terms in manual evaluation, strengthen compliance risk management, and optimize the operating cost structure.

[0069] In some embodiments, the system further includes a ship berthing scheduling intelligent agent; The intelligent agent for ship berthing is used to obtain basic port information, ship information, and real-time port operation status when the task requirements include a port information query request; and to generate ship berthing plans and cargo loading and unloading plans based on the basic port information, the ship information, and / or the real-time operation status.

[0070] In one embodiment, the vessel berthing agent connects to a graph database built based on GFM-RAG technology to retrieve basic information about the target port, covering static data such as core port facilities (e.g., cold storage areas, dedicated dangerous goods berths, container loading and unloading areas), detailed berth parameters (e.g., berth number, maximum berthing tonnage, water depth conditions, type and rated efficiency of supporting loading and unloading equipment), and port service capabilities (e.g., maximum daily loading and unloading volume, types of cargo that can be handled). Simultaneously, it uses the information retrieval tool within the agent to obtain two types of dynamic information: key parameters of the vessel itself (e.g., vessel tonnage, draft, cargo type and loading and unloading requirements, estimated arrival time) and the real-time operational status of the port (e.g., current berth occupancy, vessel operation progress in port, expected arrival vessel queue, and early warning of loading and unloading equipment malfunctions).

[0071] In one embodiment, the ship berthing agent relies on professional scheduling algorithms (such as greedy scheduling algorithms, genetic algorithms, etc.) to deeply integrate and calculate the above-mentioned static and dynamic information. For example, for berth recommendation, the algorithm can prioritize matching the ship's draft and the berth's water depth (e.g., for ships with a draft of 12 meters, automatically select berths No. 3 and No. 5 in the port with a water depth ≥ 12.5 meters). At the same time, it combines the ship's cargo type (e.g., dangerous goods ships are matched with dedicated dangerous goods berths to avoid safety risks caused by cross-operation with ordinary cargo berths) and the current occupancy status of the berth (e.g., berth No. 3 is expected to be vacant in 1 hour, and berth No. 5 is currently vacant, and a more suitable berth can be recommended based on the ship's expected arrival time). For optimizing loading and unloading schedules, the algorithm aims to reduce vessel waiting time and improve port equipment utilization. It combines estimated vessel arrival times (e.g., vessel A is expected to arrive at 10:00, vessel B at 10:30), cargo handling volume (vessel A needs to handle 200 containers, vessel B needs to handle 100 containers), and port operation schedules (e.g., berth 1 is currently handling vessel C and is expected to be available at 10:15). The algorithm dynamically adjusts the loading and unloading sequence (e.g., prioritizing vessel B's use of berth 1 after 10:15, and berthing vessel A connecting to the available berth 2 after arrival, avoiding queuing between the two vessels). The vessel berthing agent generates a standard solution that includes both vessel berthing and cargo loading / unloading schedules.

[0072] In this embodiment, the intelligent ship berthing agent can accurately recommend suitable berths and plan loading and unloading sequences by integrating information such as port water depth conditions, berth occupancy status, ship draft, and cargo type in advance. Based on the accurate matching of real-time port operation status and ship demand, port resource allocation can be optimized, while reducing the risk of failure caused by equipment overload and lowering port maintenance costs.

[0073] In some embodiments, the sub-agent may further include a ship pallet identification agent. Upon receiving basic ship information (such as ship name, IMO number, ship type, and other key identifiers), the ship pallet identification agent automatically triggers a multi-source data collaborative invocation mechanism: synchronously connecting to data platforms such as the ship registration database, ship dynamic monitoring system, and shipping company operation management platform to comprehensively and accurately collect key ship information. After completing the multi-source information collection, the ship pallet identification agent automatically integrates and standardizes the collected unstructured, multi-format data according to the system's predefined standardized ship pallet data templates for the shipping trade industry. For example, parameters such as "deadweight tonnage 20,000 tons" and "refrigerated hold temperature control range -25℃ to 5℃" are accurately categorized into the technical parameter table, and "currently anchored at Shanghai Port, expected to depart in 2 days" is synchronized to the real-time operation table, ultimately generating unified ship pallet data that supports export in multiple formats such as JSON and Excel. In one embodiment, the vessel identification agent can also combine real-time updated market conditions, such as fluctuations in frozen cargo freight rates and changes in cargo volume, with current transportation demand characteristics, and use a built-in intelligent evaluation model to make a preliminary judgment on the vessel's suitability for cargo: output evaluation conclusions from three dimensions: technical compatibility, operational matching degree, and market fit, for example, marking "prioritize suitability for frozen fresh cargo, recommend connecting with high-time-efficiency orders on the Shanghai Port-Europe route".

[0074] In some embodiments, the system merges preprocessed data with the original training data to construct an updated training dataset. Based on this dataset, Supervised Fine-Tuning (SFT) is employed to fine-tune various models in the system, such as large language models and cargo matching models, to better adapt them to the business logic and data distribution characteristics of the shipping cargo transportation field. During fine-tuning, reasonable training hyperparameters (such as learning rate and batch size) are set, and an early stopping mechanism is introduced to prevent model overfitting. During training, the model's performance on the independent validation set is evaluated at fixed intervals (e.g., every 5 rounds), calculating key performance indicators such as accuracy, recall, and F1 score. The training strategy is dynamically adjusted based on the evaluation results to ensure continuous optimization of model performance. For example, when fine-tuning the model for cargo matching, historical cargo-ship matching data accumulated in practice is used as training samples to improve the model's generalization ability in real-world scenarios.

[0075] Building upon this foundation, a data flywheel mechanism is constructed to enable continuous iteration and self-enhancement of model capabilities. Specifically, after the model's outputs, such as cargo matching suggestions and transportation plans, are adopted and implemented by users, relevant feedback data (such as matching success rate, transportation timeliness, and customer satisfaction) is automatically collected and stored in a data warehouse. This high-quality closed-loop feedback data is integrated with the original dataset for the next round of model retraining and optimization, forming a positive cycle. To ensure the healthy operation of the data flywheel, the system regularly conducts data quality assessments. By analyzing the rationality of user feedback and the consistency of behavior, low-quality or abnormal data (such as malicious ratings and erroneous operation records) is identified and filtered. When necessary, annotation corrections or removals are performed to ensure the authenticity, reliability, and representativeness of the training data.

[0076] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0077] The various agents in the shipping and trading system based on the RAG architecture described above can be implemented entirely or partially through software, hardware, or a combination thereof. These agents can be embedded in the processor of the electronic device in hardware form or independent of the processor, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each agent.

[0078] In one embodiment, an electronic device is provided, the internal structure of which can be shown as follows: Figure 3 As shown, the electronic device includes a processor, memory, communication interface, display unit, and input device connected via a method bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores operating methods and computer programs. The internal memory provides an environment for the operation of the operating methods and computer programs stored in the non-volatile storage medium. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it performs the steps of a shipping system based on a RAG architecture. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the device's casing, or an external keyboard, touchpad, or mouse.

[0079] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0080] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the steps described above in the shipping and trading system based on the RAG architecture.

[0081] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps performed by the processor of the electronic device of any of the above.

[0082] It should be noted that the user data (including but not limited to user device data, user personal data, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all data and data authorized by the user or fully authorized by all parties.

[0083] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, compilable logic units, quantum computing-based knowledge graph construction logic units, etc., and are not limited to these.

[0084] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0085] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A ship trade system based on RAG architecture, characterized in that, The system comprises a main intelligent agent and a plurality of sub-intelligent agents, wherein the sub-intelligent agents at least comprise an intention analysis intelligent agent; the sub-intelligent agents further comprise an information retrieval intelligent agent and / or a transportation scheme generation intelligent agent; The main intelligent agent is configured to dispatch the corresponding sub-intelligent agents to work cooperatively according to a user input requirement; The intention analysis intelligent agent is configured to perform intention analysis on the user input requirement when the complexity of the user input requirement is greater than a reference standard, and determine a task requirement; The information retrieval intelligent agent is configured to query corresponding ship information and / or transportation information when the task requirement comprises an information query request; The transportation scheme generation intelligent agent is configured to generate a transportation scheme based on the ship information and the transportation information when the task requirement comprises a transportation scheme generation request.

2. The system of claim 1, wherein, The sub-intelligent agents further comprise a tool intelligent agent; The tool intelligent agent is integrated with a model context protocol (MCP) tool set, and is configured to invoke corresponding tool components based on the task requirement.

3. The system of claim 1, wherein, The sub-intelligent agents further comprise a reflection intelligent agent; The reflection intelligent agent is configured to evaluate the output content of each sub-intelligent agent to obtain an evaluation result, and feed back the evaluation result to the main intelligent agent when the evaluation result is inconsistent with an expected result; The main intelligent agent is configured to start a feedback adjustment mechanism based on the evaluation result, modify the output content until the modified content corresponds to the evaluation result consistent with the expected result.

4. The system of claim 2, wherein, When the task requirement comprises an information query request, the information retrieval intelligent agent is configured to: construct a graph database query statement based on the information query request; match the ship information and the transportation information from a ship trade field knowledge graph constructed based on a GFM-RAG based on the graph database query statement; and When the task requirement comprises an information query request, the information retrieval intelligent agent is configured to: invoke an information retrieval tool based on the real-time information query request, send a target query request to a ship information database, and obtain real-time ship information and return the real-time ship information to the information retrieval intelligent agent.

5. The system of claim 2, wherein, The transportation scheme generation intelligent agent is configured to: obtain weather information in real time; analyze and iterate the ship information and the transportation information based on predefined constraint conditions and optimization objectives in combination with a genetic algorithm to generate an initial transportation scheme; perform local path fine-tuning on a transportation path in the initial transportation scheme based on the current ship automatic identification system data and the weather information by using a reinforcement learning module to obtain the transportation scheme; The tool intelligent agent is configured to: invoke a text generation tool in the MCP tool set based on the transportation scheme generation requirement to generate a transportation scheme text.

6. The system of claim 1, wherein, The sub-intelligent agents further comprise an order evaluation intelligent agent; The order evaluation intelligent agent is configured to: perform analysis on an order when the task requirement comprises an order evaluation request to obtain key information; and perform semantic retrieval on the key information and a field knowledge graph to obtain a target retrieval result. Based on the target search result, a revision suggestion for the order is generated.

7. The system of claim 1, wherein, The system further comprises a ship berthing scheduling intelligent agent; The ship berthing intelligent agent is configured to, when the task demand comprises a port information query request, acquire port basic information, ship information and real-time operation state of the port; and generate a ship berthing plan and a cargo loading and unloading plan based on the port basic information, the ship information and / or the real-time operation state.

8. The system of claim 1, wherein, The intent analysis on the user input demand comprises: Filtering and removing the user input content based on TokenSkip to obtain the user input demand; Performing semantic understanding on the user input demand based on a large language model in the ship trade field to determine an intent category; Extracting core information related to the intent category based on the intent category; Generating the task demand in a predetermined format based on the intent category and the core information.

9. An electronic device, comprising: The system comprises a processor and a memory; wherein the memory is configured to store a computer program; and the processor is configured to execute the computer program to implement the process steps performed by the system according to any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is configured to, when executed by the processor, implement the process steps performed by the system according to any one of claims 1 to 7.