Automatic land utilization optimization method and system based on large language model
By combining a large language model with an expert knowledge base, executable code classes are generated and a metaheuristic optimization engine is used to solve the problems of high technical threshold and low efficiency in the traditional land use optimization process, and realize the generation of efficient, flexible and high-quality planning schemes for automated land use optimization.
Patent Information
- Application Number
- CN202511504157.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-01-13
AI Technical Summary
Traditional land use optimization processes are technically demanding, inefficient, inflexible, and costly to communicate, making it difficult to achieve seamless integration from natural language requirements to automated optimization solutions.
It employs a large language model (LLM) combined with an expert knowledge base to generate executable code classes through structured prompts, and uses a metaheuristic optimization engine to perform optimization solutions and generate optimization reports.
It significantly lowers the technical threshold, improves modeling efficiency and solution quality, enhances planning flexibility and iteration speed, and realizes an automated process from natural language to optimized solutions.
Smart Images

Figure CN121328837A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer-aided planning and decision-making, in particular to an automatic land use optimization method and system based on a large language model. BACKGROUND
[0002] Land-Use Optimization (LUO) is a core problem in urban planning, which aims to assign the most appropriate land use type to each plot within a specific area, under the condition of meeting a series of economic, social and environmental constraints, in order to achieve one or more planning goals (such as maximizing economic benefits, highest ecological compatibility, etc.). The traditional LUO process is highly dependent on professional knowledge. Planning experts first need to convert vague planning goals into precise mathematical models, including defining objective functions, constraint conditions and decision variables. Then, experts with programming ability (or in cooperation with programmers) need to manually write this mathematical model into computer code. This process has the following significant defects: 1) High technical threshold: requires practitioners to have dual professional knowledge of urban planning and computer programming, talent shortage.
[0003] 2) Low efficiency: manual modeling and coding is a time-consuming, labor-intensive and error-prone process. Any minor adjustment to the planning scheme may require rewriting a large amount of code, with a long iteration cycle.
[0004] 3) Poor flexibility: traditional code is hard-coded for specific problems, making it difficult to adapt to new, non-standard planning needs or rapidly changing goals.
[0005] 4) High communication cost: if the planner and programmer are different people, there needs to be a lot of communication between them to ensure that the code accurately reflects the planning intent, and information bias is easily generated during this period.
[0006] In summary, the existing technology has problems such as complex land use optimization modeling process, long time-consuming, high technical threshold, etc. In recent years, large language models (LLM) have shown strong capabilities in natural language understanding and code generation, providing new possibilities for solving the above problems. However, how to build a systematic framework to combine the capabilities of LLM with the professional process of LUO, and realize the whole process from natural language requirements to automatic optimization solution, is a problem that needs to be solved in the current technical field. SUMMARY
[0007] The purpose of the present application is to provide an automatic land use optimization method and system based on a large language model to overcome the shortcomings of the prior art. The method uses relevant knowledge retrieved from an expert knowledge base and user information to construct an enhanced structured prompt. The prompt is input into a large language model (LLM) to dynamically generate an executable optimization problem class containing initialization, individual generation, constraint checking, and evaluation functions. The methods of the class are called by a meta-heuristic optimization engine to perform optimization solving. The optimization results are evaluated and reflected by the large language model to generate an analysis report. The present application significantly reduces the difficulty and time cost of optimization modeling, allowing planning experts to focus on the problem itself while ensuring the professionalism and high quality of the optimization scheme. It effectively solves the problems of complex and time-consuming traditional land use optimization modeling process, significantly reduces the technical threshold of modeling, and improves the overall efficiency from problem definition to solution.
[0008] The purpose of the present application is achieved by an automatic land use optimization method based on a large language model, which comprises the following steps: Step 1: Demand input and preprocessing Receive user input, which includes planning objectives defined in natural language and specified geographic spatial data files, and automatically preprocess the data files to generate formatted variable files and data description information; Step 2: Structured prompt generation Integrate natural language objectives, formatted variables, and data description information to form a basic prompt. Use retrieval enhancement technology to retrieve knowledge related to planning objectives from a pre-set expert knowledge base, and combine the retrieved knowledge with the basic prompt to generate an enhanced structured prompt; Step 3: Executable code class generation Input the enhanced structured prompt into a large language model to generate an executable code class that encapsulates the land use optimization problem; Step 4: Optimization execution Use a pre-set meta-heuristic optimization algorithm engine to call the methods defined in the executable code class to iteratively solve the land use optimization problem and obtain one or more optimization solutions; Step 5: Evaluation and output Input the optimization solutions and their iterative process visualization results, along with the user's initial planning objectives into a large language model to generate an evaluation report on the optimization effect.
[0009] The step 1 further comprises: 1) Geocoding the user-specified geographic spatial data files to match local policies and regulations; 2) Automatically calculate the adjacency matrix or distance matrix between plots according to the demand of planning objectives.
[0010] The expert knowledge base in step 2 includes but is not limited to: urban planning regulations, land use compatibility matrix, excellent planning cases, ecological protection guidelines or optimization model examples in specific fields.
[0011] The executable code class generated in step 3 contains at least the following four functions: 1) Initialization function for initializing problem context, loading data and data format conversion; 2) Individual creation function for randomly generating a candidate solution; 3) Constraint checking function for verifying whether a given solution meets all planning constraints; 4) Individual evaluation function for quantitatively scoring a given solution according to one or more optimization objectives.
[0012] The meta-heuristic optimization algorithm engine in step 4 includes genetic algorithm or non-dominated sorting genetic algorithm II.
[0013] Step 3 before generating the executable code class, there is a user confirmation loop, where the large language model first repeats the understanding of the problem, and after the user confirms that there is no error, the code class generation step is executed.
[0014] The initialization function maps the land use type string to an integer index array to improve computational performance.
[0015] An automatic land use optimization method based on large language model system, characterized in that the system comprises: demand input and preprocessing module, structured prompt generation module, environment generation module, optimization execution module and evaluation and output module, the demand input and preprocessing module receives the planning objectives and geographic spatial data defined by the user in natural language, and automatically preprocesses them; the structured prompt generation module integrates user information and retrieves knowledge from the expert knowledge base using retrieval enhancement generation technology to build an enhanced structured prompt; the environment generation module is built-in large language model, receives the enhanced structured prompt, and dynamically generates an executable code class encapsulating the optimization problem; the optimization execution module is built-in meta-heuristic optimization algorithm engine, calls the method of executable code class, and executes optimization solution; the evaluation and output module visualizes the optimization results and calls the large language model to generate an evaluation report.
[0016] The structured prompt generation module is connected to the expert knowledge base storing urban planning regulations, land use compatibility matrix or excellent planning cases.
[0017] The executable code class generated by the environment generation module includes initialization functions, individual creation functions, constraint checking functions and individual evaluation functions, and the optimization execution module calls these functions to drive the optimization process.
[0018] Compared with the prior art, the present application has the following beneficial technical effects and significant technical progress: 1) Lower technical threshold: users only need to describe planning goals using natural language, without writing any code, to perform complex optimization tasks.
[0019] 2) Improve modeling efficiency: reduce manual coding work from hours or even days to a few minutes of automated process.
[0020] 3) Enhance solution quality: introduce expert knowledge through RAG to guide LLM to generate more professional and realistic constraint-compliant code, ensuring the quality and feasibility of the solution.
[0021] 4) Improve flexibility and iteration speed: users can quickly modify planning goals, and the system can generate new optimization environments in real time, greatly facilitating solution exploration and iteration. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 Optimization system diagram for the architecture of the present application. DETAILED DESCRIPTION
[0023] The present application is an automatic land use optimization method based on large language models, specifically including: Step 1: Demand input and preprocessing The system receives the user's natural language planning goal and geographic data for automatic data file parsing, packages the user-defined variables, and uploads the geographic file to the object storage while performing geographic coding and spatial matrix (such as adjacency matrix) calculation.
[0024] Step 2: Structured prompt generation The system integrates all the information processed in the previous step (natural language goals, data descriptions, variable files, etc.) into a basic prompt. The technical core innovation of this step is the introduction of the Retrieval Augmented Generation (RAG) technology. Before sending the prompt to the LLM, the system will retrieve the most relevant information from a pre-set expert knowledge base (including planning regulations, best practices, compatibility principles, etc.) according to the user's planning goal. These expert knowledge is injected into the basic prompt to form an enhanced structured prompt with richer information and more explicit context.
[0025] Step 3: Environment code generation: The enhanced structured prompt is sent to the LLM, whose task is to dynamically generate a complete and executable Python optimization problem class based on the prompt content. This class is designed to have a standard interface, including at least the __init__ (initialization), create_individual (individual generation), check_constraints (constraint checking), and evaluate_individual (individual evaluation) four core functions.
[0026] Step 4: Optimization Execution Step, a pre-implemented meta-heuristic optimization engine (such as GA or NSGA-II) directly calls the methods in the code class generated in the previous step. The engine does not need to care about the specific details of the problem, but only needs to drive the entire optimization process through the standard interface to find the optimal solution or Pareto optimal solution set.
[0027] Step 5: Evaluation and Output Step, the system submits the optimized scheme (such as map visualization) and the optimization process chart (such as convergence curve) to the LLM, along with the user's initial requirements. The LLM plays the role of an "AI planning consultant" to analyze the results and generate an evaluation report to determine the extent to which the optimization results achieve the initial goals.
[0028] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0029] Referring to Figure 1 The system framework of the present application mainly includes three modules: requirement input and preprocessing module, LLM environment generation module and heuristic optimization and output module, and the specific operation steps are as follows: Step 1: Requirement input and preprocessing This stage is the main interaction interface between the user and the system, as shown in detail in Figure 1 The left part, specifically including: 1) User input The user inputs two types of information through the graphical interface, one is to describe the planning goal, variable and constraint in natural language (for example, "I hope to maximize economic benefit and green coverage rate, while ensuring that commercial land does not exceed 20% of the total area"); the second is to select the geographic spatial data file (such as GeoJSON or Shapefile) containing the land to be planned, and specify the relevant fields.
[0030] 2) Data preprocessing 2-1: File processing and variable parsing: the system reads the geographic file uploaded by the user, parses its fields and data types; the user-defined other variables (such as area ratio) are formatted and packaged into a JSON file; the geographic file is uploaded to the designated object storage server, and its access address and file description (schema) are recorded.
[0031] 2-2: Geospatial contextualization: The system automatically extracts the geographic coordinates of the parcels, geocodes them to determine the administrative regions they belong to. This allows the system to automatically match and consider local planning policies.
[0032] 2-3: Spatial matrix computation: If the user's goal involves spatial relationships (e.g., "commercial zones cannot be adjacent to industrial zones"), the system automatically computes the adjacency matrix or distance matrix between parcels.
[0033] Step Two: LLM Environment Generation This phase is the core of connecting human intent to machine code, detailed in the Figure 1 section, and specifically includes: 1) Structured Prompt Generation and User Confirmation All the information processed in the previous phase, including: natural language goal, access addresses and descriptions of data files, formatted variable files, computed spatial matrices are integrated into a structured prompt.
[0034] 2) Incorporation of Expert Knowledge (RAG): Before sending this prompt to the LLM, the system first analyzes the user's natural language goal. For example, if the goal contains "ecological compatibility", the system will retrieve relevant documents or data segments related to "land use ecological compatibility evaluation criteria" from the internal expert knowledge base. These retrieved expert knowledge will be added as additional context information to the structured prompt, forming an enhanced structured prompt.
[0035] 3) Integrity Check and User Confirmation: The enhanced structured prompt is first sent to the LLM, asking it to paraphrase its understanding of the problem. The system displays the LLM's answer to the user, who can feedback "confirmed" or make modifications. This feedback loop ensures that the LLM accurately understands the task before proceeding to the next step.
[0036] 4) Generation of Python Functions: After user confirmation, the enhanced structured prompt is sent to the LLM along with a pre-defined function signature template. The task of the LLM is to fill in the specific implementation logic of these functions, generating an executable code class named ProblemContext. This class contains four key functions: a) __init__: The initialization function, which is responsible for loading data from specified addresses and mapping parcel type strings such as 'Residential' to integers in NumPy ndarrays for high-performance computing. At the same time, it generates a JSON object describing the optimization direction (e.g., "weights": [1.0, -1.0] respectively representing maximization and minimization) according to the user's goal and stores it as a class attribute.
[0037] b) create_individual: Create an individual (i.e., a complete land use allocation plan).
[0038] c) check_constraints: Check if an individual violates all constraints.
[0039] d) evaluate_individual: Evaluate an individual's performance, returning its scores on each objective.
[0040] Step Three: Heuristic Optimization and Output This phase performs the actual computational solving, as detailed in the right-hand section, which includes: Figure 1 1) Optimization Execution: The pre-set heuristic algorithm (such as GA or NSGA-II) instantiates the ProblemContext class. In the optimization loop, it repeatedly calls the create_individual, check_constraints, and evaluate_individual functions to generate, filter, and evaluate the population of solutions. Specific operators such as crossover and mutation can be determined by an LLM Agent based on problem characteristics. 2) Visualization Output:
[0041] 2-1: Iteration Graph: During the optimization process, the system will draw a graph in real-time showing the trend of population fitness (such as the evolution of the Pareto front). 2-2: Planning Map: After optimization, the system will geovisualize the best several solutions (such as the 10 points on the Pareto front) to generate an intuitive land use planning map.
[0042] 3) LLM Verification and Reflection
[0043] 3-1: The system will package the user's initial requirements, iteration graph, and final planning map and send them to the LLM again. 3-2: The LLM will evaluate the entire result and output an evaluation report, analyzing whether the optimization result successfully responds to the initial requirements. If the LLM considers the result unsatisfactory, it can suggest re-running or adjusting parameters.
[0044] Through the above implementation, the present application constructs a closed-loop automated system from natural language to the final planning scheme, greatly improving the efficiency and accessibility of land use optimization.
[0045]
[0046] The above merely describes preferred embodiments of the present application, but is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An automated land use optimization method based on a large-scale language model, characterized in that, The method specifically includes: Step 1: Demand Input and Preprocessing The system receives user input, which includes planning objectives defined in natural language and a specified geospatial data file. It then performs automated preprocessing on the data file to generate a formatted variable file and data description information. Step 2: Generating Structured Hints The basic prompt is formed by integrating natural language objectives, formatted variables, and data description information. Then, the enhanced generation technology is used to retrieve knowledge related to the planning objectives from a pre-set expert knowledge base. The retrieved knowledge is combined with the basic prompt to generate an enhanced structured prompt. Step 3: Generate executable code class The enhanced structured hints are input into a large language model to generate an executable code class that encapsulates the land use optimization problem; Step 4: Optimize Execution The pre-defined metaheuristic optimization algorithm engine calls the methods defined in the executable code class to solve the land use optimization problem in an iterative manner, and obtain one or more optimization solutions. Step 5: Evaluation and Output The visualization results of the optimized solution and its iterative process, along with the user's initial planning goals, are input into a large language model to generate an evaluation report on the optimization effect.
2. The automated land use optimization method based on a large-scale language model according to claim 1, characterized in that, Step 1 further includes: 1) Geocoding the user-specified geospatial data files to match local policies and regulations; 2) Automatically calculate the adjacency matrix or distance matrix between plots based on the planning objectives.
3. The automated land use optimization method based on a large-scale language model according to claim 1, characterized in that, The expert knowledge base in step 2 includes, but is not limited to: urban planning regulations, land use compatibility matrix, excellent planning cases, ecological protection guidelines, or optimization model examples in specific fields.
4. The automated land use optimization method based on a large-scale language model according to claim 1, characterized in that, The executable code class generated in step 3 shall contain at least the following four functions: 1) An initialization function used to initialize the problem context, load data, and perform data format conversion; 2) An individual creation function used to randomly generate a candidate solution; 3) A constraint checking function used to verify whether a given solution satisfies all planning constraints; 4) Individual evaluation functions used to quantify and score a given solution based on one or more optimization objectives.
5. The automated land use optimization method based on a large-scale language model according to claim 1, characterized in that, The metaheuristic optimization algorithm engine in step 4 includes a genetic algorithm or a non-dominated sorting genetic algorithm II.
6. The automated land use optimization method based on a large-scale language model according to claim 1 or claim 4, characterized in that, Step 3, before generating the executable code class, includes a user confirmation loop. The large language model first restates its understanding of the problem, and the code class generation step is only executed after the user confirms that there are no errors.
7. The automated land use optimization method based on a large-scale language model according to claim 4, characterized in that, The initialization function maps string-type land use types to arrays of integer indices to improve computational performance.
8. A system constructed using the automated land use optimization method based on a large-scale language model as described in claim 1, characterized in that, The system includes: a requirement input and preprocessing module, a structured prompt generation module, an environment generation module, an optimization execution module, and an evaluation and output module. The requirement input and preprocessing module receives planning objectives and geospatial data defined by the user in natural language and performs automated preprocessing. The structured prompt generation module integrates user information and uses retrieval enhancement generation technology to retrieve knowledge from an expert knowledge base, constructing an enhanced structured prompt. The environment generation module incorporates a large-scale language model, receives the enhanced structured prompt, and dynamically generates an executable code class encapsulating the optimization problem. The optimization execution module incorporates a metaheuristic optimization algorithm engine, calls methods of the executable code class, and performs optimization solutions. The evaluation and output module visualizes the optimization results and uses the large-scale language model to generate an evaluation report.
9. The system constructed according to claim 8 using the automated land use optimization method based on a large-scale language model, characterized in that, The structured prompt generation module is connected to an expert knowledge base that stores urban planning regulations, land use compatibility matrices, or excellent planning cases.
10. The system constructed according to claim 8 using the automated land use optimization method based on a large-scale language model, characterized in that, The executable code class generated by the environment generation module includes initialization functions, individual creation functions, constraint checking functions, and individual evaluation functions, and the optimization process is driven by calling these functions through the optimization execution module.
Citation Information
Patent Citations
Large language model-based operation planning optimization method and system, electronic equipment and storage medium
CN117273005A
Project optimization problem rapid modeling method and system based on large language model
CN118151910A
Data processing method, model training method, device and equipment based on multiple targets
CN119273057A
New energy project intelligent planning method and system based on large language model
CN119671317A
Intelligent inspection method and system of work order all-in-one machine for pressure-bearing special equipment
CN119692987A
Cited By
Urban planning land utilization potential assessment method, system and equipment and storage medium
CN122048176A