Error tolerance based invertible quantization and layered rendering method, device, medium and product
Patent Information
- Application Number
- CN202611520226.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0007]本发明的目的在于:提供一种基于误差容限的可逆量化与分层恢复渲染方法、设备、介质及产品,以克服现有技术中量化误差不可控、加载渲染不灵活以及压缩不可逆的问题;在保证视觉感知或工程仿真精度的前提下,最大程度提高三维模型的压缩效率,并支持在不同场景和终端算力下实现底层硬件加速的灵活解码与渲染
1、引入误差感知策略,在保障模型绝对精度的同时极致提升压缩率。本发明通过计算顶点的局部曲率与密度构建复杂度场,并结合全局误差容限为不同子区域动态分配独立误差阈值,实现了“复杂区域高精度、平坦区域低精度”的自适应分段量化。该策略从数学底层保证了量化误差被严密限制在用户设定的容限范围内(如视觉无损或仿真误差下限),相较于传统浮点表示,可在无感损耗下显著减少30%–80%的存储与传输空间。
Smart Images

Figure CN123015808A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional graphics data processing and visualization technology, specifically to a method, device, medium, and product for reversible quantization and layered recovery rendering based on error tolerance. Background Technology
[0002] The statements in this section are provided only as background information in connection with this disclosure and may not constitute prior art.
[0003] With the rapid development of technologies such as digital twins, industrial simulation, games, and Web3D, 3D models generally face technical bottlenecks during network transmission and terminal loading, including massive data volume, long decoding time, and unsmooth rendering. To improve transmission and rendering efficiency, the industry widely adopts methods for quantizing and compressing geometric and texture data (such as using mainstream tools like Draco and Open3DGC). These existing technologies typically employ a unified strategy, quantizing floating-point data to a fixed-precision integer range before encoding and compression.
[0004] However, through long-term research and engineering practice, it has been found that existing 3D model quantization and rendering loading technologies have the following obvious shortcomings: First, quantization error is uncontrollable. Existing quantization strategies are mostly based on global fixed precision, which cannot make fine adjustments for complex local geometric features of the model (such as high curvature regions), nor can they adapt to the stringent precision requirements of different vision or industrial simulation tasks, thus inevitably causing the loss of local key details or the waste of resources in flat areas.
[0005] Second, the decoding and rendering pipelines are tightly coupled and lack flexibility. The current data loading and decoding process is closely tied to quantization accuracy and lacks a multi-precision adaptation mechanism. Furthermore, traditional decompression schemes typically rely on the CPU to complete decompression before transferring the full data to the GPU. This inefficient data flow method causes a serious bandwidth bottleneck, which is extremely detrimental to adaptive rendering on various terminals (especially devices with limited computing power).
[0006] Third, the compression process is irreversible. In pursuit of the ultimate compression ratio, most existing methods employ irreversible lossy quantization strategies, making it difficult to accurately reconstruct the original high-precision geometric and attribute data in subsequent high-precision scenarios such as simulation analysis after the model has been transmitted in a lightweight manner. Summary of the Invention
[0007] The purpose of this invention is to provide a reversible quantization and layered recovery rendering method, device, medium and product based on error tolerance, so as to overcome the problems of uncontrollable quantization error, inflexible loading and rendering and irreversible compression in the prior art; while ensuring the accuracy of visual perception or engineering simulation, it maximizes the compression efficiency of 3D models and supports flexible decoding and rendering with underlying hardware acceleration under different scenarios and terminal computing power.
[0008] The technical solution of the present invention is as follows: Error-tolerance-based reversible quantization and layered recovery rendering methods include: Step S1: Receive the original 3D model data and obtain the preset error tolerance parameters; perform spatial analysis on the original 3D model data to determine its geometric range; Step S2: Normalize the three-dimensional model space corresponding to the original three-dimensional model data, construct a complexity field based on the local curvature and local vertex density of each vertex in the original three-dimensional model data, and divide the three-dimensional model space into multiple sub-regions based on the complexity field; determine the independent error threshold corresponding to each sub-region according to the complexity of each sub-region and the error tolerance parameter. Step S3: For each sub-region, calculate the minimum quantization precision bit width of the original 3D model data based on the corresponding independent error threshold; according to the minimum quantization precision bit width, encode the floating-point type original 3D model data into integers and generate corresponding quantization metadata, which at least includes the quantization step size and the minimum reference value. Step S4: Construct a reversible intermediate representation structure based on the encoding results of all sub-regions. The reversible intermediate representation structure includes a multi-precision hierarchical structure, which sequentially includes: a base layer using the lowest acceptable precision representation, at least one residual layer recording the difference between adjacent precision layers, and a metadata area storing the quantization metadata. Step S5: During the rendering stage, the reversible intermediate representation structure is loaded as needed, and the loaded base layer and residual layer are stored in the video memory object of the graphics processor (GPU). The parallel computing kernel of the GPU is called to read the base layer, and the residual layer is added layer by layer as needed for inverse quantization reconstruction until the reconstructed 3D model data that meets the error tolerance parameters is obtained. The reconstructed 3D model data is then passed to the graphics rendering pipeline for real-time rendering.
[0009] Furthermore, the division of the three-dimensional model space into multiple sub-regions based on the complexity field includes: The three-dimensional model space is partitioned using an octree or voxel partitioning method; Calculate the variance of the complexity field within the currently partitioned region; When the complexity variance is less than a preset complexity variance threshold, the division stops, resulting in multiple sub-regions. Wherein, the independent error threshold corresponding to the sub-region satisfy: ,in, This refers to the global error tolerance parameter. A function related to the complexity of the sub-region; The local curvature of the vertex is calculated based on the difference in normal vectors between adjacent triangular faces or a second-order geometric matrix.
[0010] Further, the minimum quantization precision bit width of the original 3D model data is calculated based on the corresponding independent error threshold, and the floating-point type original 3D model data is integerized according to the minimum quantization precision bit width, specifically including: Calculate the coordinate quantization step size for vertex coordinate data. ; Based on the geometric extent of the sub-region and the coordinate quantization step size Calculate the minimum quantization precision bit width ; According to the formula Alternatively, a rounding function can be used to convert floating-point coordinates. Convert to integer encoding ,in This is the minimum reference value for the sub-region.
[0011] Furthermore, the at least one residual layer that records the difference between adjacent precision levels specifically includes: No. Level residual layer record from the first Level accuracy restored to the first The difference required for a certain level of accuracy; When the difference is sparsely distributed, the residual layer uses a compressed sparse row index format for sparse storage, or uses entropy coding for compressed storage, so as to control that only non-zero residual values are decoded on the graphics processing unit (GPU).
[0012] Furthermore, the step of calling the GPU's parallel computing kernel to read the base layer and accumulating the residual layer layer by layer as needed for inverse quantization reconstruction specifically includes: Parallel threads are allocated to each vertex by the GPU's computational shaders; In each of the parallel threads, the base layer is decoded based on the quantization step size and minimum reference value in the quantization metadata to obtain the initial reconstructed value; If higher reconstruction accuracy is required, the residual values of the required levels are read layer by layer. The residual value of the current level is multiplied by the corresponding quantization step size and then added to the reconstruction value of the previous level to obtain the reconstruction value of the current level, which satisfies the reconstruction formula: ,in, For the first The reconstructed value of the level, For the first The reconstructed value of the level, For the first The residual value of the level, For the first Quantization step size at each level; The quantization error during the reconstruction process is corrected and controlled to ensure that the coordinate error of the final reconstructed 3D model data does not exceed the error tolerance parameter.
[0013] Furthermore, the on-demand loading of the reversible intermediate representation structure includes employing a progressive loading and error-aware level-of-detail control strategy, specifically including: During the initial display phase, the base layer is loaded first. During real-time rendering, the number of residual layers to be loaded is dynamically determined based on camera distance, interaction frequency, and system computing power budget. Specifically, the accuracy level corresponding to the error tolerance parameter is set to the highest loading priority, and when the system computing power budget is insufficient, the video memory of the residual layer corresponding to the three-dimensional model space outside the viewport is preferentially reclaimed.
[0014] Furthermore, the sources for obtaining the error tolerance parameter include: The visual perception index thresholds are set based on the visualization rendering task, and these thresholds include the maximum visual deviation; or, The simulation accuracy index threshold is set for the analysis task based on finite element simulation. The simulation accuracy index threshold includes mesh deformation limit or nodal displacement error limit.
[0015] The present invention also proposes an electronic device, comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the instructions stored in the memory to perform the method described above.
[0016] The present invention also proposes a computer-readable storage medium for storing instructions that, when executed, cause the method described above to be implemented.
[0017] The present invention also proposes a computer program product, which implements the above-described method when executed by a processor.
[0018] Compared with existing technologies, the advantages of this invention are: 1. Introducing an error-aware strategy to maximize compression ratio while ensuring absolute model accuracy. This invention constructs a complexity field by calculating the local curvature and density of vertices and dynamically assigns independent error thresholds to different sub-regions based on global error tolerance, achieving adaptive segmented quantization with "high precision in complex regions and low precision in flat regions." This strategy mathematically guarantees that quantization errors are strictly limited to user-defined tolerances (such as visual lossless or simulation error lower limits), significantly reducing storage and transmission space by 30%–80% without noticeable loss compared to traditional floating-point representation.
[0019] 2. Constructing a multi-precision hierarchical structure to support progressive on-demand loading and smooth rendering. This invention abandons the traditional single-layer data structure and innovatively reconstructs model data into a reversible intermediate representation structure containing a "base layer" and "multi-level residual layers." This mechanism allows terminals with different hardware capabilities or network environments to flexibly determine the loading level based on camera distance and computing power budget (LOD control strategy), completely solving the pain points of low initial frame rate and loading stuttering for large models.
[0020] 3. Breaking through the CPU decompression bottleneck and achieving seamless integration with the GPU graphics rendering pipeline. This invention utilizes the parallel computing kernel of the graphics processing unit (GPU) (such as Compute Shader) to directly read the base layer and sparse residual layer in the video memory object, completes multi-threaded parallel layer-by-layer dequantization reconstruction within the video memory, and directly sends the results to the graphics rendering pipeline. This architecture achieves "decoding and rendering on the same side," completely releasing CPU computing power and eliminating bus bandwidth bottlenecks, and is particularly compatible with the underlying parallel optimization mechanisms of domestically developed GPUs such as Moore's Threads.
[0021] 4. High reversibility and compatibility with multi-scale simulation applications. The quantization and layer-by-layer accumulation reconstruction mechanism of this invention possesses complete mathematical reversibility. As long as sufficient levels of residuals are accumulated, 100% lossless restoration to the original floating-point data can be achieved. Furthermore, the error tolerance setting not only accommodates maximum visual deviation but also seamlessly integrates with the mesh deformation and node displacement constraints of finite element simulation, truly realizing a deep cross-domain fusion of lightweight model processing and high-precision industrial simulation tasks. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0023] Figure 1 This is a system architecture diagram provided in an embodiment of the present invention; Figure 2 This is an adaptive quantization flowchart provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the multi-precision hierarchical structure provided in an embodiment of the present invention; Figure 4 This is a flowchart of the progressive loading and decoding process provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the GPU parallel decoding and rendering pipeline fusion architecture provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0024] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0025] The features and performance of the present invention will be further described in detail below with reference to embodiments.
[0026] Example 1 This embodiment provides a reversible quantization and layered recovery rendering method based on error tolerance. For ease of understanding, this embodiment will be described in detail using the real-time rendering and finite element simulation visualization of large industrial equipment CAD models (such as assemblies, piping systems, etc.) in a domestically developed environment (such as the MUSA architecture of Moore Threads S3000 / X3000) as a specific application scenario.
[0027] Combined with appendix Figure 1The system architecture diagram shown illustrates an end-to-end system processing architecture and data flow mechanism constructed in this embodiment to achieve the objectives of this invention. In this system architecture, model data flows from input to final presentation, sequentially passing through the following core components and logical links: First, at the encoding processing end, the quantization preprocessing module performs spatial analysis and segmented quantization on the input 3D model, and after completing the integer encoding and hierarchical structure construction, outputs reversible quantized encoding; The output encoded data is then uniformly stored in the reversible quantization encoding storage area on the network or local end, serving as the data source for subsequent on-demand loading; During the rendering and display phase, the client decoder running on the terminal initiates a data request to read the reversible quantization code from the storage area; subsequently, the client decoder executes the underlying hardware call instruction to hand over the decoding task to the GPU parallel decoding kernel; The GPU parallel decoding kernel directly performs a layer-by-layer accumulation and reconstruction operation of the base layer and residual layer in the video memory. After completing the dequantization recovery, it outputs vertex / texture data to the graphics rendering pipeline. Finally, the high-precision 3D model data is sent to the rendering engine, and the rendering results generated by the rendering engine are simultaneously distributed to two application terminals: one is output to the display device for visual perception and real-time preview, and the other is input to the simulation module for high-fidelity engineering simulation analysis in combination with physical data such as stress and deformation.
[0028] based on Figure 1 The overall system architecture and strict data flow chain are shown below. The specific processing steps of the above method at the execution level in this embodiment are detailed as follows: Step S1: Receive the original 3D model data and obtain the preset error tolerance parameters; perform spatial analysis on the original 3D model data to determine its geometric range; In this embodiment, the original 3D model data includes, but is not limited to, vertex coordinates, normal vectors, texture coordinates (UV), and optional additional attributes (such as color, weight, simulation result fields, etc.).
[0029] To address the issue that existing technologies (such as Draco) use uniform, fixed precision for quantization, which fails to meet the precision requirements of different terminals or tasks, this embodiment introduces an error tolerance control mechanism. Specifically, the error tolerance parameters are obtained from: visual perception index thresholds set based on the visualization rendering task, whereby the visual perception index thresholds include the maximum visual deviation (e.g., setting texture coordinate error). Alternatively, a simulation accuracy threshold is set based on the analysis task of finite element simulation, wherein the simulation accuracy threshold includes mesh deformation limit or nodal displacement error limit (e.g., setting vertex coordinate displacement error). ).
[0030] Through spatial analysis, the bounding boxes and geometric extents of the model in the X, Y, and Z dimensions are obtained. , , This provides a global benchmark for subsequent normalization and quantization.
[0031] Step S2: Normalize the three-dimensional model space corresponding to the original three-dimensional model data, construct a complexity field based on the local curvature and local vertex density of each vertex in the original three-dimensional model data, and divide the three-dimensional model space into multiple sub-regions based on the complexity field; determine the independent error threshold corresponding to each sub-region according to the complexity of each sub-region and the error tolerance parameter. In this embodiment, to achieve adaptive quantization with "high precision in complex areas and low precision in flat areas", the following specific operating principles are further included: First, the local curvature κ of the vertex is calculated based on the difference in normal vectors between adjacent triangular faces or a second-order geometric matrix. Combined with the local vertex density, a scalar field, i.e., a complexity field, is constructed in the 3D model space. .
[0032] Subsequently, the 3D model space is recursively partitioned using an octree or voxel partitioning method. After each partition, the complexity variance of the complexity field within the current partitioned region is calculated. When the complexity variance is less than a preset complexity variance threshold, it indicates that the geometric features within the region have become smooth and uniform. At this point, the partitioning is stopped, and multiple sub-regions (Blocks) are finally obtained.
[0033] Furthermore, the independent error threshold corresponding to the sub-region Satisfying the formula: .in, The global error tolerance parameter obtained in S1. This is a monotonically decreasing function related to the complexity of the sub-region. The physical meaning of this formula is: through... The function dynamically relaxes or tightens the quantization error in different complexity regions, but the upper limit of the error in any region is strictly truncated and constrained to a globally user-defined limit. Within this range, theoretically 100% accuracy and safety are guaranteed.
[0034] To ensure the feasibility of the algorithm and the full disclosure of the technical solution of this invention, the following is provided: A specific calculation model: As a preferred implementation method, the... Configurable to complexity The inverse proportional mapping function or negative exponential function. For example, the formula can be used. Calculations are performed, in which, The system's preset scaling factor. To prevent extremely small smoothing constants with denominators of zero (such as taking...) ).
[0035] Based on the specific function model described above, its working principle and beneficial effects are as follows: when the sub-region is a complex region with high curvature and high density (i.e., complexity...) (where the value is extremely large), the allowable error calculated according to this formula is... The quantization step size tends to a minimum, thus forcing a smaller quantization step size in the complex region to maintain high-precision reconstruction; conversely, when the sub-region is a flat region (i.e., complexity...), the quantization step size tends to a minimum, thus forcing a smaller quantization step size in the complex region to maintain high-precision reconstruction. (The value is extremely small) As the calculated value increases, the quantization precision is automatically relaxed to improve the compression ratio. Based on this, through the outer layer... The function performs hard truncation, ensuring that no matter how much precision is relaxed in any flat region, the final quantization error upper limit is firmly locked at the user-defined global safety baseline. Within this framework, a perfect balance between "adaptive compression" and "controllable absolute error" is achieved.
[0036] Step S3: For each sub-region, calculate the minimum quantization precision bit width of the original 3D model data based on the corresponding independent error threshold; according to the minimum quantization precision bit width, encode the floating-point type original 3D model data into integers and generate corresponding quantization metadata, which at least includes the quantization step size and the minimum reference value. In this embodiment, the working principle of the above-mentioned integer encoding specifically includes: For vertex coordinate data, the maximum quantization error must not exceed [a certain value]. Therefore, the span of the quantization interval (i.e., the coordinate quantization step size) is set to... .
[0037] Based on the geometric extent of the sub-region and the coordinate quantization step size The minimum quantization precision bit width that can cover this range without loss is calculated using the principle of information entropy. This dynamic bit-width calculation avoids the significant waste of storage resources caused by the uniform use of 32-bit or 16-bit in traditional algorithms.
[0038] Subsequently, according to the formula Alternatively, a rounding function can be used to convert floating-point coordinates. Convert to integer encoding ,in This is the minimum reference value for the sub-region.
[0039] Combined with appendix Figure 2 The adaptive quantization flowchart shown above summarizes the core execution process from data input to encoding completion as follows: The system first inputs model data and reads the error tolerance; then, it calculates the quantization step size according to the formula; next, it performs regional segmentation or overall quantization according to the pre-constructed complexity field; finally, it encodes the floating-point data into integers to generate reversible quantization codes, completing the entire process of the quantization preprocessing stage.
[0040] Step S4: Construct a reversible intermediate representation structure based on the encoding results of all sub-regions. The reversible intermediate representation structure includes a multi-precision hierarchical structure, which sequentially includes: a base layer using the lowest acceptable precision representation, at least one residual layer recording the difference between adjacent precision layers, and a metadata area storing the quantization metadata. In this embodiment, to support subsequent progressive network transmission and terminal adaptive loading, the reversible intermediate representation structure (QIR) is designed as a multi-level structure. The base layer uses extremely low uniform precision (e.g., 8-bit) to store the basic topology and coarse location of the model, primarily for placeholder previews or distant rendering.
[0041] No. Detail Layer Record from the first Level accuracy restored to the first The difference required for higher levels of precision. Since the difference at higher levels is mostly 0 in flat regions, when the difference is sparsely distributed, the residual layer uses a compressed sparse row (CSR-like) index format for sparse storage, or uses entropy coding for compressed storage, to control that only non-zero residual values are decoded at the graphics processing unit (GPU), greatly reducing the problem of high memory bandwidth usage.
[0042] The metadata area can store the precision parameters, quantization step size, and segment index table of each layer, and provides necessary data support such as decoding order and weights. It also supports mechanisms such as fast jump, on-demand decoding, and lazy loading.
[0043] Combined with appendix Figure 3 The diagram shown illustrates a multi-precision hierarchical structure, where the reversible intermediate representation structure exhibits a clear hierarchical relationship in both physical and logical storage: Its top layer is the Base Layer (lowest precision model), which is then progressively linked to Detail Layer 1 (level 1 residual), Detail Layer 2 (level 2 residual) and so on up to Detail Layer N (level N residual). At the same time, all base layers and residual layers point to and are associated with the bottom Meta Region (quantization metadata), which provides key parameters such as quantization step size for the dynamic loading and decoding of each layer.
[0044] Step S5: During the rendering stage, the reversible intermediate representation structure is loaded as needed, and the loaded base layer and residual layer are stored in the video memory object of the graphics processor (GPU). The parallel computing kernel of the GPU is called to read the base layer, and the residual layer is added layer by layer as needed for inverse quantization reconstruction until the reconstructed 3D model data that meets the error tolerance parameters is obtained. The reconstructed 3D model data is then passed to the graphics rendering pipeline for real-time rendering.
[0045] This embodiment breaks away from the inefficient pipeline of traditional methods that decompress the model on the CPU before sending it to the GPU, achieving a deep pipeline fusion of decoding and rendering. The specific workflow and mathematical reconstruction principles are as follows: First, the model loading end dynamically determines the number of layers to load based on the current terminal's hardware performance, network bandwidth, or specific task requirements. It prioritizes loading the base layer data and storing it in the GPU's video memory objects (such as SSBO / VBO buffer objects).
[0046] Subsequently, the GPU's compute shader allocates parallel threads to each vertex (e.g., 256-512 threads per workgroup). Within each parallel thread, the base layer is first decoded to construct a simplified model for fast rendering or placeholder preview; the corresponding decoding and reconstruction formula is as follows:
[0047] in, These are the initial floating-point coordinates for the basic layer reconstruction. The integer-encoded values of the base layer, The quantization step size of the base layer, This is the minimum baseline value recorded in the quantized metadata.
[0048] After the base layer is loaded, if the system allows for increased precision (i.e., dynamically determines that a residual layer needs to be loaded), the residual layers are read and decoded layer by layer to reversibly restore precision. Specifically, the residual value of the current layer is multiplied by the corresponding quantization step size and then added to the reconstructed value of the previous layer to obtain the reconstructed value of the current layer, satisfying the following reconstruction formula:
[0049] in, For the first The reconstructed value of the level, For the first The reconstructed value of the level, For the first The residual value of the level, For the first The quantization step size is set at the [level]. Because the residual data uses sparse storage methods such as compressed sparse row index format in GPU memory, the GPU kernel can take advantage of vectorized instructions to efficiently skip zero values and achieve fast parallel reconstruction.
[0050] Finally, the system must correct and control the quantization errors during the reconstruction process. After... After the layer-by-layer residual recovery, it is necessary to ensure that the coordinates of the final reconstructed 3D model data are consistent with the original floating-point coordinates. The error between them shall strictly not exceed the global error tolerance parameter set in step S1. That is, mathematically, the following error constraint formula must be satisfied:
[0051] It is worth emphasizing that, in order to demonstrate the core technical advantage of "complete reversibility" of this method, if the loaded residual layer covers all bit planes of the model data, the original floating-point data can be recovered completely without loss (i.e. the error converges to 0), thereby achieving the highest level of fidelity in subsequent high-precision simulation analysis scenarios.
[0052] Based on this mathematical reconstruction principle, in order to achieve seamless integration of the above method with existing rendering systems, this embodiment further includes the following implementation details for specific engineering applications: (1) Specific implementation of GPU decoding: This method is compatible with mainstream graphics rendering engines and supports real-time GPU decoding and reconstruction. All residual layers are stored in a buffer object in the GPU memory; the Compute Shader kernel executes in parallel, reading the Base layer and the residuals, and restoring them layer by layer. Its core pseudocode is as follows: for each vertex v in parallel: val = Base[v]Δ_base + vmin for i in residual_layers: val += Residual[i][v]Δ_i VertexBuffer[v] = val During scheduling, each workgroup is configured with 256 to 512 threads to fully utilize the parallel computing power of the GPU. By directly writing the results to the VertexBuffer, the reconstruction of vertices and rendering shaders achieves seamless integration.
[0053] (2) Hardware-level adaptation and optimization for domestically developed GPUs: A dedicated parallel decoding kernel was developed for domestically produced GPUs to achieve quantization decoding and error correction of vertex data. For example, under the Moore Threads MUSA architecture, the warp parallel mechanism and vectorized instructions of the Compute Shader can efficiently utilize the sparsity of the residuals; at the same time, the sparse residuals adopt the compressed sparse row (CSR-like) index format, and only decode non-zero values on the GPU side, which greatly reduces the memory bandwidth usage.
[0054] (3) Graphics API interface construction: Use graphics APIs (such as Vulkan, OpenGL, OpenGLES) or interfaces provided by domestic graphics middleware to construct video memory buffer objects (SSBO / VBO) for the layer-by-layer update of the above residual data.
[0055] (4) Progressive loading mechanism and error-aware LOD: The system provides a progressive loading mechanism, initially displaying the base layer, asynchronously loading the detail layer in the background, and updating the frame buffer in real time. During the rendering process, an "error-aware LOD control strategy" is introduced to dynamically control the loading level based on camera distance, interaction frequency, and computing power budget; ensuring that the precision level corresponding to the user-set tolerance parameters is the highest priority, and actively reclaiming the video memory of the 3D model space layers outside the viewport when computing power is insufficient, and prompting the user.
[0056] Combined with appendix Figure 4 The progressive loading and decoding flowchart shown illustrates the dynamic scheduling logic at the model loading end: the system first loads the base layer and hands it over to the rendering engine for fast rendering; during operation, the system determines in real time whether higher precision is needed based on the aforementioned error-aware LOD strategy. If the determination is no (e.g., insufficient current computing power or being in a distant view), the residual loading is skipped, the current state is maintained, and rendering continues; if the determination is yes, the residual layers are loaded layer by layer, and the reconstructed vertices are superimposed in the GPU kernel, and the reconstructed high-precision data re-enters the rendering loop.
[0057] Combined with appendix Figure 5The diagram illustrates the GPU parallel decoding and rendering pipeline fusion architecture. The process of interfacing the decoding and reconstruction with the standard graphics pipeline manifests at the underlying data flow level as follows: encoded data is sent from the reversible quantization encoding storage area to the rendering engine; within the engine, the GPU decoding kernel (i.e., the Compute Shader) performs dequantization and residual accumulation in parallel, directly writing the results to the vertex buffer (corresponding to SSBO / VBO); subsequently, high-precision vertex data flows sequentially into the vertex shader for geometric transformation, into the fragment shader for pixel shading, and finally, the rendered image is written to the frame buffer for display output. This fusion pipeline completely eliminates the bandwidth bottleneck in traditional solutions where the CPU decompresses data before transferring it to the GPU.
[0058] Based on the same technical concept, embodiments of the present invention also provide an electronic device that can implement the error-tolerance-based reversible quantization and layered recovery rendering method flow provided in the above embodiments of the present invention. In one embodiment, the electronic device can be a server, a terminal device, or other electronic devices. Figure 6 As shown, the electronic device may include: At least one processor and a memory connected to the at least one processor. In this embodiment of the invention, the specific connection medium between the processor and the memory is not limited. Figure 6 The example used is the connection between the processor and memory via a bus. The bus... Figure 6 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. Buses can be divided into address buses, data buses, control buses, etc., but for ease of representation, [the specific bus type is not shown here]. Figure 6 The processor is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, a processor can also be called a controller; there are no restrictions on the name.
[0059] In this embodiment of the invention, the memory stores instructions executable by at least one processor. By executing the instructions stored in the memory, the at least one processor can perform the error-tolerance-based reversible quantization and layered recovery rendering method discussed above. The processor can implement... Figure 6 The functions of each module in the device shown.
[0060] The processor is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory and calling data stored in memory, it can monitor the device's various functions and process data, thereby enabling overall monitoring of the device.
[0061] In an alternative design, the processor may include one or more processing units. The processor may integrate an application processor and a modem processor, wherein the application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may also not be integrated into the processor. In some embodiments, the processor and memory may be implemented on the same chip; in some embodiments, they may also be implemented separately on separate chips.
[0062] The processor can be a general-purpose processor, such as a CPU, digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the error-tolerant reversible quantization and layered recovery rendering method disclosed in the embodiments of this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0063] Memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory, static random access memory, programmable read-only memory, read-only memory, electrically erasable programmable read-only memory, magnetic memory, magnetic disk, optical disk, etc. Memory is any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In embodiments of the present invention, memory can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0064] By designing and programming the processor, the code corresponding to the error-tolerant reversible quantization and layered recovery rendering method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the steps of the methods described in the foregoing embodiments during runtime. How to design and program the processor is a technique well-known to those skilled in the art and will not be elaborated upon here.
[0065] Based on the same inventive concept, embodiments of the present invention also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the error-tolerant reversible quantization and layered recovery rendering method described above.
[0066] In some alternative embodiments, the present invention also provides that various aspects of the error-tolerant reversible quantization and layered recovery rendering method can also be implemented as a program product comprising program code that, when the program product is run on a device, causes the control device to perform the steps in the error-tolerant reversible quantization and layered recovery rendering method according to various exemplary embodiments of the present invention as described above.
[0067] It should be noted that although several units or sub-units of the apparatus have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the invention, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units. Furthermore, although the operation of the method of the invention is described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0068] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media containing computer-usable program code.
[0069] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a server, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0070] Program code for performing the operations of this invention can be written using any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0071] In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0072] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0073] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0074] In addition, in some embodiments, a computer program product is proposed that, when executed by a processor, implements the above-described error-tolerance-based reversible quantization and layered recovery rendering method.
[0075] Example 2 To further illustrate the feasibility and complete operation process of the present invention, this embodiment provides a specific application example of the error-tolerant reversible quantization and layered recovery rendering method in the visualization scenario of large industrial equipment.
[0076] 1. Implementation environment and parameter initialization In this embodiment, the specific graphics platform environment deployed by the system is a rendering environment based on domestic GPUs (for example, using the Moore Threads S3000 graphics card and built based on OpenGL ES or Vulkan graphics API).
[0077] The input target model (i.e., the original 3D model data) is a CAD model of large industrial equipment, specifically including assemblies and complex piping systems.
[0078] Based on the accuracy requirements of this industrial visualization and simulation task, the preset error tolerance parameters were strictly initialized as follows: setting the vertex coordinate error threshold. Texture coordinate (UV) error threshold .
[0079] 2. Specific operating procedures The system workflow in this embodiment is divided into the following three core stages: Phase 1: Quantization Preprocessing Phase (Model Encoding End) First, the input CAD model is parsed to extract all geometric and attribute data. Then, based on the adaptive quantization algorithm derived in Example 1, the minimum quantization precision bit width required for each attribute to meet the preset error tolerance is calculated. Under the current specific error setting, the system calculates that the optimal bit width for vertex coordinates is 14 bits, and the optimal bit width for texture coordinates (UV) is 12 bits.
[0080] Subsequently, the quantization encoder is invoked to encode the floating-point data into integers according to the aforementioned bit width, generating a multi-precision reversible intermediate representation structure, and the calculated data is compressed and stored in the form of multi-layer residuals.
[0081] Phase Two: Building a Multi-Layer Model Data Package (Data Encapsulation) After encoding, the system encapsulates the reversible intermediate representation structure into a multi-layered model data packet suitable for network transmission and storage. The specific data arrangement structure is as follows: The base layer uses a uniform low-quantization precision to preserve the core topology and basic geometry of the model; Each detail layer records the residual data required to gradually recover from the bottom layer to the top layer; Then, the metadata area containing parameters such as quantization step size and minimum reference value is directly embedded into the header file of the model data package so that the decoding end can read and initialize the decoder immediately.
[0082] Phase 3: Deployment and Operation Phase (Client and GPU Rendering) When running in a digital twin or industrial visualization client, the rendering engine first quickly downloads and loads the base layer data from the model data package. This step enables a "low-precision initial display" (placeholder preview) of large CAD models, ensuring an initial frame rate.
[0083] Subsequently, the background scheduler automatically triggers a higher-precision data loading command based on user interaction (such as zooming in or decreasing camera distance). At this point, the residual layer data is sent to video memory, and the GPU's parallel computing kernel (such as the ComputeShader thread) directly performs decoding operations in video memory. Through the layer-by-layer accumulation principle described in Example 1, the GPU decompresses the residual and corrects the vertex coordinates in real time, updating the reconstructed high-precision data to the vertex buffer in real time, which is then drawn onto the screen by the rendering shader.
[0084] 3. Comparison of application effects After actual testing in the above-described implementation environment, the large CAD model processed using the method described in this embodiment achieves significant beneficial effects compared to the original floating-point model data, while ensuring the usability of the project: (1) The compression rate of model storage volume and video memory usage has been improved by approximately 60%; (2) The time for initial loading and rendering of the image has been reduced by about 70%, which greatly improves the smoothness of industrial Web3D or digital twin platforms; (3) Thanks to the strict control mechanism of error tolerance, the visual error and simulation error of the final rendering are both steadily controlled within the preset threshold (≤0.01mm and ≤0.001mm), and the appearance of the model has no obvious visual loss, perfectly achieving a balance between high-performance compression and high-fidelity restoration.
[0085] The embodiments described above merely illustrate specific implementation methods of this application, and while the descriptions are detailed and specific, they should not be construed as limiting the scope of protection of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the technical solution of this application, and these modifications and improvements all fall within the scope of protection of this application.
[0086] This background section is provided to generally present the context of the invention. The work of the currently named inventors, the work to the extent described in this background section, and aspects of this section that did not constitute prior art at the time of application are neither expressly nor impliedly acknowledged as prior art to the invention.
Claims
1. A reversible quantization and layered recovery rendering method based on error tolerance, characterized in that, include: Step S1: Receive the original 3D model data and obtain the preset error tolerance parameters; Spatial analysis is performed on the original 3D model data to determine its geometric extent; Step S2: Normalize the three-dimensional model space corresponding to the original three-dimensional model data, construct a complexity field based on the local curvature and local vertex density of each vertex in the original three-dimensional model data, and divide the three-dimensional model space into multiple sub-regions based on the complexity field; determine the independent error threshold corresponding to each sub-region according to the complexity of each sub-region and the error tolerance parameter. Step S3: For each sub-region, calculate the minimum quantization precision bit width of the original 3D model data based on the corresponding independent error threshold; according to the minimum quantization precision bit width, encode the floating-point type original 3D model data into integers and generate corresponding quantization metadata, which at least includes the quantization step size and the minimum reference value. Step S4: Construct a reversible intermediate representation structure based on the encoding results of all sub-regions. The reversible intermediate representation structure includes a multi-precision hierarchical structure, which sequentially includes: a base layer using the lowest acceptable precision representation, at least one residual layer recording the difference between adjacent precision layers, and a metadata area storing the quantization metadata. Step S5: During the rendering stage, the reversible intermediate representation structure is loaded as needed, and the loaded base layer and residual layer are stored in the video memory object of the graphics processor (GPU). The parallel computing kernel of the GPU is called to read the base layer, and the residual layer is added layer by layer as needed for inverse quantization reconstruction until the reconstructed 3D model data that meets the error tolerance parameters is obtained. The reconstructed 3D model data is then passed to the graphics rendering pipeline for real-time rendering.
2. The method according to claim 1, characterized in that, The division of the 3D model space into multiple sub-regions based on the complexity field includes: The three-dimensional model space is partitioned using an octree or voxel partitioning method; Calculate the variance of the complexity field within the currently partitioned region; When the complexity variance is less than a preset complexity variance threshold, the division stops, resulting in multiple sub-regions. Wherein, the independent error threshold corresponding to the sub-region satisfy: ,in, This refers to the global error tolerance parameter. A function related to the complexity of the sub-region; The local curvature of the vertex is calculated based on the difference in normal vectors between adjacent triangular faces or a second-order geometric matrix.
3. The method according to claim 1, characterized in that, The minimum quantization precision bit width of the original 3D model data is calculated based on the corresponding independent error threshold, and the floating-point original 3D model data is then encoded into integers according to the minimum quantization precision bit width, specifically including: Calculate the coordinate quantization step size for vertex coordinate data. ; Based on the geometric extent of the sub-region and the coordinate quantization step size Calculate the minimum quantization precision bit width ; According to the formula Alternatively, a rounding function can be used to convert floating-point coordinates. Convert to integer encoding ,in This is the minimum reference value for the sub-region.
4. The method according to claim 1, characterized in that, The at least one residual layer that records the difference between adjacent precision levels specifically includes: No. Level residual layer record from the first Level accuracy restored to the first The difference required for a certain level of accuracy; When the difference is sparsely distributed, the residual layer uses a compressed sparse row index format for sparse storage, or uses entropy coding for compressed storage, so as to control that only non-zero residual values are decoded on the graphics processing unit (GPU).
5. The method according to claim 1, characterized in that, The process of calling the GPU's parallel computing kernel to read the base layer and then accumulating the residual layers layer by layer as needed for inverse quantization reconstruction specifically includes: Parallel threads are allocated to each vertex by the GPU's computational shaders; In each of the parallel threads, the base layer is decoded based on the quantization step size and minimum reference value in the quantization metadata to obtain the initial reconstructed value; If higher reconstruction accuracy is required, the residual values of the required levels are read layer by layer. The residual value of the current level is multiplied by the corresponding quantization step size and then added to the reconstruction value of the previous level to obtain the reconstruction value of the current level, which satisfies the reconstruction formula: ,in, For the first The reconstructed value of the level, For the first The reconstructed value of the level, For the first The residual value of the level, For the first Quantization step size at each level; The quantization error during the reconstruction process is corrected and controlled to ensure that the coordinate error of the final reconstructed 3D model data does not exceed the error tolerance parameter.
6. The method according to claim 1, characterized in that, The on-demand loading of the reversible intermediate representation structure includes a progressive loading and error-aware detail level control strategy, specifically including: During the initial display phase, the base layer is loaded first. During real-time rendering, the number of residual layers to be loaded is dynamically determined based on camera distance, interaction frequency, and system computing power budget. Specifically, the accuracy level corresponding to the error tolerance parameter is set to the highest loading priority, and when the system computing power budget is insufficient, the video memory of the residual layer corresponding to the three-dimensional model space outside the viewport is preferentially reclaimed.
7. The method according to claim 1, characterized in that, The sources for obtaining the error tolerance parameters include: The visual perception index thresholds are set based on the visualization rendering task, and these thresholds include the maximum visual deviation; or, The simulation accuracy index threshold is set for the analysis task based on finite element simulation. The simulation accuracy index threshold includes mesh deformation limit or nodal displacement error limit.
8. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which executes the instructions stored in the memory to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store instructions that, when executed, cause the method as described in any one of claims 1-7 to be implemented.
10. A computer program product, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.
