A method and apparatus for real-time online visualization of multi-resolution grid data
By using distributed storage and real-time communication technology on the browser side, the problems of large data volume and low read/write efficiency of multi-resolution 3D mesh models are solved, realizing online real-time visualization of massive 3D mesh data and improving data transmission and visualization performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, the data organization and visualization methods for multi-resolution 3D mesh models are independent and unsystematic, resulting in massive data volume, low read/write efficiency, excessive browser memory pressure, and difficulty in achieving online updates.
HDF5 files with distributed storage are used to store multi-resolution stacked mesh models in the MinIO object storage system. Combined with quadtree indexes and Z-Order data nodes, data reading and transmission are optimized. On the browser side, real-time communication and multi-threaded processing are achieved through WebSocket and WebWorker. Combined with virtual quadtree organization and viewpoint-dependent block rendering, visualization performance is optimized.
It enables online real-time visualization of massive amounts of multi-resolution 3D mesh data, improves data reading and transmission efficiency, reduces browser memory pressure, and optimizes visualization performance and frame rate.
Smart Images

Figure CN121033329B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of data processing and visualization, and particularly relates to a multi-resolution mesh data real-time online visualization method and device. BACKGROUND
[0002] Three-dimensional model data is various, and mesh model contains rich information and can express various properties inside three-dimensional entities, and is widely applied in the fields of geoscience and three-dimensional visualization. However, the data organization mode of the mesh model has problems of large data volume and low visualization performance, especially for multi-resolution three-dimensional models.
[0003] In view of the problem, researchers have done a lot of work from the aspects of data compression and data organization, such as: SBRT (Stack-based terrain representation) defines a stack-based layered mesh model to realize efficient compression of three-dimensional mesh models; the 3DTiles structure of Cesium realizes efficient multi-resolution data organization, realizes loading of fine model data in the near place and loading of coarse model data in the far place; the LOD (Level of Detail) model based on a viewpoint depends on the change of the viewpoint for the local resolution of a space object, and the detail level at different distances from the viewpoint changes with the movement of the viewpoint.
[0004] Based on the above research, the organization and visualization of three-dimensional mesh models have been greatly developed. However, for multi-resolution massive mesh model data, the data organization and visualization method are relatively independent and do not form a system. The stack-based layered mesh model compresses the data volume and also provides a visualization scheme, but this is only for single-resolution models, and the existing multi-resolution layered mesh model file organization is also a single file, which has large data volume and low reading and writing efficiency; the data organization and visualization effect of 3DTiles are remarkable, but he mainly targets triangular mesh data, which is a specific format and is not universal, and it is difficult to process mesh model data; the LOD model based on a viewpoint only realizes the visualization of multi-resolution regular mesh models, and the data is not online updated but offline, that is, all resolution data is loaded into the browser at the beginning, which causes great pressure on the browser memory. SUMMARY
[0005] In order to overcome the problems in the prior art, the present application proposes a multi-resolution grid data real-time online visualization method and device aiming at the problems of large data volume of three-dimensional regular grid model, slow data read-write transmission of single storage file, low visualization performance and the like. The distributed storage, indexing and transmission of the stack-based layered grid model are carried out, and the data reading and transmission efficiency is optimized. The virtual quadtree organization of the model and the view-based block rendering and splicing are carried out on the browser side, and the browser data pressure and visualization performance are optimized. Finally, the online real-time visualization of massive multi-resolution three-dimensional grid data is realized. Firstly, in the storage layer, the multi-resolution layered grid model data is stored into the HDF5 file according to the principle of distributed storage, the number of HDF5 files is consistent with the number of resolutions, N HDF5 files are placed into the object storage system Minio, and four (quadtree index, Z-Order) data nodes are used to read the virtual partition of the storage system, so that each node is responsible for different subsets of objects. The parameter information (maximum level, minimum level, block size, query index and the like) of the multi-resolution layered grid model is placed into a separate HDF5 file as metadata, so as to reduce the storage space and optimize the query efficiency. A directory server is designed in the service layer to distribute the browser request to the four data nodes of the service layer, and a specific block is sent to a specific data node for acquisition, which is similar to a block strategy. The block strategy adopts Z-Order sequence for indexing, which ensures that adjacent blocks will not be stored in the same data node, and the transmission efficiency is improved. The browser side receives different resolution or different block data sent by the server through WebSocket real-time communication and WebWorker multithreading, and the transmission efficiency is optimized. At the same time, the virtual quadtree structure is designed on the browser side to organize the received data, and the block rendering and splicing are carried out according to the viewpoint. When the LOD model is visualized in real time, the coarse model is used to display the far distance, and the fine model is used to display the near area, so that the frame rate and efficiency of visualization are optimized based on the viewpoint-based data update, virtual quadtree organization method, view-based multi-resolution volume texture management and layered grid-based texture design strategy. Finally, through the performance optimization of the storage layer, the service layer and the application layer, the online real-time visualization of massive three-dimensional grid model data is realized.
[0006] The specific technical scheme is:
[0007] A multi-resolution grid data real-time online visualization method, comprising the following steps:
[0008] a) merging the three-dimensional regular grid data along the Z direction to form a layer sequence column with the same attribute, and keeping the regular grid in the XY direction to obtain a multi-resolution layered grid model;
[0009] b) Establishing corresponding HDF5 files according to resolution levels respectively, and writing all HDF5 files into a MinIO distributed object storage cluster to realize parallel file persistence;
[0010] c) Writing the level range, blocking parameters and two-dimensional index table of the model into an independent HDF5 metadata file, and storing the file into the MinIO cluster together with the resolution files of step b);
[0011] d) Using Z-Order sequential blocking reading on four nodes of the MinIO cluster to make adjacent blocks transmitted in parallel by different nodes;
[0012] e) Building a virtual quadtree index on the browser side, and receiving different resolution block data returned by the server in Z-Order sequence;
[0013] f) Transmitting the received data to the main thread through WebWorker multithreading and WebSocket full-duplex channel, and keeping the main thread from being blocked during rendering;
[0014] g) Calculating the Manhattan distance based on the distance of the viewpoint, and dynamically determining the farthest loading boundary of each level block and the maximum number of high-resolution blocks to be loaded to realize LOD progression;
[0015] h) Establishing an index texture array and a data texture array for the determined blocks, and loading the blocks into the GPU in the form of three-dimensional textures;
[0016] i) Recording the resolution and texture array index of each block using LODInfoTexture on the GPU side, and completing the block rendering through ray casting to realize real-time visualization with optimized frame rate.
[0017] A multi-resolution grid data real-time online visualization device comprises the following modules:
[0018] A model construction module merges units with the same attributes along the Z direction to form a layer sequence column, and keeps a regular grid in the XY direction to obtain a multi-resolution layered grid model;
[0019] A file establishment module establishes corresponding HDF5 files according to resolution levels respectively, and writes all HDF5 files into a MinIO distributed object storage cluster to realize parallel file persistence;
[0020] A writing module writes the level range, blocking parameters and two-dimensional index table of the model into an independent HDF5 metadata file, and stores the file into the MinIO cluster together with the resolution files;
[0021] A blocking module uses Z-Order sequential blocking reading on four nodes of the MinIO cluster to make adjacent blocks transmitted in parallel by different nodes;
[0022] An index construction module, a virtual quadtree index is constructed at the browser end, and different resolution block data returned by the server is received in Z-Order sequence;
[0023] A transmission module, received data is transmitted to the main thread through a WebWorker multithread and a WebSocket full-duplex channel, and the main thread keeps rendering from being blocked;
[0024] An ordering module, Manhattan distance is calculated based on the distance of a viewpoint and is ordered, the farthest loading boundary of each level block and the maximum number of resolution block loading are dynamically determined, and LOD progression is realized;
[0025] A loading module, an index texture array and a data texture array are established for the determined block, and the block is loaded into a GPU in the form of a three-dimensional texture;
[0026] A rendering module, LODInfoTexture is used on the GPU side to record the resolution of each block and the texture array subscript, block body rendering is completed through ray casting, and real-time visualization of frame rate optimization is realized.
[0027] An electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method.
[0028] A computer-readable storage medium having stored executable instructions, which, when executed by a processor, cause the processor to implement the method.
[0029] The present application has the following beneficial effects:
[0030] The multi-resolution layered grid model of the present application is stored in multiple HDF5 files according to the number of resolutions, so that when a browser simultaneously acquires multiple blocks of multiple levels, I / O blocking caused by reading only one file is avoided, and parallel capability is improved; metadata information is in a separate HDF5 file, so that the metadata can be loaded into memory as hot data, reducing disk I / O consumption.
[0031] The present application introduces an object storage Minio system, virtualizes multiple resolution layered grid HDF5 files to different nodes, ensures the uniqueness of data files, and can perform I / O in parallel.
[0032] The service layer of the present application combines a virtual distributed structure, designs a mode of a Z-Order data transmission directory server, and realizes data scheduling to ensure balanced data transmission load.
[0033] The application adopts visual layer Worker multithreading and WebSocket real-time communication to improve the online data acquisition rate, optimizes the efficiency of ray casting volume rendering based on the viewpoint-based data update, virtual quadtree organization, multi-resolution volume texture management based on the viewpoint, and texture design strategy based on the layered grid, and can improve the visualization efficiency and frame rate. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 The overall technical process of the application.
[0035] Figure 2 The data organization of the layered grid.
[0036] Figure 3 The layered grid storage strategy and results based on HDF5.
[0037] Figure 4 MinIO data server Z-Order strategy.
[0038] Figure 5 Virtual organization of multi-resolution layered grid volume data on the browser side.
[0039] Figure 6 Control strategy based on the viewpoint.
[0040] Figure 7 Index (data) texture organization for multi-resolution rendering.
[0041] Figure 8 Principle and instance of LODInfoTexture.
[0042] Figure 9 Texture management based on the layered grid. (a) Size of the index texture is set according to the number of horizontal grid in the above, (b) each texture unit of the index texture.
[0043] Figure 10 Visualization effect. (a) and (b) are top view and perspective view. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical scheme and advantages of the application clearer, the application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the application and not to limit the application. In addition, the technical features involved in each embodiment of the application described below can be combined with each other as long as they do not conflict with each other. In order to achieve the above purpose, the application adopts the following technical scheme.
[0045] This invention provides a method for real-time online visualization of multi-resolution grid data, comprising the following steps:
[0046] Step 1: Convert the multi-resolution 3D regular mesh data into a stack-based multi-resolution layered mesh model, that is, merge meshes with the same attributes in the Z direction into a single column, while the XY direction remains a regular mesh.
[0047] Step 2: Set up the MinIO distributed object storage cluster. Start four Minio object storage nodes and use a load balancing strategy to achieve persistent storage and virtual backup of files. Read the multi-resolution stacked mesh model obtained in Step 1 and write it to multiple HDF5 files according to resolution level. Then, write the generated HDF5 files sequentially to the MinIO distributed cluster.
[0048] Specifically, for each of the N resolution levels of the multi-resolution stacked mesh model, a separate Level_N.h5 file is created (where N represents the resolution level), resulting in a total of N files. Each file represents a model at a specific resolution. The file attributes store the starting point of the stacked mesh model at that resolution, the spatial size of the model, the number of blocks in each of the three directions, the size of each block, and the intra-block orientation. Each file contains a Group. The TileData group contains the specific data for each valid block. Each valid block has two datasets containing the stacked mesh logical structure data (Data array and Index array), both of which are one-dimensional datasets.
[0049] Step 3: Write the metadata of the multi-resolution stacked mesh model, including the maximum and minimum resolution levels, the number of grids in the XY direction (GridSizeX and GridSizeY) for each resolution, the number of blocks in the XY direction (TileSizeX and TileSizeY), and the two-dimensional index table, into a separate HDF5 file named TileInfo. Finally, write this file, along with the N multi-resolution files from Step 3, to the MinIO distributed cluster.
[0050] Specifically, the TileInfo file stores the minimum level (minLevel) and maximum level (maxLevel) in its attributes. The TileInfo file consists of N groups, each representing a resolution. Each group is divided into two datasets: one for indexing and the other for storing the index position of the sub-block of this resolution's cascaded mesh model in the list of valid blocks and the resolution level of the sub-block.
[0051] Step 4: N+1 HDF5 files are stored in the MinIO distributed cluster, each with a complete backup on one of the four data nodes. Data consistency is maintained across all nodes in the cluster, preparing for subsequent fast data reading and transmission. The files on the four MinIO nodes are read and transmitted in Z-Order order, based on model block partitioning. Z-Order order represents the overlapping order of two-dimensional objects, improving the parallelism of data querying and retrieval, ensuring that adjacent blocks are not read from the same server, and reducing the possibility of blocking.
[0052] Step 5: The data received by the browser is organized according to a virtual quadtree index structure. This structure still adopts a hierarchical strategy, similar to a pyramid-shaped multi-level linear structure, with each level corresponding to a one-dimensional linear storage space.
[0053] Specifically, all nodes of the quadtree are processed in layers, and the nodes in each layer are indexed in Z-Order order. The indices of the parent and child nodes of adjacent layers can be obtained by simply multiplying or dividing by 2 and rounding down.
[0054] Step 6: Data acquisition on the browser side uses browser thread WebWorker and full-duplex communication protocol WebSocket for real-time communication and transmission.
[0055] Specifically, four worker threads are created on the browser side to receive data sent by the Minio server node. The worker threads and the server receive data via WebSocket and then send it to the main thread. In this way, the shared threads receive data from the data server step by step via WebSocket, while the main thread is responsible for page rendering, data drawing, and calculation. When a shared thread receives a set of data, it communicates with the main thread and passes it to the main thread for subsequent processing, preventing the main thread from being blocked due to large data volume and long request times.
[0056] Step 7: When acquiring and displaying multi-resolution models in real time, based on the patterns of human eye observation, a coarser model is used to display distant objects, while a finer model is used to display closer areas. Therefore, determining different rendering resolutions based on the viewpoint is crucial.
[0057] Specifically, based on the viewpoint control approach, the minimum resolution level to be drawn (all its blocks are loaded as data at the farthest point of the view) and the maximum number of blocks to be loaded at other resolution levels besides the minimum resolution level (4 is used in this invention) are determined. Then, the maximum resolution level to be loaded is determined, the Manhattan distance from all nodes of the layer where the maximum resolution level is located to the viewpoint is calculated, and then they are sorted in ascending order to obtain the sorting and the corresponding index blocks.
[0058] Step 8: Store the acquired data in a texture array (data texture, index texture), and then create a new 2D texture detail layer texture manager LODInfoTexture to manage and read the data. The texture specification is the total number of blocks at the maximum resolution. In the RGBA color components of the texture, the R component stores the detail layer size lodsize of the block that needs to be drawn, and the G component stores the index of the index texture (data texture) required when drawing the block in the texture array.
[0059] Specifically, the first step is to determine the number of blocks to be loaded. In this method, the blocks to be loaded include all blocks at the minimum resolution and blocks loaded as the viewpoint is updated. Each block has an index texture and a data texture. The index texture and data texture of each block are placed in two separate texture arrays, stored in the loading order. The length of each array is the length of all the required blocks. Then, the texture arrays are loaded into a 3D texture in the GPU. The uv of the 3D texture represents the specification of the 2D data texture or index texture of a single block, and w is the number of blocks required. With the index texture and data texture, it is necessary to associate the maximum resolution of each node with the maximum resolution obtained from them. In the GPU, the corresponding texture data is obtained and all nodes are drawn using a ray casting algorithm. Finally, the viewpoint-based multi-resolution volume data is organized using LODInfoTexture, the data texture array, and the index texture array, and then passed to the GPU. In the GPU, the volume data is parsed according to LODInfoTexture, and drawn layer by layer and block by block, thus completing the drawing of the entire model.
[0060] Taking the multi-level (0-5 level) resolution stacked grid model of Xiong'an New Area as an example, this invention provides a method for implementing online real-time visualization technology of multi-resolution grid data, such as... Figure 1 As shown. It includes the following steps:
[0061] Step 1: The multi-resolution stacked mesh model of Xiong'an New Area is transformed from a 3D regular mesh. Each block of the single-level stacked mesh has a resolution of 64×64 in the XY direction. Mesh blocks with the same attributes or height values in the Z direction are merged into a single column. Figure 2 As shown.
[0062] Specifically, in this embodiment, the multi-resolution stacked mesh model is a hierarchical block LOD stacked mesh model with levels 0-5. Since attribute merging in the Z direction does not require block division, level 0 blocks are 2×2 with a resolution of 128×128×m (number of attributes), level 1 blocks are 4×4 with a resolution of 256×256×m (number of attributes), and so on. When the resolution level is n, the number of blocks T and resolution L of the hierarchical block stacked mesh structure are obtained:
[0063] ;
[0064] ;
[0065] More specifically, the hierarchical, block-based, stacked mesh model can be represented as:
[0066] ;
[0067] ;
[0068] In this context, LODLAyeredColumnGrid represents a multi-resolution layered grid model, Layered ColumnGrid represents a single-resolution layered grid, MinLODLevel represents the minimum resolution level, and MaxLODLevel represents the maximum resolution level. Index represents the index, which includes coordinates I, J (row and column) and ColumnId. The Index can be used to query the Column at different I and J coordinates, and the ColumnId can be used to index a segment within the Column. ColumnStrata contains two values, Z and Id, which represent the height and attribute value of a segment of the Column, respectively.
[0069] Step 2: Set up a MinIO distributed object storage cluster, start four MinIO object storage nodes, store the multi-resolution stacked mesh model defined in Step 1 into an HDF5 file, and according to the characteristics of HDF5 files and the number of resolutions of the stacked mesh, store the data in Step 1 into 6 separate HDF5 files, and then write these files to the MinIO cluster to achieve persistent storage and virtual backup.
[0070] Specifically, such as Figure 3 As shown, these files are named Level_n.h5. Each file's attributes store the starting point of the stacked mesh model at this resolution, the model's spatial size (128×128×number of attributes, 256×256×number of attributes, ..., etc.), the number of blocks in the model's three directions (2×2, 4×4, ..., etc.), the size of the resulting blocks, and the intra-block orientation. Each file contains a TileData group storing the effective blocks, with Num representing the number of effective blocks for a model at resolution n. T :
[0071] ;
[0072] More specifically, the TileData group contains the concrete data for each valid block. Each valid block has two datasets containing concrete data: ColumnIndex_x (the tier index x) and ColumnData_x (the tier data x) (where x ∈ Num). TBoth are one-dimensional datasets, storing data consistent with the stacked grid logical structure of the Data and Index arrays. The specific data within the ColumnData dataset can be queried using the ColumnIndex index. The ColumnIndex dataset is a pairwise index; ColumnIndex[i] and ColumnIndex[i+1] (where i=2n, n=0,1,2,...,n) represent a Column index. The former indicates the position pointer of the first set of data information in the ColumnData dataset, and the latter indicates the number of layers contained in this Column. The ColumnData dataset contains the specific data and is also a pairwise structure. ColumnData[i] and ColumnData[i+1] (where i=2n, n=0,1,2,...,n) represent a segment of data in a Column; the former represents the attribute value, and the latter represents the height value. The correspondence between the index and the data segment j of the Column is as follows:
[0073] ;
[0074] By using stacked meshes and HDF5 file storage, 3D mesh model data can be compressed while retrieval efficiency is improved. For example, a regular mesh model with a resolution of 512×512×512 and 6 attribute layers has the storage space for regular meshes and stacked meshes as shown in Table 1:
[0075] Table 1
[0076]
[0077] Step 3: Write the metadata of the multi-resolution stacked mesh model, including the maximum and minimum resolution levels, the number of grids in the XY direction (GridSizeX and GridSizeY) for each resolution, the number of blocks in the XY direction (TileSizeX and TileSizeY), and the 2D index table, into a separate HDF5 file—TileInfo. Finally, write this file, along with the N multi-resolution files from Step 2, into the MinIO distributed cluster.
[0078] Specifically, the TileInfo file consists of N groups, each representing a resolution. The groups are named Level_N, and each group is divided into two datasets: the TileInfoIndex dataset is used for indexing, and the TileInfoList dataset is used to store the index position of the tile in the valid block list and the resolution level of the sub-block in the stacked mesh model for this resolution. The length of TileInfoIndex is the number of blocks T in step 1, and the length of TileInfoList is ≤ T. TileInfoIndex[index] (where index = y + TileSize) The value of `x` (where x is the row coordinate, y is the ordinate, and TileSize is the number of blocks in the x or y direction) represents the position pointer of the block in the TileInfoList. When there is no block indexed as `index` in the TileInfoList, `TileInfoIndex[index]` is -1. The value of the position attribute of TileInfoList is the same as the `x` of `ColumnIndex_x` and `ColumnData_x` in step 2. Thus, during read and write operations, the application layer only needs to transmit `level` and `index` to quickly index and query through the TileInfo file.
[0079] Step 4: N+1 HDF5 files are stored in the MinIO distributed cluster, each with a complete backup on one of the four data nodes. For example... Figure 4 As shown, the files of the four MinIO nodes are read and transmitted in Z-Order order according to the model block format, which improves the parallelism of data query and retrieval, ensures that adjacent blocks are not read from the same server, and reduces the possibility of blocking.
[0080] Step 5: Before the browser retrieves and renders the data, it first organizes it using a virtual quadtree index structure. This structure still employs a hierarchical strategy, similar to a pyramid-shaped multi-level linear structure, with each level corresponding to a one-dimensional linear storage space, such as... Figure 5 As shown.
[0081] Specifically, all nodes of the quadtree are processed in layers, with nodes in each layer indexed according to Z-Order. Furthermore, the indices of parent and child nodes in adjacent layers can be obtained by simply multiplying or dividing by 2 and rounding down. That is:
[0082] ;
[0083] ;
[0084] Where i and j are the rows and columns of the horizontal grid, tilesize is the total number of rows or columns, childindex is the one-dimensional index value of the child node, childnode is the two-dimensional index coordinate of the child node, fatherindex is the one-dimensional index value of the adjacent parent node of the child node, and fathernode is the two-dimensional index coordinate of the adjacent parent node of the child node.
[0085] More specifically, when requesting data from the server, according to the Z-Order principle, the virtual quadtree index structure requires querying the Minio node coordinates (X, Y) when the request parameters level and index are n and m, respectively:
[0086] ;
[0087] Step 6: Data acquisition on the browser side uses WebWorker and WebSocket for real-time communication and transmission.
[0088] Specifically, four new worker threads are created on the browser side to receive data sent by the Minio server node. The worker threads and the server receive data via WebSocket and then send it to the main thread. In this way, the shared threads receive data from the data server step by step via WebSocket, while the main thread is responsible for page rendering, data drawing, and calculation. When a shared thread receives a set of data, it communicates with the main thread and passes it to the main thread for subsequent processing, preventing the main thread from being blocked due to large data volume and long request times.
[0089] More specifically, the four threads acquire data in the same way as the Minio node coordinates (X, Y) to be queried in step 5, using the Z-Order order to ensure that the data blocks allocated to each thread are balanced.
[0090] Step 7: When acquiring and displaying multi-resolution models in real time, based on the patterns of human eye observation, a coarser model is used to display distant objects, while a finer model is used to display closer areas. Therefore, determining different rendering resolutions based on the viewpoint is crucial.
[0091] Specifically, based on the viewpoint control approach, the minimum resolution level to be drawn is determined (all its blocks are loaded as data for the farthest point of view) and the maximum number of blocks to be loaded for other resolution levels besides the minimum resolution level (this method uses 4). Then, the maximum resolution level to be loaded is determined, and the Manhattan distance from all nodes in the layer containing the maximum resolution level to the viewpoint is calculated. These are then sorted in ascending order to obtain the sorting and corresponding index blocks. Blocks are drawn sequentially in this order. When the number of blocks to be drawn exceeds 4, the resolution is reduced by one level, and the decision on which blocks to draw is made continues. The calculation is implemented using the childindex and fatherindex methods in step 5. The Manhattan distance calculation formula is:
[0092] ;
[0093] in, Point and points The distance between them; Point In the Coordinate values in each dimension; This represents the coordinates of point j in the k-th dimension; This represents the total number of dimensions in the space.
[0094] More specifically, with Figure 6 For example, the maximum resolution level has a block resolution of 8×8. The four nodes closest to the viewpoint, 0, 1, 2, and 3, correspond to grid block indices 35, 36, 27, and 28, respectively, and their rendering resolution lodsize (level of detail) is 8. Continuing the search sequentially, we find nodes in the order 4, 5, 6, 8, 10, 11, 7, and 9, with a rendering resolution lodsize of 4. Their corresponding 4×4 resolution grid block indices are 9, 10, 5, and 6. The remaining nodes have a rendering resolution lodsize of 2. Therefore, the blocks to be loaded are the four blocks at resolution level 3 (35, 36, 27, and 28) and the four blocks at resolution level 2 (9, 10, 5, and 6), for a total of 8 blocks. This gives us the rendering resolution lodsize (level of detail) of all nodes in the layer containing the maximum resolution level, as well as the blocks to be loaded and their corresponding resolution levels.
[0095] Step 8: Calculate the blocks to be loaded and drawn based on the viewpoint, and then create two texture arrays—an index texture and a data texture—based on the number of blocks. The length of the texture array is the number of blocks to be drawn, i.e., 8 + 4 (all blocks at minimum resolution) = 12 in Step 7. Figure 7 As shown.
[0096] Specifically, each block has an index texture and a data texture. The index texture and data texture of each block are placed into two separate texture arrays, stored in the loading order. The length of each array is the length of all required blocks. Then, the texture arrays are loaded into a 3D texture array in the GPU. The uv (64×64) of the 3D texture represents the specification of the 2D data texture or index texture of a single block. w is the number of blocks required, which is 12. With the index texture and data texture, the maximum resolution of each node needs to be correlated with their respective maximum resolution. In the GPU, a ray casting algorithm is used to obtain the corresponding texture data and draw all nodes. Finally, the viewpoint-based multi-resolution volume data is organized using LODInfoTexture, the data texture array, and the index texture array, and then transferred to the GPU. In the GPU, the volume data is parsed according to LODInfoTexture, and drawn layer by layer and block by block, ultimately completing the rendering of the entire model.
[0097] Furthermore, the specification of LODInfoTexture is consistent with the number of blocks at the maximum resolution, i.e., T. n In LODInfoTexture, the R component (RGBA) stores the resolution lodsize (detail level size) that the block needs to be drawn, while the G component stores the index of the indexed texture (data texture) in the texture array required for drawing the block. For example... Figure 8 As shown, the R components 4, 8, and 2 represent lodsizes of 4, 8, and 2 respectively, and the G components, ordered as 4, 8, and 2, correspond to the texture array indices 11, 4, and 2.
[0098] Step 9: Obtain the corresponding index texture and data texture in sequence according to LODInfoTexture, then query the index value from the index texture to retrieve the data texture value and assign it to the GPU, and use the ray casting algorithm to perform volume rendering.
[0099] Specifically, such as Figure 9 As shown in (a), the size of the indexed texture is set according to the number of horizontal grid cells, i.e., width × height. Figure 9 As shown in (b), each texture unit texel of the index texture uses the R and G components of the original RGBA to store information. The R component stores the position pointer of the first set of data information of the column in the data texture, and the G component stores the number of layers contained in the column. The data texture stores the data of each column in row-major order. Similar to the index texture, it also uses two components to store the information of a certain segment of a column: the R component stores the attribute value of the column segment, and the G component stores the height value of the segment.
[0100] Ultimately, we obtained Figure 10The 3D rendering results in (a) and (b) show that the loaded blocks and the level of detail will differ depending on the viewpoint.
[0101] Another aspect of the present invention provides a real-time online visualization device for multi-resolution grid data, comprising the following modules:
[0102] The model building module merges cells with the same properties along the Z-axis to form a sequence column, while maintaining the regular grid in the XY-axis, to obtain a multi-resolution stacked mesh model.
[0103] The file creation module creates corresponding HDF5 files according to the resolution level, and writes all HDF5 files to the MinIO distributed object storage cluster to achieve parallel file persistence.
[0104] The writing module writes the model's level range, block parameters, and two-dimensional index table into an independent HDF5 metadata file, and stores it together with the files of each resolution into the MinIO cluster.
[0105] The block partitioning module uses Z-Order sequential block reading on the four nodes of the MinIO cluster, so that adjacent blocks are transmitted in parallel by different nodes;
[0106] The index building module constructs a virtual quadtree index on the browser side and receives block data of different resolutions returned by the server in Z-Order order.
[0107] The transmission module transmits received data to the main thread through WebWorker multi-threading and WebSocket full-duplex channel, while the main thread keeps rendering unblocked.
[0108] The sorting module calculates and sorts Manhattan distances based on viewpoint distances, dynamically determines the farthest loading boundary and the maximum number of blocks loaded at each level, and implements LOD progression.
[0109] The loading module creates an index texture array and a data texture array for the determined blocks, and loads them into the GPU in the form of 3D textures.
[0110] The rendering module uses LODInfoTexture on the GPU side to record the resolution and texture array index of each block, and completes the block rendering through ray casting to achieve real-time visualization of frame rate optimization.
[0111] Another aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method.
[0112] Another aspect of the present invention provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to implement the method described thereon.
Claims
1. A method for real-time online visualization of multi-resolution mesh data, characterized in that, The method comprises the following steps: a) merging cells with the same attribute along the Z direction to form a layer sequence column, and keeping a regular grid in the XY direction to obtain a multi-resolution layered grid model; b) establishing corresponding HDF5 files according to resolution levels, and writing all the HDF5 files into a MinIO distributed object storage cluster to realize parallel file persistence; c) writing the level range, block parameter and two-dimensional index table of the model into an independent HDF5 metadata file, and storing the metadata file and the resolution files of step b) in the MinIO cluster; d) reading in Z-Order sequential blocks on four nodes of the MinIO cluster, so that adjacent blocks are transmitted in parallel by different nodes; e) constructing a virtual quadtree index on the browser side, and receiving different resolution block data returned by the server in Z-Order sequence; f) transmitting the received data to the main thread through WebWorker multithreading and WebSocket full-duplex channels, and keeping the main thread from being blocked during rendering; g) calculating the Manhattan distance based on the distance of the viewpoint, and dynamically determining the farthest loading boundary and the maximum number of blocks of each level; h) establishing an index texture array and a data texture array for the determined blocks, and loading the blocks into a processor GPU in the form of three-dimensional textures; i) recording the resolution of each block and the index of the texture array on the GPU side using a level of detail texture manager LODInfoTexture, completing block rendering through ray casting, and realizing real-time visualization with optimized frame rate.
2. The method of claim 1, wherein, wherein step a) further comprises: for each level n, dividing the number of blocks , resolution ColumnStrata and Index describe the properties and location of the stratigraphic column.
3. The method of claim 1, wherein, In step b), the HDF5 file is named Level_N.h5, and the file attributes record the starting point, spatial size, number of divided blocks, block spatial size and block direction. The index and data are stored in pairs in ColumnIndex_x and ColumnData_x in the TileData tile group.
4. The method of claim 1, wherein, In step c), the metadata file TileInfo realizes fast query of block position pointers and resolution levels through two-level datasets TileInfoIndex and TileInfoList, and the missing index is marked as -1.
5. The method of claim 1, wherein, In step e), the parent-child node index of the virtual quadtree is derived from each other through multiplication and division by 2 and rounding down, and the resolution level level and block index index are directly mapped to the MinIO node coordinates (X, Y).
6. The method of claim 1, wherein, In step g), the minimum resolution is loaded, and no more than 4 blocks are selected in ascending order of Manhattan distance for the remaining levels, and when the number exceeds, the resolution is automatically reduced to the next level for further sorting and selection.
7. The method of claim 1, wherein, In step i), the LODInfoTexture has the same specification as the total number of blocks at the maximum resolution, the R component stores the block resolution lodsize, and the G component stores the corresponding texture array index. The GPU analyzes the texture to complete hierarchical block rendering.
8. A device for real-time online visualization of multi-resolution grid data, characterized in that, The method comprises the following modules: a model construction module, which merges cells with the same attribute along the Z direction to form a layer sequence column, and keeps a regular grid in the XY direction to obtain a multi-resolution layered grid model; A file establishment module establishes corresponding HDF5 files according to resolution levels, and writes all the HDF5 files into a MinIO distributed object storage cluster to realize parallel file persistence. A writing module writes the level range, block parameters and two-dimensional index table of the model into an independent HDF5 metadata file, and stores the file into the MinIO cluster together with the resolution files. A block module reads the blocks in Z-Order sequence on four nodes of the MinIO cluster, so that adjacent blocks are transmitted in parallel by different nodes. An index construction module constructs a virtual quadtree index on the browser side, and receives block data of different resolutions returned by the server in Z-Order sequence. A transmission module transmits the received data to the main thread through WebWorker multithreading and WebSocket full-duplex channels, and the main thread keeps rendering from being blocked. A sorting module calculates the Manhattan distance based on the distance of a viewpoint, sorts the blocks, dynamically determines the farthest loading boundary of each level of blocks and the maximum number of blocks to be loaded, and realizes LOD progression. A loading module establishes an index texture array and a data texture array for the determined blocks, and loads the blocks into the GPU in the form of three-dimensional textures. A rendering module records the resolution and texture array index of each block using LODInfoTexture on the GPU side, completes block rendering through ray casting, and realizes real-time visualization with optimized frame rate.
9. An electronic device, comprising: The method comprises the steps of: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, a processor, and a memory having stored thereon executable instructions which, when executed by the processor, cause the processor to carry out the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Storage and management method of multi-resolution block stacked grid based on HDF5
CN119474033A
Multi-source marine environment data storage method and system based on HDF5
CN120336278A