GIS software interaction implementation method and system based on large language model

By processing user natural language input through a large language model and generating GIS software operation instructions, the problem of GIS software operation complexity is solved, and ease of use and efficient GIS task completion are achieved.

CN120780722APending Publication Date: 2025-10-14CHINA RAILWAY FIRST SURVEY & DESIGN INST GRP +1

Patent Information

Application Number
CN202510687371.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

Existing GIS software is complex to operate and requires users to have a high level of technical skills, which makes the popularization and application of GIS technology difficult.

Method used

A large language model is used for text preprocessing, intent classification, and parameter extraction to generate executable operation instructions for GIS software and complete GIS tasks through natural language interaction.

Benefits of technology

It lowers the threshold for using GIS software, improves work efficiency, enhances the usability and universality of the system, and supports a variety of GIS software and scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780722A_ABST
    Figure CN120780722A_ABST
Patent Text Reader

Abstract

The invention discloses a GIS software interaction implementation method and system based on a large language model. The method comprises the steps that S1, a GIS task demand text input by a user is obtained; s2, on the basis of a large language model, performing text preprocessing on the required text, performing intention classification and parameter extraction on the preprocessed text, and converting the extracted intention and parameters into an operation instruction which can be executed by GIS software; and S3, the obtained operation instruction is sent to GIS software to be executed, and an execution result of the GIS software is obtained and fed back to a user. According to the method, the user is helped to complete GIS related operation in a natural language interaction mode, the user does not need to have a deep technical background, and the use difficulty of GIS software is remarkably reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of geographic information processing technology, and in particular to a method and system for implementing GIS software interaction based on a large language model. Background Art

[0002] Geographic Information System (GIS) software, such as ArcGIS and QGIS, is widely used in fields such as spatial analysis, mapping, and geographic data management. However, these tools often have complex interfaces and highly specialized functions, requiring users to possess a high level of technical expertise. This not only requires users to master numerous specialized terminology and complex commands, but also increases the difficulty of popularizing and applying GIS technology.

[0003] In recent years, the emergence and development of large language models (such as ChatGPT) have demonstrated powerful natural language processing capabilities. These models can understand user needs expressed in natural language and generate corresponding solutions. If large language models are combined with GIS software, users can interact with GIS software through natural language, simplifying the operation process, lowering the entry point for use, and promoting the popularization of GIS technology. Summary of the Invention

[0004] This application provides a GIS software interaction implementation method and system based on a large language model to solve the problems that existing GIS software requires users to have a high level of technical skills, has a high threshold for use, and is difficult to popularize and apply GIS technology.

[0005] According to the first aspect, an embodiment provides a method for implementing GIS software interaction based on a large language model, the method comprising:

[0006] Step S1, obtaining the GIS task requirement text input by the user;

[0007] Step S2: preprocessing the demand text based on the large language model, performing intent classification and parameter extraction on the preprocessed text, and converting the extracted intent and parameters into operation instructions executable by the GIS software;

[0008] Step S3: Send the obtained operation instruction to the GIS software for execution, obtain the execution result of the GIS software and feed it back to the user.

[0009] Furthermore, the step S2 specifically includes:

[0010] Step S21, text preprocessing, includes:

[0011] Step S211, based on the constructed stop word list, remove the stop words in the input text;

[0012] Step S212: normalize the text.

[0013] Furthermore, the step S2 specifically includes:

[0014] Step S22, intent classification, includes:

[0015] Step S221: define all GIS tasks as an intent tag set Each intent label I i Indicates a GIS data processing method;

[0016] Step S222: Based on the large language model, the preprocessed text is first converted into a fixed-dimensional vector representation, and then the vector representation is input into a linear layer or a fully connected layer to output the probability distribution of each intent label;

[0017] In step S223, the probabilities of all possible intent labels are calculated using the large language model, and the intent label corresponding to the maximum probability is selected, which is the most likely intent I corresponding to the preprocessed text.

[0018] Furthermore, the step S2 specifically includes:

[0019] Step S23, parameter extraction, includes:

[0020] Rule-based parameter extraction, including parameter extraction through predefined rules and templates;

[0021] Parameter extraction based on large language models, including automatic parameter extraction using large language models;

[0022] Hybrid parameter extraction that integrates rule extraction and large language model extraction includes combining rule-based extraction and large language model-based extraction and complementing each other.

[0023] Furthermore, the step S2 specifically includes:

[0024] Step S24, instruction conversion based on GIS mapping rules, includes:

[0025] Step S241, rule matching: based on the predefined mapping rule set F map , which is in the form of: F map ={(I1,g1),(I2,g2),…,(I n ,g n )}, where I i Indicate intention, g i is the corresponding GIS function; when the intention I parsed from the preprocessed text exists in F map When the corresponding GIS function is found through direct matching: g = F map(I);

[0026] Step S242, fuzzy matching: define a candidate function set: G = {g1, g2, ..., g k}, G is the set of all GIS features; use the pre-trained language model to associate the intent I with each GIS feature g i Convert it into an embedding vector, and then calculate the similarity between the intention I and each GIS function g i The semantic similarity of , the GIS function g with the highest similarity is selected.

[0027] Furthermore, the step S2 specifically includes:

[0028] Step S25, parameter verification and optimization, includes:

[0029] Step S251, verifying the integrity and correctness of the extracted parameters;

[0030] Step S252: When missing parameters exist, they are completed through contextual reasoning or default values;

[0031] Step S253: When a parameter has multiple possible values ​​or there is a conflict between the values, the optimal parameter combination is selected through constrained optimization.

[0032] Furthermore, the step S2 specifically includes:

[0033] Step S26, instruction generation, includes:

[0034] A command template is predefined for each GIS function, and the parsed parameters are filled into the corresponding command template of the target GIS function.

[0035] According to a second aspect, an embodiment provides a GIS software interaction implementation system based on a large language model, the system comprising:

[0036] Requirement text acquisition module, used to obtain the GIS task requirement text input by the user;

[0037] A semantic parsing module is used to perform text preprocessing on the demand text based on a large language model, perform intent classification and parameter extraction on the preprocessed text, and convert the extracted intent and parameters into operational instructions executable by the GIS software;

[0038] The execution feedback module is used to send the obtained operation instructions to the GIS software for execution, obtain the execution results of the GIS software and feed back to the user.

[0039] According to a third aspect, an embodiment provides an electronic device, the device comprising: a processor and a memory;

[0040] The memory is used to store one or more program instructions;

[0041] The processor is used to run one or more program instructions to execute the steps of a method for implementing GIS software interaction based on a large language model as described in any of the above items.

[0042] According to the fourth aspect, an embodiment provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of a GIS software interaction implementation method based on a large language model as described in any one of the above items are implemented.

[0043] This application provides a GIS software interaction implementation method and system based on a large language model, which has the following beneficial effects:

[0044] (1) Lower the threshold for use: Users do not need to master GIS professional terms and complex operating instructions, and can complete tasks through natural language.

[0045] (2) Improve work efficiency: The system automatically analyzes user needs and generates GIS executable operation instructions, saving learning and operation time.

[0046] (3) Strong universality: The system supports mainstream GIS software and is suitable for a variety of scenarios and industry needs.

[0047] (4) Humanized interaction: The system’s usability and user experience are improved through natural language interaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart of a method for implementing GIS software interaction based on a large language model provided in one embodiment of the present application;

[0049] Figure 2 An overall architecture diagram of a GIS software interaction implementation system based on a large language model provided in one embodiment of the present application. DETAILED DESCRIPTION

[0050] The present application is further described in detail below by means of specific embodiments in conjunction with the accompanying drawings. Similar elements in different embodiments are numbered with associated similar elements. In the following embodiments, many detailed descriptions are provided to enable the present application to be better understood. However, those skilled in the art will readily appreciate that some of the features may be omitted in different circumstances, or may be replaced by other elements, materials, or methods. In some cases, some operations related to the present application are not shown or described in the specification. This is to avoid the core portion of the present application being overwhelmed by excessive descriptions. For those skilled in the art, it is not necessary to describe these related operations in detail. They can fully understand the related operations based on the description in the specification and the general technical knowledge in the art.

[0051] In addition, the features, operations, or characteristics described in the specification may be combined in any appropriate manner to form various embodiments. Furthermore, the steps or actions in the method description may be reordered or adjusted in a manner readily apparent to those skilled in the art. Therefore, the various sequences in the specification and drawings are provided solely for the purpose of clearly describing a particular embodiment and are not intended to be mandatory, unless otherwise specified.

[0052] The first embodiment of this application provides a GIS software interaction implementation method based on a large language model, which aims to help users complete GIS related operations through natural language interaction, without requiring users to have a deep technical background, and significantly reducing the difficulty of using GIS software. Figure 1 Provide detailed explanation.

[0053] like Figure 1 As shown, in step S1, the GIS task requirement text input by the user is obtained.

[0054] In this embodiment, the user interface can receive natural language input from the user, supporting both text input and voice input. The user can describe the task requirements in simple natural language, such as "generate a population distribution heat map for a certain area" or "analyze the land use type in this area."

[0055] The main components of the user interface are:

[0056] 1) Input components

[0057] Function: Receive the user's task description and support multiple input methods, including text and voice.

[0058] Features:

[0059] Text input box: Users input operation requirements through the keyboard, such as "draw a land use map of a certain area".

[0060] Voice input function: Users can describe their operation requirements through voice, and the system will convert the voice into text.

[0061] Input prompts: Provide users with optional task templates or prompt statements to help them describe their requirements more clearly.

[0062] 2) Output display component

[0063] Function: Present GIS operation results in an intuitive way, including text, charts, maps, etc.

[0064] Features:

[0065] Text feedback area: displays the system's analysis results and execution status of user requirements, such as "heat map generated successfully."

[0066] Graphic display area: used to present generated maps, charts or analysis results.

[0067] Result Download Button: Allows users to download the generated chart or map as a file.

[0068] 3) Interactive control components

[0069] Function: Guide users through a multi-step task or provide them with options for further action.

[0070] Features:

[0071] Action suggestion box: Recommends possible next steps based on the user's current task.

[0072] Multi-step task navigation: supports users to complete more complex tasks, such as generating maps in steps, adjusting layers, etc.

[0073] like Figure 1 As shown, in step S2, based on the large language model, the demand text is preprocessed, the preprocessed text is subjected to intent classification and parameter extraction, and the extracted intent and parameters are converted into operational instructions executable by the GIS software.

[0074] In this embodiment, based on the capabilities of a large language model (such as GPT), the natural language input by the user is understood and converted, specifically including the following steps:

[0075] Step S21, text preprocessing, includes:

[0076] Step S211, based on the constructed stop word list, remove the stop words in the input text;

[0077] Step S212: normalize the text.

[0078] Specifically, text preprocessing is used to clean up user input text, remove extra spaces and symbols, and ensure that the input format is standardized. Text preprocessing mainly includes the following steps:

[0079] (1) Stop word removal: Natural language contains a large number of common words that are irrelevant to semantics (such as "的", "请", "谢谢", etc.). These words do not contribute to intent extraction and parameter parsing. The principle of stop word removal is to remove stop words from the input text T through a predefined stop word list S.

[0080] Given a text T = {t1, t2, ..., t n} and the stop word set S = {s1,s2,…,s m}, the preprocessed text is T′

[0081] Implementation: Construct a stop word list S, which can be based on a publicly available stop word library, such as the Chinese stop word library, or a custom word list. After tokenizing the text, match each word against the stop word list and remove any matching words. Token segmentation and stop word filtering can be implemented using a natural language processing library (such as NLTK or Jieba). The stop word list can be generated through corpus statistics and manual annotation.

[0082] (2) Character normalization:

[0083] Natural language text may contain redundant symbols, spaces, or other meaningless characters. The task of normalization is to remove these interfering information and ensure that the text format is uniform.

[0084] Define character normalization function f clean (t i ) maps each word ti to its canonical form ti′:

[0085] T″={t′ i ∣t′ i =f clean (t i ),t i ∈T′}, where T′ is the text after removing stop words and T″ is the text after character normalization.

[0086] Implementation: Character normalization is performed through regular expression-based symbol cleanup (e.g., punctuation removal) and format conversion. Format conversion, for example, converts numbers and dates to a unified format (e.g., "January 20" → "2025-01-20").

[0087] Example of character normalization:

[0088] 1) Replace full-width characters with half-width characters: Full-width characters (such as full-width punctuation marks and letters) are often used in Chinese input. However, in most language processing, they need to be converted to half-width characters (standard ASCII characters). Full-width symbol: "ABCD" → Half-width symbol: "ABCD"; Full-width punctuation: ",。?!" → Half-width punctuation: "。?!"

[0089] 2) Simplified-Traditional Character Conversion: In Chinese, simplified and traditional characters differ in visual form but convey the same meaning. For example, the character for "马" (horse) is simplified, while the character for "馬" (horse) is traditional. A common character normalization operation involves converting traditional characters to simplified or unifying them into some form.

[0090] 3) Standardize date formats: In text, dates can be expressed in a variety of ways. For example, "January 20, 2025," "2025-01-20," and "1 / 20 / 2025" represent the same date but have different formats. Character normalization unifies these different date formats into a standard format.

[0091] 4) Number Normalization: Sometimes, numbers in text use Chinese numerals (such as "二千二百十三") or different symbols (such as "1.2" and "1,2"). The normalization process will unify them into a standard numerical form.

[0092] 5) Unified symbol format: There may be different ways to express symbols in text, for example, "%" and "%" both represent the percent sign. Character normalization will unify these symbols into a standard symbol.

[0093] 6) There may be extra spaces, line breaks, or other meaningless characters in the text. For example, multiple spaces or line breaks may interfere with subsequent processing and need to be normalized to a single space or deleted.

[0094] In this embodiment, the task of semantic parsing is to extract intent I and parameters P from the preprocessed text. Semantic parsing is achieved through intent classification and parameter extraction.

[0095] Step S22, intent classification, includes:

[0096] Step S221: define all GIS tasks as an intent tag set Each intent label I i Indicates a GIS data processing method;

[0097] Step S222: Based on the large language model, the preprocessed text is first converted into a fixed-dimensional vector representation, and then the vector representation is input into a linear layer or a fully connected layer to output the probability distribution of each intent label;

[0098] In step S223, the probabilities of all possible intent labels are calculated using the large language model, and the intent label corresponding to the maximum probability is selected, which is the most likely intent I corresponding to the preprocessed text.

[0099] Specifically, intent classification is used to identify GIS tasks in text language. All GIS tasks are defined as a set of intent labels: Each intent represents a GIS data processing method, such as calculating area, measuring length, and calculating buffer. By training and fine-tuning the large language model, the input text T″ is mapped to the most likely intent label I. I is the intent that maximizes the conditional probability:

[0100]

[0101] Where P(I i |T″) means that T″ belongs to intention I i The conditional probability of is calculated by a large language model.

[0102] I: The final selected intent label, for example: "generate heat map".

[0103] Intent set, which contains all GIS tasks supported by the system (such as "calculate area", "measure length", etc.).

[0104] The method for calculating the maximum intent probability using a large language model is as follows: The large language model converts the input text T″ into a fixed-dimensional vector representation h(T″), which contains the semantic information of the text. The model then inputs the text vector representation h(T″) into a linear layer or a fully connected layer, the output of which is the probability distribution of each intent label. This process can be accomplished using the softmax function:

[0105]

[0106] h(T″): semantic vector representation of T″, generated by a large language model.

[0107] W i With intention I i The corresponding weight vector represents the feature focus of the model on this intent.

[0108] k is the set of intent sizes.

[0109] exp(·): exponential function used for softmax normalization to ensure that the sum of all probabilities is 1.

[0110] Finally, the model calculates the probabilities of all possible intent labels and selects the label with the highest probability.

[0111] Step S23, parameter extraction, includes: rule-based parameter extraction, including parameter extraction through predefined rules and templates; large language model-based parameter extraction, including automatic parameter extraction using a large language model; hybrid parameter extraction that integrates rule extraction and large language model extraction, including combining rule-based extraction and large language model-based extraction and complementing each other.

[0112] Specifically, based on the input text T″, a set of parameters related to the operation requirements is extracted. Each of the p i Is a key-value pair representing the parameter name and value.

[0113] For example:

[0114] Input text: "Generate a population density heat map of Beijing, January 2025"

[0115] Extracted parameter set: P = {region: Beijing, data type: population density, time: January 2025}

[0116] There are three parameter extraction methods: basic rule extraction, large language model-based extraction, and hybrid extraction method of fusion rule extraction and large language model.

[0117] ① Rule-based parameter extraction extracts specific parameter patterns through predefined rules and templates. Rules are usually based on regular expressions (Regex), keyword matching, or template mapping. The mathematical representation of rule extraction is:

[0118] p i =R(T″),i∈{1,2,…,n}

[0119] Where p: the extracted parameter set, consisting of key-value pairs (such as: {region: Beijing, data type: population density, time: January 2025}).

[0120] R: Parameter extraction rule function, used to match specific patterns (such as regular expressions). Example: Match region r"([\s]+city|[\s]+province|[\s]+district)".

[0121] T″: preprocessed input text.

[0122] Implementation steps: 1) Define parameter templates: Define keywords or patterns related to parameters as needed. Example: Region: Match administrative divisions (such as "Beijing" and "Shanghai"). Time: Match date or time formats (such as "January 2025" and "tomorrow"). Data type: Match specific terms (such as "population density" and "temperature"). 2) Regular expression extraction: Use regular expressions to match relevant parameters from text. Example: Extract region: r"([^\s]+city|[^\s]+province|[^\s]+district)"; extract time: r"(\d{4}year\d{1,2}month|\d{4}-\d{1,2}-\d{1,2})".

[0123] ② Parameter extraction based on large language model: Large language model can automatically extract parameters from natural language through context understanding. Implementation methods include: sequence labeling method and question answering method. Sequence labeling method transforms the parameter extraction task into a sequence labeling problem, where each word corresponds to a label (such as BERT’s NER task). Sequence labeling method calculates the parameter extraction task for each word w. i ∈T″, calculate the label probability distribution P(y i |T″);y i =argmaxP(y i |T″), and then the label sequence {y1,y2,…,y m} is mapped to a parameter collection.

[0124] Example:

[0125] Tag categories:

[0126] B-LOC (beginning word of a region), I-LOC (middle word of a region)

[0127] B-TIME (the beginning word of time), I-TIME (the middle word of time)

[0128] O (not part of any parameter)

[0129] Input text: "Generate a population density heat map of Beijing, January 2025"

[0130] Sequence annotation results: Generate O Beijing B-LOC City I-LOC O population B-DAT density I-DAT heat map O, O time O is O2025B-TIME year I-TIME1 month I-TIME

[0131] Question-answering method: Convert parameter extraction into a question-answering task.

[0132] Design questions for each parameter and answer them through a large language model. Example: Question 1: Where is the region? → Answer: "Beijing"; Question 2: What is the data type? → Answer: "Population density"; Question 3: What is the time? → Answer: "January 2025"

[0133] ③ Hybrid approaches combine rule-based methods with large language models, leveraging their respective strengths. Rules are used to quickly extract obvious parameters, such as standard expressions for time or location. Unmatched parts are further analyzed using the large language model. After the large language model predicts parameters, rules are used to verify or complete them.

[0134] Example:

[0135] Input text: "Help me generate a population density heat map for Beijing, showing data for 2025."

[0136] Rule extraction:

[0137] Region: Beijing

[0138] Data Type: Population Density

[0139] Time: 2025

[0140] Model Supplement:

[0141] If parameters are missing (such as region), the model is completed by the context.

[0142] Step S24, instruction conversion based on GIS mapping rules, includes:

[0143] Step S241, rule matching: based on the predefined mapping rule set F map , which is in the form of: F map ={(I1,g1),(I2,g2),…,(I n ,g n )}, where I i Indicate intention, g i is the corresponding GIS function; when the intention I parsed from the preprocessed text exists in F map When the corresponding GIS function is found through direct matching: g = F map (I);

[0144] Step S242, fuzzy matching: define a candidate function set: G = {g1, g2, ..., g k}, G is the set of all GIS features; use the pre-trained language model to associate the intent I with each GIS feature g i Convert it into an embedding vector, and then calculate the similarity between the intention I and each GIS function g iThe semantic similarity of , the GIS function g with the highest similarity is selected.

[0145] The core of GIS mapping rules is to convert the parsed intent I and parameters P into GIS system operation instructions. Its principle is rule matching and fuzzy matching.

[0146] (1) Rule matching is based on a predefined mapping rule set F map , which is in the form of: F map ={(I1,g1),(I2,g2),…,(I n ,g n )}. i Indicates a parsed intent, g i The corresponding GIS function (such as "generate heat map" is mapped to the HeatMap in the GIS tool. When the parsed intent I exists in Fmap, the corresponding function is found by direct matching: g = F map (I)

[0147] For example: Input intent I = "generate heat map"

[0148] Matching result: g = HeatMap(P)

[0149] (2) Fuzzy matching: When intention I fails to map When an exact match is found in , fuzzy matching is used to find the most similar GIS function g through semantic similarity. The steps are as follows:

[0150] 1. Define the candidate function set: G = {g1, g2, ..., g k}, G is the collection of all GIS functions.

[0151] 2. Semantic representation: Use pre-trained language models (such as BERT, Sentence-BERT) to represent the input intent I and function description g i Converted to embedding vector:

[0152] v I =Embedding(I),

[0153] I: The intention of the user input, usually an instruction described in natural language, such as "generate a heat map of Beijing".

[0154] g i : A description of the candidate function, such as "generate a heat map based on input point density data".

[0155] Embedding(·): The process of converting natural language text into a high-dimensional vector using a pre-trained language model (such as BERT or Sentence-BERT). This vector represents the semantic information of the text.

[0156] v I : Semantic embedding vector of user input intention I.

[0157] Candidate function g i The semantic embedding vector of .

[0158] 3. Similarity calculation: Use cosine similarity to calculate the intent I and each function g i Semantic similarity:

[0159]

[0160] Sim(I,g i ) User input intention I and candidate function g i The semantic similarity range is [-1,1][-1,1][-1,1]. The larger the value, the more similar the semantics.

[0161] ||v I || and The norm of a vector, which indicates the length of the vector.

[0162] 4. Select the optimal function: Select the function g with the highest similarity.

[0163]

[0164] g * : The GIS function that is most similar to the user's input intention (i.e., the function that is finally selected).

[0165] argmax: means finding the value that can make the similarity Sim(I,g i ) Maximized function g i .

[0166] G: candidate feature set.

[0167] Sim(I,g i ): User input intention and function g i semantic similarity.

[0168] Example description:

[0169] Assume that the user input intention is “make a heat distribution map”, but the mapping rule set F mapThe precise rules for “creating a heat map” are not included in [1]. Through fuzzy matching, “creating a heat map” is converted into an embedding vector vI. This is compared with the embeddings of the candidate function set G, such as HeatMap, ContourMap, etc. Calculate the similarity, assuming the result is:

[0170] Sim("Create Heat Map",HeatMap)=0.92

[0171] Sim("Create Heat Distribution Map",ContourMap)=0.65

[0172] Finally, g=HeatMap is selected.

[0173] Step S25, parameter verification and optimization, includes:

[0174] Step S251, verifying the integrity and correctness of the extracted parameters;

[0175] Step S252: When missing parameters exist, they are completed through contextual reasoning or default values;

[0176] Step S253: When a parameter has multiple possible values ​​or there is a conflict between the values, the optimal parameter combination is selected through constrained optimization.

[0177] In this embodiment, the core of parameter verification and optimization is to ensure that the parsed parameter P meets the completeness and correctness of functional requirements. This relies on constraint optimization and contextual reasoning, combined with actual parameter verification, missing value completion, and default value setting to ensure parameter validity and smooth functional execution.

[0178] 1. The purpose of integrity check is to determine whether the parameter P contains all the necessary information to meet the functional requirements.

[0179] Assume that the parameter set is P = {p1, p2, ..., p n}, the required parameter set is P req ={q1,q2,…,q m}, check the parameter integrity through the following constraints:

[0180] If q i ∈P req and There are missing parameters. If q i ∈P req And q i ∈P, then there are no missing parameters.

[0181] Example:

[0182] Required parameter set: Preq = {region, data type, time}

[0183] Actual parameters: P = {region: Beijing, data type: population density}

[0184] The missing piece: time

[0185] 2. Parameter completion

[0186] When missing parameters exist, they need to be completed through contextual reasoning or default values.

[0187] (1) Contextual completion (based on Bayesian inference)

[0188] Contextual completion uses historical records, contextual information of user input, or common patterns to select the most likely completion value through Bayesian inference.

[0189] Let the missing parameter be p k , its possible value set is V={v1,v2,…,v n The goal of Bayesian inference is to calculate the posterior probability of each possible value and select the value with the highest probability:

[0190]

[0191] Where: C context information (such as other parameters, history records, user preferences).

[0192] P(v i |C): Infer parameter value v based on context C i The posterior probability of .

[0193] Expanded by Bayes' formula:

[0194]

[0195] P(C|v i ): given parameter value v i The contextual conditional probability of .

[0196] P(vi): Prior probability of parameter value (can be set based on historical statistics or domain knowledge).

[0197] P(C): normalization constant.

[0198] Example:

[0199] User input: "Generate a population density heat map for Beijing."

[0200] Missing parameters: time p time p_{\text{time}}p time.

[0201] C: The context is "Generate a population density heat map of Beijing."

[0202] V = {2024, January 2025, default: most recent time period}

[0203] V = {2024, January 2025, default: most recent time period}.

[0204] Through Bayesian inference, the system may determine that the "recent time period" is a high-probability completion value.

[0205] (2) Default value completion

[0206] When contextual information is insufficient, domain knowledge or system-preset default values ​​can be used to complete missing parameters.

[0207] Example:

[0208] When the time parameter is missing, the default value is set to "current time".

[0209] When the region parameter is missing, the default value is set to "National".

[0210] 3. Parameter optimization

[0211] When the parameter P has multiple possible values ​​or there are conflicts between the values, the optimal parameter combination is selected through constrained optimization.

[0212] Optimization goal:

[0213] Define an objective function f(P) to evaluate the quality of parameter combinations and optimize under constraints:

[0214]

[0215] Where: P * This is the result after optimization.

[0216] f(P) objective function (such as parameter rationality score, user satisfaction, etc.).

[0217] g i (P): Inequality constraints (such as parameter value range restrictions).

[0218] h j (P): Equality constraints (such as parameter logical consistency).

[0219] Example:

[0220] The user inputs "Generate a heat map of Beijing".

[0221] Parameter P = {region: Beijing, data type: undetermined, time: current time}

[0222] Optional data type set: {population density, traffic flow, temperature}

[0223] Constraint optimization:

[0224] f(P): Evaluate the rationality score of different data types.

[0225] g(P): Ensure that the data type matches the area and time.

[0226] Optimization result: P* = {area: Beijing, data type: population density, time: current time}.

[0227] Step S26, instruction generation, including: predefine instruction templates for each GIS function, fill the parsed parameters into the corresponding instruction templates of the target GIS function.

[0228] In this embodiment, instructions executable by GIS software are automatically generated according to the parsed intent I and parameters P.

[0229] Implementation:

[0230] 1. Template generation: Define instruction templates for common GIS functions.

[0231] Example: HeatMap function corresponds to Python code template:

[0232] generate_heatmap(area="{area}", data_type="{data_type}", time="{time}")

[0233] 2. Dynamic interpolation: Fill the parsed parameters P into the template.

[0234] Example: Input parameter P = {area: Beijing, data type: population density, time: January 2025}

[0235] generate_heatmap(area="Beijing", data_type="population density", time="January 2025")

[0236] 3. Multi-software support: Support mainstream GIS platforms such as ArcGIS, QGIS, SuperMap, and YiZhiRui. Automatically generate script formats (such as Python, R, toolbox commands) for specific platforms.

[0237] Furthermore, this embodiment also provides a GIS interface module, which is responsible for interacting with GIS software (such as ArcGIS, QGIS, etc.), sending instructions to the GIS software, and receiving its execution results. It performs operations by calling APIs or script interfaces to ensure the integrity and compatibility of operations, supports multiple GIS software environments, and can dynamically adapt to different interface calling methods. Implementation details are as follows:

[0238] 1) Calling API: Using the development interface provided by GIS software to run the generated instructions, and providing standardized interface functions for the instruction generation module to call.

[0239] 2) Interface adaptation: Provides interface adapter mode to support multiple GIS tools.

[0240] 3) Instruction execution: The module sends the generated instructions to the target software through the GIS adapter. The module receives and parses the execution results and returns them to the system in a standardized format.

[0241] 4) Error handling: Capture exceptions in interface calls (such as network connection failure, parameter errors, etc.) and provide detailed error information to help users understand and adjust their input requirements.

[0242] like Figure 1 As shown, in step S3, the obtained operation instruction is sent to the GIS software for execution, and the execution result of the GIS software is obtained and fed back to the user.

[0243] In this embodiment, the execution feedback module obtains the execution results of the GIS software and provides feedback to the user in natural language. The feedback content can be a prompt indicating whether the operation is successful, a display of a generated chart or map, or further operation suggestions. The implementation details are as follows:

[0244] 1) Result analysis:

[0245] Receive the results returned by the GIS interface module, determine the execution status (success / failure), and generate feedback content based on the specific situation.

[0246] Feedback content example:

[0247] Success: "The heat map was generated successfully. The file save path is: C: / GIS_Project / heatmap.tif"

[0248] Failure: "Heatmap generation failed. Reason: Input data format error."

[0249] 2) Natural Language Generation (NLG):

[0250] Generate user-friendly feedback based on templates or language models.

[0251] 3) Multi-form feedback:

[0252] Text feedback: Describes the results of an operation in natural language.

[0253] Chart or map presentation: directly embed the results generated by GIS operations (such as map snapshots).

[0254] 4) Logging:

[0255] Record execution feedback to the system log to facilitate subsequent problem tracking and analysis.

[0256] Corresponding to the above-disclosed method for implementing GIS software interaction based on a large language model, the embodiment of the present application also discloses a system for implementing GIS software interaction based on a large language model, such as Figure 2 As shown, it specifically includes:

[0257] Requirement text acquisition module, used to obtain the GIS task requirement text input by the user;

[0258] A semantic parsing module is used to perform text preprocessing on the demand text based on a large language model, perform intent classification and parameter extraction on the preprocessed text, and convert the extracted intent and parameters into operational instructions executable by the GIS software;

[0259] The execution feedback module is used to send the obtained operation instructions to the GIS software for execution, obtain the execution results of the GIS software and feed back to the user.

[0260] It should be noted that for the detailed description of a GIS software interaction implementation system based on a large language model provided in an embodiment of the present application, reference can be made to the relevant description of a GIS software interaction implementation method based on a large language model provided in an embodiment of the present application, which will not be repeated here.

[0261] In addition, an embodiment of the present application also provides an electronic device, which includes: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a GIS software interaction implementation method based on a large language model as described in any of the above items.

[0262] It should be noted that, for the detailed description of an electronic device provided in an embodiment of the present application, reference can be made to the relevant description of a GIS software interaction implementation method based on a large language model provided in an embodiment of the present application, which will not be repeated here.

[0263] In addition, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for implementing GIS software interaction based on a large language model as described in any of the above items are implemented.

[0264] It should be noted that for a detailed description of a computer-readable storage medium provided in an embodiment of the present application, reference can be made to the relevant description of a GIS software interaction implementation method based on a large language model provided in an embodiment of the present application, which will not be repeated here.

[0265] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer program. When all or part of the functions in the above embodiments are implemented by computer program, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above functions can be implemented. In addition, when all or part of the functions in the above embodiments are implemented by computer program, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and saved in the memory of the local device by downloading or copying, or the system of the local device is updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be implemented.

[0266] The above specific examples are used to illustrate the present application, which is only used to help understand the present application and is not intended to limit the present application. For those skilled in the art of the present application, based on the concept of the present application, they can also make some simple deductions, modifications or substitutions.

Claims

1. A method for implementing GIS software interaction based on a large language model, characterized in that: The method comprises: Step S1, obtaining the GIS task requirement text input by the user; Step S2: preprocessing the demand text based on the large language model, performing intent classification and parameter extraction on the preprocessed text, and converting the extracted intent and parameters into operational instructions executable by the GIS software; Step S3: Send the obtained operation instruction to the GIS software for execution, obtain the execution result of the GIS software and feed it back to the user.

2. A method for implementing GIS software interaction based on a large language model as claimed in claim 1, characterized in that: The step S2 specifically includes: Step S21, text preprocessing, includes: Step S211, based on the constructed stop word list, remove the stop words in the input text; Step S212: performing character normalization processing on the text.

3. A method for implementing GIS software interaction based on a large language model as claimed in claim 1, characterized in that: The step S2 specifically includes: Step S22, intent classification, includes: Step S221: define all GIS tasks as an intent tag set Each intent label I i Indicates a GIS data processing method; Step S222: Based on the large language model, the preprocessed text is first converted into a fixed-dimensional vector representation, and then the vector representation is input into a linear layer or a fully connected layer to output the probability distribution of each intent label; In step S223, the probabilities of all possible intent labels are calculated using the large language model, and the intent label corresponding to the maximum probability is selected, which is the most likely intent I corresponding to the preprocessed text.

4. A method for implementing GIS software interaction based on a large language model as claimed in claim 3, characterized in that: The step S2 specifically includes: Step S23, parameter extraction, includes: Rule-based parameter extraction, including parameter extraction through predefined rules and templates; Parameter extraction based on large language models, including automatic parameter extraction using large language models; Hybrid parameter extraction that integrates rule extraction and large language model extraction includes combining rule-based extraction and large language model-based extraction and complementing each other.

5. A method for implementing GIS software interaction based on a large language model as claimed in claim 4, characterized in that: The step S2 specifically includes: Step S24, instruction conversion based on GIS mapping rules, includes: Step S241, rule matching: based on the predefined mapping rule set F map , which is in the form of: F map ={(I1,g1),(I2,g2),…,(I n ,g n )}, where I i Indicate intention, g i is the corresponding GIS function; when the intention I parsed from the preprocessed text exists in F map When the corresponding GIS function is found through direct matching: g = F map (I); Step S242, fuzzy matching: define a candidate function set: G = {g1, g2, ..., g k }, G is the set of all GIS features; use the pre-trained language model to associate the intent I with each GIS feature g i Convert it into an embedding vector, and then calculate the similarity between the intention I and each GIS function g i The semantic similarity of , the GIS function g with the highest similarity is selected.

6. A method for implementing GIS software interaction based on a large language model as claimed in claim 5, characterized in that: The step S2 specifically includes: Step S25, parameter verification and optimization, includes: Step S251, verifying the integrity and correctness of the extracted parameters; Step S252: When missing parameters exist, they are completed through contextual reasoning or default values; Step S253: When a parameter has multiple possible values ​​or there is a conflict between the values, the optimal parameter combination is selected through constrained optimization.

7. A method for implementing GIS software interaction based on a large language model as claimed in claim 6, characterized in that: The step S2 specifically includes: Step S26, instruction generation, includes: A command template is predefined for each GIS function, and the parsed parameters are filled into the corresponding command template of the target GIS function.

8. A GIS software interaction implementation system based on a large language model, characterized by: The system comprises: Requirement text acquisition module, used to obtain the GIS task requirement text input by the user; A semantic parsing module is used to perform text preprocessing on the demand text based on a large language model, perform intent classification and parameter extraction on the preprocessed text, and convert the extracted intent and parameters into operational instructions executable by the GIS software; The execution feedback module is used to send the obtained operation instructions to the GIS software for execution, obtain the execution results of the GIS software and feed back to the user.

9. An electronic device, characterized in that: The device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a method for implementing GIS software interaction based on a large language model as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for implementing GIS software interaction based on a large language model as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Task-driven system based on natural language

    CN113515616A

  • Mutual generation type artificial intelligence system based on multi-dimensional spatio-temporal information vector graph

    CN118484551A

  • Function calling method based on natural language

    CN118642787A

  • Geological map generation method and system based on large model agent

    CN119152071A

  • Digital intelligent management system for highway electromechanical equipment

    WO2025102966A1

Cited By

  • A natural language-based GIS automation operation method, system, device and storage medium

    CN122633794A