A large model-based natural language spatio-temporal retrieval method and system

By combining large-scale model fine-tuning with entity knowledge base, spatiotemporal data retrieval based on natural language is realized, solving the problems of professional dependence and poor interactive experience in traditional spatiotemporal retrieval systems, improving user-friendliness and flexibility, and making it suitable for smart cities and grassroots governance.

CN120653659BActive Publication Date: 2025-12-12BEIJING ZHIXIN REMOTE SENSING GEOGRAPHIC INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510793526.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-12-12
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

Traditional spatiotemporal retrieval systems rely on specialized knowledge, have poor user interaction experience, lack flexibility, and are unable to cope with dynamic query needs.

Method used

By employing large-scale model fine-tuning, entity knowledge base, and prompt word technology, and through natural language intent parsing and semantic transformation, user-friendly spatiotemporal data retrieval is achieved.

Benefits of technology

It enables intelligent mapping of user natural language commands to spatiotemporal data, improving user interaction experience and system flexibility, and is suitable for smart city and grassroots governance scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653659B_ABST
    Figure CN120653659B_ABST
Patent Text Reader

Abstract

The application discloses a natural language spatiotemporal retrieval method and system based on a large model, relates to the technical field of big data resource services, and comprises the following steps: fine-tuning a preset large language model according to a spatiotemporal retrieval problem and a preset prompt word engineering template; dividing a target management area into geographical space grids, each of which has a unique grid code; constructing an entity knowledge base classified according to different data categories based on a business spatiotemporal database and dynamic semantic labels; performing natural language intention analysis on user input based on the fine-tuned large language model, identifying spatial constraints, time constraints and business attribute constraints; converting the spatial constraints into filtering conditions; querying the data categories of corresponding key entities in the entity knowledge base; and outputting spatiotemporal retrieval results based on the fine-tuned large language model according to the business attribute constraints, the data categories, the spatial constraints and the filtering conditions. The application is free from professional dependence, improves the interactive experience and is highly flexible.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data resource service, and particularly relates to a natural language spatio-temporal retrieval method and system based on a large model. BACKGROUND

[0002] In the traditional spatio-temporal retrieval system, the following technical defects exist:

[0003] 1. Professional dependence: The traditional spatio-temporal retrieval system usually relies on professional personnel to operate through structured query language (such as the user needs to master professional syntax: "longitude>X AND distance<Y", etc.) or fixed interface, and ordinary users are difficult to directly participate in complex queries.

[0004] 2. Poor interactive experience: Users need to be familiar with spatio-temporal data formats (such as coordinates, timestamps) and retrieval syntax, and the operation threshold is high, and the interaction is not friendly. For example, to query the cameras within 200 meters of A place, the traditional system may require the user to accurately input the specific geographic coordinates of A place, the exact search radius value, and the professional and fixed information format of explicitly indicating the device type such as camera.

[0005] 3. Insufficient flexibility: The system function is fixed, and it is difficult to cope with dynamic changing query requirements (such as "periphery", "recent 30 minutes", etc. Fuzzy conditions).

[0006] Therefore, a natural language spatio-temporal retrieval method and system based on a large model are developed to solve the above problems. SUMMARY

[0007] The present application proposes a natural language spatio-temporal retrieval method and system based on a large model to solve the problems of existing professional dependence, poor interactive experience, and insufficient flexibility.

[0008] The present application achieves the above-mentioned purpose through the following technical solutions:

[0009] The natural language spatio-temporal retrieval method based on a large model comprises:

[0010] Obtaining a spatio-temporal retrieval problem and a business spatio-temporal database in a basic-level governance data business system, the spatio-temporal retrieval problem being data after key entities are labeled, the key entities including a place entity, a target entity, and a constraint condition, the constraint condition including a spatial constraint, a time constraint, and a business attribute constraint;

[0011] Fine-tuning a preset large language model according to the spatio-temporal retrieval problem and a preset prompt word engineering template;

[0012] Dividing a target governance area into geographic space grids, each geographic space grid having a unique grid code;

[0013] According to the business spatio-temporal database and the dynamic semantic label, an entity knowledge base of different data categories is constructed, and a grid code of a corresponding GeoHash precision is assigned to business data of each data category in the entity knowledge base;

[0014] Based on the fine-tuned large language model, natural language intention analysis is performed on the user input, and spatial constraints, time constraints and business attribute constraints are identified;

[0015] The spatial constraints are converted into filtering conditions;

[0016] The data category of the corresponding key entity is queried in the entity knowledge base;

[0017] According to the business attribute constraint, the data category, the spatial constraint and the filtering condition, a spatio-temporal retrieval result is output based on the fine-tuned large language model.

[0018] Further, the spatio-temporal retrieval problem in the basic-level governance data business system includes:

[0019] The user search log is obtained;

[0020] The user search log is classified based on the search intention of the user;

[0021] According to the labels of people, places, events, things and organizations and the classified user search log, a spatio-temporal data retrieval problem is extracted.

[0022] Further, the entity knowledge base is constructed according to the business spatio-temporal database and the dynamic semantic label, including:

[0023] The business spatio-temporal database is preprocessed and analyzed based on a natural language processing method to obtain analysis data;

[0024] According to the analysis data, a dynamic semantic label is generated based on a label dynamic generation algorithm.

[0025] Further, the spatial constraints are converted into filtering conditions, including:

[0026] According to the spatial constraint, a positioning point is extracted;

[0027] The most relevant information segment to the positioning point is found from a preset address knowledge base by using a semantic retrieval algorithm, and the description of the positioning point and the information segment most relevant to the description of the positioning point are input into the fine-tuned large language model to output the coordinates of the positioning point;

[0028] According to the data category, a corresponding GeoHash precision is obtained;

[0029] According to the positioning point coordinates and the corresponding GeoHash precision, the grid code of the positioning point is queried, and the grid codes of the adjacent grids of the grid where the positioning point is located are screened, 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 distance satisfies the spatial constraint are filtered out;

[0030] According to the data category, the business data corresponding to the data category is extracted, and a semantic relationship is established between the business data corresponding to the data category and the geographic spatial grid;

[0031] According to the semantic relationship between the business data corresponding to the data category and the geographic spatial grid, all grid codes whose distance satisfies the spatial constraint are queried, and the unique code of the corresponding business data that satisfies the condition is found out.

[0032] Further, the description of the positioning point and the information segment most related to the description of the positioning point are input into the fine-tuned large language model, and the coordinates of the positioning point are output, including:

[0033] The information segment most related to the description of the positioning point is input as context;

[0034] According to the context input and the description of the positioning point, a prompt word Prompt is constructed;

[0035] The prompt word Prompt is input into the fine-tuned large language model, and the coordinates of the positioning point are output.

[0036] Further, according to the business attribute constraint, the data category, the spatial constraint and the filtering condition, the spatio-temporal retrieval result is output based on the fine-tuned large language model, including:

[0037] The description participating in constructing the spatial constraint in the user input query is removed to obtain a cropped query;

[0038] A data structure metadata knowledge base is constructed, and the data structure metadata knowledge base contains database Schema information;

[0039] A large model system prompt word is set, and the prompt word includes an SQL syntax structure and a business term;

[0040] The cropped query, the data structure metadata knowledge base and the large model system prompt word are input into the fine-tuned large model, and an SQL statement is output and subjected to syntax checking and optimization;

[0041] The filtering condition and the SQL statement subjected to checking and optimization are input into the fine-tuned large language model, and the spatio-temporal retrieval result is output.

[0042] Further, the large language model is Qwen2.5-14B large model.

[0043] Further, the corresponding key entity data category in the entity knowledge base is queried through the RAG technical framework.

[0044] Further, the business space-time database includes population, organization, location, facility, point of interest, and event.

[0045] The application also provides a natural language space-time retrieval device based on a large model, which comprises:

[0046] An acquisition module is configured to acquire a space-time retrieval question and a business space-time database in a basic-level governance data business system, the space-time retrieval question being data after key entities are labeled, the key entities including a location entity, a target entity, and a constraint condition, and the constraint condition including a spatial constraint, a temporal constraint, and a business attribute constraint;

[0047] A fine-tuning module is configured to fine-tune a preset large language model according to the space-time retrieval question and a preset prompt word engineering template;

[0048] A division module is configured to divide a target governance area into geographical space grids, each geographical space grid having a unique grid code;

[0049] A construction module is configured to construct an entity knowledge base of different data category classifications according to the business space-time database and dynamic semantic labels, and assign a grid code of corresponding GeoHash precision to business data of each data category in the entity knowledge base;

[0050] An analysis module is configured to perform natural language intent analysis on user input based on the fine-tuned large language model, and identify the spatial constraint, the temporal constraint, and the business attribute constraint;

[0051] A conversion module is configured to convert the spatial constraint into a filtering condition;

[0052] A query module is configured to query a corresponding key entity data category in the entity knowledge base;

[0053] An output module is configured to output a space-time retrieval result based on the fine-tuned large language model according to the business attribute constraint, the data category, the spatial constraint, and the filtering condition.

[0054] The application has the following beneficial effects:

[0055] The natural language spatiotemporal retrieval method and system based on a large model provided in the application construct a natural language driven spatiotemporal retrieval intelligent agent system by fusing multi-modal semantic understanding, dynamic knowledge base construction, and natural language spatiotemporal retrieval SQL generation based on large model-knowledge base collaboration, realize intelligent mapping of user natural language instructions to spatiotemporal data retrieval, and are suitable for smart city, grassroots governance and other scenarios. The application breaks away from professional dependence, improves user interaction experience, and is highly flexible. BRIEF DESCRIPTION OF DRAWINGS

[0056] Figure 1 A method flowchart of the natural language spatiotemporal retrieval method based on a large model of the application;

[0057] Figure 2 A space constraint condition generation flowchart in an embodiment of the application;

[0058] Figure 3 A spatiotemporal retrieval SQL sentence generation flowchart in an embodiment of the application. DETAILED DESCRIPTION

[0059] To make the objectives, technical solutions and advantages of the embodiments of the application clearer, the technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are some embodiments of the application, rather than all the embodiments. The components of the embodiments of the application described and shown in the drawings can be arranged and designed in various different configurations.

[0060] Therefore, the detailed description of the embodiments of the application provided in the drawings below is not intended to limit the scope of the claimed application, but only represents selected embodiments of the application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the application without creative labor are within the scope of protection of the application.

[0061] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0062] To solve the problems in the prior art, the present applicant has the following idea:

[0063] With the development of artificial intelligence technology, large language models (LLM) have shown great capabilities in natural language understanding, generation, and semantic analysis. Meanwhile, entity knowledge bases and prompt technology have also provided new ideas for intelligent retrieval. However, relying solely on general large models for spatio-temporal retrieval still has shortcomings: (1) lack of knowledge precision, large models themselves lack precise knowledge of specific spatio-temporal data and entity relationships (such as geographic location and surrounding device relationships); (2) difficulty in organizing multi-dimensional information, spatio-temporal data retrieval needs to consider the effective organization and indexing of multi-dimensional information such as time and space, which is difficult to achieve directly in large models.

[0064] In spatio-temporal data retrieval involving human, place, and organization data, the key associated elements are addresses and geographic spatial grids. Geographic spatial grids are a grid system that regularly divides the Earth's surface, with each grid corresponding to a unique code and forming a mapping relationship with address entities through spatial positioning, serving as the basic unit for spatio-temporal data organization and retrieval. Addresses, on the other hand, are identifiers of specific locations. These two elements are interconnected, forming the basis for spatio-temporal data retrieval. Various spatial entity objects in cities (such as city components, buildings, and roads) can be assigned to their respective geographic spatial grids, allowing for spatial positioning and management of these entities. Population data is associated with addresses through residence addresses, organization data is associated with addresses through registered addresses / operational addresses, and events are associated with addresses through occurrence addresses. Spatial location queries for population / organizations / events can be converted into attribute queries for addresses. Ultimately, by associating various spatial data (population data, organization data, events, buildings, etc.) with addresses and then linking addresses with geographic spatial grids, complex spatial queries can be transformed into attribute queries for addresses and geographic spatial grids.

[0065] Therefore, the present application provides a natural language spatio-temporal retrieval method and system based on a large model to effectively combine large model fine-tuning, entity knowledge bases, appropriate prompts, and intelligent agents, and to construct a system that can achieve flexible spatio-temporal data retrieval through natural language interaction.

[0066] The specific embodiments of the present application will be described in detail below with reference to the accompanying drawings of Figure 1 , Figures Figure 2 , and Figures Figure 3 .

[0067] This embodiment considers multiple indicators such as execution speed, performance, and context length, and selects Qwen2.5-14B-based large models for fine-tuning and use. Specifically, the Qwen2.5-14B general large model is used to analyze user input natural language through prompt engineering for intent recognition and parsing, to achieve specific spatio-temporal retrieval tasks. The main implementation process includes the following:

[0068] 1.1 Data Collection and Preprocessing: A well-labeled dataset is needed for the specific task of spatiotemporal retrieval. 1) Search Log Collection: Massive user search logs are collected from the data business system, containing key information such as query keywords. Big data and machine learning technologies are used to classify and extract user search intents, providing a data foundation for subsequent analysis. 2) Summary of Spatiotemporal Data Retrieval Problems: Based on the business attributes of the organizational elements of people, places, things, and events in grassroots governance, relevant spatiotemporal data retrieval problems are summarized. These problems mainly cover the following categories:

[0069] XXX [Location] Surrounding XXX [Distance] Meters of XXX [Data Category], such as: Cameras within 200 meters of Building C;

[0070] Which data category is the closest to XXX [location]? For example: Which gas station is the closest to Building C?

[0071] How many XXX [data category] cameras are there within XXX [location area]? For example, how many cameras are there in Building C?

[0072] Please list XXX [Location] XXX [Business Conditions] XXX [Data Category], such as: Please list the complaints about Road B in the past week.

[0073] 3) Generation of labeled dataset: Based on the above spatiotemporal data retrieval problem, we sorted out the prompt word engineering template and formed a labeled dataset to provide data support for subsequent model fine-tuning and training.

[0074] 1.2 Preparation for Prompt Engineering Template Analysis: Prompt engineering is a method that guides a model to produce more accurate results by adding contextual or guiding information to the input text. Based on the user questions identified in the first step of the analysis, a carefully crafted prompt engineering template was developed to provide a labeled dataset for fine-tuning the model. Below is a sample prompt engineering template:

[0075] User Question: "Cameras within 200 meters of location A", Answer: "Search using the following steps:\n1. Extract query information (Location entity: Location A, Target entity: Camera, Spatial constraint: 200 meters surrounding)\n2. Query the location point address\n3. Query the geospatial grid within the location point coordinate range\n4. Identify the specific data category based on the knowledge base\n5. Filter the data category based on the query address and generate SQL\n6. Execute SQL\n7. Display the query results on a map"}

[0076] {User question: "Please list the complaint events of B Road in the past week." Answer: "Follow these steps to calculate: 1. Extract the query location information (location entity: B Road, target entity: event, spatial constraint: contains, time constraint: the past week) 2. Query the geographical space grid within the location query range 3. Identify specific data categories based on the knowledge base 4. Convert the query request according to the data category and geographical space grid filtering conditions 5. Generate SQL according to the new query request 6. Execute SQL 7. Display the query results on the map"}

[0077] 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, adjust a series of hyperparameters to optimize model performance. The specific execution parameters are shown in Table 1:

[0078] Table 1

[0079]

[0080] 1.4 Model evaluation: After fine-tuning is complete, evaluate the model's performance. Focus on evaluating whether the model can correctly understand the user's query intent. Based on the evaluation results, adjust the fine-tuning strategy. Repeat the fine-tuning, evaluation, and adjustment process until the model achieves satisfactory results and performance.

[0081] Entity knowledge base construction: Construct different data categories. In addition to building a knowledge base and business data structure (Schema) knowledge base based on traditional manual marking of human and geographical entities, we also need to extract potential label data to meet the needs of different users in spatio-temporal data retrieval. Support the construction of a business-oriented label knowledge base from massive data records in business spatio-temporal databases, which includes the following content:

[0082] 2.1 Text preprocessing and analysis: Use natural language processing (NLP) techniques to preprocess and analyze data. First, perform basic operations such as word segmentation, part-of-speech tagging, and named entity recognition to extract key information from text. Then use advanced techniques such as sentiment analysis and topic modeling to deeply understand the content of the text, providing a basis for subsequent label generation.

[0083] 2.2 Tag dynamic generation algorithm: 1) Adaptive adjustment, considering the dynamics and diversity of data, an adaptive algorithm is adopted, which can adjust the label generation strategy in real time according to data changes. 2) Reinforcement learning is introduced, and the reinforcement learning algorithm is introduced innovatively, which continuously optimizes the label generation process through interaction with data; combined with graph neural network, the relevance and hierarchy between labels are considered, so that the generated labels are more in line with business needs. 3) Multi-model combination, use machine learning models (such as classifiers or clustering algorithms) to classify text and generate label candidates; use the Transformer model to dynamically generate labels based on text content. 4) Multi-label and context association support, support multi-label generation, allow multiple labels to be applied to a data record at the same time to capture data diversity; support context association, consider the context information of the text, and generate labels with strong context association.

[0084] The generation space constraint condition is the constraint condition parsed according to the user query intention, which converts the spatial range query into a conditional filtering query to meet the conversion query of the spatial semantic relationship; the main implementation process mainly includes the following:

[0085] 3.1: Construct a global split geospatial grid

[0086] The global split algorithm is used to divide the earth's surface into geospatial grids of different levels. In this example, the Geohash method is used to construct a grid of multiple levels from coarse to fine, each grid has a unique code to adapt to different precision query requirements, such as 14.9cm for object class precision, GeoHash precision is 11, event class precision can be around 1M, GeoHash precision is 10, etc. Then assign the corresponding grid code to each type of business data to be queried, and assign all corresponding precision grid codes to line / surface features, so as to generate the geospatial grid semantics of the corresponding data.

[0087] 3.2: Based on natural language intention recognition and parsing, extract query information

[0088] After the fine-tuned large model performs natural language intention recognition and parsing on the user input, the query information in the recognition result is extracted, such as "A place within 200 meters of the camera", the recognition result is "A place, spatial constraint: within 200 meters".

[0089] 3.3: Query the coordinates of the positioning point based on the external address knowledge base

[0090] Find the most relevant information pieces (name, address, coordinates) from the external address knowledge base using semantic retrieval algorithms; input these retrieved information as context, combined with the location point description, to build a detailed prompt word Prompt, input the large language model for knowledge reasoning, and determine the user's true intention to query the location point coordinates (X, Y).

[0091] 3.4: Query the geographic spatial grid based on the location point coordinates and spatial constraints

[0092] According to the previous step, extract the user's true intention to query the data category, obtain the corresponding grid level of precision, and then query the grid code corresponding to the point based on the location point coordinates (X, Y) and grid level, filter out the grid codes with a distance less than or equal to 200 meters, and continue to loop through the adjacent grids until all the adjacent grids are filtered out.

[0093] 3.5: Generate filtering conditions corresponding to spatial constraints

[0094] According to the previous step, extract the user's true intention to query the data category, find the corresponding business data, establish a semantic relationship between the business data and the geographic spatial grid, query based on the grid codes filtered in the previous step, and find the unique code of the corresponding business data that meets the conditions. Finally, the spatial range query is converted into filtering conditions, improving the query efficiency and accuracy.

[0095] Generate a spatio-temporal data retrieval SQL statement. In the spatio-temporal data retrieval scenario, a standardized SQL statement needs to be generated through multi-technology integration. The large language model integrates user input queries (removing spatial constraint-related content) and knowledge base information, follows SQL syntax specifications, converts business constraints, data categories, and spatial conditions into corresponding query logic, and adds the spatial constraint conditions from the previous step to generate a spatio-temporal data retrieval SQL statement that meets the requirements, achieving accurate mapping from natural language requirements to structured query statements. The main implementation process includes:

[0096] 4.1, Crop to generate constraint query description based on business attributes (excluding spatial constraints), the purpose is to separate time / business constraints and spatial constraints for step-by-step processing. First, remove the descriptions involved in constructing spatial constraint conditions (including location entities and spatial constraints) from the original user input query conditions, such as the user input query: "Please list the complaints in B Road in the past week", the output result is "Please list the complaints in the past week".

[0097] 4.2, Build data structure metadata knowledge base, prepare preloaded knowledge base for the system, which contains database Schema information such as table structure, field type, index, etc. Extract the structure of each type of business data table to the vector knowledge base, which is the key to generating accurate SQL statements, ensuring that the statements conform to the actual situation of the database.

[0098] 4.3, Set up large model system prompt words, which may include commonly used SQL syntax structures, specific business terms, etc. For example:

[0099] You need to generate SQL query statements according to the user's spatiotemporal data retrieval requirements. Input includes:

[0100] (1) Time constraints: {time entity}

[0101] (2) Business constraints: {business attribute} {relationship} {threshold value}

[0102] (3) Database table structure: Please check the knowledge base {data structure knowledge base}

[0103] Example: {Give specific SQL examples}

[0104] 4.4, Generate SQL statements based on natural language

[0105] Using the system prompt words specified by the large language model (LLM), the system can more accurately understand the user's intent, load the metadata knowledge base containing the data structure, and generate SQL statements that are closer to the user's needs. This step may involve relationship extraction, converting natural language descriptions into SQL WHERE clauses, SELECT clauses, etc.

[0106] 4.5, Syntax specification verification and optimization

[0107] Based on the large language model, the generated SQL statements are subjected to syntax specification verification to ensure they meet SQL syntax standards. If the verification fails, the previous step is called to regenerate.

[0108] 4.6, Additional spatial constraint filtering conditions

[0109] Append the SQL attribute filtering conditions generated in the spatial constraint condition generation step to the SQL statements generated in the previous step.

[0110] The above is only the preferred embodiment of the present application. It should be noted that for those skilled in the art, without departing from the technical principles of the present application, several improvements and refinements can be made, which should also be considered within the scope of protection of the present application.

Claims

1. A large model-based natural language spatio-temporal retrieval method, characterized in that, The method comprises the following steps: acquiring a spatio-temporal retrieval problem in a basic-level governance data service system and a business spatio-temporal database, wherein the spatio-temporal retrieval problem is data after key entities are labeled, the key entities include a place entity, a target entity and a constraint condition, and the constraint condition includes a spatial constraint, a temporal constraint and a business attribute constraint; fine-tuning a preset large language model according to the spatio-temporal retrieval problem and a preset prompt word engineering template; dividing a target governance area into geographical space grids, each of which has a unique grid code; constructing an entity knowledge base classified according to different data categories based on the business spatio-temporal database and dynamic semantic labels, and assigning each data category of business data in the entity knowledge base a grid code of corresponding GeoHash precision; performing natural language intent analysis on user input based on the fine-tuned large language model to identify the spatial constraint, the temporal constraint and the business attribute constraint; converting the spatial constraint into a filter condition; querying the data category of the corresponding key entity in the entity knowledge base; outputting a spatio-temporal retrieval result based on the fine-tuned large language model according to the business attribute constraint, the data category, the spatial constraint and the filter condition; converting the spatial constraint into a filter condition, which comprises: extracting a positioning point according to the spatial constraint; finding the most relevant information segment of the positioning point from a preset address knowledge base by using a semantic retrieval algorithm, inputting the description of the positioning point and the information segment most relevant to the description of the positioning point into the fine-tuned large language model, and outputting the coordinates of the positioning point; acquiring corresponding GeoHash precision according to the data category; querying the grid code of the positioning point according to the positioning point coordinates and the corresponding GeoHash precision, screening the grid codes of the adjacent grids of the grid where the positioning point is located, calculating the distance from each adjacent grid center point to the grid where the positioning point is located, and filtering out all grid codes meeting the spatial constraint; extracting business data of the corresponding data category according to the data category, and establishing a semantic relationship between the business data of the corresponding data category and the geographical space grid; querying all grid codes meeting the spatial constraint according to the semantic relationship between the business data of the corresponding data category and the geographical space grid, and finding the unique code of the corresponding business data meeting the condition; outputting a spatio-temporal retrieval result based on the fine-tuned large language model according to the business attribute constraint, the data category, the spatial constraint and the filter condition, which comprises: removing the description participating in constructing the spatial constraint in the user input query to obtain a cropped query; constructing a data structure metadata knowledge base, which contains database Schema information; setting prompt words of the large model system, the prompt words including SQL syntax structure and business terminology; inputting the cropped query, the data structure metadata knowledge base and the prompt words of the large model system into the fine-tuned large model, outputting an SQL statement and performing syntax checking and optimization; inputting the filter condition and the checked and optimized SQL statement into the fine-tuned large language model, and outputting a spatio-temporal retrieval result.

2. The large model-based natural language spatio-temporal retrieval method according to claim 1, characterized in that, The method for acquiring a spatio-temporal retrieval problem in a basic-level governance data service system comprises the following steps: acquiring user search logs; classifying the user search logs based on the search intent of the user. According to the tags and classified user search logs of people, land, things, organizations, and the spatio-temporal data retrieval problem is extracted.

3. The large model-based natural language spatio-temporal retrieval method according to claim 1, characterized in that, According to the business spatio-temporal database and the dynamic semantic tag, an entity knowledge base is constructed, including: The business spatio-temporal database is preprocessed and analyzed based on a natural language processing method to obtain analysis data; According to the analysis data, a dynamic semantic tag is generated based on a tag dynamic generation algorithm.

4. The large model-based natural language spatio-temporal retrieval method according to claim 1, characterized in that, The description of the positioning point and the information segment most relevant to the description of the positioning point are input into the fine-tuned large language model to output the coordinates of the positioning point, including: The information segment most relevant to the description of the positioning point is input as context; A prompt word Prompt is constructed according to the context input and the description of the positioning point; The prompt word Prompt is input into the fine-tuned large language model to output the coordinates of the positioning point.

5. The large model-based natural language spatio-temporal retrieval method according to claim 1, characterized in that, The large language model is Qwen2.5-14B.

6. The large model-based natural language spatio-temporal retrieval method according to claim 1, characterized in that, In the entity knowledge base, the data category of the corresponding key entity is queried through an RAG technical framework.

7. The large model-based natural language spatio-temporal retrieval method according to claim 1, characterized in that, The business spatio-temporal database includes population, organization, location, facility, point of interest, and event.

8. A large model-based natural language spatio-temporal retrieval system, characterized in that, Including: An acquisition module is configured to acquire a spatio-temporal retrieval problem and a business spatio-temporal database in a grassroots governance data business system, the spatio-temporal retrieval problem being data after key entities are labeled, the key entities including a location entity, a target entity, and a constraint condition, the constraint condition including a spatial constraint, a temporal constraint, and a business attribute constraint; A fine-tuning module is configured to fine-tune a preset large language model according to the spatio-temporal retrieval problem and a preset prompt word engineering template; A division module is configured to divide a target governance area into geographical space grids, each geographical space grid having a unique grid code; A construction module is configured to construct an entity knowledge base classified according to different data categories based on the business spatio-temporal database and the dynamic semantic tag, and to assign a grid code of corresponding GeoHash precision to business data of each data category in the entity knowledge base; An analysis module is configured to perform natural language intent analysis on user input based on the fine-tuned large language model, and to identify the spatial constraint, the temporal constraint, and the business attribute constraint; A conversion module is configured to convert the spatial constraint into a filter condition; A query module is configured to query the data category of the corresponding key entity in the entity knowledge base; An output module is configured to output a spatio-temporal retrieval result based on the fine-tuned large language model according to the business attribute constraint, the data category, the spatial constraint, and the filter condition; Wherein, converting the spatial constraint into a filter condition includes: Extracting a positioning point according to the spatial constraint; Using a semantic retrieval algorithm to find the information segment most relevant to the positioning point from a preset address knowledge base, and inputting the description of the positioning point and the information segment most relevant to the description of the positioning point into the fine-tuned large language model to output the coordinates of the positioning point; According to the data category, a corresponding GeoHash precision is obtained; According to the positioning point coordinates and the corresponding GeoHash precision, the grid code of the positioning point is queried, and the grid codes of the adjacent grids of the grid where the positioning point is located are screened, 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 distance satisfies the spatial constraint are filtered out; According to the data category, the business data corresponding to the data category is extracted, and a semantic relationship between the business data corresponding to the data category and the geographic spatial grid is established; According to the semantic relationship between the business data corresponding to the data category and the geographic spatial grid, all grid codes whose distance satisfies the spatial constraint are queried, and the unique code of the corresponding business data that satisfies the condition is found out; According to the business attribute constraint, the data category, the spatial constraint and the filtering condition, the spatio-temporal retrieval result is output based on the fine-tuned large language model, including: Removing the description of the user input query involved in constructing the spatial constraint to obtain a cropped query; Constructing a data structure metadata knowledge base, the data structure metadata knowledge base containing database Schema information; Setting up a large model system prompt word, the prompt word including SQL syntax structure and business terminology; Inputting the cropped query, the data structure metadata knowledge base and the large model system prompt word into the fine-tuned large model to output an SQL statement and performing syntax checking and optimization on the SQL statement; Inputting the filtering condition and the checked and optimized SQL statement into the fine-tuned large language model to output the spatio-temporal retrieval result.

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