CN104391728B - Software upgrading difference packet acquisition methods and corresponding upgrade method and device - Google Patents

Software upgrading difference packet acquisition methods and corresponding upgrade method and device Download PDF

Info

Publication number
CN104391728B
CN104391728B CN201410773855.8A CN201410773855A CN104391728B CN 104391728 B CN104391728 B CN 104391728B CN 201410773855 A CN201410773855 A CN 201410773855A CN 104391728 B CN104391728 B CN 104391728B
Authority
CN
China
Prior art keywords
file
aku
installation kit
same name
configuration file
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.)
Expired - Fee Related
Application number
CN201410773855.8A
Other languages
Chinese (zh)
Other versions
CN104391728A (en
Inventor
田野
李宝生
韩三普
李昀臻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410773855.8A priority Critical patent/CN104391728B/en
Publication of CN104391728A publication Critical patent/CN104391728A/en
Application granted granted Critical
Publication of CN104391728B publication Critical patent/CN104391728B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to a kind of method for upgrading software based on difference packet, specifically, the present invention provides a kind of software upgrading difference packet acquisition methods and device, and the file of the same name being had differences each other in installation kit and AKU carries out difference in the form of source data, so as to obtain the smaller difference packet of volume.Correspondingly, the present invention also provides a kind of software upgrading upgrade method and device, and difference packet reduces AKU according to the zip file internal structure of AKU.The present invention program realizes the difference packet by downloading smaller volume, makes user's with more saving flow quick renewal upgrading for realizing software.

Description

Software upgrading difference packet acquisition methods and corresponding upgrade method and device
Technical field
The present invention relates to the application software upgrade based on difference packet, and specifically, the present invention relates to software upgrading difference packet Acquisition methods and corresponding upgrade method and device.
Background technology
With the continuous development of mobile Internet industry, the application program of mobile terminal is more and more, and version is constantly updated, User needs constantly to carry out the safety and stability that corresponding application software upgrade just can guarantee that software.When application software has liter During level version, it is necessary to download the AKU of installation more highest version, the usual volume of AKU of highest version is larger, and completely downloads AKU can make user's consumption wait longer download time, while can also consume more networks resource and sheet compared with various flow The input and output resource of ground file.
In order to solve the above problems, generally use difference algorithm directly carries out two to installation kit and AKU and entered prior art Difference processed, wherein conventional difference algorithm has xdelta3, bsdiff, courgette, generation characterizes the difference packet of both differences, User completes software upgrading by downloading the difference packet of smaller size smaller.Application No. 201310642252.X patent of invention discloses A kind of method and device of application software upgrade, increased using the method that binary system difference is carried out to installation kit and AKU AKU is measured, client reduces to obtain AKU by downloading the increment AKU of matching.However as software kit constantly more New upgrading, the difference packet of smaller volume can preferably meet the needs of application software frequent updating upgrading, therefore the present invention carries Supply to generate the difference packet method of smaller volume and corresponding method for upgrading software, user can be made to enter line frequency with more saving flow Numerous software upgrading, so as to reduce the leak window of software, user is set more safely to use application software, and for connecting not For stable user, the AKU of smaller volume can be more beneficial for renewal upgrading.
The content of the invention
The primary and foremost purpose of the present invention is solve above-mentioned at least one problem, so as to provide a kind of software upgrading difference packet Acquisition methods, to generate the smaller upgrading difference packet of volume.
Another object of the present invention is to corresponding to previous purpose, and a kind of upgrade method is provided, to utilize the difference packet Realize software upgrading.
To realize the above-mentioned purpose of the present invention, the present invention adopts the following technical scheme that:
The invention provides a kind of software upgrading difference packet acquisition methods, methods described includes:
Installation kit and AKU internal structure are parsed, it is determined that the file and AKU of the same name that have differences each other are relative to peace The newly-increased file of bag is filled, and generates the configuration file for recording those file location informations;
All internal structural informations of AKU are recorded, generate meta data file;
The file of the same name having differences of decompression installation kit and AKU, it is same by what is had differences described in both Name file correspondingly carries out difference to obtain differential data file in the form of source data;
The configuration file, meta data file, differential data file and the newly-increased file are compressed, obtains the upgrading Difference packet.
Specifically, the configuration file includes residual quantity configuration file and merges configuration file, wherein:
The residual quantity configuration file, for recording the positional information for the file of the same name being had differences described in installation kit;
The merging configuration file, for recording the file of the same name being had differences described in AKU and the newly-increased file Positional information.
Further, it is described merge configuration file also include be used for record AKU relative to the of the same name of installation kit indifference The positional information of file.
Further, the software difference packet acquisition methods are further comprising the steps of:
By repeatedly attempting to obtain the compression parameters matched with AKU, and it is recorded in the merging configuration file;
The differential data of the differential data file is compressed using the adaptation compression parameters.
Specifically, central directory, central directory that the meta data file is included in the AKU internal structure terminate Local file head, the data descriptor of mark and each file.
The present invention provides a kind of software upgrading difference packet acquisition device, including:
Configuration file generation unit, for generate record installation kit and the file of the same name that has differences each other of AKU and AKU increases the positional information of file newly;
Meta data file generation unit, for recording all internal structural informations of AKU;
Difference unit, for calculating the difference between the file of the same name being had differences each other in installation kit and AKU;
Compression unit, for being compressed and decompressing to file data.
Further, described device also includes:
Adaptation unit, for being adapted to the compression parameters matched with AKU.
Specifically, the configuration file includes residual quantity configuration file and merges configuration file, wherein:
The residual quantity configuration file, for recording the positional information for the file of the same name being had differences described in installation kit;
The merging configuration file, for recording the file of the same name being had differences described in AKU and the newly-increased file Positional information.
Further, it is described merge configuration file also include be used for record AKU relative to the of the same name of installation kit indifference The positional information of file.
Further, the configuration file that merges also includes being adapted to compression parameters with what AKU matched.
Specifically, central directory, central directory that the meta data file is included in the AKU internal structure terminate Local file head, the data descriptor of mark and each file.
Correspondingly, the present invention also provides a kind of software upgrading upgrade method, and methods described includes:
Difference packet is decompressed, obtains its configuration file, meta data file, differential data file and newly-increased text for being included Part;
Respective record is obtained from installation kit in the first file location information of configuration file, by the differential data file The first file after the upgrading merged in the form of source data in the form of obtaining source data corresponding with first file;
The file location information recorded according to configuration file, by the meta data file, newly-increased file, the first file with And remaining associated documents in the installation kit are reduced to AKU;
The AKU is installed.
Specifically, the configuration file includes residual quantity configuration file and merges configuration file, wherein:
The residual quantity configuration file, for recording the positional information for the file of the same name being had differences described in installation kit;
The merging configuration file, for recording the file of the same name being had differences described in AKU and the newly-increased file Positional information.
Further, it is described merge configuration file also include be used for record AKU relative to the of the same name of installation kit indifference The positional information of file.
Specifically, first file refers specifically to the file of the same name being had differences relative to AKU of installation kit.
Specifically, remaining associated documents in the installation kit are referred specifically in installation kit relative to the same of AKU indifference Name file.
Further, the reduction upgrading packet procedures also include, to different relative to AKU compress mode in installation kit The data of file of the same name carry out weight contracting.
Specifically, the weight contracting is using the compression matched with AKU the ginseng being recorded in the merging configuration file Number.
Specifically, central directory, central directory that the meta data file is included in the AKU internal structure terminate Local file head, the data descriptor of mark and each file.
The present invention provides a kind of software upgrading update device, including:
Compression unit, for decompressing difference packet to obtain configuration file, meta data file, the differential data text that it includes Part and newly-increased file;
Combining unit, for merged in the form of source data correspond in installation kit the file of the same name that has differences of AKU and Differential data file;
AKU unit is reduced, for reducing AKU according to the merging configuration file in configuration file;
Installation unit, the AKU obtained for installing reduction.
Specifically, the configuration file includes residual quantity configuration file and merges configuration file, wherein:
The residual quantity configuration file, for recording the positional information for the file of the same name being had differences described in installation kit;
The merging configuration file, for recording the file of the same name being had differences described in AKU and the newly-increased file Positional information.
Further, it is described merge configuration file also include be used for record AKU relative to the of the same name of installation kit indifference The positional information of file.
Specifically, central directory, central directory that the meta data file is included in the AKU internal structure terminate Local file head, the data descriptor of mark and each file.
Specifically, the compression unit in installation kit relative to the data of the different file of the same name of AKU compress mode Carry out weight contracting.
Further, the compression unit is using the compression matched with AKU the ginseng being recorded in the merging configuration file Number.
Compared with prior art, the invention has the advantages that:
1st, difference packet acquisition methods of the invention, due to by the file of the same name having differences each other of installation kit and AKU Difference is correspondingly carried out in the form of source data, the variance data of shorter byte is generated to the source data difference of uncoded rearrangement, obtained The smaller difference packet of volume, so that user can be rapidly completed software upgrading upgrading with more saving flow.
2nd, the Merge Scenarios in software upgrading upgrade method of the invention is by the way of zip file internal structure is recombinated, By required file data inside the meta data file and AKU that characterize AKU internal structural information, according to the text recorded Number of packages carries out restructuring reduction AKU according to the positional information inside AKU.The AKU that this method obtains and former AKU It is completely the same, in the absence of any error, the error free continuous upgrading of convenient follow-up more highest version AKU.
3rd, configuration file of the invention records the positional information of file needed for the present invention in installation kit and AKU, can be fast Speed extraction needed for the file of installation kit and AKU, it is often more important that, can accordingly configuration file provide positional information reduction AKU, obtain and the indiscriminate AKU of former AKU.
The additional aspect of the present invention and advantage will be set forth in part in the description, and these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and it is readily appreciated that, wherein:
Fig. 1 is the theory diagram of the software upgrading difference packet acquisition methods of the present invention
Fig. 2 is the theory diagram of the software upgrading upgrade method of the present invention
Fig. 3 is the theory diagram of the software upgrading difference packet acquisition device of the present invention
Fig. 4 is the theory diagram of the software upgrading update device of the present invention
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings.Below by way of reference The embodiment of accompanying drawing description is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art Language and scientific terminology), there is the general understanding identical meaning with the those of ordinary skill in art of the present invention.Should also Understand, those terms defined in such as general dictionary, it should be understood that have with the context of prior art The consistent meaning of meaning, and unless by specific definitions as here, idealization or the implication of overly formal otherwise will not be used To explain.
It will be appreciated by those skilled in the art that " application ", " application program ", " application software " and class alleged by the present invention It is the same concept well known to those skilled in the art like the concept of statement, refers to be instructed by series of computation machine and related data The computer software for being suitable to electronics operation of the organic construction of resource.Unless specified, this name is not in itself by programming language Species, rank, the operating system of operation of also not rely by it or platform are limited.In the nature of things, this genus also not by appoint The terminal of what form is limited.
The present invention will be described in detail for environment of the present invention using the terminal device of android system as embodiment, but The implementation of the present invention is not limited to Android operation system, those skilled in the art can reasonably, it is envisioned that such as Linux, The operating systems such as Windows, as long as the application package of its installation is zip file structure, it is possible to suitable for institute's structure of the present invention All schemes thought, therefore, those skilled in the art will be appreciated that this applies upper accommodation.Hereinafter, will be to all schemes of the present invention Describe in detail one by one:
Referring to Fig. 1, there is disclosed the realization principle of invention software upgrading difference packet acquisition methods, including following step Suddenly:
S11:Installation kit and AKU internal structure are parsed, it is determined that the file and AKU of the same name that have differences each other are relative In the newly-increased file of installation kit, and generate the configuration file for recording those file location informations
Zip file structure is mainly made up of three parts, including central directory, central directory end of identification and compression source document Part.Wherein central directory is made up of multiple subdirectories, the corresponding compression catalogue source data of each subdirectory, records the specific item The description information of record.It is as shown in the table referring to table 1, its internal structure:
Composition Byte length Offset
Core catalogue file leader is known 4 0
Compress the pkware versions used 2 6
Pkware versions needed for decompression 2 6
General position mark 2 8
Compress mode 2 10
The last modification time of file 2 12
File finally changes the date 2 14
CRC-32 is verified 4 16
Size after compression 4 20
Uncompressed size 4 24
Filename length 2 28
Extended field length 2 30
File notes length 2 32
The disk number of file start-position 2 34
Internal file attribute 2 36
External file attribute 4 38
Local header offset 4 42
Catalogue file name Indefinite length m 46
Extended field Indefinite length n 46+m
File notes Indefinite length k 46+m+n
The central directory subdirectory structure of table 1
Installation kit and AKU internal structure are parsed, contrasts the central directory information of installation kit and AKU, detailed process For:Compare the filename field of each subdirectory of the central directory of installation kit and AKU successively;If there is identical, then Compare the CRC-32 check codes field of central directory and the field of uncompressed size, all same is then corresponding to corresponding sub directory difference It is installation kit and the file of the same name having differences in AKU to compress source file, that is, changes file;Differ then corresponding specific item Compression source file corresponding to record respectively is the file of the same name of installation kit and AKU indifference, i.e. same file;If installation kit Middle presence and be not present in AKU, then compression source file is to have been deleted in AKU relative to installation kit corresponding to the subdirectory The file removed, that is, delete file;If being not present in installation kit and existing in AKU, compression source document corresponding to the subdirectory Part is relative to the increased file of installation kit, i.e., newly-increased file in AKU.
The fileinfo not being related to due to the deletion file of installation kit in AKU, therefore any respective handling need not be done, can As irrelevant contents.Modification file and same file belong to the fileinfo that reduction AKU needs to use, therefore need to record peace Modification file location information in dress bag, as residual quantity configuration file;Record simultaneously and file and same file are changed in AKU File location information is increased in positional information, and AKU newly, as merging configuration file.The positional information refers specifically to, each The information such as local header offset, file byte length corresponding to file.Residual quantity configuration file and merging configuration file are collectively referred to as For configuration file.
Below in relation to configuration file, residual quantity configuration file and merge configuration file description unless otherwise specified, refer both to this Locate the configuration file, residual quantity configuration file and merge configuration file.
S12:All internal structural informations of AKU are recorded, generate meta data file
Zip file can be comprising multiple using different compress modes even uncompressed document entity, wherein each file Entity structure is by local file head (Local File Header), file data (File Data) and data descriptor (Data descriptor) three parts form.Wherein when the 3rd position position of local file header, the afterbody of document entity structure Data descriptor just occurs, after compressed data last byte, is served only for that the zip file of output can not be carried out The situation of retrieval.
, will be right in AKU in order to obtain the structural information of AKU because reduction AKU needs to carry out data merging It should be had differences in installation kit or the document entity of the same name of indifference is split, the local file head of gained document entity, data are retouched Symbol, and the meta data file of the composition AKU such as the central directory of AKU, central directory end of identification are stated, is upgraded for recording All internal structural informations of bag.
S13:The file of the same name having differences of decompression installation kit and AKU, will have differences described in both File of the same name difference is correspondingly carried out in the form of source data to obtain differential data file
The existing method for obtaining difference packet, is mainly based upon the installation kit and AKU to not decompressing source data, passes through Difference algorithm directly carries out binary system difference, but because the file source data of zip file structure is after encoded compression, leads Cause the binary code of source data to carry out complicated rearrangement, put so as to cause AKU to be mounted opposite the actual less difference of bag Greatly.For example AKU is mounted opposite bag only change certain module or some bytes, both actual variances are those by more The module or byte changed, but it is encoded after, all data of installation kit and AKU are rearranged with new rule, cause two Person's difference amplify, so as to get delta package volume increase.Therefore, in order to obtain the difference packet of smaller volume, the present invention using pair The source data decompressed in installation kit and AKU carries out difference, i.e., carries out binary system difference to un-encoded initial data, Less actual variance between the two is obtained, generates smaller volume difference packet.
Using general decompression algorithm, the text of the same name being had differences each other in installation kit and AKU is decompressed in order successively The document order of the same name the having differences arrangement of part, wherein installation kit and AKU should be consistent, by the file source data of decompression Difference is correspondingly carried out according to same file name.Difference algorithm herein can use xdelta3, bsdiff, courgette etc. to calculate Method, the present invention illustrate only by taking bsdiff as an example to the differential process.
The jni of android system provides bsdiff differential interfaces:public native String bsdiff(String OldFilePath, String newFilePath, String patchFilePath), wherein oldFilePath represents storage The source data file path for corresponding to the file of the same name that AKU has differences of installation kit, newFilePath represent that storage rises The source data file path for corresponding to the file of the same name that installation kit has differences of level bag, patchFilePath represent that storage is poor The file path of data is measured, calls the interface to obtain both different informations, i.e. differential data file.
S14:The configuration file, meta data file, differential data file and the newly-increased file are compressed, described in acquisition Upgrade difference packet
Due to zip file can include it is multiple using different compress modes even uncompressed document entity, then installation kit There may be following several situations with identical file data in AKU:(1) installation kit data compression and upgrade bag data Do not compress;(2) installation bag data is not compressed and AKU data compression;(3) bag data is installed and upgrading bag data is compressed; (4) bag data is installed and upgrading bag data is not compressed.Situation is planted for (2) and (3), it will usually because of CPU versions, is The reason such as system kernel version difference and its compression parameters difference causes different compressed encoding results, if simply will be uncompressed Data weight is contracted, and complete zip bags are reassembled into differential data, AKU metadata, obtained residual quantity AKU and former AKU It is inconsistent, or even very big difference is had, so as to cause the further upgrading subsequently based on the new AKU of the restructuring to be affected.
In addition, but because installation kit is different with AKU compression parameters, and the compression ginseng of different zip bags can not be known Number, therefore in order to solve the above problems, the compression consistent with AKU is realized, the present invention is to unpressed number of files in installation kit It is compressed according to using certain compression parameters, obtained compression result same file contrast corresponding with AKU, if complete It is complete otherwise to continue to be adapted to using new compression parameters unanimously then to be adapted to successfully, until finding the compression ginseng consistent with AKU Number.The compression parameters that above-mentioned adaptation obtains, which also recorded, to be merged in configuration file.
Differential data file, the AKU obtained to above-mentioned steps increases file, AKU meta data file, residual quantity configuration newly File and merging configuration file are compressed, and obtain the smaller compression difference packet of volume.Wherein, differential data is by installation kit Obtained with the source data difference for the file of the same name being had differences each other in AKU, therefore differential data is unpacked data, institute To be also required to be compressed it to obtain the packet of smaller volume.
For software upgrading difference packet acquisition methods of the present invention, it is listed below some experimental data and carries out analysis saying It is bright:
The experimental data of table 2
Refer to shown in table 2, newly wrap the complete AKU size of big little finger of toe;The current big little finger of toe of difference packet is generated by prior art Difference packet size;Used in the new big little fingers of toe of difference packet courgetteV2 difference packet acquisition methods of the present invention CourgetteV2 difference algorithms carry out the difference packet size of difference generation;The new big little fingers of toe of difference packet bsdiff difference of the present invention Measure the difference packet size for carrying out difference generation in bag acquisition methods using bsdiff difference algorithms;By 100 software kits in table 2 Knowable to experimental data, the difference packet volume of the present invention for upgrading the difference packet that difference packet method generates and generating compared with prior art It is obviously reduced, wherein the present invention is reduced using courgette V2 difference algorithms, amplitude is maximum, and averagely reducing ratio is 44.36%;The present invention uses bsdiff difference algorithms averagely to reduce ratio as 39.55%.
Accordingly, the present invention can provide a kind of software upgrading difference packet acquisition device according to foregoing method, by The modules that the device is realized, each step of this method is realized respectively, can also realize corresponding function.Referring to Fig. 3, Specifically, software upgrading difference packet acquisition device provided by the invention, including configuration file generation unit 11, meta data file Generation unit 12, difference unit 13, compression unit 14 and adaptation unit 15.
The software upgrading difference packet acquisition device is located at service end, and service end is beforehand through the software upgrading residual quantity bag apparatus The upgrading difference packet corresponding to each version installation kit is obtained, waits client to send solicited message and obtains what is matched with its installation kit Upgrade difference packet.
Zip knots are referred specifically to by parsing installation kit and AKU internal structure by configuration file generation unit 11 first Structure, and contrast both central directory information, file of the same name that generation record installation kit and AKU have differences each other and AKU increases the configuration file of the positional information of file newly;Secondly, meta data file generation unit 12 splits every in AKU Individual document entity, all internal structural informations in AKU are recorded, generate meta data file;Then, difference unit 13 uses Difference algorithm calculates the difference between the file of the same name being had differences each other in installation kit and AKU, obtains differential data, its Middle compression unit 14 decompresses the file of the same name being had differences each other in installation kit and AKU, and both are carried out in the form of source data Difference;Finally, the compressed configuration file of compression unit 14, meta data file, differential data file and the newly-increased file, are obtained Upgrade difference packet.
The device also includes adaptation unit 15, for attempting to obtain the compression parameters to match with AKU, and this is pressed Contracting reference record is in merging configuration file.
In addition, the receiving unit of service end receives the software upgrading request that client is sent, the solicited message includes installation The information such as mark, installation kit version number are wrapped, service end is according to solicited message by matching unit and the application in service client database Software is matched, and the difference packet consistent with solicited message is pushed to client by push engine.
In order to which the difference packet obtained using the above method carries out software upgrading upgrading, with reference to Fig. 2, present invention is disclosed one kind The realization principle of software upgrading upgrade method, comprises the following steps:
S11:Difference packet is decompressed, obtains configuration file, meta data file, differential data file that it is included and new Increase file
Difference packet is decompressed, obtains configuration file, meta data file, differential data file and newly-increased file.Configuration text Part includes residual quantity configuration file and merges configuration file, wherein:
The residual quantity configuration file, for recording the positional information for the file of the same name being had differences described in installation kit;
The merging configuration file, for recording the file of the same name being had differences described in AKU and the newly-increased file Positional information.
Meta data file includes central directory in the AKU internal structure, central directory end of identification and each Local file head, the data descriptor of file.
The different information for the file of the same name that differential data file record installation kit and AKU have differences each other.
Newly-increased file refers specifically to the file that AKU increases newly relative to installation kit.
S12:Respective record is obtained from installation kit in the first file location information of configuration file, by the differential data The first file after the file upgrading merged in the form of source data in the form of obtaining source data corresponding with first file
First file refers specifically to the file of the same name being had differences relative to AKU in installation kit, according to configuration text The positional information of residual quantity configuration file record in part extracts the file of the same name from installation kit, decompresses the file of the same name, While differential data file is decompressed, both are subjected to difference merging in the form of source data, the result data of merging is after upgrading The first file, the i.e. file of the same name being had differences relative to installation kit of AKU source data.
The difference merging process can use any relative with difference algorithms in above-mentioned upgrading difference packet acquisition methods The merging algorithm answered, the present embodiment only by taking bspatch instruments corresponding to bsdiff difference algorithms as an example, are said to merging process It is bright.
The jni of Android system provides bspatch and merges interface:public native String bspatch (String oldFilePath, String oldFilePath, String oldFilePath), wherein oldFilePath tables Show the source data file path for corresponding to the file of the same name that AKU has differences of storage installation kit, newFilePath is represented The source data file path for corresponding to the file of the same name that installation kit has differences of storage AKU, patchFilePath are represented The file path of differential data is deposited, calls the interface to obtain the file of the same name for corresponding to installation kit and having differences of AKU Source data.
S13:The file location information recorded according to configuration file, by the meta data file, newly-increased file, the first text Remaining associated documents in part and the installation kit are reduced to AKU
Because the file data of the same name being had differences each other in installation kit and AKU may have following several situations: (1) installation kit data compression and upgrade bag data and do not compress;(2) installation bag data is not compressed and AKU data compression;(3) pacify Dress bag data and upgrading bag data are compressed;(4) bag data is installed and upgrading bag data is not compressed.For (2) and (3) Kind situation, it will usually because the reason such as CPU versions, system kernel version difference and its compression parameters difference causes different compressions Coding result, if simply uncompressed data weight contracted, complete zip bags are reassembled into differential data, AKU metadata, Obtained residual quantity AKU and former AKU is inconsistent, or even has very big difference, so as to cause subsequently to be based on the restructuring new liter The further upgrading of level bag is affected.So need to carry out weight contracting to (2) and (3) kind situation file of installation kit.
The installation package file of (1) kind situation directly decompresses, using uncompressed source data as AKU file data;The (2) and (3) kind situation installation package file first decompress, according still further to merge configuration file record adaptation compression parameters to solution The data of compression carry out weight contracting, as AKU file data;The installation package file of situation is directly as AKU in (4) File data.Installation kit is done into above processing corresponding to the file of the same name that AKU has differences.Meanwhile to phase in installation kit Above-mentioned same treatment is also done for the file of the same name of AKU indifference.
Reduction AKU zip structures process be:Each local file head in meta data file and correspondingly is taken in order Tail data descriptor;Taken from upgrading bag data corresponding with each local file head and corresponding tail data descriptor File data, wherein this document data include by above-mentioned weight contracting processing installation kit in relative to AKU indifference File data of the same name, and the AKU for reducing to obtain by installation kit and differential data had differences relative to installation kit it is same Name file data;The document structure information recorded according to configuration file is merged, separately constitutes different document entities;Finally, press It is new according to AKU central directory, central directory end of identification, each document entity and the AKU recorded in merging configuration file Increase the positional information of file, zip file structure is completed in combination, and reduction obtains the AKU completely the same with former AKU.
S14:The AKU is installed
Software upgrading is realized in the AKU that decompression reduction obtains, installation.
Correspondingly, software upgrading upgrade method can provide a kind of software upgrading update device in accordance with the present invention, should Device realizes corresponding relation between this method to be present, and can reach identical skill with the thinking of modularization and Kernel-based methods Art effect.Therefore, the description for the device that will be carried out below, the principle that will also continue to use the concept of preceding method are carried out.
Referring to Fig. 4, the software upgrading update device of the present invention mainly includes compression unit 11, combining unit 12, reduction AKU unit 13, installation unit 14.
The software upgrading update device is located at client, and client is sent to service end includes installation kit mark, installation The software upgrading solicited message of the information such as version number is wrapped, obtains and receives the matching difference packet of service end transmission, then by the difference Amount bag and former installation kit merge reduction AKU.
The software upgrading update device decompresses difference packet using compression unit 11, obtains its configuration text included Part, meta data file, differential data file and newly-increased file;Combining unit 12 pre-processes to installation kit first, that is, presses The positional informations such as Bureau of Documents's size offset, file byte length according to the residual quantity configuration file record in configuration file, are obtained The file of the same name being had differences relative to AKU of installation kit;Installation kit file of the same name is decompressed by compression unit 11 Contracting, installation kit file of the same name and differential data file are merged in the form of source data, and the merging process is by combining unit 12 are realized using the corresponding algorithm that merges.
Reduction AKU unit 13 takes the structural informations such as file header and data descriptor from the meta data file of difference packet, Learn from else's experience relative to the file data of the same name of AKU indifference in the installation kit of overweight compression processing, and by installation kit and residual quantity The file data of the same name being had differences relative to installation kit for the AKU that data convert obtains, recorded according to configuration file is merged Document structure information, separately constitute different document entities;Then, the AKU center recorded according to merging in configuration file Catalogue, central directory end of identification, each document entity and AKU increase the positional information of file newly, and zip file is completed in combination Structure, reduction obtain the AKU completely the same with former AKU.
During above-mentioned reduction AKU, had differences in the weight contracting installation kit of compression unit 14 relative to AKU or nothing The file of the same name to be compressed different from the compress mode of AKU of difference, i.e., first solve respective file in the installation kit one by one Compression, then re-compressed using the adaptation compression parameters merged in configuration file, obtain the file data consistent with AKU.
Software upgrading is realized in AKU after the decompression reduction of compression unit 14, installation.
Scheme in accordance with the present invention below, there is provided the specific reality of application software renewal upgrade-system of the invention Apply example.
In the specific implementation, mobile device can be by starting mobile data or wireless (such as Wi-Fi communication technology ) etc. WiFi form is connected to server, and server passes through the connection situation that monitoring programme monitors mobile device and server.Its In, the mobile device is a kind of computing device that can be used on the move, such as mobile phone.
In system embodiment of the present invention, mobile device is provided with the client-side program interacted with server (such as 360 mobile phone assistant), the one or more peaces applied installed on mobile device can be read by the client-side program Package informatin is filled, the installation package informatin can include installation kit mark, installation kit version number etc., wherein, the installation kit mark It can be used for judging the installation kit is which kind of application belonged to;The installation kit version number is currently installed on for identifying mobile device Application be which version belonged to;
In concrete application, on off state field 0 and 1 is provided with the configuration file of the client-side program of the mobile device (0 identification switch is closed, and 1 represents that switch is opened), when the client-side program starts, can read the on off state word first The value of section, judges whether the switch is open mode, if switch is open mode, opens the automatic liter to mobile device application Level function, now, client-side program can read the installation package informatin of the application in mobile device automatically.The server preserves There is the application of latest edition that can be installed in a mobile device on the market at present, specifically, server can irregularly or the cycle Property to forum or other download websites crawl latest edition application software installation kit, by the application software of the latest edition Installation kit is stored in the database of server, is city so as to keep the application software installation kit preserved in server database It is newest on face;Latest edition application software installation kit is somebody's turn to do by server with what is preserved before in server database respectively simultaneously The old installation kit of application software each version accordingly, corresponding difference packet is generated according to the difference packet acquisition methods of this programme, For the download renewal of mobile device application.
There is the upgrade application list for user's selection in corresponding mobile device, the upgrade application list can include needing The installation kit mark (or application identities) for the application to be upgraded or the conventional icon of application (for conventional application, use conventional figure The form of mark and application identities enters row-column list prompting, in general application, enters row-column list with the form of application identities and prompts), Installation kit version number, newest installation kit version number, the one or more using information such as descriptions.Have for each application corresponding Selected frame chooses whether to be updated the application for user, and user can select one or more answer in upgrade application list With being upgraded.The corresponding difference packet of the application chosen is downloaded, software provided by the invention is used with corresponding former installation kit Renewal upgrading scheme merges to obtain corresponding application upgrade bag, reinstalls application upgrade bag, realizes the more new liter of respective application Level.
Upgrade-system is updated for above-mentioned application software, is described further by taking " 360 mobile phone assistant " as an example.
It is provided with mobile phone " 360 mobile phone assistant ", mobile phone connection WiFi or unlatching mobile data cube computation, when mobile phone, assistant beats When opening, applications automatic upgrade function is opened, detailed process is:
1. mobile phone assistant reads the installation package informatin of all applications of mobile phone A, the application installation package information of mobile phone A is generated List of application 1;
2. mobile phone assistant extracts each installation kit information of the list of application 1 of mobile phone A, installation kit therein is extracted Mark and installation kit version number are sent to server, and receive the update package informatin that the server returns, the upgrading Installation kit information includes upgrade installation package version number;
3. mobile phone assistant by the upgrade installation package version number compared with the installation kit version number, if the installation Bag version number is less than the upgrade installation package version number, then judges corresponding application to need the application upgraded, and should in upgrading With showing renewable prompting in list;
4. the application of what the upgrade application list display detected renewal in need, the upgrade application list include Application software size, the information such as conventional icon using description, application.User can be by clicking on Update button, " unloading " Button or " ignoring renewal " button choose whether renewal upgrading or directly unload respective application;
5. mobile phone assistant receives " renewal " instruction that user selectes, the corresponding upgrading residual quantity of selected application is downloaded from service end Mobile phone is wrapped, while shows that is applied a download progress bar, prompts the user whether to confirm installation in the moment for downloading completion;
6. mobile phone assistant receives " confirmation " installation instruction that user selectes, by difference packet and former installation kit according to institute of the present invention State software upgrading upgrade method to merge to obtain AKU, and complete installation upgrading.
Certainly, a kind of example of the above-mentioned application upgrade process only as the present invention, it should not be construed as the limit to the present invention System.Scheme of the present invention is applied to the application software of any zip structures, is not limited by system platform.
In current smart mobile phone market, the competition of mobile phone application, in order to be continuously obtained user's favor, Mobile phone application developers have stepped up the renewal upgrading frequency of oneself application.And cellphone subscriber updates application and may require that great number unavoidably Flow, and stand-by period when a number of application together upgrades is also longer, therefore, such as " application precious ", " Android city Field ", " 360 mobile phone assistant " etc. are proposed " province's flow " renewal software function one after another using shop.Using scheme of the present invention It can realize that " province's flow " updates software function.
Described above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (14)

1. a kind of software upgrading difference packet acquisition methods, it is characterised in that comprise the following steps:
Installation kit and AKU internal structure are parsed, it is determined that the file and AKU of the same name that have differences each other are relative to installation kit Newly-increased file, and generate and record the configuration files of those file location informations;The configuration file includes residual quantity configuration file With merge configuration file, wherein:The residual quantity configuration file, for recording the file of the same name being had differences described in installation kit Positional information;The merging configuration file, for recording the file of the same name being had differences described in AKU and the newly-increased text The positional information of part;
All internal structural informations of AKU are recorded, generate meta data file;
The file of the same name having differences of decompression installation kit and AKU, the text of the same name that will be had differences described in both Part correspondingly carries out difference to obtain differential data file in the form of source data;
The configuration file, meta data file, differential data file and the newly-increased file are compressed, obtains the upgrading residual quantity Bag, wherein, by repeatedly attempting to obtain the compression parameters matched with the compression parameters of AKU, and it is recorded in the merging configuration In file;The differential data of the differential data file is compressed using the compression parameters of the matching.
2. software upgrading difference packet acquisition methods according to claim 1, it is characterised in that the merging configuration file is also Include the positional information of the file of the same name relative to installation kit indifference for recording AKU.
3. software upgrading difference packet acquisition methods according to claim 1, it is characterised in that the meta data file includes Local file head, the data of central directory, central directory end of identification and each file in the AKU internal structure Descriptor.
A kind of 4. software upgrading difference packet acquisition device, it is characterised in that including:
Configuration file generation unit, for parsing installation kit and AKU internal structure, it is determined that the text of the same name having differences each other Part and AKU and generate the configuration file for recording those file location informations relative to the newly-increased file of installation kit;It is described to match somebody with somebody Putting file includes residual quantity configuration file and merges configuration file, wherein:The residual quantity configuration file, for recording the institute of installation kit State the positional information for the file of the same name having differences;The merging configuration file, had differences for recording described in AKU File of the same name and the newly-increased file positional information, in addition to compression parameters matched with the compression parameters of AKU;
Meta data file generation unit, for recording all internal structural informations of AKU, generate meta data file;
Difference unit, for decompressing the file of the same name being had differences described in installation kit and AKU, it will be deposited described in both Difference is correspondingly carried out in the form of source data to obtain differential data file in the file of the same name of difference;
Adaptation unit, the compression parameters matched for attempting adaptation with the compression parameters of AKU;
Compression unit, for compressing the configuration file, meta data file, differential data file and the newly-increased file, obtain Obtain the upgrading difference packet.
5. software upgrading difference packet acquisition device according to claim 4, it is characterised in that the merging configuration file is also Include the positional information of the file of the same name relative to installation kit indifference for recording AKU.
6. software upgrading difference packet acquisition device according to claim 4, it is characterised in that the meta data file includes Local file head, the data of central directory, central directory end of identification and each file in the AKU internal structure Descriptor.
7. a kind of software upgrading upgrade method, it is characterised in that comprise the following steps:
Difference packet is decompressed, obtains its configuration file, meta data file, differential data file and newly-increased file for being included; The configuration file includes residual quantity configuration file and merges configuration file, wherein:The residual quantity configuration file, installed for recording The positional information of the file of the same name having differences of bag;The merging configuration file, for recording having differences for AKU The positional information of file of the same name and the newly-increased file;
Respective record is obtained from installation kit in the first file location information of configuration file, by the differential data file and institute State the first file after the corresponding upgrading merged in the form of source data in the form of obtaining source data of the first file;
The file location information recorded according to configuration file, by the meta data file, newly-increased file, the first file and institute Remaining associated documents stated in installation kit are reduced to AKU;It is described reduction upgrading packet procedures also include in installation kit relative to The data of the different file of the same name of AKU compress mode carry out weight contracting, and the weight contracting is configured using the merging is recorded in The compression parameters matched with the compression parameters of AKU in file are compressed;
The AKU is installed.
8. software upgrading upgrade method according to claim 7, it is characterised in that the merging configuration file also includes using In the positional information of the file of the same name relative to installation kit indifference of record AKU.
9. software upgrading upgrade method according to claim 7, it is characterised in that first file refers specifically to installation kit The file of the same name being had differences relative to AKU.
10. software upgrading upgrade method according to claim 7, it is characterised in that remaining in the installation kit is related File is referred specifically in installation kit relative to the file of the same name of AKU indifference.
11. software upgrading upgrade method according to claim 7, it is characterised in that the meta data file includes described The local file head of central directory, central directory end of identification and each file in AKU internal structure, data description Symbol.
A kind of 12. software upgrading update device, it is characterised in that including:
Compression unit, for decompress difference packet with obtain configuration file, meta data file, differential data file that it includes with And newly-increased file;The configuration file includes residual quantity configuration file and merges configuration file, wherein:The residual quantity configuration file, For the positional information for the file of the same name having differences for recording installation kit;The merging configuration file, for recording AKU The file of the same name having differences and the newly-increased file positional information;The compression unit in installation kit relative to upgrading The data of the different file of the same name of packet compression mode carry out weight contracting, using be recorded in the merging configuration file with upgrading The compression parameters of the compression parameters matching of bag are compressed;
Combining unit, correspond to file of the same name and the residual quantity that AKU has differences in installation kit for merging in the form of source data Data file;
AKU unit is reduced, for reducing AKU according to the merging configuration file in configuration file;
Installation unit, the AKU obtained for installing reduction.
13. software upgrading update device according to claim 12, it is characterised in that the merging configuration file also includes For the positional information for the file of the same name relative to installation kit indifference for recording AKU.
14. software upgrading update device according to claim 12, it is characterised in that the meta data file includes described The local file head of central directory, central directory end of identification and each file in AKU internal structure, data description Symbol.
CN201410773855.8A 2014-12-12 2014-12-12 Software upgrading difference packet acquisition methods and corresponding upgrade method and device Expired - Fee Related CN104391728B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410773855.8A CN104391728B (en) 2014-12-12 2014-12-12 Software upgrading difference packet acquisition methods and corresponding upgrade method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410773855.8A CN104391728B (en) 2014-12-12 2014-12-12 Software upgrading difference packet acquisition methods and corresponding upgrade method and device

Publications (2)

Publication Number Publication Date
CN104391728A CN104391728A (en) 2015-03-04
CN104391728B true CN104391728B (en) 2018-01-16

Family

ID=52609636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410773855.8A Expired - Fee Related CN104391728B (en) 2014-12-12 2014-12-12 Software upgrading difference packet acquisition methods and corresponding upgrade method and device

Country Status (1)

Country Link
CN (1) CN104391728B (en)

Families Citing this family (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516764B (en) * 2015-01-27 2018-01-12 上海携程商务有限公司 Compressed file dynamic packaging method and system
CN105205688A (en) * 2015-08-25 2015-12-30 北京网田科技发展有限公司 Automobile information recommendation system
CN106569843A (en) * 2015-10-12 2017-04-19 青岛海信移动通信技术股份有限公司 Method and device for generating OTA central package
CN106658475B (en) * 2015-10-30 2020-07-07 中兴通讯股份有限公司 Method and device for upgrading over-the-air technology
CN105373410B (en) * 2015-12-22 2019-04-30 京信通信系统(中国)有限公司 Base station software difference upgrade method and its device
CN107368290A (en) * 2016-05-12 2017-11-21 阿里巴巴集团控股有限公司 Determine incremental data method and device, updated data package method, apparatus and system
CN106354525B (en) * 2016-08-11 2019-10-01 深圳市宜搜科技发展有限公司 Application software installation kit difference storage method and system
CN106462430B (en) * 2016-08-29 2020-06-02 北京小米移动软件有限公司 Application upgrade package obtaining method and device
CN106775802B (en) * 2016-11-14 2023-04-28 福建天泉教育科技有限公司 Method and system for quickly updating mass small files
CN106686073A (en) * 2016-12-19 2017-05-17 北京东方车云信息技术有限公司 Information processing method and system
CN106791123A (en) * 2016-12-27 2017-05-31 努比亚技术有限公司 User terminal and application processing method
CN106919382A (en) * 2017-01-22 2017-07-04 百度在线网络技术(北京)有限公司 For generating the method and apparatus that application updates bag
CN110083381B (en) * 2018-01-26 2023-04-28 启碁科技股份有限公司 Incremental upgrading method and device
WO2019169587A1 (en) * 2018-03-07 2019-09-12 华为技术有限公司 Method for installing application according to function modules
CN108768662B (en) * 2018-05-30 2021-05-07 格尔软件股份有限公司 Method for adding custom signature to Android APK
CN109032641B (en) * 2018-07-24 2022-07-08 杭州安恒信息技术股份有限公司 Application version updating method and device
CN109144557A (en) * 2018-08-23 2019-01-04 携程旅游信息技术(上海)有限公司 The dynamic increment upgrade method and system of APP
CN109684577A (en) * 2018-12-27 2019-04-26 杭州云英网络科技有限公司 A kind of configuration method of web page contents, system and electronic equipment
CN110032377B (en) * 2019-03-19 2024-06-07 芯讯通无线科技(上海)有限公司 Communication module software upgrading method and system and communication module
CN110147244A (en) * 2019-04-30 2019-08-20 惠州市德赛西威智能交通技术研究院有限公司 A kind of method of vehicle-mounted software upgrading
WO2021097623A1 (en) * 2019-11-18 2021-05-27 深圳市欢太科技有限公司 File processing method and device, and terminal apparatus
CN114402286A (en) * 2019-11-18 2022-04-26 深圳市欢太科技有限公司 File processing method, file processing device and terminal equipment
CN111008028B (en) * 2019-11-22 2022-07-01 杭州数式网络科技有限公司 Software upgrading method, device and storage medium
CN111428465B (en) * 2020-03-24 2023-06-30 国网上海市电力公司 Auxiliary calibration method for direct-current control protection software modification work of converter station
CN112783539B (en) * 2020-04-20 2024-09-10 招商证券股份有限公司 Application updating method, system, terminal equipment and storage medium
CN111898118B (en) * 2020-07-13 2024-04-26 北京中软华泰信息技术有限责任公司 Automatic deduction-based linux software security upgrading system and method
CN112256315A (en) * 2020-10-16 2021-01-22 中国第一汽车股份有限公司 Upgrading method, device, equipment and storage medium
CN112416406B (en) * 2020-11-30 2023-06-23 腾讯科技(深圳)有限公司 Terminal equipment upgrading method, device, terminal equipment and medium
CN112612492A (en) * 2020-12-18 2021-04-06 百望股份有限公司 Remote upgrading method for enterprise invoice software system
CN112579140A (en) * 2020-12-22 2021-03-30 四川虹微技术有限公司 Software upgrading method and device
CN113568650A (en) * 2021-07-21 2021-10-29 联合汽车电子有限公司 Method for upgrading ECU through OTA
CN114339108A (en) * 2021-12-29 2022-04-12 天地伟业技术有限公司 Upgrading method of network hard disk video recorder and upgrading packet output device
CN114401248B (en) * 2022-03-24 2022-07-01 中国电子科技集团公司第二十八研究所 Rapid synchronization method for system reorganization address book based on Beidou broadcast

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1956482B1 (en) * 2007-02-09 2011-08-17 Telefonaktiebolaget LM Ericsson Generating delta updates for a processing device
CN102799445A (en) * 2012-05-03 2012-11-28 陈昊 Application upgrading method based on Android platform and system
CN103647816A (en) * 2013-12-03 2014-03-19 北京奇虎科技有限公司 Method and device for upgrading application software
CN103699410A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Method and device for updating application programs
WO2014086311A1 (en) * 2012-12-06 2014-06-12 Tencent Technology (Shenzhen) Company Limited Method and system for software upgrade

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1956482B1 (en) * 2007-02-09 2011-08-17 Telefonaktiebolaget LM Ericsson Generating delta updates for a processing device
CN102799445A (en) * 2012-05-03 2012-11-28 陈昊 Application upgrading method based on Android platform and system
WO2014086311A1 (en) * 2012-12-06 2014-06-12 Tencent Technology (Shenzhen) Company Limited Method and system for software upgrade
CN103647816A (en) * 2013-12-03 2014-03-19 北京奇虎科技有限公司 Method and device for upgrading application software
CN103699410A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Method and device for updating application programs

Also Published As

Publication number Publication date
CN104391728A (en) 2015-03-04

Similar Documents

Publication Publication Date Title
CN104391728B (en) Software upgrading difference packet acquisition methods and corresponding upgrade method and device
US8700803B2 (en) Web page optimization
US8533154B2 (en) Method and system for server synchronization with a computing device
CN106815370B (en) Method, device and system for updating resource file
CN100447740C (en) System and method for intra-package delta compression of data
US7836396B2 (en) Automatically collecting and compressing style attributes within a web document
US20110167173A1 (en) Optimal Compression Process Selection Methods
US9563634B2 (en) System and method of compressing data in font files
WO2014101451A1 (en) Incremental upgrade method, apparatus for applying method and storage medium
US20210144226A1 (en) Partial downloads of compressed data
EP2863593B1 (en) A method, apparatus and computer program for modifying messages in a communications network
CN105740016B (en) Increment issuing method and device, upgrading method and device of application program
CN103713928A (en) Incremental file generating method, and application program installing file updating method and device
TW201734780A (en) Mobile terminal application update method and device
CN101984405A (en) Method of software version upgrade and terminal and system
US7257649B2 (en) Method and system for transferring information during server synchronization with a computing device
CN112181471A (en) Differential upgrading method and device, storage medium and computer equipment
CN110020281A (en) Method for loading target resource file of browser
CN105740298A (en) File processing method and apparatus, and server-side equipment
US20130039252A1 (en) Preprocessor for file updating
CN116647447A (en) Application program hot update method and device, intelligent device and storage medium
CN106775802B (en) Method and system for quickly updating mass small files
CN111970161B (en) Internet of things application differential upgrading method based on address prediction
CN106708581A (en) Application update package generation method and device and application update method and device
CN118784732A (en) Data transmission processing method, device, equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180116

Termination date: 20211212

CF01 Termination of patent right due to non-payment of annual fee