Data processing method and device
The three-dimensional model data is processed through binary encoding and string compression strategies, which solves the problem of low compression efficiency of structured data and achieves higher compression rates and resource savings.
Patent Information
- Application Number
- CN202310552435.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2024-11-22
AI Technical Summary
The existing three-dimensional model data file compression methods have low efficiency in compression of structured data, especially as the three-dimensional model data files are getting bigger and bigger, how to effectively reduce storage space has become a challenge.
The preset binary encoding strategy is used to convert the three-dimensional model data into binary data, and the preset string compression strategy is used to compress the binary data, which improves the compression rate through two compressions.
It improves the compression efficiency of three-dimensional model data, achieves higher compression rates, and supports stream decompression and stream loading, saving computing resources and storage resources.
Smart Images

Figure CN119010917A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data processing method and apparatus. Background Technology
[0002] With the increasing prevalence of 3D applications and the ever-increasing precision of 3D models, the size of 3D model data files is also growing. How to compress 3D model data files and reduce storage space in the face of these ever-growing file sizes has become a key focus in the industry. Most existing 3D model data file compression methods utilize certain compression algorithms to directly compress the original 3D model data, resulting in compressed data.
[0003] However, for scene 3D models, the corresponding original 3D model data is generally structured data described by Extensible Markup Language (XML). This structured data is relatively complex, and directly compressing it results in low compression efficiency. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a data processing method and apparatus.
[0005] In a first aspect, embodiments of this application provide a data processing method, including:
[0006] Obtain the three-dimensional model data corresponding to the three-dimensional model, wherein the three-dimensional model data is structured data used to describe the three-dimensional model;
[0007] The three-dimensional model data is processed by binary encoding using a preset binary encoding strategy to obtain the corresponding binary data;
[0008] The binary data is compressed using a preset string compression strategy to obtain the compressed model data corresponding to the 3D model data.
[0009] In one possible implementation, the step of performing binary encoding processing on the 3D model data using a preset binary encoding strategy to obtain corresponding binary data includes:
[0010] Determine at least one sub-data contained in the three-dimensional model data, and the data type, data length, and sub-data value corresponding to each sub-data;
[0011] For each sub-data, a type binary code is determined based on the data type corresponding to the sub-data, a length binary code is determined based on the data length corresponding to the sub-data, and a data binary code is determined based on the sub-data value;
[0012] By combining the type binary code, the length binary code, and the data binary code, the binary data corresponding to the sub-data is obtained;
[0013] Combine the binary data corresponding to all the sub-data to obtain the binary data corresponding to the three-dimensional model data.
[0014] In one possible implementation, the compression of the binary data using a preset string compression strategy includes:
[0015] Obtain the reference length set corresponding to the string compression strategy, wherein the reference length set contains at least one reference length;
[0016] In descending order of their corresponding length values, reference strings of the corresponding reference lengths are determined sequentially in the binary data, and target strings that are identical to the reference strings are searched in the binary data.
[0017] If a target string that is identical to the reference string is found, and the number of target strings is greater than a first preset threshold, a first substitute string corresponding to the reference string and a second substitute string corresponding to the target string are determined, wherein the length of the first substitute string and the length of the second substitute string are both less than the corresponding reference length;
[0018] The reference string in the binary data is replaced with the first substitution string, and the target string in the binary data is replaced with the second substitution string.
[0019] In one possible implementation, determining the first substitute string corresponding to the reference string and the second substitute string corresponding to the target string includes:
[0020] Determine the first offset of the reference string in the binary data, and generate the first replacement string based on the first offset and the reference length corresponding to the reference string;
[0021] as well as,
[0022] Determine the second offset of the target string in the binary data, and generate the second replacement string based on the second offset and the reference length corresponding to the reference string.
[0023] In one possible implementation, the method further includes:
[0024] A first dictionary is generated based on the reference string and the first substitute string, and a second dictionary is generated based on the target string and the second substitute string;
[0025] Store the first dictionary data and the second dictionary data into a preset dictionary.
[0026] In one possible implementation, the method further includes:
[0027] For each reference length, determine the number of target strings corresponding to that reference length;
[0028] The reference lengths whose corresponding quantity is less than the second preset threshold are determined as the lengths to be deleted;
[0029] Delete the length to be deleted from the reference length set.
[0030] In one possible implementation, after compressing the binary data using a preset string compression strategy to obtain the compressed model data corresponding to the 3D model data, the method further includes:
[0031] Based on the binary encoding strategy and the string compression strategy, encoded information is generated;
[0032] A compressed file is generated based on the encoded information and the model compression data.
[0033] Secondly, embodiments of this application provide another data processing method, including:
[0034] Obtain the compressed model data corresponding to the 3D model, wherein the compressed model data is the data obtained by compressing the 3D model data used to describe the 3D model;
[0035] The model compressed data is decoded using a preset string decoding strategy to obtain the binary data corresponding to the model compressed data;
[0036] The binary data is processed by using a preset binary decoding strategy to obtain the three-dimensional model data.
[0037] Thirdly, embodiments of this application provide a data processing apparatus, including:
[0038] The model data acquisition module is used to acquire the three-dimensional model data corresponding to the three-dimensional model, wherein the three-dimensional model data is structured data used to describe the three-dimensional model;
[0039] The data encoding processing module is used to perform binary encoding processing on the three-dimensional model data using a preset binary encoding strategy to obtain the corresponding binary data;
[0040] The data compression processing module is used to compress the binary data using a preset string compression strategy to obtain the compressed model data corresponding to the three-dimensional model data.
[0041] Fourthly, embodiments of this application provide a data processing apparatus, including:
[0042] The compressed data acquisition module is used to acquire the compressed model data corresponding to the three-dimensional model, wherein the compressed model data is data obtained by compressing the three-dimensional model data used to describe the three-dimensional model;
[0043] The first decoding processing module is used to decode the model compressed data using a preset string decoding strategy to obtain the binary data corresponding to the model compressed data.
[0044] The second decoding processing module is used to perform binary decoding processing on the binary data using a preset binary decoding strategy to obtain the three-dimensional model data.
[0045] Fifthly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0046] Memory, used to store computer programs;
[0047] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect.
[0048] In a sixth aspect, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any of the methods described in the first aspect.
[0049] In a seventh aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform any of the data processing methods described above.
[0050] Beneficial effects of the embodiments in this application:
[0051] This application provides a data processing method and apparatus. First, three-dimensional model data corresponding to a three-dimensional model is acquired. This three-dimensional model data is structured data used to describe the three-dimensional model. Then, the three-dimensional model data is binary encoded using a preset binary encoding strategy to obtain corresponding binary data. Finally, the binary data is compressed using a preset string compression strategy to obtain compressed model data corresponding to the three-dimensional model data. This application allows for the conversion of complex structured data into simpler binary data, followed by compression of the binary data to obtain the final compressed model data, thereby improving compression efficiency. Furthermore, in this application, the process of converting structured data into binary data is equivalent to one compression process, and the compression of the binary data is equivalent to a second compression process. These two compression processes improve the compression ratio of the three-dimensional model data, thus achieving a better compression effect.
[0052] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0053] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0056] Figure 2 The diagram shows how to obtain a compressed file from a file before compression.
[0057] Figure 3 A flowchart illustrating another data processing method provided in this application embodiment;
[0058] Figure 4 A flowchart illustrating another data processing method provided in this application embodiment;
[0059] Figure 5 A flowchart illustrating another data processing method provided in this application embodiment;
[0060] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0061] Figure 7 This is a schematic diagram of another data processing apparatus provided in an embodiment of this application;
[0062] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0064] The data processing method provided in this application will be explained and described below with reference to the accompanying drawings and specific embodiments. The embodiments do not constitute a limitation on the embodiments of this application.
[0065] See Figure 1 This is a flowchart illustrating an embodiment of a data processing method provided in this application. Figure 1 As shown, the process may include the following steps:
[0066] S101, Obtain the three-dimensional model data corresponding to the three-dimensional model, wherein the three-dimensional model data is structured data used to describe the three-dimensional model.
[0067] This application provides a data processing method for compressing three-dimensional model data.
[0068] The aforementioned 3D model can be a scene 3D model, such as a house 3D model, or other 3D models, such as an animal 3D model, a vehicle 3D model, etc.
[0069] The aforementioned 3D model data is structured data used to describe 3D models, such as structured data described by Extensible Markup Language (XML).
[0070] In one embodiment, user-uploaded model data can be obtained as the 3D model data.
[0071] In another embodiment, user-specified model data can be used as the 3D model data in a preset database.
[0072] S102, the three-dimensional model data is processed by binary encoding using a preset binary encoding strategy to obtain the corresponding binary data.
[0073] S103, the binary data is compressed using a preset string compression strategy to obtain the compressed model data corresponding to the three-dimensional model data.
[0074] The following provides a unified explanation of S102 and S103:
[0075] In this embodiment, the 3D model data is first processed using a preset binary encoding strategy to obtain corresponding binary data, i.e., a binary string. This converts complex structured data into simpler binary data.
[0076] Then, the binary data is compressed using a preset string compression strategy to obtain the compressed model data corresponding to the 3D model data. Since binary data is simpler than structured data, compressing binary data can greatly improve compression efficiency.
[0077] The specific methods for using the preset binary encoding strategy to encode the 3D model data and for using the preset string compression strategy to compress the binary data will be explained in detail in the following embodiments, and will not be elaborated here.
[0078] In another embodiment, after S103, the method may further include the following steps: generating encoding information based on the binary encoding strategy and the string compression strategy, and generating a compressed file based on the encoding information and the model compression data.
[0079] The encoded information describes the compression strategy used to compress the 3D model data. The resulting compressed file can be used for storage or transmission.
[0080] Figure 2 The diagram shows how a compressed file is obtained from a file before compression. The file before compression contains the data before compression (i.e., the 3D model data); the file after compression contains the data after compression (i.e., the compressed model data) and encoding information.
[0081] Through this embodiment, the generated compressed file not only contains model compression data, but also coded information describing the compression strategy used. In this way, users can intuitively understand the corresponding compression strategy through the coded information.
[0082] In this embodiment, firstly, 3D model data corresponding to the 3D model is obtained. This 3D model data is structured data used to describe the 3D model. Then, the 3D model data is binary encoded using a preset binary encoding strategy to obtain corresponding binary data. Finally, the binary data is compressed using a preset string compression strategy to obtain compressed model data corresponding to the 3D model data. This application allows for the conversion of complex structured data into simpler binary data, followed by compression of the binary data to obtain the final compressed model data, thereby improving compression efficiency. Furthermore, in this application, the process of converting structured data into binary data is equivalent to one compression process, and compressing the binary data is equivalent to a second compression process. These two compression processes improve the compression ratio of the 3D model data, resulting in better compression performance.
[0083] Secondly, the compression of 3D model data using this application does not require the creation of a global index. Therefore, when decompressing the data compressed using this application, it is not necessary to wait until the entire file is decompressed before accessing it. In other words, it supports streaming decompression and streaming loading, which consumes less computing and storage resources, thus saving computing and storage resources.
[0084] See Figure 3 This is a flowchart illustrating an embodiment of another data processing method provided in this application. Figure 3 The process shown above Figure 1 Based on the illustrated process, this section describes how to use a preset binary encoding strategy to perform binary encoding processing on the 3D model data to obtain the corresponding binary data. For example... Figure 3 As shown, the process may include the following steps:
[0085] S301, determine at least one sub-data contained in the three-dimensional model data, and the data type, data length and sub-data value corresponding to each sub-data.
[0086] The 3D model data contains multiple structural description data that describe parts of the model structure. Each structural description data contains at least one granular description data that measures the granularity, which is called sub-data.
[0087] For example, if the 3D model is a house model containing 5 rooms, then for each room, there is a corresponding structural description data that describes the dimensions of the room (i.e., length, width, and height). For each structural description data, the description of the length (e.g., 5 meters) is a granular description data, the description of the width is a granular description data, and the description of the height is a granular description data.
[0088] S302, for each sub-data, determine the type binary code based on the data type corresponding to the sub-data, determine the length binary code based on the data length corresponding to the sub-data, and determine the data binary code based on the sub-data value.
[0089] Data type refers to the granularity of measurement corresponding to sub-data, such as length, width, and height.
[0090] Data length refers to the length of characters corresponding to the sub-data.
[0091] Subdata values refer to the values of subdata based on the corresponding granularity of measurement. For example, the subdata value of "length 5" is 5, and the subdata value of "height 3" is 3.
[0092] In this embodiment of the application, the correspondence between different data types and binary codes, the correspondence between different data lengths and binary codes, and the correspondence between different sub-data values and binary codes can be preset.
[0093] By establishing a predefined correspondence between data types and binary codes, the type binary code corresponding to the data type of each sub-data is determined. Similarly, by establishing a predefined correspondence between data length and binary codes, the type binary code corresponding to the data length of each sub-data is determined. Finally, by establishing a predefined correspondence between sub-data values and binary codes, the type binary code corresponding to each sub-data value is determined.
[0094] S303, combine the type binary code, the length binary code, and the data binary code to obtain the binary data corresponding to the sub-data.
[0095] In this embodiment, after determining the type binary code, length binary code, and data binary code corresponding to the sub-data, the type binary code, length binary code, and data binary code can be combined according to a preset combination order to obtain the binary data corresponding to the sub-data. The combination order can be specifically set by the user according to actual needs.
[0096] For example, if the binary code corresponding to "length" is set to 1, the binary code corresponding to the data length "3" is set to 11, and the binary code corresponding to the sub-data value "5" is set to "101", then the binary data corresponding to the sub-data "length 5" is "111101".
[0097] S304, combine the binary data corresponding to all the sub-data to obtain the binary data corresponding to the three-dimensional model data.
[0098] In this embodiment of the application, after determining the binary data corresponding to all sub-data, the binary data corresponding to all sub-data are combined according to the order of each sub-data in the 3D model data to obtain the binary data corresponding to the 3D model data.
[0099] pass Figure 3 The process shown can perform binary conversion of 3D model data based on the data type, length, and value of each sub-data element. This binary conversion allows for one-time compression of the 3D model data, reducing the storage of large amounts of floating-point data descriptions (i.e., structured data) within the 3D model data.
[0100] See Figure 4 This is a flowchart illustrating an embodiment of another data processing method provided in this application. Figure 4 The process shown above Figure 1 Based on the illustrated process, this section describes how to compress the binary data using a preset string compression strategy. For example... Figure 4 As shown, the process may include the following steps:
[0101] S401, Obtain the reference length set corresponding to the string compression strategy, wherein the reference length set contains at least one reference length.
[0102] S402, in descending order of length value, determine the reference string corresponding to the reference length in the binary data, and search for the target string that is the same as the reference string in the binary data.
[0103] The reference length set contains at least one reference length, where each reference length can be set by the user according to actual needs.
[0104] In this embodiment of the application, the corresponding reference string is determined in the binary data in descending order of the corresponding length value. Specifically, for each reference length, a sliding window that is used as the window length is slid from front to back on the binary data. The string in each sliding window that has the same length value as the reference length is taken as a reference string. In addition, for each reference string determined, a target string that is the same as the reference string is searched in the binary data.
[0105] For example, if the reference length set contains three reference lengths, 6, 7, and 8, with the largest corresponding length being "8", then by using a sliding window with a window length of "8" to slide across the binary data from front to back, multiple reference strings of length 8 are obtained. Based on each reference string, the corresponding target string is searched in the binary data. Then, by using a sliding window with a window length of "7" to slide across the binary data from front to back, multiple reference strings of length 7 are obtained. Based on each reference string, the corresponding target string is searched in the binary data. Finally, by using a sliding window with a window length of "6" to slide across the binary data from front to back, multiple reference strings of length 6 are obtained. Based on each reference string, the corresponding target string is searched in the binary data.
[0106] S403, when a target string identical to the reference string is found, and the number of target strings is greater than a first preset threshold, a first substitute string corresponding to the reference string and a second substitute string corresponding to the target string are determined, wherein the length of the first substitute string and the length of the second substitute string are both less than the corresponding reference length.
[0107] S404, replace the reference string in the binary data with the first substitution string, and replace the target string in the binary data with the second substitution string.
[0108] In this embodiment, for each reference string, if no matching target string is found, or if the number of found target strings is less than or equal to a first preset threshold, it means that the binary data contains only a small number of strings like the reference string. In this case, compression is not very meaningful and would actually reduce compression efficiency. Therefore, it can be left unprocessed. Here, the first preset threshold can be set by the user according to actual needs.
[0109] If a target string that is identical to the reference string is found, and the number of target strings is greater than the first preset threshold, it means that the binary data contains a large number of strings like the reference string. In this case, a shorter string can be used to replace the reference string and the corresponding target string to shorten the length of the binary data.
[0110] Specifically, the implementation of determining the first substitute string corresponding to the reference string and the second substitute string corresponding to the target string may include:
[0111] A first offset of the reference string in the binary data is determined, a first replacement string is generated based on the first offset and the reference length corresponding to the reference string, and a second replacement string is generated based on the second offset and the reference length corresponding to the reference string.
[0112] This scheme allows for the rapid generation of a unique replacement string based on the string's offset in binary data and its corresponding reference length, thereby improving compression efficiency.
[0113] In another embodiment, the method may further include the following steps:
[0114] A first dictionary is generated based on the reference string and the first substitute string, and a second dictionary is generated based on the target string and the second substitute string. The first dictionary and the second dictionary are then stored in a preset dictionary.
[0115] The preset dictionary stores the correspondence between the original strings (i.e., the reference string and the target string) and the replacement strings (i.e., the first replacement string and the second replacement string) in the binary data. Thus, when decoding compressed data, fast decoding can be achieved based on the preset dictionary, improving decoding efficiency.
[0116] In another embodiment, the method may further include the following steps:
[0117] For each reference length, determine the number of target strings corresponding to the reference length, and determine the reference lengths whose corresponding number is less than a second preset threshold as lengths to be deleted, and delete the lengths to be deleted from the reference length set.
[0118] The target string corresponding to the reference length refers to the target string determined based on the reference string determined by the reference length. If there are multiple reference strings determined based on the reference length, the number of target strings is the total number of target strings determined based on the multiple reference strings.
[0119] In this embodiment, if the number of target strings corresponding to the reference length is greater than or equal to the second preset threshold, it means that there are many duplicate strings determined by the reference length. In this case, the reference length can be retained and used to further determine duplicate strings. Here, the second preset threshold can be set by the user according to actual needs.
[0120] If the number of target strings corresponding to the reference length is less than the second preset threshold, it means that there are fewer duplicate strings determined by the reference length. This usually happens because the reference length is too long. In this case, the reference length can be removed from the reference length set to reduce the number of reference lengths in the reference length set, thereby improving the speed of determining the target string using the reference length set and thus improving the compression efficiency.
[0121] pass Figure 4 The process shown involves finding the corresponding reference string and its corresponding target string in the binary data based on a preset reference length. Then, the reference string in the binary data is replaced with the first substitute string corresponding to the reference string, and the target string in the binary data is replaced with the second substitute string corresponding to the target string, thus compressing the binary data. This achieves secondary compression of the 3D model data, improving the compression ratio and resulting in better compression performance.
[0122] See Figure 5 This is a flowchart illustrating another data processing method provided in this application. Figure 5 As shown, the process may include the following steps:
[0123] S501, Obtain the model compression data corresponding to the three-dimensional model, wherein the model compression data is data obtained by compressing the three-dimensional model data used to describe the three-dimensional model;
[0124] S502, the model compressed data is decoded using a preset string decoding strategy to obtain the binary data corresponding to the model compressed data;
[0125] S503, the binary data is processed by binary decoding using a preset binary decoding strategy to obtain the three-dimensional model data.
[0126] The following provides a unified explanation of S501-S503:
[0127] This application provides a data processing method for decoding compressed model data. The compressed model data is data obtained by compressing 3D model data used to describe a 3D model.
[0128] In this embodiment of the application, the string decoding strategy and Figure 1 The string compression strategy in the illustrated process corresponds to the binary decoding strategy. Figure 1 The binary encoding strategy shown in the process corresponds to the string decoding strategy and the binary decoding strategy, which are used to process the data. Figure 1 The compressed model data obtained from the process shown is then decoded (i.e. decompressed).
[0129] First, the model compressed data is decoded using a preset dictionary (a preset dictionary used to store the correspondence between strings in binary data and corresponding replacement strings in model compressed data) corresponding to the string decoding strategy, to obtain the binary data corresponding to the model compressed data.
[0130] Furthermore, by using the preset correspondence between data types and binary codes, the preset correspondence between data lengths and binary codes, and the preset correspondence between sub-data values and binary codes, binary data is subjected to binary decoding to obtain three-dimensional model data. The three-dimensional model data consists of multiple corresponding sub-data (data described by corresponding data types, data lengths, and sub-data values).
[0131] In this embodiment, firstly, compressed model data corresponding to the 3D model is obtained. This compressed model data is data obtained by compressing the 3D model data used to describe the 3D model. Then, a preset string decoding strategy is used to decode the compressed model data to obtain binary data corresponding to it. Finally, a preset binary decoding strategy is used to perform binary decoding on the binary data to obtain the 3D model data. This application allows for the first decoding of the compressed model data to obtain the corresponding binary data, followed by decoding of the binary data to obtain the original 3D model data. Therefore, binary conversion reduces the complexity of decoding the compressed model data, thereby improving decoding efficiency.
[0132] Based on the same technical concept, embodiments of this application also provide a data processing apparatus, such as... Figure 6 As shown, the device includes:
[0133] The model data acquisition module 601 is used to acquire the three-dimensional model data corresponding to the three-dimensional model, wherein the three-dimensional model data is structured data used to describe the three-dimensional model;
[0134] The data encoding processing module 602 is used to perform binary encoding processing on the three-dimensional model data using a preset binary encoding strategy to obtain the corresponding binary data;
[0135] The data compression processing module 603 is used to compress the binary data using a preset string compression strategy to obtain the model compressed data corresponding to the three-dimensional model data.
[0136] In this embodiment, firstly, 3D model data corresponding to the 3D model is obtained. This 3D model data is structured data used to describe the 3D model. Then, the 3D model data is binary encoded using a preset binary encoding strategy to obtain corresponding binary data. Finally, the binary data is compressed using a preset string compression strategy to obtain compressed model data corresponding to the 3D model data. This application allows for the conversion of complex structured data into simpler binary data, followed by compression of the binary data to obtain the final compressed model data, thereby improving compression efficiency. Furthermore, in this application, the process of converting structured data into binary data is equivalent to one compression process, and compressing the binary data is equivalent to a second compression process. These two compression processes improve the compression ratio of the 3D model data, resulting in better compression performance.
[0137] Based on the same technical concept, this application also provides another data processing apparatus, such as... Figure 7 As shown, the device includes:
[0138] The compressed data acquisition module 701 is used to acquire the model compressed data corresponding to the three-dimensional model, wherein the model compressed data is data obtained by compressing the three-dimensional model data used to describe the three-dimensional model;
[0139] The first decoding processing module 702 is used to decode the model compressed data using a preset string decoding strategy to obtain the binary data corresponding to the model compressed data.
[0140] The second decoding processing module 703 is used to perform binary decoding processing on the binary data using a preset binary decoding strategy to obtain the three-dimensional model data.
[0141] In this embodiment, firstly, compressed model data corresponding to the 3D model is obtained. This compressed model data is data obtained by compressing the 3D model data used to describe the 3D model. Then, a preset string decoding strategy is used to decode the compressed model data to obtain binary data corresponding to it. Finally, a preset binary decoding strategy is used to perform binary decoding on the binary data to obtain the 3D model data. This application allows for the first decoding of the compressed model data to obtain the corresponding binary data, followed by decoding of the binary data to obtain the original 3D model data. Therefore, binary conversion reduces the complexity of decoding the compressed model data, thereby improving decoding efficiency.
[0142] Based on the same technical concept, embodiments of this application also provide an electronic device, such as... Figure 8 As shown, it includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0143] Memory 113 is used to store computer programs;
[0144] When processor 111 executes a program stored in memory 113, it performs the following steps:
[0145] Obtain the three-dimensional model data corresponding to the three-dimensional model, wherein the three-dimensional model data is structured data used to describe the three-dimensional model;
[0146] The three-dimensional model data is processed by binary encoding using a preset binary encoding strategy to obtain the corresponding binary data;
[0147] The binary data is compressed using a preset string compression strategy to obtain the compressed model data corresponding to the 3D model data.
[0148] as well as,
[0149] Obtain the compressed model data corresponding to the 3D model, wherein the compressed model data is the data obtained by compressing the 3D model data used to describe the 3D model;
[0150] The model compressed data is decoded using a preset string decoding strategy to obtain the binary data corresponding to the model compressed data;
[0151] The binary data is processed by using a preset binary decoding strategy to obtain the three-dimensional model data.
[0152] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0153] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0154] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0155] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0156] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above data processing methods.
[0157] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the data processing methods described above.
[0158] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0159] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0160] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A data processing method, characterized in that: The method comprises: Acquire three-dimensional model data corresponding to the three-dimensional model, wherein the three-dimensional model data is structured data used to describe the three-dimensional model; Performing binary encoding processing on the three-dimensional model data using a preset binary encoding strategy to obtain corresponding binary data; The binary data is compressed using a preset character string compression strategy to obtain model compression data corresponding to the three-dimensional model data.
2. The method according to claim 1, characterized in that The using a preset binary coding strategy to perform binary coding processing on the three-dimensional model data to obtain corresponding binary data includes: Determine at least one sub-data included in the three-dimensional model data, as well as the data type, data length and sub-data value corresponding to each sub-data; For each sub-data, determining a type binary code based on a data type corresponding to the sub-data, determining a length binary code based on a data length corresponding to the sub-data, and determining a data binary code based on a value of the sub-data; Combining the type binary code, the length binary code and the data binary code to obtain binary data corresponding to the sub-data; The binary data corresponding to all the sub-data are combined to obtain the binary data corresponding to the three-dimensional model data.
3. The method according to claim 1, characterized in that The compressing the binary data using a preset string compression strategy includes: Obtaining a reference length set corresponding to the string compression strategy, wherein the reference length set includes at least one reference length; Determine reference strings of corresponding reference lengths in the binary data in descending order of corresponding length values, and search for a target string identical to the reference string in the binary data; When a target string identical to the reference string is found and the number of the target strings is greater than a first preset threshold, determining a first replacement string corresponding to the reference string and a second replacement string corresponding to the target string, wherein the length of the first replacement string and the length of the second replacement string are both less than the corresponding reference length; The reference character string in the binary data is replaced with the first replacement character string, and the target character string in the binary data is replaced with the second replacement character string.
4. The method according to claim 3, characterized in that The determining of the first replacement character string corresponding to the reference character string and the second replacement character string corresponding to the target character string includes: Determine a first offset of the reference string in the binary data, and generate the first replacement string based on the first offset and a reference length corresponding to the reference string; as well as, A second offset of the target character string in the binary data is determined, and the second replacement character string is generated based on the second offset and a reference length corresponding to the reference character string.
5. The method according to claim 3, characterized in that: The method further comprises: generating first dictionary data based on the reference character string and the first replacement character string, and generating second dictionary data based on the target character string and the second replacement character string; The first dictionary data and the second dictionary data are stored in a preset dictionary.
6. The method according to claim 3, characterized in that The method further comprises: For each reference length, determining the number of target character strings corresponding to the reference length; Determine the reference lengths whose corresponding number is less than the second preset threshold as the lengths to be deleted; The to-be-deleted length is deleted from the reference length set.
7. The method according to claim 1, characterized in that After the binary data is compressed using a preset string compression strategy to obtain model compression data corresponding to the three-dimensional model data, the method further includes: Generate encoding information based on the binary encoding strategy and the string compression strategy; A compressed file is generated based on the encoding information and the model compression data.
8. A data processing method, characterized in that: The method comprises: Acquire model compression data corresponding to the three-dimensional model, wherein the model compression data is data obtained by compressing the three-dimensional model data used to describe the three-dimensional model; Decoding the model compressed data using a preset string decoding strategy to obtain binary data corresponding to the model compressed data; The binary data is subjected to binary decoding processing using a preset binary decoding strategy to obtain the three-dimensional model data.
9. A data processing device, characterized in that: The device comprises: A model data acquisition module, used to acquire three-dimensional model data corresponding to the three-dimensional model, wherein the three-dimensional model data is structured data used to describe the three-dimensional model; A data encoding processing module, used to perform binary encoding processing on the three-dimensional model data using a preset binary encoding strategy to obtain corresponding binary data; The data compression processing module is used to compress the binary data using a preset string compression strategy to obtain model compression data corresponding to the three-dimensional model data.
10. A data processing device, characterized in that: The device comprises: A compressed data acquisition module, used to acquire model compressed data corresponding to the three-dimensional model, wherein the model compressed data is data obtained by compressing the three-dimensional model data used to describe the three-dimensional model; A first decoding processing module, used to decode the model compressed data using a preset string decoding strategy to obtain binary data corresponding to the model compressed data; The second decoding processing module is used to perform binary decoding processing on the binary data using a preset binary decoding strategy to obtain the three-dimensional model data.
