Method, device and equipment for generating virtual city by using natural language and storage medium

By using large language models and artificial intelligence content generation algorithms to generate virtual cities, the problem of low efficiency and insufficient flexibility of virtual cities in the existing technology is solved, efficient and accurate virtual city generation is achieved, and its customizability and diversity are enhanced.

CN119850834APending Publication Date: 2025-04-18CHENGDU GUOXING YUHANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411909352.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing technology has problems such as low efficiency and insufficient flexibility in virtual city generation, which limits the development and application of virtual city technology.

Method used

By using a large language model to deeply understand the user's natural language, extract key information, and obtain multiple parameters for building a virtual city based on this information. Then, using artificial intelligence to generate content algorithms, vector map data, ground map maps and city color images are generated, and these images are finally integrated with the three-dimensional model to generate a virtual city.

Benefits of technology

It improves the efficiency and accuracy of virtual city generation, enhances the customization and diversity of virtual cities, and can generate virtual cities of different styles and themes according to the user's natural language, meeting the high requirements of smart cities for urban three-dimensional modeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850834A_ABST
    Figure CN119850834A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for generating a virtual city by using a natural language, equipment and a storage medium, relates to the technical field of artificial intelligence, and is used for solving the problems of low efficiency, insufficient flexibility and the like in the aspect of virtual city generation in the prior art. The method comprises the following steps: performing deep semantic understanding on a natural language of a user by utilizing a large language model, and extracting key information; according to the key information, obtaining a plurality of parameters for constructing a virtual city; obtaining vector map data according to the plurality of parameters; the vector map data represents geographic information in a vector data form; generating a ground mapping map according to the vector map data by using an artificial intelligence generation content algorithm; the ground mapping map is used for representing texture and color information of ground features; generating a city color image according to the ground mapping map; integrating the city color image with the three-dimensional model to generate a virtual city; the three-dimensional model is created from a plurality of parameters and a ground map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology and provides a method, device, equipment and storage medium for generating a virtual city using natural language. Background Art

[0002] A virtual city is a simulated or emulated urban environment created using computer technology. It usually combines geographic information systems, 3D modeling, physics engines, and artificial intelligence technologies to simulate a virtual urban space. Virtual cities can be applied to many fields, including urban planning, virtual reality, augmented reality, game development, and simulation training.

[0003] Existing technologies have problems such as low efficiency and lack of flexibility in generating virtual cities, which restrict the development and application of virtual city technology. Summary of the invention

[0004] The present application provides a method, apparatus, device and storage medium for generating a virtual city using natural language, which are used to solve the problems of low efficiency and insufficient flexibility in the virtual city generation in the prior art.

[0005] In a first aspect, the present application provides a method for generating a virtual city using natural language, comprising:

[0006] Use a large language model to deeply understand the user's natural language and extract key information;

[0007] According to the key information, a plurality of parameters for constructing a virtual city are obtained;

[0008] According to the plurality of parameters, vector map data is obtained; the vector map data represents geographic information in the form of vector data;

[0009] Generate a ground texture map based on the vector map data using an artificial intelligence content generation algorithm; the ground texture map is used to represent texture and color information of ground features;

[0010] Generating a city color image according to the ground texture map;

[0011] The city color image is integrated with a three-dimensional model to generate a virtual city; the three-dimensional model is created based on the multiple parameters and the vector map data.

[0012] Optionally, the multiple parameters include a building density parameter value, a city size parameter value, a road complexity parameter value, a building style parameter value, and a water body ratio parameter value; and obtaining multiple parameters for constructing a virtual city based on the key information includes:

[0013] If the key information includes high-rise buildings, the building density parameter value is obtained according to the ratio of the total building base area to the total land area;

[0014] If the key information includes city size, then obtaining a city size parameter value based on population size or geographic area or number of buildings;

[0015] If the key information includes road complexity, then obtaining a road complexity parameter value according to the information entropy of each road direction angle;

[0016] If the key information includes an architectural style, determining the architectural style parameter value corresponding to the keyword according to the keyword about the architectural style in the key information;

[0017] If the key information includes the proportion of water bodies, the water body proportion parameter value is obtained according to the ratio of the water body area to the total urban area.

[0018] Optionally, obtaining the vector map data according to the multiple parameters includes:

[0019] According to the plurality of parameters, a main road network and rivers are generated in the entire plot;

[0020] Using an L-system algorithm and constraint rules, a secondary road network is generated on the entire plot according to the main road network and the river;

[0021] According to the road network formed by the main road network and the secondary road network, the entire plot is divided into multiple areas;

[0022] A building area is determined from a plurality of areas, and building filling is performed on the building area to obtain vector map data.

[0023] Optionally, the entire plot is partitioned according to the road network formed by the main road network and the secondary road network to obtain multiple areas, including:

[0024] Generating a buffer zone of the road network according to the width of the trunk road network and the width of the secondary road network;

[0025] According to the buffer zone of the road network, using a difference operation to cut the entire plot into a plurality of large plots;

[0026] Dividing the plurality of large plots into commercial areas, residential areas and industrial areas according to the distance from the centroid of each large plot to the city center; the city center is determined according to the centroids of the plurality of large plots;

[0027] Some large plots are randomly selected from the plurality of large plots as park areas.

[0028] Optionally, determining a building area from the multiple areas, performing building filling on the building area, and obtaining vector map data includes:

[0029] According to the area threshold corresponding to the regional type of each large plot, each large plot is divided into multiple small plots;

[0030] Mark all small plots that meet preset conditions as supporting facilities areas, and mark all small plots other than the supporting facilities areas as building areas;

[0031] The building area is filled with buildings according to the maximum inscribed rectangle of each small plot, so as to obtain vector map data.

[0032] Optionally, the step of filling the building area with buildings according to the maximum inscribed rectangle of each small plot of land to obtain vector map data includes:

[0033] Calculate the maximum inscribed rectangle of each small plot in the building area;

[0034] From all the maximum inscribed rectangles, a maximum inscribed rectangle with a preset proportion is randomly selected and filled with buildings using prefabricated shapes. The remaining maximum inscribed rectangles are filled with buildings using a cannibalization algorithm to obtain vector map data.

[0035] Optionally, generating a city color image according to the ground texture map includes:

[0036] Performing an optimization operation on the ground texture map to obtain an optimized ground texture map; the optimization operation includes texture synthesis, color correction and lighting simulation;

[0037] Generating an initial city color image according to the optimized ground texture map;

[0038] An image rendering operation is performed on the initial city color image to obtain a city color image; the image rendering operation includes ray tracing, global illumination and dynamic shadow.

[0039] In a second aspect, the present application provides a device for generating a virtual city using natural language, comprising:

[0040] The extraction module is used to use a large language model to perform deep semantic understanding of the user's natural language and extract key information;

[0041] An acquisition module, used to acquire multiple parameters for constructing a virtual city according to the key information; and to acquire vector map data according to the multiple parameters; the vector map data represents geographic information in the form of vector data;

[0042] A generation module is used to generate a content algorithm using artificial intelligence to generate a ground texture map based on the vector map data; the ground texture map is used to represent the texture and color information of ground features; based on the ground texture map, a city color image is generated; and the city color image is integrated with the three-dimensional model.

[0043] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method for generating a virtual city using natural language as described in the first aspect.

[0044] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and a processor executes the computer program to implement the method for generating a virtual city using natural language as described in the first aspect.

[0045] Compared with the prior art, the beneficial effects of this application are:

[0046] The present application provides a method for generating a virtual city using natural language, which uses a large language model to perform deep semantic understanding of the user's natural language and extract key information; based on the key information, multiple parameters for building a virtual city are obtained; based on the multiple parameters, vector map data is obtained; the vector map data represents geographic information in the form of vector data; an artificial intelligence content generation algorithm is used to generate a ground map based on the vector map data; the ground map is used to represent the texture and color information of ground features; based on the ground map, a city color image is generated; the city color image is integrated with a three-dimensional model to generate a virtual city; the three-dimensional model is created based on the multiple parameters and the vector map data.

[0047] This application integrates a large language model and uses the powerful natural language understanding and generation capabilities of the large language model to achieve efficient and accurate conversion from natural language to city construction parameters, thereby improving the efficiency and accuracy of virtual city generation. Virtual cities of different styles and themes can be generated based on the user's natural language to meet the personalized needs of different users, improve the customizability and diversity of virtual cities, meet the high requirements of smart city applications for the scale, details and update frequency of urban three-dimensional modeling, and adapt to the needs of the rapid development of smart cities. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart of a method for generating a virtual city using natural language provided in an embodiment of the present application;

[0049] Figure 2 A schematic diagram of a trunk road network and a river provided in an embodiment of the present application;

[0050] Figure 3 A schematic diagram of a trunk road network, a secondary road network and a river provided in an embodiment of the present application;

[0051] Figure 4 A schematic diagram of the partitions provided in the embodiment of the present application;

[0052] Figure 5 A schematic diagram of a building area and supporting facilities area provided in an embodiment of the present application;

[0053] Figure 6 A schematic diagram of a vector map provided in an embodiment of the present application;

[0054] Figure 7 A schematic diagram of a ground map provided in an embodiment of the present application;

[0055] Figure 8 A schematic diagram of a city color image provided in an embodiment of the present application;

[0056] Fig. 9 A schematic diagram of a virtual city provided in an embodiment of the present application;

[0057] Fig.10 A schematic diagram of the structure of an apparatus for generating a virtual city using natural language provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] The method of the embodiment of the present application can be executed in the form of a program by running a program on an existing computer device. The computer device can be a mobile phone, a tablet, a desktop computer, etc. The computer device may include a processor, a storage medium, etc. The storage medium is used to store the program for executing the method of the present embodiment, and the processor is used to load and execute the computer program so that the computer device executes the method for generating a virtual city using a natural language as provided in the embodiment of the present application.

[0060] In order to solve the problems of low efficiency and lack of flexibility in the prior art in natural language understanding and virtual city generation, the embodiment of the present application provides a method for generating a virtual city using natural language, which can be specifically applied to the creation and simulation of virtual environments, including but not limited to urban planning, virtual reality, augmented reality, game development, simulation training and other fields.

[0061] like Figure 1 As shown, it is a flow chart of a method for generating a virtual city using natural language provided in an embodiment of the present application. The flow of the method is introduced as follows.

[0062] S101. Use a large language model to perform in-depth semantic understanding on the user's natural language and extract key information.

[0063] In the specific implementation process, first, the user can input natural language about the virtual city through the interface, enabling the computer device to obtain the user's natural language about the virtual city. For example: "I want a modern city with dense high-rise buildings and wide parks."

[0064] Then, perform preprocessing operations on the natural language to obtain the preprocessed text. The preprocessing operations include word segmentation, stop word removal, part-of-speech tagging, etc., which can improve the parsing efficiency and accuracy of the model. Among them, word segmentation is to recombine a continuous sequence of characters into a sequence of words according to specific rules or algorithms. Stop words refer to words that frequently appear in the text but have little significance for analysis, such as "de", "he", "shi", etc. Removing stop words can reduce the noise of the data. Part-of-speech tagging is to assign the corresponding part-of-speech tags to each word, such as nouns, verbs, adjectives, etc. A large corpus with labeled data can be used to train a statistical model, and statistical models such as Hidden Markov Model (HMM), Conditional Random Field (CRF), etc. can be used. The trained statistical model is used to achieve part-of-speech tagging.

[0065] Finally, input the preprocessed text into a large language model (Large Language Model, LLM). A large language model is a model based on artificial intelligence and natural language processing (NLP) technologies. It is trained with a large amount of text data and can understand, generate, translate, and reason about human language. Use the large language model to perform in-depth semantic understanding on the preprocessed text and extract key information, such as "dense high-rise buildings", "wide parks", "modern city", etc.

[0066] S102. Obtain multiple parameters for constructing the virtual city according to the key information.

[0067] In the specific implementation process, according to the semantic understanding result, that is, the key information, obtain multiple parameters for constructing the virtual city, including building density parameter value, city size parameter value, road complexity parameter value, building style parameter value, water body proportion parameter value. For example, convert "dense high-rise buildings" into a building density parameter value.

[0068] If the key information includes high-rise buildings, then obtain the building density parameter value according to the ratio of the total building base area to the total land area. For example: A piece of land is 10,000 square meters, and the building bottom area is 3,000 square meters, then the building density parameter value is 30%.

[0069] If the key information includes the size of the city, then the city size parameter value is obtained based on the population size or geographical area or number of buildings. A parameter value can be set, such as the city population capacity or the square kilometers of the city boundary, to reflect the size of the city.

[0070] If the key information includes road complexity, the information entropy of each road direction angle in a certain area is calculated to obtain the road complexity parameter value. Since the more intersections, overpasses and viaducts there are in a region, the more complex the road network is, so the information entropy of the road direction angle can be calculated to obtain the road complexity parameter value. The calculation formula of information entropy is as follows:

[0071]

[0072] Among them, H(X) represents the information entropy of random variable X, p(x i ) indicates that the random variable X is x i probability.

[0073] If the key information includes architectural style, the architectural style parameter value corresponding to the keyword is determined according to the keyword about the architectural style in the key information. For example, if the keyword is "modern", the corresponding architectural style parameter value is modernism, and if the keyword is "classical", the corresponding architectural style parameter value is Gothic.

[0074] If the key information includes water body proportion, the ratio of water body area to total urban area is calculated to obtain the water body proportion parameter value. For example, if the total area of ​​a city is 100 square kilometers and the water body area is 20 square kilometers, the water body proportion parameter value is 20%.

[0075] S103. Generate vector map data according to multiple parameters.

[0076] Specifically, according to a plurality of parameters used to construct a virtual city, vector map data is obtained, and then a vector map is generated, such as Figure 6 As shown. Vector map data represents geographic information in the form of vector data, including road network data, river data, park data, building data and supporting facilities data. Since road network data is vector line data, it can be stored separately as a vector data (storage format is shp), and other data is surface data, which is stored in another vector data (storage format is shp), together forming vector map data.

[0077] S104, using artificial intelligence to generate content algorithms, and generating a ground texture map based on the vector map data.

[0078] In the specific implementation process, the Artificial Intelligence Generated Content (AIGC) algorithm is used to generate ground texture maps based on vector map data, such as Figure 7 The ground map is used to represent the texture and color information of ground features, including the texture and color information of roads, buildings, vegetation and other ground features. The following are some specific examples of texture and color information.

[0079] 1. Road texture and color.

[0080] Asphalt pavement has a smooth texture of dark grey or black and may have white lane markings and yellow traffic signs. Concrete pavement has a rough texture of grey or light blue and may have regular seams. Masonry pavement, such as cobblestone or red brick paving, has an irregular circular or rectangular pattern and may range in colour from light grey to dark red.

[0081] 2. Building texture and color.

[0082] Brick walls appear as a rough texture in red, brown or grey, with possible outlines and gaps between the bricks. Stone walls, such as granite or limestone, appear as a granular texture, with colours ranging from light grey to dark grey or brown. Glass curtain walls appear as a highly reflective smooth surface, which may range in colour from clear to dark blue or grey, reflecting images of the surrounding environment.

[0083] 3. Vegetation texture and color.

[0084] Grass is represented as a bright green or yellow-green fine texture, possibly with the outlines and shadows of grass blades. For trees, leaves are represented as different shades of green, with textures ranging from smooth to rough, while trunks are represented as a rough brown or gray texture with longitudinal lines. Flower beds are represented as colorful textures, with flowers and leaves of different colors and shapes, often contrasting with the brown texture of the soil.

[0085] 4. Water texture and color.

[0086] Still water, such as lakes, appears as a smooth blue or green texture that may reflect the colors of its surroundings. Moving water, such as rivers, appears as a rippled texture, and the color may change dynamically due to the flow, ranging from light blue to dark green.

[0087] 5. Sidewalks and squares.

[0088] Sidewalks are usually grey or light yellow concrete textures that may have a fine grain or anti-slip pattern. Plazas may be paved with flagstone or bricks in a regular pattern of squares or rectangles, ranging in colour from light grey to dark brown.

[0089] In the embodiment of the present application, the AIGC algorithm can automatically generate ground maps containing rich texture and color information based on vector map data to enhance the realism and details of the virtual city. These maps can not only improve the visual quality of the virtual city, but also provide a basis for subsequent 3D modeling and rendering.

[0090] S105, generating a city color image according to the ground texture map.

[0091] In the specific implementation process, the corresponding city color image is generated according to the ground map, such as Figure 8 The image generation process takes into account visual effects such as lighting, shadows, and reflections, and mainly includes the following processing steps:

[0092] ① Lighting simulation: By using a high dynamic range image (HDRI) as an environment map, realistic lighting effects, including reflection and refraction, can be simulated in the rendering engine.

[0093] ②Shadow generation: The ray tracing algorithm can accurately calculate the shadow of each object, including soft shadows, hard shadows, and blurred effects on the shadow edges caused by atmospheric scattering.

[0094] ③Reflection processing: By using cubemaps and reflection probe technology, complex reflection effects, including dynamic reflections and highlight reflections, can be captured and simulated in the rendering engine.

[0095] ④ Color correction: Adjust the color balance and saturation of the entire scene in the post-processing stage.

[0096] ⑤Detail enhancement: These micro effects can be added during the rendering process by using detail enhancement algorithms, subsurface scattering and detail maps.

[0097] S106: Integrate the city color image with the three-dimensional model to generate a virtual city.

[0098] In the specific implementation process, a 3D model is created based on multiple parameters and vector map data, and the generated city color image is integrated with the 3D model to form a complete virtual city scene, such as Fig. 9 The integration process considers the spatial alignment and visual consistency between the city color image and the 3D model, both of which are key factors in achieving realistic and coherent virtual city scenes.

[0099] Among them, spatial alignment can ensure the precise match between the geographic information in the urban color image and the 3D model, which means that the positions of features such as roads, buildings, and vegetation in the image need to be exactly the same as the corresponding objects in the 3D model. This alignment usually relies on geographic information system (GIS) data and precise geographic references, such as latitude and longitude coordinates and altitude information. Visual consistency can ensure that the urban color image and the 3D model match in terms of color, texture, lighting, and shadow, ensure that the lighting direction and intensity in the urban color image and the 3D model are consistent, and that the hue, saturation, and contrast of the two are coordinated with each other.

[0100] Finally, the overall virtual city scene can also be optimized, including lighting, shadows, special effects, etc., to improve the realism and immersion of the virtual city scene. The optimization process may include dynamic weather systems, seasonal changes, and time lapse to increase the dynamics and interactivity of the scene.

[0101] In a possible embodiment, the specific steps of S103 include:

[0102] S1.1. Generate main road networks and rivers in the entire plot based on multiple parameters.

[0103] Specifically, according to the city size parameter value and the road complexity parameter value, a trunk road network is generated in the entire plot, and according to the water body ratio parameter, a river is generated in the entire plot. Figure 2 , is a schematic diagram of the main road network and rivers provided in an embodiment of the present application, where the solid line represents the main road network and the shaded part represents the river.

[0104] Considering that the trunk road network of a large city has a multi-level complex structure, including trunk roads, expressways and other road types, forming a grid and radial layout. The combination of ring roads and radial roads can effectively divert traffic, especially around the central urban area. The nodes in the trunk road network are dense, and the intersections and overpasses are designed in a variety of ways to meet the high-volume traffic needs in different directions. In addition, the design of multi-directional connections improves the traffic efficiency between regions and provides convenient traffic conversion capabilities within and outside the city. These factors together constitute a highly complex trunk road network system in large cities, supporting the high-density travel needs of the city.

[0105] Collect trunk road network datasets of different scales and layouts, such as OpenStreetMap (OSM) data from different places, including loops, radial layouts, interchange nodes and other features. In the training process of the Low-Rank Adaptation (LoRA) model, these features are used as conditional inputs so that the LoRA model can learn the hierarchy, connection mode and distribution law of the road network. Finally, the city size parameter value and road complexity parameter value are input into the trained LoRA model. Through continuous fine-tuning, the LoRA model can generate a complex trunk road network that meets the needs of urban traffic, with high-density nodes, multi-level connections and flexible traffic structure.

[0106] The water body ratio parameter plays a key role in river generation, which directly affects the coverage, location and shape of the river. A higher water body ratio will generate wider and more widespread rivers, which may contain multiple branches and riverbanks, while a lower water body ratio will generate relatively narrow and straightforward rivers. Using geographic information system (GIS) technology, according to the terrain characteristics and the location of low-lying areas in the area, the direction and shape of natural rivers can be simulated, making the generated rivers closer to the real landforms.

[0107] S1.2. Using the L-system algorithm and constraint rules, a secondary road network is generated on the entire plot based on the main road network and rivers.

[0108] Specifically, constraint rules can be set in advance. Constraint rules include global constraint rules and local constraint rules. Local constraint rules define the conditional judgment when generating road segments, such as plot range restrictions, road intersection detection, etc. Global constraint rules refer to determining the overall generation trend of the road network based on heat map information and direction control.

[0109] Initialize and configure the road generator, load the Shapefile data of land parcels, trunk road networks, rivers, etc. Use the L-system (Lindenmayer System, L-System) algorithm to select the initial road from the trunk road network, recursively apply the generation rules from the initial road, generate and expand the road structure, and dynamically adjust the generation strategy to ensure that the generated road network meets the local and global constraints. The specific steps are as follows:

[0110] Each newly generated road segment is checked to determine whether it meets the local constraint rules. The road segments that do not meet the local constraint rules are adjusted, including segmentation, alignment and reconnection. End alignment is to align the end intersections of the lines that are close to the road network branches to prevent too many intersections. The minimum angle of the road network is to prevent the generation of adjacent roads with a small angle or even parallel to the existing road network. The default end alignment distance is 100 meters, and the default minimum angle of the road network generation is 30 degrees, which can be adjusted by LLM according to user needs.

[0111] Generate a heat map based on Perlin noise. The heat map is used to represent the population density distribution (in the range of [-1, 1]). With reference to the heat map, a probability model is used to generate branch roads according to population density and direction parameters, and finally a complex road network is formed. When the population density is greater than -0.5, secondary roads are generated according to the road generation frequency, and the direction parameter is constrained according to the angle given in 3. The branch road generation frequency defaults to 0.4, and the maximum length of a single branch road defaults to 200 meters, which can be adjusted by LLM according to user needs.

[0112] Please refer to Figure 3 , which is a schematic diagram of the main road network, secondary road network and river provided in the embodiment of the present application, compared with Figure 2 , Figure 3 The extra solid lines in the figure are the newly generated secondary road network.

[0113] S1.3. Based on the road network formed by the trunk road network and the secondary road network, the entire plot is divided into multiple areas.

[0114] Specifically, the entire plot is divided into multiple areas based on the road network, including commercial areas, residential areas, industrial areas and park areas, such as Figure 4 As shown, shaded areas of different shades represent different areas.

[0115] S1.4. Determine a building area from multiple areas, fill the building area with buildings, and obtain vector map data.

[0116] Specifically, the multiple areas divided include building areas and supporting facilities areas, such as parking lots, green areas and squares, etc. Figure 5 As shown in the figure, the large dark shaded area is the building area, and the small light shaded area is the supporting facilities area. By filling the building area with buildings, we can obtain building data, and then combine it with the road network data, river data, park data and supporting facilities data obtained previously to obtain vector map data, thereby generating a vector map such as Figure 6 shown.

[0117] In the embodiment of the present application, the L-system is a recursive algorithm for generating self-similar patterns and fractal structures, which was originally used to simulate plant growth. Its core principle is based on the form of "rewriting rules". Simple generation rules are repeatedly iterated to generate complex structures and patterns. The road network generated by the L-system has high naturalness and diversity. No manual intervention is required, and the constraint rules can be flexibly adjusted to make the generated road network structure more in line with actual needs. And based on the multiple parameters obtained by conversion, vector maps can be automatically generated to improve the efficiency and accuracy of map generation.

[0118] In a possible embodiment, the specific steps of S1.3 include:

[0119] S2.1. Generate a buffer zone of the road network according to the width of the trunk road network and the width of the secondary road network.

[0120] Specifically, the buffer zone is the coverage area of ​​the road network. The buffer zone is the process of converting lines into surfaces. The buffer zone distance is determined based on the width of the main road network (for example, 30 meters) and the width of the secondary road network (for example, 20 meters) to determine the actual area occupied by the road.

[0121] S2.2. Based on the buffer zone of the road network, use the difference operation to cut the entire plot into multiple large plots.

[0122] Specifically, according to the generated buffer zone, the portion of the plot that does not conform to the road layout is clipped, and the entire plot is clipped into a final form that conforms to the road network layout, so as to achieve a segmentation effect in which the generated road and the plot are reasonably matched.

[0123] S2.3. Divide multiple large plots into commercial areas, residential areas, and industrial areas based on the distance from the centroid of each large plot to the city center.

[0124] Specifically, the city center is determined based on the centroids of multiple large plots. The centroids of multiple large plots can be averaged to obtain the location of the city center. Alternatively, the centroids of multiple large plots can be weighted averaged according to their area ratios to obtain the location of the city center. This method allows small plots with larger areas to have a greater impact on the centroid position while maintaining the geometric shape.

[0125] Further, the farthest point from the city center is obtained as the city distance length, half of the city distance length is multiplied by a first preset ratio (e.g., 0.3) to obtain the commercial area threshold, and half of the city distance length is multiplied by a second preset ratio (e.g., 0.7) to obtain the residential area threshold. Then, the distance from the centroid of each large plot to the city center is calculated, and large plots with a distance less than or equal to the commercial area threshold are classified as commercial areas, large plots with a distance greater than the commercial area threshold and less than the residential area threshold are classified as residential areas, and large plots with a distance greater than or equal to the residential area threshold are classified as industrial areas.

[0126] In a possible embodiment, after executing S2.3, a first plot may be randomly selected in the residential area, and the buffer zone generated according to the centroid of the first plot may be re-marked as a commercial area; a second plot may be randomly selected in the industrial area, and the buffer zone generated according to the centroid of the second plot may be re-marked as a residential area. This random expansion mode can simulate the distribution of a real city and has a variety of distribution methods.

[0127] The buffer distance is set to 100 meters by default and can be adjusted by LLM according to user needs. The number of the first large plot can be randomly selected from the first preset range, with the minimum value of 1 and the maximum value of 1 / 10 of the initial number of residential areas. The number of the second large plot can be randomly selected from the second preset range, with the minimum value of 1 and the maximum value of 1 / 10 of the initial number of industrial areas. Random selection within this range can ensure the randomness and diversity of the operation, avoid the situation of no plots, and ensure classification flexibility.

[0128] S2.4. Randomly select some large plots from multiple large plots as park areas.

[0129] Specifically, large plots are randomly selected to be set as park areas according to a random ratio (5%-10%), and the random ratio can be adjusted by LLM according to user needs.

[0130] Considering that in normal urban layout, parks are mainly located near residential and commercial areas, and parks are rarely built near industrial areas, in a possible embodiment, after executing S2.4, a buffer zone of the park area can also be generated, and the industrial area intersecting with the buffer zone of the park area can be re-marked as a residential area to ensure the rationality and livability of the area near the park. The buffer zone distance of the park area is 50 meters by default, which can be adjusted by LLM according to user needs.

[0131] In the embodiment of the present application, the entire plot is divided by the buffer and difference operations of the road network, ensuring that the shape and area of ​​each large plot are reasonable, and each large plot has clear boundaries, avoiding the problem of waste of resources or excessive overlap of regions. The location of the city center is determined according to the centroids of multiple large plots, and the location of the city center can be automatically adjusted according to actual conditions. The functional areas are divided according to the distance from the centroid of each large plot to the city center, which can effectively balance the needs and locations of different functional areas and ensure that the functions of each area conform to the laws of urban planning. Randomly generating park areas can avoid over-concentration of parks in certain areas, making park design more reasonable.

[0132] In a possible embodiment, the specific steps of S1.3 include:

[0133] S3.1. Divide each large plot into multiple small plots according to the area threshold corresponding to the regional type of each large plot.

[0134] Specifically, the longest side of each large plot is first calculated to determine the direction of the median when splitting, and random perturbations are introduced to generate the median. The perturbation coefficient range is [-0.1, 0.1], and the perturbation distance is the product of the perturbation coefficient and the length of the longest side, representing the distance that the median is offset to the left and right. This can avoid the monotony caused by regular splitting and make the splitting effect more natural. The larger the perturbation coefficient, the more shapes the plots can be divided into.

[0135] Based on the perpendicular midline of each large plot, each large plot is iteratively divided, and the operation is repeated until each small plot meets the preset area threshold. The area thresholds corresponding to different area types are different. For example: the minimum area corresponding to the commercial area can be set to 2,000 square meters and the corresponding maximum area can be set to 20,000 square meters. The minimum area corresponding to the industrial area can be set to 3,000 square meters and the corresponding maximum area can be set to 50,000 square meters. For residential areas close to the city center (for example, within 2 kilometers), the corresponding minimum area can be set to 1,000 square meters and the corresponding maximum area can be set to 5,000 square meters. For residential areas far from the city center (for example, within 2 kilometers), the corresponding minimum area is set to 200 square meters and the corresponding maximum area can be set to 2,000 square meters. These area thresholds can be adjusted by LLM according to user needs.

[0136] S3.2. All small plots that meet the preset conditions are marked as supporting facilities areas, and small plots other than supporting facilities areas are marked as building areas.

[0137] Specifically, first, based on the area function (Gaussian area formula) in the Geopandas library, the area of ​​all small plots (polygons) can be directly obtained.

[0138] Secondly, the multiple small plots divided from each large plot are divided into the same category. If the number of small plots of the same category is within the first threshold range (for example, less than or equal to 3), the small plots with an area less than the first preset area (for example, 1000) are marked as supporting facilities areas. If the number of small plots of the same category is within the second threshold range (for example, [5, 10]), small plots of the first proportion (for example, 10%) are randomly selected to be marked as supporting facilities areas, and small plots with an area less than the first preset area (for example, 1000) are preferentially selected for marking. If the number of small plots of the same category is within the third threshold range (for example, [10, 20]), small plots of the second proportion (for example, 20%) are randomly selected to be marked as supporting facilities areas, and small plots with an area less than the first preset area (for example, 1000) are preferentially selected for marking. If the number of small plots of the same category is within the fourth threshold range (for example, greater than 20), small plots of the third proportion (for example, 30%) are randomly selected to be marked as supporting facilities areas, and small plots with an area less than the first preset area (for example, 1000) are preferentially selected for marking.

[0139] Secondly, check all small plots, and mark the small plots with three vertices and an area less than the second preset area (e.g., 2000) as supporting facilities areas. Calculate the compactness of all small plots, and mark the small plots with a compactness less than the preset compactness (e.g., 0.4) as supporting facilities areas; the compactness formula is as follows:

[0140]

[0141] Among them, compactness is the compactness, area is the area of ​​the small plot (polygon), and perimeter is the side length of the small plot (polygon).

[0142] Finally, the supporting facilities area is divided into green areas, parking lots and squares according to the preset ratio, and the small plots outside the supporting facilities area are marked as building areas. The proportion distribution of buildings, green areas, parking lots and squares can be 0.6, 0.2, 0.15 and 0.05, and buildings, green areas and parking lots are randomly assigned attributes by allocating proportion probabilities. All the above threshold parameters are controlled by LLM.

[0143] S3.3. Fill the building area with buildings according to the maximum inscribed rectangle of each small plot to obtain vector map data.

[0144] In an embodiment of the present application, a large plot of land is divided into multiple small plots based on specific area types and area thresholds, which helps to more accurately control the use nature of each plot of land, and divide the qualified small plots into supporting facilities areas, so that the distribution of these areas is more reasonable, and by filling the building area with the maximum inscribed rectangle, it can be ensured that the building occupies the maximum available space of each small plot as much as possible, thereby reducing waste.

[0145] In a possible embodiment, the specific steps of S3.3 include:

[0146] S4.1. Calculate the maximum inscribed rectangle of each small plot in the building area.

[0147] In the specific implementation process, the maximum inscribed rectangle algorithm of small plots can be used to calculate the maximum inscribed rectangle of each small plot in the building area. Because the maximum inscribed rectangle algorithm is only valid for small plots placed horizontally, it is necessary to rotate each small plot in the building area to a horizontal state according to the longest side. After obtaining the maximum inscribed rectangle, the small plot is reversely rotated to restore to the original angle.

[0148] S4.2. Randomly select a maximum inscribed rectangle with a preset ratio from all maximum inscribed rectangles and fill it with buildings using prefabricated shapes. Use the cannibalization algorithm to fill the remaining maximum inscribed rectangles with buildings to obtain vector map data.

[0149] In the specific implementation process, the maximum inscribed rectangle of a preset proportion (for example, 40%) is randomly selected, and any one of a plurality of prefabricated shapes is randomly used for building filling, and the plurality of prefabricated shapes include basic characteristic building shapes such as rectangle, circle, hexagon, U-shape, T-shape, etc. The cannibalization algorithm is used for the remaining (for example, 60%) maximum inscribed rectangles, and the shape is obtained by random cannibalization for building filling. By default, 3 silkworms are used, and the number of cannibalization iterations is 2.

[0150] In the embodiments of the present application, prefabricated shapes can reduce design time and complexity. Using prefabricated shapes to fill building areas can quickly and standardizedly complete the design of part of the building. The cannibalization algorithm can perform fine space filling in the remaining building area, and it can automatically adapt to vacant plots of different shapes and sizes. Combining prefabricated shapes and cannibalization algorithms to obtain building shapes and fill them can achieve building diversification.

[0151] In a possible embodiment, the step of S105 includes:

[0152] S5.1. Optimize the ground texture map to obtain an optimized ground texture map.

[0153] Specifically, the optimization operation includes at least one of texture synthesis, color correction and lighting simulation. The original vector map data may only provide basic geometric shapes and simple color information. Through texture synthesis, multiple high-resolution texture images (for example, different slate textures, crack textures and wear effects) can be synthesized into a map to create a richer and more realistic square ground effect. The original texture may be gray or blue in color, which does not match the color of the actual building. Through color correction, the color balance of the texture can be adjusted to make it closer to the real building material color, such as adjusting the red of the brick wall texture or the gray of the concrete texture to match a specific architectural style. In order to simulate the lighting effects of different time periods, the wall map of the building can be simulated for lighting. For example, at sunset, the wall of the building will appear warm, while in the early morning, the wall of the building may appear cold. Through lighting simulation, dynamic lighting effects such as shadows, highlights and reflections can be added to the map to simulate changes in the position of the sun.

[0154] S5.2. Generate an initial city color image based on the optimized ground texture map.

[0155] Specifically, the execution process of S5.2 may refer to the execution process of S105, which will not be described in detail here.

[0156] S5.3. Perform image rendering operation on the initial city color image to obtain a city color image.

[0157] Specifically, the image rendering operation includes at least one of ray tracing, global illumination, and dynamic shadows. Ray tracing calculates the color and brightness of each pixel by simulating the propagation path of light in the scene, thereby generating highly realistic images, and often uses renderers such as RenderMan or V-Ray. Global illumination is achieved through technologies such as ray tracing, photon mapping, or path tracing, which can calculate multiple bounces of light in the scene to simulate complex lighting effects. Dynamic shadows are achieved through technologies such as shadow mapping or screen space ambient occlusion in real-time rendering engines, which can provide dynamic and realistic shadow effects while maintaining real-time performance.

[0158] In an embodiment of the present application, the generated ground map is optimized through operations such as texture synthesis, color correction and lighting simulation to improve the realism and detail of the ground map, and image rendering technologies such as ray tracing, global illumination and dynamic shadows are used to improve the visual effects of urban color images to achieve realistic urban landscapes.

[0159] In summary, the embodiments of the present application provide a method for generating a virtual city using natural language, which uses advanced natural language processing technology to convert the user's natural language into parameters for constructing a virtual city, including building density, city size, road complexity, architectural style, and water body proportion. By integrating a large language model, efficient and accurate conversion from natural language to city construction parameters is achieved. Based on the converted parameters, vector maps are automatically generated to improve the efficiency and accuracy of map generation. Real-time rendering technology is used to generate a virtual city with high realism and interactivity based on the vector map. A theory of progressive construction and expression of urban scenes is proposed to achieve multi-scale modeling of urban objects and scenes, and active progressive modeling is performed using multi-source heterogeneous data.

[0160] Based on the same inventive concept, Fig.10 As shown, the embodiment of the present application also provides a device for generating a virtual city using natural language, including:

[0161] The extraction module is used to use a large language model to perform deep semantic understanding of the user's natural language and extract key information;

[0162] A generation module, used for obtaining multiple parameters for constructing a virtual city according to key information;

[0163] An acquisition module, used for acquiring vector map data according to a plurality of parameters; the vector map data represents geographic information in the form of vector data;

[0164] A conversion module, for generating a ground texture map based on the vector map data using an artificial intelligence content generation algorithm; the ground texture map is used to represent texture and color information of ground features;

[0165] The generation module is also used to generate a city color image based on the ground texture map; integrate the city color image with the three-dimensional model to generate a virtual city; the three-dimensional model is constructed based on multiple parameters and vector map data.

[0166] It should be noted that the modules in the device for generating a virtual city using natural language in this embodiment correspond one-to-one to the steps in the method for generating a virtual city using natural language in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned method for generating a virtual city using natural language, which will not be repeated here.

[0167] In addition, in one embodiment, the present application also provides a computer device, which includes a processor, a memory, and a computer program stored in the memory, and when the computer program is executed by the processor, it implements the aforementioned method of generating a virtual city using natural language.

[0168] In addition, in one embodiment, the present application also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the aforementioned method of generating a virtual city using natural language is implemented.

[0169] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0170] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0171] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0172] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for generating a virtual city using natural language, characterized in that: include: Use a large language model to deeply understand the user's natural language and extract key information; According to the key information, a plurality of parameters for constructing a virtual city are obtained; According to the plurality of parameters, obtaining vector map data; The vector map data represents geographic information in the form of vector data; Generate a ground texture map based on the vector map data using an artificial intelligence content generation algorithm; the ground texture map is used to represent texture and color information of ground features; Generating a city color image according to the ground texture map; Integrate the city color image with the three-dimensional model to generate a virtual city; The three-dimensional model is created based on the plurality of parameters and the vector map data.

2. The method for generating a virtual city using natural language according to claim 1, characterized in that: The multiple parameters include building density parameter value, city size parameter value, road complexity parameter value, building style parameter value, and water body proportion parameter value; the multiple parameters for constructing a virtual city are obtained based on the key information, including: If the key information includes high-rise buildings, the building density parameter value is obtained according to the ratio of the total building base area to the total land area; If the key information includes city size, then obtaining a city size parameter value based on population size or geographic area or number of buildings; If the key information includes road complexity, then obtaining a road complexity parameter value according to the information entropy of each road direction angle; If the key information includes an architectural style, determining the architectural style parameter value corresponding to the keyword according to the keyword about the architectural style in the key information; If the key information includes the proportion of water bodies, the water body proportion parameter value is obtained according to the ratio of the water body area to the total urban area.

3. The method for generating a virtual city using natural language according to claim 1, characterized in that: The step of obtaining vector map data according to the plurality of parameters comprises: According to the plurality of parameters, a main road network and rivers are generated in the entire plot; Using an L-system algorithm and constraint rules, a secondary road network is generated on the entire plot according to the main road network and the river; According to the road network formed by the main road network and the secondary road network, the entire plot is divided into multiple areas; A building area is determined from the multiple areas, and building filling is performed on the building area to obtain vector map data.

4. The method for generating a virtual city using natural language as claimed in claim 3, characterized in that: The road network formed by the main road network and the secondary road network is used to partition the entire land parcel to obtain a plurality of areas, including: Generating a buffer zone of the road network according to the width of the trunk road network and the width of the secondary road network; According to the buffer zone of the road network, using a difference operation to cut the entire plot into a plurality of large plots; Dividing the plurality of large plots into commercial areas, residential areas and industrial areas according to the distance from the centroid of each large plot to the city center; the city center is determined according to the centroids of the plurality of large plots; Some large plots are randomly selected from the plurality of large plots as park areas.

5. The method for generating a virtual city using natural language as claimed in claim 4, characterized in that: The step of determining a building area from the multiple areas, performing building filling on the building area, and obtaining vector map data includes: According to the area threshold corresponding to the regional type of each large plot, each large plot is divided into multiple small plots; Mark all small plots that meet preset conditions as supporting facilities areas, and mark all small plots other than the supporting facilities areas as building areas; The building area is filled with buildings according to the maximum inscribed rectangle of each small plot, so as to obtain vector map data.

6. The method for generating a virtual city using natural language as claimed in claim 5, characterized in that: The step of filling the building area with buildings according to the maximum inscribed rectangle of each small plot of land to obtain vector map data includes: Calculate the maximum inscribed rectangle of each small plot in the building area; From all the maximum inscribed rectangles, a maximum inscribed rectangle with a preset proportion is randomly selected and filled with buildings using prefabricated shapes. The remaining maximum inscribed rectangles are filled with buildings using a cannibalization algorithm to obtain vector map data.

7. The method for generating a virtual city using natural language according to claim 1, characterized in that: The step of generating a city color image according to the ground texture map comprises: Performing an optimization operation on the ground texture map to obtain an optimized ground texture map; the optimization operation includes texture synthesis, color correction and lighting simulation; Generating an initial city color image according to the optimized ground texture map; An image rendering operation is performed on the initial city color image to obtain a city color image; the image rendering operation includes ray tracing, global illumination and dynamic shadow.

8. A device for generating a virtual city using natural language, characterized in that: include: The extraction module is used to use a large language model to perform deep semantic understanding of the user's natural language and extract key information; An acquisition module, used to acquire a plurality of parameters for constructing a virtual city according to the key information; and to acquire vector map data according to the plurality of parameters; The vector map data represents geographic information in the form of vector data; A generation module, used to generate a ground texture map according to the vector map data by using an artificial intelligence content generation algorithm; the ground texture map is used to represent the texture and color information of ground features; based on the ground texture map, a city color image is generated; and the city color image is integrated with a three-dimensional model to generate a virtual city; The three-dimensional model is created based on the plurality of parameters and the vector map data.

9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method for generating a virtual city using a natural language as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the method for generating a virtual city using natural language according to any one of claims 1 to 7.