CN115391297A - File processing method and device, electronic equipment and storage medium - Google Patents
File processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115391297A CN115391297A CN202110565667.6A CN202110565667A CN115391297A CN 115391297 A CN115391297 A CN 115391297A CN 202110565667 A CN202110565667 A CN 202110565667A CN 115391297 A CN115391297 A CN 115391297A
- Authority
- CN
- China
- Prior art keywords
- file
- compressed
- classification code
- coding
- coding tree
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 32
- 230000006835 compression Effects 0.000 claims abstract description 23
- 238000007906 compression Methods 0.000 claims abstract description 19
- 238000012545 processing Methods 0.000 claims abstract description 18
- 238000012856 packing Methods 0.000 claims abstract description 9
- 238000000034 method Methods 0.000 claims description 29
- 238000004590 computer program Methods 0.000 claims description 6
- 238000004806 packaging method and process Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 2
- 230000006837 decompression Effects 0.000 description 9
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
Abstract
The application provides a file processing method and device, electronic equipment and a storage medium, and relates to the field of data processing. The file processing method comprises the following steps: acquiring a file to be compressed; acquiring a file classification code and a coding tree corresponding to the file classification code according to the file to be compressed; coding the file to be compressed according to the coding tree to generate a compressed code stream; and packing the file classification codes and the compressed code streams to generate compressed files. When the compressed file is generated, the coding tree is not stored in the compressed file, and only the file classification code corresponding to the coding tree is stored in the compressed file, so that the generated compressed file does not carry any compression coding information, and the safety of the compressed file generated by the application can be improved.
Description
Technical Field
The embodiment of the application relates to the field of data processing, in particular to a file processing method and device and an electronic device storage medium.
Background
When the software system normally operates, a large number of log files are generated, and the log files are used for collecting and recording interactive data in the operating process of the software system so as to be used for work such as later analysis, diagnosis and the like. Because the data volume of the log files is too large, the log files are generally processed in a compression mode and then stored or sent, and the like, so that the storage space or the data transmission volume is saved. When the software system relates to the safety-related field, the log files often record some sensitive information, for example, in the communication field, networking, service use and other information may be involved, and the sensitive information may form a great safety hazard to product safety, so in order to reduce and avoid the safety hazard as much as possible, various safety measures are usually performed on the log to ensure that the sensitive information is not leaked.
However, the log file is compressed and encoded in the compressed file by using the traditional compression method, the generated compressed file contains compressed encoding information, so that any software can decompress the compressed file by using the same compression algorithm, the traditional compression software can encrypt the compressed file, the common encryption method comprises the steps of setting a password, adopting pseudo-encryption, modifying a file header and the like, but the security measures can be attacked and cracked, certain potential safety hazards exist, and the security of the compressed file cannot be effectively guaranteed.
Disclosure of Invention
The present application provides a file processing method, an apparatus, an electronic device, and a storage medium, and aims to implement that compressed files are generated without carrying compressed encoding information, so that security of the compressed files can be ensured.
In order to achieve the above object, an embodiment of the present application provides a file processing method, including: acquiring a file to be compressed; acquiring a file classification code and a coding tree corresponding to the file classification code according to the file to be compressed; coding the file to be compressed according to the coding tree to generate a compressed code stream; and packing the file classification codes and the compressed code streams to generate compressed files.
In order to achieve the above object, an embodiment of the present application further provides a file processing method, where the file processing method includes: acquiring a compressed file, and analyzing the compressed file to acquire a file classification code and a compressed code stream; acquiring an encoding tree corresponding to the file classification code from a preset position according to the file classification code, wherein the encoding tree is used for generating the compressed file; and coding the compressed code stream according to the coding tree to generate an original file.
To achieve the above object, an embodiment of the present application further provides a file processing apparatus, including:
the device comprises an acquisition module, a compression module and a decoding module, wherein the acquisition module is used for acquiring a file to be compressed and acquiring a file classification code and a coding tree corresponding to the file classification code according to the file to be compressed;
the coding module is used for coding the file to be compressed according to the coding tree to generate a compressed code stream;
and the compression module is used for packaging the file classification codes and the compressed code streams to generate compressed files.
In order to achieve the above object, an embodiment of the present application further provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the file processing methods described above.
To achieve the above object, the present application further proposes a computer-readable storage medium storing a computer program, wherein the computer program is configured to implement the file processing method according to any one of the above claims when executed by a processor.
According to the file processing method, the file processing device, the electronic equipment and the storage medium, when the file is compressed, the file to be compressed is obtained; acquiring a file classification code and a coding tree corresponding to the file classification code according to a file to be compressed; coding a file to be compressed according to the coding tree to generate a compressed code stream; and packing the file classification code and the compressed code stream to generate a compressed file. When the compressed file is generated, the coding tree is not stored in the compressed file, and only the file classification code corresponding to the coding tree is stored in the compressed file, so that the generated compressed file does not carry any compression coding information, and the safety of the compressed file generated by the application can be improved.
Drawings
One or more embodiments are illustrated by the corresponding figures in the drawings, which are not meant to be limiting.
FIG. 1 is a first flowchart of a document processing method according to an embodiment of the present disclosure;
FIG. 2 is a second flowchart of a document processing method according to an embodiment of the present application;
fig. 3 is a flowchart three of step 203 in the file processing method according to the embodiment of the present application shown in fig. 2;
FIG. 4 is a fourth flowchart of a document processing method provided in the embodiments of the present application;
FIG. 5 is a fifth flowchart of a file processing method according to an embodiment of the present application;
FIG. 6 is a sixth flowchart of a document processing method according to an embodiment of the present application;
fig. 7 is a first schematic structural diagram of a document processing apparatus according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of a document processing apparatus according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in various embodiments of the present application in order to provide a better understanding of the present application. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation of the present application, and the embodiments may be mutually incorporated and referred to without contradiction.
The embodiment of the application relates to a file processing method, and specifically comprises the following steps as shown in fig. 1.
Specifically, a large number of log files are generated when the software system operates normally, the obtained files to be compressed are obtained by the software system, the obtained files to be compressed can be log files which are required to be stored or transmitted during daily operation of the software system, or data files which are sent to the software system by a third party, the log files and the data files can be of picture types or of various types such as video types, digital types, text types and the like, and the source and the file types of the files to be compressed are not limited herein.
Step 102, obtaining a file classification code and a coding tree corresponding to the file classification code according to the file to be compressed.
Specifically, because the source and type of the file to be compressed obtained by the software system are not limited, if all the files to be compressed are encoded by using a uniform coding tree, the compression efficiency of the file to be compressed is low, and the compressed file is easy to crack. After the file to be compressed is obtained, the corresponding file classification code can be selected for the file to be compressed according to a preset classification rule, and when the file classification code is obtained, the coding tree corresponding to the file classification code can also be obtained together; or after the file classification code is obtained, obtaining the coding tree corresponding to the file classification code from the storage position of the coding tree or a third party according to the file classification code; when in storage, the coding tree is mapped and associated with the file classification code and then stored; under different classification rules, the obtained file classification codes and the coding trees of the same file to be compressed are different, and the compression rates of the obtained compressed files are also different; the coding tree mentioned in the present application is obtained by compression coding a sample file in advance, and the adopted compression coding method includes, but is not limited to, predictive coding (differential pulse code modulation, pulse code modulation), transform coding (discrete fourier transform, discrete cosine transform, walsh transform, etc.), subband coding, wavelet transform coding, statistical coding (shannon-fanuo coding, huffman coding, and arithmetic coding), and the like.
And 103, coding the file to be compressed according to the coding tree to generate a compressed code stream.
Specifically, after the coding tree is obtained, the code stream in the file to be compressed is encoded and compressed according to the code stream encoding method indicated by the coding tree to obtain the compressed code stream.
And step 104, packing the file classification code and the compressed code stream to generate a compressed file.
Specifically, the actually obtained compressed code stream is a code stream obtained after compressing a file to be compressed, but the compressed code stream does not contain any compressed encoding information, so that the compressed code stream cannot be decompressed subsequently, and therefore, the file classification code and the compressed code stream need to be packed, so that the file classification code and the compressed code stream are combined into a compressed file after being packed, that is, the compressed file obtained by the application is actually composed of two parts, namely, the file classification code and the compressed code stream, and the file classification code is used for indicating an encoding tree used when the compressed code stream is compressed.
It should be noted here that the compression process of the file to be compressed given by the present application is completed by a file compression program in the software system, the file compression program may be stored inside the software system and used directly by the software system, and the file compression program may also be stored in a third-party platform and used in a called form by the software system.
According to the implementation mode of the application, when the file is compressed, the file to be compressed is obtained; acquiring a file classification code and a coding tree corresponding to the file classification code according to a file to be compressed; coding a file to be compressed according to the coding tree to generate a compressed code stream; and packing the file classification codes and the compressed code streams to generate compressed files. When the compressed file is generated, the coding tree is not stored in the compressed file, and only the file classification code corresponding to the coding tree is stored in the compressed file, so that the generated compressed file does not carry any compression coding information, and the safety of the compressed file generated by the application can be improved.
The embodiment of the application relates to a file processing method, and specifically comprises the following steps as shown in fig. 2.
Specifically, the obtained sample file is substantially the same as the content of the file to be compressed, the sample file may be a log file generated when the software system is used previously, or a file which is obtained from a third-party platform and can be subjected to encoding processing, the number and types of the sample files are not limited, but each type contains the best choice for the application.
Specifically, the preset classification rule may be a classification according to the type of the sample file, for example, the sample file may be a video type file, an image type file, a text type file, an audio type file, a digital type file, and so on, and when a certain sample file contains multiple types of videos, images, texts, numbers, and so on, the corresponding file classification code is selected according to the proportion occupied by each type (usually, the file classification code with the highest proportion occupied by the type is taken as the standard); the preset classification rule may also be classified according to the field to which the sample file belongs, for example, the sample file may be a communication field file, a circuit field file, a biological field file, or the like, and the classification rule may also be set by the user according to the style, preference, and requirement of the user.
And 203, coding the sample file according to a preset coding method to generate a coding tree.
Specifically, after the sample files are classified, the class to which each sample file belongs is completely known, one to two (the number is not limited, and may be selected by a user) more typical sample files may be selected from each file class to generate the code tree, and when selecting which sample file as the sample file, the proportion size occupied by the file type corresponding to the file classification code to which the sample file belongs in the sample may be considered (in general, the higher the occupied proportion is, the better the proportion is), and the character distribution of the sample file may also be considered (the more uniform the character distribution is, the better the character distribution is). The process of generating the coding tree in this step is shown in fig. 3, and includes:
Specifically, whether a sample file is composed of various types of characters or not needs to be counted before generating a code tree, and the frequency of each character appearing in the sample file is obtained; for example, if a character B appears 10 times in a certain sample, the frequency of the character B is 10.
Specifically, after the frequencies of the characters are obtained, the characters are sorted in a descending order according to the frequencies of the characters, then the frequencies of the two characters with the minimum occurrence frequency are added, and the step is repeated, in the step, a higher frequency branch needs to be arranged on the right side all the time until the last frequency is 1, then a path from the probability 1 to each character is drawn (in the same level, the path with the higher frequency is 1, and the path with the lower frequency is 0), and the code tree can be obtained by sequentially following the 0 and 1 of the path.
It should be noted here that the coding trees generated by the present application are all static coding trees in general, and a dynamic coding tree can also be generated under the condition that the frequency of each character in a certain file to be compressed is high, so as to avoid that the compression ratio of the file to be compressed is low due to the use of the static coding tree under the condition.
Specifically, after the encoding tree is generated, the encoding tree and the file classification code need to be mapped and then stored, so that one classification code is ensured to correspond to one encoding tree, and the accuracy of selecting the encoding tree in the subsequent decompression is ensured.
Step 205, acquiring a file to be compressed.
Specifically, this step is substantially the same as step 101 in the embodiment of the present application, and is not repeated herein.
Step 206, obtaining the file classification code and the coding tree corresponding to the file classification code according to the file to be compressed.
Specifically, this step is substantially the same as step 102 in the embodiment of the present application, and is not repeated here.
And step 207, coding the file to be compressed according to the coding tree to generate a compressed code stream.
Specifically, this step is substantially the same as step 103 in the embodiment of the present application, and is not repeated here.
And step 208, packaging the file classification codes and the compressed code streams to generate compressed files.
Specifically, this step is substantially the same as step 104 in the embodiment of the present application, and is not repeated here.
The embodiment can also classify the files on the basis of other embodiments, and the coding trees used by each type of file are inconsistent, so that the method can encode the files according to the characteristics of each type of file, and further improve the compression efficiency of the method for compressing the files.
The embodiment of the application relates to a file processing method, and specifically comprises the following steps as shown in fig. 4.
Specifically, this step is substantially the same as step 101 in the embodiment of the present application, and is not repeated here.
Specifically, this step is substantially the same as step 202 in the embodiment of the present application, and is not repeated here.
Specifically, when the sample file is processed in the early stage, it cannot be guaranteed that the sample file includes files of various types included in the classification rule, and the coding tree acquired according to the sample data cannot cover the files of various types, so before acquiring the coding tree, it may be detected whether the coding tree corresponding to the file classification code can be found from a preset position, and when the coding tree corresponding to the file classification code cannot be found, it is indicated that the file of the type is not included in the sample file, step 404 is performed, and when the coding tree corresponding to the file classification code is found, it is indicated that the coding tree corresponding to the file classification code can be acquired, and step 405 is performed.
And step 404, coding the file to be compressed according to a preset coding method, generating a coding tree, mapping the file classification code and the coding tree, and storing.
Specifically, this step is substantially the same as step 203 and step 204 in the embodiment of the present application, and is not repeated herein.
Specifically, this step is substantially the same as the method for obtaining the code tree in step 102 in the embodiment of the present application, and is not repeated here.
And 406, coding the file to be compressed according to the coding tree to generate a compressed code stream.
Specifically, this step is substantially the same as step 103 in the embodiment of the present application, and is not repeated here.
Specifically, this step is substantially the same as step 104 in the embodiment of the present application, and is not repeated herein.
On the basis of other embodiments, the embodiment can also automatically generate a corresponding encoding tree according to a file to be compressed when the encoding tree corresponding to the file classification code of the file to be compressed does not exist, and store the file classification code and the corresponding encoding tree, so that the corresponding relationship between the file classification code and the encoding tree can be gradually improved in the actual use of the application, and the applicability and flexibility of the application are improved.
The embodiment of the application relates to a file processing method, and specifically comprises the following steps as shown in fig. 5.
Specifically, this step is substantially the same as step 101 in the embodiment of the present application, and is not repeated herein.
Specifically, this step is substantially the same as step 102 in the embodiment of the present application, and is not repeated here.
Specifically, this step is substantially the same as step 103 in the embodiment of the present application, and is not repeated herein.
Specifically, this step is substantially the same as step 104 in the embodiment of the present application, and is not repeated herein.
And 505, saving the compressed file or sending the compressed file to a preset server.
Specifically, after the compressed file is acquired, the compressed file may be stored locally in the software system, or the compressed file may be transmitted to a designated server or a designated recipient.
On the basis of other embodiments, the embodiment can also process the compressed file according to the user requirement after the compressed file is acquired, so that the flexibility of the application can be improved.
The embodiment of the application relates to a file processing method, and specifically comprises the following steps as shown in fig. 6.
Specifically, the obtained compressed file is a file compressed by the file compression method according to another embodiment of the present application, and is composed of a file classification code and a compressed code stream.
Specifically, after the compressed file is obtained, since the compressed file does not simply only contain the compressed code stream, the compressed file needs to be analyzed, and the file classification code and the compressed code stream contained in the compressed file are analyzed, but since the compression program and the decompression program in the software system used in the present application are both specific, the file classification code and the compressed code stream can be obtained only when the specific decompression program is used to analyze the compressed file, and the file classification code and the compressed code stream cannot be obtained when other programs are used to analyze the compressed file.
Specifically, according to a file classification code in a compressed file, an encoding tree corresponding to the file classification code can be acquired from a storage location of the encoding tree or a third party, the encoding tree indicates what kind of processing the compressed code stream is obtained, when the encoding tree corresponding to the file classification code is acquired in the process of decompressing the compressed file, firstly, the third party is required to be acquired at a preset storage location to inquire whether the encoding tree corresponding to the file classification code exists, if so, the currently-operated decompressing program allows the decompression of the compressed file, and the inquired encoding tree can be used as the encoding tree corresponding to the file classification code; if the code tree is not found, the currently running program does not support the decompression processing of the compressed file, and the running of the program is stopped.
And step 604, coding the compressed code stream according to the coding tree to generate an original file.
Specifically, the compressed code stream may be subjected to inverse coding processing according to the coding method indicated by the coding tree, so as to perform reduction processing on the compressed code stream, and generate an original file.
It should be noted here that the decompression process of the compressed file in the present application is completed by a file decompression program in the software system, where the file decompression program may be stored inside the software system for direct use by the software system, and the file decompression program may also be stored on a third-party platform for use by the software system in a calling manner.
According to the implementation mode of the application, when the compressed file is decompressed, the corresponding coding tree can be obtained from the local or the third party according to the file classification code in the compressed file, so as to obtain the original file; when the compressed file is analyzed and the coding tree is obtained according to the file classification code, the currently used program or equipment is verified for the second time, so that the safety of the environment for decompressing the compressed file is ensured, and the safety of the decompressed file can be improved.
In addition, it should be understood that the above steps of the various methods are divided for clarity, and the implementation may be combined into one step or split into some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included in the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
An embodiment of the present application relates to a document processing apparatus, as shown in fig. 7, including:
the obtaining module 701 is configured to obtain a file to be compressed, and obtain a file classification code and an encoding tree corresponding to the file classification code according to the file to be compressed.
And the encoding module 702 is configured to encode the file to be compressed according to the encoding tree to generate a compressed code stream.
The compression module 703 is configured to package the file classification code and the compressed code stream to generate a compressed file.
An embodiment of the present application relates to a document processing apparatus, as shown in fig. 8, including:
a first obtaining module 801, configured to obtain a compressed file.
The parsing module 802 parses the compressed file to obtain a file classification code and a compressed code stream.
The second obtaining module 803 obtains the coding tree corresponding to the file classification code according to the file classification code.
And the coding module 804 performs coding processing on the compressed code stream according to the coding tree to generate an original file.
It should be noted that, in the embodiments of the present application, each module is a logic module, and in practical applications, one logic unit may be one physical unit, may be a part of one physical unit, and may also be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
An embodiment of the present application relates to an electronic device, as shown in fig. 9, including:
at least one processor 901; and, memory 902 communicatively connected to at least one processor 901; the memory 902 stores instructions executable by the at least one processor 901, and the instructions are executed by the at least one processor 901, so that the at least one processor 901 can execute the file processing method described in any method embodiment.
In the embodiments of the present application, the memory and the processor are connected by a bus, which may include any number of interconnected buses and bridges that connect various circuits of the memory and the processor together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via the antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
The present embodiment relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments for carrying out the present application, and that various changes in form and details may be made therein without departing from the spirit and scope of the present application in practice.
Claims (10)
1. A file processing method, comprising:
acquiring a file to be compressed;
acquiring a file classification code and a coding tree corresponding to the file classification code according to the file to be compressed;
coding the file to be compressed according to the coding tree to generate a compressed code stream;
and packing the file classification codes and the compressed code streams to generate compressed files.
2. The file processing method according to claim 1, wherein said obtaining the file to be compressed further comprises:
acquiring at least two sample files;
classifying the sample files according to a preset classification rule to generate the file classification codes;
coding the sample file according to a preset coding method to generate the coding tree;
and mapping the file classification code and the coding tree and then storing.
3. The file processing method according to claim 2, wherein said encoding the sample file according to a preset encoding method to generate the encoding tree comprises:
acquiring the frequency of each character of the sample file;
and coding each character frequency to generate the coding tree.
4. The method according to claim 1, wherein said obtaining a file classification code and a coding tree corresponding to the file classification code according to the file to be compressed comprises:
classifying the files to be compressed according to a preset classification rule to obtain a file classification code;
searching the corresponding coding tree from a preset position according to the file classification code;
if the file classification code is found, the found coding tree is used as the coding tree corresponding to the file classification code;
if the file is not found, the file to be compressed is coded according to a preset coding method to generate the coding tree, and the file classification code and the coding tree are stored after being mapped.
5. The file processing method according to claim 1, wherein the step of packing the file classification code and the compressed code stream to generate a compressed file further comprises:
saving the compressed file; alternatively, the first and second electrodes may be,
and sending the compressed file to a preset server.
6. A method of processing a file, comprising:
acquiring a compressed file;
analyzing the compressed file to obtain a file classification code and a compressed code stream;
acquiring an encoding tree corresponding to the file classification code from a preset position according to the file classification code, wherein the encoding tree is used for generating the compressed file;
and coding the compressed code stream according to the coding tree to generate an original file.
7. The method according to claim 6, wherein said obtaining the coding tree corresponding to the document classification code from the predetermined location according to the document classification code comprises:
searching the corresponding coding tree at the preset position according to the file classification code;
if the file classification code is found, the found coding tree is used as the coding tree corresponding to the file classification code;
and if the compressed file is not found, stopping processing the compressed file.
8. A document processing apparatus, characterized in that the apparatus comprises:
the device comprises an acquisition module, a compression module and a decoding module, wherein the acquisition module is used for acquiring a file to be compressed and acquiring a file classification code and a coding tree corresponding to the file classification code according to the file to be compressed;
the coding module is used for coding the file to be compressed according to the coding tree to generate a compressed code stream;
and the compression module is used for packaging the file classification codes and the compressed code streams to generate compressed files.
9. An electronic device, comprising: at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the document processing method of any one of claims 1 to 5, or the document processing method of any one of claims 6 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program is for implementing the file processing method of any one of claims 1 to 5 or the file processing method of any one of claims 6 to 7 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110565667.6A CN115391297A (en) | 2021-05-24 | 2021-05-24 | File processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110565667.6A CN115391297A (en) | 2021-05-24 | 2021-05-24 | File processing method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115391297A true CN115391297A (en) | 2022-11-25 |
Family
ID=84113842
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110565667.6A Pending CN115391297A (en) | 2021-05-24 | 2021-05-24 | File processing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115391297A (en) |
-
2021
- 2021-05-24 CN CN202110565667.6A patent/CN115391297A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6460044B1 (en) | Intelligent method for computer file compression | |
CN107395209B (en) | Data compression method, data decompression method and equipment thereof | |
CN105049287A (en) | Log processing method and log processing devices | |
CN103346800B (en) | A kind of data compression method and device | |
CN110738323B (en) | Method and device for establishing machine learning model based on data sharing | |
CN106503165A (en) | Compression, decompressing method, device and equipment | |
CN113518094A (en) | Data processing method, device, robot and storage medium | |
CN110399511A (en) | Image cache method, equipment, storage medium and device based on Redis | |
US20150201020A1 (en) | Method and apparatus for storing network data | |
CN112311720B (en) | Data transmission method and device | |
CN109379245A (en) | A kind of wifi report form generation method and system | |
CN108958755B (en) | Method and device for generating application program installation package and electronic equipment | |
CN112817926B (en) | File processing method and device, storage medium and electronic device | |
CN108737353A (en) | A kind of data ciphering method and device based on data analysis system | |
CN112035401A (en) | Model data processing method and device, electronic equipment and readable medium | |
WO2020258942A1 (en) | Data compression method and device | |
CN114614829A (en) | Satellite data frame processing method and device, electronic equipment and readable storage medium | |
CN115391297A (en) | File processing method and device, electronic equipment and storage medium | |
KR20090029173A (en) | Decoding variable length codes in jpeg applications | |
CN113704206B (en) | Metadata processing method and device, electronic equipment and storage medium | |
CN110545446A (en) | desktop image encoding and decoding methods, related devices and storage medium | |
CN111967001A (en) | Decoding and coding safety isolation method based on double containers | |
CN113111200A (en) | Method and device for auditing picture file, electronic equipment and storage medium | |
US10168909B1 (en) | Compression hardware acceleration | |
CN108347451B (en) | Picture processing system, method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |