Method and device for generating three-dimensional virtual scene and electronic equipment

By generating entity node data and a sparse octree structure, the performance bottleneck and ID conflict issues in 3D virtual scenes are resolved, enabling efficient 3D scene management and dynamic loading, and improving system scalability and rendering efficiency.

CN121392162AActive Publication Date: 2026-01-23启元实验室
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511973232.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-01-23
Estimated Expiration
2045-12-25

AI Technical Summary

Technical Problem

Existing 3D virtual scene generation solutions suffer from performance bottlenecks, lack of semantic and topological representation, and difficulties in dynamic integration and real-time updates. In particular, resource waste and data loss are serious in large-scale scenes, and the lack of a global ID generation mechanism leads to entity ID conflicts.

Method used

By generating entity node data, constructing a sparse octree data structure and a comprehensive scene graph, and utilizing axis-aligned bounding box data and multi-level detail values, combined with globally unique identifiers and network adapters to generate unique IDs, efficient 3D virtual scene management and dynamic loading are achieved.

Benefits of technology

It improves the efficiency of 3D scene management, reduces resource consumption, enhances system scalability and cross-platform compatibility, and supports efficient rendering and real-time updates of large-scale scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121392162A_ABST
    Figure CN121392162A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for generating a three-dimensional virtual scene, electronic equipment and a non-instantaneous computer readable storage medium, and the method comprises the steps: generating entity node data of the three-dimensional scene according to a three-dimensional model of a real scene, the entity node data comprises axis alignment bounding box data of entity nodes under a local coordinate system; constructing a plurality of single scene graphs by using the entity node data; constructing a comprehensive scene graph by using the plurality of single scene graphs; calculating a multi-detail level value of the entity node in the comprehensive scene graph; and generating the three-dimensional virtual scene by using the axis alignment bounding box data, the multi-detail level value and the comprehensive scene graph. According to the embodiment of the invention, the hierarchical three-dimensional scene graph structure is constructed according to the relationship among the entity, the single scene graph and the comprehensive scene graph, so that efficient three-dimensional scene management, dynamic loading and cross-platform compatibility are realized, and the system expansibility is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of three-dimensional modeling, in particular to a method and device for generating a three-dimensional virtual scene, an electronic device and a non-transitory computer-readable storage medium. BACKGROUND

[0002] With the development of the digital twin industry, three-dimensional virtual scenes have been widely used in smart cities and other fields. However, the current three-dimensional scene generation scheme has the following core problems: First, there is a performance bottleneck in large-scale scenes. Existing engines mainly rely on LOD (Level of Detail, referred to as multi-detail level) optimization or scene switching techniques when processing complex scenes, but still face performance problems in actual applications. For example, Unity scene switching will cause all game objects in the previous scene to be destroyed and need to be reloaded, which not only wastes resources but also can cause data loss and system lag.

[0003] Second, the semantics and topology expression are missing. Existing three-dimensional scene management techniques focus on geometric structures and lack accurate descriptions of semantic relationships and topological structures between entities. For example, although standards such as CityGML support semantic information, they lack extensibility, do not support multi-resolution expression, and have limited support for geographic coordinates, making them unsuitable for large-scale urban-scale applications.

[0004] Third, dynamic integration and real-time updating are difficult. For example, existing solutions have inconsistent new and old states of entities with the same ID when merging multiple scenes, leading to deviations in scene rendering. In addition, the ID conflict problem between newly created entities in different scenes is difficult to solve, and there is a lack of a unified global ID generation mechanism. SUMMARY

[0005] The present application proposes a method and device for generating a three-dimensional virtual scene, an electronic device and a non-transitory computer-readable storage medium to solve the problem of poor compatibility of three-dimensional virtual scene data in the prior art.

[0006] According to an aspect of the present application, a method for generating a three-dimensional virtual scene is proposed, comprising: generating entity node data of a three-dimensional scene from a three-dimensional model of a real scene, wherein the entity node data includes axis-aligned bounding box data of an entity node in a local coordinate system; constructing a plurality of single scene graphs using the entity node data; constructing a comprehensive scene graph using the plurality of single scene graphs; calculating a multi-detail level value of the entity node in the comprehensive scene graph; The three-dimensional virtual scene is generated using the axis-aligned bounding box data, the multi-detail level value, and the integrated scene graph.

[0007] According to some embodiments, the entity node data further comprises a globally unique identification of the entity node, wherein The entity node data of the three-dimensional scene is generated according to a three-dimensional model of a real scene, comprising: The geographical quadtree tile identification corresponding to the entity node is calculated; The globally unique identification is generated by an MD hash algorithm using a hardware unique identification of a network adapter, current calendar information, current performance counter value, current incremental counter value, and the geographical quadtree tile identification.

[0008] According to some embodiments, before calculating the multi-detail level value of the entity node in the integrated scene graph, the method further comprises: A sparse octree data structure is constructed using the entity node, wherein each octree node of the sparse octree data structure comprises axis-aligned bounding box data, a center point position, a current node depth, and a maximum depth value of the entity node.

[0009] According to some embodiments, the sparse octree data structure is constructed using the entity node, comprising: The three-dimensional space of the entity node is divided by a recursive octant division method so that the entity node comprises at most 8 child nodes; All child nodes of the entity node are traversed to construct the sparse octree data structure.

[0010] According to some embodiments, the multi-detail level value of the entity node in the integrated scene graph is calculated, comprising: A list of entity nodes displayed in the integrated scene graph is determined according to a camera view frustum; The multi-detail level value of each entity node in the list of entity nodes is calculated in turn.

[0011] According to some embodiments, the method further comprises: A list of preloaded entity nodes is determined according to a current position of a camera; The corresponding entity nodes are preloaded according to the list of preloaded entity nodes.

[0012] According to some embodiments, the method further comprises: A list of entity nodes in the integrated scene graph is updated according to a current position of a camera to obtain an updated list of entity nodes; The multi-detail level value of each entity node in the updated list of entity nodes is calculated in turn; The integrated scene graph is rendered using the axis-aligned bounding box data and the multi-detail level value of each entity node in the updated entity node list to generate an updated three-dimensional virtual scene.

[0013] According to some embodiments, generating the three-dimensional virtual scene using the axis-aligned bounding box data, the multi-detail level value and the integrated scene graph comprises: Determining an entity position of the entity node in the integrated scene graph using the axis-aligned bounding box data and the multi-detail level value; Loading the integrated scene graph according to the entity position to generate the three-dimensional virtual scene.

[0014] According to some embodiments, loading the integrated scene graph according to the entity position to generate the three-dimensional virtual scene comprises: Detecting whether there is an entity node conflict of the entity node in different single scene graphs using the globally unique identifier; In the case that there is an entity node conflict of the entity node in different single scene graphs, determining whether the entity node is displayed in each single scene graph according to a display priority of the entity node in different single scene graphs.

[0015] According to an aspect of the present application, a device for generating a three-dimensional virtual scene is provided, comprising: An entity node data generation unit configured to generate entity node data of a three-dimensional scene according to a three-dimensional model of a real scene, wherein the entity node data comprises axis-aligned bounding box data of an entity node in a local coordinate system; A single scene graph construction unit configured to construct a plurality of single scene graphs using the entity node data; An integrated scene graph construction unit configured to construct an integrated scene graph using the plurality of single scene graphs; A multi-detail level value calculation unit configured to calculate a multi-detail level value of the entity node in the integrated scene graph; A three-dimensional virtual scene generation unit configured to generate the three-dimensional virtual scene using the axis-aligned bounding box data, the multi-detail level value and the integrated scene graph.

[0016] According to an aspect of the present application, an electronic device is provided, comprising: a processor; a memory configured to store a computer program; and when the computer program is executed by the processor, the processor is caused to implement the method according to any one of the preceding embodiments.

[0017] According to an aspect of the present application, a non-transitory computer-readable storage medium is provided, which stores computer readable instructions. When the instructions are executed by a processor, the processor performs the method according to any one of the preceding embodiments.

[0018] According to the example embodiments of the present application, the hierarchical three-dimensional scene graph structure is constructed according to the relationship among entities, single scene graphs and integrated scene graphs, which realizes efficient three-dimensional scene management, dynamic loading and cross-platform compatibility, significantly improves the scene management efficiency of three-dimensional models, reduces resource consumption and enhances system scalability. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows.

[0020] Figure 1 A system architecture schematic diagram for generating a three-dimensional virtual scene according to an example embodiment of the present application is shown.

[0021] Figure 2 A three-dimensional entity hierarchical structure schematic diagram according to an example embodiment of the present application is shown.

[0022] Figure 3 A three-dimensional model data schematic diagram corresponding to an entity according to an example embodiment of the present application is shown.

[0023] Figure 4 A method schematic diagram for constructing an octree according to an example embodiment of the present application is shown.

[0024] Figure 5 A method flowchart for generating a three-dimensional virtual scene according to an example embodiment of the present application is shown.

[0025] Figure 6 A method schematic diagram for determining an entity node list displayed in an integrated scene graph according to a camera view volume boundary according to an example embodiment of the present application is shown.

[0026] Figure 7 A method schematic diagram for solving entity conflicts according to an example embodiment of the present application is shown.

[0027] Figure 8 A data flow schematic diagram for generating a three-dimensional virtual scene according to an example embodiment of the present application is shown.

[0028] Figure 9 An apparatus block diagram for generating a three-dimensional virtual scene according to an example embodiment of the present application is shown.

[0029] Figure 10 An electronic device according to an example embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] Example embodiments now will be described more fully hereinafter with reference to the accompanying drawings. Example embodiments, however, can be implemented in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the example embodiments to those skilled in the art. Like reference numerals refer to like elements throughout the several views.

[0031] The described features, structures, or characteristics can be combined in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the

[0032] The flow charts shown in the drawings are merely examples and not necessarily all inclusive of all content and operations / steps, nor are they necessarily performed in the order described. For example, some operations / steps can be broken down further, while some operations / steps can be combined or partially combined, so the actual order of performance can vary depending on the actual situation.

[0033] The terms "first", "second", and the like, in the description of the specification and claims and the above drawings, are used to distinguish between similar objects, not to describe a particular sequential order. Moreover, the terms "include", and "have", and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a list of steps or units is not limited to the listed steps or units, but can optionally further include other steps or units not listed, or can optionally further include other steps or units inherent to such process, method, system, product, or apparatus.

[0034] Specific embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings.

[0035] Figure 1 A system architecture diagram for generating a three-dimensional virtual scene according to an example embodiment of the present disclosure is shown in FIG. 1. Figure 1 The system architecture shown includes a data layer, an index layer, a logic layer, and an interface layer.

[0036] An example of a system architecture for generating a three-dimensional virtual scene according to an example embodiment of the present disclosure will be described in detail below. Figure 1

[0037] ​According to an embodiment of the present application, an entity.json file is used to describe the composition and representation file of entities (three-dimensional models) of a static three-dimensional virtual scene, supports various entity types such as 3D model nodes, light nodes, and the like, and contains complete attributes such as geographic coordinates, local coordinates, local coordinate system AABB bounding box, and collision detection; a.vscene file is used as a single scene graph description file, modular design is adopted, and various modules such as terrain, entity, airport, automatic city, road, and vegetation are supported, each module can be independently enabled and configured; a.vproj file is used as a comprehensive scene graph description file, supports scene list management, contains performance optimization configurations such as preloading and resident memory, and realizes unified management and switching of multiple scenes. The data format syntax rules and verification requirements of entity.json,.vscene, and.vproj are all specified by JSON Schema.

[0038] In the present embodiment, a tree structure is adopted to construct a hierarchical organization of three-dimensional scene entities, as shown in FIG. 1, each node represents a three-dimensional entity. The three-dimensional entity contains various types such as buildings, lights, vehicles, and roads, and corresponds to specific objects in the real world, and is a constituent element of a specific scene. Unlike the prior art, the nodes in the present embodiment not only contain basic attributes of three-dimensional entities, but also support dynamic parent-child relationship maintenance, and through the establishment of a dynamic parent-child relationship, scene management is more flexible and efficient. Figure 2

[0039] Figure 3 ​A three-dimensional model data diagram of an entity according to an example embodiment of the present application is shown. In specific embodiments, a unique identification ID is assigned to each entity to ensure the uniqueness of the entity across scenes. Meanwhile, both geographic coordinates and local coordinates are supported to facilitate alignment of the scene with the real geographic space or local fine adjustment. In order to describe the rotation state of the entity in the three-dimensional space, the three-dimensional model of the entity further includes attitude parameters, including roll angle, pitch angle, and yaw angle. In order to record the detail level of the current model and support dynamic switching of the entity in the scene, the three-dimensional model of the entity further includes a multi-detail level value (LOD level) related to the size of the model and the current view cone. In some embodiments, the three-dimensional model parameters of the entity further include an axis-aligned bounding box (also referred to as an AABB bounding box) in the local coordinate system for fast spatial query and collision detection, including minimum and maximum coordinates. The bounding box is defined relative to the local coordinate system of the entity, and its value can remain unchanged when the entity moves and rotates. It should be noted that in spatial calculations such as collision detection, the axis-aligned bounding box in the local coordinate system needs to be converted to an AABB bounding box in the global coordinate system (i.e., the world coordinate system) before it can be used. In other embodiments, the three-dimensional model data representation of the entity also supports extended metadata to allow the addition of custom fields such as animation scripts and physical properties according to specific entity embodiments, thereby enhancing system flexibility. In addition, the three-dimensional model data representation of the entity also includes a visibility state field for recording whether the entity is visible, thereby facilitating dynamic management.

[0040] In some embodiments, the light node includes basic attributes, light attributes, and effect attributes. The basic attributes include node name, unique identification, and tag array; the light attributes include light type (e.g., spotlight, point light source, directional light), light color, outer angle, and maximum illumination range; and the effect attributes include whether it is movable, whether it is a near light, light intensity, light effect, light visibility range, shadow projection, and shadow projection intensity.

[0041] According to an embodiment of the present application, each entity is managed by a sparse octree data structure at the index layer. Each node of the sparse octree corresponds to an entity. In specific embodiments, to support the display of a global scene, an octree of the global scene is established, the diameter of the Earth is about 6400 kilometers, and the maximum depth of the octree is set to 16, and the size of the bounding box of the leaf node is about 200x200x200 meters. The octree node stores the axis-aligned bounding box information, center point position, current node depth, maximum depth, and the like of the current node in the global coordinate system, and records the child entity objects contained in the node. When an entity spans multiple leaf nodes of the octree, the entity needs to be recorded multiple times.

[0042] In specific embodiments, as shown in FIG. 6, the global scene is divided into a plurality of sub-scenes, and each sub-scene is managed by a corresponding scene node. Each scene node includes a plurality of entity nodes, and each entity node corresponds to an entity in the sub-scene. In specific embodiments, the scene node includes a plurality of entity nodes, and each entity node corresponds to an entity in the sub-scene. In specific embodiments, the scene node includes a plurality of entity nodes, and each entity node corresponds to an entity in the sub-scene. Figure 4As shown, the three-dimensional space of the entity is divided into eight sub-cubes by recursively dividing the three-dimensional space in such a way that each node in the octree contains at most 8 child nodes, so as to improve the efficiency of three-dimensional space query.

[0043] According to the embodiments of the present application, the global ID generator generates a unique VUID for each entity by using the geographic quadtree tile ID, so as to provide efficient spatial query and collision detection functions and provide a technical basis for large-scale geographic scene management.

[0044] In specific embodiments, the global unique identifier is generated by using the hardware unique identifier of the network adapter, the current calendar information, the current performance counter value, the current incremental counter value, and the geographic quadtree tile identifier through an MD hash algorithm. In the embodiments, the uniqueness and traceability of the ID are ensured by fusing the hardware features (MAC address), geographic area, time information (calendar time + performance counter), and sequence information (counter); the microsecond-level time precision is provided by using the performance counter, so as to have higher uniqueness guarantee than the traditional timestamp; the consistency of the IDs generated by the same hardware device is ensured by using the MAC address binding, while the uniqueness of the IDs generated by different hardware devices is ensured; the 64-bit ID generated has good random distribution characteristics by using the MD5 hash algorithm to process the seed structure, so as to avoid ID collision. Meanwhile, the present application also supports batch generation of multiple global VUIDs, and the uniqueness of the batch-generated VUIDs is ensured by using the incremental counter.

[0045] According to the embodiments of the present application, a display switch is set for each single scene file to control whether the single scene is displayed in the current comprehensive scene.

[0046] In other embodiments, the comprehensive scene includes multiple single scenes, and a preloading identifier and a resident memory identifier are set for each single scene to control whether the single scene performs loading at startup and whether its memory occupation is released at scene switching.

[0047] In Figure 1 The scene management unit shown is used to manage the scene list, scene switching, preloading, and memory management. In the embodiments of the present application, modular management is adopted, and the complex three-dimensional scene is decomposed into multiple independent single scene function modules (for example, terrain, entity, airport, automatic city, road, vegetation, etc.), each of which can be independently enabled, configured, and managed, so as to greatly improve the flexibility and scalability of the comprehensive scene.

[0048] According to an embodiment of this application, the LOD management unit is used to calculate the LOD level value based on the distance from the camera to the center of the entity, and to control the loading and unloading of the 3D model corresponding to the entity; the generated 3D virtual scene includes multiple single scenes, and the dynamic loading queue is used to dynamically load and unload different single scenes.

[0049] In some embodiments, the coordinate transformation unit is used to perform multi-coordinate system transformations on entities, including transformations between geographic coordinate systems (LON, LAT, ALT), world coordinate systems (ECEF), model coordinate systems, and attitude coordinate systems (Roll, Pitch, Yaw). This embodiment not only achieves accurate transformations between different coordinate systems but also supports various application scenarios such as geolocation, spatial transformation, and attitude control. This system supports not only static coordinate transformations but also dynamic coordinate system updates and real-time transformation calculations, providing a technical foundation for spatial positioning and attitude control in complex 3D scenes.

[0050] In other embodiments, the interface layer is used to receive instructions from external applications to facilitate developers in controlling and managing the 3D scene.

[0051] Figure 5 A flowchart illustrating a method for generating a three-dimensional virtual scene according to an example embodiment of this application is shown, such as... Figure 5 The method shown includes steps S501, S503, S505, S507, and S509. The following will use... Figure 5 Taking an example, a method for generating a three-dimensional virtual scene according to an example embodiment of this application will be described in detail.

[0052] like Figure 5 As shown, in step S501, entity node data of the three-dimensional scene is generated based on the three-dimensional model of the real scene. The entity node data includes the axis-aligned bounding box data of the entity nodes in the local coordinate system.

[0053] According to embodiments of this application, entities include various types such as models, lights, and vehicles. In this embodiment, each entity node data corresponds to an entity in a real scene. Furthermore, unlike existing technologies, each entity node data not only contains the entity's basic three-dimensional attribute data but also includes the dynamic parent-child relationship maintenance between the entity and other entities, forming a hierarchical organizational structure that makes scene management more flexible and efficient.

[0054] In a specific embodiment, the entity node data is stored in JSON format, and custom extended fields can be added according to the characteristics of the entity.

[0055] In some embodiments, in order to ensure the uniqueness of the entity, the entity node data further comprises a globally unique identification of the entity node, wherein in step S501, the entity node data of the three-dimensional scene is generated according to the three-dimensional model of the real scene, comprising: calculating the geographical quadtree tile identification corresponding to the entity node; using the hardware unique identification of the network adapter, the current calendar information, the current performance counter value, the current incremental counter value and the geographical quadtree tile identification, generating the globally unique identification VUID through the MD5 hash algorithm.

[0056] In a specific embodiment, when it is necessary to generate VUID in batches, first, the hardware unique identification of the network adapter, the current calendar information, the current performance counter value, the current incremental counter value and the geographical quadtree tile identification are taken as seeds, and the counter is set to zero; then, the MD5 hash calculation is performed in a loop to generate a 128-bit 16-byte MD5 digest, and then the 4th-11th bytes (skipping the first 4 bytes) are extracted from the MD5 digest, an unsigned integer of 64 bits is formed using the 8 bytes, and the counter is incremented each time; finally, all generated VUIDs are returned.

[0057] In some embodiments, the MAC address takes the MAC address of the first network adapter obtained as the hardware unique identification; the timestamp uses time (nullptr) to obtain the current calendar time; the performance counter obtains the high-precision performance counter value through the interface provided by the operating system (for example, QueryPerformanceCounter); and the uniqueness of multiple VUIDs generated at the same time point is ensured by the incremental counter.

[0058] In the present embodiment, the uniqueness of the entities arranged by different geographical areas is ensured by geographical areas, the uniqueness of the IDs generated by different hardware devices is ensured by MAC addresses, the uniqueness in the time dimension is ensured by combining calendar time and performance counter, the microsecond-level precision is provided by the performance counter to avoid time conflicts, and the generated 64-bit ID has good distribution characteristics through the MD5 hash algorithm, without relying on centralized services and being suitable for distributed environments.

[0059] In order to provide spatial dimension information, in a specific embodiment, the geographical quadtree tile ID comprises a tile level, a tile index in the horizontal direction of the tile, a tile index in the vertical direction of the tile and a combined tile ID. The tile level represents the detail level of the tile, and the value range is 0-20; the combined tile ID combines the level, the tile index in the horizontal direction of the tile and the tile index in the vertical direction of the tile into a 32-bit tile ID through bit operation.

[0060] At step S503, a plurality of single-scene graphs are constructed using the entity node data.

[0061] In this embodiment, the single-scene graph includes a plurality of entity nodes, and is used to integrate various geographic information modules, including terrain, buildings, airports, water bodies, etc.

[0062] At step S505, a comprehensive scene graph is constructed using the plurality of single-scene graphs.

[0063] According to embodiments of the present application, by merging a plurality of single-scene graphs into one comprehensive scene graph, coverage of the entire three-dimensional virtual scene can be achieved.

[0064] At step S507, a multi-detail level value of the entity node in the comprehensive scene graph is calculated.

[0065] According to embodiments of the present application, before calculating the multi-detail level value of the entity node in the comprehensive scene graph, the method further includes: constructing a sparse octree data structure using the entity node, wherein each octree node of the sparse octree data structure includes axis-aligned bounding box data, a center point position, a current node depth, and a maximum depth value of the entity node.

[0066] In specific embodiments, as shown in FIG. 6, when constructing the sparse octree data structure using the entity node, first, the three-dimensional space of the entity node is divided by a recursive octant division method, so that the entity node includes at most 8 child nodes; then, all child nodes of the entity node are traversed, and the sparse octree data structure is constructed. Figure 4

[0067] According to embodiments of the present application, the pose parameters of the entity include a roll angle, a pitch angle, and a yaw angle, which are used to describe the rotation state of the entity in the three-dimensional space. When the position or pose of the entity changes, in some embodiments, first, the AABB bounding box thereof in the global coordinate system is updated, and then the consistency of the index is ensured through octree path reconstruction. Compared with traditional methods, in this embodiment, by making each node include at most 8 child nodes, the time complexity of the query in the three-dimensional space is reduced from O(n) to O(log n), thereby significantly improving the query efficiency.

[0068] According to embodiments of the present application, when calculating the multi-detail level value of the entity node in the comprehensive scene graph, first, as shown in FIG. 6, the three-dimensional space of the entity node is divided by a recursive octant division method, so that the entity node includes at most 8 child nodes; then, all child nodes of the entity node are traversed, and the sparse octree data structure is constructed. Figure 6 ​As shown, a list of entity nodes displayed in the integrated scene graph is determined according to the camera view frustum boundary; then, a multi-detail level value of each entity node in the list of entity nodes is calculated in sequence. This embodiment reduces the rendering calculation amount by using the camera view frustum clipping, traversing the octree, and quickly excluding nodes outside the view frustum. Meanwhile, the hierarchical structure of the octree is used for proximity query, which can quickly locate all entities within a specified range to achieve efficient collision detection.

[0069] In a specific embodiment, the multi-detail level value is calculated by using formula (1).

[0070] (1) wherein camera_distance represents the distance from the camera to the center of the entity, base_threshold is a preset reference distance (for example, 100 meters), and max_lod is a preset maximum LOD level (for example, the maximum LOD level is set to 3).

[0071] In step S509, the three-dimensional virtual scene is generated by using the axis-aligned bounding box data, the multi-detail level value, and the integrated scene graph.

[0072] According to an embodiment of the present application, in step S509, when the three-dimensional virtual scene is generated by using the axis-aligned bounding box data, the multi-detail level value, and the integrated scene graph, first, the entity position of the entity node in the integrated scene graph is determined by using the axis-aligned bounding box data and the multi-detail level value; then, the three-dimensional virtual scene is generated by loading the integrated scene graph according to the entity position.

[0073] When the integrated scene graph is generated by using a plurality of single scenes, there may be a problem of entity VUID conflict because a unified entity exists in different single scenes. In order to solve this problem, in some embodiments, first, whether there is an entity node conflict of the entity node in different single scene graphs is detected by using the globally unique identifier; then, in the case that there is an entity node conflict of the entity node in different single scene graphs, whether the entity node is displayed in each single scene graph is determined according to the display priority of the entity node in different single scene graphs.

[0074] As Figure 7As shown, when the entity node exists conflict, firstly, it is judged whether the node is global ID (that is, it is judged whether the node is root node), if it is global ID, the entity is kept in the single scene graph which exists conflict; since the same entity has same global unique identification in different single scene graphs, it may have different names in different single scene graphs, if the names in different single scene graphs are same, the entity is kept in the single scene graph which exists conflict, otherwise, the priority of the entity in different single scene graphs is compared; when the priority is same, the entity in the single scene which is loaded in front (defined as parent scene) is used to cover the entity in the single scene which is loaded in back (defined as child scene); when the priority is not same, the high priority entity is kept. Finally, the mapping relationship is updated, and the current conflict resolution result is recorded. In order to improve the loading efficiency of the three-dimensional virtual scene and reduce the loading delay, according to the embodiment of the present application, after step S509, the preloaded node is located by octree index, and the node within 10% distance range of the camera view frustum is preloaded.

[0075] Specifically, first, the preloaded entity node list is determined according to the current position of the camera; then, the corresponding entity node is preloaded according to the preloaded entity node list.

[0076] When the camera position changes, according to the embodiment of the present application, after step S509, Figure 5 The method also includes updating the entity node list in the integrated scene graph according to the current position of the camera to obtain an updated entity node list; calculating the multi-detail level value of each entity node in the updated entity node list; and using the multi-detail level value of each entity node in the updated entity node list and the axis-aligned bounding box data to render the integrated scene graph to generate an updated three-dimensional virtual scene.

[0077] When the camera position changes, the corresponding integrated scene graph including single scene graph will also change, and new single scene graph may be added, therefore, before calculating the multi-detail level value of each entity node in the updated entity node list, the octree index also needs to be updated.

[0078] According to Figure 5 According to the embodiment shown, the hierarchical three-dimensional scene graph structure is constructed according to the relationship among entity, single scene graph and integrated scene graph, efficient three-dimensional scene management, dynamic loading and cross-platform compatibility are realized, the scene management efficiency of three-dimensional model is significantly improved, the resource consumption is reduced, and the system expansibility is enhanced.

[0079] Figure 8 A data flow diagram for generating a three-dimensional virtual scene according to an example embodiment of the present application is shown, as shown in Figure 8As shown, first, the Json scene file is parsed to build an octree and establish the parent-child relationship between entities. At the same time, the model resource file is used to calculate the LOD level value of the entity by means of the LOD manager combined with the camera position. The model resource file mainly includes the geometric feature description of the entity, the material texture feature description, and the model detail definition (LOD) description of different levels. Generally, according to the distance between the camera and the entity, different levels of display details are defined to display different levels of detail features. The closer the distance, the richer the level of detail. Finally, according to the camera view frustum, the octree is used to determine the list of displayable entities, and the scene rendering is performed. Then, the dynamic loading queue is used to update the comprehensive scene. In this embodiment, different single scene modules (e.g., terrain, building, airport, etc.) are dynamically loaded or unloaded, so as to adapt to the functional implementation requirements of various application scenarios.

[0080] In specific embodiments, for example, in the construction of smart cities, it is necessary to accurately model and monitor buildings, roads, public facilities, etc. in the city in real time. Due to the large amount and variety of data involved, the three-dimensional virtual scene generation method provided by the present application can efficiently organize, manage and display these data.

[0081] For example, first, the three-dimensional entity organization and representation method proposed in the present application is used to construct a smart city three-dimensional scene graph: then, the topography and geomorphology information of the city is obtained by means of unmanned aerial vehicle shooting, satellite imagery, etc.; for important buildings, three-dimensional models are obtained by means of laser scanning technology, and dynamic data such as traffic flow and air quality are collected and sorted; then, entity files are created in JSON format to define the basic attributes of each entity and their mutual relationship; in the single scene graph description file (.vscene), various types of geographic information modules are integrated, including terrain, buildings, airports, water bodies, etc., to construct a scene graph; finally, multiple single scene graphs are merged into a comprehensive large scene to achieve comprehensive coverage of the entire city. In this embodiment, by giving each entity a globally unique VUID, the uniqueness of cross-scene entities is ensured, and the spatial query efficiency and cache hit rate are improved; at the same time, with the help of a three-dimensional engine, users can freely browse and view the city state at different time points in the virtual environment, and perform interactive queries.

[0082] The embodiment brings improvement in management efficiency by hierarchical scene graph structure, allowing city managers to quickly locate and adjust entities in a specific area during scene editing, such as adjusting the visibility state of a building or updating its pose, etc. The use of octree-optimized global coordinate system AABB bounding box and LOD dynamic preloading strategy renders only the models in the visible area, reducing resource consumption by about 40%. Different three-dimensional engines used by different departments can share and reuse scene data, avoiding repeated modeling and saving costs. To improve spatial positioning accuracy, a multi-coordinate system conversion system is used to achieve accurate positioning of entities such as buildings and roads, with a positioning accuracy of centimeters, meeting the high-precision requirements of smart city applications.

[0083] In another specific embodiment, for example, in a digital twin factory application, accurate three-dimensional modeling and simulation of equipment in the factory are required to optimize production processes and reduce costs, requiring the system not only to accurately reflect the state changes of the physical factory, but also to support operation simulation of complex equipment. The three-dimensional virtual scene generation method provided by the present application can be used to construct a digital twin factory scene.

[0084] For example, first, CAD design drawings are converted into three-dimensional models, from which equipment in the factory is extracted as entities, and logical connection relationships between devices are defined to form a complete production line model. Then, custom fields are added to the entity file to describe the behavior logic of the equipment, such as the motion trajectory of a robot, the opening and closing state of a valve, etc.; trigger conditions and response actions are set to simulate various situations in a real operating environment. Finally, device behavior is controlled through API interfaces, such as updating device pose by calling the updateNode () interface; device model precision is dynamically adjusted by the LOD management unit to optimize rendering performance; and devices are quickly located by the spatial indexing unit to improve simulation response speed.

[0085] The embodiment makes the device simulation more realistic and accurate through accurate geographic coordinates and pose parameters. The use of octree-optimized global coordinate system AABB bounding box and LOD dynamic preloading strategy improves rendering efficiency by about 35%. The addition of device behavior logic and physical properties through metadata fields allows the system to easily extend to support new devices and new functions. In addition, by configuring each device entity with a unique VUID, the system supports accurate tracking and management of device state, improving the reliability and maintainability of the simulation system. At the same time, the spatial awareness of the VUID generation algorithm allows devices in the same area to have similar VUID prefixes, optimizing device query and management efficiency. Through accurate control of the pose coordinate system (Roll, Pitch, Yaw), accurate simulation of complex poses such as device rotation and inclination is achieved, with a pose control accuracy of 0.1 degrees, meeting the high-precision industrial simulation requirements.

[0086] The above mainly introduces the embodiments of the present application from the perspective of method. It should be easily understood by those skilled in the art that the present application can be realized in the form of hardware or the combination of hardware and computer software, in combination with the operations or steps of the examples described in the embodiments disclosed herein. Those skilled in the art can use different ways to realize the described functions for each specific operation or method, and such realization shall not be considered beyond the scope of the present application.

[0087] The device embodiments of the present application are described below. For the details not explained in the device embodiments of the present application, refer to the method embodiments of the present application.

[0088] Figure 9 A device for generating a three-dimensional virtual scene according to an example embodiment of the present application is shown in the form of a block diagram as follows: Figure 9 The device shown includes a physical node data generation unit 901, a single scene graph construction unit 903, a comprehensive scene graph construction unit 905, a multi-detail level value calculation unit 907, and a three-dimensional virtual scene generation unit 909. Among them, the physical node data generation unit 901 is configured to generate physical node data of a three-dimensional scene according to a three-dimensional model of a real scene, wherein the physical node data includes axis-aligned bounding box data of a physical node in a local coordinate system; the single scene graph construction unit 903 is configured to construct a plurality of single scene graphs by using the physical node data; the comprehensive scene graph construction unit 905 is configured to construct a comprehensive scene graph by using the plurality of single scene graphs; the multi-detail level value calculation unit 907 is configured to calculate a multi-detail level value of the physical node in the comprehensive scene graph; and the three-dimensional virtual scene generation unit 909 is configured to generate the three-dimensional virtual scene by using the axis-aligned bounding box data, the multi-detail level value, and the comprehensive scene graph.

[0089] Figure 10 An electronic device according to an example embodiment of the present application is shown. The electronic device 200 according to this embodiment of the present application is described below with reference to Figure 10 Figure 10 The electronic device 200 shown is merely an example and shall not bring any limitation to the functions and use range of the embodiments of the present application.

[0090] As shown in Figure 10 The electronic device 200 is shown in the form of a general computing device. The components of the electronic device 200 can include, but are not limited to, at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.

[0091] ​The storage unit stores program codes which can be executed by the processing unit 210, so that the processing unit 210 performs the methods according to various exemplary embodiments of the present application described in the present specification. For example, the processing unit 210 can perform the methods as previously described.

[0092] The storage unit 220 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 2201 and / or a cache memory 2202, and can further include a read-only memory (ROM) 2203.

[0093] The storage unit 220 can further include a program / utility 2204 having a set of program modules 2205, including but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which can include an implementation of a networking environment, or a combination thereof.

[0094] The bus 230 can represent one or more of several types of bus structures, including a storage unit bus or bus controller, a peripheral bus, a graphics acceleration port, a processing unit bus, or a local bus using any of a variety of bus architectures.

[0095] The electronic device 200 can also communicate with one or more external devices 300 such as a keyboard or pointing device, a Bluetooth device, etc.; other devices that enable a user to interact with the electronic device 200; and / or one or more devices that enable the electronic device 200 to communicate with one or more other computing devices. Such communication can occur via an input / output (I / O) interface 250. Still yet, the electronic device 200 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 260. The network adapter 260 can communicate with the other components of the electronic device 200 via the bus 230. It should be appreciated that the electronic device 200 can be a part of a larger system, which includes a plurality of the electronic devices 200. For example, the electronic device 200 can be a server in a server farm, a desktop computer in a networked environment, or a laptop computer in a cloud computing environment.

[0096] Those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware, through the above description of the embodiments. The technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or on a network, and includes a number of instructions to make a computing device (which can be a personal computer, a server, or a network device, etc.) execute the above-mentioned method according to the embodiments of the present application.

[0097] The software product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0098] The computer readable storage medium can include a data signal carried in the baseband or as a part of a carrier wave propagating through the transmission medium, in which a readable program code is borne. Such a propagated data signal can take on many forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The readable storage medium can also be any readable medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0099] The program code can be executed by one or more programmable processors, digital signal processors, ASICs, FPGAs, GPUs or other programmable digital logic devices to perform the functions described in the above description and / or in the claims. The program code can be downloaded from a remote location (for example, an information server) through a network interface (for example, modem or network connection) or from a storage location (for example, a removable medium) or both. The program code can be stored on a storage device, which can be accessed by a general purpose or special purpose processor or both. For example, a portable memory device which is plugged into a slot can provide the program code for executing on the associated processor or processors.

[0100] The computer readable medium described above can bear one or more programs, when the one or more programs are executed by the device, the computer readable medium realizes the foregoing functions.

[0101] Those skilled in the art can understand that the above modules can be distributed in the device according to the description of the embodiment, and can also be changed in one or more devices different from the embodiment. The modules of the above embodiment can be combined into one module, or can be further split into multiple sub-modules.

[0102] According to the embodiment of the present application, a computer program is provided, including computer program or instructions, which can execute the above-described method when executed by a processor.

[0103] The above describes the embodiments of the present application in detail, and the principles and implementation modes of the present application are described by applying specific examples. The above embodiment descriptions are only used to help understand the method of the present application and its core idea. Meanwhile, the changes or deformations made by the skilled in the art according to the idea of the present application, based on the specific implementation mode and application range of the present application, all belong to the protection range of the present application. In summary, the content of the specification should not be understood as the limitation of the present application.

[0104] Those skilled in the art can understand that the above modules can be distributed in the device according to the description of the embodiment, and can also be changed in one or more devices different from the embodiment. The modules of the above embodiment can be combined into one module, or can be further split into multiple sub-modules.

[0105] The above has carried out the detailed introduction to the embodiment of the application, the principle and implementation mode of the application have been described by applying specific examples in this paper, the above embodiment description is only used for helping understanding the method of the application and its core idea. At the same time, the changes or deformations made by the person skilled in the art on the basis of the specific implementation mode and the application range of the application according to the idea of the application all belong to the protection scope of the application. In summary, the content of the specification should not be understood as the limitation of the application.

Claims

1. A method of generating a three-dimensional virtual scene, characterized by, The method comprises: generating entity node data of a three-dimensional scene according to a three-dimensional model of a real scene, wherein the entity node data comprises axis-aligned bounding box data of an entity node in a local coordinate system; constructing a plurality of single scene graphs using the entity node data; constructing a comprehensive scene graph using the plurality of single scene graphs; calculating a multi-detail level value of the entity node in the comprehensive scene graph; generating the three-dimensional virtual scene using the axis-aligned bounding box data, the multi-detail level value, and the comprehensive scene graph.

2. The method of claim 1, wherein, The entity node data further comprises a globally unique identifier of the entity node, wherein generating entity node data of a three-dimensional scene according to a three-dimensional model of a real scene comprises: calculating a geographical quadtree tile identifier corresponding to the entity node; generating the globally unique identifier by an MD hash algorithm using a hardware unique identifier of a network adapter, current calendar information, a current performance counter value, a current incremental counter value, and the geographical quadtree tile identifier.

3. The method of claim 1, wherein, Before calculating the multi-detail level value of the entity node in the comprehensive scene graph, the method further comprises: constructing a sparse octree data structure using the entity node, wherein each octree node of the sparse octree data structure comprises axis-aligned bounding box data, a center point position, a current node depth, and a maximum depth value of the entity node.

4. The method of claim 3, wherein, Constructing a sparse octree data structure using the entity node comprises: dividing a three-dimensional space of the entity node by a recursive octant division method so that the entity node comprises at most 8 child nodes; traversing all child nodes of the entity node to construct the sparse octree data structure.

5. The method of claim 4, wherein, Calculating the multi-detail level value of the entity node in the comprehensive scene graph comprises: determining a list of entity nodes displayed in the comprehensive scene graph according to a camera view frustum; calculating the multi-detail level value of each entity node in the list of entity nodes in turn.

6. The method of claim 5, wherein, Further comprising: determining a preloaded entity node list according to a current position of a camera; preloading corresponding entity nodes according to the preloaded entity node list.

7. The method of claim 1, wherein, Further comprising: updating a list of entity nodes in the comprehensive scene graph according to a current position of a camera to obtain an updated entity node list; calculating the multi-detail level value of each entity node in the updated entity node list in turn; rendering the comprehensive scene graph using the multi-detail level value of each entity node in the updated entity node list and the axis-aligned bounding box data to generate an updated three-dimensional virtual scene.

8. The method of claim 2, wherein, Generating the three-dimensional virtual scene using the axis-aligned bounding box data, the multi-detail level value, and the comprehensive scene graph comprises: determining an entity position of the entity node in the comprehensive scene graph using the axis-aligned bounding box data and the multi-detail level value; loading the comprehensive scene graph according to the entity position to generate the three-dimensional virtual scene.

9. The method of claim 8, wherein, Loading the comprehensive scene graph according to the entity position to generate the three-dimensional virtual scene comprises: detecting whether there is an entity node conflict of the entity node in different single scene graphs using the globally unique identifier; In the case that the entity node has a conflict in different single-scene graphs, whether the entity node is displayed in each single-scene graph is determined according to a display priority of the entity node in different single-scene graphs.

10. An apparatus for generating a three-dimensional virtual scene, the apparatus comprising: The method comprises: generating entity node data of a three-dimensional scene according to a three-dimensional model of a real scene, wherein the entity node data comprises axis-aligned bounding box data of an entity node in a local coordinate system; constructing a plurality of single-scene graphs by using the entity node data; constructing a comprehensive scene graph by using the plurality of single-scene graphs; calculating a multi-detail level value of the entity node in the comprehensive scene graph; generating the three-dimensional virtual scene by using the axis-aligned bounding box data, the multi-detail level value, and the comprehensive scene graph.

11. An electronic device, comprising: The method comprises: a processor; a memory for storing a computer program; when the computer program is executed by the processor, the processor implements the method according to any one of claims 1-9.

12. A non-transitory computer-readable storage medium having computer-readable instructions stored thereon, when the instructions are executed by a processor, the processor executes the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Data processing method and device for three-dimensional model and electronic equipment

    CN111127637A

  • Three-dimensional scene generation method and device, electronic equipment and storage medium

    CN117333618A

  • Lightweight model simplification method for railway four-electricity BIM three-dimensional model

    CN117934682A

  • Three-dimensional scene construction method and related device

    CN117994412A

  • Three-dimensional scene data generation method, analysis method and rendering equipment

    CN121033331A