A method and device for three-dimensional terrain generation and model training based on artificial intelligence

Through the three-dimensional terrain generation method based on artificial intelligence, prompt words are used to generate terrain height maps and road grids, combined with material maps, to automatically generate virtual terrain scenes, which solves the problem of low efficiency in generating virtual terrain scenes in the existing technology and achieves high efficiency. , Realistic scene generation.

CN118052949BActive Publication Date: 2024-09-06LUNGFISH CULTURE TECH (DALIAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410453776.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-16
Publication Date
2024-09-06
Estimated Expiration
2044-04-16

AI Technical Summary

Technical Problem

The efficiency of generating virtual terrain scenes in the existing technology is low, requiring the cooperation of multiple teams, investing a lot of time in each link, and often requiring multiple modifications and adjustments.

Method used

Using a three-dimensional terrain generation method based on artificial intelligence, a terrain height map is generated by inputting prompt words into the terrain generation model. It combines road grids and terrain material maps to automatically generate three-dimensional terrain scenes, integrating modeling, mapping, lighting and other links into one program. ization process.

Benefits of technology

It improves the efficiency of generating virtual terrain scenes, reduces costs, simplifies the process, makes the generated scenes more realistic, meets specific needs, and saves human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118052949B
    Figure CN118052949B
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for three-dimensional terrain generation and model training based on artificial intelligence, which relates to the field of three-dimensional model technology, including: inputting prompt words into a terrain generation model to generate a terrain height map, the terrain generation model is obtained by training a first diffusion neural network based on training terrain data with terrain identifiers pre-added, the training terrain data contains first sample DEM data representing the terrain of a real scene, and the terrain identifier is used to mark the terrain type of the terrain area indicated in the training terrain data; then, based on the terrain height map, a three-dimensional terrain grid is generated, a road map matching the terrain height map is obtained, and then a three-dimensional road grid is generated, a terrain material map is obtained, and finally the terrain grid, road grid and terrain material map are combined to generate a three-dimensional terrain scene. The solution provided by the embodiment of the present invention can improve the efficiency of generating virtual terrain scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of three-dimensional model technology, and in particular to a three-dimensional terrain generation and model training method and device based on artificial intelligence. Background Art

[0002] In electronic games or related real-life software, in order to provide better realism and interactivity, the producer will choose to generate a virtual terrain scene as the basic operating environment. In related technologies, the generation of a complete terrain scene first requires planners to plan the scene, build a white model of the basic structure, determine the theme, style, layout and lighting of the scene, and rely on the white box for preliminary playability testing. Afterwards, the art original painting staff draws the corresponding original painting according to the structure of the white box and the art style requirements proposed by the planner. The art modeling staff makes the corresponding scene model and still life model according to the structural proportions in the white box and the art original painting. After that, the ground editor will integrate the completed art resources and build a formed test scene in the engine, making terrain, placing still life, adjusting the light and shadow atmosphere, etc. Finally, the tester will test the scene for vulnerabilities, and the team will simultaneously fix the vulnerabilities found. At this point, a terrain scene is considered to be successfully generated.

[0003] In related technologies, the generation of terrain scenes requires multiple steps such as modeling, mapping, lighting, and animation. Each step requires a lot of time and often requires multiple modifications and adjustments, which makes the time required to generate a virtual terrain scene long and the efficiency of generating terrain scenes low. Summary of the invention

[0004] The purpose of the embodiment of the present invention is to provide a method and device for three-dimensional terrain generation and model training based on artificial intelligence to improve the efficiency of generating virtual terrain scenes. The specific technical solution is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for generating three-dimensional terrain based on artificial intelligence, the method comprising:

[0006] Inputting a prompt word into the terrain generation model to generate a terrain height map, wherein the prompt word is used to indicate the terrain type, the terrain generation model is obtained by training a first diffusion neural network based on training terrain data with terrain identifiers pre-added, the training terrain data includes first sample digital elevation model (DEM) data representing a real scene terrain, and the terrain identifier is used to mark the terrain type of the terrain area indicated in the training terrain data;

[0007] Generate a three-dimensional terrain grid based on the terrain height map;

[0008] Obtain a road map that matches the above terrain height map;

[0009] Generate a three-dimensional road grid based on the road map;

[0010] Get terrain material map;

[0011] The terrain grid, the road grid and the terrain material map are combined to generate a three-dimensional terrain scene.

[0012] In one embodiment of the present invention, the step of obtaining a road map matching the terrain height map includes:

[0013] The terrain height map is input into a road generation model to generate a road map, wherein the road generation model is obtained by training a second diffusion neural network based on second sample DEM data and sample digital line model DLM data, and the second sample DEM data and the sample DLM data respectively represent the terrain of a terrain area in a real scene and the roads in the terrain area.

[0014] In one embodiment of the present invention, the terrain type marked by the above-mentioned terrain identifier includes at least one of the following types: water area, mountain range, valley, hill, plateau, cliff, island, basin, plain, peak.

[0015] In a second aspect, an embodiment of the present invention provides a method for training a three-dimensional terrain generation model based on artificial intelligence, the method comprising:

[0016] Determine the terrain types of different terrain areas represented by the training terrain data, and add a terrain identifier representing the terrain type corresponding to the terrain area to each terrain area, wherein the training terrain data includes first sample digital elevation model DEM data representing the terrain of a real scene;

[0017] The first diffusion neural network is trained based on the training terrain data after adding terrain identification to obtain a trained terrain generation model. The terrain generation model is used to output a terrain height map matching the prompt word after obtaining the input prompt word for indicating the terrain type.

[0018] In one embodiment of the present invention, the above-mentioned training terrain data includes DEM data corresponding to the real scene and / or data generated by scientific terrain generation software.

[0019] In a third aspect, an embodiment of the present invention provides a road generation model training method based on artificial intelligence, the method comprising:

[0020] Obtaining second sample digital elevation model DEM data and sample digital line model DLM data, wherein the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the road in the terrain area;

[0021] The second diffusion neural network is trained based on the second sample DEM data and the sample DLM data to obtain a trained road generation model, which is used to output a road map adapted to the terrain represented by the terrain height map after obtaining the input terrain height map.

[0022] In a fourth aspect, an embodiment of the present invention provides a three-dimensional terrain generation device based on artificial intelligence, the device comprising:

[0023] A first generation module is used to input a prompt word into a terrain generation model to generate a terrain height map, wherein the prompt word is used to indicate a terrain type, the terrain generation model is obtained by training a first diffusion neural network based on training terrain data with terrain identifiers added in advance, the training terrain data includes first sample digital elevation model DEM data representing a real scene terrain, and the terrain identifier is used to mark the terrain type of the terrain area indicated in the training terrain data;

[0024] A second generation module is used to generate a three-dimensional terrain grid based on the terrain height map;

[0025] A road map acquisition module is used to obtain a road map that matches the terrain height map;

[0026] A third generation module is used to generate a three-dimensional road grid based on the road map;

[0027] The first acquisition module is used to obtain the terrain material map;

[0028] The fourth generation module is used to combine the terrain grid, the road grid and the terrain material map to generate a three-dimensional terrain scene.

[0029] In one embodiment of the present invention, the road map obtaining module is specifically used for:

[0030] The terrain height map is input into a road generation model to generate a road map, wherein the road generation model is obtained by training a second diffusion neural network based on second sample DEM data and sample digital line model DLM data, and the second sample DEM data and the sample DLM data respectively represent the terrain of a terrain area in a real scene and the roads in the terrain area.

[0031] In one embodiment of the present invention, the terrain type marked by the above-mentioned terrain identifier includes at least one of the following types: water area, mountain range, valley, hill, plateau, cliff, island, basin, plain, peak.

[0032] In a fifth aspect, an embodiment of the present invention provides a three-dimensional terrain generation model training device based on artificial intelligence, the device comprising:

[0033] A determination and addition module, used for determining the terrain types of different terrain areas represented by training terrain data, and adding terrain identifiers representing the terrain types corresponding to the terrain areas to each terrain area, wherein the training terrain data includes first sample digital elevation model DEM data representing the terrain of a real scene;

[0034] The first training module is used to train the first diffusion neural network based on the above-mentioned training terrain data after adding terrain identification to obtain a trained terrain generation model. The above-mentioned terrain generation model is used to output a terrain height map matching the above-mentioned prompt word after obtaining the input prompt word for representing the terrain type.

[0035] In one embodiment of the present invention, the above-mentioned training terrain data includes DEM data corresponding to the real scene and / or data generated by scientific terrain generation software.

[0036] In a sixth aspect, an embodiment of the present invention provides a road generation model training device based on artificial intelligence, the device comprising:

[0037] A second acquisition module is used to obtain second sample digital elevation model DEM data and sample digital line model DLM data, wherein the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the road in the terrain area;

[0038] The second training module is used to train the second diffusion neural network based on the second sample DEM data and the sample DLM data to obtain a trained road generation model. The road generation model is used to output a road map adapted to the terrain represented by the terrain height map after obtaining the input terrain height map.

[0039] In a seventh aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0040] Memory, used to store computer programs;

[0041] The processor is used to implement any one of the method steps in the first aspect, the second aspect or the third aspect when executing the program stored in the memory.

[0042] In an eighth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of any one of the first aspect, the second aspect, or the third aspect are implemented.

[0043] Beneficial effects of the embodiments of the present invention:

[0044] An embodiment of the present invention provides a three-dimensional terrain generation method based on artificial intelligence, inputting prompt words into a terrain generation model to generate a terrain height map, wherein the terrain generation model is obtained by training a first diffusion neural network based on training terrain data with terrain identifiers pre-added, wherein the training terrain data includes first sample DEM (Digital Elevation Model) data representing a real scene terrain, and the terrain identifier is used to mark the terrain type of the terrain area indicated in the training terrain data; then, a three-dimensional terrain grid is generated based on the terrain height map, a road map matching the terrain height map is obtained, and then a three-dimensional road grid is generated, a terrain material map is obtained, and finally, the terrain grid, the road grid and the terrain material map are combined to generate a three-dimensional terrain scene.

[0045] As can be seen from the above, in the solution provided by the embodiment of the present invention, compared with the terrain generation method in the related art that requires multiple teams to cooperate with each other to jointly complete multiple links such as modeling, mapping, lighting, animation, etc., the embodiment of the present invention uses a terrain generation model that can generate a terrain height map according to prompt words, automatically generates a terrain height map that meets the requirements, and then generates a terrain grid, and combines the road grid and terrain material mapping to generate the required three-dimensional virtual terrain scene. The embodiment of the present invention integrates the links in the related art that require multiple teams to cooperate with each other into a procedural terrain generation process, which reduces the time required to generate a virtual terrain scene, makes the generation method of the virtual terrain scene more centralized, and can improve the efficiency of generating a virtual terrain scene.

[0046] Moreover, the embodiment of the present invention only needs to input specific prompt words into the terrain generation model, and after a series of automated procedures, the required terrain scene can be finally generated. This not only makes the use threshold of the solution provided by the embodiment of the present invention low, but also does not require a large amount of human resources, and can save the cost required for generating terrain scenes; by adjusting the prompt words, a terrain scene that meets specific needs can be generated, so the embodiment of the present invention can flexibly generate terrain scenes according to needs.

[0047] In addition, since the first sample DEM data represents the terrain of a real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain a terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation, and thus can make the final generated three-dimensional terrain scene more realistic and the performance effect closer to the real scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0049] Figure 1 A schematic diagram of a process flow of a first artificial intelligence-based three-dimensional terrain generation method provided in an embodiment of the present invention;

[0050] Figure 2 A schematic flow chart of a second method for generating three-dimensional terrain based on artificial intelligence provided by an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of a flow chart of a three-dimensional terrain generation model training method based on artificial intelligence provided by an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of a process flow of a road generation model training method based on artificial intelligence provided by an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of a flow chart of a third method for generating three-dimensional terrain based on artificial intelligence provided by an embodiment of the present invention;

[0054] Figure 6 A schematic diagram of the structure of a three-dimensional terrain generation device based on artificial intelligence provided by an embodiment of the present invention;

[0055] Figure 7 A schematic diagram of the structure of a three-dimensional terrain generation model training device based on artificial intelligence provided by an embodiment of the present invention;

[0056] Figure 8 A schematic diagram of the structure of a road generation model training device based on artificial intelligence provided by an embodiment of the present invention;

[0057] Fig. 9 A schematic diagram of the structure of a first electronic device provided by an embodiment of the present invention;

[0058] Fig.10 A schematic diagram of the structure of a second electronic device provided by an embodiment of the present invention;

[0059] Fig.11 A schematic structural diagram of a third electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on the present invention belong to the scope of protection of the present invention.

[0061] In related technologies, the generation of terrain scenes requires multiple teams, and goes through multiple links such as modeling, mapping, lighting, and animation. Each link requires a lot of time and often requires multiple modifications and adjustments, which makes the time required to generate a virtual terrain scene longer and the efficiency of generating terrain scenes lower.

[0062] In order to solve the above problems, the embodiments of the present invention provide a method and device for three-dimensional terrain generation and model training based on artificial intelligence, which are described in detail below.

[0063] First, a three-dimensional terrain generation method based on artificial intelligence provided by an embodiment of the present invention is described.

[0064] See also Figure 1 , which is a flow chart of a first artificial intelligence-based three-dimensional terrain generation method provided in an embodiment of the present invention. The method can be applied to an electronic device with computing capabilities. The method includes the following steps S101 to S106.

[0065] Step S101: input prompt words into the terrain generation model to generate a terrain height map.

[0066] Among them, the above-mentioned prompt words are used to indicate the terrain type, the above-mentioned terrain generation model is obtained by training the first diffusion neural network based on the training terrain data with terrain identifiers pre-added, the above-mentioned training terrain data contains the first sample DEM data representing the terrain of the real scene, and the above-mentioned terrain identifier is used to mark the terrain type of the terrain area indicated in the above-mentioned training terrain data.

[0067] Specifically, the function of the first diffusion neural network is the same as that of the terrain generation model, both of which are: based on the obtained prompt word for indicating the terrain type, a terrain height map matching the prompt word is generated; in the embodiment of the present invention, the trained first diffusion neural network is referred to as a terrain generation model. When training the first diffusion neural network, the source of the first sample DEM data can be a DEM open source data source, a high-precision commercial DEM, etc.; the training terrain data can also include data generated by scientific terrain generation software, such as World Creator (a scientific terrain generation software) and World Machine (a scientific terrain generation software), so as to improve the data diversity of the training terrain data, so that the terrain height map generated by the terrain generation model can be more easily met. Specifically, the first sample DEM data and the data generated by the scientific terrain generation software used in the embodiment of the present invention are grayscale image data.

[0068] In the embodiment of the present invention, the specific internal structure of the first diffusion neural network is not limited, as long as the first diffusion neural network can generate a terrain height map matching the prompt word based on the prompt word obtained to represent the terrain type.

[0069] In one embodiment of the present invention, the terrain type marked by the above-mentioned terrain identifier includes at least one of the following types: water area, mountain range, valley, hill, plateau, cliff, island, basin, plain, peak. That is to say, corresponding to different terrain types, the corresponding terrain identifier can be water area, mountain range, valley, etc. Of course, the terrain type is not limited to the above description, and the terrain type can also include beach, glacier, trench, etc.; since the terrain identifier corresponds to the terrain type one by one, the terrain identifier can also be beach, glacier, trench, etc. The corresponding terrain type can be divided according to the actual situation of the training terrain data.

[0070] In the embodiment of the present invention, since the prompt word indicates the terrain type, the corresponding prompt word is set according to the required terrain type, that is, the prompt word includes the terrain identification name corresponding to the terrain type. For example, if the required terrain type is a beach, the prompt word may be: beach; if the required terrain type is a mountain, the prompt word may be: mountain. Specifically, when the prompt word includes the terrain identification name corresponding to the terrain type, the prompt word may be further refined so that the terrain generation model generates a terrain height map that meets the requirements. For example, if the required terrain type is a beach, the prompt word may be: a large area of ​​beach; if the required terrain type is a mountain, the prompt word may be: a mountain above 500m or there is a mountain. The prompt word can be adjusted according to actual needs.

[0071] Specifically, the prompt words can be manually input into the terrain generation model, or the edited prompt words can be stored in advance, and when the terrain height map needs to be generated, the prompt words are automatically imported into the terrain generation model, or multiple optional prompt word options are set, and the user selects the corresponding prompt word according to the needs. Of course, no matter which prompt word input method is used, the user is allowed to manually input the prompt word into the terrain generation model according to the needs.

[0072] Step S102: Generate a three-dimensional terrain grid based on the terrain height map.

[0073] In computer graphics, a terrain height map is generally regarded as a two-dimensional array, and each element in the array represents the height of a terrain sampling point. After obtaining the terrain height map, the terrain height map is generally converted into a triangular mesh, and then subsequent processing is performed on this basis. Specifically, in the embodiment of the present invention, the terrain height map can be processed using existing related technologies to generate a three-dimensional terrain mesh, such as using a related algorithm to process the terrain height map to generate a three-dimensional terrain mesh. The related algorithm can be an algorithm based on parametric surfaces, an algorithm based on voxels or point clouds, etc., and a suitable algorithm can be selected according to needs.

[0074] Step S103: Obtain a road map that matches the terrain height map.

[0075] After obtaining the terrain height map, the terrain-related data therein is analyzed to identify the passable area. Generally, the passable area corresponds to the terrain data with relatively low height and gentle slope in the terrain height map. Specifically, in the embodiment of the present invention, the terrain height map can be processed by existing related technologies to generate a road map, such as using a related algorithm to process the terrain height map to generate a road map. The related algorithm can be a gradient-based algorithm, a simulation-based algorithm, a hybrid algorithm, etc., and a suitable algorithm can be selected according to the needs. In addition, after the road map is generated, the road map can be optimized and adjusted as needed.

[0076] In another case, a road map that matches the terrain height map can be manually obtained based on the terrain height map by using a related method of manually generating a road map.

[0077] Step S104: Generate a three-dimensional road grid based on the road map.

[0078] Specifically, the road map generated in step S103 shows the interactive relationship between the road route and the terrain, which provides guidance for the generation of the road grid. The road map can be used to obtain relevant data of the road design, such as the direction, width, slope and other data of the road, and then generate the road centerline, and generate a three-dimensional road grid according to the coordinates of the road centerline. Specifically, in the embodiment of the present invention, the road map can be processed by existing related technologies to generate a three-dimensional road grid, such as using a related algorithm to process the road map to generate a three-dimensional road grid. The related algorithm can be a quadtree algorithm, a minimum spanning tree algorithm, a Bezier curve algorithm, etc., and a suitable algorithm can be selected according to the needs. In addition, after the road grid is generated, the road grid can be optimized and adjusted according to the needs.

[0079] Step S105: Obtain terrain material map.

[0080] Terrain material is a material that simulates the surface features of the ground in a virtual scene. Terrain material can affect the lighting effect and shadow performance, add details and textures to the scene, etc. The reasonable use of terrain material can enhance the realism and immersion of the scene, making the terrain scene present a highly realistic and visual effect. In the embodiment of the present invention, the existing relevant technology can be used to generate terrain material maps, so that terrain materials can be added to the terrain scene later. Specifically, relevant software such as Quixel Bridge, 3ds Max, ZBrush, Maya, Substance Painter, etc. can be used to generate terrain material maps.

[0081] Step S106: Combining the terrain grid, the road grid and the terrain texture map to generate a three-dimensional terrain scene.

[0082] After generating the terrain grid and road grid and obtaining the terrain material map, a three-dimensional terrain scene is finally generated on this basis. In the embodiment of the present invention, the three-dimensional terrain scene can be generated based on the terrain grid, road grid and terrain material map using existing related technologies. In the process of generating the terrain scene, appropriate texture mapping technology and lighting technology can also be used to make the generated terrain scene more natural and realistic.

[0083] As can be seen from the above, in the solution provided by the embodiment of the present invention, compared with the terrain generation method in the related art that requires multiple teams to cooperate with each other to jointly complete multiple links such as modeling, mapping, lighting, animation, etc., the embodiment of the present invention uses a terrain generation model that can generate a terrain height map according to prompt words, automatically generates a terrain height map that meets the requirements, and then generates a terrain grid, and combines the road grid and terrain material mapping to generate the required three-dimensional virtual terrain scene. The embodiment of the present invention integrates the links in the related art that require multiple teams to cooperate with each other into a procedural terrain generation process, which reduces the time required to generate a virtual terrain scene, makes the generation method of the virtual terrain scene more centralized, and can improve the efficiency of generating a virtual terrain scene.

[0084] Moreover, the embodiment of the present invention only needs to input specific prompt words into the terrain generation model, and after a series of automated procedures, the required terrain scene can be finally generated. This not only makes the use threshold of the solution provided by the embodiment of the present invention low, but also does not require a large amount of human resources, and can save the cost required for generating terrain scenes; by adjusting the prompt words, a terrain scene that meets specific needs can be generated, so the embodiment of the present invention can flexibly generate terrain scenes according to needs.

[0085] In addition, since the first sample DEM data represents the terrain of a real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain a terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation, and thus can make the final generated three-dimensional terrain scene more realistic and the performance effect closer to the real scene.

[0086] See also Figure 2 , is a flow chart of a second method for generating three-dimensional terrain based on artificial intelligence provided by an embodiment of the present invention. Figure 2 In the embodiment shown, a special algorithm is used to process the terrain height map to generate a road map. Figure 1 Compared with the embodiment shown, the aforementioned step S103 can be implemented by the following step S103A.

[0087] Step S103A: Input the terrain height map into the road generation model to generate a road map.

[0088] The road generation model is obtained by training the second diffusion neural network based on the second sample DEM data and the sample DLM (Digital Line Model) data. The second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the road in the terrain area. In addition, the source of the second sample DEM data can be a DEM open source data source, a high-precision commercial DEM, etc. The data content of the second sample DEM data and the first sample DEM data can be the same, partially the same, or completely different. The sample DLM data comes from the DLM open source data source.

[0089] Specifically, the function of the second diffusion neural network is the same as that of the road generation model, that is, generating a road map based on a terrain height map. In the embodiment of the present invention, the trained second diffusion neural network is referred to as a road generation model.

[0090] In the embodiment of the present invention, the specific internal structure of the second diffusion neural network is not limited, as long as the second diffusion neural network can generate a corresponding road map based on the terrain height map.

[0091] As can be seen from the above, in the solution provided by the embodiment of the present invention, a special algorithm, namely the road generation model, is used to process the terrain height map to generate a road map. In addition, since the road generation model is trained based on the second sample DEM data and the sample DLM data, the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the road in the terrain area, the road map generated by the road generation model can be closer to the actual situation.

[0092] Corresponding to the aforementioned artificial intelligence-based three-dimensional terrain generation method, the embodiment of the present invention also provides a model training method for this method. Figure 3 , which is a flow chart of a three-dimensional terrain generation model training method based on artificial intelligence provided in an embodiment of the present invention, which is applied to an electronic device with computing capabilities, and includes the following steps S301 and S302.

[0093] Step S301: determine the terrain types of different terrain areas represented by the training terrain data, and add a terrain identifier representing the terrain type corresponding to each terrain area.

[0094] The training terrain data mentioned above includes first sample DEM data representing the terrain of a real scene.

[0095] The source of the first sample DEM data may be a DEM open source data source, a high-precision commercial DEM, etc. In one embodiment of the present invention, the training terrain data includes DEM data corresponding to a real scene and / or data generated by scientific terrain generation software, that is, in one case, the training terrain data includes not only DEM data, but also data generated by scientific terrain generation software, such as data generated by World Creator and World Machine, so as to improve the data diversity of the training terrain data, so that the terrain height map generated by the final terrain generation model can more easily meet the needs.

[0096] After the training terrain data is acquired, a terrain identifier representing the terrain type corresponding to the terrain area is added to each terrain area in the training terrain data.

[0097] For the first sample DEM data, the data is first divided into terrain types, that is, the first sample DEM data is divided into different data segments, and different data segments correspond to different terrain types, including water areas, mountains, valleys, hills, plateaus, cliffs, islands, basins, etc. Specifically, the first sample DEM data can be divided into data segments corresponding to different terrain types according to height, slope, slope threshold, etc. For example, if the average height of a part of DEM data is within a preset range, the part of DEM data is divided into a plain; if the slope of a part of DEM data is greater than a preset value, the part of DEM data is divided into a cliff; etc. After the division is completed, the corresponding terrain identifier is added to each part of the data.

[0098] For the data generated by the scientific terrain generation software, it can be set before the data is generated to generate data of the target terrain type, so the data generated by the scientific terrain generation software is data that has been divided into different terrain types. After obtaining the data generated by the scientific terrain generation software, the corresponding terrain identifiers can be directly added to the data of different parts according to the previous setting information.

[0099] Specifically, the terrain identifier is the name of the corresponding terrain type. For example, if the terrain type corresponding to a portion of the data is a mountain range, the terrain identifier of the portion of the data is a mountain range. Terrain identifiers can be added to different portions of the training terrain data manually, or by using an appropriate algorithm.

[0100] Step S302: training the first diffusion neural network based on the training terrain data after adding terrain identification to obtain a trained terrain generation model.

[0101] The terrain generation model is used to output a terrain height map matching the prompt word after obtaining the input prompt word for indicating the terrain type.

[0102] In the embodiment of the present invention, the specific internal structure of the first diffusion neural network is not limited, as long as the first diffusion neural network can generate a terrain height map matching the prompt word based on the obtained prompt word for representing the terrain type.

[0103] After obtaining the training terrain data with terrain identification added, the training terrain data is input into the first diffusion neural network so that the first diffusion neural network learns the relationship between the terrain data and the terrain type.

[0104] Afterwards, a prompt word is input into the first diffusion neural network, and the prompt word can be a beach or a mountain, etc., to generate a corresponding terrain height map. If the generated terrain height map meets the preset requirements, it is confirmed that the first diffusion neural network has been trained and a terrain generation model is obtained; if the generated terrain height map does not meet the preset requirements, the parameters of the first diffusion neural network are adjusted, and the first diffusion neural network with adjusted parameters is continuously trained until the generated terrain height map meets the preset requirements, and it is confirmed that the first diffusion neural network has been trained and a terrain generation model is obtained.

[0105] Specifically, during the training process, a suitable loss function can be used to measure the generated terrain height map to determine how to adjust the parameters of the first diffusion neural network. In addition, the parameters of the first diffusion neural network can be adjusted automatically through programming or through manual judgment.

[0106] As can be seen from the above, in the solution provided by the embodiment of the present invention, by using the training terrain data after adding terrain identification to train the first diffusion neural network, a terrain generation model that generates a terrain height map according to the prompt word can be obtained. In addition, since the first sample DEM data represents the terrain of the real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain the terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation.

[0107] Corresponding to the manner of generating a terrain road map in the aforementioned artificial intelligence-based three-dimensional terrain generation method, the embodiment of the present invention further provides the following Figure 4 The artificial intelligence-based road generation model training method shown.

[0108] See also Figure 4 , which is a flow chart of a road generation model training method based on artificial intelligence provided by an embodiment of the present invention, which is applied to an electronic device with computing capabilities, and includes the following steps S401 and S402.

[0109] Step S401: Obtain second sample DEM data and sample DLM data.

[0110] The second sample DEM data and the sample DLM data respectively represent the terrain of a terrain area in a real scene and the roads in the terrain area.

[0111] Specifically, the source of the second sample DEM data may be a DEM open source data source, a high-precision commercial DEM, etc., and the sample DLM data comes from a DLM open source data source.

[0112] Step S402: training the second diffusion neural network based on the second sample DEM data and the sample DLM data to obtain a trained road generation model.

[0113] The road generation model is used to output a road map adapted to the terrain represented by the terrain height map after obtaining the input terrain height map.

[0114] In the embodiment of the present invention, the specific internal structure of the second diffusion neural network is not limited, as long as the second diffusion neural network can generate a corresponding road map based on the terrain height map.

[0115] The obtained second sample DEM data and sample DLM data are input into the second diffusion neural network to train the second diffusion neural network. During the training process, the parameters of the second diffusion neural network can be adjusted based on a suitable loss function and the training can be continued. After the training termination condition is reached, the road generation model is obtained.

[0116] As can be seen from the above, in the solution provided by the embodiment of the present invention, by using the second sample DEM data and the sample DLM data to train the second diffusion neural network, a road generation model for generating a road map can be obtained. In addition, since the road generation model is trained based on the second sample DEM data and the sample DLM data, the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the roads in the terrain area, the road map generated using the road generation model can be closer to the actual situation.

[0117] See also Figure 5 , which is a flow chart of a third method for generating three-dimensional terrain based on artificial intelligence provided in an embodiment of the present invention. The method is applied to an electronic device with computing capabilities and includes the following steps S501 to S512.

[0118] Step S501: Obtain the first sample DEM data.

[0119] Step S502: Determine the terrain types of different terrain areas represented by the first sample DEM data.

[0120] Step S503: Acquire data generated by scientific terrain generation software.

[0121] Specifically, the embodiment of the present invention does not limit the execution order of step S503 and step S501 or step S502.

[0122] Step S504: The first sample DEM data and the data generated by the scientific terrain generation software are combined to determine as training terrain data, and corresponding terrain identifiers are added to each terrain area in the training terrain data.

[0123] Step S505: training the first diffusion neural network based on the training terrain data after adding the terrain identification, to obtain a trained terrain generation model.

[0124] Step S506: input prompt words into the terrain generation model to generate a terrain height map.

[0125] Step S507: Generate a three-dimensional terrain grid based on the terrain height map.

[0126] Step S508: Acquire second sample DEM data and sample DLM data.

[0127] Step S509: training the second diffusion neural network based on the second sample DEM data and the sample DLM data to obtain a trained road generation model.

[0128] Step S510: Input the terrain height map into the road generation model to generate a road map.

[0129] Step S511: Generate a three-dimensional road grid based on the road map.

[0130] Step S512: Combining the terrain grid, the road grid and the terrain texture map to generate a three-dimensional terrain scene.

[0131] Specifically, yes Figure 5 The description of the illustrated embodiment can refer to the contents of the previous embodiments, which will not be repeated here.

[0132] Corresponding to the aforementioned three-dimensional terrain generation method based on artificial intelligence, an embodiment of the present invention further provides a three-dimensional terrain generation device based on artificial intelligence.

[0133] See also Figure 6 , is a schematic diagram of the structure of a three-dimensional terrain generation device based on artificial intelligence provided by an embodiment of the present invention, the device is applied to an electronic device with computing capabilities, and the device includes:

[0134] The first generation module 601 is used to input prompt words into the terrain generation model to generate a terrain height map, wherein the prompt words are used to indicate the terrain type, the terrain generation model is obtained by training a first diffusion neural network based on training terrain data with terrain identifiers pre-added, the training terrain data includes first sample DEM data representing a real scene terrain, and the terrain identifier is used to mark the terrain type of the terrain area indicated in the training terrain data.

[0135] The second generating module 602 is used to generate a three-dimensional terrain grid based on the terrain height map.

[0136] The road map obtaining module 603 is used to obtain a road map that matches the terrain height map.

[0137] The third generating module 604 is used to generate a three-dimensional road grid based on the road map.

[0138] The first acquisition module 605 is used to obtain a terrain material map.

[0139] The fourth generating module 606 is used to generate a three-dimensional terrain scene by combining the terrain grid, the road grid and the terrain material map.

[0140] As can be seen from the above, in the solution provided by the embodiment of the present invention, compared with the terrain generation method in the related art that requires multiple teams to cooperate with each other to jointly complete multiple links such as modeling, mapping, lighting, animation, etc., the embodiment of the present invention uses a terrain generation model that can generate a terrain height map according to prompt words, automatically generates a terrain height map that meets the requirements, and then generates a terrain grid, and combines the road grid and terrain material mapping to generate the required three-dimensional virtual terrain scene. The embodiment of the present invention integrates the links in the related art that require multiple teams to cooperate with each other into a procedural terrain generation process, which reduces the time required to generate a virtual terrain scene, makes the generation method of the virtual terrain scene more centralized, and can improve the efficiency of generating a virtual terrain scene.

[0141] Moreover, the embodiment of the present invention only needs to input specific prompt words into the terrain generation model, and after a series of automated procedures, the required terrain scene can be finally generated. This not only makes the use threshold of the solution provided by the embodiment of the present invention low, but also does not require a large amount of human resources, and can save the cost required for generating terrain scenes; by adjusting the prompt words, a terrain scene that meets specific needs can be generated, so the embodiment of the present invention can flexibly generate terrain scenes according to needs.

[0142] In addition, since the first sample DEM data represents the terrain of a real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain a terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation, and thus can make the final generated three-dimensional terrain scene more realistic and the performance effect closer to the real scene.

[0143] In one embodiment of the present invention, the road map obtaining module 603 is specifically used for:

[0144] The terrain height map is input into a road generation model to generate a road map, wherein the road generation model is obtained by training a second diffusion neural network based on second sample DEM data and sample DLM data, and the second sample DEM data and the sample DLM data respectively represent the terrain of a terrain area in a real scene and the roads in the terrain area.

[0145] As can be seen from the above, in the solution provided by the embodiment of the present invention, a special algorithm, namely the road generation model, is used to process the terrain height map to generate a road map. In addition, since the road generation model is trained based on the second sample DEM data and the sample DLM data, the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the road in the terrain area, the road map generated by the road generation model can be closer to the actual situation.

[0146] In one embodiment of the present invention, the terrain type marked by the above-mentioned terrain identifier includes at least one of the following types: water area, mountain range, valley, hill, plateau, cliff, island, basin, plain, peak.

[0147] Corresponding to the aforementioned three-dimensional terrain generation model training method based on artificial intelligence, an embodiment of the present invention also provides a three-dimensional terrain generation model training device based on artificial intelligence.

[0148] See also Figure 7 , is a schematic diagram of the structure of a three-dimensional terrain generation model training device based on artificial intelligence provided by an embodiment of the present invention, the device is applied to an electronic device with computing capabilities, and the device includes:

[0149] The determination and addition module 701 is used to determine the terrain types of different terrain areas represented by the training terrain data, and add terrain identifiers representing the terrain types corresponding to the terrain areas to each terrain area, wherein the training terrain data includes the first sample DEM data representing the terrain of the real scene.

[0150] The first training module 702 is used to train the first diffusion neural network based on the above-mentioned training terrain data after adding terrain identification to obtain a trained terrain generation model. The above-mentioned terrain generation model is used to output a terrain height map matching the above-mentioned prompt word after obtaining the input prompt word for representing the terrain type.

[0151] As can be seen from the above, in the solution provided by the embodiment of the present invention, by using the training terrain data after adding terrain identification to train the first diffusion neural network, a terrain generation model that generates a terrain height map according to the prompt word can be obtained. In addition, since the first sample DEM data represents the terrain of the real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain the terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation.

[0152] In one embodiment of the present invention, the above-mentioned training terrain data includes DEM data corresponding to real scenes and / or data generated by scientific terrain generation software, which can improve the data diversity of the training terrain data, so that the terrain height map generated by the final terrain generation model can more easily meet the needs.

[0153] Corresponding to the aforementioned artificial intelligence-based road generation model training method, an embodiment of the present invention also provides an artificial intelligence-based road generation model training device.

[0154] See also Figure 8 , is a schematic diagram of the structure of a road generation model training device based on artificial intelligence provided by an embodiment of the present invention, the device is applied to an electronic device with computing capabilities, and the device includes:

[0155] The second acquisition module 801 is used to obtain second sample DEM data and sample DLM data, wherein the second sample DEM data and the sample DLM data respectively represent the terrain of a terrain area in a real scene and the roads in the terrain area.

[0156] The second training module 802 is used to train the second diffusion neural network based on the second sample DEM data and the sample DLM data to obtain a trained road generation model. The road generation model is used to output a road map adapted to the terrain represented by the terrain height map after obtaining the input terrain height map.

[0157] As can be seen from the above, in the solution provided by the embodiment of the present invention, by using the second sample DEM data and the sample DLM data to train the second diffusion neural network, a road generation model for generating a road map can be obtained. In addition, since the road generation model is trained based on the second sample DEM data and the sample DLM data, the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the roads in the terrain area, the road map generated using the road generation model can be closer to the actual situation.

[0158] See also Fig. 9 , is a schematic diagram of the structure of a first electronic device provided by an embodiment of the present invention, comprising a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904;

[0159] Memory 903, used for storing computer programs;

[0160] The processor 901 is used to implement any step of the aforementioned artificial intelligence-based three-dimensional terrain generation method when executing the program stored in the memory 903.

[0161] As can be seen from the above, in the solution provided by the embodiment of the present invention, compared with the terrain generation method in the related art that requires multiple teams to cooperate with each other to jointly complete multiple links such as modeling, mapping, lighting, animation, etc., the embodiment of the present invention uses a terrain generation model that can generate a terrain height map according to prompt words, automatically generates a terrain height map that meets the requirements, and then generates a terrain grid, and combines the road grid and terrain material mapping to generate the required three-dimensional virtual terrain scene. The embodiment of the present invention integrates the links in the related art that require multiple teams to cooperate with each other into a procedural terrain generation process, which reduces the time required to generate a virtual terrain scene, makes the generation method of the virtual terrain scene more centralized, and can improve the efficiency of generating a virtual terrain scene.

[0162] Moreover, the embodiment of the present invention only needs to input specific prompt words into the terrain generation model, and after a series of automated procedures, the required terrain scene can be finally generated. This not only makes the use threshold of the solution provided by the embodiment of the present invention low, but also does not require a large amount of human resources, and can save the cost required for generating terrain scenes; by adjusting the prompt words, a terrain scene that meets specific needs can be generated, so the embodiment of the present invention can flexibly generate terrain scenes according to needs.

[0163] In addition, since the first sample DEM data represents the terrain of a real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain a terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation, and thus can make the final generated three-dimensional terrain scene more realistic and the performance effect closer to the real scene.

[0164] See also Fig.10 , is a schematic diagram of the structure of a second electronic device provided by an embodiment of the present invention, comprising a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004;

[0165] Memory 1003, used for storing computer programs;

[0166] The processor 1001 is used to implement any step of the aforementioned artificial intelligence-based three-dimensional terrain generation model training method when executing the program stored in the memory 1003.

[0167] As can be seen from the above, in the solution provided by the embodiment of the present invention, by using the training terrain data after adding terrain identification to train the first diffusion neural network, a terrain generation model that generates a terrain height map according to the prompt word can be obtained. In addition, since the first sample DEM data represents the terrain of the real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain the terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation.

[0168] See also Fig.11 , is a schematic diagram of the structure of a third electronic device provided by an embodiment of the present invention, including a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104;

[0169] Memory 1103, used for storing computer programs;

[0170] The processor 1101 is used to implement any step of the aforementioned artificial intelligence-based road generation model training method when executing the program stored in the memory 1103.

[0171] As can be seen from the above, in the solution provided by the embodiment of the present invention, by using the second sample DEM data and the sample DLM data to train the second diffusion neural network, a road generation model for generating a road map can be obtained. In addition, since the road generation model is trained based on the second sample DEM data and the sample DLM data, the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the roads in the terrain area, the road map generated using the road generation model can be closer to the actual situation.

[0172] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0173] The communication interface is used for communication between the above electronic device and other devices.

[0174] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0175] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0176] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned three-dimensional terrain generation methods based on artificial intelligence are implemented.

[0177] When the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention is used to generate three-dimensional terrain, compared with the terrain generation method in the related art that requires multiple teams to cooperate with each other to jointly complete multiple links such as modeling, mapping, lighting, animation, etc., the embodiment of the present invention uses a terrain generation model that can generate a terrain height map according to prompt words, automatically generates a terrain height map that meets the requirements, and then generates a terrain grid, and combines the road grid and terrain material mapping to generate the required three-dimensional virtual terrain scene. The embodiment of the present invention integrates the links that require multiple teams to cooperate with each other in the related art into a programmatic terrain generation process, reduces the time required to generate a virtual terrain scene, makes the generation method of the virtual terrain scene more centralized, and can improve the efficiency of generating a virtual terrain scene.

[0178] Moreover, the embodiment of the present invention only needs to input specific prompt words into the terrain generation model, and after a series of automated procedures, the required terrain scene can be finally generated. This not only makes the use threshold of the solution provided by the embodiment of the present invention low, but also does not require a large amount of human resources, and can save the cost required for generating terrain scenes; by adjusting the prompt words, a terrain scene that meets specific needs can be generated, so the embodiment of the present invention can flexibly generate terrain scenes according to needs.

[0179] In addition, since the first sample DEM data represents the terrain of a real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain a terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation, and thus can make the final generated three-dimensional terrain scene more realistic and the performance effect closer to the real scene.

[0180] In another embodiment of the present invention, another computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned artificial intelligence-based three-dimensional terrain generation model training methods are implemented.

[0181] When the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention is used to train the three-dimensional terrain generation model based on artificial intelligence, the terrain generation model that generates the terrain height map according to the prompt words can be obtained by training the first diffusion neural network using the training terrain data after adding the terrain identification. In addition, since the first sample DEM data represents the terrain of the real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain the terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation.

[0182] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned artificial intelligence-based road generation model training methods are implemented.

[0183] When the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention is used to train the road generation model based on artificial intelligence, the road generation model for generating a road map can be obtained by training the second diffusion neural network using the second sample DEM data and the sample DLM data. In addition, since the road generation model is trained based on the second sample DEM data and the sample DLM data, the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the roads in the terrain area, the road map generated using the road generation model can be closer to the actual situation.

[0184] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any one of the three-dimensional terrain generation methods based on artificial intelligence in the above-mentioned embodiments.

[0185] When the computer program product provided by the embodiment of the present invention is used to generate three-dimensional terrain, compared with the terrain generation method in the related art that requires multiple teams to cooperate with each other to jointly complete multiple links such as modeling, mapping, lighting, animation, etc., the embodiment of the present invention uses a terrain generation model that can generate a terrain height map according to prompt words, automatically generates a terrain height map that meets the requirements, and then generates a terrain grid, and combines the road grid and terrain material mapping to generate the required three-dimensional virtual terrain scene. The embodiment of the present invention integrates the links that require multiple teams to cooperate with each other in the related art into a programmatic terrain generation process, reduces the time required to generate a virtual terrain scene, makes the generation method of the virtual terrain scene more centralized, and can improve the efficiency of generating a virtual terrain scene.

[0186] Moreover, the embodiment of the present invention only needs to input specific prompt words into the terrain generation model, and after a series of automated procedures, the required terrain scene can be finally generated. This not only makes the use threshold of the solution provided by the embodiment of the present invention low, but also does not require a large amount of human resources, and can save the cost required for generating terrain scenes; by adjusting the prompt words, a terrain scene that meets specific needs can be generated, so the embodiment of the present invention can flexibly generate terrain scenes according to needs.

[0187] In addition, since the first sample DEM data represents the terrain of a real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain a terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation, and thus can make the final generated three-dimensional terrain scene more realistic and the performance effect closer to the real scene.

[0188] In another embodiment of the present invention, another computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any one of the artificial intelligence-based three-dimensional terrain generation model training methods in the above-mentioned embodiments.

[0189] When the computer program product provided by the embodiment of the present invention is used to train a three-dimensional terrain generation model based on artificial intelligence, the terrain generation model that generates a terrain height map according to the prompt words can be obtained by training the first diffusion neural network using the training terrain data after adding terrain identification. In addition, since the first sample DEM data represents the terrain of the real scene and is real terrain data, the embodiment of the present invention uses the first sample DEM data to train the first diffusion neural network to obtain the terrain generation model, which can make the terrain height map generated using the terrain generation model more in line with the actual situation.

[0190] In another embodiment provided by the present invention, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the artificial intelligence-based road generation model training methods in the above-mentioned embodiments.

[0191] When the computer program product provided by the embodiment of the present invention is used to train the road generation model based on artificial intelligence, the second diffusion neural network is trained using the second sample DEM data and the sample DLM data, so that a road generation model for generating a road map can be obtained. In addition, since the road generation model is trained based on the second sample DEM data and the sample DLM data, the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the roads in the terrain area, so the road map generated by the road generation model can be closer to the actual situation.

[0192] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0193] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0194] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0195] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A three-dimensional terrain generation method based on artificial intelligence, characterized in that: The method comprises: Inputting a prompt word including a terrain identification name corresponding to a terrain type into a terrain generation model to generate a terrain height map, wherein the prompt word is used to indicate the terrain type, the terrain generation model is obtained by training a first diffusion neural network based on training terrain data to which a terrain identification is pre-added, the training terrain data includes first sample digital elevation model DEM data representing a real scene terrain, the terrain identification is used to mark the terrain type of the terrain area indicated in the training terrain data, the terrain type marked by the terrain identification includes at least one of the following types: water area, mountain range, valley, hill, plateau, cliff, island, basin, plain, peak, and the terrain identification corresponds to the terrain type one by one; generating a three-dimensional terrain mesh based on the terrain height map; After obtaining the terrain height map, the terrain height map is input into the road generation model, the terrain data therein is analyzed, the passable area is identified, and a road map matching the terrain height map and including the passable area is obtained, wherein the road generation model is obtained by training a second diffusion neural network based on second sample DEM data and sample digital line model DLM data, and the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the road in the terrain area; generating a three-dimensional road grid based on the road map; Get terrain material map; The terrain grid, the road grid and the terrain material map are combined to generate a three-dimensional virtual terrain scene.

2. The method according to claim 1, characterized in that The AI-based 3D terrain generation model is trained in the following ways: Determine the terrain types of different terrain areas represented by training terrain data, and add terrain identifiers representing the terrain types corresponding to the terrain areas to each terrain area, wherein the training terrain data includes first sample digital elevation model (DEM) data representing the terrain of a real scene; The first diffusion neural network is trained based on the training terrain data after adding terrain identification to obtain a trained terrain generation model, and the terrain generation model is used to output a terrain height map matching the prompt word after obtaining the input prompt word for representing the terrain type.

3. The method according to claim 2, characterized in that The training terrain data includes DEM data corresponding to real scenes and / or data generated by scientific terrain generation software.

4. The method according to claim 1, characterized in that: The AI-based road generation model is trained as follows: Obtaining second sample digital elevation model DEM data and sample digital line model DLM data, wherein the second sample DEM data and the sample DLM data respectively represent the terrain of a terrain area in a real scene and the road in the terrain area; The second diffusion neural network is trained based on the second sample DEM data and the sample DLM data to obtain a trained road generation model, wherein the road generation model is used to output a road map adapted to the terrain represented by the terrain height map after obtaining the input terrain height map.

5. A three-dimensional terrain generation device based on artificial intelligence, characterized in that: The device comprises: A first generation module is used to input a prompt word containing a terrain identification name corresponding to a terrain type into a terrain generation model to generate a terrain height map, wherein the prompt word is used to indicate the terrain type, the terrain generation model is obtained by training a first diffusion neural network based on training terrain data with a terrain identification added in advance, the training terrain data includes first sample digital elevation model DEM data representing a real scene terrain, the terrain identification is used to mark the terrain type of the terrain area indicated in the training terrain data, the terrain type marked by the terrain identification includes at least one of the following types: water area, mountain range, valley, hill, plateau, cliff, island, basin, plain, peak, and the terrain identification corresponds to the terrain type one by one; A second generating module, used for generating a three-dimensional terrain grid based on the terrain height map; A road map acquisition module is used for, after obtaining the terrain height map, inputting the terrain height map into a road generation model, analyzing the terrain data therein, identifying the passable area, and obtaining a road map matching the terrain height map and including the passable area, wherein the road generation model is obtained by training a second diffusion neural network based on second sample DEM data and sample digital line model DLM data, wherein the second sample DEM data and the sample DLM data respectively represent the terrain of the terrain area in the real scene and the road in the terrain area; A third generating module, used for generating a three-dimensional road grid based on the road map; The first acquisition module is used to obtain the terrain material map; The fourth generation module is used to combine the terrain grid, the road grid and the terrain material map to generate a three-dimensional virtual terrain scene.

6. The device according to claim 5, characterized in that The device also includes: A determination and addition module, used for determining the terrain types of different terrain areas represented by training terrain data, and adding terrain identifiers representing the terrain types corresponding to the terrain areas to each terrain area, wherein the training terrain data includes first sample digital elevation model DEM data representing the terrain of a real scene; The first training module is used to train the first diffusion neural network based on the training terrain data after adding the terrain identification to obtain the trained terrain generation model. The terrain generation model is used to output a terrain height map matching the prompt word after obtaining the input prompt word for representing the terrain type.

7. The device according to claim 6, characterized in that The training terrain data includes DEM data corresponding to real scenes and / or data generated by scientific terrain generation software.

8. The device according to claim 5, characterized in that The device also includes: A second acquisition module is used to obtain second sample digital elevation model DEM data and sample digital line model DLM data, wherein the second sample DEM data and the sample DLM data represent the terrain of the terrain area in the real scene and the road in the terrain area respectively; The second training module is used to train the second diffusion neural network based on the second sample DEM data and the sample DLM data to obtain a trained road generation model, and the road generation model is used to output a road map adapted to the terrain represented by the terrain height map after obtaining the input terrain height map.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor is used to implement any one of the method steps in claims 1-4 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps in any one of claims 1 to 4 are implemented.