Intelligent interactive GIS data analysis method and apparatus, and electronic device

By constructing message lists and using tool description templates and other templates, and using the intention understanding ability of the large language model, intelligent interaction of GIS analysis is achieved, solving the problem of high threshold for using traditional GIS analysis and improving user experience.

CN120371929APending Publication Date: 2025-07-25BEIJING SUPERMAP SOFTWARE CO LTD +5
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510431603.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The use threshold of traditional GIS analysis solutions is high and difficult to operate, so users need to be familiar with interface functions and task processes.

Method used

Introduce tool description templates, inference action templates, knowledge base templates and task instruction description templates, generate reply messages through large language models, call GIS analysis tools and output results, reducing the threshold for use and operation difficulty.

Benefits of technology

Intelligently completed GIS analysis through natural language interaction, reducing the threshold and operation difficulty and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371929A_ABST
    Figure CN120371929A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent interaction GIS data analysis method and device and electronic equipment, and the method comprises the steps: responding to a user request message, constructing a message list, the message list comprises the user request message and a system prompt message, and the system prompt message comprises a tool description template, a reasoning action template, a knowledge base template and a task instruction description template; based on the message list, generating a first reply message corresponding to the reasoning action template through a large language model; under the condition that the first reply message indicates that the first GIS analysis tool is to be called, calling the first GIS analysis tool to obtain a tool calling result, and outputting the tool calling result; based on the tool calling result, generating a second reply message corresponding to the message reasoning template through a large language model; and outputting the second reply message under the condition that the second reply message indicates that no GIS analysis tool is to be called. The use threshold and the operation difficulty of GIS analysis are reduced through the large language model, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to an intelligent interaction GIS data analysis method, device, and electronic device. Background Art

[0002] A Geographic Information System (GIS) is a spatial information system that can collect, store, manage, analyze, describe, and display geographical distribution data in the earth's surface space with the support of computer hardware and software systems.

[0003] In practical applications, traditional GIS analysis solutions can perform human-computer interaction through a graphical interface. Users need to understand the various functions in the interface and be familiar with each operation step of the GIS task process in order to use GIS for analysis smoothly and correctly. Therefore, for users, the usage threshold is relatively high and the operation difficulty is relatively large. Summary of the Invention

[0004] Embodiments of this application provide an intelligent interaction GIS data analysis method, device, and electronic device to reduce the usage threshold and operation difficulty of GIS analysis and improve the user experience.

[0005] In a first aspect, embodiments of this application provide an intelligent interaction GIS data analysis method, including:

[0006] In response to a user request message, construct a message list, where the message list includes the user request message and system prompt messages. The system prompt messages include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a Geographic Information System (GIS) analysis tool. The inference action template is used to describe the inference action information for the GIS analysis tool. The knowledge base template is used to describe the knowledge information provided to a large language model. The task instruction description template is used to describe the GIS analysis task information of the large language model, and the GIS analysis task of the large language model corresponds to the GIS analysis tool;

[0007] Based on the message list, generate a first reply message corresponding to the inference action template through the large language model;

[0008] In the case where the first reply message indicates that a first GIS analysis tool is to be called, call the first GIS analysis tool to obtain a tool call result, and output the tool call result;

[0009] Based on the tool call result, generate a second reply message corresponding to the message inference template through the large language model;

[0010] In the case where the second reply message indicates that there is no GIS analysis tool to be called, output the second reply message.

[0011] Optionally, before calling the first GIS analysis tool to obtain a tool call result when the first reply message indicates that the first GIS analysis tool is to be called, the method further includes:

[0012] In the case where the first reply message includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool, determine that the first reply message indicates that the first GIS analysis tool is to be called;

[0013] The calling the first GIS analysis tool to obtain a tool call result includes:

[0014] Extract target text from the first reply message based on the inference action template, where the target text includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool;

[0015] Call the first GIS analysis tool based on the target text to obtain the tool call result.

[0016] Optionally, before calling the first GIS analysis tool to obtain a tool call result, the method further includes:

[0017] Extract model thinking information for the user request message from the first reply message based on the inference action template;

[0018] Output the model thinking information.

[0019] Optionally, the generating, based on the tool call result, a second reply message corresponding to the message inference template through the large language model includes:

[0020] Update the output result of the first GIS analysis tool in the first reply message based on the tool call result to obtain an intermediate reply message;

[0021] Update the message list based on the intermediate reply message to obtain an updated message list;

[0022] Generate the second reply message through the large language model based on the updated message list.

[0023] Optionally, before constructing a message list in response to a user request message, the method further includes:

[0024] Split the GIS task process to obtain multiple GIS analysis tasks, and each GIS analysis task in the multiple GIS analysis tasks is the smallest task unit in the GIS task process;

[0025] Based on the multiple GIS analysis tasks, define multiple GIS analysis tools one by one.

[0026] Optionally, before constructing the message list in response to the user request message, the method further includes:

[0027] Determine the model role information and the model description information, where the model role information indicates that the large language model is used to execute the GIS analysis task, and the model description information includes the rules and precautions when the large language model executes the GIS analysis task;

[0028] Based on the model role information and the model description information, construct the task instruction description template.

[0029] Optionally, before outputting the second reply message when the second reply message indicates that there is no GIS analysis tool to be called, the method further includes:

[0030] When the second reply message does not include the name of the second GIS analysis tool and the input parameters of the second GIS analysis tool, determine that the second reply message indicates that there is no GIS analysis tool to be called.

[0031] Optionally, the outputting the tool call result includes:

[0032] Output the tool call result through a visual interaction interface;

[0033] The outputting the second reply message includes:

[0034] Output the second reply message through the conversation list.

[0035] In a second aspect, an embodiment of the present application provides an intelligent interactive GIS data analysis device, including:

[0036] A message list construction module, configured to construct a message list in response to a user request message, where the message list includes the user request message and system prompt messages, and the system prompt messages include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a Geographic Information System (GIS) analysis tool. The inference action template is used to describe the inference action information for the GIS analysis tool. The knowledge base template is used to describe the knowledge information provided to a large language model. The task instruction description template is used to describe the GIS analysis task information of the large language model, and the GIS analysis task of the large language model corresponds to the GIS analysis tool;

[0037] A first message generation module, configured to generate a first reply message corresponding to the inference action template through the large language model based on the message list;

[0038] A tool invocation module, configured to, when the first reply message indicates that a first GIS analysis tool is to be invoked, invoke the first GIS analysis tool to obtain a tool invocation result and output the tool invocation result;

[0039] A second message generation module, configured to generate a second reply message corresponding to the message inference template through the large language model based on the tool invocation result;

[0040] A message output module, configured to output the second reply message when the second reply message indicates that no GIS analysis tool is to be invoked.

[0041] In a third aspect, an embodiment of the present application provides an electronic device, where the device includes: a processor, a memory, and a system bus;

[0042] The processor and the memory are connected through the system bus;

[0043] The memory is used to store a program, and the program includes instructions that, when executed by the processor, cause the processor to execute any implementation step of the above-mentioned GIS data analysis method for intelligent interaction.

[0044] From the above technical solutions, it can be seen that the embodiments of the present application have the following advantages:

[0045] In an embodiment of the present application, in response to a user request message, a message list may be constructed first. The message list may include the above-mentioned user request message and system prompt messages. The system prompt messages may specifically include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a geographic information system (GIS) analysis tool. The inference action template is used to describe the inference action information for the GIS analysis tool. The knowledge base template is used to describe the knowledge information provided to the large language model. The task instruction description template is used to describe the GIS analysis task information of the large language model. The GIS analysis task of the large language model corresponds to the GIS analysis tool. Then, based on the message list, a first reply message corresponding to the inference action template may be generated through the large language model. When the first reply message indicates that the first GIS analysis tool is to be called, the first GIS analysis tool may be called to obtain a tool call result, and the tool call result may be output. Subsequently, further based on the tool call result, a second reply message corresponding to the message inference template may be generated through the large language model. When the second reply message indicates that no GIS analysis tool is to be called, the second reply message may be output.

[0046] It can be seen that this solution introduces and utilizes the tool description template, the inference action template, the knowledge base template, and the task instruction description template, which can help the large language model have the ideas and methods for performing GIS analysis tasks. On this basis, with the help of the intention understanding ability of the large language model, GIS analysis can be intelligently completed through natural language interaction, thereby reducing the usage threshold and operation difficulty of GIS analysis and improving the user experience. Description of the Drawings

[0047] Figure 1 is a flowchart of an intelligent interactive GIS data analysis method provided by an embodiment of the present application;

[0048] Figure 2 is a schematic diagram of a tool description template provided by an embodiment of the present application;

[0049] Figure 3 is a schematic diagram of an inference action template provided by an embodiment of the present application;

[0050] Figure 4 is a schematic diagram of a knowledge base template provided by an embodiment of the present application;

[0051] Figure 5 is a schematic diagram of a task instruction description template provided by an embodiment of the present application;

[0052] Figure 6 is a schematic diagram of a system prompt message provided by an embodiment of the present application;

[0053] Figure 7a Schematic diagram of a human - machine interaction interface provided by an embodiment of the present application;

[0054] Figure 7b Schematic diagram of another human - machine interaction interface provided by an embodiment of the present application;

[0055] Figure 8 Schematic diagram of the structure of an intelligent interactive GIS data analysis device provided by an embodiment of the present application. Detailed implementation manners

[0056] As described above, in practical applications, traditional GIS analysis solutions can perform human - machine interaction through a graphical interface. Users need to understand each function in the interface and be familiar with each operation step of the GIS task process in order to use GIS for analysis smoothly and correctly. Therefore, for users, the usage threshold is relatively high and the operation difficulty is relatively large.

[0057] Based on this, to solve the above problems, an embodiment of the present application provides an intelligent interactive GIS data analysis method, which may include: in response to a user request message, a message list may be constructed first. Among them, the message list may include the above - mentioned user request message and system prompt messages. The system prompt messages may specifically include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a geographic information system (GIS) analysis tool. The inference action template is used to describe the inference action information for the GIS analysis tool. The knowledge base template is used to describe the knowledge information provided to a large - language model. The task instruction description template is used to describe the GIS analysis task information of the large - language model. The GIS analysis task of the large - language model corresponds to the GIS analysis tool. Then, based on the message list, a first reply message corresponding to the inference action template may be generated through the large - language model. And when the first reply message indicates that the first GIS analysis tool is to be called, the first GIS analysis tool may be called to obtain a tool call result, and the tool call result may be output. Then, further based on the tool call result, a second reply message corresponding to the message inference template may be generated through the large - language model. And when the second reply message indicates that no GIS analysis tool is to be called, the second reply message may be output.

[0058] It can be seen that this solution introduces the use of the tool description template, the inference action template, the knowledge base template, and the task instruction description template, which can help the large - language model have the ideas and methods for performing GIS analysis tasks. On this basis, with the help of the intention understanding ability of the large - language model, GIS analysis can be intelligently completed through natural - language interaction, thereby reducing the usage threshold and operation difficulty of GIS analysis and improving the user experience.

[0059] It should be noted that the execution subject of the GIS data analysis method of the intelligent interaction in the embodiments of the present application is not limited. For example, the GIS data analysis method of the intelligent interaction in the embodiments of the present application can be applied to data analysis devices such as terminal devices or servers. Among them, the terminal device can be an electronic device such as a smart phone, a computer, a personal digital assistant (PDA), or a tablet computer. The server can be an independent server, a cluster server, or a cloud server.

[0060] In order to make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0061] Figure 1 It is a flowchart of a GIS data analysis method for intelligent interaction provided by an embodiment of the present application. Combining Figure 1 As shown, the GIS data analysis method for intelligent interaction provided by an embodiment of the present application may include the following steps S101-S105.

[0062] S101: In response to a user request message, construct a message list, where the message list includes the user request message and system prompt messages. The system prompt messages include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a geographic information system (GIS) analysis tool. The inference action template is used to describe the inference action information for the GIS analysis tool. The knowledge base template is used to describe the knowledge information provided to the large language model. The task instruction description template is used to describe the GIS analysis task information of the large language model. The GIS analysis task of the large language model corresponds to the GIS analysis tool.

[0063] In the embodiments of the present application, for ease of understanding, an exemplary description of the construction of the large language model is first given.

[0064] As an example, the large language model can be locally deployed on a client device, such as the above-mentioned terminal device. Alternatively, the large language model can also be remotely deployed on a server. Correspondingly, the large language model can provide a dialogue interface through which the large language model can interact with the user to complete GIS analysis.

[0065] Among them, the request parameters in the dialogue interface may include a message list. The message list includes multiple messages arranged in sequence, and each message may include the role corresponding to the message and the task content corresponding to the role.

[0066] In practical applications, the roles of messages can be divided into three types: system, user, and assistant. System messages refer to messages used to set the overall behavior, role, and context of the large language model; user messages are the content input by the user; assistant messages refer to the responses generated by the large language model based on system messages and user messages when the role of the large language model is set to an assistant.

[0067] Moreover, the message list only includes one system message, and it is located at the first position in the message list. Starting from the second message in the message list, user messages and assistant messages are arranged alternately in sequence.

[0068] In addition, after preparing the large language model, it is also necessary to process the GIS task flow and construct the above-mentioned various templates so that the large language model can correctly execute the GIS task flow and complete GIS analysis subsequently. For the convenience of understanding, the following will give an exemplary illustration of this process in combination with the accompanying drawings.

[0069] As an example, first, the GIS task flow can be split to obtain multiple GIS analysis tasks. And each GIS analysis task in the multiple GIS analysis tasks is the smallest task unit in the GIS task flow. For example, GIS analysis tasks such as resource search, drawing of basic maps, drawing of 3D heat maps, overlay analysis, buffer analysis, and skyline analysis are all the smallest task units in the GIS task flow that cannot be further split.

[0070] Next, multiple GIS analysis tools can be defined one-to-one based on the multiple GIS analysis tasks. That is to say, one GIS analysis task can be defined as one GIS analysis tool. Here, the essence of each GIS analysis tool is actually an application programming interface (API) that follows the Representational State Transfer (REST) architecture specification.

[0071] For example, the definition information of a GIS analysis tool may include the name, description information, request path, request method, request headers, and input parameters of the GIS analysis tool. Among them, the input parameters include parameter name, parameter description, parameter type, enumeration value, default value, and whether it is required, etc.

[0072] As mentioned above, the tool description template is used to describe the definition information of a Geographic Information System (GIS) analysis tool. Based on this, after defining the GIS analysis tool, the tool description template can be constructed based on the definition information of the GIS analysis tool. For example, as shown in Figure 2 The tool description template can include the definition information of multiple GIS tools, such as the name, description information, and input parameters of Tool 1, and the name, description information, and input parameters of Tool 2. Here, only Tool 1 and Tool 2 are used as examples to introduce the content of the tool description template, and the number of GIS tools is not limited.

[0073] Next, an inference action template can also be constructed based on the definition information of the GIS analysis tool. For example, as shown in Figure 3 The inference action template can include model thinking information and a final response message for the user request message. The model thinking information can describe the thinking process of the large language model when facing the user request message. The final response message refers to the information finally presented by the large language model to the user.

[0074] In addition, during this thinking process, if the large language model determines that a GIS analysis tool needs to be invoked, the inference action template can also include the name, input parameters, and tool invocation result of the first GIS analysis tool to be invoked.

[0075] Moreover, in the embodiments of the present application, knowledge can also be injected into the large language model through a knowledge base template to improve the understanding ability of the large language model and thus better handle GIS tasks. For example, as shown in Figure 4 Since the knowledge information can be real-time knowledge, the knowledge base template can include the current time and relevant knowledge information.

[0076] Furthermore, in the embodiments of the present application, a task instruction description template also needs to be constructed to assist the large language model in performing GIS analysis tasks. As an example, first, the model role information and model description information can be determined. The model role information indicates that the large language model is used to perform GIS analysis tasks; the model description information includes the rules and precautions when the large language model performs GIS analysis tasks. Then, based on the above model role information and model description information, the task instruction description template can be constructed.

[0077] For example, as shown in Figure 5As shown, in the task instruction description template, the model role information can be "You are a human assistant who can use tools to help humans complete various GIS analysis tasks". The model description information can include precautions such as "If the user chats, suggest that the user provide a resource name to help the user retrieve resources and perform subsequent analysis operations" and "If the user's question is vague, infer the user's intention based on the first GIS analysis tool and continue to ask the user".

[0078] In this way, after preparing the large language model and constructing the above four templates, the tool description template, the reasoning action template, the knowledge base template, and the task instruction description template can be used to help the large language model have the ideas and methods for performing GIS analysis tasks, so as to intelligently complete GIS analysis through natural language interaction by virtue of the large language model's intention understanding ability.

[0079] Regarding step S101, the above user request message refers to the message input by the user to the large language model in the form of natural language, that is, the above user message. In the GIS analysis scenario, the user request message is related to the GIS task process. In this way, after receiving the user request message through the large language model, the user request message can be used as the content of the user message in the message list.

[0080] The system prompt message refers to the prompt message set for the large language model, that is, the above system message. In the GIS analysis scenario, the system prompt message is related to the GIS task process. Combining Figure 6 As shown, the system prompt message can include the above tool description template, reasoning action template, knowledge base template, and task instruction description template.

[0081] In this way, after receiving the user request message through the large language model, a message list can be constructed based on the user request message and the system prompt message.

[0082] In addition, in practical applications, after receiving the user request message through the large language model, the user request message can be output to the user in the form of a conversation list. For example, combining Figure 7a As shown, the user request message can be "Use the 'Beijing Residential Area Distribution' data to draw a 3D bar chart". Combining Figure 7b As shown, the user request message can be "View the 'Beijing CBD' scene resources, and perform skyline analysis with the geographical coordinate position of longitude 116.45, latitude 39.91, and height 10 as the target point".

[0083] S102: Based on the message list, generate a first reply message corresponding to the reasoning action template through the large language model.

[0084] In the embodiments of the present application, the above message list can be specifically used to request the dialogue interface of the large language model, so as to obtain the first reply message through the feedback of the large language model. Since the first reply message is fed back by the large language model, the role of the first reply message is the assistant, and the content is in accordance with the above Figure 3 The reply given in the style of the inference action template shown.

[0085] S103: When the first reply message indicates that the first GIS analysis tool is to be called, call the first GIS analysis tool to obtain the tool call result, and output the tool call result.

[0086] As mentioned above, in the thinking process of the large language model, if the large language model determines that a GIS analysis tool needs to be called, the inference action template can also include the name of the first GIS analysis tool to be called (i.e., Figure 3 Acition in), input parameters (i.e., Figure 3 Acition Input in), and tool call result (i.e., Figure 3 Observation in).

[0087] Based on this, in practical applications, if the first reply message includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool, that is, there is "Action:", "Action Input:", and the content after the colon in the first reply message, it can be determined that the first reply message indicates that the first GIS analysis tool is to be called.

[0088] In this way, when the above first reply message indicates that the first GIS analysis tool is to be called, the process of calling the first GIS analysis tool to obtain the tool call result can be specifically reflected as follows: First, extract the target text from the first reply message based on the inference action template, and the target text includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool. That is, extract the content after the colon of "Action:" and the content after the colon of "Action Input:" from the first reply message. Then, the first GIS analysis tool can be called based on the target text to obtain the tool call result, that is, the content after the colon of "Observation:".

[0089] After obtaining the tool call result, the tool call result can be output to the user in the form of a visual interaction interface, so as to facilitate the user to directly obtain the tool call result through interactive operations and improve the user experience.

[0090] For example, in combination with Figure 7aAs shown, the first GIS analysis tool called can include a resource search tool and a mapping tool. Correspondingly, after the user clicks "View Resource Table", the resource list obtained by using the resource search tool can be used as the tool call result and presented to the user. After the user clicks "View 3D Map", the 3D map obtained by using the mapping tool can be used as the tool call result and presented to the user.

[0091] Combined with Figure 7b As shown, the first GIS analysis tool called can include a resource search tool and a skyline analysis tool. Correspondingly, after the user clicks "View Resource Table", the resource list obtained by using the resource search tool can be used as the tool call result and presented to the user. After the user clicks "View Scene", the skyline analysis result obtained by using the skyline analysis tool can be used as the tool call result and presented to the user.

[0092] In addition, if the first reply message does not include the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool, that is, there is no "Action:", "Action Input:", and the content after the colon in the first reply message, it can be determined that the first reply message indicates that there is no GIS analysis tool to be called. At this time, the first reply message can be directly output, and this first reply message can be embodied as Figure 3 the content after the colon of "Final Answer:" in the inference action template shown.

[0093] Furthermore, since the content of the first reply message is a reply given in accordance with the style of the inference action template shown above Figure 3 therefore, the first reply message can also include the model thinking information for the user request message, that is Figure 3 the content after the colon of "Thought:" in it. Based on this, in the embodiments of the present application, the above model thinking information can also be extracted from the first reply message based on this inference action template and the model thinking information can be output. In this way, it can facilitate the user to master the thinking process of the large language model for the request message proposed by himself and improve the user experience.

[0094] In practical applications, the above model thinking information can be output to the user in the form of a dialogue list. For example, combined with Figure 7a as shown, the model thinking information can be "Need to first search for the data resource with the resource name 'Distribution of Residential Areas in Beijing'" and "According to the search results, I will use the data resource ID of the first search result to draw a 3D bar map". Combined with Figure 7bAs shown, the model thinking information can be "It is necessary to first search for the scene resources of 'Beijing CBD' and then use the skyline analysis tool for analysis" and "According to the search results, the scene resources of 'Beijing CBD' are found, and then the skyline analysis tool is used for analysis".

[0095] S104: Based on the tool call result, generate a second reply message corresponding to the message inference template through the large language model.

[0096] As mentioned above, the tool call result is the content after the colon of "Observation:". Based on this, after obtaining the tool call result, the output result of the first GIS analysis tool in the first reply message can be updated based on the tool call result to obtain an intermediate reply message. For example, the intermediate reply message can be obtained by replacing the output result of the first GIS analysis tool in the first reply message, that is, replacing the content after the colon of "Observation:".

[0097] Then, the message list can be updated based on the intermediate reply message to obtain an updated message list. For example, since the first reply message is a message generated according to the style of the inference action template, the intermediate reply message obtained by updating the first reply message above is actually the result after updating the inference action template. Based on this, the intermediate reply message can be further appended to the original message list to obtain an updated message list, which is convenient for the large language model to further perform inference using the updated message list.

[0098] Finally, the second reply message can be generated through the large language model based on the updated message list. Among them, the generation method of the second reply message is similar to that of the first reply message. For specific details, please refer to the relevant content of step S102 above and will not be elaborated here.

[0099] S105: When the second reply message indicates that there is no GIS analysis tool to be called, output the second reply message.

[0100] In practical applications, if the second reply message includes the name of the second GIS analysis tool and the input parameters of the second GIS analysis tool, that is, there is "Action:", "Action Input:", and the content after the colon in the second reply message, it can be determined that the second reply message indicates that the second GIS analysis tool is to be called. Correspondingly, if the second reply message does not include the name of the second GIS analysis tool and the input parameters of the second GIS analysis tool, that is, there is no "Action:", "Action Input:", and the content after the colon in the second reply message, it can be determined that the second reply message indicates that there is no GIS analysis tool to be called.

[0101] It should be noted that in the embodiments of the present application, the first GIS analysis tool and the second GIS analysis tool may be the same GIS analysis tool or different GIS analysis tools. Here, due to the differences between the first reply message and the second reply message, the first GIS analysis tool and the second GIS analysis tool are named differently for distinction.

[0102] In this way, when the above-mentioned second reply message indicates that there is no GIS analysis tool to be called, the second reply message can be output. Specifically, the second reply message can be output in the form of a conversation list.

[0103] Furthermore, as mentioned before, the above-mentioned user request message and model thinking information are also output in the form of a conversation list. Therefore, in the conversation list, the user request message, the model thinking information, and the second reply message can be output in the actual conversation order. For example, as shown in Figure 7a and Figure 7b , the user request message, the model thinking information, and the second reply message can be sequentially displayed to the user in the conversation list. Among them, the model thinking information can be the content of multi-round thinking. Therefore, when the model thinking information is the content of multi-round thinking, the model thinking information also needs to be displayed in the order of thinking.

[0104] In addition, if the second reply message includes the name of the second GIS analysis tool and the input parameters of the second GIS analysis tool, that is, there are "Action:" and "Action Input:" and the content after the colon in the second reply message, it can be determined that the second reply message indicates that the second GIS analysis tool is to be called. At this time, the second GIS analysis tool can be called accordingly, and the process can refer to the above step S103, which will not be elaborated here. This is executed cyclically until the latest reply message indicates that there is no GIS analysis tool to be called, and the latest reply message is output.

[0105] As can be seen from the relevant content of the above steps S101 - S105, in the embodiment of the present application, in response to a user request message, a message list can be constructed first. Among them, the message list can include the above user request message and system prompt messages. The system prompt messages can specifically include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a geographic information system (GIS) analysis tool. The inference action template is used to describe the inference action information for the GIS analysis tool. The knowledge base template is used to describe the knowledge information provided to the large language model. The task instruction description template is used to describe the GIS analysis task information of the large language model. The GIS analysis task of the large language model corresponds to the GIS analysis tool. Then, based on the message list, a first reply message corresponding to the inference action template can be generated through the large language model. And when the first reply message indicates that the first GIS analysis tool is to be called, the first GIS analysis tool can be called to obtain a tool call result, and the tool call result can be output. Then, further based on the tool call result, a second reply message corresponding to the message inference template can be generated through the large language model. And when the second reply message indicates that no GIS analysis tool is to be called, the second reply message can be output.

[0106] As can be seen, this solution introduces and utilizes the tool description template, inference action template, knowledge base template, and task instruction description template, which can help the large language model have the ideas and methods for performing GIS analysis tasks. On this basis, with the help of the intention understanding ability of the large language model, GIS analysis can be intelligently completed through natural language interaction, thereby reducing the usage threshold and operation difficulty of GIS analysis and improving the user experience.

[0107] Furthermore, based on the intelligent interaction GIS data analysis method provided in the above embodiment, the embodiment of the present application can also provide an intelligent interaction GIS data analysis device. The intelligent interaction GIS data analysis device will be described below in combination with the embodiment and the drawings.

[0108] Figure 8 It is a schematic structural diagram of an intelligent interaction GIS data analysis device provided in an embodiment of the present application. Combining Figure 8 As shown, the intelligent interaction GIS data analysis device 800 provided in the embodiment of the present application can include:

[0109] A message list construction module 801, configured to construct a message list in response to a user request message, where the message list includes the user request message and system prompt messages, and the system prompt messages include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a geographic information system (GIS) analysis tool, the inference action template is used to describe the inference action information for the GIS analysis tool, the knowledge base template is used to describe the knowledge information provided to a large language model, and the task instruction description template is used to describe the GIS analysis task information of the large language model, and the GIS analysis task of the large language model corresponds to the GIS analysis tool;

[0110] A first message generation module 802, configured to generate a first reply message corresponding to the inference action template through the large language model based on the message list;

[0111] A tool invocation module 803, configured to, when the first reply message indicates that a first GIS analysis tool is to be invoked, invoke the first GIS analysis tool to obtain a tool invocation result and output the tool invocation result;

[0112] A second message generation module 804, configured to generate a second reply message corresponding to the message inference template through the large language model based on the tool invocation result;

[0113] A message output module 805, configured to output the second reply message when the second reply message indicates that no GIS analysis tool is to be invoked.

[0114] Optionally, the intelligent interactive GIS data analysis device 800 further includes:

[0115] A message determination module, configured to determine that the first reply message indicates that the first GIS analysis tool is to be invoked when the first reply message includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool;

[0116] The tool invocation module 803 is specifically configured to:

[0117] Extract target text from the first reply message based on the inference action template, where the target text includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool;

[0118] Invoke the first GIS analysis tool based on the target text to obtain the tool invocation result.

[0119] Optionally, the intelligent interactive GIS data analysis device 800 further includes:

[0120] An information extraction module, configured to extract model thinking information for the user request message from the first reply message based on the inference action template;

[0121] The message output module 805 is further configured to:

[0122] Output the model thinking information.

[0123] Optionally, the second message generation module 804 is specifically configured to:

[0124] Update the output result of the first GIS analysis tool in the first reply message based on the tool call result to obtain an intermediate reply message;

[0125] Update the message list based on the intermediate reply message to obtain an updated message list;

[0126] Generate the second reply message through the large language model based on the updated message list.

[0127] Optionally, the intelligent interactive GIS data analysis device 800 further includes:

[0128] A process splitting module, configured to split the GIS task process into multiple GIS analysis tasks, and each GIS analysis task in the multiple GIS analysis tasks is the smallest task unit in the GIS task process;

[0129] A tool definition module, configured to define multiple GIS analysis tools one-to-one based on the multiple GIS analysis tasks.

[0130] Optionally, the intelligent interactive GIS data analysis device 800 further includes:

[0131] An information determination module, configured to determine model role information and model description information, where the model role information indicates that the large language model is used to execute GIS analysis tasks, and the model description information includes the rules and precautions when the large language model executes GIS analysis tasks;

[0132] A template construction module, configured to construct the task instruction description template based on the model role information and the model description information.

[0133] Optionally, the message determination module is further configured to:

[0134] When the second reply message does not include the name of the second GIS analysis tool and the input parameters of the second GIS analysis tool, determine that the second reply message indicates that no GIS analysis tool is to be called.

[0135] Optionally, the tool invocation module 803 is specifically configured to:

[0136] Output the tool invocation result through a visual interaction interface;

[0137] The message output module 805 is specifically configured to:

[0138] Output the second reply message through a conversation list.

[0139] Furthermore, an embodiment of the present application further provides an electronic device, including: a processor, a memory, and a system bus;

[0140] The processor and the memory are connected through the system bus;

[0141] The memory is used to store one or more programs, and the one or more programs include instructions, and when the instructions are executed by the processor, the processor is caused to execute any implementation step of the above-mentioned intelligent interaction GIS data analysis method.

[0142] Furthermore, an embodiment of the present application further provides a computer-readable storage medium, and instructions are stored in the computer-readable storage medium. When the instructions are run on an electronic device, the electronic device is caused to execute any implementation step of the above-mentioned intelligent interaction GIS data analysis method.

[0143] From the description of the above embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in each embodiment or some parts of the embodiments of the present application. It should be noted that the embodiments in this specification are described in a progressive manner, and the key point of each embodiment is to describe the differences from other embodiments. The same and similar parts among the embodiments can be referred to each other.

[0144] For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0145] It should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.

[0146] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An intelligent interactive GIS data analysis method, characterized in that, Including: In response to a user request message, construct a message list, where the message list includes the user request message and system prompt messages. The system prompt messages include a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a Geographic Information System (GIS) analysis tool. The inference action template is used to describe the inference action information for the GIS analysis tool. The knowledge base template is used to describe the knowledge information provided to a large language model. The task instruction description template is used to describe the GIS analysis task information of the large language model, and the GIS analysis task of the large language model corresponds to the GIS analysis tool. Based on the message list, generate a first reply message corresponding to the inference action template through the large language model. In the case where the first reply message indicates that a first GIS analysis tool is to be invoked, invoke the first GIS analysis tool to obtain a tool invocation result, and output the tool invocation result. Based on the tool invocation result, generate a second reply message corresponding to the message inference template through the large language model. In the case where the second reply message indicates that no GIS analysis tool is to be invoked, output the second reply message.

2. The GIS data analysis method for intelligent interaction according to claim 1, wherein Before the step of invoking the first GIS analysis tool to obtain a tool invocation result when the first reply message indicates that the first GIS analysis tool is to be invoked, the method further includes: In the case where the first reply message includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool, determine that the first reply message indicates that the first GIS analysis tool is to be invoked. The step of invoking the first GIS analysis tool to obtain a tool invocation result includes: Extract target text from the first reply message based on the inference action template, where the target text includes the name of the first GIS analysis tool and the input parameters of the first GIS analysis tool. Invoke the first GIS analysis tool based on the target text to obtain the tool invocation result.

3. The GIS data analysis method for intelligent interaction according to claim 2, wherein Before the step of invoking the first GIS analysis tool to obtain a tool invocation result, the method further includes: Extract model thinking information for the user request message from the first reply message based on the inference action template. Output the model thinking information.

4. The GIS data analysis method for intelligent interaction according to claim 1, wherein The step of generating a second reply message corresponding to the message inference template through the large language model based on the tool invocation result includes: Update the output result of the first GIS analysis tool in the first reply message based on the tool invocation result to obtain an intermediate reply message. Update the message list based on the intermediate reply message to obtain an updated message list. Generate the second reply message through the large language model based on the updated message list.

5. The GIS data analysis method for intelligent interaction according to any one of claims 1 to 4, characterized in that, Before the step of constructing a message list in response to a user request message, the method further includes: Split the GIS task process to obtain multiple GIS analysis tasks, where each GIS analysis task in the multiple GIS analysis tasks is the smallest task unit in the GIS task process; Based on the multiple GIS analysis tasks, define multiple GIS analysis tools one-to-one.

6. The GIS data analysis method for intelligent interaction according to any one of claims 1 to 4, characterized in that, Before constructing the message list in response to the user request message, the method further includes: Determine the model role information and the model description information, where the model role information indicates that the large language model is used to perform GIS analysis tasks, and the model description information includes the rules and precautions when the large language model performs GIS analysis tasks; Based on the model role information and the model description information, construct the task instruction description template.

7. The GIS data analysis method for intelligent interaction according to any one of claims 1 to 4, characterized in that, Before outputting the second reply message when the second reply message indicates that no GIS analysis tool is to be called, the method further includes: When the second reply message does not include the name of the second GIS analysis tool and the input parameters of the second GIS analysis tool, determine that the second reply message indicates that no GIS analysis tool is to be called.

8. The GIS data analysis method for intelligent interaction according to any one of claims 1 to 4, characterized in that, The output of the tool call result includes: Output the tool call result through the visual interaction interface; The output of the second reply message includes: Output the second reply message through the conversation list.

9. An intelligent interactive GIS data analysis device, characterized in that, Includes: A message list construction module, configured to construct a message list in response to a user request message, where the message list includes the user request message and a system prompt message, and the system prompt message includes a tool description template, an inference action template, a knowledge base template, and a task instruction description template. The tool description template is used to describe the definition information of a geographic information system (GIS) analysis tool, the inference action template is used to describe the inference action information for the GIS analysis tool, the knowledge base template is used to describe the knowledge information provided to the large language model, and the task instruction description template is used to describe the GIS analysis task information of the large language model, and the GIS analysis task of the large language model corresponds to the GIS analysis tool; A first message generation module, configured to generate a first reply message corresponding to the inference action template through the large language model based on the message list; A tool call module, configured to call the first GIS analysis tool to obtain a tool call result and output the tool call result when the first reply message indicates that the first GIS analysis tool is to be called; A second message generation module, configured to generate a second reply message corresponding to the message inference template through the large language model based on the tool call result; A message output module, configured to output the second reply message when the second reply message indicates that no GIS analysis tool is to be called.

10. An electronic device, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected through the system bus; The memory is used to store a program, the program includes instructions, and when the instructions are executed by the processor, the processor is caused to execute the steps of the GIS data analysis method for intelligent interaction according to any one of claims 1 to 8.

Citation Information

Cited By

  • Geographic space analysis agent system and method based on large model

    CN121390817A

  • A geospatial analysis agent system and method based on large models

    CN121390817B