Natural language space-time retrieval method and system based on large model
By using a large-model-based natural language spatiotemporal retrieval method, we build an entity knowledge base and generate SQL statements, solving the problems of specialized dependence and poor interactive experience of traditional spatiotemporal retrieval systems and achieving user-friendly and flexible spatiotemporal data retrieval.
Patent Information
- Application Number
- CN202510793526.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-13
AI Technical Summary
Traditional spatiotemporal retrieval systems rely on professional operators, have poor user interaction experience, lack flexibility, and are unable to cope with dynamically changing query needs.
A natural language spatiotemporal retrieval method based on a large model is adopted. By obtaining spatiotemporal retrieval questions and business spatiotemporal databases, an entity knowledge base is constructed. The large language model is used to parse natural language intent, identify spatial, temporal and business attribute constraints, and generate SQL statements for retrieval.
It realizes the intelligent mapping of user natural language commands to spatiotemporal data, improves user interaction experience and flexibility, and is suitable for smart city and grassroots governance scenarios.
Smart Images

Figure CN120653659A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data resource services, and particularly to a natural language spatio-temporal retrieval method and system based on a large model. Background Art
[0002] In traditional spatio-temporal retrieval systems, the following technical defects exist: 1. Professional dependence: Traditional spatio-temporal retrieval systems usually rely on professionals to operate through structured query languages (such as users need to master professional syntax: "longitude > X AND distance < Y", etc.) or fixed interfaces. It is difficult for ordinary users to directly participate in complex queries.
[0003] 2. Poor interaction experience: Users need to be familiar with spatio-temporal data formats (such as coordinates, timestamps) and retrieval syntax, with a high operation threshold and unfriendly interaction. For example, when querying cameras within 200 meters around location A, traditional systems may require users to accurately input the specific geographical coordinates of location A, the exact search radius value, and clearly indicate the device type such as cameras in a professional and fixed information format.
[0004] 3. Lack of flexibility: The system functions are fixed and it is difficult to handle dynamically changing query requirements (such as fuzzy conditions like "around" and "the last 30 minutes").
[0005] Therefore, a natural language spatio-temporal retrieval method and system based on a large model are developed to solve the above problems. Summary of the Invention
[0006] The present invention proposes a natural language spatio-temporal retrieval method and system based on a large model to solve the problems of existing professional dependence, poor interaction experience, and lack of flexibility.
[0007] The present invention achieves the above object through the following technical solutions: A natural language spatio-temporal retrieval method based on a large model of the present invention includes: Obtaining spatio-temporal retrieval problems and a business spatio-temporal database in the grass-roots governance data business system, where the spatio-temporal retrieval problems are data with key entities marked, and the key entities include location entities, target entities, and constraint conditions, and the constraint conditions include spatial constraints, time constraints, and business attribute constraints; Fine-tuning a preset large language model according to the spatio-temporal retrieval problems and a preset prompt engineering template; Dividing the target governance area into geographical space grids, and each geographical space grid has a unique grid code; Constructing an entity knowledge base for classifying different data categories according to the business spatio-temporal database and dynamic semantic tags, and assigning grid codes corresponding to GeoHash precision to the business data of each data category in the entity knowledge base; Based on the fine-tuned large language model, natural language intent analysis is performed on user input to identify spatial constraints, temporal constraints, and business attribute constraints. Converting the spatial constraint into a filter condition; Querying the entity knowledge base for data categories of corresponding key entities; Based on business attribute constraints, data categories, spatial constraints and filtering conditions, spatiotemporal retrieval results are output based on the fine-tuned large language model.
[0008] Furthermore, the spatiotemporal retrieval issues in the grassroots governance data business system include: Get user search logs; classifying the user search log based on the user's search intent; Extract spatiotemporal data retrieval problems based on the labels of people, places, things, objects, and organizations and classified user search logs.
[0009] Furthermore, an entity knowledge base is constructed based on the business spatiotemporal database and dynamic semantic tags, including: Preprocess and analyze the business spatiotemporal database based on natural language processing methods to obtain analytical data; According to the analysis data, dynamic semantic tags are generated based on a dynamic tag generation algorithm.
[0010] Furthermore, the spatial constraint is converted into a filtering condition, including: Extract positioning points based on spatial constraints; A semantic retrieval algorithm is used to find the most relevant information fragments for the location point from the preset address knowledge base. The location point description and the most relevant information fragments are then input into the fine-tuned large language model to output the coordinates of the location point. Get the corresponding GeoHash precision based on the data category; The grid code of the positioning point is retrieved based on the coordinates of the positioning point and the corresponding GeoHash precision. The grid codes of the adjacent grids of the grid where the positioning point is located are filtered. The distance from the center point of each adjacent grid to the grid where the positioning point is located is calculated, and all grid codes whose distances meet the spatial constraints are filtered out. Extract business data of corresponding data categories according to data categories, and establish semantic relationships between business data of corresponding data categories and geospatial grids; According to the semantic relationship established between the business data of the corresponding data category and the geographic space grid, all grid codes whose distances meet the spatial constraints are queried to find the unique code of the corresponding business data that meets the conditions.
[0011] Furthermore, the description of the anchor point and the information fragment most relevant to the description of the anchor point are input into the fine-tuned large language model, and the coordinates of the anchor point are output, including: The most relevant information fragment to the description of the anchor point is used as context input; Construct a prompt word based on the context input and the description of the anchor point; Input the prompt word Prompt into the fine-tuned large language model and output the coordinates of the positioning point.
[0012] Furthermore, based on business attribute constraints, data categories, spatial constraints, and filtering conditions, the fine-tuned large language model outputs spatiotemporal search results, including: Remove the description involved in constructing the spatial constraints from the user input query to obtain a trimmed query; Build a data structure metadata knowledge base, which contains database schema information; Setting up large model system prompt words, including SQL syntax structure and business terms; Input the tailored query, data structure metadata knowledge base, and large model system prompt words into the fine-tuned large model, output the SQL statement, and perform syntax verification and optimization; The filter conditions and the SQL statements after verification optimization are input into the fine-tuned large language model, and the spatiotemporal retrieval results are output.
[0013] Furthermore, the large language model is a Qwen2.5-14B large model.
[0014] Furthermore, the data category of the corresponding key entity is queried in the entity knowledge base through the RAG technical framework.
[0015] Furthermore, the business spatiotemporal database includes population, organizations, locations, facilities, points of interest, and events.
[0016] The present invention also provides a natural language spatiotemporal retrieval device based on a large model, comprising: An acquisition module, which is used to obtain spatiotemporal retrieval problems and business spatiotemporal databases in the grassroots governance data business system. The spatiotemporal retrieval problems are data after key entities are annotated. The key entities include location entities, target entities, and constraints. The constraints include spatial constraints, time constraints, and business attribute constraints. A fine-tuning module, configured to fine-tune a preset large language model according to a spatiotemporal retrieval problem and a preset prompt word engineering template; A division module, the division module is used to divide the target governance area into geographic space grids, each geographic space grid has a unique grid code; A construction module is used to construct an entity knowledge base classified by different data categories based on the business spatiotemporal database and dynamic semantic tags, and assign a grid code of corresponding GeoHash precision to the business data of each data category in the entity knowledge base; A parsing module, which is used to parse the natural language intent of user input based on the fine-tuned large language model and identify spatial constraints, temporal constraints, and business attribute constraints; A conversion module, configured to convert the spatial constraint into a filtering condition; A query module, configured to query the entity knowledge base for corresponding key entity data categories; The output module is used to output spatiotemporal retrieval results based on the fine-tuned large language model according to business attribute constraints, data categories, spatial constraints and filtering conditions.
[0017] The beneficial effects of the present invention are: The large-model-based natural language spatiotemporal retrieval method and system proposed in this paper integrates multimodal semantic understanding, dynamic knowledge base construction, and natural language spatiotemporal retrieval SQL generation based on large-model-knowledge base collaboration to build a natural language-driven spatiotemporal retrieval agent system. This intelligently maps user natural language commands to spatiotemporal data retrieval, making it suitable for scenarios such as smart cities and grassroots governance. This method eliminates reliance on specialized knowledge, enhances the user interaction experience, and offers high flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flowchart of a method for natural language spatiotemporal retrieval based on a large model for this application; Figure 2 A schematic diagram of a process for generating space constraints in an embodiment of the present application; Figure 3 A flow chart for generating spatiotemporal search SQL statements in an embodiment of the present application. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the embodiments of the present invention. It should be understood that the described embodiments are only a portion of the embodiments of the present invention, not all of them. Generally, the components of the embodiments of the present invention described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations.
[0020] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0021] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0022] In order to solve the problems existing in the prior art, the applicant has come up with the following ideas: With the development of artificial intelligence technology, large language models (LLMs) have demonstrated powerful capabilities in natural language understanding, generation, and semantic analysis. At the same time, entity knowledge bases and prompt word technologies have also provided new ideas for intelligent retrieval. However, relying solely on general large models for spatiotemporal retrieval still has shortcomings: (1) insufficient knowledge accuracy. Large models themselves lack accurate knowledge of specific spatiotemporal data and entity relationships (such as the relationship between geographic location and surrounding devices); (2) multi-dimensional information organization is difficult. The retrieval of spatiotemporal data requires effective organization and indexing of multi-dimensional information such as time and space, which is difficult to directly achieve in large models.
[0023] In spatiotemporal data retrieval involving data on people, places, things, and organizations, the key linking elements are addresses and geospatial grids. A geospatial grid is a regular grid system dividing the Earth's surface. Each grid cell is uniquely coded and mapped to an address entity through spatial location. It serves as the fundamental unit for spatiotemporal data organization and retrieval, while an address identifies a specific location. The two are interrelated and form the foundation for spatiotemporal data retrieval. Various spatial entities in a city (urban components, spatial infrastructure elements such as buildings and roads, and location elements) can be located and attributed within the geospatial grid, allowing for spatial location and management of these entities. Population data is linked to addresses through residential addresses, organizational data is linked to addresses through registered / business addresses, and events are linked to addresses through occurrence addresses. Queries on the spatial location of people, organizations, and events can be converted to queries on address attributes. By linking various spatially specific data types (population data, organizational data, events, buildings, etc.) to addresses, and then linking addresses to geospatial grids, complex spatial queries can be transformed into queries on attributes such as addresses and geospatial grids.
[0024] Therefore, the present invention provides a natural language spatiotemporal retrieval method and system based on a large model to achieve an effective combination of large model fine-tuning, entity knowledge base, appropriate prompt words and intelligent agents, and to build a system that can achieve flexible spatiotemporal data retrieval through natural language interaction.
[0025] The following is combined with Figure 1 , Attachment Figure 2 and attached Figure 3 , the specific implementation methods of the present invention are described in detail.
[0026] This embodiment comprehensively considers multiple indicators such as execution speed, performance, and context length, and chooses to fine-tune and use the Qwen2.5-14B large model. Specifically, it uses the Qwen2.5-14B general large model to perform intent recognition and analysis of natural language input by users through prompt word engineering to achieve specific spatiotemporal retrieval tasks. The main implementation process includes the following: 1.1 Data collection and preprocessing: In order to perform specific spatiotemporal retrieval tasks, a well-labeled dataset is required. 1) Search log collection: Collect massive user search logs from the data business system, which contain key information such as query keywords. Use big data and machine learning technology to classify and extract user search intentions to provide a data basis for subsequent analysis. 2) Summary of spatiotemporal data retrieval problems: Based on the business attributes of the human, land, things, and organizational elements in grassroots governance, summarize the relevant spatiotemporal data retrieval problems. These problems mainly cover the following categories: XXX [data category] within XXX [distance] meters around XXX [location], for example: cameras within 200 meters of Building C; Which XXX [data category] is closest to XXX [location]? For example, which gas station is closest to Building C? How many XXX [data categories] are there in XXX [location area], e.g., how many cameras are there in Building C? Please list XXX [location] XXX [business conditions] XXX [data category], for example: Please list the complaints on Road B in the past week.
[0027] 3) Annotated Dataset Generation: Based on the aforementioned spatiotemporal data retrieval problem, we sorted out the prompt word engineering templates to form an annotated dataset to provide data support for subsequent model fine-tuning training.
[0028] 1.2. Analysis and Preparation of the Prompt Word Engineering Template: Prompt word engineering is a method that adds context or guidance to the input text to guide the model to produce more accurate results. Based on the user questions analyzed in the first step, we carefully sorted out the prompt word engineering template to provide a labeled dataset for fine-tuning the model. The following is an example of a prompt word engineering template: {User question: "Cameras within 200 meters of location A", answer: "Query using the following steps: 1. Extract query information (location entity: location A, target entity: camera, spatial constraint: 200 meters around) 2. Query the location point address 3. Query the geospatial grid within the query range of the location point coordinates 4. Identify specific data categories based on the knowledge base 5. Filter data categories based on the query address and generate SQL 6. Execute the SQL 7. Display the query results on a map"} {User question: "Please list the complaints on Road B in the past week." Answer: "Use the following steps to count: 1. Extract query location information (location entity: Road B, target entity: event, spatial constraint: contains, time constraint: past week) 2. Query the geospatial grid within the query range of the location 3. Identify specific data categories based on the knowledge base 4. Semantically transform the query request based on the data category and geospatial grid filter conditions 5. Generate SQL based on the new query request 6. Execute the SQL 7. Display the query results on a map."} 1.3. Fine-tuning: Fine-tune the Qwen2.5-14B base model using the prepared prompt word engineering template annotation dataset. During the fine-tuning process, a series of hyperparameters are adjusted to optimize model performance. The specific execution parameters are shown in Table 1 below: Table 1
[0029] 1.4 Model Evaluation: After fine-tuning is complete, evaluate the model's performance. Focus on assessing whether the model correctly understands the user's query intent and adjust the fine-tuning strategy based on the evaluation results. Repeat the fine-tuning, evaluation, and adjustment process until the model achieves satisfactory results and performance.
[0030] Entity knowledge base construction: Building a classification system for different data categories. In addition to building a knowledge base and a business data structure (Schema) knowledge base based on traditional manual labeling of people, places, things, and organizations, it is also necessary to extract potential label data to meet the needs of different users when retrieving spatiotemporal data. Supporting the construction of a business-specific label knowledge base from the massive data records in the business spatiotemporal database includes the following: 2.1 Text Preprocessing and Analysis: Natural Language Processing (NLP) techniques are used to preprocess and analyze data. Basic operations such as word segmentation, part-of-speech tagging, and named entity recognition are performed to extract key information from the text. Advanced techniques such as sentiment analysis and topic modeling are then used to gain a deeper understanding of the text content, providing a basis for subsequent tag generation.
[0031] 2.2 Dynamic label generation algorithm: 1) Adaptive adjustment: Taking into account the dynamics and diversity of data, an adaptive algorithm is used to adjust the label generation strategy in real time according to data changes. 2) Introducing reinforcement learning: Innovatively introducing reinforcement learning algorithms to continuously optimize the label generation process through interaction with data; combined with graph neural networks, considering the correlation and hierarchy between labels, so that the generated labels are more in line with business needs. 3) Combining multiple models: Using machine learning models (such as classifiers or clustering algorithms) to classify text and generate label candidates; using the Transformer model, dynamically generate labels based on text content. 4) Support for multi-label and contextual association: Support multi-label generation, allowing multiple labels to be applied to a data record at the same time to capture data diversity; support contextual association, considering text context information, and generating labels with strong contextual relevance.
[0032] Generating spatial constraints is to parse the constraints based on the user's query intent, convert the spatial range query into a conditional filtering query, and satisfy the conversion query of spatial semantic relationships. The main implementation process includes the following: 3.1: Constructing a global geospatial grid A global meshing algorithm is used to divide the Earth's surface into geospatial grids of varying levels. This example uses the Geohash method to construct multiple levels of grids, from coarse to fine. Each grid has a unique code to accommodate queries of varying precision. For example, a precision of 14.9 cm for physical objects can correspond to a GeoHash precision of 11, while an accuracy of approximately 1 MB for events can correspond to a GeoHash precision of 10. Each type of business data to be queried is then assigned its corresponding grid code. For line and area features, grid codes encompassing all corresponding precisions are assigned, thereby generating the geospatial grid semantics for the corresponding data.
[0033] 3.2: Extract query information based on natural language intent recognition and analysis After natural language intent recognition and parsing of user input based on the fine-tuned large model, the query information is extracted from the recognition results. For example, for "cameras within 200 meters of location A", the positioning point (location) is identified as: location A, and the spatial constraint is: 200 meters around.
[0034] 3.3: Query the coordinates of the positioning point based on the external address knowledge base A semantic retrieval algorithm is used to find the most relevant information fragments (name, address, coordinates) related to the location description from the external address knowledge base. This retrieved information is used as context input and combined with the location description to construct a detailed prompt word. This is then input into a large language model for knowledge reasoning to determine the location coordinates (X, Y) that the user actually wants to query.
[0035] 3.4: Querying Geospatial Grids Based on Position Point Coordinates and Spatial Constraints According to the previous steps, the data category that the user really wants to query is extracted, and the corresponding grid accuracy level is obtained. Then, based on the positioning point coordinates (X, Y) and the grid level, the grid code corresponding to the point is queried as "wx4g02". The adjacent grids of the grid are filtered out, and the distance from each grid center point to "wx4g02" is calculated. The grid codes with a distance less than or equal to 200 meters are filtered out until the adjacent grids traversed in the loop have no smaller distance.
[0036] 3.5: Generate filter conditions corresponding to spatial constraints Based on the data categories that users actually want to query, extracted from the previous steps, the corresponding business data is found. Based on the semantic relationship established between the business data and the geospatial grid, a query is performed based on the grid codes filtered in the previous step to find the unique codes for the corresponding business data that meet the conditions. Ultimately, the spatial range query is converted into a filtering condition, improving query efficiency and accuracy.
[0037] Generate SQL statements for spatiotemporal data retrieval. In spatiotemporal data retrieval scenarios, standardized SQL statement generation requires the integration of multiple technologies. The large language model integrates user input queries (excluding content related to spatial constraints) with knowledge base information, follows SQL syntax specifications, converts business constraints, data categories, and spatial conditions into corresponding query logic, and superimposes the spatial constraints from the previous step to generate SQL statements that meet the requirements for spatiotemporal data retrieval, achieving accurate mapping from natural language requirements to structured query statements. The main implementation process includes the following: 4.1. Tailoring generates constraint query descriptions based on business attributes (excluding spatial constraints). This separation of temporal / business constraints from spatial constraints facilitates step-by-step processing. First, for the original user-entered query, remove the descriptions that contribute to the construction of spatial constraints (including location entities and spatial constraints). For example, if the user enters the query "Please list the complaints on Road B in the past week," the output result will be "Please list the complaints on Road B in the past week."
[0038] 4.2. Build a data structure metadata knowledge base to prepare a preloaded knowledge base for the system. This knowledge base contains database schema information, such as table structure, field types, indexes, etc. Extracting the structure of each business data table into the vector knowledge base is key to generating accurate SQL statements, ensuring that the statements conform to the actual database.
[0039] 4.3. Set up system prompts for the large model. These prompts may include common SQL syntax structures, specific business terms, etc. For example: You need to generate a query statement that conforms to SQL syntax based on the user's spatiotemporal data retrieval requirements. The input includes: (1) Time constraint: {time entity} (2) Business constraints: {business attributes} {relationships} {thresholds} (3) Database table structure: Please refer to the knowledge base {Data Structure Knowledge Base} Example: {Give a specific SQL example} 4.4. Generate SQL statements based on natural language By using the system prompt words specified by the large model (LLM), the system can more accurately understand the user's intention, load the metadata knowledge base containing the data structure, and generate SQL statements that are more in line with user needs. This step may involve relation extraction, converting natural language descriptions into SQL WHERE clauses, SELECT clauses, etc.
[0040] 4.5. Syntax Standard Verification and Optimization Based on the large language model, the generated SQL statements are checked for syntax compliance to ensure they conform to SQL syntax standards. If the check fails, the previous step is called to regenerate the statement.
[0041] 4.6. Additional spatial constraint filtering conditions To the SQL statement generated in the previous step, append the SQL attribute filter conditions generated in the Generate Spatial Constraint Conditions step.
[0042] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A natural language spatiotemporal retrieval method based on a large model, characterized in that: include: Obtaining spatiotemporal retrieval problems and business spatiotemporal databases in grassroots governance data business systems. The spatiotemporal retrieval problems are data with key entities labeled. Key entities include location entities, target entities, and constraints. The constraints include spatial constraints, temporal constraints, and business attribute constraints. Fine-tune the preset large language model based on spatiotemporal retrieval questions and the preset prompt word engineering template; Divide the target governance area into geospatial grids, each of which has a unique grid code; Build an entity knowledge base with different data categories based on the business spatiotemporal database and dynamic semantic tags, and assign a grid code with corresponding GeoHash precision to each data category in the entity knowledge base; Based on the fine-tuned large language model, natural language intent analysis is performed on user input to identify spatial constraints, temporal constraints, and business attribute constraints. Converting the spatial constraint into a filter condition; Querying the entity knowledge base for data categories of corresponding key entities; Based on business attribute constraints, data categories, spatial constraints and filtering conditions, spatiotemporal retrieval results are output based on the fine-tuned large language model.
2. A natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: The spatiotemporal retrieval issues in the grassroots governance data business system include: Get user search logs; classifying the user search log based on the user's search intent; Extract spatiotemporal data retrieval problems based on the labels of people, places, things, objects, and organizations and classified user search logs.
3. A natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: Build an entity knowledge base based on the business spatiotemporal database and dynamic semantic tags, including: Preprocess and analyze the business spatiotemporal database based on natural language processing methods to obtain analytical data; According to the analysis data, dynamic semantic tags are generated based on a dynamic tag generation algorithm.
4. A natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: Convert the spatial constraints into filtering conditions, including: Extract positioning points based on spatial constraints; A semantic retrieval algorithm is used to find the most relevant information fragments for the location point from the preset address knowledge base. The location point description and the most relevant information fragments are then input into the fine-tuned large language model to output the coordinates of the location point. Get the corresponding GeoHash precision based on the data category; The grid code of the positioning point is retrieved based on the coordinates of the positioning point and the corresponding GeoHash precision. The grid codes of the adjacent grids of the grid where the positioning point is located are filtered. The distance from the center point of each adjacent grid to the grid where the positioning point is located is calculated, and all grid codes whose distances meet the spatial constraints are filtered out. Extract business data of corresponding data categories according to data categories, and establish semantic relationships between business data of corresponding data categories and geospatial grids; According to the semantic relationship established between the business data of the corresponding data category and the geographic space grid, all grid codes whose distances meet the spatial constraints are queried to find the unique code of the corresponding business data that meets the conditions.
5. The natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: The description of the anchor point and the information fragment most relevant to the description of the anchor point are input into the fine-tuned large language model, and the coordinates of the anchor point are output, including: The most relevant information fragment to the description of the anchor point is used as context input; Construct a prompt word based on the context input and the description of the anchor point; Input the prompt word Prompt into the fine-tuned large language model and output the coordinates of the positioning point.
6. A natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: Based on business attribute constraints, data categories, spatial constraints, and filtering conditions, the fine-tuned large language model outputs spatiotemporal search results, including: Remove the description involved in constructing the spatial constraints from the user input query to obtain a trimmed query; Build a data structure metadata knowledge base, which contains database schema information; Set up system prompts for large models, including SQL syntax structures and business terms; Input the tailored query, data structure metadata knowledge base, and large model system prompt words into the fine-tuned large model, output the SQL statement, and perform syntax verification and optimization; The filter conditions and the SQL statements after verification optimization are input into the fine-tuned large language model, and the spatiotemporal retrieval results are output.
7. The natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: The large language model is the Qwen2.5-14B large model.
8. The natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: The data category of the corresponding key entity is queried in the entity knowledge base through the RAG technical framework.
9. The natural language spatiotemporal retrieval method based on a large model according to claim 1, characterized in that: The business spatiotemporal database includes population, organizations, locations, facilities, points of interest, and events.
10. A natural language spatiotemporal retrieval system based on a large model, characterized by: include: An acquisition module, which is used to obtain spatiotemporal retrieval problems and business spatiotemporal databases in the grassroots governance data business system. The spatiotemporal retrieval problems are data with key entities marked. The key entities include location entities, target entities, and constraints. The constraints include spatial constraints, temporal constraints, and business attribute constraints. A fine-tuning module, configured to fine-tune a preset large language model according to a spatiotemporal retrieval problem and a preset prompt word engineering template; A division module, the division module is used to divide the target governance area into geographic space grids, each geographic space grid has a unique grid code; A construction module is used to construct an entity knowledge base classified by different data categories based on the business spatiotemporal database and dynamic semantic tags, and assign a grid code of corresponding GeoHash precision to the business data of each data category in the entity knowledge base; A parsing module, which is used to parse the natural language intent of user input based on the fine-tuned large language model and identify spatial constraints, temporal constraints, and business attribute constraints; A conversion module, configured to convert the spatial constraint into a filtering condition; A query module, configured to query the entity knowledge base for corresponding key entity data categories; The output module is used to output spatiotemporal retrieval results based on the fine-tuned large language model according to business attribute constraints, data categories, spatial constraints and filtering conditions.
Citation Information
Patent Citations
Big data-based surveying and mapping result management method and system
CN119576862A
GIS dynamic grid management and control system based on intelligent question-answering model
CN119760039A
Geographic language model processing method and device, program product and storage medium
CN119848166A
Space-time data prediction method based on space grid coding and large language model
CN120045633A
Method and system for electronic processing of user queries maintaining factual consistency during processing
US12204524B1
Cited By
Method and system for replying petition document based on MCP protocol and large model
CN120832404A
Distributed database retrieval optimization method and system oriented to geographic knowledge graph
CN120873046A
Distributed database retrieval optimization method and system for geographic knowledge graph
CN120873046B
Camera quick calling and visualization method based on natural language understanding
CN121479015A
Domain knowledge-driven retrieval enhancement generation method and system for airport clearance analysis
CN121524320A