A semantic vector construction and retrieval method and system for maritime route data
By extracting multi-dimensional features and transforming semantic templates, a semantic vector representation of the shipping route is generated, which solves the problems of insufficient multi-dimensional features and semantic understanding in maritime shipping route data, and realizes efficient and accurate intelligent route retrieval, improving user experience and retrieval efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN COSCO SHIPPING DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2026-06-01
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies are insufficient in the representation and feature utilization of maritime route data. They cannot fully and deeply extract and integrate the multidimensional features of routes, and there are problems of "semantic gap" and high retrieval complexity in terms of semantic understanding and retrieval efficiency, making it difficult to meet the real-time retrieval needs of large-scale data.
By acquiring historical flight paths and ship attribute data, multi-dimensional feature extraction is performed to construct a structured flight path data set. Based on preset semantic templates and feature mapping rules, the structured feature representation at the flight path level is transformed into a unified semantic text representation of the flight path. An embedding model is used to generate a semantic vector representation of the flight path, thereby enabling intelligent retrieval of high-level semantic intent.
It achieves comprehensive characterization and efficient calculation of route characteristics, accurately understands users' complex semantic needs, improves the relevance and practicality of route recommendations, and supports efficient retrieval of large-scale maritime route data.
Smart Images

Figure CN122489552A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical fields of intelligent shipping and artificial intelligence, and in particular to a method and system for constructing and retrieving semantic vectors for maritime route data. Background Technology
[0002] With the booming development of the global shipping industry and the deepening of digitalization, utilizing historical navigation data to assist in route planning, optimization, and recommendation has become an important research direction in the field of intelligent shipping. Equipment such as Automatic Identification Systems (AIS) generate massive amounts of ship track data, providing a valuable data foundation for analyzing route patterns, assessing navigation risks, and improving operational efficiency. Route mining, similarity calculation, and personalized recommendation technologies based on historical tracks are of significant importance for improving ship navigation safety, reducing fuel consumption, and optimizing shipping logistics efficiency.
[0003] However, existing technologies have significant shortcomings in data representation and feature utilization. Current methods mostly rely on the spatial geometry of the flight path or a few dimensions (such as distance and time) for shallow analysis, failing to comprehensively and deeply extract and integrate the multidimensional features of the flight path, such as refined navigation motion status, detailed meteorological environmental information, potential risk exposure, and the stability of the flight path itself. This single or shallow feature representation method results in an insufficiently comprehensive and accurate characterization of the flight path, failing to fully reflect the true nature and inherent attributes of the flight path, and severely limiting the depth and accuracy of subsequent analysis and recommendations.
[0004] At the semantic understanding and user intent matching level, existing solutions generally suffer from a "semantic gap." Most systems still employ retrieval methods based on keyword matching or simple rule filtering, making it difficult to understand users' high-level, abstract semantic needs such as "safety," "stability," and "economy," and to effectively map these needs to specific route features for quantitative matching. Due to the lack of ability to associate low-level data features with high-level semantic intent, the retrieval process is often rigid, and the returned results fail to accurately match users' complex and multi-objective true planning intentions, resulting in a poor user experience.
[0005] Furthermore, in terms of retrieval efficiency and scalability, existing technologies struggle to balance retrieval accuracy and efficiency when faced with massive amounts of historical flight track data. Similarity calculation methods based on traditional metrics (such as dynamic time warping and Fraser distance) are computationally complex and cannot meet the real-time retrieval needs of large-scale data. On the other hand, some methods based on simple hashing or indexing are insufficient to support complex similarity judgments based on the multi-dimensional semantics of flight routes. The lack of a mechanism that can efficiently encode the rich semantics of flight routes into a computable and comparable representation, and support large-scale approximate nearest neighbor search, has become a key bottleneck restricting the actual deployment and application performance of related systems. Therefore, there is room for improvement. Summary of the Invention
[0006] To address the aforementioned technical issues, this application provides a method and system for constructing and retrieving semantic vectors for maritime route data.
[0007] The above-mentioned objective of this application is achieved through the following technical solution:
[0008] A method for constructing and retrieving semantic vectors for maritime route data, comprising the following steps:
[0009] Acquire historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set;
[0010] For each route in the route data set, multi-dimensional features are extracted to form a route-level structured feature representation. The multi-dimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features.
[0011] Based on preset semantic templates and feature mapping rules, the route-level structured feature representation is transformed into a unified route semantic text representation;
[0012] The semantic text representation of the flight route is input into a preset embedding model for encoding, generating a corresponding semantic vector representation of the flight route, and then standardized and stored.
[0013] The system receives user query requests, responds to the user query requests, converts them into query semantic text and generates query vectors, calculates the similarity between the query vectors and the stored route semantic vectors, and outputs a set of candidate routes based on the similarity matching results.
[0014] By adopting the above technical solution, a structured route data set was constructed by acquiring historical track and vessel attribute data and grouping them by origin and destination ports. This provides a unified and standardized data foundation for subsequent analysis, solving the problems of messy raw AIS data and difficulty in effectively aggregating data from single voyages. Furthermore, multi-dimensional feature extraction was performed on each route, comprehensively characterizing its characteristics from multiple perspectives such as navigation motion, meteorological environment, risk exposure, and stability. This resulted in a structured feature representation that comprehensively reflects the inherent attributes of the route, overcoming the limitations of traditional methods that only consider a single dimension (such as distance or time). Based on preset semantic templates and feature mapping rules, the numerical structured features were transformed into a unified semantic text representation of the route, bridging the gap between machine data and human-understandable semantics, laying the foundation for deep semantic understanding. Subsequently, the semantic text was encoded into semantic vectors through an embedding model and stored in a standardized manner, enabling efficient calculation and comparison of complex route semantic information in the form of dense vectors. Finally, by transforming user queries into query vectors and performing similarity matching, intelligent route retrieval based on high-level semantic intent (such as "safety" and "efficiency") was achieved, rather than simple keyword or numerical matching. This enables more accurate fulfillment of users' diverse route planning needs and significantly improves the relevance and practicality of route recommendations.
[0015] In a preferred embodiment, this application can be further configured as follows: the step of extracting multi-dimensional features from each route in the route data set to form a route-level structured feature representation specifically includes:
[0016] Based on track data, calculate the average speed, maximum speed, speed standard deviation, average heading, and heading variance of the route.
[0017] Based on the associated meteorological data, the average wind speed, maximum wind speed, average wave height, maximum wave height, and average sea surface temperature of the areas traversed by the route are calculated.
[0018] Identify extreme weather segments and high-risk areas in flight routes, and calculate the extreme weather exposure ratio and the duration of passage through high-risk areas;
[0019] Based on the turning points of the flight path, the turning frequency per unit distance is calculated, and the overall stability index of the flight path is calculated based on the trajectory curvature.
[0020] By adopting the above technical solutions, refined features are extracted from four dimensions: navigation motion, meteorological environment, risk exposure, and route stability. Calculating average speed, maximum speed, speed standard deviation, average heading, and heading variance accurately quantifies the overall motion state and fluctuations of the vessel on the route, providing crucial evidence for assessing route efficiency and predictability. Calculating the mean and maximum values of wind speed, wave height, and sea temperature objectively reflects the overall meteorological conditions and extreme sea state risks of the sea areas traversed by the route, enhancing the comprehensiveness and accuracy of route environmental assessment. Identifying extreme weather sections and high-risk areas and calculating their exposure ratios and passage times enables a quantitative assessment of potential route risks, shifting risk comparison from qualitative to quantitative. Calculating turning frequency and stability indicators based on trajectory curvature geometrically characterizes the tortuosity and smoothness of navigation. This multi-dimensional and refined feature extraction scheme collectively constructs a rich and in-depth profile of route features, providing solid data support for generating accurate and detailed semantic descriptions, overcoming the shortcomings of traditional feature extraction methods that are single-dimensional and coarsely characterized.
[0021] In a preferred example, this application can be further configured as follows: the transformation of the route-level structured feature representation into a unified route semantic text representation based on preset semantic templates and feature mapping rules specifically includes:
[0022] Construct multiple semantic description templates to describe basic route information, navigation status, meteorological environment, risk characteristics, and stability;
[0023] Establish mapping rules from numerical ranges to semantic labels, and conversion rules from continuous variables to descriptive statements;
[0024] Based on the semantic template and mapping rules, global semantics describing the overall characteristics of the route, local semantics describing the characteristics of the route segments, and event semantics describing key events are generated respectively.
[0025] The global semantics, local semantics, and event semantics are combined and standardized to form a structured route semantic text, and high-level semantic tags are introduced into it.
[0026] By adopting the above technical solutions, a standardized conversion process from structured features to semantic text was constructed. Multiple semantic description templates covering basic route information, navigation status, meteorological environment, risk characteristics, and stability were pre-built, ensuring the standardization and consistency of the generated semantic descriptions in terms of format and content. Mapping rules were established from numerical ranges to semantic labels and from continuous variables to descriptive statements, automatically transforming cold, impersonal numerical features into meaningful natural language fragments, guaranteeing the accuracy and interpretability of semantic generation. Based on templates and rules, semantics describing the overall route, its parts, and key events were generated, forming a multi-layered semantic description system combining global overview, local refinement, and highlighting key events. This allows the generated text to grasp both the overall route picture and subtle differences. Finally, by combining and standardizing multi-granular semantics and introducing high-level semantic labels such as "safety" and "efficiency," a final semantic text with a clear structure, rich semantics, and generalized labels was output. This process systematically and hierarchically organizes chaotic multi-dimensional feature data into high-quality text descriptions, providing high-quality and standardized input for subsequent vectorized encoding, and is a key step in improving the semantic understanding capability of the entire system.
[0027] In a preferred embodiment, this application can be further configured as follows: based on the semantic template and mapping rules, generating global semantics describing the overall characteristics of the route, local semantics describing the characteristics of route segments, and event semantics describing key events, specifically includes:
[0028] Map the route-level structured features to generate global semantics that summarize the entire route's navigation status, average environmental conditions, and overall risk level.
[0029] The route is divided into multiple segments, and the local features extracted from each segment are mapped to generate segmented semantics that describe the specific navigation conditions and risks of each segment.
[0030] Identify extreme weather or high-risk critical events in flight routes, extract event duration and intensity features, and generate event semantics for the event;
[0031] Establish logical connections between the global semantics, segmented semantics, and event semantics, and integrate them into a coherent, multi-layered route semantic text.
[0032] By adopting the above technical solutions, the generation process of multi-level semantics is further refined. Mapping the structured features at the route level to generate global semantics provides users or systems with a high-level overview of the entire route's navigation status, average environmental conditions, and overall risk level, facilitating a rapid grasp of the route's core attributes. Dividing the route into multiple segments and generating segmented semantics for each segment reveals the differences in navigation conditions and risks across different sections within the route, providing more refined local insights than global semantics and helping to identify advantageous and bottleneck segments. Identifying key events such as extreme weather or high-risk events and generating event semantics focuses on discrete situations that significantly impact navigation safety or efficiency, providing crucial risk points and decision-making information. Finally, establishing logical connections between global, segmented, and event semantics and integrating them into a coherent, multi-level text ensures the logical consistency and narrative fluency of the final semantic description, avoiding information fragmentation. This semantic generation logic, from the whole to the part and from the general to the specific, makes the generated route description both comprehensive and in-depth, greatly enhancing the richness and practicality of semantic representation.
[0033] In a preferred embodiment, this application can be further configured as follows: the combination and standardization of the global semantics, local semantics, and event semantics to form a structured route semantic text, and the introduction of high-level semantic tags therein, specifically including:
[0034] The generated semantic description statements are standardized in terms of sentence structure and terminology to eliminate redundancy. The contradictions between the standardized semantic description statements are checked and logically corrected.
[0035] Based on the analysis results of the route characteristics, one or more high-level semantic tags are automatically assigned to the semantic text;
[0036] The output is the final route semantic text, which has been standardized, validated for consistency, and injected with high-level semantic tags, for vectorization.
[0037] By employing the aforementioned technical solutions, key standardization and enhancement processes were performed on the combined semantic text. Standardizing the sentence structure and terminology of the generated semantic descriptions eliminated potential redundancy and inconsistencies in word choice caused by different templates or mappings, improving the text's standardization and readability. Checking for contradictions among the standardized semantic descriptions and making logical corrections ensured the consistency of semantic information from different sources and at different granularities after integration, avoiding information conflicts and improving the accuracy and reliability of the semantic text. Based on the analysis results of flight route features, high-level semantic tags were automatically assigned to the semantic text, enabling intelligent summarization and classification of the overall attributes of the flight routes. This injected clear, generalized semantics into the text, greatly facilitating subsequent rapid retrieval, filtering, and classification. The final output is standardized, consistency-checked flight route semantic text with high-level semantic tags, resulting in higher quality and clearer information in the input embedding model. This helps generate vector representations with better discriminative power and more accurate semantics, while also providing users with intuitive flight route attribute tags.
[0038] In a preferred embodiment, this application can be further configured as follows: the step of inputting the semantic text representation of the flight route into a preset embedding model for encoding, generating a corresponding semantic vector representation of the flight route, and performing standardization processing and storage specifically includes:
[0039] The semantic temperature variation of the route is used as the input text sequence of the embedding model. The embedding model is used to encode the input semantic text sequence to generate a dense vector of fixed dimension, which serves as the semantic vector representation of the route.
[0040] The generated route semantic vectors are normalized to ensure that all vectors are on the same scale. The normalized route semantic vectors are then associated with the corresponding route unique identifiers and stored in a vector database or a vector index is constructed.
[0041] By employing the above technical solution, high-quality route semantic text is transformed into computable and comparable semantic vectors. Using the standardized route semantic text as the input sequence of the embedding model, the powerful semantic understanding capability of the pre-trained language model encodes the complex semantic information contained in the text into a dense vector of fixed dimension. This vector effectively captures the comprehensive semantic features of routes in terms of safety, efficiency, and stability. Normalizing the generated route semantic vectors ensures that all vectors are on the same scale, eliminating the influence of vector magnitude on similarity calculations. This allows subsequent similarity comparisons to more purely reflect the closeness in vector direction (i.e., semantic content), improving the accuracy and stability of retrieval. Associating the normalized vectors with unique route identifiers and storing them in a vector database or constructing a vector index provides the technical foundation for the efficient storage and rapid retrieval of massive route semantic vectors. This enables large-scale semantically similar route matching and is the core guarantee for the efficient operation of the entire retrieval system.
[0042] In a preferred embodiment, this application can be further configured as follows: receiving a user query request, responding to the user query request, converting it into query semantic text and generating a query vector, calculating the similarity between the query vector and the stored route semantic vector, and outputting a candidate route set based on the similarity matching result, specifically including:
[0043] Receive user queries containing origin and destination ports, navigation destination and vessel attributes, and parse the navigation destination into high-level semantic requirements;
[0044] Based on the parsed high-level semantic requirements, combined with the constraints of origin and destination ports and ship attributes, query semantic text is constructed, and query vectors are generated using an embedding model.
[0045] Calculate the cosine similarity between the query vector and all route semantic vectors in the vector database, and sort all routes in descending order based on the cosine similarity score to obtain a list of matched routes.
[0046] By adopting the above technical solution, intelligent route retrieval based on high-level semantic intent is achieved. By receiving user queries containing origin and destination ports, navigation targets, and vessel attributes, and parsing the navigation targets into high-level semantic requirements such as "safety" and "efficiency," the system can accurately understand the user's complex and unstructured search intent, rather than simply relying on keyword matching. Based on the parsed high-level semantic requirements, and combined with constraints such as origin and destination ports, query semantic text is constructed. A query vector is generated using the same embedding model as in the construction phase, ensuring that the query and routes in the database are in the same semantic vector space, making similarity comparisons meaningful. Calculating the cosine similarity between the query vector and the semantic vectors of all routes in the database is an efficient and effective measure of semantic similarity. Sort all routes in descending order based on similarity scores to quickly filter out the candidate route list that best matches the user's needs at the semantic level. This process transforms the user's abstract needs into specific vectorized queries and achieves precise matching through similarity calculation in the vector space, fundamentally improving the intelligence level of route retrieval and the user experience.
[0047] Secondly, the above-mentioned inventive objective of this application is achieved through the following technical solutions:
[0048] A semantic vector construction and retrieval system for maritime route data, the system comprising:
[0049] The route data construction module is used to acquire historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set;
[0050] The multidimensional feature extraction module is used to extract multidimensional features from each route in the route data set to form a route-level structured feature representation. The multidimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features.
[0051] The route semantic encoding module is used to transform the route-level structured feature representation into a unified route semantic text representation based on a preset semantic template and feature mapping rules.
[0052] The route semantic vector construction module is used to input the route semantic text representation into a preset embedding model for encoding, generate the corresponding route semantic vector representation, and perform standardization processing and storage.
[0053] The route semantic retrieval module is used to receive user query requests, respond to the user query requests, convert them into query semantic text and generate query vectors, calculate the similarity between the query vectors and the stored route semantic vectors, and output a candidate route set based on the similarity matching results.
[0054] By adopting the above technical solution, a structured route data set was constructed by acquiring historical track and vessel attribute data and grouping them by origin and destination ports. This provides a unified and standardized data foundation for subsequent analysis, solving the problems of messy raw AIS data and difficulty in effectively aggregating data from single voyages. Furthermore, multi-dimensional feature extraction was performed on each route, comprehensively characterizing its characteristics from multiple perspectives such as navigation motion, meteorological environment, risk exposure, and stability. This resulted in a structured feature representation that comprehensively reflects the inherent attributes of the route, overcoming the limitations of traditional methods that only consider a single dimension (such as distance or time). Based on preset semantic templates and feature mapping rules, the numerical structured features were transformed into a unified semantic text representation of the route, bridging the gap between machine data and human-understandable semantics, laying the foundation for deep semantic understanding. Subsequently, the semantic text was encoded into semantic vectors through an embedding model and stored in a standardized manner, enabling efficient calculation and comparison of complex route semantic information in the form of dense vectors. Finally, by transforming user queries into query vectors and performing similarity matching, intelligent route retrieval based on high-level semantic intent (such as "safety" and "efficiency") was achieved, rather than simple keyword or numerical matching. This enables more accurate fulfillment of users' diverse route planning needs and significantly improves the relevance and practicality of route recommendations.
[0055] Thirdly, the above-mentioned objectives of this application are achieved through the following technical solutions:
[0056] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the semantic vector construction and retrieval method for maritime route data described above.
[0057] Fourthly, the above-mentioned objectives of this application are achieved through the following technical solutions:
[0058] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described semantic vector construction and retrieval method for maritime route data.
[0059] In summary, this application includes at least one of the following beneficial technical effects:
[0060] 1. By acquiring historical flight paths and vessel attribute data and grouping them by origin and destination ports, a structured set of route data was constructed, providing a unified and standardized data foundation for subsequent analysis and solving the problems of messy raw AIS data and difficulty in effectively aggregating data from single voyages. Furthermore, multi-dimensional feature extraction was performed on each route, comprehensively characterizing its features from multiple perspectives such as navigation motion, meteorological environment, risk exposure, and stability. This resulted in a structured feature representation that comprehensively reflects the inherent attributes of the route, overcoming the limitations of traditional methods that only consider a single dimension (such as distance or time). Based on pre-defined semantic templates and feature mapping rules, the numerical structured features were transformed into a unified semantic text representation of the route, bridging the gap between machine data and human-understandable semantics, laying the foundation for deep semantic understanding. Subsequently, the semantic text was encoded into semantic vectors through an embedding model and stored in a standardized manner, enabling efficient calculation and comparison of complex route semantic information in the form of dense vectors. Finally, by converting user queries into query vectors and performing similarity matching, intelligent route retrieval based on high-level semantic intent (such as "safety" and "efficiency") was achieved, rather than simple keyword or numerical matching. This enables more accurate fulfillment of users' diverse route planning needs and significantly improves the relevance and practicality of route recommendations.
[0061] 2. A standardized conversion process from structured features to semantic text was constructed. By pre-constructing multiple semantic description templates covering basic route information, navigation status, meteorological environment, risk characteristics, and stability, the standardization and consistency of the generated semantic descriptions in terms of format and content were ensured. Mapping rules from numerical ranges to semantic labels and from continuous variables to descriptive statements were established, enabling the automatic transformation of cold, impersonal numerical features into natural language fragments with clear meaning, ensuring the accuracy and interpretability of semantic generation. Based on templates and rules, semantics describing the overall route, its parts, and key events were generated respectively, forming a multi-level semantic description system that combines global overview, local refinement, and highlighting key events. This allows the generated text to grasp both the overall picture of the route and the subtle differences. Finally, by combining and standardizing multi-granular semantics and introducing high-level semantic labels such as "safety" and "efficiency," a final semantic text with a clear structure, rich semantics, and generalized labels was output. This process systematically and hierarchically organizes messy multi-dimensional feature data into high-quality text descriptions, providing high-quality and standardized input for subsequent vectorized encoding, and is a key link in improving the semantic understanding capability of the entire system.
[0062] 3. Key standardization and enhancement processes were performed on the combined semantic text. By standardizing the sentence structure and terminology of the generated semantic description statements, redundancy and inconsistencies in word usage that might arise from different templates or mappings were eliminated, improving the text's standardization and readability. By checking for contradictions among the standardized semantic description statements and making logical corrections, the consistency of semantic information from different sources and at different granularities was ensured after integration, avoiding information conflicts and improving the accuracy and reliability of the semantic text. Based on the analysis results of route features, high-level semantic tags were automatically labeled for the semantic text, enabling intelligent summarization and classification of the overall attributes of the routes, injecting clear and generalized semantics into the text, greatly facilitating subsequent rapid retrieval, filtering, and classification. The final output is a standardized, consistency-checked route semantic text with high-level semantic tags, resulting in higher quality and clearer information in the text input to the embedding model. This helps generate vector representations with better discriminative power and more accurate semantics, while also providing users with intuitive route attribute tags.
[0063] 4. Intelligent route retrieval based on high-level semantic intent has been achieved. By receiving user queries containing origin and destination ports, navigation destinations, and vessel attributes, and parsing the navigation destinations into high-level semantic requirements such as "safety" and "efficiency," the system can accurately understand the user's complex and unstructured search intent, rather than simply relying on keyword matching. Based on the parsed high-level semantic requirements, and combined with constraints such as origin and destination ports, a query semantic text is constructed. A query vector is generated using the same embedding model as in the construction phase, ensuring that the query and the routes in the database are in the same semantic vector space, making similarity comparisons meaningful. Calculating the cosine similarity between the query vector and the semantic vectors of all routes in the database is an efficient and effective measure of semantic similarity. Sort all routes in descending order based on similarity scores to quickly filter out a list of candidate routes that best match the user's needs at the semantic level. This process transforms the user's abstract needs into specific vectorized queries and achieves precise matching through similarity calculation in the vector space, fundamentally improving the intelligence level of route retrieval and the user experience. Attached Figure Description
[0064] Figure 1 This is a flowchart of a semantic vector construction and retrieval method for maritime route data in one embodiment of this application;
[0065] Figure 2 This is a flowchart illustrating the implementation of step S20 in a semantic vector construction and retrieval method for maritime route data in one embodiment of this application.
[0066] Figure 3 This is a flowchart illustrating the implementation of step S30 in a semantic vector construction and retrieval method for maritime route data in one embodiment of this application.
[0067] Figure 4 This is a flowchart illustrating the implementation of step S33 in a semantic vector construction and retrieval method for maritime route data in one embodiment of this application.
[0068] Figure 5 This is a flowchart illustrating the implementation of step S34 in a semantic vector construction and retrieval method for maritime route data in one embodiment of this application.
[0069] Figure 6 This is a flowchart illustrating the implementation of step S40 in a semantic vector construction and retrieval method for maritime route data in one embodiment of this application.
[0070] Figure 7 This is a flowchart illustrating the implementation of step S50 in a semantic vector construction and retrieval method for maritime route data in one embodiment of this application.
[0071] Figure 8 This is a principle block diagram of a semantic vector construction and retrieval system for maritime route data according to one embodiment of this application;
[0072] Figure 9 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0073] The present application will be further described in detail below with reference to the accompanying drawings.
[0074] In one embodiment, such as Figure 1 As shown, this application discloses a semantic vector construction and retrieval method for maritime route data, which specifically includes the following steps:
[0075] S10: Obtain historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set.
[0076] In this embodiment, the route data set is the basic data unit for constructing semantic vectors. Its core is to aggregate discrete ship trajectory points into routes with clear start and end points. Historical track data usually comes from the Automatic Identification System (AIS) and includes dynamic information such as timestamps, latitude and longitude, speed over land, and heading over land; ship attribute data includes static information such as ship type, gross tonnage, draft, and length. Grouping by origin and destination ports aims to classify multiple navigation tracks between the same pair of ports, laying the data foundation for subsequently extracting the common features and patterns of the route.
[0077] Specifically, raw AIS message data is obtained from maritime AIS data centers or shipping company databases. The data time span should ideally cover at least one full year to include weather conditions across different seasons. First, the raw data is cleaned, removing invalid points with abnormal latitude and longitude, speeds of 0 (in berthed state), or speeds exceeding reasonable ranges (e.g., merchant ships exceeding 30 knots). Next, based on the time series and spatial density of the trajectory points, a trajectory clustering algorithm (such as the density-based DBSCAN algorithm) is used to segment continuous AIS point sequences into single voyage trajectories. Then, using a port geographic information system (GIS) database, a spatial matching algorithm (such as point-polygon inclusion judgment) is used to identify the starting and destination ports of each trajectory. Finally, voyage trajectories with the same pair of starting and ending ports are grouped into the same route data set, and each route is assigned a unique identifier. This process solves the problems of messy raw AIS data and difficulty in identifying single voyages, forming a structured route sample library.
[0078] S20: Extract multi-dimensional features from each route in the route data set to form a route-level structured feature representation. The multi-dimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features.
[0079] In this embodiment, route-level structured feature representation is the process of abstracting a route into a set of quantifiable and computable feature vectors, aiming to characterize the intrinsic attributes of the route from different dimensions. Navigation motion features reflect the macroscopic motion state of the ship on the route; meteorological environment features describe the environmental conditions of the sea areas traversed by the route; risk exposure features quantify the probability and duration of the route passing through high-risk areas; and route stability features characterize the straightness and smoothness of the route. These features collectively constitute the numerical foundation of route semantics.
[0080] Specifically, the feature extraction process is performed independently for each route in the route dataset. First, navigation motion characteristics are calculated from the cleaned AIS trajectory points: based on the speed-to-ground (SOG) sequence of all trajectory points, the average speed, maximum speed, and speed standard deviation are calculated; based on the heading-to-ground (COG) sequence, the average heading and heading variance are calculated. Second, meteorological data is correlated: through spatiotemporal matching, the route trajectory points are associated with historical meteorological reanalysis data (such as the ERA5 dataset), extracting wind speed, wave height, and sea surface temperature data for each trajectory point at the corresponding location and time, and then calculating the average wind speed, maximum wind speed, average wave height, maximum wave height, and average sea surface temperature for the entire route. Third, risk exposure characteristics are calculated: high-risk area layers (such as typhoon-prone areas, pirate activity areas, and shallow water areas) are loaded from the electronic nautical chart, and the ratio of the total distance the route trajectory traverses these areas to the total length of the route (i.e., the exposure ratio), as well as the total traversal time, are calculated. Finally, the stability characteristics of the flight path are calculated: based on the turning points of the trajectory (i.e., the points where the heading changes beyond a set threshold), the turning frequency per unit distance is calculated; simultaneously, based on the curvature sequence of the trajectory, the average curvature or curvature variance of the entire flight path is calculated as a stability index. All extracted feature values are organized into a structured feature vector, such as an array containing 15 dimensions, as a structured representation of the flight path.
[0081] S30: Based on preset semantic templates and feature mapping rules, the route-level structured feature representation is transformed into a unified route semantic text representation.
[0082] In this embodiment, the semantic text representation of flight routes is the process of converting numerical, structured features into natural language descriptions that are readable by humans or machines. It serves as a bridge connecting underlying data with high-level semantic understanding. Through preset templates and rules, the generated semantic descriptions are ensured to be consistent, structured, and complete in information, providing standardized text input for subsequent vectorized encoding.
[0083] Specifically, firstly, a semantic description template library covering all dimensions of the route is constructed. For example, for navigation motion characteristics, the template might be: "The average speed of this route is [average speed] knots, with speed fluctuations of [large / medium / small] (based on standard deviation), the overall heading is [average heading] degrees, and the heading remains [stable / moderate / unstable] (based on variance)." For meteorological environment characteristics, the template might be: "The average wind speed [mean wind speed] meters per second in the sea area traversed by the route, the maximum wind speed [maximum wind speed] meters per second; the average wave height [mean wave height] meters, the maximum wave height [maximum wave height] meters; the average sea temperature [mean sea temperature] degrees Celsius." Secondly, mapping rules are established from feature values to semantic labels or descriptive fragments. For example, the standard deviation of speed is mapped to "large fluctuation" (if > 2 knots), "medium fluctuation," and "small fluctuation"; the exposure ratio to extreme weather is mapped to "frequent encounters with severe sea conditions" (if > 10%), "occasional encounters with severe sea conditions," and "generally good sea conditions." Then, for a given route, each value in its structured feature vector is filled into the corresponding semantic template according to the mapping rules, generating multi-dimensional semantic fragments. Finally, these fragments are combined in the logical order of "navigation overview - meteorological environment - risk assessment - route characteristics," and origin and destination port information is added to form a complete, structured semantic text description of the route. For example: "The route from Shanghai to Los Angeles has an average speed of 15 knots, with minimal speed fluctuations and a stable course. The average wind speed in the sea areas traversed is 8 m / s, with a maximum wind speed of 20 m / s; the average wave height is 2 meters, with a maximum wave height of 5 meters; the average sea temperature is 18 degrees Celsius. 5% of the route is exposed to extreme weather, and the total time spent traversing high-risk areas is 12 hours. The route has a low turning frequency and a gentle overall curvature, classifying it as a stable route."
[0084] S40: Input the semantic text representation of the flight route into a preset embedding model for encoding, generate the corresponding semantic vector representation of the flight route, and perform standardization processing and storage.
[0085] In this embodiment, the semantic vector representation of flight routes is the process of transforming unstructured natural language text into dense numerical vectors that are easy for computers to process and compute. Embedding models (such as BERT, Sentence-BERT, and other pre-trained language models) can capture the deep semantic information of the text. Standardization (such as L2 normalization) ensures that the vectors are on the same scale, facilitating subsequent similarity calculations. Storage and indexing are designed to support efficient similarity retrieval.
[0086] Specifically, first, a pre-trained text embedding model is selected and loaded. This model can encode variable-length text into a 384-dimensional fixed-length vector. The standardized route semantic text generated by S34 is used as input to this model. The model segments and encodes the text, outputting a 384-dimensional floating-point vector, which is the semantic vector representation of the route. Next, L2 normalization is performed on this vector, that is, the Euclidean norm (L2 norm) of the vector is calculated, and then each element in the vector is divided by the norm, so that the normalized vector has a magnitude of 1. Finally, the normalized semantic vector is associated with the route's unique identifier, origin and destination ports, and other metadata, and stored in a dedicated vector database, or a vector index based on the Approximate Nearest Neighbor (ANN) algorithm (such as HNSW or IVF index) is constructed to support subsequent large-scale, low-latency similarity retrieval.
[0087] S50: Receive user query request, respond to the user query request, convert it into query semantic text and generate query vector, calculate the similarity between the query vector and the stored route semantic vector, and output a candidate route set based on the similarity matching result.
[0088] In this embodiment, route semantic retrieval is the core application function of the system. It aims to quickly find the semantically most matching route from a massive database of historical routes based on the user's high-level semantic needs (such as "find a safe and stable route from port A to port B"). The key lies in transforming the user query into points in the same semantic vector space and performing matching through vector similarity calculation.
[0089] Specifically, the system receives query requests submitted by users through the front-end interface or API. The request must include at least the origin and destination ports, and may include navigation objectives (such as "safety," "shortest time," and "avoiding severe sea conditions") and vessel attributes (such as ship type and draft). First, query semantic parsing: the navigation objective is parsed into high-level semantic requirement keywords, for example, "safety" corresponds to the "safe route" tag, and "shortest time" may correspond to the "efficient route" tag. Then, query semantic text construction: combining the origin and destination ports, the parsed high-level semantic requirement keywords, and vessel attributes (such as "large container ship"), a query semantic text is constructed according to a template similar to S31. For example: "Looking for routes from Shanghai to Los Angeles, suitable for large container ships, requiring a safe and stable route, avoiding high-risk areas as much as possible." Next, query vector generation: using the same embedding model as S41, the constructed query semantic text is encoded into a query vector, and subjected to the same L2 normalization processing as S42. Finally, similarity matching and ranking: in the vector database, the cosine similarity (i.e., vector dot product) between the normalized query vector and all normalized route semantic vectors in the database is calculated. All routes are sorted in descending order based on similarity scores, and the top K routes with the highest scores (e.g., K=10) are selected as an initial candidate set, along with their similarity scores, route identifiers, and other basic information, and returned to the user.
[0090] In this embodiment, a structured route data set was constructed by acquiring historical flight tracks and vessel attribute data and grouping them by origin and destination ports. This provides a unified and standardized data foundation for subsequent analysis, solving the problems of messy raw AIS data and difficulty in effectively aggregating data from single voyages. Furthermore, multi-dimensional feature extraction was performed on each route, comprehensively characterizing its features from multiple perspectives such as navigation motion, meteorological environment, risk exposure, and stability. This resulted in a structured feature representation that comprehensively reflects the inherent attributes of the route, overcoming the limitations of traditional methods that only consider a single dimension (such as distance or time). Based on preset semantic templates and feature mapping rules, the numerical structured features were transformed into a unified semantic text representation of the route, bridging the gap between machine data and human-understandable semantics, laying the foundation for deep semantic understanding. Subsequently, the semantic text was encoded into semantic vectors through an embedding model and stored in a standardized manner, enabling efficient calculation and comparison of complex route semantic information in the form of dense vectors. Finally, by transforming user queries into query vectors and performing similarity matching, intelligent route retrieval based on high-level semantic intent (such as "safety" and "efficiency") was achieved, rather than simple keyword or numerical matching. This enables more accurate fulfillment of users' diverse route planning needs and significantly improves the relevance and practicality of route recommendations.
[0091] In one embodiment, such as Figure 2As shown, in step S20, multimodal behavior data of the user on multiple platforms is collected. This multimodal behavior data includes text interaction data, image browsing data, audio interaction data, and video viewing data, specifically including:
[0092] S21: Based on track data, calculate the average speed, maximum speed, speed standard deviation, average heading, and heading variance of the route.
[0093] In this embodiment, the navigation motion characteristics aim to quantify the macroscopic motion state of the ship along the entire route. The average speed and heading reflect the overall trend, while the standard deviation and variance reflect the volatility or consistency of the motion, which is crucial for assessing the predictability and efficiency of the route.
[0094] Specifically, for a flight route, the ground speed sequence of all AIS track points is first extracted. The average speed is the arithmetic mean of this sequence. The maximum speed is the maximum value in the sequence. The speed standard deviation is calculated to measure the degree of speed fluctuation throughout the flight. Similarly, the ground heading sequence of all track points is extracted. Since heading is an angle value, a cyclic statistical method is used to calculate the average heading, for example, by converting each heading angle into a unit vector and then calculating the average direction. The heading variance is used to quantify the dispersion of heading changes, and is also calculated using a cyclic statistical method.
[0095] S22: Based on associated meteorological data, calculate the average wind speed, maximum wind speed, average wave height, maximum wave height, and average sea surface temperature of the area traversed by the route.
[0096] In this embodiment, meteorological environmental characteristics are used to assess the sea conditions experienced by the route, which directly affect the ship's navigation safety, fuel consumption, and comfort. Wind speed and wave height are key indicators for measuring the severity of sea conditions, while sea temperature may be related to certain ocean phenomena (such as warm currents and cold water masses).
[0097] Specifically, high spatiotemporal resolution historical meteorological grid data (such as the ECMWF ERA5 dataset, which provides hourly, 0.25°×0.25° grid data for wind speed, wave height, and sea surface temperature) is acquired. For each AIS track point on the route, based on its latitude, longitude, and timestamp, the corresponding wind speed (10-meter high wind speed, unit: m / s), significant wave height (wave height, unit: m), and sea surface temperature (unit: degrees Celsius) are extracted from the meteorological grid data using bilinear interpolation. Then, the meteorological parameter sequences extracted from all track points along the entire route are calculated: the mean wind speed and mean wave height are the arithmetic mean of their respective sequences; the maximum wind speed and maximum wave height are the maximum values of their respective sequences; and the mean sea surface temperature is the arithmetic mean of the sea surface temperature sequences. This process generates five key numerical features describing the overall meteorological environment of the route.
[0098] S23: Identify extreme weather segments and high-risk areas in the flight route, and calculate the extreme weather exposure ratio and the passage time through high-risk areas.
[0099] In this embodiment, risk exposure characteristics aim to quantify the degree of external threats faced by a shipping route. Extreme weather segments refer to continuous track segments encountering safety thresholds (e.g., wind speed > 15 m / s, wave height > 4 m); high-risk areas refer to fixed risk areas marked on electronic charts, such as shoals, military exercise areas, and reported pirate activity areas. Exposure ratio and transit time are important indicators for measuring the severity of risk.
[0100] Specifically, extreme weather segments are identified as follows: Based on the wind speed and wave height data of each trajectory point obtained in S22, thresholds are set (e.g., wind speed threshold of 15 m / s, wave height threshold of 4 m). Trajectory points that continuously meet any threshold condition are marked as an extreme weather segment. The total length of all extreme weather segments is calculated (by summing the distances between trajectory points) and divided by the total length of the flight route to obtain the extreme weather exposure ratio. High-risk areas are identified by loading a GIS layer containing polygonal boundaries for high-risk areas. For each trajectory point on the flight route, a spatial point-in-polygon algorithm is used to determine whether it falls within any high-risk area. Trajectory points that continuously fall within the same high-risk area are marked as a crossing segment. The total duration of all crossing segments is calculated (by summing the time differences between trajectory points) to obtain the total passage time through high-risk areas. These two feature values together constitute the risk profile of the flight route.
[0101] S24: Based on the turning points of the trajectory, calculate the turning frequency per unit distance, and calculate the overall stability index of the route based on the trajectory curvature.
[0102] In this embodiment, the route stability characteristics reflect the "bending" and smoothness of the route, and are related to navigation efficiency, fuel economy, and crew comfort. A high turning frequency means the route is curved and may require frequent steering; a large curvature indicates that the route has sharp turns.
[0103] Specifically, the turning frequency is calculated as follows: First, turning points are detected based on the heading sequence. A heading change threshold is set (e.g., 10 degrees). The heading sequence is traversed, and if the absolute value of the heading difference between two adjacent trajectory points exceeds this threshold, the latter point is marked as a turning point. The total number of turning points along the entire route is counted. The total route distance can be obtained by summing the great circle distances between adjacent trajectory points. The turning frequency per unit distance is the total number of turning points divided by the total route distance (unit: times / nautical mile). The trajectory curvature is calculated: For a trajectory line composed of latitude and longitude coordinates, the instantaneous curvature at each trajectory point can be calculated using geometric methods (approximately the reciprocal of the radius of curvature of the arc formed by three adjacent points). The overall stability index of the route can be defined as the average or standard deviation of the curvature of all points along the entire route. A simpler alternative index is a statistic of the rate of change of heading (such as the standard deviation of heading change).
[0104] In one embodiment, such as Figure 3 As shown, in step S30, based on the preset semantic template and feature mapping rules, the route-level structured feature representation is transformed into a unified route semantic text representation, specifically including:
[0105] S31: Construct multiple semantic description templates to describe basic route information, navigation status, meteorological environment, risk characteristics, and stability.
[0106] In this embodiment, the semantic description template is a predefined text framework with placeholders, used to transform numerical features into standard natural language sentences. The template design needs to cover all feature dimensions mentioned in the claims and ensure the fluency and professionalism of the generated sentences.
[0107] Specifically, the template might be: "The average speed of this route is [average speed] knots, with speed fluctuations of [large / medium / small] (based on standard deviation); the overall heading is [average heading] degrees, and the heading remains [stable / moderate / unstable] (based on variance)." Regarding meteorological characteristics, the template might be: "The average wind speed in the sea areas traversed by the route is [mean wind speed] meters per second, with a maximum wind speed of [maximum wind speed] meters per second; the average wave height is [mean wave height] meters, with a maximum wave height of [maximum wave height] meters; the average sea surface temperature is [mean sea surface temperature] degrees Celsius." Placeholders in the template will be replaced by specific feature values or mapped semantic labels in subsequent steps.
[0108] S32: Establish mapping rules from numerical ranges to semantic labels, and conversion rules from continuous variables to descriptive statements.
[0109] In this embodiment, the mapping rule is key to discretizing continuous, numerical features into a finite number of semantically meaningful labels or descriptive phrases. This ensures consistency in the semantic descriptions generated for similar numerical features across different routes and computation batches.
[0110] Specifically, mapping rules are typically implemented using lookup tables or piecewise functions. For example, for the standard deviation of speed (σ_v): if σ_v < 1 knot, it is mapped to "small fluctuation"; if 1 knot ≤ σ_v < 3 knots, it is mapped to "moderate fluctuation"; if σ_v ≥ 3 knots, it is mapped to "large fluctuation". For extreme weather exposure ratios, if the extreme weather exposure ratio < 2%, it is mapped to "almost never encountered"; if 2% ≤ extreme weather exposure ratio < 10%, it is mapped to "occasionally encountered"; if the extreme weather exposure ratio ≥ 10%, it is mapped to "frequently encountered". For continuous variables to descriptive statements, such as average speed, a description can be generated: "Sailing at approximately [average speed] knots". For maximum wind speed, a description can be generated: "The maximum [maximum wind speed] m / s wind speed encountered". These rules can be formulated based on domain knowledge (such as navigation experience), historical data distribution, or industry standards, and stored as configuration files for easy maintenance and adjustment.
[0111] S33: Based on the semantic template and mapping rules, generate global semantics describing the overall characteristics of the route, local semantics describing the characteristics of the route segments, and event semantics describing key events.
[0112] In this embodiment, multi-granularity semantic generation aims to provide route descriptions at different levels. Global semantics summarizes the overall attributes of the route; local semantics refines to the segment level, revealing the heterogeneity within the route; event semantics focuses on specific high-risk or abnormal segments, providing key details. This hierarchical description can portray the route more comprehensively and meticulously.
[0113] Specifically, the process involves several steps: First, generating global semantics: Using the template in S31 and the rules in S32, all feature values of the entire route (such as average speed, average wind speed, etc.) are mapped and filled to generate a summary text. Second, generating local semantics: The entire route is first divided into multiple segments by fixed distances (e.g., every 100 nautical miles) or fixed time intervals. For each segment, its local features (such as average wind speed, maximum wave height, etc.) are calculated independently, and then the same template and rules are used to generate semantic text describing that segment. Third, generating event semantics: Based on the extreme weather segments or high-risk area crossing segments identified in S23, for each independent event, features such as duration, maximum intensity (e.g., maximum wind speed within the segment), and spatial range are extracted, and an event description such as "Within [time range], the route crossed [high-risk area name] for [duration], during which the maximum wind speed reached [maximum wind speed] meters per second" is generated. Ultimately, the complete semantic text of a route consists of a global semantic overview, sequentially arranged local semantics of each segment, and event semantics inserted in chronological order.
[0114] S34: Combine and standardize the global semantics, local semantics and event semantics to form a structured route semantic text, and introduce high-level semantic tags into it.
[0115] In this embodiment, the combination and standardization of semantic text aims to integrate multi-source, multi-granular semantic fragments into a coherent, non-redundant, and uniformly formatted text description, and to assign it a general high-level label to facilitate subsequent understanding and retrieval by the vectorization model.
[0116] Specifically, the global semantics are output as an overview. Then, the local semantics of each flight segment are inserted sequentially according to the flight segment order, with paragraphs connected by conjunctions (such as "subsequently," "next") or sequence numbers. Next, an event semantic description is inserted at the corresponding location where the event occurs (based on the timestamp).
[0117] In one embodiment, such as Figure 4 As shown, in step S33, based on the semantic template and mapping rules, global semantics describing the overall characteristics of the route, local semantics describing the characteristics of route segments, and event semantics describing key events are generated, specifically including:
[0118] S331: Map the route-level structured features to generate global semantics that summarize the entire route's navigation status, average environmental conditions, and overall risk level.
[0119] In this embodiment, generating global semantics aims to provide a highly generalized description of the core features of a route, offering users or subsequent processing a clear and comprehensive overview of the route. It does not involve segment details or specific events, but rather focuses on the average performance and overall attributes of the entire route, serving as a top-level summary of the route's semantic text.
[0120] Specifically, the mapping rules from numerical intervals to semantic labels established in step S32, as well as the conversion rules from continuous variables to descriptive statements, are invoked. First, for the route-level structured feature vector extracted in step S20, dimensions for global description are selected, typically including: average speed, speed standard deviation, average heading, heading variance, mean wind speed, mean wave height, mean sea temperature, extreme weather exposure ratio, total time to pass through high-risk areas, turning frequency per unit distance, and overall route stability index. Then, these numerical features are input into the mapping rules one by one. For example, if the average speed is 15 knots, "average speed 15 knots" is directly generated; if the speed standard deviation is 1.2 knots, "small speed fluctuation" is generated according to the rule (e.g., σ_v < 1.5 knots is mapped to "small fluctuation"); if the extreme weather exposure ratio is 8%, "route encounters severe sea conditions" is generated according to the rule (e.g., 2% ≤ extreme weather exposure ratio < 10% is mapped to "occasional severe sea conditions"). Finally, the generated semantic fragments are filled and combined according to the preset global semantic template (e.g., "This route runs from [port of departure] to [port of destination], overall [navigation status summary], [meteorological environment summary] of the sea areas traversed, [risk assessment summary], belonging to the [stability summary] route."). For example, the final generated global semantics might be: "This route runs from Shanghai to Los Angeles, with generally stable speed and course, passing through sea areas with moderate winds and waves and suitable sea temperatures, occasionally encountering severe sea conditions and briefly passing through high-risk areas, belonging to a relatively stable route."
[0121] S332: Divide the route into multiple segments, map the local features extracted from each segment, and generate segmented semantics that describe the specific navigation conditions and risks of each segment.
[0122] In this embodiment, segmented semantics are generated to reveal the differences between different segments within a shipping route, providing a more refined local insight than global semantics. Since a long shipping route may cross different climate zones or sea state areas, segmented descriptions can more accurately reflect changes in conditions during navigation, providing a basis for waypoint selection or adjustments to navigation strategies.
[0123] Specifically, the route is first segmented. This can be done using a fixed-distance segmentation method (e.g., every 100 nautical miles per segment) or a fixed-time segmentation method (e.g., every 12 hours of sailing per segment). Based on the timestamps and locations of the original AIS track points, the sequence of track points is divided into corresponding segments. For each segment, its local features are calculated independently, including: the segment's average speed, maximum wind speed, average wave height, whether it crosses a high-risk area, and the number of turning points within the segment. The calculation method for these features is similar to that in step S20, but the data range is limited to the current segment. Then, using the same mapping rules as in S331, the local feature values of each segment are converted into semantic descriptions. For example, for a certain segment, if its average wind speed is calculated to be 12 meters per second, it is mapped to "strong winds" according to the rules; if the segment is identified as crossing the "outer typhoon influence zone," then the semantic meaning of "crossing the outer typhoon influence zone" is generated. Finally, a separate semantic description is generated for each segment, usually numbered sequentially and following a template such as "Segment [N] (from [start point] to [end point]): [Specific semantic description of this segment]." For example: "Segment 1 (departure to 125 degrees East longitude): High speed, encountering strong crosswinds, large waves, smooth navigation."
[0124] S333: Identify extreme weather or high-risk critical events in flight routes, extract event duration and intensity features, and generate event semantics for the event.
[0125] In this embodiment, the generated event semantics aims to focus on specific, discrete anomalies or high-risk situations occurring along the route that have a significant impact on navigation safety or efficiency. Unlike segmented semantics, which describes the overall condition of a route segment, event semantics specifically describes concrete events such as "encountering a typhoon," "passing through a narrow waterway," or "equipment failure causing a sudden drop in speed," providing key risk points and decision-making information.
[0126] Specifically, event identification is based on the detection results of extreme weather segments and high-risk area crossing segments completed in step S23. Each identified continuous segment or crossing segment is considered an independent event. For each event, its specific features are extracted: 1) Event type: such as "extreme weather (strong winds)", "extreme weather (large waves)", "high-risk area (shoals)", "high-risk area (pirate reporting area)". 2) Spatial range: the start and end locations (latitude and longitude) of the event. 3) Temporal attributes: the start time, end time, and total duration of the event. 4) Intensity features: for extreme weather events, the maximum wind speed or maximum wave height during the event is extracted; for high-risk area events, the regional risk level can be labeled. Then, based on the event type and extracted features, a specialized event semantic template is invoked. For example, for extreme weather events, the template might be: "Within [time range], [event type] occurred near [location range], lasting [duration], during which the maximum wind speed reached [maximum wind speed] m / s (or the maximum wave height reached [maximum wave height] m)." Filling specific feature values into the template generates an event semantic description such as: "From 08:00 to 14:00 on July 10, 2023, a strong wind process occurred in the sea area near 30 degrees North latitude and 130 degrees East longitude, lasting 6 hours, during which the maximum wind speed reached 25 m / s."
[0127] S334: Establish the logical connections between the global semantics, segmented semantics, and event semantics, and integrate them into a coherent, multi-layered route semantic text.
[0128] In this embodiment, integrating multi-granular semantics involves organically combining the generated global, segmented, and event semantics into a complete, fluent, and logically clear text description. This is not a simple splicing, but rather requires establishing connections based on spatiotemporal logic to ensure that the final text reads as a coherent narrative of a flight path, rather than a collection of fragmented information.
[0129] Specifically, the structure and order of integration are determined. A "general-specific-event interlude" structure is typically adopted: it begins with a global semantic overview. Then, the segmented semantics of each segment are presented sequentially, either chronologically or spatially. During the presentation of segmented semantics, if an event occurs within the currently described segment, the corresponding event semantic description is immediately inserted after the segment's semantic description, using conjunctions such as "among which," "notably," and "during this period" to indicate that the event is a specific occurrence within that segment. For example, when describing "Segment Two," if a strong wind event occurred within that segment, it would be described as: "Segment Two (125°E to 135°E): Speed decreased, sea conditions worsened. A strong wind event occurred in the middle of the segment, lasting 6 hours, with a maximum wind speed of 25 m / s." If an event spans multiple segments, the event semantics can be inserted after the description of the first relevant segment, explaining its scope of impact. Finally, all semantic segments are thoroughly reviewed and fine-tuned to ensure correct temporal and spatial logic, fluent sentences, and to avoid information duplication or contradictions. The final output is a complete semantic text of the flight route that is clearly structured and includes an overall overview, segment details, and descriptions of key events.
[0130] In one embodiment, such as Figure 5 As shown, in step S34, the global semantics, local semantics, and event semantics are combined and standardized to form structured route semantic text, and high-level semantic tags are introduced into it, specifically including:
[0131] S341: Standardize the sentence structure and terminology of the generated semantic description statements, eliminate redundant expressions, check whether there are contradictions among the standardized semantic description statements, and make logical corrections.
[0132] In this embodiment, standardization and consistency verification are key post-processing steps to improve the quality of generated text and ensure its accuracy and reliability. Their purpose is to eliminate inconsistencies in expression, information redundancy, or logical conflicts that may arise from template combinations or mapping rules, resulting in a final text that is standardized, concise, and self-consistent.
[0133] Specifically, standardization processes include: 1) Terminology unification: Scan all semantic segments to ensure that the same concept uses the same terminology. For example, unify "wind speed" and "wind force" as "wind speed"; unify "wave height" and "wave height" as "wave height". 2) Sentence structure optimization: Check and adjust overly repetitive or awkward sentence structures. For example, if multiple segment descriptions all begin with "This segment...", they can be appropriately adjusted to "This segment...", "This segment...", or combined into one description. 3) Redundancy elimination: Delete information that is repeatedly expressed. For example, if the global semantics already mentions "average speed of 15 knots", and a segment's semantics also mentions "speed of approximately 15 knots" without any other special explanation, then that sentence in the segment can be deleted; or the same conclusion implied in multiple features can be combined (e.g., "small speed fluctuations" and "stable heading" may both point to "smooth sailing", and can be combined as appropriate). Consistency checks and logical corrections are implemented through rules or simple reasoning: checking for contradictions in numerical descriptions (e.g., the global semantics says "sea conditions are good," but a segment's semantics says "wave height is very high"); and checking spatiotemporal logic (e.g., whether the event's time falls within the route's time frame, or whether the event's location falls within the route's spatial frame). When contradictions are found, the system flags and prioritizes the conclusions from more specific and direct data sources (e.g., segment semantics or event semantics), or triggers a manual review process. The final output is standardized semantic text that has been cleaned, optimized, and logically verified.
[0134] S342: Based on the analysis results of route features, automatically label one or more high-level semantic tags for semantic text.
[0135] In this embodiment, high-level semantic tags are a highly generalized classification of the overall attributes of flight routes, facilitating rapid identification and retrieval. Based on a comprehensive analysis of the structured features of flight routes, they reduce complex, multi-dimensional features to several easily understood categories, such as "safe," "efficient," "economical," and "stable."
[0136] Specifically, based on the route-level structured features extracted in step S20 and the semantic information generated in steps S331-S334, a set of predefined labeling rules are used to automatically determine and label routes. These rules are typically based on feature thresholds: for example, a safe route label is triggered when the "extreme weather exposure ratio" is below threshold A and the "high-risk area transit time" is below threshold B. An efficient route label is triggered when the "average airspeed" is above threshold C and the "turning frequency per unit distance" is below threshold D. A stable route label is triggered when the "airspeed standard deviation" is below threshold E, the "heading variance" is below threshold F, and the "overall route stability index" is better than threshold G. An economical route label may be determined by combining factors such as "average airspeed" (moderate, not maximum to save fuel) and "total distance." A route may simultaneously meet the conditions of multiple labels. The labels are injected into the final semantic text in a specific format, usually placed prominently at the beginning or end of the text, for example, in the form of "[Label: Safe Route, Stable Route]" or "## Safe, Stable Route##". These tags provide enhanced high-level semantic signals for subsequent semantic vector encoding, and also make it easier for users to quickly filter search results.
[0137] S343: Outputs the final route semantic text that has been standardized, validated for consistency, and injected with high-level semantic tags for vectorization.
[0138] In this embodiment, this step is the final output stage of the semantic text construction process. Its product is standardized text that has undergone full-process processing, has controllable quality, is rich in information, and contains high-level generalizations. This text will be used as the direct input to the embedding model in step S40 and will be converted into a semantic vector.
[0139] Specifically, the coherent semantic text, standardized and logically corrected by S341, is synthesized with the high-level semantic tags generated by S342. The synthesis method can be to insert the tags as part of the text (e.g., at the beginning) or to associate them with the text as independent metadata fields. The final output text is a complete string, typically structured as follows: "[High-level semantic tags] [Global semantic overview]. Following this, [Semantic description of the first segment]. Within this, [Semantic description of relevant events within the first segment]. Next, [Semantic description of the second segment]... (subsequent segments and events). Overall, [Possible summary statements]." For example: "[Safe and stable] This route runs from Shanghai to Los Angeles, with generally stable speed and course, and moderate sea conditions. First segment (departure to 125°E): Relatively high speed, encountering strong crosswinds. A short period of strong winds occurred at the end of the segment, with a maximum wind speed of 18 m / s. Second segment (125°E to 135°E): Sea conditions improved, navigation was smooth..." The final text is then passed to the semantic vector construction module in step S40, awaiting encoding. Simultaneously, this text can also be stored in a database for direct viewing or subsequent analysis.
[0140] In one embodiment, such as Figure 6 As shown, in step S40, the semantic text representation of the flight route is input into a preset embedding model for encoding, generating a corresponding semantic vector representation of the flight route, and then standardized and stored. Specifically, this includes:
[0141] S41: The semantic temperature change of the route is used as the input text sequence of the embedding model. The embedding model is used to encode the input semantic text sequence to generate a dense vector of fixed dimension, which serves as the semantic vector representation of the route.
[0142] In this embodiment, this step is the core operation of vectorization. The embedding model, through its deep neural network structure, encodes and aggregates the contextual information of each word in the text sequence and the relationships between words, ultimately outputting a dense vector that comprehensively represents the semantics of the entire text. The fixed dimension ensures the comparability of all route vectors.
[0143] Specifically, firstly, the input route semantic text is preprocessed, including removing redundant spaces and standardizing the encoding format. Then, the model's corresponding tokenizer converts the text into an input ID sequence acceptable to the model, adding special [CLS] and [SEP] tags. Next, the ID sequence is input into a pre-trained embedding model. After computation by a multi-layer Transformer encoder, the model typically uses the last hidden state corresponding to the [CLS] tag as the representation of the entire sentence, or uses the average pooling of the last hidden states of all tags as the sentence vector. Finally, the model outputs a fixed-dimensional (e.g., 384-dimensional) floating-point vector. This vector captures comprehensive semantic information about the route in terms of navigation status, weather, risk, stability, and other aspects.
[0144] S42: Normalize the generated route semantic vectors to make all vectors the same scale, associate the normalized route semantic vectors with the corresponding route unique identifiers, and store them in the vector database or build a vector index.
[0145] In this embodiment, normalization is a crucial preprocessing step before similarity retrieval. It eliminates the influence of vector magnitude on similarity calculation (such as cosine similarity), ensuring that similarity is determined solely by the angle between vectors, which better aligns with semantic similarity comparisons. Storage and indexing are then implemented to enable rapid retrieval from massive amounts of flight route data.
[0146] Specifically, for the generated semantic vector v = (v1, v2, ..., vn), its L2 norm is calculated: ||v||2 = sqrt(v1² + v2² + ... + vn²). Then, each component of the original vector is divided by this norm to obtain the normalized vector v' = v / ||v||2. After this operation, the magnitude of all vectors is 1. Next, a data record is constructed, containing the following fields: a unique route identifier (e.g., "SHG-LAX-2023-001"), origin and destination port codes, the original semantic text, and the normalized semantic vector. This record is inserted into the vector database; for L2-normalized vectors, the cosine similarity is equal to the inner product. After data insertion, the database automatically maintains a vector index to support efficient approximate nearest neighbor search. At this point, the route semantic vector library is complete.
[0147] In one embodiment, such as Figure 7 As shown, in step S50, i.e., receiving a user query request, responding to the user query request, converting it into query semantic text and generating a query vector, calculating the similarity between the query vector and the stored route semantic vector, and outputting a candidate route set based on the similarity matching result, specifically including:
[0148] S51: Receive user queries containing origin and destination ports, navigation destination and vessel attributes, and parse the navigation destination into high-level semantic requirements.
[0149] In this embodiment, this step is crucial for understanding the user's search intent. The navigation target is usually an abstract need expressed by the user in natural language, which needs to be parsed into high-level semantic tags or feature constraints that the system can understand and process in order to construct accurate query semantic text.
[0150] Specifically, a query interface is provided where users can input origin and destination ports (e.g., "Shanghai" or "Los Angeles"), enter "I want to find a safe and fuel-efficient route" in the navigation target text box, and select vessel attributes (e.g., "ship type: container ship," "draft: 12 meters") from the drop-down menu. The system internally maintains a mapping dictionary of "navigation target keywords - high-level semantic tags." For example, "safe" maps to the tag "safe route"; "fuel-efficient" might map to the tag "economical route" or be associated with features such as "stable speed" or "few turns." Natural Language Processing (NLP) techniques, such as keyword matching or simple intent recognition models, are used to parse the user-input navigation target text, extract keywords, and map them to corresponding sets of high-level semantic tags. Simultaneously, vessel attributes are directly converted into structured constraints. The parsing results are encapsulated into a structured query object.
[0151] S52: Based on the parsed high-level semantic requirements, combined with the constraints of the origin and destination ports and ship attributes, construct the query semantic text, and use the embedding model to generate the query vector.
[0152] In this embodiment, the query semantic text is a standardized, structured textual expression of the user's search intent. It needs to maintain stylistic consistency with the generated format of the flight route semantic text to ensure meaningful comparisons between the two within the same semantic space. The query vector is the numerical representation of this text in a vector space.
[0153] Specifically, based on the structured query object parsed from S51, a "query semantic template" similar to that in S31 is used to construct the text. The query template might be designed as: "Find a route from [origin port] to [destination port], suitable for [ship type], draft [draft] meters. Navigation target requirements: [high-level semantic requirement description]." Specific values are filled into the template, for example: "Find a route from Shanghai to Los Angeles, suitable for large container ships, draft 12 meters. Navigation target requirements: safe route, good fuel economy." To enhance retrieval performance, high-level semantic tags can be directly added to the text in a prominent manner, such as: "[Requirements: Safety, Economy] Find a route from Shanghai to Los Angeles, suitable for large container ships, draft 12 meters." Then, the constructed query semantic text is input into the same pre-trained embedding model as in S41, undergoing the same encoding process to generate a fixed-dimensional query vector. Finally, the query vector is subjected to the same L2 normalization process as in S42 to obtain a normalized query vector that can be used for similarity calculation.
[0154] S53: Calculate the cosine similarity between the query vector and all route semantic vectors in the vector database, sort all routes in descending order according to the cosine similarity score, and obtain a list of matched routes.
[0155] In this embodiment, cosine similarity is an indicator that measures the degree of similarity between two vectors in terms of direction. Its value range is [-1, 1]. The closer the value is to 1, the more consistent the directions of the two vectors are, and the more semantically similar they are. Since all vectors have been L2 normalized, cosine similarity is simplified to the dot product of the vectors. By calculating the dot product of the query vector and each route vector in the database and sorting them, the route with the most similar semantics can be found quickly.
[0156] Specifically, the similarity search interface of the vector database is invoked to construct a search request, specifying: 1) the normalized query vector to be searched; 2) the distance metric type as COSINE (cosine similarity) or IP (inner product, equivalent to cosine similarity for normalized vectors); 3) the upper limit K of the number of results to be returned (e.g., 10); and 4) optional filtering conditions, such as only retrieving routes whose origin and destination ports match the query (this is usually implemented at the database level through scalar filtering). The vector database uses its pre-built Approximate Nearest Neighbor (ANN) index (e.g., HNSW) to efficiently calculate the distance between the query vector and vectors in the database (here, cosine distance or negative inner product), and returns the K vectors with the smallest distances, along with their corresponding route IDs and distance values. Since cosine similarity is used, the returned distance values usually need to be converted to similarity scores (e.g., cosine distance d_cos = 1 - similarity). The system sorts the returned route IDs and similarity scores (usually 1 - d_cos) in descending order to generate a preliminary list of matching routes. The routes in this list are those whose semantic descriptions are closest to the user's query intent in the vector space.
[0157] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0158] In one embodiment, a semantic vector construction and retrieval system for maritime route data is provided, which corresponds one-to-one with the semantic vector construction and retrieval methods for maritime route data described in the above embodiments. For example... Figure 8 As shown, this semantic vector construction and retrieval system for maritime route data includes a route data construction module, a multi-dimensional feature extraction module, a route semantic encoding module, a route semantic vector construction module, and a route semantic retrieval module. Detailed descriptions of each functional module are as follows:
[0159] The route data construction module is used to acquire historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set;
[0160] The multidimensional feature extraction module is used to extract multidimensional features from each route in the route data set to form a route-level structured feature representation. The multidimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features.
[0161] The route semantic encoding module is used to transform the route-level structured feature representation into a unified route semantic text representation based on a preset semantic template and feature mapping rules.
[0162] The route semantic vector construction module is used to input the route semantic text representation into a preset embedding model for encoding, generate the corresponding route semantic vector representation, and perform standardization processing and storage.
[0163] The route semantic retrieval module is used to receive user query requests, respond to the user query requests, convert them into query semantic text and generate query vectors, calculate the similarity between the query vectors and the stored route semantic vectors, and output a candidate route set based on the similarity matching results.
[0164] Specific limitations regarding the semantic vector construction and retrieval system for maritime route data can be found in the above section on the limitations of the semantic vector construction and retrieval method for maritime route data, and will not be repeated here. Each module in the aforementioned semantic vector construction and retrieval system for maritime route data can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in an electronic device, or stored in the memory of an electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0165] In one embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, this electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores route data, embedded models, and route sets. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a semantic vector construction and retrieval method for maritime route data.
[0166] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0167] Acquire historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set;
[0168] For each route in the route data set, multi-dimensional features are extracted to form a route-level structured feature representation. The multi-dimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features.
[0169] Based on preset semantic templates and feature mapping rules, the route-level structured feature representation is transformed into a unified route semantic text representation;
[0170] The semantic text representation of the flight route is input into a preset embedding model for encoding, generating a corresponding semantic vector representation of the flight route, and then standardized and stored.
[0171] The system receives user query requests, responds to the user query requests, converts them into query semantic text and generates query vectors, calculates the similarity between the query vectors and the stored route semantic vectors, and outputs a set of candidate routes based on the similarity matching results.
[0172] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0173] Acquire historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set;
[0174] For each route in the route data set, multi-dimensional features are extracted to form a route-level structured feature representation. The multi-dimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features.
[0175] Based on preset semantic templates and feature mapping rules, the route-level structured feature representation is transformed into a unified route semantic text representation;
[0176] The semantic text representation of the flight route is input into a preset embedding model for encoding, generating a corresponding semantic vector representation of the flight route, and then standardized and stored.
[0177] The system receives user query requests, responds to the user query requests, converts them into query semantic text and generates query vectors, calculates the similarity between the query vectors and the stored route semantic vectors, and outputs a set of candidate routes based on the similarity matching results.
[0178] Those skilled in the art will understand that all or part of the processes in the methods of 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 of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0179] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0180] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A semantic vector construction and retrieval method for maritime route data, characterized in that, The semantic vector construction and retrieval method for maritime route data includes the following steps: Acquire historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set; For each route in the route data set, multi-dimensional features are extracted to form a route-level structured feature representation. The multi-dimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features. Based on preset semantic templates and feature mapping rules, the route-level structured feature representation is transformed into a unified route semantic text representation; The semantic text representation of the flight route is input into a preset embedding model for encoding, generating a corresponding semantic vector representation of the flight route, and then standardized and stored. The system receives user query requests, responds to the user query requests, converts them into query semantic text and generates query vectors, calculates the similarity between the query vectors and the stored route semantic vectors, and outputs a set of candidate routes based on the similarity matching results.
2. The semantic vector construction and retrieval method for maritime route data according to claim 1, characterized in that, The step of extracting multi-dimensional features from each route in the route data set to form a route-level structured feature representation specifically includes: Based on track data, calculate the average speed, maximum speed, speed standard deviation, average heading, and heading variance of the route. Based on the associated meteorological data, the average wind speed, maximum wind speed, average wave height, maximum wave height, and average sea surface temperature of the areas traversed by the route are calculated. Identify extreme weather segments and high-risk areas in flight routes, and calculate the extreme weather exposure ratio and the duration of passage through high-risk areas; Based on the turning points of the flight path, the turning frequency per unit distance is calculated, and the overall stability index of the flight path is calculated based on the trajectory curvature.
3. The semantic vector construction and retrieval method for maritime route data according to claim 1, characterized in that, The process of transforming the route-level structured feature representation into a unified route semantic text representation based on preset semantic templates and feature mapping rules specifically includes: Construct multiple semantic description templates to describe basic route information, navigation status, meteorological environment, risk characteristics, and stability; Establish mapping rules from numerical ranges to semantic labels, and conversion rules from continuous variables to descriptive statements; Based on the semantic template and mapping rules, global semantics describing the overall characteristics of the route, local semantics describing the characteristics of the route segments, and event semantics describing key events are generated respectively. The global semantics, local semantics, and event semantics are combined and standardized to form a structured route semantic text, and high-level semantic tags are introduced into it.
4. The semantic vector construction and retrieval method for maritime route data according to claim 3, characterized in that, Based on the semantic template and mapping rules, the following steps are taken to generate global semantics describing the overall characteristics of the route, local semantics describing the characteristics of route segments, and event semantics describing key events: Map the route-level structured features to generate global semantics that summarize the entire route's navigation status, average environmental conditions, and overall risk level. The route is divided into multiple segments, and the local features extracted from each segment are mapped to generate segmented semantics that describe the specific navigation conditions and risks of each segment. Identify extreme weather or high-risk critical events in flight routes, extract event duration and intensity features, and generate event semantics for the event; Establish logical connections between the global semantics, segmented semantics, and event semantics, and integrate them into a coherent, multi-layered route semantic text.
5. The semantic vector construction and retrieval method for maritime route data according to claim 3, characterized in that, The process of combining and standardizing the global semantics, local semantics, and event semantics to form structured route semantic text, and introducing high-level semantic tags into it, specifically includes: The generated semantic description statements are standardized in terms of sentence structure and terminology to eliminate redundancy. The contradictions between the standardized semantic description statements are checked and logically corrected. Based on the analysis results of the route characteristics, one or more high-level semantic tags are automatically assigned to the semantic text; The output is the final route semantic text, which has been standardized, validated for consistency, and injected with high-level semantic tags, for vectorization.
6. The semantic vector construction and retrieval method for maritime route data according to claim 1, characterized in that, The step of inputting the semantic text representation of the flight route into a preset embedding model for encoding, generating a corresponding semantic vector representation of the flight route, and performing standardization processing and storage specifically includes: The semantic temperature variation of the route is used as the input text sequence of the embedding model. The embedding model is used to encode the input semantic text sequence to generate a dense vector of fixed dimension, which serves as the semantic vector representation of the route. The generated route semantic vectors are normalized to ensure that all vectors are on the same scale. The normalized route semantic vectors are then associated with the corresponding route unique identifiers and stored in a vector database or a vector index is constructed.
7. The semantic vector construction and retrieval method for maritime route data according to claim 1, characterized in that, The process of receiving a user query request, responding to the user query request, converting it into query semantic text and generating a query vector, calculating the similarity between the query vector and the stored route semantic vector, and outputting a candidate route set based on the similarity matching results specifically includes: Receive user queries containing origin and destination ports, navigation destination and vessel attributes, and parse the navigation destination into high-level semantic requirements; Based on the parsed high-level semantic requirements, combined with the constraints of origin and destination ports and ship attributes, query semantic text is constructed, and query vectors are generated using an embedding model. Calculate the cosine similarity between the query vector and all route semantic vectors in the vector database, and sort all routes in descending order based on the cosine similarity score to obtain a list of matched routes.
8. A semantic vector construction and retrieval system for maritime route data, characterized in that, The semantic vector construction and retrieval system for maritime route data includes: The route data construction module is used to acquire historical track data and vessel attribute data, and group the tracks according to the origin and destination ports to form a route data set; The multidimensional feature extraction module is used to extract multidimensional features from each route in the route data set to form a route-level structured feature representation. The multidimensional features include at least navigation motion features, meteorological environment features, risk exposure features, and route stability features. The route semantic encoding module is used to transform the route-level structured feature representation into a unified route semantic text representation based on a preset semantic template and feature mapping rules. The route semantic vector construction module is used to input the route semantic text representation into a preset embedding model for encoding, generate the corresponding route semantic vector representation, and perform standardization processing and storage. The route semantic retrieval module is used to receive user query requests, respond to the user query requests, convert them into query semantic text and generate query vectors, calculate the similarity between the query vectors and the stored route semantic vectors, and output a candidate route set based on the similarity matching results.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the semantic vector construction and retrieval method for maritime route data as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the semantic vector construction and retrieval method for maritime route data as described in any one of claims 1 to 7.