Map interaction system and method based on large language model and MCP protocol

By using a map interaction system based on a large language model and the MCP protocol, the shortcomings of existing GIS technologies in natural language understanding and cross-platform interoperability are solved. This enables users to perform map operations driven by natural language, improving the flexibility of interaction and the compatibility of the system.

CN120949974AActive Publication Date: 2025-11-14AEROSPACE INFORMATION RES INST CAS
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511476632.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2025-11-14
Estimated Expiration
2045-10-16

AI Technical Summary

Technical Problem

Existing GIS map interaction technologies have significant shortcomings in terms of intelligence, flexibility, and standardization, especially in understanding and responding to human natural language commands, achieving cross-platform interaction, and reducing operational barriers, making it difficult to meet diverse and personalized interaction needs.

Method used

The map interaction system based on the large language model and MCP protocol includes a web front-end, a GIS service back-end, a large language model service module, an MCP client, and an MCP server. It realizes natural language-driven map operations through WebSocket long connection and server push event mechanism. Combined with the MCP protocol to define standardized interaction tool interfaces, it achieves cross-platform compatibility and scalability.

Benefits of technology

It enables users to efficiently manipulate GIS maps using natural language, eliminating reliance on mice, keyboards, or fixed command templates, improving the flexibility and accuracy of interaction, and ensuring cross-platform compatibility and system scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120949974A_ABST
    Figure CN120949974A_ABST
Patent Text Reader

Abstract

The invention provides a map interaction system and method based on a large language model and an MCP protocol, and belongs to the field of spatial information processing and artificial intelligence interaction.The map interaction system comprises a WEB front end, a GIS service rear end, a large language model service module, an MCP client side and an MCP server side; wherein the WEB front end is used for providing a user natural language dialogue interface and map interactive display; the GIS service rear end is used for integrating the MCP tool and the large language model service and providing a service interface required by the WEB front end; the large language model service module is used for understanding a natural language of a user and reasoning out an MCP tool needing to be used; the MCP client is used for querying a tool defined by the MCP service and executing MCP tool calling; the MCP server side is used for providing MCP tool definition and service and distributing a map interaction instruction to the WEB front end. Semantics are analyzed through a large language model, a tool calling request is generated, and automatic recognition is achieved in combination with cooperation of an MCP client side and a server side.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of spatial information processing and artificial intelligence interaction technology, specifically relating to a map interaction system and method based on a large language model and the MCP protocol. Background Technology

[0002] In today's digital age, where the digital space increasingly serves as a daily decision-making environment, maps are no longer just static base maps to be "looked at," but dynamic interfaces that can respond instantly when "spoken." However, in reality, GIS interaction remains stuck in a three-point line mode of "hand-eye-device": users must drag with a mouse, zoom with a scroll wheel, or make fixed gestures on a touchscreen to make the map change accordingly. This "hands-free" approach is a habit for professional operators, but a barrier for the general public—complex control layouts and obscure icons often deter first-time users.

[0003] In certain scenarios (such as in-vehicle navigation systems), some technologies attempt to achieve map operations through voice interaction, such as setting navigation routes or querying locations via predefined voice commands. However, the functionality of such voice interaction systems is limited to a fixed set of commands, capable of recognizing only commands in specific formats, and lacking a deep understanding of natural language. Once the user's expression deviates from the preset command template (such as changes in wording or semantic complexity), the system often fails to parse or respond correctly, leading to interaction failure. These technologies have significant shortcomings in flexibility and intelligence, making it difficult to meet diverse and personalized interaction needs.

[0004] Furthermore, existing technologies also have limitations in terms of standardization and scalability of map interaction. The interaction logic of traditional GIS systems is often bound to specific platforms or devices, lacking a unified interface standard and limiting cross-system and cross-platform interoperability. MCP (Model Context Protocol), as an open protocol, offers a new approach to solving this problem. MCP provides a standardized technical framework for integrating AI models with external data sources and tools by standardizing the context passing mechanism between applications and Large Language Models (LLMs), similar to how a USB-C port provides a unified interface for device connection. However, existing technologies have not fully utilized the potential of the MCP protocol; combining it with Large Language Models to achieve natural language-driven GIS map interaction remains a technological gap.

[0005] Existing GIS map interaction technologies have significant shortcomings in terms of intelligence, flexibility, and standardization, especially in understanding and responding to human natural language commands, achieving cross-platform interaction, and reducing operational barriers. Innovative solutions are urgently needed to overcome these limitations.

[0006] Existing Geographic Information System (GIS) map interaction technologies suffer from significant shortcomings in terms of intelligence, flexibility, and user experience. First, traditional interaction methods primarily rely on physical operations such as mice, keyboards, or touchscreens. Users must trigger map state changes through predefined gestures or buttons, such as dragging, scrolling, and zooming. This approach is complex, has a steep learning curve, and is particularly difficult for non-professional users to quickly master, and it cannot respond to complex semantic intents. Second, some systems' voice interaction functions are limited to fixed command sets, only recognizing commands in specific formats and lacking a deep understanding of natural language. When user expressions change slightly or commands involve multiple steps, the system often fails to accurately parse or execute them, resulting in low interaction efficiency. Furthermore, the interaction logic of existing technologies is typically tied to specific platforms or devices, lacking standardized interface specifications, limiting cross-system integration and functional expansion, and making it difficult to adapt to diverse application scenarios. These limitations severely restrict the widespread application of GIS technology in fields such as smart cities and emergency management. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention proposes a map interaction system and method based on a large language model and the MCP protocol, aiming to solve the challenges of natural language-driven map interaction. The specific technical solution is as follows:

[0008] A map interaction system based on a large language model and the MCP protocol includes a web front-end, a GIS service back-end, a large language model service module, an MCP client, and an MCP server; among which,

[0009] The web front-end is used to provide users with a natural language dialogue interface and map interaction display;

[0010] The GIS service backend is used to integrate MCP tools and large language model services and provide the service interfaces required by the web frontend;

[0011] The Large Language Model Service module is used to understand the user's natural language and infer the MCP tools needed.

[0012] The MCP client is used to query the tools defined in the MCP service and execute MCP tool calls;

[0013] The MCP server is used to provide MCP tool definitions and services and distribute map interaction commands to the web front end.

[0014] A map interaction method based on a large language model and the MCP protocol includes the following steps:

[0015] After a user accesses the web frontend through a browser, the web frontend establishes a WebSocket long connection with the MCP server, generating and recording the session;

[0016] Users input natural language requests in the web front-end dialog window using text or voice, and the web front-end encapsulates these requests into a natural dialogue request from the user.

[0017] After receiving the user's natural dialogue request, the GIS service backend immediately calls the MCP client, which requests and obtains the MCP map interaction tool definition list from the MCP server.

[0018] The GIS service backend encapsulates the tool definition list and the user's natural dialogue request together into a large language dialogue service request and sends it to the large language model service module.

[0019] The large language model service module parses the large language dialogue service request and returns the dialogue result. The GIS service backend parses the tool call array tool_calls in the result.

[0020] If the tool call array tool_calls exists, the GIS service backend iterates through the array and sends MCP tool call requests to the MCP server one by one via the MCP client, and writes session parameters into the parameters of each request;

[0021] Based on the session parameters, the MCP server distributes map interaction commands to the web front-end using the MCP service and web front-end communication message structure.

[0022] The web front-end parses and executes the map interaction command, driving the map component to complete the corresponding operation;

[0023] The MCP server returns the execution results to the MCP client, and the GIS service backend records and merges all tool call results.

[0024] The GIS service backend encapsulates the merged results and the dialogue results from the large language model and sends them to the web frontend, which then displays them in the dialogue window.

[0025] The present invention has the following beneficial effects:

[0026] The system of this invention uses a large language model with tool calling capabilities as a "translator" to instantly break down the colloquial phrase "zoom in on the Beijing map" into precise actions that can be directly executed by GIS components, completely eliminating the dependence on mouse, keyboard or fixed command templates and achieving a zero-threshold experience of "operating the map by speaking a sentence".

[0027] This invention extends the MCP (Model Context Protocol) to define standardized map interaction tool interfaces (such as zoom, pan, and position), enabling efficient integration between large language models and GIS systems, and ensuring cross-platform and cross-system compatibility and scalability.

[0028] This invention employs a collaborative approach involving a web front-end, a GIS service back-end, a large language model service, an MCP client, and an MCP server. Through WebSocket long connections and server push event (SSE) mechanisms, it achieves real-time command transmission and high-efficiency response.

[0029] This invention parses complex semantics using a large language model and generates tool call requests. Combined with the collaboration between the MCP client and server, it achieves an end-to-end automated process from user intent to map operation, improving the flexibility and accuracy of interaction.

[0030] This invention utilizes the natural language processing capabilities of large language models and the standardized context passing mechanism of the MCP protocol to enable users to drive intelligent interaction of GIS maps through natural language dialogue, including map display, zooming, panning, positioning, and advanced business function operations, providing an innovative technical solution for the efficient utilization of spatial information and intelligent human-computer interaction. Attached Figure Description

[0031] Figure 1 This is a structural diagram of the map interaction system based on the large language model and MCP protocol of the present invention;

[0032] Figure 2 This is a flowchart of the map interaction method based on the large language model and MCP protocol of the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other. To achieve the above objectives, this invention adopts the following technical solution.

[0034] In the description of this invention, it should be understood that the terms "upper," "lower," "top," "bottom," "inner," and "outer," etc., used in this invention to indicate orientation or positional relationships are based on the orientation or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0035] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0036] This invention proposes a map interaction system based on a large language model and the MCP protocol, achieving intelligent map interaction through deep integration of natural language processing and standardized protocols. Furthermore, this invention proposes a GIS map interaction method based on a large language model and the MCP protocol. This system includes a web front-end, a GIS service back-end, a large language model service module, an MCP client, and an MCP server. These modules work collaboratively to ensure that users can efficiently manipulate GIS maps and obtain dynamic spatial information through natural language commands, such as... Figure 1 As shown.

[0037] The web front-end is used to provide users with a natural language dialogue interface and map interaction display;

[0038] The GIS service backend is used to integrate MCP tools and large language model services and provide the service interfaces required by the web frontend;

[0039] The Large Language Model Service module is used to understand the user's natural language and infer the MCP tools needed.

[0040] The MCP client is used to query the tools defined in the MCP service and execute MCP tool calls;

[0041] The MCP server is used to provide MCP tool definitions and services and distribute map interaction commands to the web front end.

[0042] The web front-end is the user interface, consisting of two parts: a map interaction module and a dialog window module. The map interaction module, based on standard GIS map components, is responsible for rendering the map, displaying GIS data, and listening for and executing map operation commands such as zooming, panning, and positioning in real time via a WebSocket connection established with the MCP server. WebSocket is a protocol that maintains a long TCP connection between the client and server. The dialog window module provides the user's interaction entry point with the large language model, supporting text or voice input. It is responsible for encapsulating user natural language commands into interface requests and sending them to the GIS service backend, while simultaneously displaying the dialogue results, ensuring intuitive and smooth interaction.

[0043] The GIS service backend, acting as the data and logic hub, undertakes multiple functions. First, it integrates GIS data query services, providing spatial data retrieval and processing capabilities. Second, it interfaces with the large language model service module through a proxy interface, transmitting user commands and model responses. Furthermore, it embeds the MCP client, responsible for calling the map interaction tools of the MCP server to achieve precise mapping from commands to operations. This GIS server, through efficient data integration and communication mechanisms, ensures the system's stability and response speed in complex business scenarios.

[0044] The large language model service module, based on a large language model that supports tool calls (such as a model deployed via Ollam or OpenAPI standard interfaces), provides powerful natural language understanding and logical reasoning capabilities. It can parse the complex semantics of user input, generate corresponding tool call instructions, and, through collaboration with the MCP client, translate semantic intent into specific map operation requests, providing the core driving force for the system's intelligent interaction.

[0045] The MCP client acts as a bridge between the large language model and the MCP server, responsible for receiving tool call requests returned by the large language model and executing the corresponding service calls according to the MCP protocol standard. It ensures the accuracy and real-time performance of command transmission through an efficient request parsing and forwarding mechanism.

[0046] The MCP server provides standardized map interaction tools, defining operation interfaces (such as map zooming and positioning) that conform to the MCP protocol. It distributes tool call requests to the map component on the web front end via WebSocket long connections and supports real-time responses using Server Push Events (SSE), ensuring efficient execution of interaction commands and system scalability.

[0047] The aforementioned components, through modular design and seamless collaboration of standardized protocols, construct a highly integrated and scalable GIS map interaction system.

[0048] This invention proposes a map interaction method based on a large language model and the MCP protocol, which drives map interaction behavior through natural language commands. The following details the system preparation and map interaction process, as follows: Figure 2 As shown, this demonstrates the collaboration and data flow between the various components.

[0049] To ensure the system functions properly, the following initialization steps must be completed:

[0050] 1. Launch the Large Language Model Service Module: Deploy a large language model that supports tool invocation functionality, using the Ollam framework combined with the Qwen2.5 model as an example. This large language model can parse user natural language commands and generate tool invocation requests, providing core support for intelligent interaction.

[0051] 2. Start the MCP server: The MCP server works in conjunction with the map component of the web front-end, defining map interaction tools that conform to the MCP protocol standard, such as map zooming, panning, and positioning functions. The MCP server provides real-time service through the Server Push Event (SSE) mechanism, ensuring efficient command response and distribution.

[0052] 3. Start the GIS service backend: As the system hub, the GIS service backend acts as the proxy for the dialogue interface of the large language model service module, and establishes a communication connection with the MCP server through the integrated MCP client, and is responsible for data query, command transmission and result integration.

[0053] The following is a detailed process of map interaction, which combines the collaboration of various components to achieve a complete closed loop from user natural language commands to map operations.

[0054] [1]: Access via browser;

[0055] Users access the web front-end through a browser and enter the interactive interface.

[0056] [2]: Establish a WebSocket connection and create a session <uuid>;

[0057] The web front-end and the MCP server establish a long connection via the WebSocket protocol, generating a unique session ID. <uuid>), and wait to execute the map operation instructions distributed by the MCP server.

[0058] [3]: Dialogue description;

[0059] Users can input their map interaction needs via text or voice in the dialog window of the web front end, such as "I want to see Beijing", and submit a request.

[0060] [4]: Request the server;

[0061] The WEB front end encapsulates the natural language input by the user into a natural dialogue request and sends it to the GIS service backend interface. This interface proxies the dialogue interface of the large language model service module and adds the session ID from the process [2] to the request body header. <uuid>Example: Topic-Id: <uuid>.

[0062] [5]: Call the client;

[0063] After receiving the natural dialogue request, the GIS service backend calls the integrated MCP client.

[0064] [6]: Get all tools;

[0065] The MCP client sends a request to the MCP server to retrieve all map interaction tools.

[0066] [7]: Return to all tools;

[0067] The MCP server responds to the MCP client's request to obtain all map interaction tools by returning a list of MCP map interaction tool definitions, including map operation methods and parameters.

[0068] [8]: Packaging tool description;

[0069] The GIS service backend encapsulates the list of map interaction tools obtained through the MCP client into a service request to the large language model service module.

[0070] [9]: Request large language model dialogue service;

[0071] The GIS service backend will send the large language dialogue service request, which encapsulates the tool list, to the large language model dialogue service and wait for the result to be returned.

[0072]

[10] : Returns the dialogue results from the large language model;

[0073] After receiving a dialogue service request, the large language model service understands the user's natural language intent and infers the result, then returns the dialogue result to the GIS service backend.

[0074]

[11] : Parse the returned tool calls (tool_calls);

[0075] The GIS service backend parses the results returned by the large language model service and determines whether the results contain the tool call array `tool_calls`. The `tool_calls` array contains a set of MCP tool methods and parameters inferred by the large language model based on user input requests. If the `tool_calls` array exists, it iterates through the array, extracts the calling methods and parameters, and initiates the call through the MCP client.

[0076]

[12] : Call the client;

[0077] The GIS service backend loops through the tool call array `tool_calls` and calls the MCP client.

[0078]

[13] : Execution tool call;

[0079] The MCP client sends an MCP tool invocation request to the MCP server based on the transmitted MCP tool method and parameters. The session parameter `topicId` is added to the parameters of the MCP tool invocation request. <uuid>This parameter comes from the Topic-Id parameter in the request body header of the process [4].

[0080]

[14] : Push map interaction commands to <uuid>Conversation;

[0081] After receiving the MCP client tool call request, the MCP server distributes the map interaction instructions to the web frontend of the WebSocket long connection session corresponding to the Topic-Id according to the Topic-Id session parameter Topic-Id, using the communication message structure between the MCP server and the web frontend.

[0082]

[15] : Execute map interaction commands;

[0083] After receiving the map interaction command distributed via the WebSocket long connection, the web frontend parses the corresponding method and parameters, and operates the map component to execute the command, such as moving or zooming.

[0084]

[16] : Changes in map browsing interaction;

[0085] Users observe the view changes of the web front-end map component after executing map interaction commands distributed by the MCP server.

[0086]

[17] : Returns the result of the tool call;

[0087] The MCP server will distribute the results of the map interaction commands and return them to the MCP client.

[0088]

[18] : Record the results of the tool call;

[0089] The GIS service backend records the results of the MCP client's execution tool calls.

[0090]

[19] : Merge call results;

[0091] After completing the loop through the tool call array tool_calls, the GIS service backend merges the results of the calls executed by the MCP client.

[0092]

[20] : Responding to a dialogue request;

[0093] The GIS service backend merges the results of the tool call array (tool_calls) with the results of the dialogue with the large language model service module, and then responds to the web frontend.

[0094]

[21] : Display the dialogue results;

[0095] The web frontend displays the returned dialog results in a dialog box, which includes the call results for each tool in the tool call array tool_calls.

[0096]

[22] : Browse the dialogue results;

[0097] Users can view the text record of the results of this conversation in the chat window on the web front end.

[0098] Throughout the map interaction process, the data information that needs to be transmitted includes: user natural dialogue requests, MCP map interaction tool definitions, large language dialogue service requests, MCP tool call requests, and communication messages between the MCP server and the web frontend. The specific content is as follows:

[0099] (1) User natural dialogue request

[0100] The user-input dialogue content is a text string. When it is passed to the backend service, it needs to be encapsulated into JSON data suitable for calling the large language model interface. The specific format of the user's natural dialogue request is as follows: POST / agent / api / chat Topic-Id: <uuid> { model: "qwen2.5", messages: [{ role: "user", Content: "I want to see Beijing" }], }

[0101] The above request indicates that an HTTP request is sent via the POST method to the GIS service backend interface address / agent / api / chat. The request content is a JSON string, where the `model` field defines the name of the large language model to be used, and the `messages` field represents an array of dialogue content. Within each dialogue content in the array, the `role` field defines the context content type, with a value of `user` indicating user input, and the `content` field defines the text content. In the example above, the `content` field contains "I want to see Beijing," which represents the user's natural language interaction request text content.

[0102] To ensure that the MCP server can distribute map interaction commands to the correct web frontend, a unique session ID for the WebSocket long-lived connection established between the web frontend and the MCP service backend needs to be added to the HTTP request header: Topic-Id. <uuid>.

[0103] (2) Definition of MCP map interaction tool

[0104] In the MCP server, map interaction tools need to be defined so that the large language model can understand and call them later. This includes the tool name and related parameters. Below is an example of defining an MCP map interaction tool that allows the user to fly to a specific coordinate: { 'type': 'function', 'function': { 'name': 'flyTo', 'description': 'Fly to a certain coordinate', 'parameters': { 'type': 'object', 'properties': { 'lng': { 'type': 'number', 'description': 'WGS84 location longitude coordinates', }, 'lat': { 'type': 'number', 'description': 'WGS84 location latitude and longitude coordinates', }, 'zoom': { 'type': 'number', 'description': 'Target location zoomed to map level', }, 'topicId': { 'type': 'string', 'description': 'session UUID', } }, 'required': ['ln g ', 'lat'], }, }, }

[0105] The above structure defines a map interaction tool object. The `type` field defines the tool type, and a value of `function` indicates that this tool is a callable method. The `function` field defines the method object. Within the method object, the `name` field defines the method name, the `description` field defines a description of the tool's method to help the large language model understand the tool's function, the `parameters` field defines the parameters required by the method, and the `required` field defines an array of names of the necessary parameters. Within `parameters`, the `type` field defines the parameter type, with a value of `object` indicating that the parameter is an object. The `properties` field defines all parameters that can be passed to the tool's method. Within each parameter object, the `type` field defines the parameter's attribute type, for example, `string` represents a string type, and `number` represents a number type. The `description` field defines a description of the parameter to help the large language model understand its meaning.

[0106] The example structure above defines a map interaction tool method named flyTo. The tool's function is to make the map fly to a certain coordinate position. The parameters are lng (longitude coordinate), lat (latitude coordinate), zoom (map zoom level), and topicId (session ID), where lng and lat are required parameters.

[0107] (3) Request for large language dialogue service

[0108] Before sending the user request to the large language model service, it is necessary to obtain a list of all supported tools from the MCP server and send this list as part of the large language model request. This allows the large language model to know and understand which map interaction tools are available and to return the appropriate tools and parameters as results during inference. The specific request format is that the user request is supplemented with the tools list, as shown below: { model: "qwen2.5", messages: [{ role: "user", Content: "I want to see Beijing" }], tools: [{…}] }

[0109] This structure adds a tools field to the (1) User Natural Dialogue Request JSON content. This field represents all map interaction tool objects defined by the MCP server. It is an array composed of the structures in (2) MCP map interaction tool definition, including tool name, description, parameters, etc.

[0110] (4) MCP tool call request

[0111] The results returned by the large language model dialogue will include calls to map interaction tools, and the format of the returned results is as follows: { "model": "qwen2.5", "created_at": "2025-04-22T20:33:28.123648Z", "message": { "role": "assistant", "content": "", "tool_calls": [ { "function": { "name": "flyTo", "arguments": { "lng": 116.25, "lat": 39.26, "zoom": 12 } } } ] } }

[0112] In the above structure, the `model` field represents the name of the large language model used, the `created_at` field represents the creation time of the request, and the `message` field represents the content message returned in this response. In the `message` result, the `role` field represents the message type; a value of `assistant` indicates that this is an auxiliary message, the `content` field indicates that the text content is empty, and the `tool_calls` field represents an array of map interaction tool calls that the large language model needs to invoke after understanding the dialogue intent. Each object in the tool call array represents a method call, where the `name` field represents the name of the method to be called, and the `arguments` field represents the parameters required to call this tool method after inference by the large language model. The GIS service backend parses and iterates through the tool call array (`tools_calls`), and then calls the corresponding method on the MCP server through the MCP client, passing the parameters. The specific MCP call request content is as follows: { "name": "flyTo", "arguments": { "lng": 116.25, "lat": 39.26, "zoom": 12, "topicId": " <uuid>" } }

[0113] In the above structure, the name field represents the method name of the MCP calling tool, the arguments field represents the parameters passed by the calling tool method, the lng parameter represents the longitude, the lat parameter represents the latitude, the zoom parameter represents the map zoom level, and the topicId parameter represents the session ID from the HTTP request body header parameter Topic-Id in the process [4].

[0114] (5) Communication messages between MCP service and WEB front end

[0115] After the MCP service receives a tool call request from the MCP client, it parses the topicId to find the corresponding WebSocket long connection established by the web frontend. Then, it sends the call method and parameters as communication message instructions through this WebSocket long connection to the web frontend. The web frontend then parses and executes the corresponding map interaction instructions. The specific communication message format is as follows: { "name": "flyTo", "arguments": { "lng": 116.25, "lat": 39.26, "zoom": 12 } }

[0116] The above structure represents the map interaction methods that the web front-end map component needs to execute, where the name field is the method name and the arguments field is the parameters of the executed method.

[0117] The example above demonstrates the execution of the map interaction method named flyTo, where the longitude parameter is 116.25, the latitude parameter is 39.26, and the map zoom level parameter is 12. After the web front-end map component parses and executes this instruction, the user can observe the changes in the web front-end map view.

[0118] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0119] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0120] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0121] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0122] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0123] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.< / uuid> < / uuid> < / uuid> < / uuid> < / uuid> < / uuid> < / uuid> < / uuid> < / uuid>

Claims

1. A map interaction system based on a large language model and the MCP protocol, characterized in that, This includes a web front-end, a GIS service back-end, a large language model service module, an MCP client, and an MCP server; among which, The web front-end is used to provide users with a natural language dialogue interface and map interaction display; The GIS service backend is used to integrate MCP tools and large language model services and provide the service interfaces required by the web frontend. The Large Language Model Service module is used to understand the user's natural language and infer the MCP tools needed. The MCP client is used to query the tools defined in the MCP service and execute MCP tool calls; The MCP server is used to provide MCP tool definitions and services and distribute map interaction commands to the web front end.

2. The map interaction system based on a large language model and MCP protocol according to claim 1, characterized in that, The web front-end consists of two parts: a map interaction module and a dialog window module. The map interaction module is based on standard GIS map components and is used to render maps and display GIS data. It also listens for and executes map operation commands in real time through a WebSocket connection established with the MCP server. The dialog window module provides an interaction entry point for users to interact with the large language model. It supports text or voice input and is used to encapsulate users' natural language commands into interface requests and send them to the GIS service backend to display the dialogue results.

3. The map interaction system based on a large language model and MCP protocol according to claim 1, characterized in that, The GIS service backend integrates GIS data query services, providing spatial data retrieval and processing capabilities. The GIS service backend interfaces with the large language model service module through a proxy interface to transmit user commands and model responses. The GIS service backend embeds an MCP client, which is used to call the map interaction tools of the MCP server.

4. A map interaction system based on a large language model and MCP protocol according to claim 1, characterized in that, The large language model service module is based on a large language model that supports tool calls. It provides natural language understanding and logical reasoning capabilities, parses the semantics of user input, generates corresponding tool call instructions, and transforms semantic intent into specific map operation requests through collaboration with the MCP client.

5. A map interaction system based on a large language model and MCP protocol according to claim 1, characterized in that, The MCP client connects the large language model service module and the MCP server, and is used to receive tool call requests returned by the large language model and execute the corresponding service calls according to the MCP protocol standard.

6. A map interaction system based on a large language model and MCP protocol according to claim 1, characterized in that, The MCP server provides standardized map interaction tool services, defines operation interfaces that conform to the MCP protocol, distributes tool call requests to the map component of the web front end through WebSocket connections, and supports real-time response by pushing events from the server.

7. A map interaction system based on a large language model and MCP protocol according to claim 2, characterized in that, Map operation commands include zoom, pan, and position.

8. A map interaction method based on a large language model and the MCP protocol, characterized in that, Includes the following steps: After a user accesses the web frontend through a browser, the web frontend establishes a WebSocket long connection with the MCP server, generating and recording the session; Users input natural language requests in the web front-end dialog window using text or voice, and the web front-end encapsulates these requests into a natural dialogue request from the user. After receiving the user's natural dialogue request, the GIS service backend immediately calls the MCP client, which requests and obtains the MCP map interaction tool definition list from the MCP server. The GIS service backend encapsulates the tool definition list and the user's natural dialogue request together into a large language dialogue service request and sends it to the large language model service module. The large language model service module parses the large language dialogue service request and returns the dialogue result. The GIS service backend parses the tool call array tool_calls in the result. If the tool call array tool_calls exists, the GIS service backend iterates through the array and sends MCP tool call requests to the MCP server one by one via the MCP client, and writes session parameters into the parameters of each request; Based on the session parameters, the MCP server distributes map interaction commands to the web front-end using the MCP service and web front-end communication message structure. The web front-end parses and executes the map interaction command, driving the map component to complete the corresponding operation; The MCP server returns the execution results to the MCP client, and the GIS service backend records and merges all tool call results. The GIS service backend encapsulates the merged results and the dialogue results from the large language model and sends them to the web frontend, which then displays them in the dialogue window.

9. A map interaction method based on a large language model and MCP protocol according to claim 8, characterized in that, User natural dialogue requests are used to encapsulate the dialogue content in the form of text strings entered by the user into JSON data suitable for calling the large language model interface.

10. A map interaction method based on a large language model and MCP protocol according to claim 8, characterized in that, The MCP map interaction tool definition includes the tool name and related parameters.

Citation Information

Patent Citations

  • Conversational GIS visual scene generation method and system based on LLM large model

    CN120541135A

  • Method and system for dynamically calling Java statistical analysis interface based on LLM and MCP

    CN120560800A

  • System for intelligent interaction of software as service platform

    CN120611027A

  • Cloud mobile phone control system based on large language model

    CN120658720A

  • Using language models to verify map data in map generation systems and applications

    US20240419904A1