Three-dimensional data cross-platform compression method, device, equipment and storage medium

By building a compression model containing multiple compression algorithms and using web page technology to generate cross-platform execution files, the problem that three-dimensional data cannot be compressed across platforms is solved, and the efficiency and widespread application of cross-platform compressed three-dimensional data is achieved.

CN117112512BActive Publication Date: 2025-08-19广域铭岛数字科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311062267.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-22
Publication Date
2025-08-19
Estimated Expiration
2043-08-22

AI Technical Summary

Technical Problem

In the prior art, three-dimensional data cannot be compressed across platforms, resulting in a reduced scope of application and experience of compression models.

Method used

Build a compression model, including multiple compression algorithms, and encapsulate them with the preset environment into command line tools. Use web technology to build a cross-platform desktop framework to generate execution files, transmit matching execution files according to the operating system type of the target terminal, receive three-dimensional data and configure appropriate compression algorithms and parameters for compression.

Benefits of technology

Cross-platform compression of three-dimensional data is realized, which improves the scope of application and efficiency of the compression model, reduces data acquisition time and storage space, and reduces rendering calculation overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117112512B_ABST
    Figure CN117112512B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and discloses a cross-platform compression method, device, equipment and storage medium for three-dimensional data. The method pre-constructs a compression model; encapsulates the compression model and a preset environment to form a command line tool; utilizes web page technology to construct a cross-platform desktop framework, packages the command tool line based on the desktop framework, generates an execution file, and uploads it to the cloud; obtains a download request from a target terminal, transmits a matching execution file in response to the download request, so that the target terminal installs the execution file; loads the execution file, receives three-dimensional data and determines the data type of the three-dimensional data, configures different compression algorithms and compression parameters according to the data type to compress the three-dimensional data, and obtains a compressed file. The present invention realizes cross-platform compression of three-dimensional data through the compression model, reduces the use requirements of the compression model, and increases the application scope of the compression model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a three-dimensional data cross-platform compression method, device, equipment and storage medium. Background Art

[0002] Data compression is the process of encoding existing data using less space. This involves reducing the amount of data to save storage space, improve transmission, storage, and processing efficiency, or reorganize data according to specific algorithms to reduce data redundancy and storage space without losing useful information. It is widely used to compress 3D data, particularly for real-time 3D rendering on the web. The loading speed of 3D models has become a performance metric for applications. Overly large models can reduce the application experience due to network bandwidth constraints.

[0003] In related technologies, when the cloud (backend) compresses three-dimensional data, it is necessary to configure environmental parameters to meet the usage conditions of the compression model. Often, the front end does not have such usage conditions, resulting in the front end being unable to use the compression model to process three-dimensional data, making it impossible to compress and process three-dimensional data across platforms, reducing the applicability and experience of the compression model. Summary of the Invention

[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0005] In view of the shortcomings of the existing technology mentioned above, the present invention discloses a three-dimensional data cross-platform compression method, device, equipment and storage medium to overcome the inability to compress three-dimensional data across platforms, which reduces the applicability and experience of the compression model.

[0006] The present invention provides a cross-platform compression method for three-dimensional data, comprising: pre-building a compression model, the compression model including multiple compression algorithms for processing the three-dimensional data; encapsulating the compression model with a preset environment to form a command line tool, the preset environment including a node environment and environmental parameters required for the compression model to run in the node environment; using web page technology to build a cross-platform desktop framework, packaging the command tool line based on the desktop framework, generating an executable file with a human-computer interaction interface, and uploading it to the cloud for storage; obtaining a download request from a target terminal, the download request carrying an executable file identifier, transmitting the executable file that matches the executable file in response to the executable file identifier, so that the target terminal installs the executable file; loading the executable file, receiving three-dimensional data and determining the data type of the three-dimensional data, configuring different compression algorithms and compression parameters according to the data type to compress the three-dimensional data to obtain a compressed file.

[0007] Optionally, the compression model is pre-constructed, and the compression model includes multiple compression algorithms for processing the three-dimensional data, including: obtaining multiple compression algorithms for compressing the three-dimensional data, the three-dimensional data including three-dimensional point cloud data and three-dimensional mesh data, and configuring corresponding compression algorithms for the point cloud data and the mesh data respectively to form a compression model based on the Draco algorithm.

[0008] Optionally, the use of web technology to build a cross-platform desktop framework, packaging the command tool line based on the desktop framework, and generating an executable file with a human-computer interaction interface includes: building a cross-platform desktop framework based on web technology to form a first program, the first program is loaded with a built-in browser, and at the same time, the first program integrates a node environment, an operating system interface, and a program application interface; in the node environment, the command tool line is integrated into the first program through the program application interface, and packaged to generate a second program, and the second program is edited according to the human-computer user interface of the browser and the operating system interface to generate the executable file, wherein the type of the executable file is determined by the operating system of the target terminal to be any one of the Windows operating system, the Linux operating system, and the Mac operating system.

[0009] Optionally, obtaining a download request from the target terminal, the download request carrying an execution file identifier, and transmitting the matching execution file in response to the execution file identifier, includes: receiving, on the cloud side, the download request from the target terminal, the download request carrying the execution file identifier and the operating system of the target terminal; searching on the cloud side in response to the execution file identifier, determining the execution file that matches the execution file identifier, and outputting, based on the operating system of the target terminal, the execution file that matches the operating system type.

[0010] Optionally, receiving three-dimensional data and determining the data type of the three-dimensional data, configuring different compression algorithms and compression parameters according to the data type to compress the three-dimensional data to obtain a compressed file, includes: receiving the three-dimensional data to be processed, determining the data type of the three-dimensional data to be processed; based on the mapping relationship between the three-dimensional data and at least one compression algorithm, if it is determined that the three-dimensional data of any data type is associated with multiple different compression algorithms, performing weighted calculation on the compression ratio, decoding rate and discretization loss of the compression algorithm to determine the performance evaluation value corresponding to each compression algorithm; sorting the performance evaluation value corresponding to each compression algorithm, and selecting the compression algorithm with the best performance evaluation value as the current compression method of the compression model; determining the compression parameters corresponding to the current compression algorithm, compressing the three-dimensional data according to the current compression algorithm and compression parameters to obtain a compressed file.

[0011] Optionally, compressing the three-dimensional data according to the current compression algorithm and compression parameters to obtain a compressed file also includes: separating the three-dimensional data to be processed according to the data type to obtain three-dimensional point cloud data and three-dimensional grid data in a preset format; establishing a three-dimensional coordinate system based on a preset coordinate origin, and determining at least two extreme points of the three-dimensional point cloud data or three-dimensional grid data on each coordinate axis according to the three-dimensional coordinate system; constructing a plane perpendicular to the corresponding coordinate axis based on each extreme point, and constructing a space that encloses all three-dimensional point cloud data or three-dimensional grid data based on all planes; determining the volume of the space, and determining the volume of the space based on the volume and the number of three-dimensional point cloud data or three-dimensional grid data corresponding to the volume. Perform calculations to determine density; determine the number of divisions of each side length of the space based on the density and a preset density, divide the space based on the number of divisions of each side length to obtain multiple subspaces, construct a parent node and a child node with the space and each subspace respectively, and determine a topological tree based on the number of the parent node and the child node, wherein multiple node sets are obtained based on the inclusion relationship of the nodes in the topological tree, all nodes in each node set are numbered in turn to obtain node numbers, and the node numbers are assigned to the corresponding spaces and subspaces for binding; compress the space corresponding to the topological tree according to the current compression algorithm and compression parameters to obtain a compressed file.

[0012] Optionally, after obtaining the compressed file, it also includes: the cloud decompresses the received compressed file to obtain a decompressed file, and the decompressed file includes three-dimensional geometric data and attribute data; and simplifies the decompressed file to obtain simplified data, calculates the LOD block information of the simplified data based on the octree algorithm, and constructs an index file of the three-dimensional data based on the LOD block information; compresses the simplified data again, and reconstructs the block model file with the LOD block information as the center, integrates it with the attribute data, and constructs a block file; combines the index file with the block file to generate a three-dimensional file for download.

[0013] The present invention provides a three-dimensional data cross-platform compression device, comprising: a model construction module, used to pre-construct a compression model, the compression model including multiple compression algorithms for processing the three-dimensional data; an encapsulation module, used to encapsulate the compression model with a preset environment to form a command line tool, the preset environment including a node environment and environmental parameters required for the compression model to run in the node environment; a file generation module, which utilizes web page technology to construct a cross-platform desktop framework, packages the command tool line based on the desktop framework, generates an executable file with a human-computer interaction interface, and uploads it to the cloud for storage; a request response module, which obtains a download request from a target terminal, the download request carries an executable file identifier, and transmits the matching executable file in response to the executable file identifier, so that the target terminal installs the executable file; a compression module, which is used to load the executable file, receive three-dimensional data and determine the data type of the three-dimensional data, and compress the three-dimensional data according to different compression algorithms and compression parameters configured according to the data type to obtain a compressed file.

[0014] The present invention provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above method.

[0015] The present invention provides a computer-readable medium having a computer program stored thereon, wherein the computer program is used to enable a computer to execute the above method.

[0016] Beneficial effects of the present invention:

[0017] The compression model constructed by the present invention includes multiple compression algorithms. When processing three-dimensional data, it can match the corresponding compression algorithm to compress the three-dimensional data according to the different data types of the three-dimensional data. Compared with traditional data compression schemes, the present invention greatly improves the efficiency and performance of data compression; at the same time, the compression model and the preset environment are encapsulated to generate a command line tool. The preset environment includes the node environment and the environmental parameters required for the compression model to run in the node environment. The command tool line is packaged based on the desktop framework to generate an executable file with a human-computer interaction interface. In this way, on the one hand, the compression model can be used across platforms to achieve cross-platform compression of three-dimensional data. On the other hand, the front end (terminal) performs compression by installing and using the executable file, which reduces the use requirements of the compression model and increases the scope of application of the compression model; using this method to generate compressed files, for compressed files, the present invention not only reduces data acquisition time and storage space, but also reduces data rendering calculation overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1is a flow chart of a cross-platform compression method for three-dimensional data according to an exemplary embodiment of the present invention;

[0019] Figure 2 is a schematic structural diagram of a three-dimensional data cross-platform compression device according to an exemplary embodiment of the present invention;

[0020] Figure 3 It is a structural diagram of a computer system suitable for implementing the electronic device of the present invention, shown in an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0021] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other unless there is a conflict.

[0022] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.

[0023] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the embodiments of the present invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring the embodiments of the present invention.

[0024] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate for the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. Unless otherwise specified, the term "plurality" means two or more. In the embodiments of the present disclosure, the character " / " indicates that the previous and next objects are in an "or" relationship. For example, A / B means: A or B. The term "and / or" is a description of the association relationship of objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0025] See also Figure 1 , is a flow chart of a cross-platform compression method for three-dimensional data according to an exemplary embodiment of the present invention. Figure 1 As shown, in an exemplary embodiment, the three-dimensional data cross-platform compression method includes at least steps S101 to S106, which are described in detail as follows:

[0026] Step S101, pre-building a compression model, wherein the compression model includes multiple compression algorithms for processing the three-dimensional data;

[0027] Specifically, a plurality of compression algorithms for compressing the three-dimensional data are obtained, where the three-dimensional data includes three-dimensional point cloud data and three-dimensional mesh data, and corresponding compression algorithms are configured for the point cloud data and the mesh data respectively to form a compression model based on the Draco algorithm.

[0028] Among them, the Draco algorithm is a database for compressing and decompressing 3D geometric meshes and 3D point clouds, designed to improve the storage and transmission of 3D graphics and significantly accelerate the encoding, transmission, and decoding of 3D data; Draco is a GLTF extension for mesh compression and an open source library developed by Google. It compresses vertex positions, normals, colors, texture coordinates, and any other common vertex attributes, thereby improving the efficiency and speed of transmitting 3D content on the network. Draco can compress mesh and point cloud data. Since the two data representations are essentially different, it does not rely on a single compression algorithm, but uses a variety of different technologies to optimize the compression of these two representations in terms of compression ratio, decoding speed, and discretization loss. Therefore, it provides higher performance than general-purpose algorithms (for example, gzip).

[0029] Draco relies on optimizing encoding by rearranging the order of points using a kd-tree. Position data is discretized by a configurable number of quantization bits. While this naturally results in a loss of spatial resolution, it can be fine-tuned based on accuracy or visual quality requirements. Draco also supports compressing arbitrary point attributes, making it well-suited for heterogeneous data. To compress mesh topology, Draco relies on an edge breaker algorithm that attempts to encode the mesh in a spiral, encoding the connections of each triangle face in a string while keeping track of the vertices and faces that have been visited. These strings are then compressed individually by the library.

[0030] In addition, in this embodiment, it should be noted that constructing a compression model also includes: obtaining a neural network model to be compressed and neuron parameters of the neural network model; constructing a compression model according to the model structure of the neural network model; iteratively training the compression model according to the neuron parameters of the neural network model until a preset termination condition is met to obtain a target compression model; and compressing the neural network model using the target compression model to obtain a target neural network model.

[0031] In an embodiment of the present invention, a compression model is constructed based on the model structure of the neural network model to be compressed, and the compression model is iteratively trained based on the neuron parameters of the neural network model to obtain a target compression model, thereby improving the compatibility between the target compression model and the neural network model and facilitating improved model compression effects. The target compression model is then used to compress the neural network model to obtain a target neural network model. This embodiment of the present invention can reduce the storage space required for the neural network model while maintaining its accuracy, enabling the target neural network model to be deployed in various hardware devices to achieve the same functionality as the pre-compression neural network model.

[0032] Step S102: Encapsulating the compression model and a preset environment to form a command line tool, wherein the preset environment includes a node environment and environmental parameters required for the compression model to run in the node environment;

[0033] Specifically, a command-line tool based on Draco's encapsulation in the Node environment allows convenient use of Draco in the Node environment, and the command-line also encapsulates the parameters required by Draco. If used on the server side, a Node environment must also be deployed on the server side, which is not convenient for non-developers. The above method is convenient to use but is limited to the Node environment. In addition to compressing Gltf models, this tool can also convert between Gltf and Glb formats.

[0034] Step S103: constructing a cross-platform desktop framework using web technology, packaging the command tool line based on the desktop framework, generating an executable file with a human-computer interaction interface, and uploading it to the cloud for storage;

[0035] Among them, it should be noted that a cross-platform desktop framework is constructed based on web page technology to form a first program, which is loaded with a built-in browser. At the same time, the first program integrates the node environment, the operating system interface and the program application interface; in the node environment, the command tool line is integrated into the first program through the program application interface, and the second program is packaged and generated. The second program is edited according to the human-computer user interface of the browser and the operating system interface to generate the executable file, wherein the type of the executable file is determined by the operating system of the target terminal to be any one of the Windows operating system, Linux operating system and Mac operating system.

[0036] For example, building a cross-platform desktop framework based on Web technology is also called a Gui program.

[0037] Electron=Chromium+Node.js+Native APIs

[0038] Electron is a cross-platform desktop application framework built with JavaScript, HTML, and CSS. Electron uses the built-in Chromium browser so that Electron programs do not have to worry about compatibility issues. The browser has very good support for standards and even supports some standards that have not yet been passed. At the same time, Electron can use the operating system interface, solving the file system and system tray system notifications that are restricted by the Web front end.

[0039] Native APIs refer to application development interfaces (APIs) that are directly exposed in binary form and as libraries. Chromium is the UI layer and lacks the ability to directly operate native GUIs. Eelectron integrates Node.js (an open-source, cross-platform runtime environment capable of running JavaScript on the server), allowing it to develop interfaces while also gaining access to the underlying operating system APIs. Chromium is the engine behind Google's Chrome browser, and its goal is to create a secure, stable, and fast universal browser.

[0040] To provide native system GUI support, Electron has built-in native application programming interfaces (APIs) that support calling system functions, such as calling system notifications and opening system folders. Electron is cross-platform, achieved by leveraging the Node+Chromium runtime. Because Node and Chromium are not cross-platform, packaging requires specifying the corresponding system environment (Windows, Mac, Linux).

[0041] For example, the running process of the Electron program is as follows:

[0042] 1) Enable it in the command line, the bin file is executed, and the internal build method is called;

[0043] 2) After processing some information in the Build method, call the dobuild method to continue building (which platforms to create installation packages for and how to package them);

[0044] 3) Use the createHelper method inside Electron to install the application's dependencies based on the current system environment and architecture;

[0045] 4) Call the pack method to pack. Pack will perform detailed packaging based on the Packer (Win Packer) created by the create Helper that is suitable for the current environment. The packaging configuration is loaded by reading the main field of package.json in the current file directory.

[0046] For another example, the execution process of Electron is as follows:

[0047] 1) The user uploads a file, and the UI sends the file address to the middle platform through IPC communication packaged by Electron;

[0048] 2) After receiving the file address, the Electron middle platform reads the file information through the Nodejs interface integrated in the Electron bottom layer;

[0049] 3) Pass the file information through the gltf pipeline (the Node environment is integrated internally, so the use of gltfpipeline is not restricted by the environment), call the interface, pass in the compression parameters, and call the draco algorithm interface internally to pass in the file for compression.

[0050] Through the above method, by building a cross-platform desktop application and packaging it according to the front-end system environment to produce an executable file, it can meet the front-end use of different system environments.

[0051] Step S104: obtaining a download request from a target terminal, the download request carrying an executable file identifier, and transmitting the executable file that matches the executable file in response to the executable file identifier, so that the target terminal installs the executable file;

[0052] Specifically, the cloud receives a download request from the target terminal, and the download request carries an execution file identifier and the operating system of the target terminal; in response to the execution file identifier, a search is performed on the cloud to determine the execution file that matches the execution file identifier, and the execution file that matches the operating system type is output according to the operating system of the target terminal.

[0053] The target terminal can be a WEB terminal, a computer, a personal terminal, a smart phone, etc.

[0054] Through the above method, the execution file that matches the target terminal can be downloaded from the cloud, ensuring that the execution file can be run completely and accurately on the target terminal.

[0055] Step S105 , loading the execution file, receiving three-dimensional data and determining the data type of the three-dimensional data, configuring different compression algorithms and compression parameters according to the data type to compress the three-dimensional data to obtain a compressed file.

[0056] In some embodiments, receiving three-dimensional data and determining a data type of the three-dimensional data, and configuring different compression algorithms and compression parameters according to the data type to compress the three-dimensional data to obtain a compressed file includes:

[0057] Receive the three-dimensional data to be processed and determine the data type of the three-dimensional data to be processed; based on the mapping relationship between the three-dimensional data and at least one compression algorithm, if it is determined that the three-dimensional data of any data type is associated with multiple different compression algorithms, perform weighted calculations on the compression ratio, decoding rate and discretization loss of the compression algorithm to determine the performance evaluation value corresponding to each compression algorithm; sort the performance evaluation values corresponding to each compression algorithm, and select the compression algorithm with the best performance evaluation value as the current compression method of the compression model; determine the compression parameters corresponding to the current compression algorithm, and compress the three-dimensional data according to the current compression algorithm and compression parameters to obtain a compressed file.

[0058] It should be understood that there is at least one compression algorithm associated with each type of three-dimensional data. When it is determined that there are multiple different compression algorithms associated with the three-dimensional data of a certain data type, calculations are performed in terms of compression ratio, decoding rate, and discretization loss. At the same time, weighting coefficients are combined. For example, the weighting coefficients corresponding to the compression ratio, decoding rate, and discretization loss are 0.4, 0.3, and 0.3 respectively. It should be noted that the weighting coefficients can be set according to needs. In this way, a performance evaluation value can be determined. By sorting the various performance evaluation values, the performance evaluation value with the highest score is determined as the compression algorithm with the best performance evaluation value. The three-dimensional data is compressed using this algorithm. At the same time, the preset compression parameters corresponding to each compression algorithm, such as data rate, bit rate, frame rate, and frame type, are configured. The compression algorithm directly compresses the three-dimensional data under the configuration of the preset compression parameters.

[0059] Through the above method, it is possible to quickly determine the most suitable compression algorithm for a certain type of three-dimensional data among multiple compression algorithms. On the one hand, it improves the compression efficiency while ensuring the compression performance; on the other hand, it is more compatible with the compression processing of multiple three-dimensional data, greatly improving the data compression processing range.

[0060] In some other embodiments, compressing the three-dimensional data according to the current compression algorithm and compression parameters to obtain a compressed file further includes:

[0061] Separate the three-dimensional data to be processed according to the data type to obtain three-dimensional point cloud data and three-dimensional grid data in a preset format; establish a three-dimensional coordinate system based on a preset coordinate origin, and determine at least two extreme points of the three-dimensional point cloud data or three-dimensional grid data on each coordinate axis according to the three-dimensional coordinate system; construct a plane perpendicular to the corresponding coordinate axis based on each extreme point, and construct a space that encloses all three-dimensional point cloud data or three-dimensional grid data based on all planes; determine the volume of the space, and calculate the density based on the volume and the number corresponding to the three-dimensional point cloud data or three-dimensional grid data; determine the density based on the density and the preset density The number of divisions of each side length of the space, the space is divided into multiple subspaces based on the number of divisions of each side length, the parent node and the child node are constructed respectively with the space and each subspace, and a topological tree is determined according to the number of the parent node and the child node, wherein, based on the inclusion relationship of the nodes in the topological tree, multiple node sets are obtained, all nodes in each node set are numbered in turn to obtain node numbers, and the node numbers are configured to the corresponding space and the subspace for binding; the space corresponding to the topological tree is compressed according to the current compression algorithm and compression parameters to obtain a compressed file.

[0062] Among them, the preset coordinate origin is a manually preset coordinate origin. The preset coordinate origin can be a three-dimensional electric cloud acquisition device, or any three-dimensional point cloud in the three-dimensional point cloud data of the target object, and is not limited here.

[0063] It can be understood that after establishing a coordinate system based on the preset coordinate origin, the maximum and minimum points of the three-dimensional point cloud data of the target object on each coordinate axis (X, Y, and Z coordinate axes) will be obtained. At this time, the extreme points of the coordinate axis represent the minimum and maximum values of the target object in the three-dimensional data on each coordinate axis. A plane perpendicular to the coordinate axis is constructed at the extreme point to form a cube, which wraps all the three-dimensional point cloud data.

[0064] It can be understood that in the spatial coordinate system, the maximum and minimum values of the target object in the X-axis direction are selected, and then a plane perpendicular to the X-axis is established based on the coordinate points of the maximum and minimum values on the X-axis so that all the three-dimensional point cloud data of the target object in the X-axis direction are completely wrapped. In the spatial coordinate system, the maximum and minimum values of the target object in the Y-axis direction are selected, and then a plane perpendicular to the Y-axis is established based on the coordinate points of the maximum and minimum values on the Y-axis so that all the three-dimensional point cloud data of the target object in the Y-axis direction are completely wrapped. The horizontal axis plane wraps all the three-dimensional point cloud data in the X-axis direction, the vertical axis plane wraps all the three-dimensional point cloud data in the Y-axis direction, and the vertical axis plane wraps all the three-dimensional point cloud data in the Z-axis direction. The intersection of the three forms a total spatial unit that wraps all the three-dimensional point cloud data.

[0065] It can be understood that the density is determined by the ratio of the total number of 3D point clouds (or the total number of 3D grids) to the total volume of the total space. The number of divisions for each side of the total space is determined based on the density and the preset density, and all sides in the space are divided according to the number of divisions. For example, if the number of divisions is 1, it means that if the spatial unit is a cuboid, the length, width, and height are divided once each, and the length, width, and height are each divided into 2 segments, thus being divided into 8 small cubes.

[0066] Through the above implementation, a greater density of the target object means a more complex structure of the object, and thus the division reflects more details corresponding to the object; a smaller density of the target object means a simpler structure of the object, and thus the division reflects less details corresponding to the object, thereby making the division more realistic.

[0067] It can also be understood that a parent node is constructed based on the space, a corresponding child node is constructed based on the child space, and a corresponding grandchild node is constructed based on the grandchild space. The child node is connected to the parent node, and the grandchild node is connected to the child node, thereby generating a topological tree. For example, the parent node and the child node are in an inclusion relationship, and the child node and the grandchild node are in an inclusion relationship. The corresponding parent node set, child node set and grandchild node set are determined according to the corresponding hierarchical inclusion relationship, and the nodes in the parent node set, child node set and grandchild node set are numbered in turn, and the numbers are assigned to the corresponding space for easy subsequent display.

[0068] By using the current compression algorithm and compression parameters to compress the space (three-dimensional data) corresponding to the topological tree to obtain a compressed file, the three-dimensional data can be quickly located during compression, which is beneficial to speeding up the three-dimensional data compression efficiency.

[0069] In other embodiments, after obtaining the compressed file, it also includes: the cloud decompresses the received compressed file to obtain a decompressed file, and the decompressed file includes three-dimensional geometric data and attribute data; and simplifies the decompressed file to obtain simplified data, calculates the LOD (multi-level of detail) block information of the simplified data based on the octree algorithm, and constructs an index file of the three-dimensional data based on the LOD block information; compresses the simplified data again, and reconstructs the block model file with the LOD block information as the center, integrates it with the attribute data, and constructs a block file; combines the index file with the block file to generate a three-dimensional file for download.

[0070] It should be understood that the cloud or server decompresses the compressed file to obtain a decompressed file, which contains at least 3D geometry data and attribute data. For example, the simplification process can use the half-edge collapse algorithm. This algorithm reduces the number of triangles in the model by removing one vertex and two edges (one for each adjacent triangle) while preserving the model's characteristics. This process uses multi-threading technology to improve processing efficiency.

[0071] For example, common three-dimensional space partitioning algorithms include k-dimensional trees, quadtrees, octrees, etc. When a three-dimensional space is divided into multiple subspaces, each subspace is stored as a child node of the space node, and the node stores the geometric information of the space range.

[0072] For example, converting 3D model data in OSGB format to 3D Tiles format enables on-demand model loading and rendering, enabling WebGL (Web Graphics Library)-based rendering visualization and a smooth 3D model browsing experience. As an open 3D spatial data standard, 3D Tiles files can speed up model loading and rendering in large 3D scenes.

[0073] It should also be noted that in this embodiment, the model is divided into blocks using the quadtree algorithm, and the LOD weights are calculated based on the volume of the blocks, and the LOD weights are output to the LOD index file 3DTiles.json. This process can use multi-threading technology to improve processing efficiency. The file is compressed again using the Draco algorithm, and the generated LOD block information is used as the range to create a block model file in the glTF format after segmentation according to the glTF format. For example, according to the glTF format specification, the lightweight binary three-dimensional data is converted into the glTF format. This process can use multi-threading technology to improve processing efficiency. The glTF format block model file and the construction attribute data (bounding box data, direction data) are integrated to construct a B3DM format block file. For example, according to the B3DM file layout specification, the existing glTF is written as the underlying data into the B3DM format block file, and other necessary information is filled in.

[0074] Combine all B3DM-format tile files and the generated LOD index files into a single 3DTiles file. For example, the 3dTiles.json file is an index file that connects the individual B3DM files generated by quadtree partitioning and applies LOD values. The engine uses this file to retrieve and schedule the individual B3DM tiles. Store this 3DTiles file on the server for download. For example, provide all generated files to the backend, which is responsible for exposing them to the 3D engine for use.

[0075] Through the above method, the file size of large 3D models (3D data) is reduced, the time required for 3D model transmission on the network is reduced, the display and operation smoothness of 3D models in server-side and mobile applications are improved, and the impact on the user experience of 3D applications and application crashes caused by the increase in the size of the 3D model is avoided.

[0076] See also Figure 2 , is a schematic diagram of the structure of a three-dimensional data cross-platform compression device according to an exemplary embodiment of the present invention. Figure 2 As shown, the exemplary three-dimensional data cross-platform compression device includes: a model building module 201, an encapsulation module 202, a file generation module 203, a request response module 204 and a compression module 205, wherein:

[0077] A model building module 201 is used to pre-build a compression model, wherein the compression model includes multiple compression algorithms for processing the three-dimensional data;

[0078] The packaging module 202 is used to package the compression model and the preset environment to form a command line tool. The preset environment includes the node environment and the environment parameters required for the compression model to run in the node environment;

[0079] The file generation module 203 uses web technology to build a cross-platform desktop framework, packages the command tool line based on the desktop framework, generates an executable file with a human-computer interaction interface, and uploads it to the cloud for storage;

[0080] The request response module 204 receives a download request from a target terminal, the download request carrying an executable file identifier, and transmits the executable file that matches the executable file in response to the executable file identifier, so that the target terminal installs the executable file;

[0081] The compression module 205 is used to load the execution file, receive three-dimensional data and determine the data type of the three-dimensional data, and configure different compression algorithms and compression parameters according to the data type to compress the three-dimensional data to obtain a compressed file.

[0082] It should be noted that the three-dimensional data cross-platform compression device provided in the above embodiment and the three-dimensional data cross-platform compression method provided in the above embodiment belong to the same concept, and the specific method of executing the operation in each step has been described in detail in the system embodiment and will not be repeated here.

[0083] The three-dimensional data cross-platform compression device provided by the embodiment of the present invention is used to construct a compression model that includes multiple compression algorithms. When processing three-dimensional data, the three-dimensional data can be compressed by matching the corresponding compression algorithm according to the different data types of the three-dimensional data. Compared with traditional data compression schemes, the present invention greatly improves the efficiency and performance of data compression; at the same time, the compression model is encapsulated with a preset environment to generate a command line tool, and the preset environment includes a node environment and the environmental parameters required for the compression model to run in the node environment. The command tool line is packaged based on the desktop framework to generate an executable file with a human-computer interaction interface. In this way, on the one hand, the compression model can be used across platforms to achieve cross-platform compression of three-dimensional data. On the other hand, the front end reduces the use requirements of the compression model by installing and using the executable file, and increases the scope of application of the compression model; using this method to generate compressed files, for compressed files, the present invention not only reduces data acquisition time and storage space, but also reduces data rendering calculation overhead.

[0084] See also Figure 3 , shows a schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present invention. It should be noted that, Figure 3 The computer system 300 of the electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0085] like Figure 3 As shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM 303. The CPU 301, ROM 302 and RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0086] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, and the like; an output section 307 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. Removable media 311, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 310 as needed, so that computer programs read therefrom can be installed into the storage section 308 as needed.

[0087] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product that includes a computer program carried on a computer-readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 309 and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the various functions defined in the system of the present invention are performed.

[0088] The present invention also provides a computer-readable and writable storage medium storing a computer program, wherein when the computer program is executed, at least one embodiment of the above-described method for cross-platform compression of three-dimensional data is implemented, such as Figure 1 The described embodiment.

[0089] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.

[0090] In the embodiments provided by the present invention, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a magnetic disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store desired program code in the form of instructions or data structures and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, server or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.

[0091] In one or more exemplary aspects, the functions described by the computer program of the method described herein can be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored or transmitted as one or more instructions or codes on a computer-readable medium. The steps of the method or algorithm disclosed herein can be embodied in a processor-executable software module, wherein the processor-executable software module can be located on a tangible, non-transitory computer-readable and writable storage medium. The tangible, non-transitory computer-readable and writable storage medium can be any available medium that can be accessed by a computer.

[0092] The flowcharts and block diagrams in the accompanying drawings of the present invention illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. Based on this, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0093] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.

Claims

1. A three-dimensional data cross-platform compression method, characterized in that: include: Pre-building a compression model, wherein the compression model includes a plurality of compression algorithms for processing the three-dimensional data; Encapsulating the compression model and a preset environment to form a command line tool, wherein the preset environment includes a node environment and environmental parameters required for the compression model to run in the node environment; Utilize web technology to build a cross-platform desktop framework, package the command line tool based on the desktop framework, generate an executable file with a human-computer interaction interface, and upload it to the cloud for storage; Obtaining a download request from a target terminal, the download request carrying an executable file identifier, and transmitting the executable file that matches the executable file in response to the executable file identifier, so that the target terminal installs the executable file; The execution file is loaded, three-dimensional data is received and the data type of the three-dimensional data is determined, and different compression algorithms and compression parameters are configured according to the data type to compress the three-dimensional data to obtain a compressed file; wherein, the three-dimensional data to be processed is received and the data type of the three-dimensional data to be processed is determined; based on the mapping relationship between the three-dimensional data and at least one compression algorithm, if it is determined that the three-dimensional data of any data type is associated with multiple different compression algorithms, the compression ratio, decoding rate and discretization loss of the compression algorithm are weightedly calculated to determine the performance evaluation value corresponding to each compression algorithm; the performance evaluation value corresponding to each compression algorithm is sorted, and the compression algorithm with the best performance evaluation value is selected as the current compression method of the compression model; the compression parameters corresponding to the current compression algorithm are determined, and the three-dimensional data is compressed according to the current compression algorithm and compression parameters to obtain a compressed file.

2. The cross-platform compression method for three-dimensional data according to claim 1, characterized in that: The pre-built compression model includes multiple compression algorithms for processing the three-dimensional data, including: A plurality of compression algorithms for compressing the three-dimensional data are obtained, wherein the three-dimensional data includes three-dimensional point cloud data and three-dimensional mesh data, and corresponding compression algorithms are configured for the point cloud data and the mesh data respectively to form a compression model based on the Draco algorithm.

3. The cross-platform compression method for three-dimensional data according to claim 2, characterized in that: The cross-platform desktop framework is constructed by using web page technology, the command line tool is packaged based on the desktop framework, and an executable file with a human-computer interaction interface is generated, including: A cross-platform desktop framework is constructed based on web page technology to form a first program, wherein the first program is loaded with a built-in browser and integrates a node environment, an operating system interface, and a program application interface; In a node environment, the command line tool is integrated into the first program through the program application interface, packaged to generate a second program, and the second program is edited according to the human-computer user interface of the browser and the operating system interface to generate the executable file, wherein the type of the executable file is determined by the operating system of the target terminal to be any one of the Windows operating system, Linux operating system and Mac operating system.

4. The cross-platform compression method for three-dimensional data according to claim 3, characterized in that: Obtaining a download request from a target terminal, the download request carrying an executable file identifier, and transmitting a matching executable file in response to the executable file identifier, including: The cloud receives a download request from the target terminal, wherein the download request carries an executable file identifier and an operating system of the target terminal; In response to the execution file identifier, a search is performed in the cloud to determine the execution file that matches the execution file identifier, and the execution file that matches the operating system type is output according to the operating system of the target terminal.

5. The cross-platform compression method for three-dimensional data according to claim 1, characterized in that: The compressing the three-dimensional data according to the current compression algorithm and compression parameters to obtain a compressed file further includes: Separating the three-dimensional data to be processed according to the data type to obtain three-dimensional point cloud data and three-dimensional mesh data in a preset format; Establishing a three-dimensional coordinate system based on a preset coordinate origin, determining at least two extreme points of the three-dimensional point cloud data or three-dimensional mesh data on each coordinate axis based on the three-dimensional coordinate system; constructing a plane perpendicular to the corresponding coordinate axis based on each of the extreme points, and constructing a space that encloses all of the three-dimensional point cloud data or three-dimensional mesh data based on all of the planes; determining the volume of the space, and calculating the density based on the volume and the number of three-dimensional point cloud data or three-dimensional mesh data corresponding to the volume; Determining the number of divisions of each side length of the space based on the density and a preset density, dividing the space based on the number of divisions of each side length to obtain multiple subspaces, constructing a parent node and a child node using the space and each of the subspaces, respectively, and determining a topological tree based on the number of the parent nodes and the child nodes, wherein multiple node sets are obtained based on the inclusion relationship of nodes in the topological tree, all nodes in each of the node sets are numbered in sequence to obtain node numbers, and the node numbers are assigned to the corresponding spaces and subspaces for binding; The space corresponding to the topological tree is compressed according to the current compression algorithm and compression parameters to obtain a compressed file.

6. The cross-platform compression method for three-dimensional data according to any one of claims 1 to 5, characterized in that: After obtaining the compressed file, the method further includes: The cloud decompresses the received compressed file to obtain a decompressed file, wherein the decompressed file includes three-dimensional geometric data and attribute data; simplifies the decompressed file to obtain simplified data, calculates LOD block information of the simplified data based on an octree algorithm, and constructs an index file of the three-dimensional data based on the LOD block information; The simplified data is compressed again, and a block model file is rebuilt with the LOD block information as the center, and the block model file is integrated with the attribute data to build a block file; The index file is combined with the block file to generate a three-dimensional file for downloading.

7. A three-dimensional data cross-platform compression device, characterized in that: include: A model building module, configured to pre-build a compression model, wherein the compression model includes a plurality of compression algorithms for processing the three-dimensional data; An encapsulation module, configured to encapsulate the compression model and a preset environment to form a command line tool, wherein the preset environment includes a node environment and environmental parameters required for the compression model to run in the node environment; A file generation module, which uses web technology to build a cross-platform desktop framework, packages the command line tool based on the desktop framework, generates an executable file with a human-computer interaction interface, and uploads it to the cloud for storage; a request response module, which obtains a download request from a target terminal, the download request carrying an executable file identifier, and transmits the executable file that matches the executable file in response to the executable file identifier, so that the target terminal installs the executable file; A compression module is used to load the executable file, receive three-dimensional data and determine the data type of the three-dimensional data, and compress the three-dimensional data according to different compression algorithms and compression parameters configured according to the data type to obtain a compressed file; wherein, the three-dimensional data to be processed is received and the data type of the three-dimensional data to be processed is determined; based on the mapping relationship between the three-dimensional data and at least one compression algorithm, if it is determined that the three-dimensional data of any data type is associated with multiple different compression algorithms, the compression ratio, decoding rate and discretization loss of the compression algorithm are weightedly calculated to determine the performance evaluation value corresponding to each compression algorithm; the performance evaluation value corresponding to each compression algorithm is sorted, and the compression algorithm with the best performance evaluation value is selected as the current compression mode of the compression model; the compression parameters corresponding to the current compression algorithm are determined, and the three-dimensional data is compressed according to the current compression algorithm and compression parameters to obtain a compressed file.

8. An electronic device, characterized in that: include: processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, the computer program being configured to cause a computer to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Processing method and device based on unreal engine, electronic equipment and storage medium

    CN112596713A

  • Data processing method and apparatus

    WO2022213992A1