Content of the invention
In view of the above problems, the present invention propose delta file generation method, application program installation file update method and
Device, the delta file that this delta file generation method, application program installation file update method and device generate is little, saves
Server and mobile terminal delivery flow rate.
According to an aspect of the invention, it is provided it is a kind of civilian for the increment of application program updating in server execution
Part generation method, including:After getting new edition application compressed package, decompress described new edition application compressed package with
And locally stored old edition application compressed package, obtain new edition application installation file and old edition application
Installation file;And
Based on new edition application installation file and old edition application installation file, generate delta file,
Described delta file includes file header and file body, and described file header comprises new edition application installation file
Version information, described file body is used for storing the information of upgrade file of each file in new edition application installation file.
Wherein, described new edition application compressed package and old edition application compressed package solution are depressed into two files
Folder.
Wherein, based on new edition application installation file and old edition application installation file, generate delta file
Including:
For each file in old edition application installation file;
Inquiry whether there is the file of the same name under same catalogue in new edition application installation file;
Have that filename is identical under the same catalogue of new edition application installation file but literary composition that file MD5 value is different
During part, based on this corresponding differential file of two file generateds, differential file is processed the filename of label information, this document
Claim, store path and differential file write in the file body of delta file as the information of upgrade file of this document;
Have that filename is identical and file MD5 value identical literary composition under the same catalogue of new edition application installation file
During part, same file is processed label information, the file name of this document and store path as the upgrade file letter of this document
Breath writes in described delta file;
When there is not any file with same file name in new edition application installation file, then by this document
File name, store path and delete file process label information as this document information of upgrade file write described increment
In file;
For each file in new edition application installation file,
Inquiry inquiry in legacy version installation file whether there is the file of the same name under same catalogue, in old edition intrinsic safety
In dress file when inquiring about less than file of the same name, by the file name of this document, store path, newly-increased file process label information and
File data writes in described delta file as the information of upgrade file of this document.
According to another aspect of the present invention, there is provided a kind of application program installation file in mobile terminal execution updates
Method, including:
After receiving delta file from server, read legacy version installation file corresponding with this delta file, described
Delta file is to be generated according to the above-mentioned delta file generation method of the present invention;
Based on delta file, legacy version installation file is updated obtaining redaction installation file.
Wherein, based on delta file, legacy version installation file is updated obtain redaction installation file including:
Read the information of upgrade file in file body from delta file, described information of upgrade file includes file process mark
Note information, routing information and file content;
When the file process label information being read is newly-increased file process label information, according to the path letter being read
Breath and file content, current file is added in the file of legacy version installation file respective path;
When the file process label information being read processes label information for differential file, according to the path letter being read
Breath, searches the respective file in legacy version installation file, and generates redaction based on corresponding old edition presents and differential file
File;
When the file process label information being read is to delete file process label information, according to the path letter being read
Breath, deletes the legacy version installation file under this path;
When the file process label information being read processes label information for same file, according to the path letter being read
Breath, is not processed to this document under this path of legacy version installation file.
This method also includes:Software upgrading is carried out according to redaction installation file.
Wherein, described file header comprises the MD5 value of redaction installation file, and legacy version installation file is updated obtaining
Also include after redaction installation file:
It is compressed to updating the redaction installation file obtaining, generate the MD5 value of redaction installation file compressed file;
And
When the MD5 value of the redaction installation file compressed file being generated is identical with the MD5 value in described file header, really
Redaction installation file verification obtained by recognizing is qualified.
Wherein, described file header comprises the MD5 value of legacy version installation file, and described delta file is server in response to moving
Dynamic terminal updates according to the application program installation file that version number and the MD5 value of locally stored legacy version installation file are initiated please
Ask and issue.
According to another aspect of the present invention, there is provided a kind of delta file generating means for application program updating,
Including:
Decompression units, for, after getting new edition application compressed package, decompressing described new edition application pressure
Contracting bag and locally stored old edition application compressed package, obtain new edition application installation file and legacy version should
Use program installation file;
Delta file signal generating unit, for installing literary composition based on new edition application installation file with old edition application
Part, generates delta file.
Wherein, described delta file signal generating unit includes:
First acquisition module, for obtaining the fileinfo of each file in old edition application installation file;
First enquiry module, for according to the fileinfo in the old edition application installation file obtaining, inquiry exists
Whether there is the file of the same name under same catalogue in new edition application installation file;
First writing module, is configured to:
Have that filename is identical under the same catalogue of new edition application installation file but literary composition that file MD5 value is different
During part, based on this corresponding differential file of two file generateds, differential file is processed the filename of label information, this document
Claim, store path and differential file write in the file body of delta file as the information of upgrade file of this document;
Have that filename is identical and file MD5 value identical literary composition under the same catalogue of new edition application installation file
During part, same file is processed label information, the file name of this document and store path as the upgrade file letter of this document
Breath writes in described delta file;
When there is not any file with same file name in new edition application installation file, then by this document
File name, store path and delete file process label information as this document information of upgrade file write described increment
In file;
Second acquisition module, for obtaining the fileinfo of each file in new edition application installation file;
Second enquiry module, for according to the fileinfo in the new edition application installation file obtaining, in old edition
In this installation file, inquiry whether there is the file of the same name under same catalogue, and the second writing module, in old edition
When inquiring about in this installation file less than file of the same name, the file name of the new edition application installation file that this is obtained, deposit
Storage path, newly-increased file process label information and file data write described delta file as the information of upgrade file of this document
In.
According to another aspect of the present invention, there is provided a kind of application program installation file updating device, described more new clothes
Install and be placed in mobile terminal, including:
Legacy version installation file reading unit, for after receiving delta file from server, reading and this increment literary composition
Part corresponding legacy version installation file, described delta file is to be generated according to the above-mentioned delta file generation method of the present invention;
Installation file updating block, based on delta file, is updated to legacy version installation file obtaining redaction installation
File.
Wherein, described installation file updating block includes:
Delta file read module, for reading the information of upgrade file in file body, described upgrading from delta file
Fileinfo includes file process label information, routing information and file content;
Redaction installation file merges module, is configured to
When the file process label information being read is newly-increased file process label information, according to the path letter being read
Breath and file content, current file is added in the file of legacy version installation file respective path;
Process label information in the file process label information being read for differential file constantly, according to the path letter reading
Breath, searches corresponding file in legacy version installation file, and generates redaction based on corresponding old edition presents and differential file
File;
When the file process label information being read is to delete file process label information, according to the path letter being read
Breath, deletes the legacy version installation file under this path;
When the file process label information being read processes label information for same file, according to the path letter being read
Breath, is not processed to the file under this path of legacy version installation file.
Wherein, application program installation file updating device also includes file MD5 value generation module, for obtain to renewal
Redaction installation file is compressed, and generates the MD5 value of redaction installation file compressed file;
Correction verification module, in the MD5 value of the redaction installation file compressed file being generated and described file header
When MD5 value is identical, the redaction installation file verification obtained by confirming is qualified.
Wherein, application program installation file updating device, also includes:
Update request sending module, for mobile terminal according to the version number of locally stored legacy version installation file and
The application program installation file that MD5 value is initiated updates request.
In order to realize above-mentioned and related purpose, the delta file generation method that the present invention provides, application program install literary composition
Part update method and device.By server, new edition application compressed package and old edition application compressed package decompression are obtained
New edition application installation file and old edition application installation file, the increasing of the file generated after being then based on decompressing
Amount file, client is stored in local old edition application installation file and delta file based on it after receiving delta file
Inverse composition new edition application installation file.Due to being should by new edition application compressed package and legacy version by server
Obtain new edition application installation file and old edition application installation file with program compaction bag decompression, be then based on
The delta file of the file generated after decompression, so delta file is little, server is also little to the data of client transmissions, saves
Delivery flow rate.
The feature that will be explained in below and be particularly pointed out in the claims.Description below and accompanying drawing describe in detail
Some illustrative aspects of the present invention.However, the various sides that the principle of the present invention only can be used of these aspects instruction
Some modes in formula.Additionally, it is contemplated that including all these aspects and their equivalent.
Specific embodiment
Various aspects of the disclosure is described below.It is to be understood that teaching herein can be had with varied form
Body embodies, and any concrete structure disclosed herein, function or both are only representational.Religion based on this paper
Lead, those skilled in the art it is to be understood that one aspect disclosed herein can be realized independent of any other aspect,
And the two or more aspects in these aspects can combine in various manners.It is, for example possible to use it is described in this paper
Any number of aspect, realizes device or puts into practice method.Further, it is possible to use other structures, function or except described here
One or more aspects outside or be not one or more aspects described herein 26S Proteasome Structure and Function, realize this device
Or put into practice this method.Additionally, any aspect described herein can include at least one element of claim.
Each embodiment of the present invention is described below with reference to accompanying drawings.
Fig. 1 be the present invention a kind of server execution for application program updating delta file generation method flow process
Figure.
As shown in Figure 1 the present invention a kind of server execution for application program updating delta file generation side
Method, including:
Step S1, after getting new edition application compressed package, decompress described new edition application compressed package with
And locally stored old edition application compressed package, obtain new edition application installation file and old edition application
Installation file.
In this step, new edition application compressed package can be that program developer sends to server.Namely open
Originator sends after new edition application compressed package to server, inquires about locally stored old edition application compressed package, looks into
When having ask legacy version application program compressed package, decompress described new edition application compressed package and locally stored legacy version
Application program compressed package, obtains new edition application installation file and old edition application installation file.In server
If the old edition application compressed package of multiple versions that are stored with, each old edition application compressed package is required for solving
Pressure.The new edition application installation file obtaining after decompression and old edition application installation file are usually binary system literary composition
Part.
Step S2, based on new edition application installation file and old edition application installation file, generates increment literary composition
Part, described delta file includes file header and file body, and described file header comprises the version of new edition application installation file
Information, described file body is used for storing the information of upgrade file of each file in new edition application installation file.
The present embodiment a kind of server execution for application program updating delta file generation method, by servicing
New edition application compressed package and old edition application compressed package decompression are obtained new edition application installation file by device
And old edition application installation file, the delta file of the file generated after being then based on decompressing, the delta file of generation
Little, server is also little to the data of client transmissions, saves delivery flow rate.
Fig. 2 be the present invention a kind of server execution for the delta file generation method of application program updating step
The flow chart of rapid S2.
As shown in Fig. 2 step S2 is based on new edition application installation file and old edition application installation file, raw
Delta file is become to include:
Step S200 obtains the fileinfo of the file in old edition application installation file.Due to old edition this application journey
Sequence installation file comprises much individual subfiles, so the file chosen in this step can be the random file chosen.For example
Can be E:\a\...\assets\location_public_key.der.
The inquiry of step S201 whether there is the literary composition of the same name under same catalogue in new edition application installation file
Part.The meaning of same catalogue here it should be say relatively the same.The catalogue of such as legacy version installation file decompression is E:A,
The decompression catalogue of redaction installation file is E:B, and in step S200 obtain file catalogue be E:a\c\...\
Assets, and the catalogue of its corresponding redaction installation file be E:B c ... assets, then when comparison here
Higher level's two-stage catalogue of both of these documents should be ignored, in the present invention same catalogue refer to c ... assets identical.
In the case of there is file of the same name under the same catalogue of new edition application installation file, enter step S202 and sentence
Whether disconnected file MD5 value is identical.Before judging whether file MD5 value is identical, first have to generate the MD5 value of two files, can
To generate before implementing in the present invention it is also possible to generate in the decompression procedure of step S1 of the present invention, the MD5 value of file is base
File content in two files generates, and generation method is common method, the present invention no longer describes in detail.
When MD5 value is different then it is assumed that the content of two files has differences, enters step S203 and be based on this two files
Generate corresponding differential file, differential file is processed label information, the file name of this document, store path and differential file
Information of upgrade file as this document writes in the file body of delta file.Here by generalized delta algorithm bsdiff life
Become the differential file of two files, the present invention can also be that other general delta algorithm generates the differential file of two files.
When judging that MD5 value is identical then it is assumed that two files are identical file, entering step S204 will be identical
File process label information, the file name of this document and store path write described increasing as the information of upgrade file of this document
In amount file.
When there is not file of the same name under the same catalogue of new edition application installation file, now legacy version installs literary composition
In part, this file needs to delete, and enters step S205 afterwards and by the file name of this document, store path and deletes at file
Reason label information writes in described delta file as the information of upgrade file of this document.
Complete S203, after the completion of any one step of S204, S205, enter step S206 and judge that old edition application is installed
There is untreated file in file.Here judge to have in old edition application installation file the untreated file can be
By way of traveling through file, the catalogue according to file judges whether currently processed file carries out S201's to S205 above one by one
Process.For example currently processed file is location_public_key.der, and its catalogue is E:A ... d assets, judge
This document needs to delete, then that complete is S200, S201, S205 of abovementioned steps, and step S206 is to first determine whether E afterwards:\
A ... assets whether have file without above flow processing under catalogue, then continue to judge E:\a\...\
Assets catalogue upper level catalogue E:A ... d in whether have the file not carrying out the above file process of flow processing,
Until E:All Files under a catalogue has inquired about the file all not processed then it is assumed that old edition application installs literary composition
There is no untreated file in part.There is untreated file under a careless catalogue, then enter step S207 and obtain legacy version
The fileinfo of next untreated file in application program installation file, return to step S203 afterwards.
If there is no untreated file in old edition application installation file, entering step S208 and obtaining new edition
The fileinfo of the file in application installation file, acquisition here is also random acquisition.E.g. E:b\c\...\
F armeabi xxx.so, afterwards step S209 judge in legacy version installation file whether there is same under same catalogue
Name file.Here the judgement of same catalogue is as judgement above.Legacy version installation file is inquired about less than file of the same name
When then it is assumed that this document is newly-increased file, enter step S210 by the file name of this document, store path, newly-increased file
Reason label information and file data write in described delta file as the information of upgrade file of this document.
Enter step S211 afterwards and judge whether there is untreated file in new edition application installation file.Here
The determination methods of untreated file, as determination methods above, are to determine whether without S209 and S210 step
Processed, if there is no untreated file, then terminated.If there is untreated file, then enter step S212 and obtain
Take the fileinfo of next untreated file in new edition application installation file, return to step S209 afterwards.
Judging when there is the file of the same name being located under same catalogue in legacy version installation file in step S209, no
Process, process ends.
From above-mentioned steps it can be seen that being the delta file based on the file generated after decompressing the present embodiment, delta file
Little.Make server also little to the data of client transmissions, save flow.
Fig. 3 is a kind of flow chart of application program installation file update method in mobile terminal execution of the present invention.
Fig. 4 is an embodiment flow chart before implementation steps S3 in Fig. 3 of the present invention.
A kind of application program installation file update method in mobile terminal execution of the present invention includes as shown in Figure 3, Figure 4
Step:
Step S3, after receiving delta file from server, reads legacy version corresponding with this delta file and installs literary composition
Part.Delta file described in this step is to be generated according to above-described embodiment, is server according to answering getting redaction
After program compaction bag, decompress described new edition application compressed package and the compression of locally stored old edition application
Bag, obtains new edition application installation file and old edition application installation file, based on new edition application peace
The delta file that dress file is generated with old edition application installation file.
If locally only store the compressed file of legacy version installation file in mobile terminal in this step, then
First have to during execution step S3 for the compressed file of legacy version installation file to carry out decompression obtain legacy version installation file, Ran Houcai
Described legacy version installation file can be read.
Described delta file includes file header and file body, and described file header comprises new edition application installation file
Version information, described file body is used for storing the information of upgrade file of each file in new edition application installation file.
Included step S300 before S3, mobile terminal according to the version number of locally stored legacy version installation file and
MD5 value is initiated application program installation file and is updated request.The locally stored legacy version sending mobile terminal to server is installed
The purpose of the version number of file and MD5 value is to be verified (step S301) for server to this legacy version installation file.Verification
Purpose is whether the legacy version installation file of the mobile terminal storage judging to ask upgrading is that official issues.If mobile terminal
The version number of the legacy version installation file of storage in the locally stored version number of legacy version installation file and MD5 value and server
And MD5 value correspondence then thinks that verification is passed through, after verification is passed through, enter the version according to legacy version installation file for the step S302 server
This number corresponding delta file of lookup.The preferred embodiments of the present invention are when software publisher issues latest edition installation file
When, the delta file that will generate latest edition installation file with all legacy version installation files stores on the server, for example,
When the software version that software publisher issues latest edition installation file is V2.3, and the version of legacy version installation file has
V2.0, V1.9, V1.8, V1.0, server will generate the increment of V2.3 installation file and V2.0, V1.9, V1.8, V1.0 respectively
File.Storage is on the server.Can not find appropriate version delta file when, then enter generate delta file program, that is, before
The S1 of face embodiment, S2 step.
After finding corresponding delta file, server to mobile terminal send delta file enter step S3 or, look for
To after corresponding delta file, enter the download address that step S303 server sends delta file to mobile terminal, afterwards
Step S304 mobile terminal downloads delta file according to the download address of the delta file receiving, request, just enters step afterwards
S3.
After completing S3, enter step S4, based on delta file, legacy version installation file is updated obtaining redaction
Installation file.This process is the inverse process of delta file generating process.It is mobile terminal based on its locally stored old edition intrinsic safety
Dress file and delta file generate redaction installation file.
After completing step S4, the redaction installation file needing further exist for renewal is obtained is compressed, and generates redaction
The MD5 value (step S5) of installation file compressed file.After generating the MD5 value of redaction installation file compressed file, it is step S6,
Confirm the new edition intrinsic safety comprising in the MD5 value of redaction installation file compressed file generating and the file header of described delta file
File MD5 is identical for dress, if the same thinks that the redaction installation file verification that mobile terminal to update obtains is qualified.
What deserves to be explained is in the redaction installation file of server side generation and the delta file of legacy version installation file
Before, server can carry out pretreatment to redaction installation file, is sent out using specific compression algorithm compressed software publisher
The redaction installation file of cloth, generates the MD5 value of redaction installation file.And will be generated when generating delta file
Redaction installation file MD5 value write delta file header file in.So obtaining to mobile terminal to update above-mentioned
Redaction installation file is carried out in step S5 of checking procedure, is compressed to updating the redaction installation file obtaining, generates
The MD5 value of redaction installation file compressed file.The compression algorithm that it adopts must be entered to redaction installation file with server
The compression algorithm that redaction installation file during row pretreatment, software publisher issued is compressed adopting is identical.Specific calculation
Method is compressed using algorithm commonly used in the prior art.
After completing to update the verification of redaction installation file obtaining, enter step S7, entered according to redaction installation file
Row software upgrading.
The application program installation file update method that the present invention provides.Using by server, new edition application is compressed
Bag and old edition application compressed package decompression obtain new edition application installation file and the installation of old edition application
File, be then based on decompress after the delta file of file generated and mobile terminal its be stored in local old edition application
Installation file inverse composition new edition application installation file.Due to be by server by new edition application compressed package and
Old edition application compressed package decompression obtains new edition application installation file and old edition application installation file,
The delta file of the file generated after being then based on decompressing, so delta file is little, the data that server transmits to mobile terminal
Also little, save delivery flow rate.
Fig. 5 is a kind of the detailed of step S4 of application program installation file update method in mobile terminal execution of the present invention
Thin flow chart.
Based on delta file, legacy version installation file is updated obtaining redaction installation file as shown in Figure 5, including
Step S500, reads the information of upgrade file in file body from delta file.Described information of upgrade file includes file process
Label information, routing information and file content.
It is step S501 afterwards, determine that upgrade file processes type.Here it is to wrap according in the information of upgrade file reading
The file process label information containing to determine upgrade file process type.
When the file process label information being read is newly-increased file process label information, enter step S502, according to
The routing information being read and file content, current file is added in the file of legacy version installation file respective path.
When the file process label information being read processes label information for differential file, enter step S503, according to
The routing information being read, searches the respective file in legacy version installation file, and is based on corresponding old edition presents and difference
File generated new edition file.The process generating new edition file based on corresponding old edition presents and differential file of this step
It is the inverse process of previous embodiment step S203, that is, if step S203 uses delta algorithm bsdiff and generates two
The differential file of file, then this step is to generate new edition file using the inverse operation of bsdiff algorithm.If step S203
It is the differential file generating two files using other general delta algorithm, then correspondence is the inverse fortune of other difference algorithms
Calculate.
When the file process label information being read is to delete file process label information, enter step S504, according to
The routing information being read, deletes the legacy version installation file under this path.
When the file process label information being read processes label information for same file, enter step S505, according to
The routing information being read, is not processed to this document under this path of legacy version installation file.
Above-described embodiment completes the installation file of mobile terminal with new process, due to being to compress new edition application
After bag and old edition application compressed package decompression, obtain new edition application installation file and old edition application peace
Dress file is the delta file based on the file generated after decompressing, and delta file is little.The data that mobile terminal receives is also little, saves
Delivery flow rate.
Fig. 6 is the block diagram of the delta file generating means for application program updating of the present invention.
As shown in fig. 6, the delta file generating means of the present invention include:Decompression units 600, for getting redaction
After application program compressed package, decompress described new edition application compressed package and the compression of locally stored old edition application
Bag, obtains new edition application installation file and old edition application installation file.Described new edition application pressure
Contracting bag can be that program developer sends to server.Namely developer sends new edition application pressure to server
After contracting bag, inquire about locally stored old edition application compressed package, when having inquired legacy version application program compressed package, decompression
Unit 600 decompresses described new edition application compressed package and locally stored old edition application compressed package, obtains new
Version application program installation file and old edition application installation file.If being stored with the old of multiple versions in server
Version application program compressed package, then decompression units 600 need to each old edition application compressed package decompress.Obtain after decompression
New edition application installation file and old edition application installation file be usually binary file.
Delta file signal generating unit 601, for being pacified with old edition application based on new edition application installation file
Dress file, generates delta file, and described delta file includes file header and file body, and described file header comprises new edition this application journey
The version information of sequence installation file, described file body is used for storing the liter of each file in new edition application installation file
Level fileinfo.
A kind of delta file generating means of the present embodiment are arranged at server, and decompression units are by new edition application pressure
After contracting bag and old edition application compressed package decompression, obtain new edition application installation file and old edition application
Installation file, the delta file based on the file generated after decompression for the delta file signal generating unit.By being then based on file generated
Delta file, so delta file is little.Make the data that server transmits to mobile terminal also little, save flow.
Fig. 7 shows one embodiment block diagram of delta file signal generating unit of the present invention.
Delta file signal generating unit 601 includes as shown in Figure 7:First acquisition module 6011, the first enquiry module 6012,
One writing module 6013, the second acquisition module 6014, the second enquiry module 6015 and the second enquiry module 6015.
First acquisition module 6011, the file for obtaining the All Files in old edition application installation file is believed
Breath.Because old edition application installation file comprises much individual subfiles, so the literary composition chosen in the first acquisition module 6011
Part is to be the random file chosen.Can be for example E:\a\...\assets\location_public_key.der.
First enquiry module 6012 is used for inquiry and whether there is positioned at same mesh in new edition application installation file
File of the same name under record.The meaning of same catalogue here it should be say relatively the same.Such as legacy version installation file decompression
Catalogue is E:A, the decompression catalogue of redaction installation file is E:B, and in step S200 obtain file catalogue be E:
A c ... assets, and the catalogue of its corresponding redaction installation file be E:B c ... assets, then here than
Higher level's two-stage catalogue of both of these documents should be ignored when relatively, in the present invention same catalogue refer to c ... assets phase
With.
First writing module 6013 is configured to there is file under the same catalogue of new edition application installation file
Name is identical but during file that file MD5 value is different, based on this corresponding differential file of two file generateds, differential file processed
Label information, the file name of this document, store path and differential file write increment as the information of upgrade file of this document
In the file body of file.
Have that filename is identical and file MD5 value identical literary composition under the same catalogue of new edition application installation file
During part, same file is processed label information, the file name of this document and store path as the upgrade file letter of this document
Breath writes described delta file.
Whether mutually the same compare MD5 value in the present embodiment, first have to generate the MD5 value of two files, can be in the present invention
Generate before enforcement it is also possible to generate during decompression units 600 decompressing files of the present invention, the MD5 value of file is base
In two files file content generate, generation method no longer describes in detail for the common method present invention.
When there is not any file with same file name in new edition application installation file, then by this document
File name, store path and delete file process label information as this document information of upgrade file write described increment
In file.
Second acquisition module 6014 is used for obtaining the fileinfo of each file in new edition application installation file;
It is also random acquisition that second acquisition module 6014 obtains first file of new edition application installation file.E.g. E:b\
C ... f armeabi xxx.so, be to judge under this catalogue, whether there are other untreated files, if any then afterwards
After the completion of entering the whole process of file under next resume module, current directory, whether have other under inquiry upper level catalogue
Untreated file, completes until All Files is all processed.
Second enquiry module 6015 is used for according to the fileinfo in the new edition application installation file obtaining, old
In version installation file, inquiry is with the presence or absence of the file of the same name under same catalogue.
When second writing module 6016 is used for inquiring about less than file of the same name in legacy version installation file, by this obtain new
The file name of version application program installation file, store path, newly-increased file process label information and file data are as this
The information of upgrade file of file writes described delta file.
Fig. 8 is the enforcement block diagram of the application program installation file updating device of the present invention.
As shown in figure 8, described application program installation file updating device includes:Legacy version installation file reading unit 800,
For, after receiving delta file from server, reading legacy version installation file corresponding with this delta file, described increment
File is that aforementioned delta file signal generating unit 601 generates.Described delta file includes file header and file body, described file header
Comprise the version information of new edition application installation file, described file body is used for storing new edition application installation file
In each file information of upgrade file.
If locally only store the compressed file of legacy version installation file in mobile terminal in the present embodiment, then
Before legacy version installation file reading unit 800 reads legacy version installation file corresponding with this delta file, first having to will be old
The compressed file of version installation file carries out decompression and obtains legacy version installation file, then could read described legacy version and install literary composition
Part.
Installation file updating block 801, based on delta file, is updated obtaining new edition intrinsic safety to legacy version installation file
Dress file.
Application program installation file updating device as the preferred embodiment present invention also includes:Update request and send mould
Block 804, the application program peace initiated according to version number and the MD5 value of locally stored legacy version installation file for mobile terminal
Dress file updates request.Send version number and the MD5 value of the locally stored legacy version installation file of mobile terminal to server
Purpose be for server, this legacy version installation file to be verified.Verification purpose is that the mobile terminal judging request upgrading is deposited
Whether the legacy version installation file of storage is that official issues.If the version of the locally stored legacy version installation file of mobile terminal
Number and MD5 value corresponding with the version number of legacy version installation file of storage and MD5 value on server, think that verification is passed through.
Application program installation file updating device as the preferred embodiment present invention also includes:File MD5 value generates
Module 802, the redaction installation file for obtaining to renewal is compressed, and generates redaction installation file compressed file
MD5 value.
Correction verification module 803, in the MD5 value of the redaction installation file compressed file being generated and described file header
MD5 value identical when, confirm obtained by redaction installation file verification qualified.
What deserves to be explained is server side delta file signal generating unit 601 generate redaction installation file and legacy version
Before the delta file of installation file, server can carry out pretreatment to redaction installation file, is calculated using specific compression
The redaction installation file that method compressed software publisher issues, generates the MD5 value of redaction installation file.And generating increment
When file, the MD5 value of the redaction being generated installation file is write in the header file of delta file.So above-mentioned right
When the redaction installation file that the correction verification module 803 of mobile terminal obtains to renewal verifies, first will be to more to mobile terminal
The redaction installation file newly obtaining is compressed generating the MD5 value of redaction installation file compressed file.Now it adopts
Compression algorithm must carry out to redaction installation file during pretreatment, the redaction that software publisher issues being installed with server
The compression algorithm that file is compressed adopting is identical.Specific algorithm is compressed using algorithm commonly used in the prior art.
The embodiment block diagram of installation file updating block in the application program installation file updating device of Fig. 9 present invention.
As shown in figure 9, installation file updating block includes:Delta file read module 8010, for from delta file
Read the information of upgrade file in file body, described information of upgrade file includes file process label information, routing information and literary composition
Part content.
Redaction installation file merges module 8011, is configured to
When the file process label information being read is newly-increased file process label information, according to the path letter being read
Breath and file content, current file is added in the file of legacy version installation file respective path;
Process label information in the file process label information being read for differential file constantly, according to the path letter reading
Breath, searches corresponding file in legacy version installation file, and generates redaction based on corresponding old edition presents and differential file
File;
When the file process label information being read is to delete file process label information, according to the path letter being read
Breath, deletes the legacy version installation file under this path;
When the file process label information being read processes label information for same file, according to the path letter being read
Breath, is not processed to the file under this path of legacy version installation file.
The installation file that above-described embodiment completes mobile terminal updates, due to be by new edition application compressed package and
Obtain new edition application installation file after old edition application compressed package decompression and old edition application installs literary composition
Part, is the delta file based on the file generated after decompressing, and delta file is little.The data that mobile terminal receives is also little, saves
Delivery flow rate.
Additionally, typically, mobile terminal of the present invention can be various hand-held terminal devices, such as mobile phone, individual number
Word assistant (PDA).
Additionally, the method according to the invention is also implemented as by processor (such as CPU) execution in mobile terminal
Computer program, and store in a memory in the mobile terminal.It is when executed by this computer program, execute basis
The above-mentioned functions limiting in the method for invention.
Additionally, the method according to the invention is also implemented as a kind of computer program, this computer program
Including computer-readable medium, it is stored with the computer-readable medium for executing limit in the method for the present invention above-mentioned
The computer program of function.
Additionally, said method step and system unit can also utilize controller and make controller real for storage
The computer readable storage devices of the computer program of existing above-mentioned steps or Elementary Function are realized.
Those skilled in the art will also understand is that, in conjunction with the various illustrative logical blocks described by disclosure herein, mould
Block, circuit and algorithm steps may be implemented as electronic hardware, computer software or a combination of both.Hard in order to clearly demonstrate
Part and this interchangeability of software, the function with regard to various exemplary components, square, module, circuit and step it is entered
Go general description.This function is implemented as software and is also implemented as hardware depending on concrete application and applying
Design constraint to whole system.Those skilled in the art can realize described in every way for every kind of concrete application
Function, but this realize decision and should not be interpreted as causing a departure from the scope of the present.
Although content disclosed above shows the exemplary embodiment of the present invention, it should be noted that without departing substantially from power
On the premise of profit requires the scope of the present invention limiting, may be many modifications and change.Real according to invention described herein
Function, step and/or the action of applying the claim to a method of example are not required to execute with any particular order.Although additionally, the present invention
Element with the description of individual form or can require, it is also contemplated that multiple, unless explicitly limited for odd number.
Although describing to be described according to each embodiment of the present invention above with reference to figure, people in the art
Member should be appreciated that each embodiment that the invention described above is proposed, and can also do on the basis of without departing from present invention
Go out various improvement.Therefore, protection scope of the present invention should be determined by the content of appending claims.