CN106681720A - Compression method and device and decompression method and device for installation packages - Google Patents

Compression method and device and decompression method and device for installation packages Download PDF

Info

Publication number
CN106681720A
CN106681720A CN201611208663.8A CN201611208663A CN106681720A CN 106681720 A CN106681720 A CN 106681720A CN 201611208663 A CN201611208663 A CN 201611208663A CN 106681720 A CN106681720 A CN 106681720A
Authority
CN
China
Prior art keywords
installation kit
file
benchmark
increment
default
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
CN201611208663.8A
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.)
Guang Heng Hengyu (beijing) Technology Co Ltd
Original Assignee
Guang Heng Hengyu (beijing) 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 Guang Heng Hengyu (beijing) Technology Co Ltd filed Critical Guang Heng Hengyu (beijing) Technology Co Ltd
Priority to CN201611208663.8A priority Critical patent/CN106681720A/en
Publication of CN106681720A publication Critical patent/CN106681720A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a compression method and device and a decompression method and device for installation packages, and relates to the technical field of information. The problems that in the prior art, the compression efficiency of a batch of similar installation packages is low, and the generating compression rate of compression files is high are solved. The compression method includes the steps that standard installation packages are selected from the batch of similar installation packages; informative abstract files of the standard installation packages and informative abstract files of increment installation packages are analyzed respectively and compared, and the increment installation packages are the installation packages which are similar to the standard installation packages but are different from the standard installation packages in the batch of similar installation packages; according to the comparison result, difference files of the increment installation packages relative to the standard installation packages are sought, and a preset difference list is updated according to the difference files and used for recording the difference files between the increment installation packages and the standard installation packages; the standard installation packages and the preset difference list are compressed, and target compression files are obtained. The compression method and device and the decompression method and device for the installation packages are used for compressing and decompressing the installation packages.

Description

Packet compression, decompressing method and device are installed
Technical field
It is more particularly to a kind of that packet compression, decompressing method and device are installed the present invention relates to areas of information technology.
Background technology
With continuing to develop for information technology, various application programs emerge in an endless stream, used as the application city of various application programs Field is also various, and for more preferable popularization and application program, application developers would generally be by the installation of application program Bag is published in different application markets.For convenience the download in subsequent statistical different application market, user activity, use Custom etc., application developers generally need to generate different installation kits for different application market, are logical to distinguish user Cross the application program which application market is downloaded.Because the different installation kits for different application market only have a small amount of file not Together, therefore in each application issued, all can the similar installation kit of Mass production.Under normal circumstances, research and development engineer obtains , it is necessary to the similar installation kit of batch is transferred into successive projects Shi Jinhang treatment after to the similar installation kit of batch, test is such as passed to Engineer carries out installation kit test.Installation kit similar with transmission batch is stored for convenience, after the similar installation kit of generation batch, Generally need to be compressed the similar installation kit of batch, then decompressed again when in use.
At present, when similar installation packet compression in batches is carried out, generally all installation kits in the similar installation kit of batch are entered Row compression.However, the installation kit quantity of the similar installation kit of batch is larger, if being compressed to all installation kits, compression can be caused Time is more long, causes the compression efficiency of the similar installation kit of batch relatively low.Meanwhile, the compression ratio for generating compressed file is higher.
The content of the invention
In view of this, the present invention provides a kind of installation packet compression, decompressing method and device, and main purpose is to reduce Similar installation kit compression time in batches such that it is able to the compression efficiency of the similar installation kit of lifting batch.Meanwhile, it is capable to reduce compression The compression ratio of file.
According to one aspect of the invention, there is provided a kind of installation kit compression method, including:
Benchmark installation kit is chosen from the similar installation kit of batch;
The informative abstract file in the benchmark installation kit and increment installation kit is parsed respectively and is contrasted, the increasing Amount installation kit is similar but different from benchmark installation kit installation kit in the similar installation kit of the batch;
Differential file of the increment installation kit relative to the benchmark installation kit is searched according to comparing result, and according to institute State differential file and update default diff list, the default diff list is used to record the increment installation kit relative to the base Differential file between quasi- installation kit;
The benchmark installation kit and the default diff list are compressed, targeted compression file is obtained.
Preferably, described information Summary file is used to record the informative abstract of file in installation kit.
Preferably, the differential file includes the first differential file, newly-increased file or deletes file, and first difference is literary Part is that identification information in the increment installation kit is identical with the identification information in the benchmark installation kit but informative abstract Different files.
Preferably, the differential file is the first differential file, described to search the increment installation kit according to comparing result Differential file relative to the benchmark installation kit includes:
If comparing result be identification information of first file in the increment installation kit with the benchmark installation kit Identification information it is identical but informative abstract is different, it is determined that first file is first differential file;
It is described to be included according to the default diff list of differential file renewal:
According to first differential file and comparison in difference algorithm, generate first differential file and installed with the benchmark The variance data of respective file in bag;
The variance data is added in default diff list.
Preferably, the differential file is newly-increased file, described relative according to the comparing result lookup increment installation kit Include in the differential file of the benchmark installation kit:
If comparing result exists for the second file in the increment installation kit, but does not exist in the benchmark installation kit, then Determine that second file is the newly-increased file;
It is described to be included according to the default diff list of differential file renewal:
The identification information of the newly-increased file and the newly-increased file are added to the default diff list.
Preferably, the differential file is described relative according to the comparing result lookup increment installation kit to delete file Include in the differential file of the benchmark installation kit:
If comparing result does not exist for the 3rd file in the increment installation kit, but exists in the benchmark installation kit, then Determine that the 3rd file is the deletion file;
It is described to be included according to the default diff list of differential file renewal:
The identification information of the deletion file is added to the default diff list.
According to another aspect of the invention, there is provided a kind of installation kit decompressing method, including:
Loaded targets compressed file, and the benchmark peace extruded in the similar installation kit of batch is solved from the targeted compression file Dress bag and default diff list, the default diff list are used for difference of the recording increment installation kit relative to the benchmark installation kit Different article part, the increment installation kit is similar but different from benchmark installation kit installation in the similar installation kit of the batch Bag;
According to the default diff list, differential file of the increment installation kit relative to the benchmark installation kit is obtained And same file;
The differential file and the same file are added to target decompressing files, the increment installation kit is obtained.
Preferably, the differential file includes the first differential file, newly-increased file or deletes file, and first difference is literary Part is that identification information in the increment installation kit is identical with the identification information in the benchmark installation kit but informative abstract Different files.
Preferably, the differential file is the first differential file, and the default diff list is poor for recording described first Different article part relative to respective file in the benchmark installation kit variance data, it is described according to the default diff list, obtain The increment installation kit includes relative to the differential file of the benchmark installation kit:
Variance data and comparison in difference algorithm according to the default diff list, generate the first difference text Part, and obtain the compressed file of the same file;
It is described the differential file and the same file are added to target decompressing files to include:
First differential file is compressed treatment;
The compressed file of the compressed file of first differential file and the same file is added to target decompression text Part.
Preferably, the differential file is newly-increased file, and the default diff list is used to record the increment installation kit It is described according to the default diff list relative to the newly-increased file of the benchmark installation kit, obtain the increment installation kit phase Differential file for the benchmark installation kit includes:
According to the default diff list, newly-increased text of the increment installation kit relative to the benchmark installation kit is obtained Part;
It is described the differential file is added to target decompressing files to include:
The newly-increased file is compressed treatment;
The compressed file of the newly-increased file is added to target decompressing files.
Preferably, the differential file is to delete file, and it is relative that the default diff list is used for the increment installation kit It is described according to the default diff list in the identification information of the deletion file of the benchmark installation kit, obtain the increment peace Differential file between dress bag and the benchmark installation kit includes:
The identification information of the deletion file in the default diff list, obtains the increment installation kit relative to institute State the deletion file of benchmark installation kit;
It is described the differential file is added to target decompressing files to include:
The operation that deletion file is added to target decompressing files is not performed.
According to another aspect of the present invention, there is provided a kind of installation kit compression set, including:
Unit is chosen, for choosing benchmark installation kit from the similar installation kit of batch;
Resolution unit, in the benchmark installation kit and increment installation kit that parse the selection unit selection respectively Informative abstract file, the increment installation kit be the similar installation kit of the batch in but difference similar to the benchmark installation kit Installation kit;
Comparison unit, plucks for the information in the benchmark installation kit and increment installation kit that are parsed to the resolution unit File is wanted to be contrasted;
Searching unit, the comparing result for being obtained according to the comparison unit searches the increment installation kit relative to institute State the differential file of benchmark installation kit;
Updating block, the differential file for being searched according to the searching unit updates default diff list, described Default diff list is used to record the increment installation kit relative to the differential file between the benchmark installation kit;
Compression unit, it is pre- for update the benchmark installation kit and the updating block of the selection unit selection If diff list is compressed, targeted compression file is obtained.
Preferably, described information Summary file is used to record the informative abstract of file in installation kit.
Preferably, the differential file includes the first differential file, newly-increased file or deletes file, and first difference is literary Part is that identification information in the increment installation kit is identical with the identification information in the benchmark installation kit but informative abstract Different files.
Preferably, the differential file is the first differential file,
The searching unit includes:
First determining module, if for comparing result be identification information of first file in the increment installation kit with Identification information in the benchmark installation kit is identical but informative abstract is different, it is determined that first file is first difference File;
The updating block includes:
First generation module, for according to first differential file and comparison in difference algorithm, generating first difference The variance data of file and respective file in the benchmark installation kit;
First add module, for the variance data that the generation module is generated to be added in default diff list.
Preferably, the differential file is newly-increased file, and the searching unit includes:
Second determining module, if for comparing result for the second file exists in the increment installation kit, but in the base Quasi- installation kit does not exist, it is determined that second file is the newly-increased file;
The updating block includes:
Second add module, it is described default for the identification information of the newly-increased file and the newly-increased file to be added to Diff list.
Preferably, to delete file, the searching unit includes the differential file:
3rd determining module, if for comparing result for the 3rd file does not exist in the increment installation kit, but described Benchmark installation kit is present, it is determined that the 3rd file is the deletion file;
The updating block includes:
3rd add module, for the identification information of the deletion file to be added into the default diff list.
According to another aspect of the present invention, there is provided a kind of installation kit decompression device, including:
Loading unit, for loaded targets compressed file;
Decompression units, for being solved in the targeted compression file that is loaded from the loading unit and extruding the similar installation kit of batch in Benchmark installation kit and default diff list, the default diff list pacifies for recording increment installation kit relative to the benchmark The differential file of bag is filled, the increment installation kit is but difference similar to the benchmark installation kit in the similar installation kit of the batch Installation kit;
Acquiring unit, for the default diff list decompressed according to the decompression units, obtains the increment installation kit phase For the differential file and same file of the benchmark installation kit;
Adding device, differential file and the same file for the acquiring unit to be obtained are added to target decompression File, obtains the increment installation kit.
Preferably, the differential file includes the first differential file, newly-increased file or deletes file, and first difference is literary Part is that identification information in the increment installation kit is identical with the identification information in the benchmark installation kit but informative abstract Different files.
Preferably, the differential file is the first differential file, and the default diff list is poor for recording described first Different article part relative to respective file in the benchmark installation kit variance data,
The acquiring unit includes:
Second generation module, it is raw for variance data and comparison in difference algorithm according to the default diff list Into first differential file;
First acquisition module, the compressed file for obtaining the same file;
The adding device includes:
First compression module, for first differential file to be compressed into treatment;
4th add module, for the compressed file of the first differential file that compresses first compression module and described The compressed file of same file is added to target decompressing files.
Preferably, the differential file is newly-increased file, and the default diff list is used to record the increment installation kit Relative to the newly-increased file of the benchmark installation kit,
The acquiring unit includes:
Second acquisition module, for according to the default diff list, obtaining the increment installation kit relative to the base The newly-increased file of quasi- installation kit;
The adding device includes:
Second compression module, for the newly-increased file to be compressed into treatment;
5th add module, the compressed file of the newly-increased file for second compression module to be compressed is added to target Decompressing files.
Preferably, the differential file is to delete file, and it is relative that the default diff list is used for the increment installation kit In the identification information of the deletion file of the benchmark installation kit,
The acquiring unit includes:
3rd acquisition module, for the identification information of the deletion file in the default diff list, obtains described Deletion file of the increment installation kit relative to the benchmark installation kit;
The adding device includes:
6th add module, deletion file is added to the operation of target decompressing files for not performing.
By above-mentioned technical proposal, the technical scheme that the present invention is provided at least has following advantages:
Packet compression, decompressing method and device are installed the invention provides one kind, and at present in the similar installation kit of batch All installation kits are compressed to be compared, and the present invention can choose benchmark installation kit from the similar installation kit of batch, and by respectively Parse the informative abstract file in the benchmark installation kit and increment installation kit and contrasted, the increment can be found out Differential file in installation kit and benchmark installation kit, updates default diff list and arranges default difference by the differential file Table and benchmark installation kit are compressed, and obtain targeted compression file, realize only compression benchmark installation kit and increment installation kit With the differential file in benchmark installation kit, just can complete the compression of similar installation kit in batches, it is to avoid to similar installation kit in batches The repeated compression of middle same file, reduces the similar data volume for installing packet compression of batch, so as to reduce the similar installation of batch The packet compression time, and then the compression efficiency of the similar installation kit of batch is improved, while reducing the compression ratio of generation compressed file.
Described above is only the general introduction of technical solution of the present invention, in order to better understand technological means of the invention, And can be practiced according to the content of specification, and in order to allow the above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by specific embodiment of the invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows a kind of installation kit compression method flow chart provided in an embodiment of the present invention;
Fig. 2 shows a kind of similar installation kit compression method flow chart of batch provided in an embodiment of the present invention;
Fig. 3 shows another installation kit compression method flow chart provided in an embodiment of the present invention;
Fig. 4 shows the similar method flow diagram for installing packet compression of another batch provided in an embodiment of the present invention;
Fig. 5 shows a kind of installation kit decompressing method flow chart provided in an embodiment of the present invention;
Fig. 6 shows a kind of similar installation kit decompressing method flow chart of batch provided in an embodiment of the present invention;
Fig. 7 shows another installation kit decompressing method flow chart provided in an embodiment of the present invention;
Fig. 8 shows the similar installation kit decompressing method flow chart of another batch provided in an embodiment of the present invention;
Fig. 9 shows a kind of installation kit compression set structural representation provided in an embodiment of the present invention;
Figure 10 shows another installation kit compression set structural representation provided in an embodiment of the present invention;
Figure 11 shows a kind of installation kit decompression device structural representation provided in an embodiment of the present invention;
Figure 12 shows another installation kit decompression device structural representation provided in an embodiment of the present invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.Conversely, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
A kind of installation kit compression method is the embodiment of the invention provides, as shown in figure 1, methods described includes:
101st, benchmark installation kit is chosen from the similar installation kit of batch.
Wherein, the file needed for installing can be typically included in installation kit.For the similar installation kit of the batch, at this Some file is identical each other in class installation kit.Described benchmark installation kit can be understood as being answered for different With platform or to realize that different needs can generate the maternal installation kit of other different installation kits.
Wherein, a large amount of identical files, this part text are contained between each installation kit in the similar installation kit of batch Part is generally installation kit in the necessary file needed for installation process, is that installation kit there must be to realize peace in installation process The file of dress.In addition, some extra files are included in installation kit, the extra file in this part is generally for installation kit In the configuration file of different application platforms, the file such as some inessential plug-in units of optimization file, and correlation.
For example, there is pure version by taking the installation kit of the security guard of Qihoo 360 as an example, in general networking (i.e. only comprising 360 peaces The installation kit of full bodyguard's correlation installation file) (to remove and install literary comprising 360 security guards are related to the full version comprising binding plug-in unit Outside part, the installation kit of installation file also comprising such as 360 mobile phone assistant or other 360 security components etc.) two kinds of installation kits.Its In, 360 pure editions described installation kits can be regarded as the benchmark installation kit in such 360 installation kit.
102nd, the informative abstract file in the benchmark installation kit and increment installation kit is parsed respectively and is contrasted.
Wherein, increment installation kit is similar but different from benchmark installation kit installation in the similar installation kit of the batch Bag.
As described in step 101, benchmark installation kit can be understood as different application platforms or to realize that different needs can Generate the maternal installation kit of other different installation kits.Correspondence benchmark installation kit, increment installation kit can be understood as being installed in benchmark Partial document is modified, adds or deleted on the basis of bag to realize more functions, or for different application market and User and the installation kit that generates.
In this step, parsed with informative abstract file in increment installation kit by benchmark installation kit, and will solution The informative abstract content that analysis is obtained is contrasted.By comparing result, can compare and state benchmark installation kit with increment installation The difference of file in bag.
For example, by taking APK installation kits as an example.Jar wherein after Android installation kit (Android Package, APK) and signature File format.Installed by being performed in by the way that APK file is passed directly into Android simulator or Android phone.If described When the installation kit for carrying out informative abstract file contrast is APK class installation kits, then in this step, it is necessary to the information for being parsed is plucked It is then MANIFEST.MF files to want file.Can deposit treated through SHA-1 message digest algorithms in wherein MANIFEST.MF Informative abstract, the corresponding SHA-1 values of different files are different.The different text that specifically mode of contrast can be in informative abstract Part title and the corresponding SHA-1 values of file are contrasted:If benchmark APK informative abstracts and file in increment APK informative abstracts Name and file SHA-1 values are identical, then illustrate that the filename respective file is in benchmark APK installation kits and increment APK installation kits Same file;If benchmark APK informative abstracts are same from file famous prime minister in increment APK informative abstracts and file SHA-1 values are different, say The corresponding file file described in increment APK installation kits of bright this title carried out modification;If not having in benchmark APK informative abstracts Have, and the file name contained in increment APK informative abstracts, then illustrate there is no the corresponding file of the title in benchmark APK; If containing in benchmark APK informative abstracts, and the title not having in increment APK informative abstracts, then illustrate that described title is corresponding File does not exist in increment APK installation kits.
103rd, differential file of the increment installation kit relative to the benchmark installation kit, and root are searched according to comparing result Default diff list is updated according to the differential file.
Wherein, presetting diff list is used to record the increment installation kit relative to the difference between the benchmark installation kit File.
After being contrasted to the clip Text in informative abstract file in abovementioned steps 102, the information that can obtain is plucked The difference section between content is wanted, the difference section is including the increase and decrease of file, the change of file etc. in the difference of different modes Hold.Because informative abstract file is the log file of All Files in the installation kit, therefore can be by currently available letter The difference of clip Text is ceased, the corresponding installation package file of the difference section is inquired about, and the differential file that will be inquired For the renewal of the default diff list.
Differential file title, the corresponding difference content of file name, difference can be included in wherein default diff list The related datas such as the quantity of file.Specifically the form of diff list, content and item number can be had according to actual needs The setting of body, does not do specific restriction herein, but selected form and item number should meet can comprising all of differential file and Its corresponding difference mode.
104th, the benchmark installation kit and the default diff list are compressed, obtain targeted compression file.
Wherein, the compress mode of file can be ZIP, RAR, 7Z, GZ and BZ2 etc..Involved by the compression process of the file And two important indicators include:Compression ratio and compression time, i.e., different compress mode have different compression ratio and compressions Time.Compression ratio can be the ratio value of the data volume of the data volume of file and compression preceding document after compressing, and usual compression ratio is got over It is small, illustrate that the data volume after compression is smaller, more save disk space;Compression ratio is bigger, illustrates that the file data amount after compression is got over Greatly, disk space is more taken.For the embodiment of the present invention, by only compressing benchmark installation kit and the default diff list, subtract The data volume of compressed file is lacked, has reduced compression ratio, so as to save disk space.
Specifically, default diff list is updated by abovementioned steps 103 in this step, after being updated Diff list, and corresponding differential file is obtained by the diff list after the renewal.Then by corresponding differential file and Benchmark installation kit is compressed, and obtains the compressed file of increment installation kit, i.e. targeted compression file.
It should be noted that after the operation for carrying out this step, in addition it is also necessary to judge whether to need to proceed installation kit Squeeze operation:If so, then can be with the step described in repeat step 102 to 104 after this step is carried out;If it is not, can then stop Operation.Specific implementation process, can be according to Fig. 2.
A kind of installation kit compression method provided in an embodiment of the present invention, and at present to all peaces in the similar installation kit of batch Dress bag is compressed to be compared, and the present invention can choose benchmark installation kit from the similar installation kit of batch, and by parsing respectively Informative abstract file in the benchmark installation kit and increment installation kit is simultaneously contrasted, and can find out the increment installation kit With the differential file in benchmark installation kit, default diff list is updated and by default diff list and base by the differential file Quasi- installation kit is compressed, and obtains targeted compression file, realizes only compression benchmark installation kit and increment installation kit and benchmark Differential file in installation kit, just can complete the compression of similar installation kit in batches, it is to avoid to identical in similar installation kit in batches The repeated compression of file, reduces the similar data volume for installing packet compression of batch, so as to reduce the similar installation packet compression of batch Time, and then the compression efficiency of the similar installation kit of batch is improved, while reducing the compression ratio of generation compressed file.
Another installation kit compression method is the embodiment of the invention provides, as shown in figure 3, methods described includes:
201st, benchmark installation kit is chosen from the similar installation kit of batch.
Wherein, the similar installation kit of the batch can be understood as on the basis of certain installation kit, carry out partial document addition, The installation kit generated after deleting or being modified to which part file.Between such installation kit most of file it is identical and Small part file is different, or small part file has increase and decrease.Such installation kit can be understood as similar installation kit.And certain described Installation kit be then appreciated that on the basis of installation kit.The specific similar installation kit enters above step with the description of benchmark installation kit Described in 61, extra repeating is not done herein.
202nd, the informative abstract file in the benchmark installation kit and increment installation kit is parsed respectively and is contrasted.
Wherein, the increment installation kit is similar but different from the benchmark installation kit in the similar installation kit of the batch Installation kit.
Described information Summary file is used to record the informative abstract of file in installation kit.Wherein, due to benchmark installation kit with File included in increment installation kit is different, and all files of corresponding installation kit are recorded in informative abstract file.Thus Understand, the informative abstract of the file in different installation kits causes its correspondence due to file difference included in installation kit Informative abstract content be also different.Therefore, can be by its informative abstract in the case that file is unknown in the installation kit File is contrasted and then is learnt the contrast situation of file in the installation kit.
Identical with the increment installation kit described in step 202, specific increment installation kit can be regarded as to be installed in benchmark Modified on package base the installation kit for obtaining.Wherein it should be noted that because the species of installation kit is different, then described letter Breath Summary file is also different.
The process of specific contrast, mainly the file identification in informative abstract and specific clip Text are carried out Contrast.For example, by taking APK installation kits as an example, the informative abstract file wherein corresponding to APK installation kits is MANIFEST.MF files. In MANIFEST.MF, all files informative abstract comprising APK installation kits.Wherein, informative abstract is typically by SHA-1 information Digest algorithm treatment generation, each informative abstract of file all includes a corresponding SHA-1 value.According to this SHA-1 value Contrast, it can be determined that whether current corresponding file carried out modification, this SHA-1 value is then the specific summary described in this step Content, and the title of each informative abstract can be understood as the file identification in this step.Specifically, in current information summary Certain informative abstract file in file is in the case of filename identical:If SHA-1 values are different, illustrate that corresponding file enters Went modification;If SHA-1 values are identical, illustrate that corresponding file does not change.Therefore, in this example can be by sentencing File name and the corresponding SHA-1 values of title are that can determine whether what the file in two APK installation kits has poor in disconnected informative abstract Different, such as the increase of file, the deletion of file or file carried out modification.
203rd, differential file of the increment installation kit relative to the benchmark installation kit, and root are searched according to comparing result Default diff list is updated according to the differential file.
Wherein, presetting diff list is used to record the increment installation kit relative to the difference between the benchmark installation kit File.The differential file includes the first differential file, newly-increased file or deletes file, and the first differential file is in the increasing Identification information in amount installation kit and the file that identification information is identical but informative abstract is different in the benchmark installation kit.
If described to search the increment according to comparing result specifically, the differential file can be the first differential file Installation kit relative to the benchmark installation kit differential file the step of be specifically as follows:If comparing result is the first file in institute State that identification information in increment installation kit is identical from the identification information in the benchmark installation kit but informative abstract is different, then really Fixed first file is first differential file.It is described that the step of presetting diff list tool is updated according to the differential file Body can include:According to first differential file and comparison in difference algorithm, first differential file and the benchmark are generated The variance data of respective file in installation kit;The variance data is added in default diff list.For example, described information is plucked File is wanted for MANIFEST.MF files, what is deposited in MANIFEST.MF is the SHA-1 values of each file in apk, if benchmark APK Installation kit is installation kit A, and increment APK installation kits are installation kit B, then this step is specifically as follows:If the identification information of file exists Exist in the MANIFEST.MF files of installation kit A and installation kit B, but file is in the MANIFEST.MF files of installation kit A In summary info SHA-1 value of the summary info SHA-1 values from file in the MANIFEST.MF files of installation kit B it is different, can To determine current file as the first differential file.At this point it is possible to according to the first differential file and the generation of comparison in difference algorithm The variance data of the first differential file and respective file in the benchmark installation kit, and be added in default diff list.
Wherein, original position of the difference content in benchmark installation kit respective file is included in the variance data, is terminated Position and difference content.For example, the data content in the first differential file is in respective file in AAAAA and benchmark installation kit Data content be ABABCA, according to contrast difference's algorithm, two variance datas can be generated:(1,2, B) and (3,4, BC).Then This two variance datas are stored in the corresponding diff list of current file.The specific form of variance data can be as shown in table 1. File described in table 1 on the basis of reference file in installation kit, the delta file is literary with the benchmark in increment installation kit The corresponding file of part.
Table 1
If described to search the increment according to comparing result and install specifically, described when to state differential file be newly-increased file The step of wrapping the differential file relative to the benchmark installation kit is specifically as follows:If comparing result is the second file in the increasing Amount installation kit is present, but does not exist in the benchmark installation kit, it is determined that second file is the newly-increased file.This step It is middle that default diff list is updated according to the differential file, it is specifically as follows:By the identification information of the newly-increased file and described Newly-increased file is added to the default diff list.
For example, informative abstract file is MANIFEST.MF files, and if benchmark APK installation kits are installation kit A, increment APK peaces Dress bag is installation kit C, then this step is specifically as follows:If the identification information of file is in the MANIFEST.MF files of installation kit C In the presence of, but not existing in the MANIFEST.MF files of installation kit A, it may be determined that the file is the newly-increased file.This When, the identification information of the file in installation kit C and file can be added in default diff list.
If described to search the increment installation kit according to comparing result specifically, the differential file is to delete during file Relative to the benchmark installation kit differential file the step of can specifically include:If comparing result is the 3rd file in the increasing Amount installation kit does not exist, but exists in the benchmark installation kit, it is determined that the 3rd file is the deletion file.Described The step of updating default diff list according to the differential file is specifically as follows:The identification information of the deletion file is added to The default diff list.
For example, if benchmark APK installation kits are installation kit A, increment APK installation kits are installation kit D, then this step specifically can be with For:If the identification information of file does not exist in the MANIFEST.MF files of installation kit D, but installation kit A's Exist in MANIFEST.MF files, it may be determined that the differential file is deletion file.Can be now by installation kit D The identification information for deleting file is added in default diff list.
Wherein, in described default diff list, can include in installation kit title, the newly-increased file of newly-increased file name Hold, increase file number newly, delete file name, delete file number, differential file title, variance data content, differential file Number and above-mentioned file correspond to specifically describe.Specifically, as shown in table 2.
Table 2
Title Specifically describe
Apk titles The title of apk
Newly-increased file number m Newly-increased file number, common m
Newly-increased file name 1 Newly-increased data
Newly-increased file content 1 Data content
Newly-increased file name 2 Newly-increased data
Newly-increased file content 2 Data content
... ...
Newly-increased file name m Newly-increased data
Newly-increased file content number m Data content
Delete file number n Delete the number of file name, common n
Delete file name 1 Delete data
Delete file name 2 Delete data
...
Delete file name n Delete data
Differential file number p The number of differential file, common p
Differential file title 1 Variance data
Variance data 1 Data content
...
Differential file title p Variance data
Variance data p Data content
204th, the benchmark installation kit and the default diff list are compressed, obtain targeted compression file.
Under normal circumstances, in the mode of selection compression, alternative compress mode has various to file, specific compression Mode includes:Various compressing file modes such as ZIP, RAR, 7Z, GZ and BZ2.Because the selection of compress mode depends on two weights Want index, i.e. compression ratio and compression time.The description of wherein described compression ratio will not be described here as described in step 64.
In this step, the diff list is together compressed in by benchmark installation kit, obtains target pressure After contracting file, then judged as needed, if continue need for carrying out other installation kit squeeze operations:If so, then weighing Step described in multiple previous step 202 to 204;If it is not, then end operation.Specific implementation process, can be according to Fig. 4.
If for example, when there is currently the similar APK installation kits that 100 data volumes are 13.11MB, data total amount is 1311MB.Specific compression process and its result can be as shown in table 3, table 3 includes ZIP, RAR, 7Z, GZ, BZ2 and this reality A method is applied in interior compress mode and its corresponding compression ratio, and compression time.
Table 3
Compress mode Size after compression Compression ratio Compression time
This method 13.15MB 0.010 2.13 the second
7z 21.77MB 0.016 245.08 the second
zip 844.61MB 0.549 33.54 seconds
rar 834.83MB 0.542 63.27 seconds
gz 844.61MB 0.549 32.57 seconds
bz2 1257.8MB 0.559 145.27 the second
The embodiment of the invention provides another installation kit compression method, at present to the similar installation kit of batch in it is all Installation kit is compressed to be compared, and the present invention can choose benchmark installation kit from the similar installation kit of batch, and by parsing respectively The informative abstract file that goes out in the benchmark installation kit and increment installation kit is simultaneously contrasted, and can be found out the increment and be installed Differential file in bag and benchmark installation kit, default diff list is updated by the differential file and by default diff list and Benchmark installation kit is compressed, and obtains targeted compression file, realizes only compression benchmark installation kit and increment installation kit and base Differential file in quasi- installation kit, just can complete the compression of similar installation kit in batches, it is to avoid to phase in similar installation kit in batches With the repeated compression of file, the similar data volume for installing packet compression of batch is reduced, so as to reduce the similar installation kit pressure of batch The contracting time, and then the compression efficiency of the similar installation kit of batch is improved, while reducing the compression ratio of generation compressed file.And Further it is analyzed by the differential file, determines that the differential file is specifically the first differential file, newly-increased text Part deletes any situation in file, and default diff list is carried out according to differential file concrete condition corresponding Operation is updated, variance data is such as added to default diff list, is added the identification information of newly-increased file and the newly-increased file It is added to the default diff list or the identification information for deleting file is added to described default diff list etc., and then ensure that The accuracy of operation is updated to diff list.
Another installation kit decompressing method is the embodiment of the invention provides, as shown in figure 5, methods described includes:
301st, loaded targets compressed file, and the base extruded in the similar installation kit of batch is solved from the targeted compression file Quasi- installation kit and default diff list.
Wherein, presetting diff list is used for differential file of the recording increment installation kit relative to the benchmark installation kit, increases Amount installation kit is similar but different from benchmark installation kit installation kit in the similar installation kit of the batch.
Wherein, increment installation kit can be understood as the installation kit obtained after being modified on the basis of benchmark installation kit.Its In file it is identical with the file major part in benchmark installation kit.The default diff list can include the increment installation kit The list of difference between benchmark installation kit.Difference therein can be the modification of file, the different difference shapes such as increase or deletion Formula.The differential file form for actually including does not do specific restriction herein.
302nd, according to the default diff list, difference of the increment installation kit relative to the benchmark installation kit is obtained File and same file.
After diff list is obtained, content that can be in diff list analyzes increment installation kit different from benchmark File in installation kit, and with identical file in benchmark installation kit.Due in default diff list comprising differential file, The different difference conditions such as newly-increased file, deletion file.Therefore different difference conditions is directed to, is recorded in combination difference list Specifically describe, obtain the files different from benchmark installation kit, i.e. differential file.Same file then can directly from the benchmark Obtained in installation kit.
If for example, after there is currently benchmark installation kit A and diff list, wherein drawn in analysis diff list it is current poor Differential file a is only existed in heterotaxy table, then according to the corresponding difference description of differential file a and its a in diff list, benchmark is pacified File a in dress bag A modifies, and obtains new file a.Wherein, new file a is the differential file in this step, base Alternative document in quasi- installation kit A in addition to a is then the same file described in this step.
303rd, the differential file and the same file are added to target decompressing files, obtain the increment and install Bag.
After step 302 is carried out, decompressed by differential file, the differential file after being decompressed, and decompression Differential file afterwards is added to target decompressing files with the same file judged before, you can obtain described increment peace Dress bag.
Specifically, it is necessary to judge the current decompression that whether proceeds after step 303 is carried out, if so, then needing Want repeat step 301 to the operation in step 303;If it is not, then terminating operation.Specific operating process, as shown in Figure 6.
A kind of installation kit decompressing method provided in an embodiment of the present invention, and at present to all peaces in the similar installation kit of batch Dress bag carries out decompression and compares, and the present invention from targeted compression file by solving the benchmark installation kit extruded in the similar installation kit of batch With default diff list, and the differential file according to the default diff list acquisition increment installation kit relative to benchmark installation kit And same file, differential file and same file are finally added to target decompressing files again, obtain increment installation kit.Avoid To the repetition decompression operations of same file in the similar installation kit decompression procedure of batch is carried out, and then decompression time is saved, it is real Show the purpose that rapid batch decompresses similar installation kit, improve the Extractio efficiency in similar installation kit.
Another installation kit decompressing method is the embodiment of the invention provides, as shown in fig. 7, methods described includes:
401st, loaded targets compressed file, and the base extruded in the similar installation kit of batch is solved from the targeted compression file Quasi- installation kit and default diff list.
Wherein, presetting diff list is used for differential file of the recording increment installation kit relative to the benchmark installation kit, increases Amount installation kit is similar but different from benchmark installation kit installation kit in the similar installation kit of the batch.
Specifically, the specific descriptions of the increment installation kit, benchmark installation kit and default diff list described in this step As described in step 301, will not be described here.
402nd, according to the default diff list, difference of the increment installation kit relative to the benchmark installation kit is obtained File and same file.
Wherein, differential file includes the first differential file, newly-increased file or deletes file, first differential file be Identification information in the increment installation kit is identical from the identification information in the benchmark installation kit but informative abstract is different File.
If specifically, the differential file is the first differential file, default diff list is used to record first difference File is described according to the default diff list relative in the benchmark installation kit during variance data of respective file, obtains The increment installation kit relative to the benchmark installation kit differential file the step of, be specifically as follows:According to the default difference Variance data described in heterotaxy table and comparison in difference algorithm, generate first differential file, and obtain the same file Compressed file.The differential file and the same file are added to target decompressing files in this step, can specifically be included: First differential file is compressed treatment;By the compressed file of first differential file and the pressure of the same file Contracting file is added to target decompressing files.
For example, by taking APK installation kits as an example, if benchmark installation kit is installation kit A, increment installation kit is installation kit B, if currently When differential file is the first differential file a, then the first described differential file a can be learnt simultaneously according to default diff list It is present in installation kit A and installation kit B, but wherein the content of file a carried out modification.Therefore by diff list first The corresponding variance datas of differential file a and its corresponding description, can obtain is carried out needed for corresponding a files in installation kit B The concrete operations of modification.Specifically, can be modified to current a files by comparison algorithm, new file a is generated.With Afterwards, the new file a that will be drawn is compressed treatment (APK installation kits are a kind of compression installation kit), and together with alternative document (phase Same file) compressed file be added in the lump in target decompressing files.
Specifically, if differential file is newly-increased file, default diff list be used to recording the increment installation kit relative to It is described according to the default diff list during the newly-increased file of the benchmark installation kit, obtain the increment installation kit relative to The step of differential file of the benchmark installation kit, it is specifically as follows:According to the default diff list, the increment peace is obtained Newly-increased file of the dress bag relative to the benchmark installation kit.In this step, the differential file is added to target decompressing files Can specifically include:The newly-increased file is compressed treatment;The compressed file of the newly-increased file is added to target solution Pressure file.
For example, by taking APK installation kits as an example, when benchmark installation kit is installation kit A, and increment installation kit is installation kit C, if institute It is newly-increased file to state differential file, then then there is file b in the default diff list, this file b in diff list Description, it is known that not existing file b in the benchmark installation kit A, and should there is file b in increment installation kit, then exist , it is necessary to get file b according to default diff list in this step, and file b is compressed into treatment, and (APK installation kits are one Plant compression installation kit), and be added in target decompressing files.
Specifically, if differential file is to delete file, presetting diff list is used for the increment installation kit relative to described It is described according to the default diff list during identification information of the deletion file of benchmark installation kit, obtain the increment installation kit And the step of differential file between the benchmark installation kit, it is specifically as follows:According to the deletion in the default diff list The identification information of file, obtains deletion file of the increment installation kit relative to the benchmark installation kit.By institute in this step State differential file and be added to target decompressing files and be specifically as follows:The behaviour that deletion file is added to target decompressing files is not performed Make.
For example, by taking APK installation kits as an example, when benchmark installation kit is installation kit A, and increment installation kit is installation kit D, if institute Differential file is stated to delete file, is then existed in the default diff list and is deleted file c, this file in diff list , it is known that there is file c in the benchmark installation kit A, and should not be present file c in the description of c, then exist in increment installation kit , it is necessary to get file c according to default diff list in this step, and can not perform c is added to target decompressing files Operation.
403rd, the differential file and the same file are added to target decompressing files, obtain the increment and install Bag.
Specifically, the difference of the differential file according to step 402, the specific operation for performing is also different in this step 's.
If for example, when differential file described in step 402 is the first differential file, needing to obtain the first difference text in this step Part, and the specific difference description of the file and comparison algorithm will must be gone on business in the default diff list of the first differential file combination Different article part, differential file is compressed, and is added in target decompressing files with the compressed file of same file, and then is obtained Increment installation kit;
If differential file described in step 402 is newly-increased file, need, according to default diff list, to obtain in this step To described newly-increased file, and newly-increased file is added in target decompressing files, and then obtains increment installation kit;
If differential file described in step 402 needs, according to default diff list, to obtain to delete during file in this step Described deletion file is got, is not performed and the deletion file is added to the operation of decompressing files, and then obtain increment peace Dress bag.
It should be noted that carrying out described the differential file and the same file being added into target decompressing files When, when the target decompressing files is APK class installation package files, the form of described file destination can be as shown in table 4, its The specific descriptions of file identification, length and correlation comprising the class file in middle table 4.
Table 4
After this step is carried out, in addition it is also necessary to whether need to proceed decompression operations to judge to current:If so, then Need repeat step 401 to the operation in step 403;If it is not, then terminating operation.Specific implementation process, as shown in Figure 8.
Further, all steps with reference to described in the embodiments of the present invention, by specific example, with existing skill Method in art is contrasted with the present invention.
When there is the similar APK installation kits that 100 data volume sizes are 13.11MB, by the method for the present invention, contrast Others compression, decompression mode, particular situation can be as shown in table 5.Wherein table 5 includes compressing and decompressing mode, compression Data such as file size, compression ratio, compression time and decompression time afterwards.
Table 5
Another installation kit decompressing method provided in an embodiment of the present invention, at present to the similar installation kit of batch in it is all Installation kit carries out decompression and compares, and the present invention from from targeted compression file by solving the benchmark peace extruded in the similar installation kit of batch Dress bag and default diff list, and difference of the increment installation kit relative to benchmark installation kit is obtained according to the default diff list File and same file, are finally added to target decompressing files by differential file and same file again, obtain increment installation kit.Keep away Exempt from the repetition decompression operations to same file in the similar installation kit decompression procedure of batch is carried out, and then when saving decompression Between, the purpose that rapid batch decompresses similar installation kit is realized, improve the Extractio efficiency in similar installation kit.And Further specifically analyzed by differential file, analyzed the first differential file, newly-increased included in differential file File deletes three kinds of situations of file, and for these three situations, different addition operations is carried out to the target decompressing files, Such as the first differential file is compressed, and compresses it file and be added to target decompression text with the compressed file of same file Part, newly-increased file is compressed, and compresses it file and be added to target decompressing files or just delete file and be not added to Target decompressing files etc., further ensure that the accuracy in the decompression procedure of batch installation kit.
Further, as the realization to method shown in above-mentioned Fig. 1, the embodiment of the invention provides a kind of installation packet compression Device, as shown in figure 9, the device includes:Choose unit 51, resolution unit 52, comparison unit 53, searching unit 54, renewal list Unit 55, compression unit 56, wherein
Unit 51 is chosen, can be used for choosing benchmark installation kit from the similar installation kit of batch.
Resolution unit 52, can be used for parsing the benchmark installation kit and increment that the selection unit 51 is chosen respectively Informative abstract file in installation kit, the increment installation kit be the similar installation kit of the batch in the benchmark installation kit phase Like but different installation kits.
Comparison unit 53, can be used in the benchmark installation kit and increment installation kit to the parsing of the resolution unit 52 Informative abstract file contrasted.
Searching unit 54, the comparing result that can be used for being obtained according to the comparison unit 53 searches the increment installation kit Relative to the differential file of the benchmark installation kit.
Updating block 55, the differential file that can be used for being searched according to the searching unit 54 updates default difference row Table, the default diff list is used to record the increment installation kit relative to the differential file between the benchmark installation kit.
Compression unit 56, can be used for the benchmark installation kit and the updating block of choosing the selection unit 51 The 55 default diff lists for updating are compressed, and obtain targeted compression file.
The embodiment of the invention provides a kind of installation kit compression set.Described device includes:Choose unit, resolution unit, Comparison unit, searching unit, updating block, compression unit.To all installation kits in the similar installation kit of batch are carried out at present Compression is compared, and the present invention can choose benchmark installation kit from the similar installation kit of batch, and by parsing the benchmark respectively Informative abstract file in installation kit and increment installation kit is simultaneously contrasted, and can find out the increment installation kit and benchmark peace Differential file in dress bag, default diff list is updated and by default diff list and benchmark installation kit by the differential file Be compressed, obtain targeted compression file, realize only compression benchmark installation kit and increment installation kit and benchmark installation kit in Differential file, just can complete the compression of similar installation kit in batches, it is to avoid to the weight of same file in similar installation kit in batches Compound compression, reduces the similar data volume for installing packet compression of batch, so as to reduce the similar installation kit compression time of batch, and then The compression efficiency of the similar installation kit of batch is improved, while reducing the compression ratio of generation compressed file.
Further, as the realization to method shown in above-mentioned Fig. 3, the embodiment of the invention provides another installation kit pressure Compression apparatus, as shown in Figure 10, the device includes:Choose unit 61, resolution unit 62, comparison unit 63, searching unit 64, renewal Unit 65, compression unit 66, wherein
Unit 61 is chosen, can be used for choosing benchmark installation kit from the similar installation kit of batch.
Resolution unit 62, can be used for parsing the benchmark installation kit and increment that the selection unit 61 is chosen respectively Informative abstract file in installation kit, the increment installation kit be the similar installation kit of the batch in the benchmark installation kit phase Like but different installation kits.
Comparison unit 63, can be used in the benchmark installation kit and increment installation kit to the parsing of the resolution unit 62 Informative abstract file contrasted.
Searching unit 64, the comparing result that can be used for being obtained according to the comparison unit 63 searches the increment installation kit Relative to the differential file of the benchmark installation kit.
Updating block 65, the differential file that can be used for being searched according to the searching unit 64 updates default difference row Table, the default diff list is used to record the increment installation kit relative to the differential file between the benchmark installation kit.
Compression unit 66, can be used for the benchmark installation kit and the updating block of choosing the selection unit 61 The 65 default diff lists for updating are compressed, and obtain targeted compression file.
Further, the searching unit 64 includes:
First determining module 6401, if can be used for comparing result is mark of first file in the increment installation kit Information is identical from the identification information in the benchmark installation kit but informative abstract is different, it is determined that first file is described First differential file.
The updating block 65 includes:
First generation module 6501, can be used for according to first differential file and comparison in difference algorithm, and generation is described The variance data of the first differential file and respective file in the benchmark installation kit.
First add module 6502, can be used for being added to the variance data that first generation module 6501 is generated pre- If in diff list.
Further, the searching unit 64 includes:
Second determining module 6402, if can be used for comparing result for the second file exists in the increment installation kit, but Do not exist in the benchmark installation kit, it is determined that second file is the newly-increased file.
The updating block 65 includes:
Second add module 6503, can be used for being added to the identification information of the newly-increased file and the newly-increased file The default diff list.
Further, the searching unit 64 includes:
3rd determining module 6403, if can be used for comparing result for the 3rd file does not exist in the increment installation kit, But exist in the benchmark installation kit, it is determined that the 3rd file is the deletion file.
The updating block 65 includes:
3rd add module 6504, can be used for for the identification information of the deletion file being added to the default difference row Table.
The embodiment of the invention provides another installation kit compression set.Described device includes:Choose unit, parsing list Unit, comparison unit, searching unit, updating block, compression unit.To all installation kits in the similar installation kit of batch are entered at present Row compression is compared, and the present invention can choose benchmark installation kit from the similar installation kit of batch, and by parsing the base respectively Informative abstract file in quasi- installation kit and increment installation kit is simultaneously contrasted, and can find out the increment installation kit and benchmark Differential file in installation kit, updates default diff list and installs default diff list and benchmark by the differential file Bag is compressed, and obtains targeted compression file, realizes only compression benchmark installation kit and increment installation kit and benchmark installation kit In differential file, just can complete the compression of similar installation kit in batches, it is to avoid to same file in similar installation kit in batches Repeated compression, reduces the similar data volume for installing packet compression of batch, so as to reduce the similar installation kit compression time of batch, enters And the compression efficiency of the similar installation kit of batch is improved, while reducing the compression ratio of generation compressed file.And it is further It is analyzed by the differential file, determines that the differential file is specifically the first differential file, newly-increased file or deletion Any situation in file, and corresponding renewal behaviour is carried out to default diff list according to differential file concrete condition Make, as variance data being added into default diff list, the identification information of newly-increased file and the newly-increased file being added into institute State default diff list or the identification information for deleting file is added to described default diff list etc., and then ensure that to difference List is updated the accuracy of operation.
Further, as the realization to method shown in above-mentioned Fig. 5, the embodiment of the invention provides a kind of installation kit decompression Device, as shown in figure 11, the device includes:Loading unit 71, decompression units 72, acquiring unit 73, adding device 74, wherein
Loading unit 71, for loaded targets compressed file.
Decompression units 72, the similar installation of batch is extruded for being solved in the targeted compression file that is loaded from the loading unit 71 Benchmark installation kit and default diff list in bag, the default diff list are used for recording increment installation kit relative to the base The differential file of quasi- installation kit, the increment installation kit be the similar installation kit of the batch in it is similar to the benchmark installation kit but Different installations.
Acquiring unit 73, for the default diff list decompressed according to the decompression units 72, obtains the increment and installs Wrap the differential file and same file relative to the benchmark installation kit.
Adding device 74, differential file and the same file for the acquiring unit 73 to be obtained are added to target Decompressing files, obtains the increment installation kit.
The embodiment of the invention provides a kind of installation kit decompression device.Described device includes:Loading unit, decompression units, Acquiring unit, adding device.Compared with decompression is carried out to all installation kits in the similar installation kit of batch at present, the present invention passes through The benchmark installation kit and default diff list extruded in the similar installation kit of batch are solved from targeted compression file, and according to described pre- If diff list obtains differential file and same file of the increment installation kit relative to benchmark installation kit, finally again by differential file It is added to target decompressing files with same file, obtains increment installation kit.Avoid and press through carrying out the similar installation kit solution of batch To the repetition decompression operations of same file in journey, and then decompression time is saved, realize rapid batch and decompress similar installation kit Purpose, improve the Extractio efficiency in similar installation kit.
Further, as the realization to method shown in above-mentioned Fig. 7, the embodiment of the invention provides another installation kit solution Pressure device, as shown in figure 12, the device includes:Loading unit 81, decompression units 82, acquiring unit 83, adding device 84, wherein
Loading unit 81, can be used for loaded targets compressed file.
Decompression units 82, can be used for the solution extrusion batch from the targeted compression file of the loading of the loading unit 81 similar Benchmark installation kit and default diff list in installation kit, the default diff list are used for recording increment installation kit relative to institute State the differential file of benchmark installation kit, the increment installation kit be in the similar installation kit of the batch with the benchmark installation kit phase Like but different installations.
Acquiring unit 83, can be used for the default diff list decompressed according to the decompression units 82, obtain the increment Differential file and same file of the installation kit relative to the benchmark installation kit.
Adding device 84, can be used for the differential file for obtaining the acquiring unit 83 and the same file is added to Target decompressing files, obtains the increment installation kit.
Further, the acquiring unit 83 includes:
Second generation module 8301, can be used for variance data and comparison in difference according to the default diff list Algorithm, generates first differential file.
First acquisition module 8302, can be used for obtaining the compressed file of the same file.
The adding device 84 includes:
First compression module 8401, can be used for for first differential file being compressed treatment.
4th add module 8402, can be used for the pressure of the first differential file for compressing first compression module 8401 The compressed file of contracting file and the same file is added to target decompressing files.
Further, the acquiring unit 83 includes:
Second acquisition module 8303, can be used for, according to the default diff list, obtaining the increment installation kit relative In the newly-increased file of the benchmark installation kit.
The adding device 84 includes:
Second compression module 8403, can be used for for the newly-increased file being compressed treatment.
5th add module 8404, can be used for the compression text of the newly-increased file for compressing second compression module 8403 Part is added to target decompressing files.
Further, the acquiring unit 83 includes:
3rd acquisition module 8304, the identification information of the deletion file that can be used in the default diff list, Obtain deletion file of the increment installation kit relative to the benchmark installation kit.
The adding device 84 includes:
6th add module 8405, can be used for not performing the operation that deletion file is added to target decompressing files.
Another installation kit decompression device provided in an embodiment of the present invention, described device includes:Loading unit, decompression are single Unit, acquiring unit, adding device.Compared with decompression is carried out to all installation kits in the similar installation kit of batch at present, the present invention By solving the benchmark installation kit and default diff list that extrude in the similar installation kit of batch from targeted compression file, and according to institute State default diff list and obtain differential file and same file of the increment installation kit relative to benchmark installation kit, finally again by difference File and same file are added to target decompressing files, obtain increment installation kit.Avoiding is carrying out the similar installation kit solution of batch To the repetition decompression operations of same file during pressure, and then decompression time is saved, realize rapid batch and decompress similar peace The purpose of bag is filled, the Extractio efficiency in similar installation kit is improve.And further carried out by differential file Specific analysis, analyzes the first differential file, newly-increased file or the deletion three kinds of situations of file included in differential file, and pin To these three situations, different addition operations are carried out to the target decompressing files, be such as compressed the first differential file, and File is compressed it to be added to target decompressing files with the compressed file of same file, be compressed newly-increased file, and by its Compressed file is added to target decompressing files or just deletion file is not added to target decompressing files etc., further ensure that and criticizes Measure the accuracy in the decompression procedure of installation kit.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion described in detail in certain embodiment Point, may refer to the associated description of other embodiment.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment " first ", " second " etc. be, for distinguishing each embodiment, and not represent the quality of each embodiment.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system Structure be obvious.Additionally, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various Programming language realizes the content of invention described herein, and the description done to language-specific above is to disclose this hair Bright preferred forms.
In specification mentioned herein, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be put into practice in the case of without these details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify one or more that the disclosure and helping understands in each inventive aspect, exist Above to the description of exemplary embodiment of the invention in, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, and wherein each claim is in itself All as separate embodiments of the invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Unit or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, can use any Combine to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit is required, summary and accompanying drawing) disclosed in each feature can the alternative features of or similar purpose identical, equivalent by offer carry out generation Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection is appointed One of meaning mode can be used in any combination.
All parts embodiment of the invention can be realized with hardware, or be run with one or more processor Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) realize in target location determining device according to embodiments of the present invention The some or all functions of a little or whole parts.The present invention is also implemented as performing method as described herein Some or all equipment or program of device (for example, computer program and computer program product).Such realization Program of the invention can be stored on a computer-readable medium, or can have the form of one or more signal.This The signal of sample can be downloaded from internet website and obtained, or be provided on carrier signal, or be carried in any other form For.
It should be noted that above-described embodiment the present invention will be described rather than limiting the invention, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol being located between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element listed in the claims or step.Word "a" or "an" before element is not excluded the presence of as multiple Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.

Claims (10)

1. a kind of installation kit compression method, it is characterised in that including:
Benchmark installation kit is chosen from the similar installation kit of batch;
The informative abstract file in the benchmark installation kit and increment installation kit is parsed respectively and is contrasted, the increment peace Dress bag is installation kit similar but different from the benchmark installation kit in the similar installation kit of the batch;
Differential file of the increment installation kit relative to the benchmark installation kit is searched according to comparing result, and according to the difference Different article part updates default diff list, and the default diff list is pacified for recording the increment installation kit relative to the benchmark Differential file between dress bag;
The benchmark installation kit and the default diff list are compressed, targeted compression file is obtained.
2. method according to claim 1, it is characterised in that described information Summary file is used to record file in installation kit Informative abstract.
3. the method according to any one of claim 1-2, it is characterised in that the differential file includes the first difference text Part, newly-increased file delete file, first differential file be identification information in the increment installation kit with described The file that identification information in benchmark installation kit is identical but informative abstract is different.
4. the method according to any one of claim 1-3, it is characterised in that the differential file is the first difference text Part, it is described to be included relative to the differential file of the benchmark installation kit according to the comparing result lookup increment installation kit:
If comparing result is identification information of first file in the increment installation kit and the mark in the benchmark installation kit Knowledge information is identical but informative abstract is different, it is determined that first file is first differential file;
It is described to be included according to the default diff list of differential file renewal:
According to first differential file and comparison in difference algorithm, in generating first differential file and the benchmark installation kit The variance data of respective file;
The variance data is added in default diff list.
5. the method according to any one of right wants 1-4, it is characterised in that the differential file is newly-increased file, described Search the increment installation kit according to comparing result includes relative to the differential file of the benchmark installation kit:
If comparing result exists for the second file in the increment installation kit, but does not exist in the benchmark installation kit, it is determined that Second file is the newly-increased file;
It is described to be included according to the default diff list of differential file renewal:
The identification information of the newly-increased file and the newly-increased file are added to the default diff list.
6. the method according to any one of claim 1-5, it is characterised in that the differential file is to delete file, institute State includes according to the comparing result lookup increment installation kit relative to the differential file of the benchmark installation kit:
If comparing result does not exist for the 3rd file in the increment installation kit, but exists in the benchmark installation kit, it is determined that 3rd file is the deletion file;
It is described to be included according to the default diff list of differential file renewal:
The identification information of the deletion file is added to the default diff list.
7. a kind of installation kit decompressing method, it is characterised in that including:
Loaded targets compressed file, and the benchmark installation kit extruded in the similar installation kit of batch is solved from the targeted compression file With default diff list, it is literary relative to the difference of the benchmark installation kit that the default diff list is used for recording increment installation kit Part, the increment installation kit is similar but different from benchmark installation kit installation kit in the similar installation kit of the batch;
According to the default diff list, differential file and phase of the increment installation kit relative to the benchmark installation kit are obtained Same file;
The differential file and the same file are added to target decompressing files, the increment installation kit is obtained.
8. a kind of installation kit compression set, it is characterised in that including:
Unit is chosen, for choosing benchmark installation kit from the similar installation kit of batch;
Resolution unit, for the letter in the benchmark installation kit and increment installation kit that parse the selection unit selection respectively Breath Summary file, the increment installation kit is similar but different from benchmark installation kit peace in the similar installation kit of the batch Dress bag;
Comparison unit, for the informative abstract text in the benchmark installation kit and increment installation kit that are parsed to the resolution unit Part is contrasted;
Searching unit, the comparing result for being obtained according to the comparison unit searches the increment installation kit relative to the base The differential file of quasi- installation kit;
Updating block, the differential file for being searched according to the searching unit updates default diff list, described default Diff list is used to record differential file of the increment installation kit relative to the benchmark installation kit;
Compression unit, for the default difference for updating the benchmark installation kit and the updating block of the selection unit selection Heterotaxy table is compressed, and obtains targeted compression file.
9. device according to claim 8, it is characterised in that described information Summary file is used to record file in installation kit Informative abstract.
10. a kind of installation kit decompression device, it is characterised in that including:
Loading unit, for loaded targets compressed file;
Decompression units, for solving the base extruded in the similar installation kit of batch in the targeted compression file that is loaded from the loading unit Quasi- installation kit and default diff list, the default diff list are used for recording increment installation kit relative to the benchmark installation kit Differential file, the increment installation kit is similar but different from benchmark installation kit peace in the similar installation kit of the batch Dress bag;
Acquiring unit, for the default diff list decompressed according to the decompression units, obtain the increment installation kit relative to The differential file and same file of the benchmark installation kit;
Adding device, differential file and the same file for the acquiring unit to be obtained are added to target decompression text Part, obtains the increment installation kit.
CN201611208663.8A 2016-12-23 2016-12-23 Compression method and device and decompression method and device for installation packages Pending CN106681720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611208663.8A CN106681720A (en) 2016-12-23 2016-12-23 Compression method and device and decompression method and device for installation packages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611208663.8A CN106681720A (en) 2016-12-23 2016-12-23 Compression method and device and decompression method and device for installation packages

Publications (1)

Publication Number Publication Date
CN106681720A true CN106681720A (en) 2017-05-17

Family

ID=58870452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611208663.8A Pending CN106681720A (en) 2016-12-23 2016-12-23 Compression method and device and decompression method and device for installation packages

Country Status (1)

Country Link
CN (1) CN106681720A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897546A (en) * 2018-07-03 2018-11-27 北京五八信息技术有限公司 Monitor method, apparatus, equipment and the readable storage medium storing program for executing of APK size
CN109241500A (en) * 2018-08-14 2019-01-18 中国平安人寿保险股份有限公司 Files in batch comparison method, device, computer equipment and storage medium
CN109309697A (en) * 2017-07-27 2019-02-05 阿里巴巴集团控股有限公司 Information-pushing method and device, approaches to IM and device
CN110231947A (en) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 A kind of update of plug-in method, equipment, server and the storage medium of application program
CN110795114A (en) * 2019-10-29 2020-02-14 北京五八信息技术有限公司 Application program installation package monitoring method and device, electronic equipment and storage medium
CN114329360A (en) * 2022-01-07 2022-04-12 每日互动股份有限公司 Method, electronic device and medium for fuzzification pkg

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577271A (en) * 2003-07-21 2005-02-09 微软公司 System and method for intra-package delta compression of data
CN1866821A (en) * 2006-06-05 2006-11-22 中国人民解放军国防科学技术大学 Network monitoring data compression storing and combination detecting method based on similar data set
CN103095838A (en) * 2013-01-16 2013-05-08 福州博远无线网络科技有限公司 Method for upgrading Android smartphone software through downloading incremental upgrade package
CN106210742A (en) * 2016-07-15 2016-12-07 东北大学 Batch images based on common feature compression transmission and the system and method reduced

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577271A (en) * 2003-07-21 2005-02-09 微软公司 System and method for intra-package delta compression of data
CN1866821A (en) * 2006-06-05 2006-11-22 中国人民解放军国防科学技术大学 Network monitoring data compression storing and combination detecting method based on similar data set
CN103095838A (en) * 2013-01-16 2013-05-08 福州博远无线网络科技有限公司 Method for upgrading Android smartphone software through downloading incremental upgrade package
CN106210742A (en) * 2016-07-15 2016-12-07 东北大学 Batch images based on common feature compression transmission and the system and method reduced

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109309697A (en) * 2017-07-27 2019-02-05 阿里巴巴集团控股有限公司 Information-pushing method and device, approaches to IM and device
CN109309697B (en) * 2017-07-27 2021-08-27 阿里巴巴集团控股有限公司 Information pushing method and device and information management method and device
CN108897546A (en) * 2018-07-03 2018-11-27 北京五八信息技术有限公司 Monitor method, apparatus, equipment and the readable storage medium storing program for executing of APK size
CN109241500A (en) * 2018-08-14 2019-01-18 中国平安人寿保险股份有限公司 Files in batch comparison method, device, computer equipment and storage medium
CN109241500B (en) * 2018-08-14 2023-02-03 中国平安人寿保险股份有限公司 File batch comparison method and device, computer equipment and storage medium
CN110231947A (en) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 A kind of update of plug-in method, equipment, server and the storage medium of application program
CN110795114A (en) * 2019-10-29 2020-02-14 北京五八信息技术有限公司 Application program installation package monitoring method and device, electronic equipment and storage medium
CN114329360A (en) * 2022-01-07 2022-04-12 每日互动股份有限公司 Method, electronic device and medium for fuzzification pkg

Similar Documents

Publication Publication Date Title
CN106681720A (en) Compression method and device and decompression method and device for installation packages
CN102663281B (en) Method and device for detecting malicious software
Shahid et al. Identification and annotation of small RNA genes using ShortStack
EP1652069B1 (en) Method and system for updating versions of content stored in a storage device
CN108628751A (en) A kind of useless dependence item detection method and device
CN110147239B (en) Method, equipment and storage medium for multiple compression of game installation inclusion
CN106843842A (en) The update method and device of a kind of application profiles
CN112395305B (en) SQL sentence analysis method and device, electronic equipment and storage medium
KR101614070B1 (en) Wireless handheld device startup method and wireless handheld device
EP3438848B1 (en) Identifying properties of a communication device
CN101702152A (en) Intelligent data processing method, device and system
CN106604109B (en) Configuration method and device of smart television
CN106843984A (en) The update method and device of application database
WO2014184896A1 (en) Program analyzer, program analysis method, and program analysis program
CN112506558A (en) Multi-architecture static library conflict processing method, device, equipment and storage medium
CN106708522A (en) Batch distribution method and device for installation packages
CN107122294A (en) A kind of method, terminal and the device of test parameter file compatibility
CN104239215B (en) The investigation method and apparatus of garbageware
CN106528260A (en) Automatic calculation method based on formula
CN115586996A (en) Internet of things firmware fingerprint identification method and device based on open source software supply chain
CN106708581A (en) Application update package generation method and device and application update method and device
CN105204937B (en) Kernel function call method, apparatus and operating system
Martens Public proteomics data: How the field has evolved from sceptical inquiry to the promise of in silico proteomics
Türker et al. BPMN in the Wild: A Reprise.
CN109298831B (en) Information storage method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170517