3D file processing method and related device
By analyzing and distributed compression processing of 3D files, the problem of low compression efficiency in the prior art is solved, and fast and efficient 3D file processing is achieved.
Patent Information
- Application Number
- CN202510289682.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-05-30
AI Technical Summary
The existing 3D file compression methods are inefficient and cannot meet the needs of rapid processing, especially in large-scale and complex 3D file processing.
By parsing the compressed 3D files, the index files and different types of sub-files are obtained, and the distributed server is used to compress these sub-files in a targeted manner. Finally, the compressed sub-file is reassembled into a 3D compressed file based on the index file.
It improves the overall compression efficiency of 3D files, can complete compression in a shorter time, meets the rapid processing needs of 3D files in actual applications, and reduces the utilization and cost of hardware resources.
Smart Images

Figure CN120067060A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of 3D file processing, and more specifically, to a 3D file processing method and related device. Background Art
[0002] With the rapid development of computer graphics technology, 3D files have been widely used in fields such as game development, animation production, virtual reality, and industrial design. However, 3D files usually contain a large amount of geometric data, texture information, material parameters, animation data, and audio, etc., resulting in large file sizes. During file transmission, storage, and processing, large-sized 3D files bring many inconveniences, such as long transmission time, high storage cost, high requirements for hardware resources during decompression and loading, etc. Therefore, it is usually necessary to compress 3D files.
[0003] Currently, common 3D file compression methods mainly perform a single compression operation on the entire file. However, for large-scale and complex 3D files, the existing compression methods require a long compression time, so the compression efficiency is low and cannot meet the rapid processing requirements of 3D files in practical applications. Summary of the Invention
[0004] In view of this, the present invention discloses a 3D file processing method and related device to improve the overall compression efficiency of 3D files and meet the rapid processing requirements of 3D files in practical applications.
[0005] A 3D file processing method includes:
[0006] Parsing the 3D file to be compressed to obtain an index file and sub-files of different types;
[0007] Combining the index file, and using a distributed server to perform targeted compression processing on the sub-files of different types to obtain each compressed target sub-file;
[0008] Based on the index file, reassembling each target sub-file into a 3D compressed file.
[0009] Optionally, the parsing the 3D file to be compressed to obtain an index file and sub-files of different types includes:
[0010] Identifying the file format of the 3D file to be compressed to obtain a file format identification result;
[0011] Based on the file format identification result, parsing the 3D file to be compressed to obtain the sub-files of different types, and recording the file placement position and hierarchical structure of each sub-file in the 3D file to be compressed;
[0012] Based on different types of the sub-files, as well as the file placement positions and the hierarchical structures of each of the sub-files in the 3D file to be compressed, construct a directed graph starting from the vertices of the 3D file to be compressed to each of the sub-files, where each file node in the directed graph represents a sub-file, and each file node includes: sub-file id, sub-file name, starting position, file size, and file type;
[0013] Store each of the sub-files into a shared storage to obtain the original storage path of each sub-file in the shared storage;
[0014] Store each of the original storage paths into the corresponding file nodes in the directed graph to obtain the index file.
[0015] Optionally, in combination with the index file, use a distributed server to perform targeted compression processing on different types of the sub-files to obtain each compressed target sub-file, including:
[0016] Parse the index file to obtain all file node information on the directed graph in the index file;
[0017] Based on the file type in each file node on the directed graph, assemble the file node information corresponding to each file node and the target compression format into a compression task;
[0018] Distribute each of the compression tasks to the distributed server, and the distributed server obtains the corresponding sub-files based on each of the compression tasks and performs targeted compression processing on different types of the sub-files using corresponding compression algorithms to obtain each compressed target sub-file.
[0019] Optionally, reassemble each of the target sub-files into a 3D compressed file based on the index file, including:
[0020] Store each of the compressed target sub-files into the shared storage and obtain the compressed storage path corresponding to each target sub-file;
[0021] Put the compressed storage path corresponding to each of the target sub-files into the corresponding position in the index file to obtain a target index file;
[0022] Use the target index file to reassemble each of the target sub-files into the 3D compressed file.
[0023] Optionally, use the target index file to reassemble each of the target sub-files into the 3D compressed file, including:
[0024] Parse the target index file, traverse the file node information of each file node in the target index file, and determine whether each of the file nodes contains the compressed storage path;
[0025] If all of the file nodes contain the corresponding compressed storage path, use the target index file to reassemble each of the target sub-files into the 3D compressed file.
[0026] Optionally, the step of using the target index file to reassemble each of the target sub-files into the 3D compressed file includes:
[0027] According to the file placement positions and the corresponding hierarchical structures recorded in the directed graph in the target index file, place each of the target sub-files in the corresponding positions, and then perform re-rendering and synthesis to obtain the 3D compressed file.
[0028] Optionally, before the step of parsing the 3D file to be compressed to obtain an index file and sub-files of different types, it further includes:
[0029] Obtain a 3D file compression request, where the 3D file compression request carries at least the path of the 3D file to be compressed and the target compression format;
[0030] Obtain the 3D file to be compressed according to the 3D file compression request.
[0031] A 3D file processing device includes:
[0032] A file parsing unit, configured to parse a 3D file to be compressed to obtain an index file and sub-files of different types;
[0033] A compression unit, configured to combine the index file and use a distributed server to perform targeted compression processing on the sub-files of different types to obtain each of the compressed target sub-files;
[0034] A reassembly unit, configured to reassemble each of the target sub-files into a 3D compressed file based on the index file.
[0035] A computer storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the above-mentioned 3D file processing method is implemented.
[0036] An electronic device includes: a memory and a processor;
[0037] The memory is used to store at least one instruction;
[0038] The processor is used to execute the at least one instruction to implement the above-mentioned 3D file processing method.
[0039] As can be seen from the above technical solution, the present invention discloses a 3D file processing method and related device. The 3D file to be compressed is parsed to obtain an index file and sub-files of different types. Combining the index file, the distributed server is used to perform targeted compression processing on the sub-files of different types to obtain each target sub-file after compression. Based on the index file, each target sub-file is reassembled into a 3D compressed file. By decomposing the 3D file to be compressed into sub-files of different types and using a distributed server for distributed processing, the present application can adopt the most suitable compression algorithm according to the characteristics of each sub-file, thereby greatly improving the overall compression efficiency of the 3D file. Compared with the traditional single compression method, the compression of the 3D file can be completed in a shorter time, so as to meet the rapid processing requirements of 3D files in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the disclosed drawings without creative efforts.
[0041] Figure 1 It is a flowchart of a 3D file processing method disclosed in an embodiment of the present invention;
[0042] Figure 2 It is a schematic structural diagram of a 3D file processing device disclosed in an embodiment of the present invention;
[0043] Figure 3 It is a schematic structural diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0045] See Figure 1 , a flowchart of a 3D file processing method disclosed in an embodiment of the present application, the method includes:
[0046] Step S101: Parse the 3D file to be compressed to obtain an index file and sub-files of different types.
[0047] The 3D file to be compressed contains sub-files such as animations, materials, textures, audio, etc., as well as the file placement locations and hierarchical structures of these sub-files in the 3D file. In this application, by parsing the 3D file to be compressed, different types of sub-files are obtained, for example, files such as animations, materials, textures, audio, etc. According to the file placement locations and hierarchical structures of these sub-files in the 3D file, an index file can be obtained.
[0048] In practical applications, Blender (an open-source 3D creation software) can be used to parse the 3D file to be compressed to obtain different types of sub-files.
[0049] Preferably, the index file can be a JSON file. JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy for devices to parse and generate.
[0050] Step S102: Combining the index file, use a distributed server to perform targeted compression processing on different types of the sub-files to obtain each compressed target sub-file.
[0051] A distributed server refers to a server architecture that distributes computing resources across multiple independent servers and coordinates and manages them through a network.
[0052] In this application, taking advantage of the characteristics of a distributed server, different types of sub-files are distributed to different servers for compression processing, and different compression algorithms are used for different types of sub-files. For example, for audio sub-files, the server can use audio compression algorithms such as MP3 and AAC; for texture sub-files, image compression algorithms such as JPEG (Joint Photographic Experts Group) and PNG (Portable Network Graphics) are selected according to their characteristics; for animation data and material data, compression algorithms specifically for these data types or optimized general data compression algorithms can be used. Through this distributed processing and targeted compression method, this application can make full use of distributed computing power, thereby improving the compression efficiency.
[0053] Step S103: Based on the index file, reassemble each of the target sub-files into a 3D compressed file.
[0054] The index file records the file placement locations and hierarchical structures of each sub-file in the 3D file. Therefore, each of the target sub-files can be reassembled into a 3D compressed file based on the index file.
[0055] In summary, the present application discloses a 3D file processing method. The 3D file to be compressed is parsed to obtain an index file and sub-files of different types. Combining the index file, a distributed server is used to perform targeted compression processing on the sub-files of different types to obtain each compressed target sub-file. Based on the index file, each target sub-file is reassembled into a 3D compressed file. By decomposing the 3D file to be compressed into sub-files of different types and using a distributed server for distributed processing, the present application can adopt the most suitable compression algorithm for each type of sub-file, thereby greatly improving the overall compression efficiency of the 3D file. Compared with the traditional single compression method, the compression of the 3D file can be completed in a shorter time, thus meeting the rapid processing requirements of 3D files in practical applications.
[0056] At the same time, each server in the distributed server shares the compression task of each sub-file, effectively avoiding the high requirements for hardware resources when performing large-scale data processing on a 3D file on a single device. This enables efficient compression of 3D files through distributed cooperation even on servers with ordinary configurations, reducing the hardware cost and the occupation of hardware resources to a certain extent.
[0057] In addition, during the 3D file parsing and compression process, the sub-files of different types are separated, making the 3D file processing more flexible. For example, if a specific sub-file needs to be modified or optimized separately, operations can be directly performed on the corresponding sub-file without reprocessing the entire 3D file, thereby enhancing the flexibility of 3D file processing.
[0058] In one embodiment, before step S101, it may further include:
[0059] Obtain a 3D file compression request, where the 3D file compression request carries at least the path of the 3D file to be compressed and the target compression format;
[0060] Obtain the 3D file to be compressed according to the 3D file compression request.
[0061] After the system in the present application obtains the 3D file compression request, the corresponding 3D file to be compressed can be obtained according to the path of the 3D file to be compressed carried in the 3D file compression request.
[0062] The target compression format is the compression format of each sub-file obtained after parsing the 3D file to be compressed. For example, the compression format corresponding to the texture sub-file can be.jpg or.jpeg.
[0063] In one embodiment, step S101 may specifically include:
[0064] (1). Identify the file format of the 3D file to be compressed to obtain the file format identification result.
[0065] (2). Parse the 3D file to be compressed based on the file format identification result to obtain different types of sub-files, and record the file placement location and hierarchical structure of each sub-file in the 3D file to be compressed.
[0066] In practical applications, Blender (an open-source 3D creation software) can be used to parse the 3D file to be compressed, extract different types of sub-files such as animations, materials, textures, and audio from the 3D file to be compressed, and record the file placement location and hierarchical structure of these sub-files in the 3D file to be compressed.
[0067] (3). Based on different types of the sub-files, and the file placement location and hierarchical structure of each sub-file in the 3D file to be compressed, construct a directed graph from the vertices of the 3D file to be compressed to each of the sub-files.
[0068] Among them, each file node in the directed graph represents a sub-file, and each file node includes: sub-file id (unique identifier), sub-file name, starting position, file size, and file type.
[0069] (4). Store each of the sub-files in a shared storage to obtain the original storage path of each sub-file in the shared storage.
[0070] (5). Store each of the original storage paths in the corresponding file nodes in the directed graph to obtain an index file.
[0071] Among them, the generated index file is also saved in the shared storage for subsequent use.
[0072] In practical applications, the constructed directed graph is stored in the index file, and after storing each sub-file in the shared storage and obtaining the original storage path of each sub-file in the shared storage, the original storage paths corresponding to each sub-file are also saved in the corresponding file nodes in the directed graph. Therefore, information such as which part of the model a certain texture corresponds to and which model objects a certain animation segment acts on will be clearly recorded in the index file. In this way, it can be ensured that the original structure of the 3D file can be accurately restored during the subsequent assembly process.
[0073] In one embodiment, step S102 may specifically include:
[0074] (1). Parse the index file to obtain all file node information on the directed graph in the index file.
[0075] Among them, the directed graph contains multiple file nodes, each file node represents a sub-file, and the information of each file node, that is, the information corresponding to each file node, includes: sub-file id (unique identifier), sub-file name, start position, file type, and original storage path.
[0076] (2) Based on the file types in each file node of the directed graph, assemble the file node information corresponding to each file node and the target compression format into a compression task.
[0077] In this application, each file node corresponds to a compression task, so multiple compression tasks can be obtained.
[0078] (3) Distribute each of the compression tasks to a distributed server. The distributed server obtains the corresponding sub-files based on each of the compression tasks, and performs targeted compression processing on the sub-files of different types using the corresponding compression algorithms to obtain the compressed target sub-files.
[0079] The distributed server consists of multiple servers. After distributing each compression task to the distributed server, each server in the distributed server obtains a compression task.
[0080] After the server obtains the compression task, it obtains the file node information to be compressed and the target compression format from the compression task, and obtains the original file path of the sub-file from the file node information. Then it downloads the corresponding sub-file to be compressed from the shared storage according to this original file path.
[0081] The server determines the corresponding compression algorithm according to the target compression format, and uses this compression algorithm to perform targeted compression processing on the sub-file to obtain the compressed target sub-file.
[0082] Among them, each server in the distributed server will select different compression algorithms for compression processing according to different file types. For example:
[0083] For audio sub-files, use audio compression algorithms such as MP3 and AAC.
[0084] For texture sub-files, select image compression algorithms such as JPEG and PNG according to their characteristics.
[0085] For animation data and material data, use compression algorithms specifically for these data types or optimized general data compression algorithms.
[0086] To further improve the compression efficiency and prevent resource waste caused by repeated compression of sub-files, each server in the distributed server first performs a repeated compression check after obtaining the sub-file to be compressed from the shared storage, and when it is determined that the sub-file has not been compressed before, it compresses the sub-file.
[0087] The principle of each server in the distributed server to check for repeated compression is as follows:
[0088] Determine the hash value of the sub-file (hash value), combine this hash value with the target compression format to form a key value key, and determine whether the key value key has been compressed. If the key value key has been compressed, directly return the compression result; otherwise, compress the sub-file.
[0089] In practical applications, the hash value of the sub-file can be determined according to the hash function. The specific determination process can refer to existing mature solutions and will not be elaborated here.
[0090] In one embodiment, step S103 may specifically include:
[0091] (1) Store each compressed target sub-file in the shared storage and obtain the compressed storage path corresponding to each target sub-file.
[0092] (2) Put the compressed storage paths corresponding to each of the target sub-files into the corresponding positions in the index file to obtain the target index file.
[0093] Each file node in the directed graph in the index file represents a sub-file. Each file node includes: sub-file id (unique identifier), sub-file name, start position, file type, and original storage path. After each compressed target sub-file is stored in the shared storage, the compressed storage path corresponding to each target sub-file can be obtained. Each target sub-file has a corresponding file node in the directed graph. Therefore, the compressed storage paths corresponding to each target sub-file can be put into the corresponding file nodes.
[0094] Among them, the node structure of each file node in the target index file is as follows:
[0095] {
[0096] "id": 1111,
[0097] "name": "picture.png",
[0098] "start_position": 1024,
[0099] "data_length": 512000,
[0100] "data_type": "img",
[0101] "origin_url": " / data / file / picture.png",
[0102] "compress_url": " / data / file / img.png"
[0103] }
[0104] Among them, "id" represents the sub-file id, "name" represents the sub-file name, "start_position" represents the starting position, "data_length" represents the file size, "data_type" represents the file type, "origin_url" represents the original storage path, and "compress_url" represents the storage path after compression.
[0105] (3) Reassemble each target sub-file into a 3D compressed file by using the target index file.
[0106] In practical applications, since each sub-file is executed concurrently on different servers, every time a sub-file is compressed and the storage path after compression is put into the index file, the index file will be updated. Therefore, this application will listen for the update event of the index file in real time, parse the index file, traverse the file node information of each file node, and judge whether the storage path after compression exists. If the storage path after compression exists for all file nodes, it will enter the 3D file synthesis process. According to the hierarchical position and other information recorded in the directed graph stored in the index file, the files will be placed in the correct positions and a 3D compressed file will be obtained through re-rendering and synthesis by Blender.
[0107] Specifically, parse the target index file, traverse the file node information of each file node in the target index file, and judge whether each of the file nodes contains the storage path after compression;
[0108] If all of the file nodes contain the corresponding storage path after compression, use the target index file to reassemble each of the target sub-files into the 3D compressed file.
[0109] Among them, the process of reassembling each target sub-file into a 3D compressed file by using the target index file may include:
[0110] According to the file placement positions and the corresponding hierarchical structures recorded in the directed graph in the target index file, place each target sub-file in the corresponding positions, and then perform re-rendering and synthesis to obtain a 3D compressed file.
[0111] In summary, by decomposing the 3D file to be compressed into different types of sub-files and using a distributed server for distributed processing, the present application can adopt the most suitable compression algorithm for the characteristics of each sub-file, thereby greatly improving the overall compression efficiency of the 3D file. Compared with the traditional single compression method, the compression of the 3D file can be completed in a shorter time, so as to meet the rapid processing requirements of 3D files in practical applications.
[0112] At the same time, each server in the distributed server shares the compression task of each sub-file, effectively avoiding the high requirements for hardware resources when performing large-scale data processing on 3D files on a single device. This enables efficient compression of 3D files through distributed collaboration even on servers with ordinary configurations, reducing the hardware cost and the occupation of hardware resources to a certain extent.
[0113] In addition, during the 3D file parsing and compression process, different types of sub-files are separated for processing, making the 3D file processing more flexible. For example, if a specific sub-file needs to be modified or optimized separately, operations can be directly performed on the corresponding sub-file without reprocessing the entire 3D file, thus enhancing the flexibility of 3D file processing.
[0114] Corresponding to the above embodiments of the 3D file processing method, the present application also discloses a 3D file processing device.
[0115] See Figure 2 , a schematic structural diagram of a 3D file processing device disclosed in an embodiment of the present application. The device may include:
[0116] A file parsing unit 201, configured to parse the 3D file to be compressed to obtain an index file and different types of sub-files.
[0117] The 3D file to be compressed contains sub-files such as animations, materials, textures, audio, etc., as well as the file placement locations and hierarchical structures of these sub-files in the 3D file. By parsing the 3D file to be compressed, the present application obtains different types of sub-files, for example, files such as animations, materials, textures, audio, etc. According to the file placement locations and hierarchical structures of these sub-files in the 3D file, an index file can be obtained.
[0118] In practical applications, Blender (an open-source 3D creation software) can be used to parse the 3D file to be compressed to obtain different types of sub-files.
[0119] Preferably, the index file can be a JSON file. JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for devices to parse and generate.
[0120] A compression unit 202, configured to combine with the index file and use a distributed server to perform targeted compression processing on different types of the sub-files, so as to obtain each compressed target sub-file.
[0121] A distributed server refers to a server architecture that distributes computing resources across multiple independent servers and coordinates and manages them through a network.
[0122] This application takes advantage of the characteristics of a distributed server to distribute different types of sub-files to different servers for compression processing, and different compression algorithms are adopted for different types of sub-files. For example, for audio sub-files, the server can adopt audio compression algorithms such as MP3 and AAC; for texture sub-files, image compression algorithms such as JPEG (Joint Photographic Experts Group) and PNG (Portable Network Graphics) are selected according to their characteristics; for animation data and material data, compression algorithms specifically for these data types or optimized general data compression algorithms can be adopted. Through this distributed processing and targeted compression method, this application can make full use of distributed computing power, thereby improving the compression efficiency.
[0123] A reassembly unit 203, configured to reassemble each of the target sub-files into a 3D compressed file based on the index file.
[0124] The index file records the file placement locations and hierarchical structures of each sub-file in the 3D file. Therefore, each of the target sub-files can be reassembled into a 3D compressed file based on the index file.
[0125] In summary, the present application discloses a 3D file processing method, which parses a 3D file to be compressed to obtain an index file and sub-files of different types. Combining the index file, a distributed server is used to perform targeted compression processing on the sub-files of different types to obtain each compressed target sub-file, and each target sub-file is reassembled into a 3D compressed file based on the index file. By decomposing the 3D file to be compressed into sub-files of different types and using a distributed server for distributed processing, the present application can adopt the most suitable compression algorithm for the characteristics of each sub-file, thereby greatly improving the overall compression efficiency of the 3D file. Compared with the traditional single compression method, the compression of the 3D file can be completed in a shorter time, so as to meet the rapid processing requirements of 3D files in practical applications.
[0126] At the same time, each server in the distributed server shares the compression task of each sub-file, effectively avoiding the high requirements for hardware resources when performing large-scale data processing on a 3D file on a single device. Even on a server with ordinary configuration, through distributed cooperation, the compression of the 3D file can be efficiently completed, reducing the hardware cost and the occupation of hardware resources to a certain extent.
[0127] In addition, during the 3D file parsing and compression process, the sub-files of different types are separated for processing, making the 3D file processing more flexible. For example, if a specific sub-file needs to be modified or optimized separately, it can be directly operated on the corresponding sub-file without reprocessing the entire 3D file, thereby enhancing the flexibility of 3D file processing.
[0128] In one embodiment, the file parsing unit 201 is further configured to:
[0129] Identify the file format of the 3D file to be compressed to obtain a file format identification result;
[0130] Parse the 3D file to be compressed based on the file format identification result to obtain the sub-files of different types, and record the file placement position and hierarchical structure of each sub-file in the 3D file to be compressed;
[0131] Based on the sub-files of different types, and the file placement position and the hierarchical structure of each sub-file in the 3D file to be compressed, construct a directed graph from the vertices of the 3D file to be compressed to each sub-file, wherein each file node in the directed graph represents a sub-file, and each file node includes: sub-file id, sub-file name, starting position, file size, and file type;
[0132] Store each of the sub-files in a shared storage to obtain the original storage path of each sub-file in the shared storage;
[0133] Store each of the original storage paths in the corresponding file nodes in the directed graph to obtain the index file.
[0134] In one embodiment, the compression unit 202 is further configured to:
[0135] Parse the index file to obtain all file node information on the directed graph in the index file;
[0136] Based on the file type in each file node on the directed graph, assemble the file node information corresponding to each file node and the target compression format into a compression task;
[0137] Distribute each of the compression tasks to the distributed server, and the distributed server obtains the corresponding sub-files based on each of the compression tasks and performs targeted compression processing on the sub-files of different types using the corresponding compression algorithms to obtain each target sub-file after compression.
[0138] In one embodiment, the reassembly unit 203 can also be used to:
[0139] Store each of the target sub-files after compression in the shared storage and obtain the storage path after compression corresponding to each target sub-file;
[0140] Put the storage path after compression corresponding to each target sub-file into the corresponding position in the index file to obtain a target index file;
[0141] Use the target index file to reassemble each of the target sub-files into the 3D compressed file.
[0142] In one embodiment, the reassembly unit 203 can also be used to:
[0143] Parse the target index file, traverse the file node information of each file node in the target index file, and determine whether each file node contains the storage path after compression;
[0144] If all the file nodes contain the corresponding storage path after compression, use the target index file to reassemble each of the target sub-files into the 3D compressed file.
[0145] In one embodiment, the reassembly unit 203 can also be used to:
[0146] According to the file placement positions recorded in the directed graph in the target index file and the corresponding hierarchical structure, place each of the target sub-files in the corresponding positions, and then perform re-rendering and synthesis to obtain the 3D compressed file.
[0147] In one embodiment, the 3D file processing device may further include:
[0148] A request acquisition unit, configured to acquire a 3D file compression request, where the 3D file compression request carries at least a path of a 3D file to be compressed and a target compression format;
[0149] A 3D file acquisition unit, configured to acquire the 3D file to be compressed according to the 3D file compression request.
[0150] It should be noted that for the specific working principles of the constituent units in the 3D file processing device, please refer to the corresponding parts of the method embodiments, which will not be elaborated here.
[0151] Corresponding to the above embodiments, the present application also discloses a computer storage medium, where the computer storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the steps shown in the method embodiment of 3D file processing are implemented.
[0152] The computer storage medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer storage medium may be a machine-readable signal medium or a machine-readable storage medium. The computer storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0153] Corresponding to the above embodiments, as Figure 3 shown, the present invention also provides an electronic device, and the electronic device may include: a processor 1 and a memory 2;
[0154] Wherein, the processor 1 and the memory 2 communicate with each other through a communication bus 3;
[0155] The processor 1 is configured to execute at least one instruction;
[0156] A memory 2 for storing at least one instruction;
[0157] The processor 1 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0158] The memory 2 may include a high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
[0159] Wherein, the processor executes at least one instruction to implement the steps shown in the embodiments of the 3D file processing method.
[0160] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0161] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the various embodiments can be referred to each other.
[0162] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A 3D file processing method, characterized in that: include: Parse the compressed 3D file to obtain an index file and sub-files of different types; In combination with the index file, using a distributed server to perform targeted compression processing on the sub-files of different types to obtain compressed target sub-files; The target sub-files are reassembled into a 3D compressed file based on the index file.
2. The 3D file processing method according to claim 1, characterized in that: The 3D file to be compressed is parsed to obtain an index file and sub-files of different types, including: Performing file format recognition on the 3D file to be compressed to obtain a file format recognition result; Parsing the 3D file to be compressed based on the file format recognition result to obtain the sub-files of different types, and recording the file placement position and hierarchical structure of each sub-file in the 3D file to be compressed; Based on the different types of sub-files, the file placement position of each sub-file in the 3D file to be compressed, and the hierarchical structure, a directed graph starting from the vertex of the 3D file to be compressed to each sub-file is constructed, wherein each file node in the directed graph represents a sub-file, and each file node includes: a sub-file id, a sub-file name, a starting position, a file size, and a file type; Storing each of the sub-files in a shared storage, and obtaining an original storage path of each of the sub-files in the shared storage; Each of the original storage paths is stored in a corresponding file node in the directed graph to obtain the index file.
3. The 3D file processing method according to claim 1 or 2, characterized in that: The method combines the index file and uses the distributed server to perform targeted compression processing on the sub-files of different types to obtain compressed target sub-files, including: Parsing the index file to obtain all file node information on the directed graph in the index file; Based on the file type in each file node on the directed graph, assembling the file node information and the target compression format corresponding to each file node into a compression task; Each compression task is distributed to the distributed server, and the distributed server obtains the corresponding sub-file based on each compression task, and uses the corresponding compression algorithm to perform targeted compression processing on different types of sub-files to obtain compressed target sub-files.
4. The 3D file processing method according to claim 1 or 2, characterized in that: The step of reassembling the target sub-files into a 3D compressed file based on the index file includes: The compressed target sub-files are stored in a shared storage, and the compressed storage paths corresponding to the target sub-files are obtained; Put the compressed storage path corresponding to each target sub-file into the corresponding position of the index file to obtain a target index file; The target sub-files are reassembled into the 3D compressed file using the target index file.
5. The 3D file processing method according to claim 4, characterized in that: The step of reassembling the target sub-files into the 3D compressed file by using the target index file includes: Parsing the target index file, traversing the file node information of each file node in the target index file, and determining whether each file node contains the compressed storage path; If all the file nodes contain the corresponding compressed storage paths, the target sub-files are reassembled into the 3D compressed file using the target index file.
6. The 3D file processing method according to claim 5, characterized in that: The step of reassembling the target sub-files into the 3D compressed file by using the target index file includes: According to the file placement positions recorded in the directed graph in the target index file and the corresponding hierarchical structure, each of the target sub-files is placed at a corresponding position, and then re-rendered and synthesized to obtain the 3D compressed file.
7. The 3D file processing method according to claim 1, characterized in that: Before the step of parsing the 3D file to be compressed to obtain the index file and sub-files of different types, the step further includes: Obtaining a 3D file compression request, wherein the 3D file compression request carries at least a path of the 3D file to be compressed and a target compression format; The 3D file to be compressed is obtained according to the 3D file compression request.
8. A 3D file processing device, characterized in that: include: A file parsing unit, used for parsing the compressed 3D file to obtain an index file and sub-files of different types; A compression unit, used to combine the index file and use the distributed server to perform targeted compression processing on the sub-files of different types to obtain compressed target sub-files; A reassembling unit is used to reassemble each of the target sub-files into a 3D compressed file based on the index file.
9. A computer storage medium, characterized in that: The computer storage medium stores at least one instruction, and when the at least one instruction is executed by the processor, the 3D file processing method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The electronic device comprises: a memory and a processor; The memory is used to store at least one instruction; The processor is used to execute the at least one instruction to implement the 3D file processing method according to any one of claims 1 to 7.