A multi-stage-based spatial data intelligent analysis method, device and equipment
By parsing user intent and generating execution plans using a large language model, and combining closed-loop iterative optimization of subtasks, automated analysis of natural resource spatial data has been achieved. This solves the problems of low efficiency and poor reliability of traditional manual operations, and improves analysis efficiency and result reliability.
Patent Information
- Application Number
- CN202611625208.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-20
AI Technical Summary
Traditional spatial data analysis of natural resources relies heavily on manual operation, resulting in cumbersome, time-consuming, and labor-intensive procedures that are easily affected by human intervention, making it difficult to improve the efficiency and reliability of the analysis results.
A multi-stage spatial data intelligent analysis method is adopted, which uses a large language model to parse user intent, generate an execution plan, and automatically generate analysis results of natural resource spatial data through closed-loop iterative optimization of sub-task execution, thereby reducing manual intervention.
This improves the efficiency of obtaining spatial data analysis results for natural resources, reduces time consumption, enhances the reliability of analysis results, and avoids the waste of resources by repeatedly executing completed steps.
Smart Images

Figure CN123138352A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence technology, geographic information server equipment technology, and natural language processing technology, and in particular to a method, apparatus, and device for intelligent analysis of spatial data based on multi-stage processes. Background Technology
[0002] With the deepening of the informatization of natural resource management, planning and natural resource authorities at all levels have accumulated a massive amount of natural resource spatial data, which is characterized by large data volume, heterogeneous formats, and diverse coordinate systems.
[0003] However, traditional analysis of natural resource spatial data relies heavily on manual operation by staff. This manual operation requires staff to be familiar with the operation procedures of various geographic information server software and to manually complete steps such as data loading, parameter setting, spatial calculation, and result export. This process is not only cumbersome and time-consuming, but also easily affected by human intervention, which is not conducive to improving the efficiency of obtaining analysis results of natural resource spatial data. Therefore, how to obtain analysis results of natural resource spatial data is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] This application provides a multi-stage spatial data intelligent analysis method, apparatus, and device to solve the aforementioned technical problem of how to obtain the analysis results of natural resource spatial data.
[0005] In a first aspect, embodiments of this application provide a multi-stage spatial data intelligent analysis method, applied to a server-side device, the spatial data intelligent analysis method comprising: Step S1: Obtain the spatial data analysis instructions uploaded by the user terminal device, call the large language model to perform intent parsing on the spatial data analysis instructions to obtain the user intent, use the semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of the user intent, obtain the semantic similarity between the vector of the user intent and the vector of each memory item, take the memory items with semantic similarity greater than a preset threshold as the recall results, obtain historical dialogue records, user preference information and knowledge items from the recall results, combine the historical dialogue records, user preference information and knowledge items to form auxiliary information, concatenate the user intent and auxiliary information to obtain prompt words, input the prompt words into the large language model, and generate demand understanding information, key information, task type and expected results through the large language model. Spatial data analysis instructions refer to natural language instructions for analyzing natural resource spatial data. Step S2: Based on the needs understanding information, key information, task type and expected results, decompose the user intent into multiple sub-tasks, integrate the tools corresponding to each sub-task, the pre-filled parameters corresponding to each sub-task and the historical reference information corresponding to each sub-task according to the execution order of each sub-task, and generate an execution plan. Step S3: Input the execution plan into the large language model. Through the function call mechanism of the large language model, call the tool corresponding to each subtask to execute each subtask and obtain the initial execution result of each subtask. Step S4: According to the preset checklist, check whether the initial execution result of each subtask meets the preset conditions, and generate the judgment result of each subtask; Step S5: When the judgment result of any subtask is that the preset conditions are not met, the failed steps in the execution phase are obtained, the failed steps are input into the large language model, the correction plan of the failed steps is generated through the large language model, the correction plan of the failed steps is fed back to the planning phase, and steps S3 to S5 are re-executed to form a closed loop iteration. The core function of feeding back the correction plan for failed steps to the planning stage of step 2 is to enable the server-side equipment to replan with minimal changes, accurately repair failed steps, and keep successful steps unchanged. This effectively avoids the waste of time and computing resources caused by repeatedly executing completed steps.
[0006] Step S6: When the number of closed-loop iterations reaches the preset maximum iteration threshold, exit the closed-loop iteration, obtain the final execution result of each subtask from the output data of the large language model, integrate the final execution results of each subtask, and generate the analysis results of natural resource spatial data.
[0007] In one possible implementation of the first aspect, spatial data analysis instructions uploaded by the user's terminal device are obtained. A large language model is invoked to parse the spatial data analysis instructions to obtain the user's intent. In the long-term memory table, a semantic similarity model is used to perform similarity retrieval on the vector of the user's intent, obtaining the semantic similarity between the vector of the user's intent and the vector of each memory item. Memory items with semantic similarity greater than a preset threshold are used as recall results. Historical dialogue records, user preference information, and knowledge items are obtained from the recall results. These historical dialogue records, user preference information, and knowledge items are combined to form auxiliary information. The user's intent and auxiliary information are concatenated to obtain prompt words. The prompt words are input into the large language model, which generates demand understanding information, key information, task type, and expected results. Spatial data analysis instructions refer to natural language instructions for analyzing natural resource spatial data, including: The system acquires spatial data analysis instructions uploaded by user devices, calls a large language model to parse the spatial data analysis instructions to obtain user intent, uses a semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of user intent, obtains the semantic similarity between the vector of user intent and the vector of each memory item, and uses memory items with semantic similarity greater than a preset threshold as recall results. From the recall results, the system obtains historical dialogue records, user preference information and knowledge items, combines historical dialogue records, user preference information and knowledge items to form auxiliary information, concatenates user intent and auxiliary information to obtain prompt words, inputs prompt words into the large language model, and generates demand understanding information, key information, task type and expected results through the large language model. Spatial data analysis instructions refer to natural language instructions for analyzing spatial data of natural resources. The large language model extracts regional keywords, resource type keywords, operational verbs, operational objects, time ranges, spatial coordinate parameters, and data layer names from prompts. Based on the regional keywords and resource type keywords, the scope of the natural resource spatial data is determined. The operational verbs and operational objects are combined to obtain the analysis objective. The time range, spatial coordinate parameters, and data layer names are combined to obtain key information. The large language model processes the scope and analysis objective of the natural resource spatial data to generate demand understanding information. The scope, analysis objective, and key information of the natural resource spatial data are combined into sub-tasks of the natural resource spatial data. The large language model is then used to predict the sub-tasks to obtain the expected results of the sub-tasks.
[0008] In one possible implementation of the first aspect, the user intent is decomposed into multiple subtasks. The tools corresponding to each subtask, the pre-filled parameters corresponding to each subtask, and the historical reference information corresponding to each subtask are integrated according to the execution order of each subtask to generate an execution plan, including: Based on the understanding of requirements, key information, task types, and expected results, the user intent is decomposed into multiple subtasks, resulting in a subtask sequence. The identifier and task type of each subtask are obtained from this sequence. Based on the task type, the corresponding tool is retrieved from the tool layer. Based on the identifier, the pre-filled parameters are retrieved from the parameter configuration results. The task type of each subtask is input into a long-term memory table. Historical reference information for each subtask is retrieved from the long-term memory table. Finally, the tools, pre-filled parameters, and historical reference information for each subtask are integrated according to their execution order to generate an execution plan.
[0009] In one possible implementation of the first aspect, the step of inputting the execution plan into a large language model, and using the function call mechanism of the large language model to call the tool corresponding to each subtask to execute each subtask, thereby obtaining the initial execution result of each subtask, includes: The execution plan is input into the large language model. Through the function call mechanism of the large language model, the tool corresponding to each subtask is called, and the call result of each subtask is obtained. When the call result of any subtask is successful, the tool corresponding to each subtask is used to execute each subtask, and the initial execution result of each subtask is obtained. When the call result of any subtask is unsuccessful, the call parameters corresponding to each subtask are retrieved from the log file, and a reflection process is performed on the call parameters corresponding to each subtask. Through the reflection process, the call parameters corresponding to each subtask are corrected, and the corrected call parameters of each subtask are obtained. Based on the corrected call parameters of each subtask, the tool corresponding to each subtask is called again to execute each subtask, and the initial execution result of each subtask is obtained.
[0010] In one possible implementation of the first aspect, when the number of closed-loop iterations reaches a preset maximum iteration threshold, the closed-loop iteration is exited, and the final execution result of each sub-task is obtained from the output data of the large language model. The final execution results of each sub-task are then integrated to generate the analysis results of the natural resource spatial data, including: The process involves obtaining the number of closed-loop iterations. When the number of iterations reaches the preset maximum iteration threshold, the closed-loop iteration is terminated. From the output data of the large language model, the final execution result of each subtask is obtained. The final execution result of the first subtask is the target vector data; the final execution result of the second subtask is the spatial coordinate data after coordinate transformation (coordinate transformation refers to transforming the spatial coordinate data of the map layer from the first coordinate system to the second coordinate system); the final execution result of the third subtask is a statistical table of the number of elements in each attribute field; the final execution result of the fourth subtask is a thematic map of attribute field distribution classification; and the final execution result of the fifth subtask is a statistical analysis report. The thematic map of attribute field distribution classification refers to a map that uses natural resource spatial data as the base map, and uses different colors, symbols, or fill styles to visualize the level of each element according to the preset attribute field classification standards, in order to intuitively show the spatial distribution range and location characteristics of each attribute field. Obtain the preset report template, fill the element quantity statistics table into the statistics section of the report template, insert the attribute field distribution classification thematic map into the chart section of the report template, fill the target vector data and coordinate-transformed spatial coordinate data into the data description section of the report template, fill the statistical analysis report into the conclusion section of the report template, and generate the analysis results of natural resource spatial data. The target vector data includes various types of spatial vector data in the field of natural resources.
[0011] In one possible implementation of the first aspect, the long-term memory table includes a dialogue memory table, a knowledge accumulation table, a user preference table, a task history table, a file memory table, and an error experience table; A dialogue memory table is used to store dialogue summaries, key points, relevant documents, and completed tasks; A knowledge accumulation table is used to store structured knowledge and is organized by topic and confidence level. A user preference table is used to store user habits in key-value pairs. The task history table stores task descriptions, tool sequences, results, and execution times. File memory table, used to store file metadata and content summary; An error experience table is used to store error types, messages, contexts, and solutions.
[0012] In one possible implementation of the first aspect, the semantic similarity model is defined as follows: ; The semantic similarity between the vector representing the user's intent and the vector of the i-th memory item; q represents the vector of user intent; The vector representing the i-th memory item.
[0013] In one possible implementation of the first aspect, the toolset includes GIS tools, reporting tools, document tools, device tools, general tools, research tools, charting tools, search tools, and custom skills tools; The GIS tool supports Shapefile, GeoJSON, CSV, KML, GeoPackage, and GeoTIFF formats. GIS tools include data loading tools, layer management tools, spatial analysis tools, thematic map tools, coordinate system conversion tools, map display tools, feature query tools, and geocoding tools; The thematic map creation tool supports four types of thematic maps: hierarchical color maps, category maps, hierarchical symbol maps, and heat maps. The hierarchical color map uses coloring based on attribute field values and supports three classification methods: quantile method, equal interval method, and natural break method. The natural break method aims to minimize the sum of squared deviations within each class. The formula for calculating the sum of squared deviations within each class is defined as follows: ; SSD represents the sum of squared deviations within a class. The larger the sum of squared deviations within a class, the more dispersed the elements are within each class; the smaller the sum of squared deviations within a class, the more concentrated the elements are within each class. K is the number of categories. Let k be the set of elements of the kth category. Let j be the attribute value of the j-th element. is the mean of the k-th category.
[0014] Secondly, embodiments of this application provide a multi-stage spatial data intelligent analysis device, applied to a server-side device, comprising: The acquisition module is used to acquire spatial data analysis instructions uploaded by user devices, call the large language model to perform intent parsing on the spatial data analysis instructions to obtain user intent, and use a semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of user intent to obtain the semantic similarity between the vector of user intent and the vector of each memory item. Memory items with semantic similarity greater than a preset threshold are used as recall results. Historical dialogue records, user preference information and knowledge items are obtained from the recall results. Historical dialogue records, user preference information and knowledge items are combined to form auxiliary information. User intent and auxiliary information are concatenated to obtain prompt words. The prompt words are input into the large language model, and the large language model generates demand understanding information, key information, task type and expected results, and spatial data. The first generation module is used to understand information, key information, task type and expected results based on requirements, decompose user intent into multiple sub-tasks, integrate the tools corresponding to each sub-task, the pre-filled parameters corresponding to each sub-task and the historical reference information corresponding to each sub-task according to the execution order of each sub-task, and generate an execution plan. The calling module is used to input the execution plan into the large language model. Through the function call mechanism of the large language model, the tool corresponding to each subtask is called to execute each subtask and obtain the initial execution result of each subtask. The second generation module is used to check whether the initial execution result of each subtask meets the preset conditions according to the preset checklist, and generate the judgment result of each subtask. The iteration module is used to obtain the failed steps in the execution phase when the judgment result of any subtask does not meet the preset conditions, input the failed steps into the large language model, generate a correction plan for the failed steps through the large language model, feed the correction plan of the failed steps back to the planning phase, and re-execute steps S3 to S5 to form a closed loop iteration. The analysis module is used to exit the closed-loop iteration when the number of iterations reaches the preset maximum iteration threshold. It then obtains the final execution results of each subtask from the output data of the large language model, integrates the final execution results of each subtask, and generates the analysis results of the natural resource spatial data.
[0015] Thirdly, embodiments of this application provide a server device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the spatial data intelligent analysis method described in the first aspect above.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the spatial data intelligent analysis method described in the first aspect above.
[0017] Fifthly, embodiments of this application provide a computer program product that, when run on a server device, causes the server device to execute the spatial data intelligent analysis method described in the first aspect.
[0018] The beneficial effects of the embodiments of this application are as follows: Firstly, when the number of closed-loop iterations reaches the preset maximum iteration threshold, the closed-loop iteration is exited. The final execution results of each subtask are obtained from the output data of the large language model. The final execution results of each subtask are integrated to generate the analysis results of natural resource spatial data. Since it does not rely on manual operation by staff, the time for obtaining the analysis results of natural resource spatial data is reduced, which is conducive to improving the efficiency of obtaining the analysis results of natural resource spatial data. Secondly, since the analysis results of the automatically generated natural resource spatial data are not affected by human intervention, it is beneficial to improve the reliability of the analysis results of the obtained natural resource spatial data. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the spatial data intelligent analysis method provided in an embodiment of this application; Figure 2 Application scenario diagram of the spatial data intelligent analysis method provided in the embodiments of this application; Figure 3 The analysis results of displaying spatial data of natural resources provided in the embodiments of this application; Figure 4 A schematic block diagram of a spatial data intelligent analysis device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the server device provided in an embodiment of this application. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0022] The spatial data intelligent analysis method provided in this application embodiment can be applied to server-side devices, including but not limited to servers, mobile phones, tablets, and laptops. This application embodiment does not impose any restrictions on the specific type of server-side device.
[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating the spatial data intelligent analysis method provided in this application embodiment, which can be applied to server-side devices.
[0024] like Figure 1 As shown, the spatial data intelligent analysis method provided in this application includes the following steps, detailed below: Step S1: Obtain the spatial data analysis instructions uploaded by the user terminal device, call the large language model to perform intent parsing on the spatial data analysis instructions to obtain the user intent, use the semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of the user intent, obtain the semantic similarity between the vector of the user intent and the vector of each memory item, take the memory items with semantic similarity greater than a preset threshold as the recall results, obtain historical dialogue records, user preference information and knowledge items from the recall results, combine the historical dialogue records, user preference information and knowledge items to form auxiliary information, concatenate the user intent and auxiliary information to obtain prompt words, input the prompt words into the large language model, and generate demand understanding information, key information, task type and expected results through the large language model. Spatial data analysis instructions refer to natural language instructions for analyzing natural resource spatial data. Step S1 includes: The system acquires spatial data analysis instructions uploaded by user devices, calls a large language model to parse the spatial data analysis instructions to obtain user intent, uses a semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of user intent, obtains the semantic similarity between the vector of user intent and the vector of each memory item, and uses memory items with semantic similarity greater than a preset threshold as recall results. From the recall results, the system obtains historical dialogue records, user preference information and knowledge items, combines historical dialogue records, user preference information and knowledge items to form auxiliary information, concatenates user intent and auxiliary information to obtain prompt words, inputs prompt words into the large language model, and generates demand understanding information, key information, task type and expected results through the large language model. Spatial data analysis instructions refer to natural language instructions for analyzing spatial data of natural resources. The large language model extracts regional keywords, resource type keywords, operational verbs, operational objects, time ranges, spatial coordinate parameters, and data layer names from prompts. Based on the regional keywords and resource type keywords, the scope of the natural resource spatial data is determined. The operational verbs and operational objects are combined to obtain the analysis objective. The time range, spatial coordinate parameters, and data layer names are combined to obtain key information. The large language model processes the scope and analysis objective of the natural resource spatial data to generate demand understanding information. The scope, analysis objective, and key information of the natural resource spatial data are combined into sub-tasks of the natural resource spatial data. The large language model is then used to predict the sub-tasks to obtain the expected results of the sub-tasks.
[0025] Step S2: Based on the needs understanding information, key information, task type and expected results, decompose the user intent into multiple sub-tasks, integrate the tools corresponding to each sub-task, the pre-filled parameters corresponding to each sub-task and the historical reference information corresponding to each sub-task according to the execution order of each sub-task, and generate an execution plan. This process involves breaking down user intent into multiple subtasks based on needs understanding, key information, task type, and expected results. The tools, pre-filled parameters, and historical reference information for each subtask are then integrated according to their execution order to generate an execution plan, including: Based on the understanding of requirements, key information, task types, and expected results, the user intent is decomposed into multiple subtasks, resulting in a subtask sequence. The identifier and task type of each subtask are obtained from this sequence. Based on the task type, the corresponding tool is retrieved from the tool layer. Based on the identifier, the pre-filled parameters are retrieved from the parameter configuration results. The task type of each subtask is input into a long-term memory table. Historical reference information for each subtask is retrieved from the long-term memory table. Finally, the tools, pre-filled parameters, and historical reference information for each subtask are integrated according to their execution order to generate an execution plan.
[0026] The long-term memory table includes a dialogue memory table, a knowledge accumulation table, a user preference table, a task history table, a document memory table, and an error experience table. A dialogue memory table is used to store dialogue summaries, key points, relevant documents, and completed tasks; A knowledge accumulation table is used to store structured knowledge and is organized by topic and confidence level. A user preference table is used to store user habits in key-value pairs. The task history table stores task descriptions, tool sequences, results, and execution times. File memory table, used to store file metadata and content summary; An error experience table is used to store error types, messages, contexts, and solutions.
[0027] The semantic similarity model is defined as follows: ; The semantic similarity between the vector representing the user's intent and the vector of the i-th memory item; q represents the vector of user intent; The vector representing the i-th memory item.
[0028] The toolset includes GIS tools, reporting tools, document tools, device tools, general tools, research tools, charting tools, search tools, and custom skills tools. The GIS tool supports Shapefile, GeoJSON, CSV, KML, GeoPackage, and GeoTIFF formats. GIS tools include data loading tools, layer management tools, spatial analysis tools, thematic map tools, coordinate system conversion tools, map display tools, feature query tools, and geocoding tools; The thematic map creation tool supports four types of thematic maps: hierarchical color maps, category maps, hierarchical symbol maps, and heat maps. The hierarchical color map uses coloring based on attribute field values and supports three classification methods: quantile method, equal interval method, and natural break method. The natural break method aims to minimize the sum of squared deviations within each class. The formula for calculating the sum of squared deviations within each class is defined as follows: ; SSD represents the sum of squared deviations within a class. The larger the sum of squared deviations within a class, the more dispersed the elements are within each class; the smaller the sum of squared deviations within a class, the more concentrated the elements are within each class. K is the number of categories. Let k be the set of elements of the kth category. Let j be the attribute value of the j-th element. is the mean of the k-th category.
[0029] Shapefile refers to a file format for storing vector spatial data; GeoJSON is a file format for encoding geospatial data based on JSON format. CSV is a file format that stores tabular data in plain text. KML refers to a file format based on XML for expressing geographic annotation and visualization data; GeoPackage refers to a file format for storing geospatial data based on an SQLite database. GeoTIFF is a raster image file format that contains geographic coordinate information.
[0030] A hierarchical color map is a map that divides data into several levels according to their numerical values, and assigns different colors to each level to represent them. It is used to show the spatial distribution differences of data.
[0031] A classification map is a map that divides data according to category attributes, using different colors or symbols to represent different categories, and is used to show the type classification of geographic features. A rank symbol map is a map that uses symbols of different sizes to represent data ranks or numerical values, with the symbol size increasing as the value increases, and is used to visually compare the relative magnitudes of different locations.
[0032] A heatmap is a map that displays the density or intensity distribution of data through changes in color density or brightness; the darker or brighter the color, the higher the value or the greater the density. The tools include: reporting tools for generating statistical analysis reports; document tools for parsing and structuring documents; device tools for interacting with external hardware; general tools for providing data format conversion, data validation, and data storage functions; research tools for executing research and analysis algorithms; charting tools for generating statistical charts; and search tools for retrieving target data from preset data sources.
[0033] The data loading tool is used to load GIS data files stored on the server, and supports specifying file type, layer name and coordinate system; Layer management tools are used to list, load, and query layer metadata and field information; Spatial analysis tools are used to perform buffer analysis, overlay analysis, and spatial statistics; Thematic map tools are used to create spatial thematic maps; Coordinate system transformation tool, used to transform the coordinate system of layers; A map display tool used to display specified layers on a map and return them in GeoJSON format; Feature query tool, used to support attribute query and spatial query; Geocoding tools are used to convert address strings into geographic coordinates.
[0034] Custom skill tools refer to new tools that users define themselves through JSON configuration files and can be dynamically loaded into the device's toolset.
[0035] For ease of explanation, the following example is provided: Users create custom skill tools through JSON configuration files. Each custom skill tool includes a unique skill identifier, skill name, skill description, parameter definitions, processor type, processor configuration, and activation status. Processor types include Hypertext Transfer Protocol (HTTP) skills, web hook skills, and script skills.
[0036] The Hypertext Transfer Protocol (HTTP) is used to call external services through the REST application programming interface. During execution, the server device sends the technical parameters as query parameters or request body to the external service.
[0037] The network hook skill is used to call external network hook services in an event-driven manner. When executed, the server-side device constructs a payload containing the event type, data, and timestamp, and sends it to the external network hook service via a POST request.
[0038] Script skills are used to execute via local scripts. During execution, the server-side device runs the local script through a subprocess, passes the skill parameters to the script in JSON format, and returns the script execution result as the execution result.
[0039] Skill configuration files are stored in isolation by user. When a user initiates a conversation, the server dynamically loads all of that user's enabled skills through the user's client device and adds the enabled skills to the toolset. Skill loading is completed at runtime, without requiring modification of the server-side device code or a service restart.
[0040] The server-side device automatically converts the JSON configuration of user-defined skills into the function call tool definition format of the large language model. The converted tool definition is managed uniformly with the built-in tools of the server-side device. The server-side device assigns the custom skill tool to the corresponding processor for execution based on the processor type and returns the execution result to the large language model.
[0041] Step S3: Input the execution plan into the large language model. Through the function call mechanism of the large language model, call the tool corresponding to each subtask to execute each subtask and obtain the initial execution result of each subtask. The process of inputting the execution plan into the large language model, and using the function call mechanism of the large language model to call the tool corresponding to each subtask to execute each subtask, and obtaining the initial execution result of each subtask, includes: The execution plan is input into the large language model. Through the function call mechanism of the large language model, the tool corresponding to each subtask is called, and the call result of each subtask is obtained. When the call result of any subtask is successful, the tool corresponding to each subtask is used to execute each subtask, and the initial execution result of each subtask is obtained. When the call result of any subtask is unsuccessful, the call parameters corresponding to each subtask are retrieved from the log file, and a reflection process is performed on the call parameters corresponding to each subtask. Through the reflection process, the call parameters corresponding to each subtask are corrected, and the corrected call parameters of each subtask are obtained. Based on the corrected call parameters of each subtask, the tool corresponding to each subtask is called again to execute each subtask, and the initial execution result of each subtask is obtained.
[0042] The remorse process includes error persistence, historical solution retrieval, parameter correction and retries, and degradation handling. Error persistence: When a tool call fails, the error type, error message, error context, tool name, and whether it has been resolved are saved to the error experience table; Historical Solution Retrieval: Search the error experience database for historical records that have been resolved and have the same name and error type as the current tool, as a reference solution; Parameter correction and retry: The solution recorded in the reference scheme is applied first; if the reference scheme is unavailable, a preset correction strategy is executed according to the error type. The preset correction strategy includes layer identifier correction, file path correction and coordinate system correction, and then the tool call is re-executed with the corrected parameters. Degradation processing: When the number of consecutive failures reaches the degradation threshold, a degradation instruction is sent to the large language model, which is used to indicate the use of alternative tools.
[0043] Step S4: According to the preset checklist, check whether the initial execution result of each subtask meets the preset conditions, and generate the judgment result of each subtask; The server device obtains a preset checklist, which contains check items and preset conditions corresponding to each subtask. The server device traverses the subtask sequence, sequentially extracts one subtask as the current subtask, obtains the initial execution result of the current subtask, extracts the check items and preset conditions corresponding to the current subtask from the preset checklist, and compares the initial execution result of the current subtask with the corresponding preset conditions.
[0044] When the initial execution result meets the preset conditions, the server device marks the current subtask's check result as satisfied; when the initial execution result does not meet the preset conditions, the server device marks the current subtask's check result as unsatisfied and records the reason for the unsatisfiedness.
[0045] The server repeats the above operations until all subtasks in the subtask sequence have been checked, generating a judgment result for each subtask. The judgment result for each subtask includes a subtask identifier, an inspection result marker, and a reason record.
[0046] For ease of explanation, the following example is provided: For example, the subtask is "Load data of the target protected area," and the corresponding preset condition is "number of features greater than 0." The server device obtains the initial execution result of this subtask, which includes the loaded data and the number of features. The server device reads the number of features as 15 from the initial execution result, compares 15 with the preset condition "greater than 0," and finds that 15 is greater than 0, thus satisfying the preset condition. The server device then marks the subtask's check result as satisfied.
[0047] For example, the subtask is "count the number of elements in each attribute field," and the corresponding preset condition is "the statistics table is not empty." The server device obtains the initial execution result of this subtask, which includes the statistics table. The server device checks whether the statistics table is empty. The statistics table contains statistical data for 5 attribute fields and is not empty, thus meeting the preset condition. The server device then marks the check result of this subtask as satisfied.
[0048] For example, the subtask is "Generate thematic map," and the corresponding preset condition is "Thematic map file exists." The server device obtains the initial execution result of this subtask, which includes the storage status of the thematic map file. The server device checks whether the thematic map file exists. If the thematic map file exists, the server device marks the subtask's check result as satisfied; if the thematic map file does not exist, the server device marks the subtask's check result as unsatisfactory and records the reason as "Thematic map file not generated."
[0049] For example, a subtask might be "Generate a statistical analysis report," with the corresponding preset condition being "the report file format is a word processing software format." The server device obtains the initial execution result of this subtask, which includes the report file's format information. The server device checks whether the report file format is a word processing software format. If the report file format is a word processing software format, the server device marks the subtask's check result as satisfied; if the report file format is not a word processing software format, the server device marks the subtask's check result as unsatisfactory and records the reason as "the report file format is incorrect; it was expected to be a word processing software format."
[0050] After the server-side device has traversed all subtasks, it summarizes the inspection results of all subtasks and generates a judgment result. If the inspection results of all subtasks are marked as satisfactory, the overall judgment result is satisfactory. If the inspection results of one or more subtasks are marked as unsatisfactory, the overall judgment result is unsatisfactory, and all reasons for unsatisfactory are summarized as the basis for generating a revised execution plan in the subsequent improvement phase.
[0051] Step S5: When the judgment result of any subtask is that the preset conditions are not met, the failed steps in the execution phase are obtained, the failed steps are input into the large language model, the correction plan of the failed steps is generated through the large language model, the correction plan of the failed steps is fed back to the planning phase, and steps S3 to S5 are re-executed to form a closed loop iteration. Step S6: When the number of closed-loop iterations reaches the preset maximum iteration threshold, exit the closed-loop iteration, obtain the final execution result of each subtask from the output data of the large language model, integrate the final execution results of each subtask, and generate the analysis results of natural resource spatial data.
[0052] Specifically, when the number of closed-loop iterations reaches a preset maximum iteration threshold, the closed-loop iteration is exited. The final execution results of each subtask are obtained from the output data of the large language model, and the final execution results of each subtask are integrated to generate the analysis results of natural resource spatial data, including: The process involves obtaining the number of closed-loop iterations. When the number of iterations reaches the preset maximum iteration threshold, the closed-loop iteration is terminated. From the output data of the large language model, the final execution result of each subtask is obtained. The final execution result of the first subtask is the target vector data; the final execution result of the second subtask is the spatial coordinate data after coordinate transformation (coordinate transformation refers to transforming the spatial coordinate data of the map layer from the first coordinate system to the second coordinate system); the final execution result of the third subtask is a statistical table of the number of elements in each attribute field; the final execution result of the fourth subtask is a thematic map of attribute field distribution classification; and the final execution result of the fifth subtask is a statistical analysis report. The thematic map of attribute field distribution classification refers to a map that uses natural resource spatial data as the base map, and uses different colors, symbols, or fill styles to visualize the level of each element according to the preset attribute field classification standards, in order to intuitively show the spatial distribution range and location characteristics of each attribute field. Obtain the preset report template, fill the element quantity statistics table into the statistics section of the report template, insert the attribute field distribution classification thematic map into the chart section of the report template, fill the target vector data and coordinate-transformed spatial coordinate data into the data description section of the report template, fill the statistical analysis report into the conclusion section of the report template, and generate the analysis results of natural resource spatial data. The target vector data includes various types of spatial vector data in the field of natural resources.
[0053] The target vector data processed in this scheme is a general term for various types of spatial vector data in the field of natural resources, and is not limited to any specific type. Target vector data includes, but is not limited to, vector data of geological heritage protection areas, forest protection areas, wetland protection areas, cultural heritage protection areas, water source protection areas, marine areas, mineral resource areas, and grassland areas.
[0054] Steps S1, S2, S3, S4, S5, and S6 belong to the understanding stage, planning stage, execution stage, inspection stage, and improvement stage, respectively.
[0055] For ease of explanation, the following example is provided: Taking "analyzing geological heritage protection zoning data, counting the number of elements in each attribute field, and generating thematic maps and reports" as an example, the five-stage closed-loop execution process provided by this invention will be further explained.
[0056] (a) Understanding Stage The server-side device receives the spatial data analysis command input by the user. The command is to "analyze the geological heritage protection zoning data, count the number of elements in each attribute field, and generate thematic maps and reports."
[0057] The server retrieves historical information related to the current command from the memory layer. The retrieval includes: obtaining the three most recent dialogue memories, retrieving two relevant knowledge entries based on the keyword "geological relics," and obtaining user preferences (including the default coordinates of the server and the default color band). The server then uses the retrieved historical dialogue memories, relevant knowledge, and user preferences as memory context and injects them into the server-side prompts in the large language model.
[0058] The server sends a question interpretation command to the large language model. The large language model parses the command based on the spatial data analysis command input by the user and the injected memory context, and outputs the requirement understanding information, key information, task type and expected result.
[0059] The user needs to perform statistical analysis on geological heritage protection zoning data, including statistical analysis of the number of elements in each attribute field, thematic map creation, and report generation. Key information includes: the data file is "Geological Heritage Protection Zoning," the analysis dimension is "Attribute Fields," and both thematic maps and reports are required as outputs. The task type is spatial analysis plus report generation. Expected results include: an attribute field statistics table, a thematic map of attribute field distribution, and a statistical analysis report.
[0060] (II) Planning Phase Based on the requirements understanding information, key information, task type and expected result output in the understanding phase, the server device decomposes the user intent into multiple sub-tasks, resulting in a sub-task sequence.
[0061] The server-side device checks the memory layer for historical experiences similar to the current task. The search criteria are tasks whose descriptions contain the keywords "geological relics" or "protected area," sorted in reverse chronological order of creation time, and the first two records are retrieved. If a similar task has been successfully completed, its historical tool sequence is used as a planning reference and injected into the planning prompts of the large language model.
[0062] The server-side device sends planning instructions to the large language model. Based on the output of the understanding phase and retrieved historical experience, the large language model generates a structured execution plan. This execution plan includes the following sub-tasks: loading geological heritage protection zoning data; obtaining layer field information and confirming attribute field names; checking and transforming coordinates on the server-side device; counting the number of features in each attribute field; creating a thematic map of attribute field distribution; and generating a statistical analysis report. The server-side device extracts the number of sub-tasks from the execution plan and records it in the execution plan list.
[0063] (III) Implementation Phase Based on the structured execution plan, the server-side device uses the function call mechanism of the large language model to sequentially call the tools corresponding to each subtask in the planned order to execute each subtask.
[0064] First iteration: The server-side device calls the data loading tool to load the geological heritage protection zone data file, which is in Shapefile format. The server-side device executes the data loading tool, detects that the data uses projected coordinates, and returns information indicating that coordinate transformation is required.
[0065] Second iteration: The server device calls the field information acquisition tool to obtain the field list of the loaded layer and confirms that the attribute field name is "attribute field".
[0066] The third iteration: The server device calls the coordinate server device conversion tool to convert the data from the projected coordinate server device to the target coordinate server device.
[0067] Fourth iteration: The server-side device calls the spatial statistics tool to perform quantity statistics on each level of elements according to the attribute fields, and obtains the element quantity statistics results for each attribute field.
[0068] Fifth iteration: The server-side device calls the thematic map generation tool to generate categorized thematic maps based on attribute fields.
[0069] The sixth iteration: The server-side device calls the report generation tool to generate a statistical analysis report, which is in word processing software format.
[0070] Seventh iteration: The large language model returns a plain text response without any tool calls, and the server-side device determines that the execution phase is complete.
[0071] During execution, after each subtask is completed, the server device will append the execution result to the dialogue history.
[0072] (iv) Inspection phase The server-side equipment verifies the execution results generated during the execution phase. It checks each item on a pre-defined checklist: whether the geological heritage protection zoning data, containing 15 elements, has been loaded; whether coordinate server-side equipment conversion has been completed; whether the number of elements in each attribute field has been counted; whether a thematic map of attribute field distribution has been generated; and whether a statistical analysis report has been generated. Simultaneously, the server-side equipment tracks the execution status of its statistical tools. A total of 6 sub-tasks were executed successfully, with some failures recorded. The failed steps in the execution phase are identified and input into the large language model. The large language model generates a correction plan for the failed steps, which is then fed back to the planning phase. Steps S3 to S5 are then re-executed, forming a closed-loop iteration.
[0073] (v) Results Generation Stage When the number of closed-loop iterations reaches the preset maximum iteration threshold, the closed-loop iteration is exited. The final execution results of each subtask are obtained from the output data of the large language model, and the final execution results of each subtask are integrated to generate the analysis results of natural resource spatial data.
[0074] The beneficial effects of the embodiments of this application are as follows: Firstly, when the number of closed-loop iterations reaches the preset maximum iteration threshold, the closed-loop iteration is exited. The final execution results of each subtask are obtained from the output data of the large language model. The final execution results of each subtask are integrated to generate the analysis results of natural resource spatial data. Since it does not rely on manual operation by staff, the time for obtaining the analysis results of natural resource spatial data is reduced, which is conducive to improving the efficiency of obtaining the analysis results of natural resource spatial data. Secondly, since the analysis results of the automatically generated natural resource spatial data are not affected by human intervention, it is beneficial to improve the reliability of the analysis results of the obtained natural resource spatial data.
[0075] Please see Figure 2 , Figure 2 The application scenario diagram of the spatial data intelligent analysis method provided in the embodiments of this application is described in detail below: The server device connects to the user device; the user device obtains the spatial data analysis instructions input by the user through a dialog window and uploads the spatial data analysis instructions to the server device. The server device obtains the spatial data analysis instructions uploaded by the user device, calls the large language model to perform intent parsing on the spatial data analysis instructions, and obtains the user intent.
[0076] In this embodiment of the application, the server device is connected to the user device, which can reduce the time for obtaining spatial data analysis instructions and improve the efficiency of obtaining spatial data analysis instructions.
[0077] Please see Figure 3 , Figure 3 The analysis results of displaying spatial data of natural resources provided in the embodiments of this application are described in detail below: S301, The server-side device encapsulates the analysis results of natural resource spatial data into a data packet; S302 sends data packets to the user terminal device via a WebSocket connection so that the user terminal device can display the analysis results of natural resource spatial data.
[0078] WebSocket is a network protocol that enables full-duplex communication between a client and a server over a single Transmission Control Protocol (TCP) connection.
[0079] In this embodiment of the application, the analysis results of natural resource spatial data are visualized, enabling users to intuitively obtain the analysis conclusions without having to interpret the original data or understand the analysis process themselves. Users can grasp the analysis conclusions at a glance, effectively reducing the requirements for professional GIS knowledge and data interpretation experience. This allows non-professional users to quickly understand the analysis results and make business decisions accordingly, significantly improving the usability and ease of use of the analysis results.
[0080] For the spatial data intelligent analysis method described in the above embodiments, please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic block diagram of the spatial data intelligent analysis device provided in the embodiments of this application. Figure 4 The spatial data intelligent analysis device 400 shown can be applied to, for example... Figure 1 The application scenario diagram shows the server-side device. The following section uses the server-side device as an example to illustrate this. Figure 4 The spatial data intelligent analysis device 400 shown will be described in detail. The spatial data intelligent analysis device 400 may include an acquisition module 401, a first generation module 402, a calling module 403, a second generation module 404, an iteration module 405, and an analysis module 406.
[0081] The acquisition module 401 is used to acquire spatial data analysis instructions uploaded by the user terminal device, call the large language model to perform intent parsing on the spatial data analysis instructions to obtain the user intent, and use a semantic similarity model to perform similarity retrieval on the vector of the user intent in the long-term memory table to obtain the semantic similarity between the vector of the user intent and the vector of each memory item. Memory items with semantic similarity greater than a preset threshold are used as recall results. Historical dialogue records, user preference information and knowledge items are obtained from the recall results. Historical dialogue records, user preference information and knowledge items are combined to form auxiliary information. The user intent and auxiliary information are concatenated to obtain prompt words. The prompt words are input into the large language model, and the large language model generates demand understanding information, key information, task type and expected results, and spatial data. The first generation module 402 is used to understand the information, key information, task type and expected results according to the requirements, decompose the user intent into multiple sub-tasks, integrate the tools corresponding to each sub-task, the pre-filled parameters corresponding to each sub-task and the historical reference information corresponding to each sub-task according to the execution order of each sub-task, and generate an execution plan. Module 403 is called to input the execution plan into the large language model. Through the function call mechanism of the large language model, the tool corresponding to each subtask is called to execute each subtask and obtain the initial execution result of each subtask. The second generation module 404 is used to check whether the initial execution result of each subtask meets the preset conditions according to the preset checklist, and generate the judgment result of each subtask. The iteration module 405 is used to obtain the failed steps in the execution phase when the judgment result of any subtask does not meet the preset conditions, input the failed steps into the large language model, generate a correction plan for the failed steps through the large language model, feed the correction plan of the failed steps back to the planning phase, and re-execute steps S3 to S5 to form a closed loop iteration. The analysis module 406 is used to exit the closed-loop iteration when the number of closed-loop iterations reaches the preset maximum iteration threshold, obtain the final execution results of each sub-task from the output data of the large language model, integrate the final execution results of each sub-task, and generate the analysis results of the natural resource spatial data.
[0082] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of the server device provided in an embodiment of this application.
[0083] like Figure 5 As shown, Figure 5 The server-side device includes: at least one processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20. When the processor 20 executes the computer program 22, it implements the steps in the above-described intelligent spatial data analysis method.
[0084] The server-side equipment may include, but is not limited to, processor 20 and memory 21. Those skilled in the art will understand that... Figure 5 This is merely an example of server-side equipment and does not constitute a limitation on server-side equipment. It may include more or fewer components than shown in the figure, or combinations of certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0085] The processor 20 may be a central processing unit, or it may be other general-purpose processors, digital signal processors, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0086] In some embodiments, the memory 21 may be an internal storage unit of the server device, such as the hard disk or memory of the server device.
[0087] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A multi-stage intelligent analysis method for spatial data, characterized in that, The spatial data intelligent analysis method, applied to server-side devices, includes: Step S1: Obtain the spatial data analysis instructions uploaded by the user terminal device, call the large language model to perform intent parsing on the spatial data analysis instructions to obtain the user intent, use the semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of the user intent, obtain the semantic similarity between the vector of the user intent and the vector of each memory item, take the memory items with semantic similarity greater than a preset threshold as the recall results, obtain historical dialogue records, user preference information and knowledge items from the recall results, combine the historical dialogue records, user preference information and knowledge items to form auxiliary information, concatenate the user intent and auxiliary information to obtain prompt words, input the prompt words into the large language model, and generate demand understanding information, key information, task type and expected results through the large language model. Spatial data analysis instructions refer to natural language instructions for analyzing natural resource spatial data. Step S2: Based on the needs understanding information, key information, task type and expected results, decompose the user intent into multiple sub-tasks, integrate the tools corresponding to each sub-task, the pre-filled parameters corresponding to each sub-task and the historical reference information corresponding to each sub-task according to the execution order of each sub-task, and generate an execution plan. Step S3: Input the execution plan into the large language model. Through the function call mechanism of the large language model, call the tool corresponding to each subtask to execute each subtask and obtain the initial execution result of each subtask. Step S4: According to the preset checklist, check whether the initial execution result of each subtask meets the preset conditions, and generate the judgment result of each subtask; Step S5: When the judgment result of any subtask is that the preset conditions are not met, the failed steps in the execution phase are obtained, the failed steps are input into the large language model, the correction plan of the failed steps is generated through the large language model, the correction plan of the failed steps is fed back to the planning phase, and steps S3 to S5 are re-executed to form a closed loop iteration. Step S6: When the number of closed-loop iterations reaches the preset maximum iteration threshold, exit the closed-loop iteration, obtain the final execution result of each subtask from the output data of the large language model, integrate the final execution results of each subtask, and generate the analysis results of natural resource spatial data.
2. The spatial data intelligent analysis method according to claim 1, characterized in that, The process involves acquiring spatial data analysis instructions uploaded by user devices, using a large language model to parse these instructions to obtain user intent, and then performing a semantic similarity search on the long-term memory table to determine the semantic similarity between the user intent vector and the vector of each memory item. Memory items with semantic similarity greater than a preset threshold are used as recall results. Historical dialogue records, user preference information, and knowledge items are retrieved from the recall results. These are combined to form auxiliary information, and the user intent and auxiliary information are concatenated to obtain prompt words. These prompt words are then input into the large language model, which generates requirement understanding information, key information, task type, and expected results. Spatial data analysis instructions refer to natural language instructions for analyzing natural resource spatial data, including: The system acquires spatial data analysis instructions uploaded by user devices, calls a large language model to parse the spatial data analysis instructions to obtain user intent, uses a semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of user intent, obtains the semantic similarity between the vector of user intent and the vector of each memory item, and uses memory items with semantic similarity greater than a preset threshold as recall results. From the recall results, the system obtains historical dialogue records, user preference information and knowledge items, combines historical dialogue records, user preference information and knowledge items to form auxiliary information, concatenates user intent and auxiliary information to obtain prompt words, inputs prompt words into the large language model, and generates demand understanding information, key information, task type and expected results through the large language model. Spatial data analysis instructions refer to natural language instructions for analyzing spatial data of natural resources. The large language model extracts regional keywords, resource type keywords, operational verbs, operational objects, time ranges, spatial coordinate parameters, and data layer names from prompts. Based on the regional keywords and resource type keywords, the scope of the natural resource spatial data is determined. The operational verbs and operational objects are combined to obtain the analysis objective. The time range, spatial coordinate parameters, and data layer names are combined to obtain key information. The large language model processes the scope and analysis objective of the natural resource spatial data to generate demand understanding information. The scope, analysis objective, and key information of the natural resource spatial data are combined into sub-tasks of the natural resource spatial data. The large language model is then used to predict the sub-tasks to obtain the expected results of the sub-tasks.
3. The spatial data intelligent analysis method according to claim 1, characterized in that, Based on the understanding of user needs, key information, task type, and expected results, the user intent is broken down into multiple subtasks. The tools, pre-filled parameters, and historical reference information for each subtask are integrated according to their execution order to generate an execution plan, including: Based on the understanding of requirements, key information, task types, and expected results, the user intent is decomposed into multiple subtasks, resulting in a subtask sequence. The identifier and task type of each subtask are obtained from this sequence. Based on the task type, the corresponding tool is retrieved from the tool layer. Based on the identifier, the pre-filled parameters are retrieved from the parameter configuration results. The task type of each subtask is input into a long-term memory table. Historical reference information for each subtask is retrieved from the long-term memory table. Finally, the tools, pre-filled parameters, and historical reference information for each subtask are integrated according to their execution order to generate an execution plan.
4. The spatial data intelligent analysis method according to claim 1, characterized in that, The process involves inputting the execution plan into the large language model, and then using the function call mechanism of the large language model to invoke the tool corresponding to each subtask to execute each subtask, thereby obtaining the initial execution result of each subtask, including: The execution plan is input into the large language model. Through the function call mechanism of the large language model, the tool corresponding to each subtask is called, and the call result of each subtask is obtained. When the call result of any subtask is successful, the tool corresponding to each subtask is used to execute each subtask, and the initial execution result of each subtask is obtained. When the call result of any subtask is unsuccessful, the call parameters corresponding to each subtask are retrieved from the log file, and a reflection process is performed on the call parameters corresponding to each subtask. Through the reflection process, the call parameters corresponding to each subtask are corrected, and the corrected call parameters of each subtask are obtained. Based on the corrected call parameters of each subtask, the tool corresponding to each subtask is called again to execute each subtask, and the initial execution result of each subtask is obtained.
5. The spatial data intelligent analysis method according to claim 1, characterized in that, When the number of closed-loop iterations reaches a preset maximum iteration threshold, the closed-loop iteration is exited. The final execution results of each subtask are obtained from the output data of the large language model, and the final execution results of each subtask are integrated to generate the analysis results of natural resource spatial data, including: The process involves obtaining the number of closed-loop iterations. When the number of iterations reaches the preset maximum iteration threshold, the closed-loop iteration is terminated. From the output data of the large language model, the final execution result of each subtask is obtained. The final execution result of the first subtask is the target vector data; the final execution result of the second subtask is the spatial coordinate data after coordinate transformation (coordinate transformation refers to transforming the spatial coordinate data of the map layer from the first coordinate system to the second coordinate system); the final execution result of the third subtask is a statistical table of the number of elements in each attribute field; the final execution result of the fourth subtask is a thematic map of attribute field distribution classification; and the final execution result of the fifth subtask is a statistical analysis report. The thematic map of attribute field distribution classification refers to a map that uses natural resource spatial data as the base map, and uses different colors, symbols, or fill styles to visualize the level of each element according to the preset attribute field classification standards, in order to intuitively show the spatial distribution range and location characteristics of each attribute field. Obtain the preset report template, fill the element quantity statistics table into the statistics section of the report template, insert the attribute field distribution classification thematic map into the chart section of the report template, fill the target vector data and coordinate-transformed spatial coordinate data into the data description section of the report template, fill the statistical analysis report into the conclusion section of the report template, and generate the analysis results of natural resource spatial data. The target vector data includes various types of spatial vector data in the field of natural resources.
6. The spatial data intelligent analysis method according to claim 1, characterized in that, Long-term memory tables include dialogue memory tables, knowledge accumulation tables, user preference tables, task history tables, document memory tables, and error experience tables; A dialogue memory table is used to store dialogue summaries, key points, relevant documents, and completed tasks; A knowledge accumulation table is used to store structured knowledge and is organized by topic and confidence level. A user preference table is used to store user habits in key-value pairs. The task history table stores task descriptions, tool sequences, results, and execution times. File memory table, used to store file metadata and content summary; An error experience table is used to store error types, messages, contexts, and solutions.
7. The spatial data intelligent analysis method according to claim 1, characterized in that, The semantic similarity model is defined as follows: ; The semantic similarity between the vector representing the user's intent and the vector of the i-th memory item; q represents the vector of user intent; The vector representing the i-th memory item.
8. The spatial data intelligent analysis method according to claim 1, characterized in that, The toolset includes GIS tools, reporting tools, document tools, device tools, general tools, research tools, charting tools, search tools, and custom skills tools; The GIS tool supports Shapefile, GeoJSON, CSV, KML, GeoPackage, and GeoTIFF formats. GIS tools include data loading tools, layer management tools, spatial analysis tools, thematic map tools, coordinate system conversion tools, map display tools, feature query tools, and geocoding tools; The thematic map creation tool supports four types of thematic maps: hierarchical color maps, category maps, hierarchical symbol maps, and heat maps. The hierarchical color map uses coloring based on attribute field values and supports three classification methods: quantile method, equal interval method, and natural break method. The natural break method aims to minimize the sum of squared deviations within each class. The formula for calculating the sum of squared deviations within each class is defined as follows: ; SSD represents the sum of squared deviations within a class. The larger the sum of squared deviations within a class, the more dispersed the elements are within each class; the smaller the sum of squared deviations within a class, the more concentrated the elements are within each class. K is the number of categories. Let k be the set of elements of the kth category. Let j be the attribute value of the j-th element. is the mean of the k-th category.
9. A multi-stage spatial data intelligent analysis device, characterized in that, Applied to server-side devices, including: The acquisition module is used to acquire spatial data analysis instructions uploaded by user devices, call the large language model to perform intent parsing on the spatial data analysis instructions to obtain user intent, and use a semantic similarity model in the long-term memory table to perform similarity retrieval on the vector of user intent to obtain the semantic similarity between the vector of user intent and the vector of each memory item. Memory items with semantic similarity greater than a preset threshold are used as recall results. Historical dialogue records, user preference information and knowledge items are obtained from the recall results. Historical dialogue records, user preference information and knowledge items are combined to form auxiliary information. User intent and auxiliary information are concatenated to obtain prompt words. The prompt words are input into the large language model, and the large language model generates demand understanding information, key information, task type and expected results, and spatial data. The first generation module is used to understand information, key information, task type and expected results based on requirements, decompose user intent into multiple sub-tasks, integrate the tools corresponding to each sub-task, the pre-filled parameters corresponding to each sub-task and the historical reference information corresponding to each sub-task according to the execution order of each sub-task, and generate an execution plan. The calling module is used to input the execution plan into the large language model. Through the function call mechanism of the large language model, the tool corresponding to each subtask is called to execute each subtask and obtain the initial execution result of each subtask. The second generation module is used to check whether the initial execution result of each subtask meets the preset conditions according to the preset checklist, and generate the judgment result of each subtask. The iteration module is used to obtain the failed steps in the execution phase when the judgment result of any subtask does not meet the preset conditions, input the failed steps into the large language model, generate a correction plan for the failed steps through the large language model, feed the correction plan of the failed steps back to the planning phase, and re-execute steps S3 to S5 to form a closed loop iteration. The analysis module is used to exit the closed-loop iteration when the number of iterations reaches the preset maximum iteration threshold. It then obtains the final execution results of each subtask from the output data of the large language model, integrates the final execution results of each subtask, and generates the analysis results of the natural resource spatial data.
10. A server-side device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the spatial data intelligent analysis method as described in any one of claims 1 to 7.
