A civil track analysis method and system based on hybrid vector retrieval enhancement
By adopting a hybrid vector search enhancement method and a big model question-and-answer framework in track analysis, combining geographical and semantic vector features, the problem of lack of intuitiveness and comprehensibility of the output of track analysis in the prior art is solved, and a lower operating threshold and higher explanatory and interactive nature are achieved.
Patent Information
- Application Number
- CN202411942940.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-12-27
AI Technical Summary
When explaining and analyzing complex tracks, the output lacks intuitiveness and comprehensibility, making it difficult to form smooth interaction with users, and fail to effectively combine the language generation ability and track analysis tasks of large language models.
The civil track analysis method based on hybrid vector retrieval is adopted, combined with the language processing capabilities of the big model and the efficient data retrieval mechanism, the similarity calculation is performed by building a two-vector feature library and query features, and the big model question and answer framework is used to provide detailed explanations and analysis results.
It reduces the difficulty of track analysis, enhances the interpretability of data analysis, readability and interactive friendliness of results, and improves the ability of users to understand the analysis process and its basis, thereby improving the effectiveness and transparency of decision-making.
Smart Images

Figure CN119378690B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of track analysis, and in particular to a civil track analysis method and system based on hybrid vector retrieval enhancement. Background Art
[0002] Currently, track analysis technology is widely used in the fields of maritime navigation, logistics and transportation to predict target trajectories, monitor abnormal behaviors and provide navigation assistance. Existing research mostly relies on machine learning and deep learning models, which are trained on a large amount of historical track data to establish track prediction and analysis models. These methods have good prediction capabilities when there is sufficient data. However, when interpreting and analyzing complex tracks, the output of traditional machine learning methods often lacks intuitiveness and comprehensibility, making it difficult to form smooth interactions with users.
[0003] With the development of large language models, they have shown great potential in natural language processing, text generation and summarization. However, there is still a lack of detailed discussion on how to combine the language generation capabilities of large models with the specific tasks of track analysis. In particular, there is no mature solution to combine historical data retrieval with generation models to form a clear and smooth analysis process that is easy for users to understand and make decisions by leveraging the capabilities of large models in retrieval-augmented generation (RAG). Summary of the invention
[0004] Purpose of the invention: In view of the shortcomings of the prior art, the purpose of the present invention is to provide a civil track analysis method and system based on hybrid vector retrieval enhancement, combining the powerful language processing capabilities of large models and efficient data retrieval mechanisms to perform interactive and friendly analysis and interpretation of civil track data.
[0005] Technical solution: To achieve the above-mentioned invention object, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a civil track analysis method based on hybrid vector retrieval enhancement, comprising the following steps:
[0007] Step 1: Acquire location information and description information of multiple known targets and construct a dual-vector feature library; the dual-vector feature library includes a geographic vector library and a semantic vector library; the geographic vector library stores the average speed, speed standard deviation, average acceleration, total distance and straightness of the track of the known target; the semantic vector library stores the semantic vector obtained by text embedding of the description information of the known target; the description information at least includes the identity information of the known target;
[0008] Step 2: Obtain location information and description information of the target to be analyzed, and construct a dual-vector query feature; the dual-vector query feature includes a geographic vector query feature and a semantic vector query feature;
[0009] Step 3: Calculate the similarity based on the dual-vector query feature and the dual-vector feature library to obtain the final similarity between the target to be analyzed and the known target;
[0010] Step 4: Enable the big model service, use the system prompt words to initialize the big model, and obtain the big model question-answering framework;
[0011] Step 5: Input the final similarity calculation result obtained in step 3 into the dialogue template in the large model question and answer framework obtained in step 4 to obtain the output result of the large model question and answer.
[0012] Furthermore, the target speed and acceleration are calculated based on the timestamp and longitude and latitude of the target track data, or the timestamp, longitude and latitude and altitude, and then the average speed, average acceleration and speed standard deviation of the target are calculated; the total distance is calculated based on the longitude and latitude of the target track data, or the longitude and latitude and altitude, and then the straightness is calculated in combination with the starting point and the end point.
[0013] Furthermore, the calculation result of the final similarity between the target to be analyzed and the known target includes: a preset number of target sets with the highest geographical similarity, a preset number of target sets with the highest semantic similarity, and a cross-similarity matrix constructed based on the two sets.
[0014] Furthermore, is the set of top K targets with the highest geographical similarity, is the top K target set with the highest semantic similarity. and For each target in, construct the cross-similarity matrix for:
[0015] ;
[0016] ;
[0017] ;
[0018] The superscript T indicates transposition. Indicates known target and The geographical similarity between Indicates known target and The semantic similarity between them, i∈[1,K].
[0019] Furthermore, for the target to be analyzed q and known targets d , based on geographic vectors and The geographic similarity is calculated according to the following formula:
[0020] ;
[0021] ;
[0022] in , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the target to be analyzed. , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the known target.
[0023] Furthermore, for the target to be analyzed q and known targets d , based on semantic vector and The semantic similarity is calculated according to the following formula:
[0024] ;
[0025] in Indicates the magnitude of the vector to be calculated.
[0026] In a second aspect, the present invention provides a civil track analysis system based on hybrid vector retrieval enhancement, comprising:
[0027] A feature library construction module is used to obtain location information and description information of multiple known targets and construct a dual-vector feature library; the dual-vector feature library includes a geographic vector library and a semantic vector library; the geographic vector library stores the average speed, speed standard deviation, average acceleration, total distance and straightness of the track of the known target; the semantic vector library stores the semantic vector obtained by text embedding of the description information of the known target; the description information at least includes the identity information of the known target;
[0028] A query feature construction module, used to obtain location information and description information of the target to be analyzed, and to construct a dual-vector query feature; the dual-vector query feature includes a geographic vector query feature and a semantic vector query feature;
[0029] A similarity calculation module is used to perform similarity calculation based on the dual-vector query feature and the dual-vector feature library to obtain the final similarity between the target to be analyzed and the known target;
[0030] The track analysis module is used to enable the big model service, initialize the big model using the system prompt words, and obtain the big model question and answer framework; and input the final similarity calculation result obtained by the similarity calculation module into the big model question and answer framework to obtain the output result of the big model question and answer framework.
[0031] In a third aspect, the present invention provides a computer system comprising a memory, a processor, and a computer program / instructions stored in the memory and executable on the processor, wherein the computer program / instructions, when executed by the processor, implement the steps of a civil track analysis method based on hybrid vector retrieval enhancement.
[0032] In a fourth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the civil track analysis method based on hybrid vector retrieval enhancement.
[0033] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0034] 1. The present invention provides a simple track analysis system: by combining the ability to generate large models and the ability to retrieve historical data, the present invention shows a lower operating threshold in the analysis of track data and reduces the difficulty of track analysis.
[0035] 2. The present invention enhances the interpretability of data analysis: by utilizing the natural language generation capability of the large model, a detailed explanation of the track analysis results can be provided, making it easier for users to understand the analysis process and its basis, thereby improving the effectiveness and transparency of decision-making.
[0036] 3. The present invention enhances the readability and interactive friendliness of the results: the present invention is not only suitable for large-scale data analysis, but also has better interactive friendliness by using natural language for interaction, and is suitable for promotion and application in various civil track analysis scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flow chart of a method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments.
[0039] like Figure 1 As shown, a civil track analysis method based on hybrid vector retrieval enhancement disclosed in an embodiment of the present invention includes the following steps:
[0040] Step 1: Obtain the location information and description information of multiple known targets and build a dual-vector feature library.
[0041] Specifically, assuming that there are M known targets, for each known target, the location information includes the target's timestamp t (Unit: seconds), longitude x (Unit: degrees), latitude y (Unit: degrees), height h (Unit: meter) data (in some scenarios, there may be no altitude data, such as sea navigation). The information source can be an open source data set or a measured data set. The description information includes the identity information of the target. For example, for sea navigation, the description information of the target can be ship information, including the ship name, Maritime Mobile Service Identity (MMSI, which is a nine-digit code sent by the ship's radio communication system on its radio channel that can uniquely identify various stations and group call stations) and other information that can be used to describe its identity. Assume that the target has a total of N+1 data points.
[0042] In this embodiment, the dual vector feature library specifically includes a geographic vector library and a semantic vector library. The geographic vector library stores the average speed, speed standard deviation, average acceleration, total distance and straightness of the track of the known target. The semantic vector library stores the semantic vector obtained by text embedding of the description information of the known target.
[0043] Specifically, the construction method of the geographic vector library is as follows:
[0044] For each target, calculate the target velocity vector:
[0045] ;
[0046] in, , , are the longitude, latitude and altitude at time t, , , They are t +1 longitude, latitude, and altitude at time. t The value is [0, N ].
[0047] Calculate the target velocity using the velocity vector:
[0048] ;
[0049] The target acceleration value can be approximately calculated by the target velocity:
[0050] ;
[0051] The target average speed can be calculated from the target speed:
[0052] ;
[0053] The target speed standard deviation can be calculated from the target speed and the target average speed:
[0054] ;
[0055] The target average acceleration can be approximately calculated by the target acceleration:
[0056] ;
[0057] Calculate the total distance to the target using the target's latitude, longitude and altitude:
[0058] ;
[0059] Calculate the target straightness by the total target distance and the target starting and ending points:
[0060] ;
[0061] in, , , are the longitude, latitude and altitude of the starting point, , , are the longitude, latitude and altitude of the destination respectively.
[0062] From the above, we can get the target geographic vector:
[0063] ;
[0064] Will M By saving the known target geographic vectors to a database, a target geographic vector library can be obtained, wherein the database can adopt any existing database that can store the above-mentioned geographic vectors.
[0065] The construction method of the semantic vector library is as follows:
[0066] Save the target ship name, MMSI number and identity information into a text document (.txt) format, and map the document to the vector space using the Embedding method to obtain a vector The embedding method is a vector mapping method, and its core spirit is to map text content into vectors in a fixed way. This method is not unique, and it is recommended to use the open source method "all-MiniLM-L6-v2" of Google.
[0067] WillM Vector Use the ChromaDB (semantic vector database) method to save it as a database file. You can get the semantic vector library. The ChromaDB (semantic vector database) method is not unique, but it is a common method in the industry.
[0068] Step 2: Obtain the location information and description information of the target to be analyzed and construct a dual-vector query feature.
[0069] The location information and description information of the target to be analyzed in this step are consistent with those in step 1. The difference is that the amount of data of the known target is large, while the amount of data of the target to be analyzed is small, and there may be missing items.
[0070] The construction method of the dual vector query feature is basically the same as step 1, except that only the geographic vector and semantic vector No need to create a database.
[0071] In order to distinguish known targets from targets to be analyzed, in this embodiment, the elements in the dual-vector feature library are marked as , , mark the dual-vector query feature of the target to be analyzed as , . q , d They represent the target to be analyzed and the known target respectively.
[0072] Step 3: Perform similarity calculation based on the dual-vector query features and the dual-vector feature library to obtain the final similarity between the target to be analyzed and the known target.
[0073] Specifically, the similarity calculation process is as follows:
[0074] For a target to be analyzed q , traverse all the M targets and perform similarity calculation. d= [1, M ].
[0075] For each and , perform geographic similarity calculation:
[0076] ;
[0077] in:
[0078] ;
[0079] in , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the target to be analyzed. , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the known target.
[0080] For each and Calculate semantic similarity:
[0081] ;
[0082] For the target q to be analyzed, obtain:
[0083] The top K targets with the highest geographical similarity: ;
[0084] The top K targets with the highest semantic similarity: ;
[0085] for and For each target in, construct a cross-similarity matrix :
[0086] ;
[0087] ;
[0088] ;
[0089] Where i and j are positive integers in [1, K]. In a specific implementation, K can generally be 5. The superscript T represents transposition. Indicates known target and The geographical similarity between Indicates known target and The calculation of the geographic similarity and semantic similarity between known targets can be found in the above formula and will not be repeated here.
[0090] Step 4: Enable the big model service, use the system prompt words to initialize the big model, and obtain the big model question and answer framework.
[0091] In this step, enabling big model services mainly includes enabling big model services such as Zhipu Qingyan and Tongyi Qianwen. The specific big model is not limited here, as long as it has basic conversation understanding capabilities. Among them, the big model service is a natural language processing model based on deep learning training, which can understand and generate text that conforms to the context.
[0092] The system prompt words are text inputs that provide behavioral guidance for the large model and are used to standardize the output behavior of the model. The system prompt words used in this embodiment are:
[0093] "From now on, you need to generate answers based on the similarity calculation results combined with the context and summarize them. You cannot generate answers arbitrarily. The target to be analyzed is: <location information and description information of the target to be analyzed>. The target situation is as follows: 1. Geographic similarity matching situation: 2. Semantic similarity matching: . 3. Cross similarity matrix: Based on this information, you need to: 1. Identify target behavior patterns. 2. Mining potential associations.
[0094] After enabling the big model service, load the big model question-and-answer framework. The loading method can refer to the LangChain method and is not limited here.
[0095] Step 5: Input the final similarity calculation result obtained in step 3 into the dialogue template in the large model question and answer framework obtained in step 4 to obtain the output result of the large model question and answer.
[0096] The dialogue template input into the large model question-answering framework obtained in step 4 is to fill in the geographical similarity matching situation obtained in step 3 In the example, fill in the semantic similarity matching situation In , fill the cross-similarity matrix into The large model can then generate output results based on the above information.
[0097] Among them, the large model needs to have a certain level of intelligence, that is: it can recognize basic semantic logical relationships, and will not generate divergent content or fail to communicate normally; it can recognize track information and will not be insensitive to digital content; it can recognize longitude and latitude information, and can roughly describe the real location it represents based on the longitude and latitude information.
[0098] Based on the same inventive concept, an embodiment of the present invention discloses a civil track analysis system based on hybrid vector retrieval enhancement, comprising:
[0099] A feature library construction module is used to obtain location information and description information of multiple known targets and construct a dual-vector feature library; the dual-vector feature library includes a geographic vector library and a semantic vector library; the geographic vector library stores the average speed, speed standard deviation, average acceleration, total distance and straightness of the track of the known target; the semantic vector library stores the semantic vector obtained by text embedding of the description information of the known target; the description information at least includes the identity information of the known target;
[0100] A query feature construction module, used to obtain location information and description information of the target to be analyzed, and to construct a dual-vector query feature; the dual-vector query feature includes a geographic vector query feature and a semantic vector query feature;
[0101] A similarity calculation module is used to perform similarity calculation based on the dual-vector query feature and the dual-vector feature library to obtain the final similarity between the target to be analyzed and the known target;
[0102] The track analysis module is used to enable the big model service, initialize the big model using the system prompt words, and obtain the big model question and answer framework; and input the final similarity calculation result obtained by the similarity calculation module into the big model question and answer framework to obtain the output result of the big model question and answer framework.
[0103] An embodiment of the present invention also discloses a computer system, including a memory, a processor, and a computer program / instruction stored in the memory and executable on the processor. When the computer program / instruction is executed by the processor, the steps of the civil track analysis method based on hybrid vector retrieval enhancement are implemented.
[0104] The embodiment of the present invention further discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the civil track analysis method based on hybrid vector retrieval enhancement.
Claims
1. A civil track analysis method based on hybrid vector retrieval enhancement, characterized in that: The steps include: Step 1: Acquire location information and description information of multiple known targets and construct a dual-vector feature library; the dual-vector feature library includes a geographic vector library and a semantic vector library; the geographic vector library stores the average speed, speed standard deviation, average acceleration, total distance and straightness of the track of the known target; the semantic vector library stores the semantic vector obtained by text embedding of the description information of the known target; the description information at least includes the identity information of the known target; Step 2: Obtain the location information and description information of the target to be analyzed and construct a dual-vector query feature; The dual-vector query feature includes a geographic vector query feature and a semantic vector query feature; Step 3: Calculate the similarity based on the dual-vector query feature and the dual-vector feature library to obtain the final similarity between the target to be analyzed and the known target; The calculation results of the final similarity between the target to be analyzed and the known target include: a set of a preset number of targets with the highest geographical similarity, a set of a preset number of targets with the highest semantic similarity, and a cross-similarity matrix constructed based on the two sets; set up is the set of top K targets with the highest geographical similarity, is the top K target set with the highest semantic similarity. and For each target in, construct the cross-similarity matrix for: ; ; ; The superscript T indicates transposition. Indicates known target and The geographical similarity between Indicates known target and The semantic similarity between them, i∈[1,K]; For the target to be analyzed q and known targets d , based on geographic vectors and The geographic similarity is calculated according to the following formula: ; ; in , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the target to be analyzed. , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the known target; For the target to be analyzed q and known targets d , based on semantic vector and The semantic similarity is calculated according to the following formula: ; in Indicates the magnitude of the calculated vector; Step 4: Enable the big model service, use the system prompt words to initialize the big model, and obtain the big model question-answering framework; Step 5: Input the final similarity calculation result obtained in step 3 into the dialogue template in the large model question and answer framework obtained in step 4 to obtain the output result of the large model question and answer.
2. According to claim 1, a civil track analysis method based on hybrid vector retrieval enhancement is characterized in that: According to the timestamp and longitude and latitude of the target track data, or the timestamp, longitude and latitude and altitude, the target speed and acceleration are calculated, and then the average speed, average acceleration and speed standard deviation of the target are calculated; The total distance is calculated based on the longitude and latitude of the target track data, or the longitude and latitude and altitude, and then the straightness is calculated by combining the starting point and the end point.
3. A civil track analysis system based on hybrid vector retrieval enhancement, characterized in that: include: A feature library construction module is used to obtain the location information and description information of multiple known targets and construct a dual-vector feature library; The dual vector feature library includes a geographic vector library and a semantic vector library; the geographic vector library stores the average speed, speed standard deviation, average acceleration, total distance and straightness of the track of the known target; the semantic vector library stores the semantic vector obtained by text embedding of the description information of the known target; the description information at least includes the identity information of the known target; The query feature construction module is used to obtain the location information and description information of the target to be analyzed and construct a dual-vector query feature; The dual-vector query feature includes a geographic vector query feature and a semantic vector query feature; A similarity calculation module is used to perform similarity calculation based on the dual-vector query feature and the dual-vector feature library to obtain the final similarity between the target to be analyzed and the known target; The calculation results of the final similarity between the target to be analyzed and the known target include: a set of a preset number of targets with the highest geographical similarity, a set of a preset number of targets with the highest semantic similarity, and a cross-similarity matrix constructed based on the two sets; set up is the set of top K targets with the highest geographical similarity, is the top K target set with the highest semantic similarity. and For each target in, construct the cross-similarity matrix for: ; ; ; The superscript T indicates transposition. Indicates known target and The geographical similarity between Indicates known target and The semantic similarity between them, i∈[1,K]; For the target to be analyzed q and known targets d , based on geographic vectors and The geographic similarity is calculated according to the following formula: ; ; in , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the target to be analyzed. , , , , They are the average speed, speed standard deviation, average acceleration, total distance and straightness of the known target; For the target to be analyzed q and known targets d , based on semantic vector and The semantic similarity is calculated according to the following formula: ; in Indicates the magnitude of the calculated vector; The track analysis module is used to enable the big model service, initialize the big model using the system prompt words, and obtain the big model question and answer framework; and input the final similarity calculation result obtained by the similarity calculation module into the big model question and answer framework to obtain the output result of the big model question and answer framework.
4. A computer system comprising a memory, a processor and a computer program / instruction stored in the memory and executable on the processor, characterized in that: When the computer program / instructions are executed by a processor, the steps of a civil track analysis method based on hybrid vector retrieval enhancement according to claim 1 or 2 are implemented.
5. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of a civil track analysis method based on hybrid vector retrieval enhancement according to claim 1 or 2 are implemented.
Citation Information
Patent Citations
Reading understanding intelligent question and answer method based on RPR fusion model
CN114064871A
Multi-mode spatio-temporal trajectory data processing method, device, equipment, medium and product
CN118410303A