CN110704072A - Device and method for file decompression based on operating system and storage medium - Google Patents
Device and method for file decompression based on operating system and storage medium Download PDFInfo
- Publication number
- CN110704072A CN110704072A CN201910821089.0A CN201910821089A CN110704072A CN 110704072 A CN110704072 A CN 110704072A CN 201910821089 A CN201910821089 A CN 201910821089A CN 110704072 A CN110704072 A CN 110704072A
- Authority
- CN
- China
- Prior art keywords
- decompression
- file
- decompressed
- operating system
- decompressing
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to a communication technology, and discloses a device, a method and a storage medium for file decompression based on an operating system, wherein the method comprises the following steps: after a JDK package is preset and a JDK environment is set up, acquiring the type of a current operating system based on the JDK package, and judging whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system; if not, downloading a preset decompression tool packet in the current operating system by adopting a downloading mode corresponding to the type of the current operating system; after the downloading of a preset decompression tool package fails, acquiring a preset built-in decompression tool package for installation; and after the installation is finished, acquiring the file to be decompressed, and decompressing the file to be decompressed based on the installed decompression toolkit and a preset decompression mode. The invention can automatically install the decompression tool according to different operating system types, has simple and convenient operation, and has cross-platform property and stronger universality.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an apparatus and a method for performing file decompression based on an operating system, and a storage medium.
Background
Some of the existing operating systems have their decompression facilities, but some do not. If the operating system does not carry the decompression tool, the user is required to download and install the corresponding compression tool for file decompression. At present, all decompression tools in the market need to install installation files with different formats aiming at different operating systems, the downloading and installation operations of part of the decompression tools are relatively complicated, and the problems of version compatibility and the like exist. In view of this, it is a problem to be solved to provide a decompression tool with simple downloading and installation operations and strong versatility for different operating systems.
Disclosure of Invention
The invention aims to provide a device, a method and a storage medium for decompressing files based on an operating system, aiming at automatically installing a decompressing tool according to different operating system types, and having simple and convenient operation and strong universality.
In order to achieve the above object, the present invention provides an apparatus for decompressing a file based on an operating system, where the apparatus for decompressing a file based on an operating system includes a memory and a processor connected to the memory, the memory stores a decompressing program executable on the processor, and the decompressing program, when executed by the processor, implements the following steps:
after a Java language development kit is preset and an environment of the Java language development kit is established, acquiring the type of a current operating system based on the Java language development kit, and judging whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system;
if not, downloading a preset decompression tool package in the current operating system by adopting a downloading mode corresponding to the type of the current operating system;
after the predetermined decompression tool package fails to be downloaded, acquiring a built-in decompression tool package in advance for installation;
and after the installation is finished, acquiring a file to be decompressed, and decompressing the file to be decompressed based on the installed decompression toolkit and a preset decompression mode.
Preferably, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method specifically includes:
acquiring an output directory of a file to be decompressed;
in the process of decompressing, if the subfile in the file to be decompressed has a decompression error, capturing the subfile with the decompression error, copying the subfile with the decompression error into an error folder pre-established in an output directory, and deleting a source file corresponding to the subfile with the decompression error;
skipping the sub-file with the error and decompressing the next sub-file in the file to be decompressed, and outputting the sub-file which is successfully decompressed and the sub-file with the error in the folder with the error after the file to be decompressed is decompressed.
Preferably, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method further includes:
after the file to be decompressed is decompressed, traversing the successfully decompressed subfiles and analyzing whether compressed files exist in the successfully decompressed subfiles;
and if so, decompressing the subfiles which are the compressed files until all the compressed files in the files to be decompressed are decompressed.
Preferably, the decompression program, when executed by the processor, further implements the steps of:
when the Java language development toolkit is not preset, analyzing whether the environment of the Java language development toolkit is established in the current operating system or not;
and if not, downloading the Java language development kit and building the environment of the Java language development kit based on the Java language development kit.
In order to achieve the above object, the present invention further provides a method for decompressing a file based on an operating system, where the method for decompressing a file based on an operating system includes:
s1, after a Java language development kit is preset and the environment of the Java language development kit is established, acquiring the type of a current operating system based on the Java language development kit, and judging whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system;
s2, if not, downloading a preset decompression toolkit in the current operating system by adopting a downloading mode corresponding to the type of the current operating system;
s3, after the downloading of the preset decompression tool package fails, acquiring a built-in decompression tool package in advance for installation;
and S4, after the installation is completed, acquiring the file to be decompressed, and decompressing the file to be decompressed based on the installed decompression toolkit and a preset decompression mode.
Preferably, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method specifically includes:
acquiring an output directory of a file to be decompressed;
in the process of decompressing, if the subfile in the file to be decompressed has a decompression error, capturing the subfile with the decompression error, copying the subfile with the decompression error into an error folder pre-established in an output directory, and deleting a source file corresponding to the subfile with the decompression error;
skipping the sub-file with the error and decompressing the next sub-file in the file to be decompressed, and outputting the sub-file which is successfully decompressed and the sub-file with the error in the folder with the error after the file to be decompressed is decompressed.
Preferably, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method further includes:
after the file to be decompressed is decompressed, traversing the successfully decompressed subfiles and analyzing whether compressed files exist in the successfully decompressed subfiles;
and if so, decompressing the subfiles which are the compressed files until all the compressed files in the files to be decompressed are decompressed.
Preferably, before the step S1, the method further includes:
when the Java language development toolkit is not preset, analyzing whether the environment of the Java language development toolkit is established in the current operating system or not, and if not, downloading the Java language development toolkit and establishing the environment of the Java language development toolkit based on the Java language development toolkit.
Preferably, the pre-built decompression toolkit is the latest version of the decompression toolkit applicable to the type of the current operating system.
The present invention further provides a computer-readable storage medium, which stores a decompression program, and the decompression program, when executed by a processor, implements the steps of the method for file decompression based on an operating system as described above.
The invention has the beneficial effects that: the invention develops a decompression program with cross-platform property, firstly obtains the type of the current operating system, judges whether a decompression tool is installed or not by adopting a corresponding analysis mode according to the type of the current operating system, then downloads a decompression tool package by adopting a downloading mode corresponding to the type of the current operating system under the condition that the decompression tool is not installed in the current operating system, obtains a built-in decompression tool package for installation offline when online downloading fails, and finally decompresses based on the installed decompression tool package and a preset decompression mode after the installation is finished. The invention can automatically install the decompression tool according to different operating system types, has simple and convenient operation, and has cross-platform property and stronger universality.
Drawings
FIG. 1 is a diagram illustrating a hardware architecture of an apparatus for decompressing files based on an operating system according to an embodiment of the present invention;
FIG. 2 is a block diagram of an embodiment of the decompression routine of FIG. 1;
fig. 3 is a flowchart illustrating an embodiment of a method for decompressing a file based on an operating system according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Fig. 1 is a schematic diagram illustrating a hardware architecture of an apparatus for performing file decompression based on an operating system according to an embodiment of the present invention. The device 1 for decompressing files based on an operating system is a device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance. The device 1 for decompressing files based on an operating system may be a computer, or may be a single network server, a server group composed of a plurality of network servers, or a cloud composed of a large number of hosts or network servers based on cloud computing, where the cloud computing is one of distributed computing and is a super virtual computer composed of a group of loosely coupled computers.
In the present embodiment, the apparatus 1 for decompressing files based on an operating system may include, but is not limited to, a memory 11, a processor 12, and a network interface 13, which are communicatively connected to each other through a system bus, and the memory 11 stores a decompressing program 10 that can be executed on the processor 12. It is noted that fig. 1 only shows the operating system based device 1 for file decompression with components 11-13, but it is to be understood that not all shown components need to be implemented, and that more or less components may be implemented instead.
The storage 11 includes a memory and at least one type of readable storage medium. The memory provides a cache for the operation of the device 1 for performing file decompression based on the operating system; the readable storage medium may be a non-volatile storage medium such as flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the readable storage medium may be an internal storage unit of the apparatus 1 for file decompression based on an operating system, for example, a hard disk of the apparatus 1 for file decompression based on an operating system; in other embodiments, the non-volatile storage medium may also be an external storage device of the apparatus 1 for performing file decompression based on the operating system, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the apparatus 1 for performing file decompression based on the operating system. In this embodiment, the readable storage medium of the memory 11 is generally used for storing an operating system and various application software installed in the device 1 for performing file decompression based on the operating system, for example, program codes of the decompression program 10 in an embodiment of the present invention are stored. Further, the memory 11 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 12 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as the decompression program 10.
The network interface 13 may include a standard wireless network interface, a wired network interface, and the network interface 13 is generally used to establish a communication connection between the operating system based file decompression apparatus 1 and other electronic devices.
The decompression program 10 is stored in the memory 11 and includes at least one computer readable instruction stored in the memory 11, which is executable by the processor 12 to implement the method of the embodiments of the present application; and the at least one computer readable instruction may be divided into different logic blocks depending on the functions implemented by the respective portions.
In an embodiment, the decompression program 10 when executed by the processor 12 implements the following steps:
after a Java language development kit is preset and an environment of the Java language development kit is established, acquiring the type of a current operating system based on the Java language development kit, and judging whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system;
if not, downloading a preset decompression tool package in the current operating system by adopting a downloading mode corresponding to the type of the current operating system;
after the predetermined decompression tool package fails to be downloaded, acquiring a built-in decompression tool package in advance for installation;
and after the installation is finished, acquiring a file to be decompressed, and decompressing the file to be decompressed based on the installed decompression toolkit and a preset decompression mode.
Further, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method specifically includes:
acquiring an output directory of a file to be decompressed;
in the process of decompressing, if the subfile in the file to be decompressed has a decompression error, capturing the subfile with the decompression error, copying the subfile with the decompression error into an error folder pre-established in an output directory, and deleting a source file corresponding to the subfile with the decompression error;
skipping the sub-file with the error and decompressing the next sub-file in the file to be decompressed, and outputting the sub-file which is successfully decompressed and the sub-file with the error in the folder with the error after the file to be decompressed is decompressed.
Further, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method further includes:
after the file to be decompressed is decompressed, traversing the successfully decompressed subfiles and analyzing whether compressed files exist in the successfully decompressed subfiles;
and if so, decompressing the subfiles which are the compressed files until all the compressed files in the files to be decompressed are decompressed.
Further, when executed by the processor, the decompression program further performs the steps of:
when the Java language development toolkit is not preset, analyzing whether the environment of the Java language development toolkit is established in the current operating system or not;
and if not, downloading the Java language development kit and building the environment of the Java language development kit based on the Java language development kit.
Referring to fig. 2, a program block diagram of the decompression program 10 of fig. 1 is shown. The decompression program 10 is divided into a plurality of modules, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The modules referred to herein are referred to as a series of computer program instruction segments capable of performing specified functions.
The decompression program 10 may be divided into: a judging module 101, a downloading module 102, an installing module 103 and a decompressing module 104.
The judging module 101 is configured to, after a Java language development kit is preset and an environment of the Java language development kit is established, obtain a type of a current operating system based on the Java language development kit, and judge whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system;
the downloading module 102 is configured to, if not, download a predetermined decompression toolkit in the current operating system in a downloading manner corresponding to the type of the current operating system;
the installation module 103 is configured to obtain a preset built-in decompression toolkit for installation after the predetermined decompression toolkit fails to be downloaded;
the decompression module 104 is configured to obtain a file to be decompressed after the installation is completed, and decompress the file to be decompressed based on the installed decompression toolkit and a predetermined decompression manner.
For the detailed principle, refer to the following description of fig. 3 regarding the flow chart of the method.
As shown in fig. 3, fig. 3 is a flowchart illustrating an embodiment of a method for decompressing a file based on an operating system according to the present invention, where the following steps are implemented when a processor 13 of an apparatus 1 for decompressing a file based on an operating system executes a decompression program 10 stored in a memory 12:
step S1, after a Java language development kit is preset and the environment of the Java language development kit is established, acquiring the type of a current operating system based on the Java language development kit, and judging whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system;
in this embodiment, a Java Development ToolKit (JDK) may be pre-built in the device for decompressing files based on the operating system, and an environment of the Java Development ToolKit, that is, a JDK environment, is built based on the Java Development ToolKit.
Under the condition that the JDK environment is established, the type of the current operating system may be determined by calling a local method through a JAVA code, for example, the type of the current operating system is obtained through "String os name ═ system.
The types of the current operating systems include a Linux operating system, a Unix operating system, and a Windows operating system. On any type of operating system interface, the decompression program 10 may be distinguished by icons, and when the decompression program 10 is clicked and executed, subsequent operations may be automatically performed.
After the type of the current operating system is determined, whether a decompression tool is installed in the current operating system is judged according to an analysis mode corresponding to the type of the current operating system.
Under the condition that a JDK environment is established, in Linux and Unix operating systems, whether a decompression tool is installed or not can be judged through an analysis mode I (an execution command) or an analysis mode II (a local method is called to obtain the command from a JAVA code);
analysis mode 1-command rpm-qa | grep *** is executed to query *** whether a package is installed;
or execute the command yumlistingrolled | grep *** to list all installed packages, query *** whether a package is installed;
or execute command dpkg-l | grep *** to query *** whether the package is installed.
The above-mentioned "***" is the installation package of the decompression tool, and it is determined whether the decompression tool is installed by inquiring whether the installation package of the decompression tool is installed.
Analysis mode 2: the script for calling the local method is directly executed, the corresponding output stream is obtained from the JAVA code, information such as 'no effective decompression tool installation package' and the like can be prompted, and whether a decompression tool is installed or not can be directly judged.
In addition, under the condition that the JDK environment is not built, in Linux and Unix operating systems, whether a decompression tool is installed or not can be determined by the above-mentioned analysis method one (execution command).
In the Windows operating system, whether a JDK environment is established or not, whether a decompression tool is installed or not can be determined by means of command query, where the command is:
@echo off
Regquery
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVers
ion\Uninstall\|find/i"***">nul 2>nul
if% errorlevel% ═ 0 (echo:installed) else echo: not installed.
In another embodiment, in order to improve the flexibility of the application, the device for decompressing files based on the operating system may not have a Java language development kit built in advance, and in this case, the operation of downloading the Java language development kit from the network and building the JDK environment by itself may be executed by the decompressor, including: when a Java language development toolkit is not preset, firstly analyzing whether the environment of the Java language development toolkit is established in the current operating system or not; if the environment of the Java language development toolkit is not built in the current operating system, downloading the Java language development toolkit and building the environment of the Java language development toolkit based on the Java language development toolkit, and if the JDK environment is built in the current operating system, downloading the Java language development toolkit from a network is not needed.
Step S2, if not, downloading a predetermined decompression toolkit in the current operating system by adopting a downloading mode corresponding to the type of the current operating system;
under the condition that a JDK environment is established, if a decompression tool is not installed in a Linux or Unix operating system, a preset decompression tool package can be downloaded in a first downloading mode (in the form of an execution command) or a second downloading mode (by calling a local method to install the decompression tool);
the first downloading mode is that an instruction for installing a decompression tool is executed through a shell script, for example, Linux executes an 'lsudoapt-getistall ***' command through the shell script, Unix executes an 'lsudoapt-getistall ***' command through the shell script, and after the command is executed, a preset decompression tool package is downloaded;
and a second downloading mode: directly calling a local method to install a decompression tool, wherein the local method comprises the following steps: proceschild ═ runtime.
In addition, under the condition that the JDK environment is not built, in Linux and Unix operating systems, a predetermined decompression toolkit may be downloaded in the above-described first downloading manner (execution command).
In the Windows operating system, the same as the second downloading method, a local method is directly called to install the decompression toolkit, and the local method is as follows: proceschild ═ runtime.
In this embodiment, the predetermined decompression toolkit is the latest version of the decompression toolkit applicable to the type of the current operating system.
Furthermore, if a decompression tool is already installed in the current operating system, the installed decompression tool can be used directly.
Step S3, after the downloading of the preset decompression tool package fails, acquiring a built-in decompression tool package in advance for installation;
wherein, in the process of downloading the predetermined decompression toolkit, if the online downloading is successful, the installation is directly carried out;
if the online downloading fails due to abnormal conditions such as network and the like, a built-in decompression toolkit corresponding to the type of the current operating system is acquired in advance, and then the decompression toolkit is installed offline.
According to the embodiment, because the decompression tool packages corresponding to the types of the operating systems are pre-built as emergency schemes, the pre-built decompression tool packages can be used off line when online downloading fails, and the application flexibility is improved.
Step S4, after the installation is completed, the file to be decompressed is obtained, and the file to be decompressed is decompressed based on the installed decompression toolkit and the predetermined decompression method.
After the decompression toolkit is installed, a user selects a file to be decompressed, and then the installed decompression tool is used for decompressing the file to be decompressed.
In an embodiment, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method specifically includes:
acquiring an output directory of a file to be decompressed;
in the process of decompressing, if the subfile in the file to be decompressed has a decompression error, capturing the subfile with the decompression error, copying the subfile with the decompression error into an error folder pre-established in an output directory, and deleting a source file corresponding to the subfile with the decompression error;
skipping the sub-file with the error and decompressing the next sub-file in the file to be decompressed, and outputting the sub-file which is successfully decompressed and the sub-file with the error in the folder with the error after the file to be decompressed is decompressed.
In the prior art, if an error file is encountered during decompression, the file needs to be reprocessed to continue to be compressed and uploaded, and the decompression operation is stopped. In the process of decompressing the file to be decompressed by using the installed decompression toolkit and the predetermined decompression mode, the subfile with the error decompression and the subfile with the successful decompression can be separated and output together, so that the subsequent judgment and processing of the subfile with the error decompression can be conveniently performed, the subfile with the error decompression can be skipped over, and the next subfile can be decompressed, thereby reducing the user operation to the maximum extent.
In another embodiment, on the basis of the foregoing embodiment, the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression manner further includes:
after the file to be decompressed is decompressed, traversing the successfully decompressed subfiles and analyzing whether compressed files exist in the successfully decompressed subfiles;
and if so, decompressing the subfiles which are the compressed files until all the compressed files in the files to be decompressed are decompressed.
In the prior art, a decompression tool often can only decompress a layer of file, and when the sub-file obtained by decompression still contains a compressed file, the sub-file cannot be further decompressed. In this embodiment, after the file to be decompressed is decompressed once, whether the compressed file exists in the subfile can be continuously analyzed, so that all the compressed files in the file to be decompressed can be decompressed, and the problem that all the compressed packets in the file to be decompressed cannot be recursively decompressed by a conventional decompression tool is solved.
Compared with the prior art, the invention develops a decompression program with cross-platform property, firstly obtains the type of the current operating system, judges whether a decompression tool is installed or not by adopting a corresponding analysis mode according to the type of the current operating system, then downloads the decompression tool package by adopting a downloading mode corresponding to the type of the current operating system under the condition that the decompression tool is not installed in the current operating system, obtains a built-in decompression tool package for installation by off-line when the on-line downloading fails, and finally decompresses based on the installed decompression tool package and a preset decompression mode after the installation is finished. The invention can automatically install the decompression tool according to different operating system types, has simple and convenient operation, and has cross-platform property and stronger universality.
Furthermore, the embodiment of the present invention also provides a computer-readable storage medium, which may be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a USB memory, and the like. The computer-readable storage medium includes a decompression program, and the decompression program implements the functions when executed by the processor, please refer to the description of fig. 3, which is not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method 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, apparatus, article, or method.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. An apparatus for decompressing a file based on an operating system, the apparatus comprising a memory and a processor connected to the memory, the memory storing a decompressing program executable on the processor, the decompressing program when executed by the processor implementing the following steps:
after a Java language development kit is preset and an environment of the Java language development kit is established, acquiring the type of a current operating system based on the Java language development kit, and judging whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system;
if not, downloading a preset decompression tool package in the current operating system by adopting a downloading mode corresponding to the type of the current operating system;
after the predetermined decompression tool package fails to be downloaded, acquiring a built-in decompression tool package in advance for installation;
and after the installation is finished, acquiring a file to be decompressed, and decompressing the file to be decompressed based on the installed decompression toolkit and a preset decompression mode.
2. The apparatus for decompressing files based on an operating system according to claim 1, wherein the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method specifically comprises:
acquiring an output directory of a file to be decompressed;
in the process of decompressing, if the subfile in the file to be decompressed has a decompression error, capturing the subfile with the decompression error, copying the subfile with the decompression error into an error folder pre-established in an output directory, and deleting a source file corresponding to the subfile with the decompression error;
skipping the sub-file with the error and decompressing the next sub-file in the file to be decompressed, and outputting the sub-file which is successfully decompressed and the sub-file with the error in the folder with the error after the file to be decompressed is decompressed.
3. The os-based file decompression apparatus according to claim 2, wherein the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method further comprises:
after the file to be decompressed is decompressed, traversing the successfully decompressed subfiles and analyzing whether compressed files exist in the successfully decompressed subfiles;
and if so, decompressing the subfiles which are the compressed files until all the compressed files in the files to be decompressed are decompressed.
4. The operating system-based file decompression device according to any one of claims 1 to 3, wherein the decompression program, when executed by the processor, further implements the steps of:
when the Java language development toolkit is not preset, analyzing whether the environment of the Java language development toolkit is established in the current operating system or not;
and if not, downloading the Java language development kit and building the environment of the Java language development kit based on the Java language development kit.
5. A method for decompressing a file based on an operating system is characterized in that the method for decompressing the file based on the operating system comprises the following steps:
s1, after a Java language development kit is preset and the environment of the Java language development kit is established, acquiring the type of a current operating system based on the Java language development kit, and judging whether a decompression tool is installed in the current operating system according to an analysis mode corresponding to the type of the current operating system;
s2, if not, downloading a preset decompression toolkit in the current operating system by adopting a downloading mode corresponding to the type of the current operating system;
s3, after the downloading of the preset decompression tool package fails, acquiring a built-in decompression tool package in advance for installation;
and S4, after the installation is completed, acquiring the file to be decompressed, and decompressing the file to be decompressed based on the installed decompression toolkit and a preset decompression mode.
6. The method according to claim 5, wherein the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method specifically comprises:
acquiring an output directory of a file to be decompressed;
in the process of decompressing, if the subfile in the file to be decompressed has a decompression error, capturing the subfile with the decompression error, copying the subfile with the decompression error into an error folder pre-established in an output directory, and deleting a source file corresponding to the subfile with the decompression error;
skipping the sub-file with the error and decompressing the next sub-file in the file to be decompressed, and outputting the sub-file which is successfully decompressed and the sub-file with the error in the folder with the error after the file to be decompressed is decompressed.
7. The method according to claim 6, wherein the step of decompressing the file to be decompressed based on the installed decompression toolkit and a predetermined decompression method further comprises:
after the file to be decompressed is decompressed, traversing the successfully decompressed subfiles and analyzing whether compressed files exist in the successfully decompressed subfiles;
and if so, decompressing the subfiles which are the compressed files until all the compressed files in the files to be decompressed are decompressed.
8. The os-based file decompression method according to any one of claims 5 to 7, wherein before the step S1, the method further comprises:
when the Java language development toolkit is not preset, analyzing whether the environment of the Java language development toolkit is established in the current operating system or not, and if not, downloading the Java language development toolkit and establishing the environment of the Java language development toolkit based on the Java language development toolkit.
9. The method for file decompression based on the operating system according to any one of claims 5 to 7, wherein the pre-built decompression toolkit is a latest version of the decompression toolkit applicable to the type of the current operating system.
10. A computer-readable storage medium, having a decompression program stored thereon, which, when executed by a processor, implements the steps of the operating system-based file decompression method according to any one of claims 5 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910821089.0A CN110704072A (en) | 2019-08-30 | 2019-08-30 | Device and method for file decompression based on operating system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910821089.0A CN110704072A (en) | 2019-08-30 | 2019-08-30 | Device and method for file decompression based on operating system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110704072A true CN110704072A (en) | 2020-01-17 |
Family
ID=69194006
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910821089.0A Pending CN110704072A (en) | 2019-08-30 | 2019-08-30 | Device and method for file decompression based on operating system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110704072A (en) |
-
2019
- 2019-08-30 CN CN201910821089.0A patent/CN110704072A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108108181B (en) | Function updating method and device of application program and computer readable storage medium | |
CN108847950B (en) | Electronic device, cloud system software automatic deployment method and storage medium | |
US10599413B2 (en) | Method and device for identifying file | |
EP3812890A1 (en) | Software update agent apparatus and patch method using same | |
CN105867947A (en) | Data processing method and device after upgrades of preset applications | |
JP2001147826A (en) | Device and method for loading object from hash index of primary memory | |
WO2017157178A1 (en) | Mobile terminal application update method and device | |
US11775288B2 (en) | Method and apparatus for generating difference between old and new versions of data for updating software | |
WO2020177429A1 (en) | Method and apparatus for embedding codes in application, and electronic device | |
CN102968321A (en) | Application program installation device and application program installation method | |
CN114296835B (en) | Application program starting method and device | |
CN111552517B (en) | Application program starting method and device, electronic equipment and computer storage medium | |
CN106547602B (en) | Method for manufacturing operating system mirror image suitable for iSCSI protocol remote wireless loading | |
CN115543429A (en) | Project environment building method, electronic equipment and computer readable storage medium | |
WO2018006884A1 (en) | Method, device and user terminal for software installation | |
CN111045698A (en) | Redundant picture deleting method and device, electronic equipment and storage medium | |
CN109032617B (en) | Control method and control device for automatically deleting installation package | |
EP3812916A1 (en) | Data structuring method for difference between old and new data, and device therefor | |
CN110704072A (en) | Device and method for file decompression based on operating system and storage medium | |
CN102902564B (en) | Method and the device of patch are installed | |
CN109002710B (en) | Detection method, detection device and computer readable storage medium | |
CN111475220B (en) | Cold start method and device, electronic equipment and computer storage medium | |
CN114296747A (en) | Installation method and device of software installation package | |
CN113515299A (en) | Software development kit SDK hot upgrading method, device, equipment and storage medium | |
CN115185553A (en) | Method for updating device firmware of user and related 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 |