A file compression method, a file decompression method and a device
By converting multi-layer class attribute objects in the file into nested single-layers and compressing, the problem of unsatisfactory file compression is solved, more efficient memory usage is achieved, and the file structure is kept intact when decompressing.
Patent Information
- Application Number
- CN202410256866.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-03-07
AI Technical Summary
In the prior art, the multi-layer structure of json or xml file formats leads to unsatisfactory file compression effect and high memory occupancy. It is necessary to improve the file compression effect to reduce memory occupancy.
By identifying objects that belong to class attributes and nested with multiple layers in the file, converting them into target multi-layer objects with nested single-layers, and compressing the converted files, restore the nested single-layer objects to embedded when decompressed. Set multiple layers to maintain the original structure of the file.
It improves file compression effect, reduces memory usage, and maintains the original structure of the file during the decompression process, avoiding the impact on subsequent use.
Smart Images

Figure CN118194822B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a file compression method, a file decompression method and a device. Background Art
[0002] Currently, due to the multi-layer nature of json or xml file formats, the file compression effect is not very ideal. Even if the file is compressed, the memory usage may still be too high. Therefore, the file compression effect needs to be improved. Summary of the invention
[0003] The main purpose of the present invention is to provide a file compression method, a file decompression method, a file compression device, a file decompression device, a computer device and a storage medium, which can solve the problem of poor file compression effect in the prior art.
[0004] To achieve the above object, the present invention provides a file compression method in a first aspect, the method comprising:
[0005] Get the file to be compressed;
[0006] Identify the file to be compressed, and convert the object to be converted identified in the file to be compressed into a target multi-layer object with a single-layer nesting, to obtain a converted file to be compressed; wherein the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0007] The converted file to be compressed is compressed to obtain a compressed target file.
[0008] In combination with the first aspect, in a possible implementation method, the above-mentioned conversion of the object to be converted identified in the file to be compressed into a target multi-layer object with a nested single layer to obtain the converted file to be compressed includes: obtaining the attribute name of the object to be converted in the file to be compressed; based on the attribute name and a preset identifier representing the layer number of the attribute name, converting the object to be converted in the file to be compressed into a target multi-layer object with a nested single layer to obtain the converted file to be compressed.
[0009] In combination with the first aspect, in a possible implementation method, the above-mentioned object to be converted in the to-be-compressed file is converted into a nested single-layer target multi-layer object based on the attribute name and the preset identifier representing the layer number of the attribute name, including: adding a preset identifier representing the layer number of the attribute name before or after the attribute name obtained in each layer, obtaining the target attribute name corresponding to each attribute name, and arranging each of the target attribute names to obtain a single-layer object; converting the nested multi-layer object to be converted into a nested single-layer, and using the identifier representing the string and the single-layer object as the content in the nested single layer of the object to be converted, to obtain the target multi-layer object.
[0010] In combination with the first aspect, in a possible implementation method, the above-mentioned identification of the file to be compressed includes: traversing the objects in the file to be compressed, and for the traversed target object, identifying whether the characters representing the attributes in the target object have an identifier representing the class attribute, if the characters representing the attributes in the target object have an identifier representing the class attribute, then determining the target object as an object belonging to the class attribute; identifying whether the object belonging to the class attribute is nested in multiple layers, if the object belonging to the class attribute is nested in multiple layers, determining that the object belonging to the class attribute is the object to be converted, and if the object belonging to the class attribute is not nested in multiple layers, determining that the object belonging to the class attribute is not the object to be converted.
[0011] To achieve the above object, the second aspect of the present invention provides a file compression device, the device comprising:
[0012] File acquisition module: used to obtain files to be compressed;
[0013] File conversion module: used for identifying the file to be compressed, converting the object to be converted identified in the file to be compressed into a target multi-layer object with a single-layer nesting, to obtain the converted file to be compressed; wherein the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0014] File compression module: used to compress the converted file to be compressed to obtain the compressed target file.
[0015] To achieve the above object, the third aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:
[0016] Get the file to be compressed;
[0017] Identify the file to be compressed, and convert the object to be converted identified in the file to be compressed into a target multi-layer object with a single-layer nesting, to obtain a converted file to be compressed; wherein the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0018] The converted file to be compressed is compressed to obtain a compressed target file.
[0019] To achieve the above object, a fourth aspect of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0020] Get the file to be compressed;
[0021] Identify the file to be compressed, and convert the object to be converted identified in the file to be compressed into a target multi-layer object with a single-layer nesting, to obtain a converted file to be compressed; wherein the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0022] The converted file to be compressed is compressed to obtain a compressed target file.
[0023] To achieve the above object, the fifth aspect of the present invention provides a file decompression method, the method comprising:
[0024] Get the file to be decompressed;
[0025] Decompressing the file to be decompressed to obtain a decompressed file, identifying a target multi-layer object in the decompressed file, wherein the target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0026] The target multi-layer object in the decompressed file is restored from a single-layer nesting to a multi-layer nesting to obtain the original file.
[0027] In combination with the fifth aspect, in a possible implementation, the above-mentioned identification of the target multi-layer object in the decompressed file includes: traversing the objects in the compressed file, and for the traversed target objects, identifying whether the target object has an identifier representing the class attribute, if the target object has an identifier representing the class attribute, the target object is determined to be an object belonging to the class attribute, and if the target object does not have an identifier representing the class attribute, the target object is not determined to be an object belonging to the class attribute; identifying whether the target object belonging to the class attribute is nested in a single layer, if the target object belonging to the class attribute is not nested in a single layer, determining that the target object belonging to the class attribute is not a target multi-layer object; if the target object belonging to the class attribute is nested in a single layer, identifying whether there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, if there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, determining that the target object belonging to the class attribute is a target multi-layer object, and if there is no preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, determining that the target object belonging to the class attribute is not a target multi-layer object.
[0028] In combination with the fifth aspect, in a possible implementation method, the above-mentioned restoration of the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer to obtain the original file includes: obtaining a target preset identifier from all preset identifiers representing the number of layers in the target multi-layer object, and determining the number of layers represented by the target preset identifier as the target number of layers; wherein the target preset identifier is a preset identifier corresponding to the maximum number of layers among the numbers of layers represented by all preset identifiers in the target multi-layer object; respectively obtaining each target attribute name contained in a single-layer object in a single layer nested by the target multi-layer object, wherein the single-layer object is composed of a plurality of target attribute names arranged in an arrangement, and the target attribute name contains a single preset identifier and an attribute name, and the attribute name is located after or in front of the preset identifier; based on the target number of layers and the target attribute name, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer to obtain the original file.
[0029] In combination with the fifth aspect, in a possible implementation method, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer based on the target number of layers and the target attribute name to obtain the original file, including: if the preset identifier contained in the target attribute name is not the target preset identifier, then the attribute name in the target attribute name is obtained, and an identifier representing the class attribute is added before the attribute name to obtain a first attribute name; if the preset identifier contained in the target attribute name is the target preset identifier, then the attribute name in the target attribute name is obtained, and an identifier representing the string is added before the attribute name to obtain a second attribute name; the target multi-layer object in the decompressed file is converted from a nested single layer to a nested multi-layer, wherein the number of nested layers of the target multi-layer object is the target number of layers, the first attribute name is used as the content of the layer with the same number of layers represented by the preset identifier corresponding to the first attribute name in the target multi-layer object, and the second attribute name is used as the content of the layer with the same number of layers represented by the preset identifier corresponding to the second attribute name in the target multi-layer object, to obtain the original file.
[0030] To achieve the above object, the sixth aspect of the present invention provides a file decompression device, the device comprising:
[0031] File acquisition module: used to obtain files to be decompressed;
[0032] File identification module: used to decompress the file to be decompressed to obtain a decompressed file, and identify a target multi-layer object in the decompressed file, wherein the target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0033] File conversion module: used for restoring the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer, and converting it to obtain the original file.
[0034] To achieve the above object, the seventh aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:
[0035] Get the file to be decompressed;
[0036] Decompressing the file to be decompressed to obtain a decompressed file, identifying a target multi-layer object in the decompressed file, wherein the target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0037] The target multi-layer object in the decompressed file is restored from a single-layer nesting to a multi-layer nesting to obtain the original file.
[0038] To achieve the above object, an eighth aspect of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0039] Get the file to be decompressed;
[0040] Decompressing the file to be decompressed to obtain a decompressed file, identifying a target multi-layer object in the decompressed file, wherein the target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to a class attribute and having multiple layers of nesting;
[0041] The target multi-layer object in the decompressed file is restored from a single-layer nesting to a multi-layer nesting to obtain the original file.
[0042] The embodiments of the present invention have the following beneficial effects:
[0043] The present invention provides a file compression method, which obtains a file to be compressed, identifies the file to be compressed, converts the object to be converted identified in the file to be compressed into a target multi-layer object with a nested single layer, obtains the converted file to be compressed, and compresses the converted file to be compressed to obtain the compressed target file. In this regard, the present invention also proposes a file decompression method, which obtains the file to be decompressed, decompresses the file to be decompressed to obtain a decompressed file, identifies the target multi-layer object in the decompressed file, and restores the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer, thereby converting to obtain the original file. Since objects with class attributes are often nested in multiple layers, the present invention can improve the effect by converting objects with class attributes in the file to be compressed from nested multi-layers to target multi-layer objects with a nested single layer, and then compressing the converted file to be compressed, so as to reduce the memory occupancy rate. In addition, when decompressing the file, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer, that is, the original file is converted, thereby not affecting the use of subsequent files. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] in:
[0046] Figure 1 A schematic diagram of a process of a file compression method in an embodiment of the present invention;
[0047] Figure 2 is a structural block diagram of a file compression device in an embodiment of the present invention;
[0048] Figure 3 A schematic diagram of a process of decompressing a file in an embodiment of the present invention;
[0049] Figure 4 A file decompression device in an embodiment of the present invention;
[0050] Figure 5 4 is a structural block diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The embodiment of the present invention provides a file compression method, which can be used in any scenario of file compression. The method can be executed by a terminal or a server. In this embodiment, the terminal executing the file compression method is recorded as a first terminal, and the server executing the file compression method is recorded as a first server. Figure 1 , Figure 1 A flowchart of a file compression method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the file compression method is specifically shown in steps S101 to S103:
[0053] Step S101: Obtain the file to be compressed.
[0054] Step S102: Identify the file to be compressed, and convert the object to be converted identified in the file to be compressed into a target multi-layer object with a nested single layer, to obtain a converted file to be compressed.
[0055] Step S103: compress the converted file to be compressed to obtain a compressed target file.
[0056] The file to be compressed is obtained, wherein the file to be compressed is a file that needs to be compressed currently. In a possible implementation, the file to be compressed may be a file in json format or xml format.
[0057] Generally speaking, the objects with class attributes in the compressed file can be nested multiple layers, for example,
[0058]
[0059] In this embodiment, Class can be defined as a class, which is an identifier that represents that the attribute is a class, Contact can be the attribute name, Class Contact is the outermost layer, which can be understood as the first layer, and the curly braces {} are nested layers, one curly brace represents one layer, and the number of layers represented from the outer layer to the inner layer can be defined to increase in sequence. Therefore, Class Address can be understood as the content in the second layer, and the content can include the identifier representing the attribute and the attribute name. Address can be understood as the attribute name in the second layer, string can be defined as a string, which is an identifier that represents that the attribute is a string, and string City can be understood as the content in the third layer.
[0060]
[0061] It should be noted that, for objects whose attributes are classes, except for the identifier representing the attribute in the innermost layer, which is an identifier representing the attribute as a string, the identifiers representing the attributes in other layers are all identifiers representing the class attribute.
[0062] In order to improve the compression effect, in this embodiment, objects belonging to class attributes and nested in multiple layers in the file to be compressed are converted into target multi-layer objects nested in a single layer to obtain the converted file to be compressed, and the converted file to be compressed is compressed to obtain the compressed target file, so as to achieve compression of the file to be compressed.
[0063] Specifically, first, the to-be-compressed file is identified to identify objects in the to-be-compressed file that belong to the class attribute and are nested in multiple layers, wherein in this embodiment, the objects that belong to the class attribute and are nested in multiple layers can be called objects to be converted, that is, the objects to be converted are defined as objects that belong to the class attribute and are nested in multiple layers. Then, the objects to be converted identified in the to-be-compressed file are converted into target multi-layer objects with a single nested layer to obtain the converted to-be-compressed file, and the converted to-be-compressed file is compressed to obtain the compressed target file.
[0064] In this embodiment, a method for identifying an object to be converted is proposed, which can be specifically shown in steps S201 and S202:
[0065] Step S201, traverse the objects in the to-be-compressed file, and for the traversed target object, identify whether the characters representing the attributes in the target object have an identifier representing the class attribute; if the characters representing the attributes in the target object have an identifier representing the class attribute, determine the target object as an object belonging to the class attribute.
[0066] Step S202, identifying whether the object belonging to the class attribute is nested in multiple layers. If the object belonging to the class attribute is nested in multiple layers, determining that the object belonging to the class attribute is an object to be converted; if the object belonging to the class attribute is not nested in multiple layers, determining that the object belonging to the class attribute is not an object to be converted.
[0067] Traverse the objects in the file to be compressed. In a possible implementation, if the object has nested layers, the traversed object can be the entire object composed of the outermost layer and the nested layers. For the traversed target object, identify whether the characters representing the attributes in the target object have an identifier representing the class attribute. If the characters representing the attributes in the target object have an identifier representing the class attribute, the target object is determined to be an object belonging to the class attribute. If the characters representing the attributes in the target object do not have an identifier representing the class attribute, it means that the target object does not belong to the class attribute. Therefore, it is determined that the target object is not an object of the class attribute. In a possible implementation, it can be identified whether the characters representing the attributes in the outermost layer of the target object are identifiers representing the class attribute. If the characters representing the attributes in the outermost layer of the target object are identifiers representing the class attribute, the target object is determined to be an object belonging to the class attribute. If the characters representing the attributes in the outermost layer of the target object are identifiers representing the class attribute, the target object is determined to be an object belonging to the class attribute. If the characters representing the attributes in the outermost layer of the target object are not identifiers representing the class attribute, it is determined that the target object is not an object of the class attribute.
[0068]
[0069] }, in the target object, Class is a character representing an attribute. Since Class can be defined as a class in json format or xml format, Class is an identifier representing a class. The outermost object is ClassContact, and the target object is an object belonging to a class attribute.
[0070] Further, it is identified whether the object belonging to the class attribute is nested multiple times. If the object belonging to the class attribute is nested multiple times, it is determined that the object belonging to the class attribute is the object to be converted. If the object belonging to the class attribute is not nested multiple times, it is determined that the object belonging to the class attribute is not the object to be converted. For example, the target object is
[0071]
[0072] The above describes how to determine the object to be converted. The following describes how to obtain the converted file to be compressed. The specific method can be shown in steps S301-S302:
[0073] Step S301: Obtain the attribute name of the object to be converted in the file to be compressed.
[0074] Step S302: based on the attribute name and the preset identifier representing the layer number of the attribute name, convert the object to be converted in the file to be compressed into a target multi-layer object with a nested single layer, to obtain a converted file to be compressed.
[0075] For the object to be converted, the attribute name of each layer of the object to be converted is obtained, and based on the attribute name and the preset identifier representing the layer number of the attribute name, the object to be converted in the compressed file is converted into a target multi-layer object with a nested single layer, and the converted file to be compressed is obtained. The specific method is shown in steps S401-S402:
[0076] Step S401, adding a preset identifier representing the layer number of the attribute name before or after the attribute name obtained at each layer, obtaining the target attribute name corresponding to each attribute name, and arranging the target attribute names to obtain a single-layer object.
[0077] Step S402: convert the multi-layer nested object to be converted into a single-layer nested object, and use the identifier representing the string and the single-layer object as the content in the single-layer nested object to obtain a target multi-layer object.
[0078] In a possible implementation, a preset identifier representing the layer number of the attribute name can be added before the attribute name obtained at each layer, and the target attribute name corresponding to each attribute name can be obtained, and each target attribute name can be arranged to obtain a single-layer object. In a possible implementation, a preset identifier representing the layer number of the attribute name can be added after the attribute name obtained at each layer, and the target attribute name corresponding to each attribute name can be obtained, and each target attribute name can be arranged to obtain a single-layer object.
[0079] For example, the preset identifier L1 represents the first layer, the preset identifier L2 represents the second layer, and the preset identifier L3 represents the third layer. If the object to be converted is
[0080]
[0081] }, it can be seen that the object to be converted is nested in 2 layers, so there are 3 layers in total. The attribute name in the first layer is Contact, so the target attribute name is L1 Contact, the attribute name in the second layer is Address, so the target attribute name is L2Address, and the attribute name in the third layer is City, so the target attribute name is L3 City. The single-layer object obtained by arranging the target attribute names is L1 Contact L2 Address L3City.
[0082] The multi-layer nested object to be converted in the compressed file is converted into a single-layer nested object, and the identifier representing the string and the single-layer object are used as the object in the single-layer nested object to be converted to obtain the target multi-layer object. For example, the object to be converted is
[0083]
[0084] The single-layer object obtained by arranging the target attribute names is L1 Contact L2Address L3 City. The identifier representing the string is string, and the target multi-layer object obtained is:
[0085] Class Contact {
[0086] String L1 Contact L2 Address L3 City
[0087] }.
[0088] In this embodiment, each object to be converted in the file to be compressed is converted into a corresponding target multi-layer object, so that the converted file to be compressed can be obtained.
[0089] Based on the above file compression method, by converting the multi-layer nested attribute class object into a single-layer nested target multi-layer object before file compression, the subsequent file compression effect can be improved to reduce memory usage.
[0090] In order to better implement the above-mentioned file compression method, the embodiment of the present invention provides a file compression device, which can perform the relevant functions of all steps of the above-mentioned file compression method. Figure 2 , Figure 2 A structural block diagram of a file compression device provided by an embodiment of the present invention, such as Figure 2 As shown, the file compression device 20 specifically includes:
[0091] File acquisition module 201: used to obtain the file to be compressed.
[0092] File conversion module 202: used for identifying the file to be compressed, converting the object to be converted identified in the file to be compressed into a target multi-layer object with a single nested layer, to obtain the converted file to be compressed; wherein the object to be converted is an object belonging to a class attribute and having multiple nested layers.
[0093] The file compression module 203 is used to compress the converted file to be compressed to obtain a compressed target file.
[0094] In a possible design, the above-mentioned file conversion module 202 is specifically used to: obtain the attribute name of the object to be converted in the file to be compressed; based on the attribute name and a preset identifier representing the layer number of the attribute name, convert the object to be converted in the file to be compressed into a nested single-layer target multi-layer object to obtain the converted file to be compressed.
[0095] In a possible design, the above-mentioned file conversion module 202 is specifically used to: add a preset identifier representing the layer number of the attribute name before or after the attribute name obtained in each layer, obtain the target attribute name corresponding to each attribute name, and arrange each of the target attribute names to obtain a single-layer object; convert the nested multi-layer object to be converted into a nested single-layer, and use the identifier representing the string and the single-layer object as the content in the nested single layer of the object to be converted to obtain the target multi-layer object.
[0096] In a possible design, the file conversion module 202 is specifically used to: traverse the objects in the file to be compressed, and for the traversed target object, identify whether the characters representing the attributes in the target object have an identifier representing the class attribute, and if the characters representing the attributes in the target object have an identifier representing the class attribute, determine the target object as an object belonging to the class attribute; identify whether the object belonging to the class attribute is nested in multiple layers, and if the object belonging to the class attribute is nested in multiple layers, determine that the object belonging to the class attribute is the object to be converted, and if the object belonging to the class attribute is not nested in multiple layers, determine that the object belonging to the class attribute is not the object to be converted.
[0097] Based on the above device, it is possible to convert a multi-layer nested object with a class attribute into a single-layer nested target multi-layer object, which can improve the subsequent file compression effect and reduce memory usage.
[0098] Based on the above file compression method, this embodiment also provides a corresponding file decompression method, which can be applied to the scenario of decompressing the target file compressed based on the above file compression method. The method can be executed by a terminal or a server. In this embodiment, the terminal executing the file decompression method is recorded as the second terminal, and the server executing the file decompression method is recorded as the second server. In a possible implementation, the first terminal and the second terminal can be the same terminal, and the first server and the second server can be the same server. Figure 3 , Figure 3 A flowchart of a file decompression method provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the file decompression method is specifically shown in steps S1001 to S1003:
[0099] Step S1001, obtain the file to be decompressed.
[0100] Step S1002: decompress the file to be decompressed to obtain a decompressed file, and identify a target multi-layer object in the decompressed file.
[0101] The target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to a class attribute and having multiple nested layers.
[0102] Step S1003: restore the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer, and convert it to obtain the original file.
[0103] Obtain a file to be decompressed, which may be a target file to be decompressed at present. As can be seen from the description of the above file compression method, the target file is a file compressed by the above file compression method. Decompress the file to be decompressed to obtain a decompressed file, and identify a target multi-layer object in the decompressed file. As can be seen from the description of the above file compression method, the target multi-layer object is obtained by converting the object to be converted into a nested single layer. The object to be converted is an object belonging to a class attribute and nested in multiple layers.
[0104] This embodiment provides a method for identifying a target multi-layer object in a decompressed file, and the method is specifically shown in steps S2001 and S2002:
[0105] Step S2001, traverse the objects in the compressed file, and for the traversed target object, identify whether the target object has an identifier representing the class attribute. If the target object has an identifier representing the class attribute, determine the target object as an object belonging to the class attribute; if the target object does not have an identifier representing the class attribute, do not determine the target object as an object belonging to the class attribute.
[0106] Traverse the objects in the compressed file. In a possible implementation, if the object has nested layers, the traversed object may be the entire object consisting of the outermost layer and the nested layers. For the traversed target object, identify whether the target object has an identifier representing the class attribute. If the target object has an identifier representing the class attribute, the target object is determined to be an object belonging to the class attribute. If the target object does not have an identifier representing the class attribute, the target object is not determined to be an object belonging to the class attribute. Since, for the target multi-layer object, the identifier representing the class attribute is located in the outermost layer, therefore, in a possible implementation, it can be identified whether the characters representing the attributes in the outermost layer of the target object are identifiers representing the class attribute. If the characters representing the attributes in the outermost layer of the target object are identifiers representing the class attribute, the target object is determined to be an object belonging to the class attribute. If the characters representing the attributes in the outermost layer of the target object are not identifiers representing the class attribute, it is determined that the target object is not an object of the class attribute.
[0107] Step S2002, identify whether the target object belonging to the class attribute is nested in a single layer. If the target object belonging to the class attribute is not nested in a single layer, determine that the target object belonging to the class attribute is not a target multi-layer object; if the target object belonging to the class attribute is nested in a single layer, identify whether there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute. If there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, determine that the target object belonging to the class attribute is a target multi-layer object. If there is no preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, determine that the target object belonging to the class attribute is not a target multi-layer object.
[0108] Since the target multi-layer object must be a nested single-layer and the nested layer contains a preset identifier representing the number of layers, therefore, it is necessary to identify whether the target object belonging to the class attribute is a nested single-layer. If the target object belonging to the class attribute is not a nested single-layer, it means that the target object belonging to the class attribute is not the target multi-layer object. If the target object belonging to the class attribute is nested in a single-layer, it is further identified whether there is a preset identifier representing the number of layers in the nested single-layer of the target object belonging to the class attribute. If there is a preset identifier representing the number of layers in the nested single-layer of the target object belonging to the class attribute, it is determined that the target object belonging to the class attribute is the target multi-layer object. If there is no preset identifier representing the number of layers in the nested single-layer of the target object belonging to the class attribute, it means that the target object belonging to the class attribute is not the target multi-layer object.
[0109] For example, the identified target object is
[0110] Class Contact
[0111] {
[0112] string L1contact L2Addtress L3 City;
[0113] },
[0114] Class represents the identifier of the class attribute, L1, L2 and L3 are the preset identifier representing the first layer, the preset identifier representing the second layer and the preset identifier representing the third layer respectively, therefore,
[0115] Class Contact
[0116] {
[0117] string L1contact L2Addtress L3 City;
[0118] } is the target multi-layer object.
[0119] The above describes how to identify the target multi-layer object in the decompressed file. The following describes how to restore the target multi-layer object from a nested single layer to a nested multi-layer to obtain the original file. The specific method is shown in steps S3001 to S3003:
[0120] Step S3001: Obtain a target preset identifier from among all preset identifiers representing the number of layers in the target multi-layer object, and determine the number of layers represented by the target preset identifier as the target number of layers.
[0121] Step S3002: Obtain the target attribute names contained in the single-layer objects in the single-layer nested target multi-layer objects.
[0122] Among them, a single-layer object is composed of a plurality of target attribute names arranged in an array, and the target attribute name includes a single preset identifier and an attribute name, and the attribute name is located after or before the preset identifier.
[0123] Step S3003: Based on the target number of layers and the target attribute name, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer, and the original file is converted.
[0124] Obtain a target preset identifier from among all preset identifiers representing the number of layers in the target multi-layer object, wherein the target preset identifier is a preset identifier corresponding to the maximum number of layers among the numbers of layers represented by all preset identifiers in the target multi-layer object, and determine the number of layers represented by the target preset identifier as the target number of layers. For example, the target multi-layer object is:
[0125] Class Contact
[0126] {
[0127] string L1contact L2Addtress L3 City;
[0128] }, L1, L2 and L3 are the preset identifier representing the first layer, the preset identifier representing the second layer and the preset identifier representing the third layer respectively, then L3 is the preset identifier corresponding to the maximum number of layers, therefore, the target preset identifier is L3, and the target number of layers is 3.
[0129] Respectively obtain each target attribute name contained in a single-layer object in a single layer (nested layer) of the nested target multi-layer object. From the description of the above file compression method, it can be seen that a single-layer object is composed of a plurality of target attribute names arranged in an arrangement, and the target attribute name contains a single preset identifier and an attribute name. The attribute name is located after or in front of the preset identifier, and the single preset identifier and attribute name contained in the target attribute name in the single-layer object are adjacent. For example, the single-layer object is L1 ContactL2Address L3City, L1, L2 and L3 are respectively the preset identifiers representing the first layer, the preset identifiers representing the second layer and the preset identifiers representing the third layer, L1Contact is adjacent, then L1 Contact is a target attribute name, L2Address is adjacent, then L2Address is a target attribute name, L3 City is adjacent, then L3 City is a target attribute name. In a possible implementation method, if the single-layer object is Contact L1 Address L2 CityL3, then ContactL1 is adjacent, then ContactL1 is a target attribute name, Address L2 is adjacent, then Address L2 is a target attribute name, City L3 is adjacent, then City L3 is a target attribute name.
[0130] In a possible implementation, the method for obtaining the target attribute name may be as follows: obtain the content except the identifier representing the attribute in a single layer (nested layer) of the nested target multi-layer object, obtain the single-layer object, obtain the preset identifier located at the front of the single-layer object, determine whether there is an attribute name before the preset identifier located at the front of the single-layer object, if there is an attribute name before the preset identifier located at the front of the single-layer object, then determine the attribute name before the current preset identifier in the single-layer object and the current preset identifier as the target attribute name, wherein the current preset identifier is any preset identifier in the single-layer object. If there is no attribute name before the preset identifier located at the front of the single-layer object, then determine the attribute name after the current preset identifier in the single-layer object and the current preset identifier as the target attribute name, wherein the current preset identifier is any preset identifier in the single-layer object.
[0131] For example, the target multi-layer object is:
[0132] Class Contact
[0133] {
[0134] string L1contact L2Addtress L3 City;
[0135] }, string is an identifier representing a string, the obtained single-layer object is L1contact L2AddtressL3 City, L1, L2 and L3 are respectively a preset identifier representing the first layer, a preset identifier representing the second layer and a preset identifier representing the third layer, then if it is recognized that there is no attribute name before L1, L1contact, L2Addtress and L3 City are determined as the target attribute names respectively.
[0136] If the target multi-layer object is:
[0137] Class Contact
[0138] {
[0139] string contactL1 Addtress L2 City L3;
[0140] }, string is an identifier representing a string, the obtained single-layer object is contactL1AddtressL2City L3, L1, L2 and L3 are respectively the preset identifier representing the first layer, the preset identifier representing the second layer and the preset identifier representing the third layer, then it is recognized that there is an attribute name before L1, then contactL1, Addresstress L2 and City L3 are determined as the target attribute names respectively.
[0141] Based on the target number of layers and the target attribute name, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer, and the original file is converted. The specific method is shown in step S4001-step S4002:
[0142] Step S4001: If the preset identifier included in the target attribute name is not the target preset identifier, then obtain the attribute name in the target attribute name, add an identifier representing the class attribute before the attribute name, and obtain a first attribute name; if the preset identifier included in the target attribute name is the target preset identifier, then obtain the attribute name in the target attribute name, add an identifier representing the string before the attribute name, and obtain a second attribute name.
[0143] The object to be converted determined before compression is
[0144]
[0145] It can be seen that, except for the identifier representing the attribute in the innermost object, which is string, the identifiers representing the attributes in the objects of other layers are all Class. Therefore, in this embodiment, it is determined whether the preset identifier contained in the acquired target attribute name is the target preset identifier. If the preset identifier contained in the target attribute name is not the target preset identifier, that is, the target attribute name is not the target attribute name corresponding to the innermost layer, then the attribute name in the target attribute name is obtained, and the identifier representing the class attribute is added before the attribute name to obtain the first attribute name. If the preset identifier contained in the target attribute name is the target preset identifier, that is, the target attribute name is the target attribute name corresponding to the innermost layer, then the attribute name in the target attribute name is obtained, and the identifier representing the string is added before the attribute name to obtain the second attribute name. For example, a single-layer object is L1 Contact L2Address L3City, L1, L2 and L3 are respectively the preset identifiers representing the first layer, the preset identifier representing the second layer and the preset identifier representing the third layer, the target layer number is 3, Class represents the identifier of the class attribute, String represents the identifier of the string, and the identified target attribute names are L1 Contact, L2 Address, and L3 City. The layer number corresponding to L1 Contact is the first layer, the layer number corresponding to L2 Address is the second layer, and the layer number corresponding to L3 City is the third layer. The first attribute name corresponding to L1 Contact is Class Contact, the first attribute name corresponding to L2Address is ClassAddress, and the second attribute name corresponding to L3 City is String City.
[0146] Step S4002, converting the target multi-layer object in the decompressed file from a nested single-layer to a nested multi-layer, wherein the number of nested layers of the target multi-layer object is the target number of layers, using the first attribute name as the content within the layer with the same number of layers represented by the preset identifier corresponding to the first attribute name in the target multi-layer object, and using the second attribute name as the content within the layer with the same number of layers represented by the preset identifier corresponding to the second attribute name in the target multi-layer object, to obtain the original file.
[0147] Convert the target multi-layer object in the decompressed file from single-nested to multi-nested. The number of nested layers of the target multi-layer object is the target number of layers. For example, if the target number of layers of the target multi-layer object is 3, convert it from single-nested to 2-nested.
[0148] The first attribute name is used as the content in the same layer represented by the preset identifier corresponding to the first attribute name in the target multi-layer object, and the second attribute name is used as the content in the same layer represented by the preset identifier corresponding to the second attribute name in the target multi-layer object, and the original file is obtained. For example, the first attribute names are ClassContact and Class Address, and the second attribute name is String City. The layers of Class Contact and Class Address are 1 and 2 respectively, and the layer number of String City is 3. Then Class Contact is used as the content in the first layer, ClassAddress is used as the content in the second layer, and String City is used as the content in the third layer to obtain the original object to be converted:
[0149]
[0150] The target multi-layer object can be restored to the object to be converted.
[0151] The original file before compression can be obtained by restoring each target multi-layer object in the decompressed file to the corresponding object to be converted.
[0152] Based on the above file decompression method, after decompressing the file, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer, that is, the original file is converted, so that the use of subsequent files is not affected.
[0153] In order to better implement the above-mentioned file decompression method, the embodiment of the present invention provides a file decompression device, which can perform the relevant functions of all steps of the above-mentioned file decompression method. Figure 4 , Figure 4 A file decompression device is provided in an embodiment of the present invention. The file decompression device 40 is specifically used for:
[0154] File acquisition module 401: used to acquire the file to be decompressed.
[0155] File identification module 402: used to decompress the file to be decompressed to obtain a decompressed file, and identify a target multi-layer object in the decompressed file, wherein the target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to a class attribute and having multiple nested layers.
[0156] File conversion module 403: used for restoring the target multi-layer object in the decompressed file from a single-layer nesting to a multi-layer nesting to obtain the original file.
[0157] In a possible design, the file identification module 402 is specifically used to: traverse the objects in the compressed file, and for the traversed target object, identify whether the target object has an identifier representing the class attribute, if the target object has an identifier representing the class attribute, determine the target object as an object belonging to the class attribute, if the target object does not have an identifier representing the class attribute, then do not determine the target object as an object belonging to the class attribute; identify whether the target object belonging to the class attribute is nested in a single layer, if the target object belonging to the class attribute is not nested in a single layer, then determine that the target object belonging to the class attribute is not a target multi-layer object; if the target object belonging to the class attribute is nested in a single layer, identify whether there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, if there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, then determine that the target object belonging to the class attribute is a target multi-layer object, if there is no preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, then determine that the target object belonging to the class attribute is not a target multi-layer object.
[0158] In a possible design, the above-mentioned file conversion module 403 is specifically used to: obtain a target preset identifier from all preset identifiers representing the number of layers in the target multi-layer object, and determine the number of layers represented by the target preset identifier as the target number of layers; wherein the target preset identifier is a preset identifier corresponding to the maximum number of layers among the numbers of layers represented by all preset identifiers in the target multi-layer object; respectively obtain each target attribute name contained in a single-layer object in a single layer nested by the target multi-layer object, wherein the single-layer object is composed of a plurality of target attribute names arranged in an arrangement, and the target attribute name contains a single preset identifier and an attribute name, and the attribute name is located after or before the preset identifier; based on the target number of layers and the target attribute name, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer, and the original file is converted.
[0159] In a possible design, the above-mentioned file conversion module 403 is specifically used for: if the preset identifier contained in the target attribute name is not the target preset identifier, then obtaining the attribute name in the target attribute name, adding an identifier representing the class attribute before the attribute name, and obtaining a first attribute name; if the preset identifier contained in the target attribute name is the target preset identifier, then obtaining the attribute name in the target attribute name, adding an identifier representing the string before the attribute name, and obtaining a second attribute name; converting the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer, wherein the number of nested layers of the target multi-layer object is the target number of layers, using the first attribute name as the content of the layer with the same number of layers represented by the preset identifier corresponding to the first attribute name in the target multi-layer object, and using the second attribute name as the content of the layer with the same number of layers represented by the preset identifier corresponding to the second attribute name in the target multi-layer object, to obtain the original file.
[0160] Based on the above device 40, it is possible to restore the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer, that is, convert it to obtain the original file, thereby not affecting the use of subsequent files.
[0161] Figure 5 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server, the computer device may be a first terminal or a first server, and the computer device may be a second terminal or a second server. Figure 5 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. If the computer device is a first terminal or a first server, when the computer program is executed by the processor, the processor may implement all the steps of the above-mentioned file compression method. If the computer device is a second terminal or a second server, when the computer program is executed by the processor, the processor may implement all the steps of the above-mentioned file decompression method. The internal memory may also store a computer program. If the computer device is a first terminal or a first server, when the computer program is executed by the processor, the processor may implement all the steps of the above-mentioned file compression method. If the computer device is a second terminal or a second server, when the computer program is executed by the processor, the processor may implement all the steps of the above-mentioned file decompression method. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0162] In one embodiment, a computer device is proposed, including a memory and a processor, wherein the memory stores a computer program. If the computer device is a first terminal or a first server, when the computer program is executed by the processor, the processor can implement all the steps of the above-mentioned file compression method. If the computer device is a second terminal or a second server, when the computer program is executed by the processor, the processor can implement all the steps of the above-mentioned file decompression method.
[0163] In one embodiment, a computer-readable storage medium is proposed, which stores a computer program. If the computer-readable storage medium is located in a first terminal or a first server, when the computer program is executed by a processor, the processor can implement all the steps of the above-mentioned file compression method. If the computer-readable storage medium is located in a second terminal or a second server, when the computer program is executed by the processor, the processor can implement all the steps of the above-mentioned file decompression method.
[0164] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0165] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A file compression method, It is characterized in that The method comprises: Get the file to be compressed; Traversing the objects in the to-be-compressed file, for the traversed target object, identifying whether the characters representing the attributes in the target object have an identifier representing the class attribute, if the characters representing the attributes in the target object have an identifier representing the class attribute, determining the target object as an object belonging to the class attribute; identifying whether the object belonging to the class attribute is nested in multiple layers, if the object belonging to the class attribute is nested in multiple layers, determining that the object belonging to the class attribute is the object to be converted, if the object belonging to the class attribute is not nested in multiple layers, determining that the object belonging to the class attribute is not the object to be converted, and obtaining the attribute name of the object to be converted in the to-be-compressed file; based on the attribute name and a preset identifier representing the number of layers of the attribute name, converting the object to be converted in the to-be-compressed file into a target multi-layer object with a single nested layer, to obtain the converted file to be compressed; wherein the object to be converted is an object belonging to the class attribute and nested in multiple layers; The converted file to be compressed is compressed to obtain a compressed target file.
2. The method according to claim 1, It is characterized in that The step of converting the object to be converted in the to-be-compressed file into a target multi-layer object with a nested single layer based on the attribute name and a preset identifier representing the number of layers where the attribute name is located includes: Add a preset identifier representing the layer number of the attribute name before or after the attribute name obtained at each layer, obtain the target attribute name corresponding to each attribute name, and arrange the target attribute names to obtain a single-layer object; The multi-layer nested object to be converted is converted into a single-layer nested object, and the identifier representing the string and the single-layer object are used as the content in the single-layer nested object to obtain a target multi-layer object.
3. A file decompression method, It is characterized in that The method comprises: Get the file to be decompressed; Decompress the file to be decompressed to obtain a decompressed file, traverse the objects in the decompressed file, and for the traversed target object, determine whether the target object has an identifier representing the class attribute. If the target object has an identifier representing the class attribute, determine the target object as an object belonging to the class attribute; if the target object does not have an identifier representing the class attribute, do not determine the target object as an object belonging to the class attribute; identify whether the target object belonging to the class attribute is a single-layer nested; if the target object belonging to the class attribute is not a single-layer nested, determine that the target object belonging to the class attribute is not a target multi-layer object; if the If the target object of the class attribute is nested in a single layer, it is identified whether there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute; if there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, it is determined that the target object belonging to the class attribute is a target multi-layer object; if there is no preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, it is determined that the target object belonging to the class attribute is not a target multi-layer object, wherein the target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to the class attribute and nested in multiple layers; The target multi-layer object in the decompressed file is restored from a single-layer nesting to a multi-layer nesting to obtain the original file.
4. The method according to claim 3, It is characterized in that The step of restoring the target multi-layer object in the decompressed file from a single-layer nested object to a multi-layer nested object to obtain the original file includes: Obtain a target preset identifier from among all preset identifiers representing the number of layers in the target multi-layer object, and determine the number of layers represented by the target preset identifier as the target number of layers; wherein the target preset identifier is a preset identifier corresponding to the maximum number of layers among the numbers of layers represented by all preset identifiers in the target multi-layer object; Respectively obtain each target attribute name contained in a single-layer object in a single-layer of the nested target multi-layer object, wherein the single-layer object is composed of a plurality of target attribute names arranged in sequence, and the target attribute name includes a single preset identifier and an attribute name, and the attribute name is located after or before the preset identifier; Based on the target number of layers and the target attribute name, the target multi-layer object in the decompressed file is restored from a nested single layer to a nested multi-layer, and the original file is converted.
5. The method according to claim 4, It is characterized in that The method of restoring the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer based on the target number of layers and the target attribute name to obtain the original file includes: If the preset identifier included in the target attribute name is not a target preset identifier, then the attribute name in the target attribute name is obtained, and an identifier representing the class attribute is added before the attribute name to obtain a first attribute name; if the preset identifier included in the target attribute name is a target preset identifier, then the attribute name in the target attribute name is obtained, and an identifier representing the string is added before the attribute name to obtain a second attribute name; The target multi-layer object in the decompressed file is converted from a nested single layer to a nested multi-layer, wherein the number of nested layers of the target multi-layer object is the target number of layers, the first attribute name is used as the content of the layer with the same number of layers represented by the preset identifier corresponding to the first attribute name in the target multi-layer object, and the second attribute name is used as the content of the layer with the same number of layers represented by the preset identifier corresponding to the second attribute name in the target multi-layer object, to obtain the original file.
6. A file compression device, It is characterized in that The device comprises: File acquisition module: used to obtain files to be compressed; File conversion module: used for traversing the objects in the to-be-compressed file, for the traversed target object, identifying whether the characters representing the attributes in the target object have an identifier representing the class attribute, if the characters representing the attributes in the target object have an identifier representing the class attribute, then determining the target object as an object belonging to the class attribute; identifying whether the object belonging to the class attribute is nested in multiple layers, if the object belonging to the class attribute is nested in multiple layers, then determining that the object belonging to the class attribute is the object to be converted, if the object belonging to the class attribute is not nested in multiple layers, then determining that the object belonging to the class attribute is not the object to be converted, and obtaining the attribute name of the object to be converted in the to-be-compressed file; based on the attribute name and a preset identifier representing the number of layers of the attribute name, converting the object to be converted in the to-be-compressed file into a target multi-layer object with a single nested layer, and obtaining the converted to-be-compressed file; wherein the object to be converted is an object belonging to the class attribute and nested in multiple layers; File compression module: used to compress the converted file to be compressed to obtain the compressed target file.
7. A file decompression device, It is characterized in that The device comprises: File acquisition module: used to obtain files to be decompressed; File identification module: used for decompressing the to-be-decompressed file to obtain the decompressed file, traversing the objects in the decompressed file, and for the traversed target object, determining whether the target object has an identifier representing the class attribute, if the target object has an identifier representing the class attribute, determining the target object as an object belonging to the class attribute, and if the target object does not have an identifier representing the class attribute, not determining the target object as an object belonging to the class attribute; identifying whether the target object belonging to the class attribute is a single-layer nested, and if the target object belonging to the class attribute is not a single-layer nested, determining that the target object belonging to the class attribute is not a target multi-layer object; If the target object belonging to the class attribute is nested in a single layer, then identify whether there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute; if there is a preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, then determine that the target object belonging to the class attribute is a target multi-layer object; if there is no preset identifier representing the number of layers in the nested single layer of the target object belonging to the class attribute, then determine that the target object belonging to the class attribute is not a target multi-layer object, wherein the target multi-layer object is obtained by converting the object to be converted into a nested single layer, and the object to be converted is an object belonging to the class attribute and nested in multiple layers; File conversion module: used for restoring the target multi-layer object in the decompressed file from a nested single layer to a nested multi-layer, and converting it to obtain the original file.
