CN110851871A - File decompression method and device, electronic equipment and storage medium - Google Patents

File decompression method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110851871A
CN110851871A CN201911121927.XA CN201911121927A CN110851871A CN 110851871 A CN110851871 A CN 110851871A CN 201911121927 A CN201911121927 A CN 201911121927A CN 110851871 A CN110851871 A CN 110851871A
Authority
CN
China
Prior art keywords
target
file
decompressed
decompression
layers
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
Application number
CN201911121927.XA
Other languages
Chinese (zh)
Inventor
韩振国
王志海
喻波
魏云云
安鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wondersoft Technology Co Ltd
Original Assignee
Beijing Wondersoft Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Wondersoft Technology Co Ltd filed Critical Beijing Wondersoft Technology Co Ltd
Priority to CN201911121927.XA priority Critical patent/CN110851871A/en
Publication of CN110851871A publication Critical patent/CN110851871A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files

Abstract

The embodiment of the invention provides a file decompression method, a file decompression device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a target compressed file and initializing the corresponding number of decompression layers; decompressing the target compressed file to obtain a target decompressed file, and updating the number of decompressed layers; under the condition that the target decompressed file has the subfiles in the compressed format and the number of the decompressed layers is less than or equal to the preset number of the decompressed layers, taking the subfiles as the target compressed file, returning to decompress the target compressed file and updating the number of the decompressed layers; and outputting the target decompressed file under the condition that the number of the compression layers is larger than the compression layer number threshold and/or under the condition that the sub-file in the compression format does not exist in the target decompressed file. The embodiment of the invention limits the number of the decompression layers when the compressed file is decompressed in multiple layers, avoids the situation that the individual compressed file occupies too much processing resources due to too many compression layers, and improves the efficiency of the multi-layer decompression process.

Description

File decompression method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a file decompression method and apparatus, an electronic device, and a storage medium.
Background
In some security-related units with higher data security requirements, sensitive information monitoring is usually performed on internal file contents, and most of the files are in the form of compressed files, so that a large number of compressed files need to be analyzed for subsequent monitoring.
In the prior art, compressed files are usually directly decompressed, and if the compressed files of a plurality of layers of compressed files are nested inside, a large amount of data processing resources are consumed, the efficiency is low, and the requirement of large-scale file decompression when a user monitors the file content cannot be met.
Disclosure of Invention
The invention provides a file decompression method, a file decompression device, electronic equipment and a storage medium, and aims to solve the problem that a clock synchronization scheme aiming at an isolation network is not solved in the prior art.
In order to solve the above problems, the present invention is realized by:
in a first aspect, an embodiment of the present invention provides a file decompression method, including:
acquiring a target compressed file and initializing the corresponding number of decompression layers;
decompressing the target compressed file to obtain a target decompressed file, and updating the number of the decompressed layers;
under the condition that the target decompressed file has the subfiles in the compressed format and the number of the decompressed layers is smaller than or equal to the preset number of the decompressed layers, taking the subfiles as the target compressed file, returning to the step of decompressing the target compressed file to obtain the target decompressed file, and updating the number of the decompressed layers;
and outputting the target decompressed file under the condition that the number of the compression layers is larger than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file.
Optionally, the step of decompressing the target compressed file to obtain a target decompressed file includes:
determining a target compression format type of the target compressed file;
decompressing the target compressed file according to the target compressed format type under the condition that a preset compressed format type set contains the target compressed format type to obtain a target decompressed file;
and when the preset compression format type set does not contain the target compression format type, taking the target compression file as a target decompression file, and adding a sensitive identifier.
Optionally, before the step of outputting the target decompressed file, the method further includes:
and adding a sensitive identifier to the target analysis file under the condition that the number of the compression layers is greater than the compression layer number threshold.
Optionally, after the step of outputting the target decompressed file, the method further includes:
and under the condition that the target decompressed file contains the sensitive identification, generating an abnormal decompressed record according to the target decompressed file and storing the abnormal decompressed record.
Optionally, after the step of outputting the target decompressed file, the method further includes:
and outputting preset warning prompt information according to the sensitive identification under the condition that the target decompressed file contains the sensitive identification.
In a second aspect, an embodiment of the present invention provides a file decompression apparatus, including:
the acquisition module is used for acquiring the target compressed file and initializing the corresponding decompression layer number;
the decompression module is used for decompressing the target compressed file to obtain a target decompressed file and updating the number of the decompression layers;
the first processing module is used for taking the subfile as a target compressed file and returning the subfile to the decompression module under the condition that the target decompressed file contains the subfile in the compressed format and the number of the decompression layers is less than or equal to a preset decompression layer threshold value;
and the second processing module is used for outputting the target decompressed file under the condition that the number of the compression layers is greater than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file.
Optionally, the decompression module includes:
the determining submodule is used for determining the target compression format type of the target compressed file;
the first decompression submodule is used for decompressing the target compressed file according to the target compression format type under the condition that a preset compression format type set contains the target compression format type to obtain a target decompressed file;
and the second decompression sub-module is used for taking the target compressed file as a target decompressed file and adding a sensitive identifier when the target compressed format type is not contained in the preset compressed format type set.
Optionally, the apparatus further includes:
and the adding module is used for adding a sensitive identifier to the target analysis file under the condition that the number of the compression layers is greater than the compression layer number threshold.
Optionally, the apparatus further includes:
and the recording module is used for generating an abnormal decompression record according to the target decompression file and storing the abnormal decompression record under the condition that the target decompression file contains the sensitive identification.
Optionally, the apparatus further includes:
and the warning module is used for outputting preset warning prompt information according to the sensitive identification under the condition that the target decompressed file contains the sensitive identification.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the file decompression method of any of the above.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements the steps of the file decompression method described in any one of the above.
Compared with the prior art, the invention has the following advantages:
the embodiment of the invention provides a file decompression method, a file decompression device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a target compressed file and initializing the corresponding number of decompression layers; decompressing the target compressed file to obtain a target decompressed file, and updating the number of the decompressed layers; under the condition that the target decompressed file has the subfiles in the compressed format and the number of the decompressed layers is smaller than or equal to the preset number of the decompressed layers, taking the subfiles as the target compressed file, returning to the step of decompressing the target compressed file to obtain the target decompressed file, and updating the number of the decompressed layers; and outputting the target decompressed file under the condition that the number of the compression layers is larger than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file. The embodiment of the invention limits the number of the decompression layers when the compressed file is decompressed in multiple layers, avoids the situation that the individual compressed file occupies too much processing resources due to too many compression layers, and improves the efficiency of the multi-layer decompression process.
Drawings
FIG. 1 is a flowchart illustrating steps of a file decompression method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating steps of another file decompression method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a file decompression apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram illustrating another file decompression apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Example one
Referring to fig. 1, a flowchart illustrating steps of a file decompression method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 101, obtaining a target compressed file, and initializing a corresponding decompression layer number.
In the embodiment of the invention, in an environment with high requirements on information security, such as a confidential unit, an administrative organization, a scientific research institution and the like, strict security audit needs to be performed on incoming and outgoing files, most of the files are in a compressed file format, and decompression processing needs to be performed to perform subsequent audit. When detecting that data are transmitted into or transmitted out of the internal network, if the data are in a compressed format, taking the data as a target compressed file, initializing a corresponding decompression layer number, wherein the initial value is 0, and adding the target compressed file to a decompression task queue to perform subsequent decompression operation.
And 102, decompressing the target compressed file to obtain a target decompressed file, and updating the number of the decompressed layers.
In the embodiment of the invention, the processor extracts the target compressed urheen from the decompression task queue so as to decompress the target compressed file. Because the target compressed file may be multi-layer compressed when the data is nested, and the original file data in the target compressed file cannot be completely obtained by one-time decompression, the target compressed file needs to be decompressed for multiple times, and after one-layer decompression is performed on the target compressed file, the corresponding number of decompressed layers is updated and added by 1 to monitor the decompression process in real time, so that the situation that a certain compressed file occupies too many computing resources due to too many compressed layers is avoided.
And 103, under the condition that the target decompressed file contains the subfiles in the compressed format and the number of the decompressed layers is less than or equal to a preset number threshold of the decompressed layers, taking the subfiles as the target compressed file, returning to the step of decompressing the target compressed file to obtain the target decompressed file, and updating the number of the decompressed layers.
In the embodiment of the present invention, after the target compressed file is not decompressed by one layer, the target decompressed file obtained each time needs to be detected, and the subfile still in the compressed format after being decompressed is confirmed, it can be understood that, for a compressed file, the first layer is compressed as a whole, while in the second and subsequent compression levels it is possible to compress the partial data contained, therefore, an irregular nested compression structure is formed, so that in order to ensure the reasonable operation of the compression process, the subfiles which are still in a compression format need to be confirmed after each decompression, and adds the subfile as a target decompressed file to a decompression task queue for further decompression, and the subfiles which are not in the compressed format after being decompressed are added to the finally output target decompressed files, and the decompressed subfiles and other target decompressed files obtained by subsequent decompression are jointly output after the decompression process is completed.
In order to avoid that the compressed layer data of individual abnormal compressed files is too much, so that the compressed files are decompressed to consume too much data processing resources, and the file decompression efficiency in safety detection is reduced, an operator can set a decompression layer number threshold according to actual requirements, so that the target decompressed files are decompressed at most when the decompression layer number does not exceed the decompression layer number threshold, and the file decompression efficiency is ensured.
And 104, outputting the target decompressed file under the condition that the number of the compression layers is greater than the compression layer number threshold and/or under the condition that no subfile in a compressed format exists in the target decompressed file.
In the embodiment of the present invention, after the target compressed file is decompressed in multiple layers, if the number of decompressed layers after updating exceeds the threshold of the number of compressed layers, or if it is determined that no file exists in the decompressed target file, it is determined that no file exists in the decompressed task queue, the decompressed target files obtained through decompression in multiple layers are integrated and output as the final decompressed file of the target compressed file.
The file decompression method provided by the embodiment of the invention comprises the following steps: acquiring a target compressed file and initializing the corresponding number of decompression layers; decompressing the target compressed file to obtain a target decompressed file, and updating the number of the decompressed layers; under the condition that the target decompressed file has the subfiles in the compressed format and the number of the decompressed layers is smaller than or equal to the preset number of the decompressed layers, taking the subfiles as the target compressed file, returning to the step of decompressing the target compressed file to obtain the target decompressed file, and updating the number of the decompressed layers; and outputting the target decompressed file under the condition that the number of the compression layers is larger than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file. The embodiment of the invention limits the number of the decompression layers when the compressed file is decompressed in multiple layers, avoids the situation that the individual compressed file occupies too much processing resources due to too many compression layers, and improves the efficiency of the multi-layer decompression process.
Example two
Referring to fig. 2, a flowchart illustrating steps of another file decompression method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 201, obtaining a target compressed file, and initializing a corresponding number of decompression layers.
In the embodiment of the invention, before the target compressed file is acquired, a decompression configuration interface can be pushed to a user when decompression is started, so that the user can set a compression format type set and a decompression layer number threshold value which need to be decompressed. Furthermore, the combination of the decompressed file formats and the decompressed layer number threshold value can be configured by default according to actual requirements and automatically loaded when the compression process is started. In this step, the step of obtaining the target decompressed file and initializing the corresponding number of decompressed layers may refer to the detailed description of step 101, and will not be described herein again.
Step 202, determining the target compression format type of the target compressed file.
In the embodiment of the present invention, after the target compressed file is obtained each time, whether the format of the target compressed file to be decompressed can be decompressed is determined according to a predetermined compression format type set. It can be understood that, due to the wide variety of compression formats, the situation that the compression format of the compressed file is unknown and the file cannot be normally decompressed often occurs, so that the overall compression efficiency is affected. The target compression format type may be determined according to a suffix of a file name in the target compressed file, for example: rar, zip, etc.
And 203, decompressing the target compressed file according to the target compression format type under the condition that a preset compression format type set contains the target compression format type to obtain a target decompressed file, and updating the number of the decompressed layers.
In the embodiment of the present invention, if the target compression format type of the target decompressed file exists in the compression format type set, it is determined that the target compressed file can be decompressed, and a decompression process is performed to obtain the target decompressed file.
And 204, when the target compression format type is not contained in the preset compression format type set, using the target compression file as a target decompression file, and adding a sensitive identifier.
In the embodiment of the present invention, if the target compression format type of the target decompressed file does not exist in the compression format type set, the target compressed file may be directly output, and the sensitive flag may be performed. In practical application, an internal worker usually adopts a common compression format type, if the compression format type which cannot be identified appears, the file is indicated to have a certain risk, a sensitive identifier is added to the file for an operator to identify, and then specific analysis is carried out subsequently.
Step 205, when the target decompressed file has a subfile in a compressed format and the number of layers of decompression is less than or equal to a preset threshold value of the number of layers of decompression, taking the subfile as the target compressed file, and returning to the step 202.
In this embodiment of the present invention, after performing one-layer decompression, if it is detected that the subfiles in the compressed format still exist in the obtained target decompressed file and the number of decompressed layers does not exceed the threshold of the number of decompressed layers, the process returns to step 202 to perform decompression again.
And step 206, adding a sensitive identifier to the target analysis file under the condition that the number of the compression layers is greater than the compression layer number threshold.
In the embodiment of the invention, if the number of compression layers corresponding to a certain target compressed file exceeds the threshold of the number of compression layers, in order to guarantee the overall efficiency of the compression process, the decompression process of the target compressed file is ended, and a sensitive identifier is added to the compression for an operator to identify and perform subsequent processing.
Step 207, outputting the target decompressed file under the condition that the number of the compression layers is greater than the compression layer number threshold and/or under the condition that no subfile in a compressed format exists in the target decompressed file.
This step can refer to the detailed description of step 104, which is not repeated here.
And 208, under the condition that the target decompressed file contains the sensitive identification, generating an abnormal decompressed record according to the target decompressed file and storing the abnormal decompressed record.
In the embodiment of the invention, the target decompressed file added with the sensitive identifier in the decompression process is recorded and stored for subsequent processing by an operator.
And 209, outputting preset warning prompt information according to the sensitive identification under the condition that the target decompressed file contains the sensitive identification.
In the embodiment of the invention, under the condition that the target decompressed file containing the sensitive identification appears, the operator can be informed to carry out manual processing by sending out the preset warning prompt information, wherein the preset warning prompt information can be the prompt information of types such as alarm prompt, pop-up prompt, voice prompt and the like.
Another file decompression method provided in an embodiment of the present invention includes: acquiring a target compressed file and initializing the corresponding number of decompression layers; decompressing the target compressed file to obtain a target decompressed file, and updating the number of the decompressed layers; under the condition that the target decompressed file has the subfiles in the compressed format and the number of the decompressed layers is smaller than or equal to the preset number of the decompressed layers, taking the subfiles as the target compressed file, returning to the step of decompressing the target compressed file to obtain the target decompressed file, and updating the number of the decompressed layers; and outputting the target decompressed file under the condition that the number of the compression layers is larger than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file. The embodiment of the invention limits the number of the decompression layers when the compressed file is decompressed in multiple layers, avoids the situation that the individual compressed file occupies too much processing resources due to too many compression layers, and improves the efficiency of the multi-layer decompression process.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
EXAMPLE III
Referring to fig. 3, a schematic structural diagram of a file decompression apparatus 30 according to an embodiment of the present invention is shown, which may specifically include:
the obtaining module 301 is configured to obtain a target compressed file and initialize a corresponding number of decompression layers.
And the decompression module 302 is configured to decompress the target compressed file to obtain a target decompressed file, and update the number of decompression layers.
The first processing module 303 is configured to, when a subfile in a compressed format exists in the target decompressed file and the number of decompression layers is less than or equal to a preset decompression layer number threshold, take the subfile as a target compressed file and return the target compressed file to the decompression module 302.
A second processing module 304, configured to output the target decompressed file when the number of compression layers is greater than the threshold number of compression layers, and/or when there is no subfile in a compressed format in the target decompressed file.
The file decompression device provided by the embodiment of the invention comprises: the acquisition module is used for acquiring the target compressed file and initializing the corresponding decompression layer number; the decompression module is used for decompressing the target compressed file to obtain a target decompressed file and updating the number of the decompression layers; the first processing module is used for taking the subfile as a target compressed file and returning the subfile to the decompression module under the condition that the target decompressed file contains the subfile in the compressed format and the number of the decompression layers is less than or equal to a preset decompression layer threshold value; and the second processing module is used for outputting the target decompressed file under the condition that the number of the compression layers is greater than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file. The embodiment of the invention limits the number of the decompression layers when the compressed file is decompressed in multiple layers, avoids the situation that the individual compressed file occupies too much processing resources due to too many compression layers, and improves the efficiency of the multi-layer decompression process.
Example four
Referring to fig. 4, a schematic structural diagram of another file decompression apparatus 40 provided in the embodiment of the present invention is shown, which may specifically include:
the obtaining module 401 is configured to obtain a target compressed file and initialize a corresponding number of decompression layers.
And the decompression module 402 is configured to decompress the target compressed file to obtain a target decompressed file, and update the number of decompression layers.
A first processing module 403, configured to, when a subfile in a compressed format exists in the target decompressed file and the number of layers of decompression is less than or equal to a preset number of layers of decompression threshold, use the subfile as a target compressed file, return to the step of decompressing the target compressed file to obtain a target decompressed file, and update the number of layers of decompression.
A second processing module 404, configured to output the target decompressed file when the number of compression layers is greater than the threshold number of compression layers, and/or when there is no subfile in a compressed format in the target decompressed file.
Optionally, the decompression module 402 includes:
the determining sub-module 4021 is configured to determine a target compression format type of the target compressed file.
The first decompressing sub-module 4022 is configured to decompress the target compressed file according to the target compression format type under the condition that a preset compression format type set includes the target compression format type, so as to obtain a target decompressed file.
The second decompression sub-module 4023 is configured to, when the preset compression format type set does not include the target compression format type, use the target compression file as a target decompression file, and add a sensitive identifier.
Optionally, the apparatus further includes:
an adding module 405, configured to add a sensitive identifier to the target parsing file when the number of compression layers is greater than the compression layer number threshold.
Optionally, the method further includes:
and the recording module 406 is configured to generate an abnormal decompressed record according to the target decompressed file and store the abnormal decompressed record under the condition that the target decompressed file contains the sensitive identifier.
Optionally, the apparatus further includes:
and the warning module 407 is configured to output preset warning prompt information according to the sensitive identifier when the target decompressed file contains the sensitive identifier.
Another file decompression device provided in an embodiment of the present invention includes: the acquisition module is used for acquiring the target compressed file and initializing the corresponding decompression layer number; the decompression module is used for decompressing the target compressed file to obtain a target decompressed file and updating the number of the decompression layers; the first processing module is used for taking the subfile as a target compressed file and returning the subfile to the decompression module under the condition that the target decompressed file contains the subfile in the compressed format and the number of the decompression layers is less than or equal to a preset decompression layer threshold value; and the second processing module is used for outputting the target decompressed file under the condition that the number of the compression layers is greater than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file. The embodiment of the invention limits the number of the decompression layers when the compressed file is decompressed in multiple layers, avoids the situation that the individual compressed file occupies too much processing resources due to too many compression layers, and improves the efficiency of the multi-layer decompression process.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the above-mentioned file decompression method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned file decompression method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminals (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction system which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The foregoing describes in detail a file decompression method and a file decompression apparatus provided by the present invention, and specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the foregoing examples are only used to help understand the method and the core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A method for file decompression, comprising:
acquiring a target compressed file and initializing the corresponding number of decompression layers;
decompressing the target compressed file to obtain a target decompressed file, and updating the number of the decompressed layers;
under the condition that the target decompressed file has the subfiles in the compressed format and the number of the decompressed layers is smaller than or equal to the preset number of the decompressed layers, taking the subfiles as the target compressed file, returning to the step of decompressing the target compressed file to obtain the target decompressed file, and updating the number of the decompressed layers;
and outputting the target decompressed file under the condition that the number of the compression layers is larger than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file.
2. The method according to claim 1, wherein the step of decompressing the target compressed file to obtain a target decompressed file comprises:
determining a target compression format type of the target compressed file;
decompressing the target compressed file according to the target compressed format type under the condition that a preset compressed format type set contains the target compressed format type to obtain a target decompressed file;
and when the preset compression format type set does not contain the target compression format type, taking the target compression file as a target decompression file, and adding a sensitive identifier.
3. The method according to claim 1, wherein the step of outputting the target decompressed file is preceded by the steps of:
and adding a sensitive identifier to the target analysis file under the condition that the number of the compression layers is greater than the compression layer number threshold.
4. The method according to claim 3, wherein the step of outputting the target decompressed file is followed by:
and under the condition that the target decompressed file contains the sensitive identification, generating an abnormal decompressed record according to the target decompressed file and storing the abnormal decompressed record.
5. The method according to claim 3, wherein the step of outputting the target decompressed file is followed by:
and outputting preset warning prompt information according to the sensitive identification under the condition that the target decompressed file contains the sensitive identification.
6. A file decompression apparatus, comprising:
the acquisition module is used for acquiring the target compressed file and initializing the corresponding decompression layer number;
the decompression module is used for decompressing the target compressed file to obtain a target decompressed file and updating the number of the decompression layers;
the first processing module is used for taking the subfile as a target compressed file and returning the subfile to the decompression module under the condition that the target decompressed file contains the subfile in the compressed format and the number of the decompression layers is less than or equal to a preset decompression layer threshold value;
and the second processing module is used for outputting the target decompressed file under the condition that the number of the compression layers is greater than the compression layer number threshold and/or under the condition that no subfile in a compression format exists in the target decompressed file.
7. The apparatus of claim 5, wherein the decompression module comprises:
the determining submodule is used for determining the target compression format type of the target compressed file;
the first decompression submodule is used for decompressing the target compressed file according to the target compression format type under the condition that a preset compression format type set contains the target compression format type to obtain a target decompressed file;
and the second decompression sub-module is used for taking the target compressed file as a target decompressed file and adding a sensitive identifier when the target compressed format type is not contained in the preset compressed format type set.
8. The apparatus of claim 6, further comprising:
and the adding module is used for adding a sensitive identifier to the target analysis file under the condition that the number of the compression layers is greater than the compression layer number threshold.
9. The apparatus of claim 8, further comprising:
and the recording module is used for generating an abnormal decompression record according to the target decompression file and storing the abnormal decompression record under the condition that the target decompression file contains the sensitive identification.
10. The apparatus of claim 8, further comprising:
and the warning module is used for outputting preset warning prompt information according to the sensitive identification under the condition that the target decompressed file contains the sensitive identification.
11. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the file decompression method according to any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the file decompression method according to one of the claims 1 to 5.
CN201911121927.XA 2019-11-15 2019-11-15 File decompression method and device, electronic equipment and storage medium Pending CN110851871A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911121927.XA CN110851871A (en) 2019-11-15 2019-11-15 File decompression method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911121927.XA CN110851871A (en) 2019-11-15 2019-11-15 File decompression method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110851871A true CN110851871A (en) 2020-02-28

Family

ID=69600481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911121927.XA Pending CN110851871A (en) 2019-11-15 2019-11-15 File decompression method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110851871A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488556A (en) * 2020-04-09 2020-08-04 深信服科技股份有限公司 Nested document extraction method and device, electronic equipment and storage medium
CN112214462A (en) * 2020-10-22 2021-01-12 新华三信息安全技术有限公司 Multi-layer decompression method of compressed file, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020205A (en) * 2012-12-05 2013-04-03 北京普泽天玑数据技术有限公司 Compression and decompression method based on hardware accelerator card on distributive-type file system
CN108090115A (en) * 2017-11-03 2018-05-29 中国科学院信息工程研究所 A kind of filter method and system for Gzip compressed datas
CN108229164A (en) * 2016-12-21 2018-06-29 武汉安天信息技术有限责任公司 Decompress the judgment method and device of bomb

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020205A (en) * 2012-12-05 2013-04-03 北京普泽天玑数据技术有限公司 Compression and decompression method based on hardware accelerator card on distributive-type file system
CN108229164A (en) * 2016-12-21 2018-06-29 武汉安天信息技术有限责任公司 Decompress the judgment method and device of bomb
CN108090115A (en) * 2017-11-03 2018-05-29 中国科学院信息工程研究所 A kind of filter method and system for Gzip compressed datas

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488556A (en) * 2020-04-09 2020-08-04 深信服科技股份有限公司 Nested document extraction method and device, electronic equipment and storage medium
CN112214462A (en) * 2020-10-22 2021-01-12 新华三信息安全技术有限公司 Multi-layer decompression method of compressed file, electronic equipment and storage medium
CN112214462B (en) * 2020-10-22 2023-04-28 新华三信息安全技术有限公司 Multi-layer decompression method for compressed file, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN106936441B (en) Data compression method and device
CN108549662B (en) Complementary digestion method and device for semantic analysis results in multi-round conversation
US8863087B2 (en) Comprehensively testing functionality of a computer program based on program code changes
US20150193280A1 (en) Method and device for monitoring api function scheduling in mobile terminal
CN109902446B (en) Method and apparatus for generating information prediction model
CN113507455B (en) Network security detection method and system based on big data
CN111198859A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN110851871A (en) File decompression method and device, electronic equipment and storage medium
CN111160805A (en) Emergency plan auxiliary information acquisition method, device and equipment
CN112084179B (en) Data processing method, device, equipment and storage medium
CN105095753B (en) Broadcast safe detection method, device
CN109240916B (en) Information output control method, information output control device and computer readable storage medium
CN110941632A (en) Database auditing method, device and equipment
CN110442439B (en) Task process processing method and device and computer equipment
CN112311755A (en) Industrial control protocol reverse analysis method and device
CN113869989B (en) Information processing method and device
CN111090623A (en) Data auditing method and device, electronic equipment and storage medium
CN110888791A (en) Log processing method, device, equipment and storage medium
CN113852835A (en) Live broadcast audio processing method and device, electronic equipment and storage medium
US11556649B2 (en) Methods and apparatus to facilitate malware detection using compressed data
CN109614137B (en) Software version control method, device, equipment and medium
CN111274104B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN109871361B (en) File uploading method and device, electronic equipment and readable storage medium
CN113111200A (en) Method and device for auditing picture file, electronic equipment and storage medium
CN112153148A (en) Message accumulation processing method and device based on message receiving end

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200228

RJ01 Rejection of invention patent application after publication