CN104978215A - File updating method, relevant equipment and system - Google Patents

File updating method, relevant equipment and system Download PDF

Info

Publication number
CN104978215A
CN104978215A CN201410529184.0A CN201410529184A CN104978215A CN 104978215 A CN104978215 A CN 104978215A CN 201410529184 A CN201410529184 A CN 201410529184A CN 104978215 A CN104978215 A CN 104978215A
Authority
CN
China
Prior art keywords
delta package
version number
target
file
terminal
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.)
Granted
Application number
CN201410529184.0A
Other languages
Chinese (zh)
Other versions
CN104978215B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410529184.0A priority Critical patent/CN104978215B/en
Publication of CN104978215A publication Critical patent/CN104978215A/en
Application granted granted Critical
Publication of CN104978215B publication Critical patent/CN104978215B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a file updating method, which comprises the following steps: a server receives an updating request sent from a terminal, wherein the updating request comprises a current version number and a target version number of a file to be updated; if an incremental package set associated with the current version number and the target version number is in the presence in a preset database, an incremental package with a minimum size is selected from the incremental package set as a target incremental package, wherein the incremental package set comprises at least two incremental packages, and the types of incremental updating algorithms used by all incremental packages are different; and the server returns an updating response to the terminal, wherein the updating response comprises the target incremental package and the type of the incremental updating algorithm used by the target incremental package. The embodiment of the invention also discloses relevant equipment and system. Network flow consumed by file updating can be effectively reduced.

Description

A kind of file updating method, relevant device and system
Technical field
The present invention relates to internet arena, particularly relate to a kind of file updating method, relevant device and system.
Background technology
The quantity of the software that current terminal is installed gets more and more, and brings great convenience to the life of user.In the use procedure of software, server can regularly publish the software of redaction, the software of the legacy version of prompting user more on new terminal, if user downloads the meeting that whole new version softwares carries out upgrading consume a large amount of network traffics.
In order to the consumption reducing network traffics proposes a kind of increment updating method, software in terminal needs renewal to make, the delta package that server adopts a certain Incremental Updating Algorithm to obtain between new edition file and legacy version file, delta package is sent to terminal, and terminal utilizes delta package to synthesize new edition file.But due to the difference of file structure, the delta package not having a kind of Incremental Updating Algorithm to generate always is less than other Incremental Updating Algorithm, and the network traffics consumed during file update are still larger.
Summary of the invention
Embodiment of the present invention technical matters to be solved is, provides a kind of update method of file.The problem that when can solve file update, network flow consumption is larger.
In order to solve the problems of the technologies described above, embodiments provide a kind of update method of file, comprising:
The update request that server receiving terminal sends, described update request comprises: the current version of file to be updated number and target version number;
If exist and number delta package set associated with described target version number of described current version in the database preset, from described delta package set, choose the minimum delta package of size as target delta package; Wherein, described delta package set comprises at least two delta package, and the Incremental Updating Algorithm type that each delta package uses is not identical;
Described server returns to described terminal and upgrades response, the described Incremental Updating Algorithm type upgrading response and comprise described target delta package and the use of described target delta package.
Correspondingly, the embodiment of the present invention additionally provides a kind of server, comprising:
Receiver module, for the update request that receiving terminal sends, described update request comprises: the current version of file to be updated number and target version number;
Choose module, if for existing and number delta package set associated with described target version number of described current version in default database, choose the minimum delta package of size as target delta package from described delta package set; Wherein, described delta package set comprises at least two delta package, and the Incremental Updating Algorithm type that each delta package uses is not identical;
Returning module, upgrading response for returning to described terminal, the described Incremental Updating Algorithm type upgrading response and comprise described target delta package and the use of described target delta package.
Accordingly, the embodiment of the present invention additionally provides a kind of update method of file, comprising:
Terminal obtains current version number and the target version number of file to be updated, and sends update request to server; Wherein, described update request comprises described current version number and described target version number;
Described terminal receives the renewal response that described server returns according to described current version number and described target version number, describedly upgrades response and comprises the Incremental Updating Algorithm type that target delta package and described target delta package use;
Described file to be updated is updated to described target version number by described current version number according to described target delta package by described terminal.
Accordingly, the embodiment of the present invention additionally provides a kind of terminal, comprising:
Sending module, for obtaining current version number and the target version number of file to be updated, and sends update request to server; Wherein, described update request comprises described current version number and described target version number;
Receiver module, for receiving the renewal response that described server returns according to described current version number and described target version number, describedly upgrading response and comprises the Incremental Updating Algorithm type that target delta package and described target delta package use;
Synthesis module, for being updated to described target version number by described file to be updated by described current version number according to described target delta package.
Implement the embodiment of the present invention, there is following beneficial effect:
Server is according to the current version of file to be updated in terminal number and target version number, the current version number delta package set associated with target version number whether is present in Query Database, delta package set comprises at least two delta package, the Incremental Updating Algorithm type that each delta package uses is not identical, the delta package that server selects size minimum from the delta package set of association is as target delta package, the Incremental Updating Algorithm type notification that target delta package and target delta package use by server is to terminal, the file of the Incremental Updating Algorithm type synthesis target version number used according to application target delta package and its to make terminal.Like this, server, by sacrificing Time and place resource, chooses the target delta package that the size that meets terminal requirements is minimum, to save traffic consumes and the download time of terminal.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of the update method of a kind of file that first embodiment of the invention provides;
Fig. 2 is the schematic flow sheet of the update method of a kind of file that second embodiment of the invention provides;
Fig. 3 is the schematic flow sheet of the update method of a kind of file that third embodiment of the invention provides;
Fig. 4 is the schematic flow sheet of the update method of a kind of file that fourth embodiment of the invention provides;
Fig. 5 is the schematic flow sheet of the update method of a kind of file that fifth embodiment of the invention provides;
Fig. 6 is the structural representation of a kind of server that first embodiment of the invention provides;
Fig. 7 is the structural representation of a kind of server that second embodiment of the invention provides;
Fig. 8 is the structural representation choosing module in Fig. 7;
Fig. 9 is the structural representation of a kind of terminal that first embodiment of the invention provides;
Figure 10 is the structural representation of a kind of terminal that second embodiment of the invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
In the embodiment of the present invention, terminal can be PC (Personal Computer, personal computer), notebook computer, mobile phone, PAD (panel computer), intelligent wearable device, car-mounted terminal etc.
See Fig. 1, the schematic flow sheet of the update method of a kind of file provided for first embodiment of the invention, in embodiments of the present invention, described method comprises:
The update request that S101, server receiving terminal send, described update request comprises: the current version of file to be updated number and target version number.
Concrete, file to be updated can be audio file, video file, text or program installation file etc.Terminal obtains the current version number of local file to be updated, and the version number of the file to be updated issued by contrast server judges whether to need to upgrade, and the version number that server is issued comprises all version numbers of file to be updated.If the file to be updated in terminal needs to upgrade, terminal to server sends update request, and update request is for being updated to target version number by the file to be updated in terminal by current version number, and target version number is higher than current version number.In the application scenarios of reality, target version number can be the most top version number that file to be updated is issued at server.
If exist and number delta package set associated with described target version number of described current version in the database that S102 presets, from described delta package set, choose the minimum delta package of size as target delta package; Wherein, described delta package set comprises at least two delta package, and the Incremental Updating Algorithm type that each delta package uses is different.
Concrete, multiple delta package set is stored in the database preset, each delta package set associative has lowest version number and top version number, each delta package set comprises at least two delta package, to be server adopt Incremental Updating Algorithm to obtain according to the file of lowest version number and the file of top version number to delta package, delta package use Incremental Updating Algorithm type to comprise in Hdiff, BSDiff, Exsdiff and bzip2 any one, the Incremental Updating Algorithm type that each delta package uses is not identical.Whether there is the delta package set associated in the database that server is preset for key word of the inquiry inquiry according to the current version of file to be updated number and target version number, if exist, server chooses the minimum target delta package of size from the delta package set of association.
Can find out, server chooses the minimum target delta package of size from delta package set, and flow required when terminal upgrades local file to be updated is minimum, and under identical speed of download, required download time is also the shortest.
S103, described server return to described terminal and upgrade response, the described Incremental Updating Algorithm type upgrading response and comprise described target incremental update bag and the use of described target delta package.
Wherein, after server chooses target delta package in delta package set, directly target delta package can be returned to terminal; Or after server chooses target delta package in delta package set, the memory address of notification terminal target delta package, server returns target delta package to terminal after receiving the download request of terminal.Terminal calls the file to be updated of local current version and the file of target delta package synthesis target version, the file of the composition algorithm synthesis target version that the Incremental Updating Algorithm type selecting that terminal uses according to target delta package is corresponding, building-up process prior art is existing to be described, and repeats no more herein.
Implement embodiments of the invention, server is according to the current version of file to be updated in terminal number and target version number, the current version number delta package set associated with target version number whether is present in Query Database, delta package set comprises at least two delta package, the Incremental Updating Algorithm type that each delta package uses is not identical, the delta package that server selects size minimum from the delta package set of association is as target delta package, the Incremental Updating Algorithm type notification that target delta package and target delta package use by server is to terminal, the file of the Incremental Updating Algorithm type synthesis target version number used according to application target delta package and its to make terminal.Like this, server, by sacrificing Time and place resource, chooses the target delta package that the size that meets terminal requirements is minimum, to save traffic consumes and the download time of terminal.
See Fig. 2, the schematic flow sheet of the update method of a kind of file provided for second embodiment of the invention, in embodiments of the present invention, described method comprises:
The update request that S201, server receiving terminal send, described update request comprises: the current version of file to be updated number, target version number and actual performance parameter.
Concrete, actual performance parameter refers to hardware configuration parameter and/or the software configuration parameter of terminal, the actual performance parameter of terminal comprise in the memory size of terminal, CPU frequency and OS Type one or more.When terminal needs updating file, update request is sent to server, update request comprises: the actual performance parameter of the current version of file to be updated number, target version number and terminal, wherein, the target version of file to be updated number higher than current version number, the update request that server receiving terminal sends.
Exemplary, file to be installed is the installation file of instant communication software, the actual performance parameter of terminal acquisition self: memory size 1G, CPU frequency 1.0GHz, in terminal, the current version number of installation file is v1.0, the version number of the announced installation file of server is v1.0, v2.0 and v3.0, shows that the installation file in terminal can be updated to v2.0 or v3.0 by current v1.0.Suppose that terminal needs installation file to be updated to v3.0 by v1.0, terminal to server sends update request, update request comprises current version v1.0, the target version v3.0 of installation file and the actual performance parameter of terminal: memory size 1G, CPU frequency 1GHz, server receives the update request comprising above-mentioned parameter, from update request, resolve above-mentioned parameter.
It should be noted that, after server receives the update request of terminal, can the second cryptographic hash of file to be updated on the first cryptographic hash of file to be updated on comparison terminal and server, if the first cryptographic hash and the second cryptographic hash unequal, then show that the file to be updated in terminal is not identical with the file to be updated on server, terminal cannot utilize the file of local file to be updated and delta package synthesis target version number, now adopt the scheme of full dose increment, namely the file of target version number is directly sent to terminal by server, terminal replaces the file to be updated of current version number, complete by current version number to the renewal process of target version number.
The described current version number index list item associated with described target version number whether is there is in the database that S202, judgement are preset.
Concrete, index list item and delta package set associative, index list item comprises the size for representing each delta package in delta package set, the Incremental Updating Algorithm type used, the record of demand performance parameter and memory address, often kind of Incremental Updating Algorithm is different to the Capability Requirement of terminal, demand performance Parametric Representation terminal utilizes delta package to synthesize hardware configuration parameter and/or the software configuration parameter of the minimum requirements of the file demand fulfillment of target version number, if the demand that the actual performance parameter of terminal cannot meet this delta package forms parameter, terminal normally cannot synthesize the file of target version number.The searching keyword of index list item comprises first version number and the second edition number, server generates the delta package between the installation file of first version number and the second edition number respectively according to number of different types Incremental Updating Algorithm, the set of multiple delta package composition delta package, generates the index list item of delta package set according to the Incremental Updating Algorithm type of the size of delta package each in delta package set, demand performance parameter, use and memory address.Whether server exists for key word of the inquiry inquiry the index list item associated with the current version of file to be updated number and target version number, if exist, performs S207, if do not exist, performs S203.
It should be noted that, the local data base of the server that the database preset can be built-in, can be also external remote data base, the present invention be restricted.
Exemplary, the file of installation file is called netscape, the version number of installation file to be updated in terminal is v1.0, the version number of the announced installation file of server is v1.0, v2.0 and v3.0, two delta package set are provided with in the database preset, be respectively the first delta package set and the second delta package set, it is delta package between v3.0 that first delta package set comprises installation file that version number is v1.0 and version number, server uses at least two kinds of different Incremental Updating Algorithm types to generate delta package in the first delta package set, the quantity of the quantity of the delta package in the first delta package set and the Incremental Updating Algorithm type of use is equal, first delta package set associative has index list item, the searching keyword of this index list item is v1.0 and v3.0, second delta package set comprises the delta package between installation file that installation file that version number is v2.0 and version number are v3.0, server uses at least two kinds of different Incremental Updating Algorithm types to generate delta package in the second delta package set, the quantity of the quantity of the delta package in the second delta package set and the Incremental Updating Algorithm type of use is equal, second incremental update bag is associated with index list item, and the searching keyword of this index list item is v2.0 and v3.0.As shown in Table 1 and Table 2, the index list item of the first delta package set stored in database and the index list item of the second delta package set is respectively:
Table 1
Table 2
Terminal to server sends update request, if update request comprises current version v1.0, the target version v3.0 of installation file and the actual performance parameter of terminal: memory size 512M, CPU frequency 1GHz, be present in the index list item (table 1) that current version v1.0 associates with target version v3.0 in server lookup database, perform S207; If update request comprises current version v1.0, the target version v2.0 of installation file and the actual performance parameter of terminal: memory size 512M, CPU frequency 1GHz, the database that server lookup is preset finds there is not the index list item associated with target version v2.0 with current version v1.0, performs S203.
S203, at least two delta package corresponding according at least two kinds of Incremental Updating Algorithm generations preset.
Concrete, server generates and at least two delta package according at least two kinds of Incremental Updating Algorithm preset, and the data of delta package equal the quantity of Incremental Updating Algorithm type, and delta package is the delta package between the file to be updated of current version number and target version number.
Exemplary, current version number is v1.0, target version number is v2.0, the Incremental Updating Algorithm preset comprises Hdiff, Exediff, Bsdiff, RTPath, Xdelta and bzip2, and server generates 6 delta package between the file to be updated of v1.0 and v2.0 according to above-mentioned 6 kinds of Incremental Updating Algorithm.
S204, using described at least two delta package as with number delta package set associated with described target version number of described current version.
S205, to be stored to described in described default database with the current version number delta package set associated with described target version number.
S206, Incremental Updating Algorithm type, demand performance parameter and memory address according to the size of each delta package in described delta package set, use generate the index list item of described incremental update bag set.
Wherein, the index list item of the incremental update bag set of generation is as shown in table 3:
Table 3
The index list item of generation is stored in default database by server, and the form of the memory address of delta package can be URL address.
Exist and number delta package set associated with described target version number of described current version in S207, described default database.
Wherein, inquire and the current version number index list item associated with target version number, namely determine in database, to be present in the current version number delta package set associated with target version number.
S208, determine from described delta package set the delta package satisfying the demands performance parameter according to the actual performance parameter of described terminal.
Concrete, server is according to the delta package satisfying the demands performance parameter in the actual performance parameter choose delta package set of terminal.
Exemplary, as shown in table 1, the actual performance parameter of terminal is memory size 512M, CPU frequency 1GHz, the delta package determining to satisfy the demands performance parameter according to the index record of table 1 be numbered 1,2,3,4 and 6 delta package.
S209, choose the minimum delta package of size as target delta package from described satisfying the demands the delta package of performance parameter.
Concrete, server satisfies the demands the size of the delta package of performance parameter, from wherein choosing the minimum delta package of size as target delta package according to acquisition in index list item.
Exemplary, satisfy the demands performance parameter delta package be in table 1 be numbered 1,2,3,4 and 6 delta package, known according to table 1, the size of above-mentioned delta package is respectively 5.4M, 4.6M, 5.0M, 6.5M and 4.0M, the size being numbered the delta package of 6 is minimum, choose be numbered 6 delta package as target delta package.
S210, described server return to described terminal and upgrade response, the described Incremental Updating Algorithm type upgrading response and comprise described target delta package and the use of described target delta package.
Wherein, after server chooses target delta package in delta package set, directly target delta package can be returned to terminal; Or after server chooses target delta package in delta package set, the memory address of notification terminal target delta package, server returns target delta package to terminal after receiving the download request of terminal.Terminal calls the file to be updated of local current version and the file of target delta package synthesis target version, the file of the composition algorithm synthesis target version that the Incremental Updating Algorithm type selecting that terminal uses according to target delta package is corresponding, building-up process prior art is existing to be described, and repeats no more herein.
Such as, the target delta package that server is chosen be in table 1 be numbered 6 delta package, the type bzip2 of Incremental Updating Algorithm that the delta package and this delta package that are numbered 6 use is returned to terminal by server, and terminal calls the synthesis program corresponding with bzip2 Incremental Updating Algorithm by the file of the file synthesis target version to be updated of target delta package and current version.
Implement embodiments of the invention, server is according to the current version of file to be updated in terminal number and target version number, the current version number delta package set associated with target version number whether is present in Query Database, delta package set comprises at least two delta package, the Incremental Updating Algorithm type that each delta package uses is not identical, the delta package that server selects size minimum from the delta package set of association is as target delta package, the Incremental Updating Algorithm type notification that target delta package and target delta package use by server is to terminal, the file of the Incremental Updating Algorithm type synthesis target version number used according to application target delta package and its to make terminal.Like this, server, by sacrificing Time and place resource, chooses the target delta package that the size that meets terminal requirements is minimum, to save traffic consumes and the download time of terminal.
See Fig. 3, the schematic flow sheet of the update method of a kind of file provided for the embodiment of the present invention three, in embodiments of the present invention, described method comprises:
S301, terminal obtain current version number and the target version number of file to be updated, and send update request to server; Wherein, described update request comprises described current version number and described target version number.
Wherein, when terminal detects that file to be updated needs to upgrade, the target version number that the current version number and needing obtaining file to be updated is updated to, and send update request to server, update request comprises current version number and the target version number of file to be updated.
S302, described terminal receive the renewal response that described server returns according to described current version number and described target version number, describedly upgrade response and comprise the Incremental Updating Algorithm type that target delta package and described target delta package use.
Wherein, target incremental update bag is delta package, the target delta package that terminal reception server sends and the Incremental Updating Algorithm type that target delta package uses between the file of the file to be updated of current version number and target version number.
Described file to be updated is updated to described target version number by described current version number according to described target delta package by S303, described terminal.
Wherein, after server chooses target delta package in delta package set, directly target delta package can be returned to terminal; Or after server chooses target delta package in delta package set, the memory address of notification terminal target delta package, server returns target delta package to terminal after receiving the download request of terminal.Terminal calls the file to be updated of local current version and the file of target delta package synthesis target version, the file of the composition algorithm synthesis target version that the Incremental Updating Algorithm type selecting that terminal uses according to target delta package is corresponding, building-up process prior art is existing to be described, and repeats no more herein.
Implement embodiments of the invention, when the file of terminal needs to upgrade, current version number and the target version number of file to be updated is sent to server, server returns target delta package according to current version target version number, and terminal is according to the file of the file synthesis target version to be updated of target delta package and current version number number.Terminal does not need to download complete file, thus the consumption of minimizing and flow and download time.
See Fig. 4, the schematic flow sheet of the update method of a kind of file provided for third embodiment of the invention, in embodiments of the present invention, described method comprises:
S401, terminal obtain current version number and the target version number of file to be updated, and send update request to server; Wherein, described update request comprises described current version number, described target version number and actual performance parameter.
Wherein, actual performance parameter refers to hardware configuration parameter and/or the software configuration parameter of terminal, the actual performance parameter of terminal comprise in the memory size of terminal, CPU frequency and OS Type one or more.
S402, described terminal receive the renewal response that described server returns according to described current version number and described target version number, describedly upgrade response and comprise the Incremental Updating Algorithm type that target delta package and described target delta package use;
Described file to be updated is updated to described target version number by described current version number according to described target delta package by S403, described terminal.
S404, obtain the first cryptographic hash of the file of the described target version number after upgrading, and obtain second cryptographic hash of file of described target version on described server number.
Concrete, terminal calculates the first cryptographic hash of the file of the target version after upgrading number according to the hash algorithm preset, and server stores the second cryptographic hash obtained after the file of employing hash algorithm identical with terminal to target version number calculates.
Whether S405, more described first cryptographic hash be equal with described second cryptographic hash.
Wherein, if the first cryptographic hash and the second cryptographic hash unequal, show that the file of target version on the file of target version that terminal is synthesized number and server number is inconsistent, may be make a mistake in building-up process, the target version file that terminal is synthesized cannot normally use.If the first cryptographic hash is equal with the second cryptographic hash, show that the file of the file of target version that terminal is synthesized number and the target version on server number is consistent, the file of target version after synthesis number can normally use.
S406, display update success message.
S407, display update failed message.
Implement embodiments of the invention, when the file of terminal needs to upgrade, current version number and the target version number of file to be updated is sent to server, server returns target delta package according to current version target version number, and terminal is according to the file of the file synthesis target version to be updated of target delta package and current version number number.Terminal does not need to download complete file, thus the consumption of minimizing and flow and download time.
See Fig. 5, be the process flow diagram of a kind of file updating method that the embodiment of the present invention five provides, in embodiments of the present invention, described method comprises:
S1, terminal obtain current version number and the target version number of file to be updated.
Concrete, file to be updated can be audio file, video file, text or program installation file etc.Terminal obtains the current version number of local file to be updated, and the version number of the file to be updated issued by contrast server judges whether to need to upgrade, and the version number that server is issued comprises all version numbers of file to be updated.If the file to be updated in terminal needs to upgrade, terminal obtains the current version target version number of file to be updated.
S2, terminal to server send update request, and update request comprises current version number and target version number.
Concrete, terminal to server sends update request, and update request is for being updated to target version number by the file to be updated in terminal by current version number, and target version number is higher than current version number.In the application scenarios of reality, target version number can be the most top version number that file to be updated is issued at server.
The current version number delta package set associated with target version number is present in the database that S3, server lookup are preset.
Multiple delta package set is stored in the database preset, each delta package set associative has lowest version number and top version number, each delta package set comprises at least two delta package, to be server adopt Incremental Updating Algorithm to obtain according to the file of lowest version number and the file of top version number to delta package, delta package use Incremental Updating Algorithm type to comprise in Hdiff, BSDiff, Exsdiff and bzip2 any one, the Incremental Updating Algorithm type that each delta package uses is not identical.
S4, server choose the minimum delta package of size as target delta package from delta package set.
Wherein, the delta package set associated whether is there is in the database that server is preset for key word of the inquiry inquiry according to the current version of file to be updated number and target version number, if exist, server chooses the minimum target delta package of size from the delta package set of association.
Can find out, server chooses the minimum target delta package of size from delta package set, and flow required when terminal upgrades local file to be updated is minimum, and under identical speed of download, required download time is also the shortest.
S5, server return to terminal and upgrade response, upgrade the Incremental Updating Algorithm type that response comprises target delta package and the use of target delta package.
Wherein, after server chooses target delta package in delta package set, directly target delta package can be returned to terminal; Or after server chooses target delta package in delta package set, the memory address of notification terminal target delta package, server returns the Incremental Updating Algorithm type of target delta package and the use of target delta package after receiving the download request of terminal to terminal.
S6, according to target delta package, file to be updated is updated to target version number by current version number.
Wherein, the file of the composition algorithm synthesis target version that the Incremental Updating Algorithm type selecting that terminal uses according to target delta package is corresponding, building-up process prior art is existing to be described, and repeats no more herein.
Implement embodiments of the invention, server is according to the current version of file to be updated in terminal number and target version number, the current version number delta package set associated with target version number whether is present in Query Database, delta package set comprises at least two delta package, the Incremental Updating Algorithm type that each delta package uses is not identical, the delta package that server selects size minimum from the delta package set of association is as target delta package, the Incremental Updating Algorithm type notification that target delta package and target delta package use by server is to terminal, the file of the Incremental Updating Algorithm type synthesis target version number used according to application target delta package and its to make terminal.Like this, server, by sacrificing Time and place resource, chooses the target delta package that the size that meets terminal requirements is minimum, to save traffic consumes and the download time of terminal.
See Fig. 6, be the structural representation of a kind of server that first embodiment of the invention provides, in embodiments of the present invention, described server comprises receiver module 10, chooses module 11 and return module 12.
Receiver module 10, for the update request that receiving terminal sends, described update request comprises: the current version of file to be updated number and target version number.
Choose module 11, if for existing and number delta package set associated with described target version number of described current version in default database, choose the minimum delta package of size as target delta package from described delta package set; Wherein, described delta package set comprises at least two delta package, and the Incremental Updating Algorithm type that each delta package uses is not identical.
Returning module 12, upgrading response for returning to described terminal, the described Incremental Updating Algorithm type upgrading response and comprise described target delta package and the use of described target delta package.
The embodiment of the present invention and embodiment of the method one belong to same design, and its technique effect brought is also identical, specifically please refer to the description of embodiment of the method one, repeats no more herein.
See Fig. 7 and Fig. 8, for the structural representation of a kind of server that second embodiment of the invention provides, in embodiments of the present invention, described server, except comprising receiver module 10, choosing module 11 and returning except module 12, also comprises generation module 13, relating module 14 and memory module 15.
Generation module 13, if for not existing in described default database and number delta package set associated with described target version number of described current version, at least two kinds of Incremental Updating Algorithm according to presetting generate at least two delta package;
Relating module 14, for using described at least two delta package as with number delta package set associated with described target version number of described current version;
Memory module 15, for being stored to number delta package set associated with described target version number of described current version in described default database.
Optionally, memory module 15 is also for obtaining the size of each delta package in described delta package set, the Incremental Updating Algorithm type of use and memory address; The index list item of described delta package set is generated according to the size of each delta package, the Incremental Updating Algorithm type of use and memory address in described delta package set.
Optionally, choose module 11 comprise query unit 111 and choose unit 112.
Query unit 111, whether exist and the described current version number index list item associated with described target version number for inquiring about in described default database, if yes, then determine to exist and number delta package set associated with described target version number of described current version in described default database;
Choose unit 112, for choosing the minimum delta package of size as target delta package according to being recorded in described delta package set in described index list item; Wherein, described index list item comprises at least two records, and every bar record comprises the size of delta package, the Incremental Updating Algorithm type of use and memory address.
Optionally, described update request also comprises: the actual performance parameter of described terminal, and in described index list item, every bar record also comprises: demand performance parameter;
Described unit 112 of choosing is specifically for determining to satisfy the demands the delta package of performance parameter from described delta package set according to the actual performance parameter of described terminal; The minimum delta package of size is chosen as target delta package from described satisfying the demands the delta package of performance parameter.
The embodiment of the present invention and embodiment of the method two belong to same design, and its technique effect brought is also identical, specifically please refer to the description of embodiment of the method two, does not repeat herein.
See Fig. 9, be the structural representation of a kind of terminal that first embodiment of the invention provides, described terminal comprises sending module 20, receiver module 21 and synthesis module 22 in embodiments of the present invention.
Sending module 20, for obtaining current version number and the target version number of file to be updated, and sends update request to server; Wherein, described update request comprises described current version number and described target version number.
Receiver module 21, for receiving the renewal response that described server returns according to described current version number and described target version number, describedly upgrading response and comprises the Incremental Updating Algorithm type that target delta package and described target delta package use.
Synthesis module 22, for being updated to described target version number by described file to be updated by described current version number according to described target delta package.
The embodiment of the present invention and embodiment of the method three belong to same design, and its technique effect brought is also identical, specifically please refer to the description of embodiment of the method three, repeats no more herein.
See Figure 10, for the structural representation of a kind of terminal that second embodiment of the invention provides, in embodiments of the present invention, described terminal, except comprising sending module 20, receiver module 21 and synthesis module 22, also comprises acquisition module 23, comparison module 24, first display module 25 and the second display module 26.
Acquisition module 23, for obtaining the first cryptographic hash of the file of the described target version after renewal number, and obtains second cryptographic hash of file of described target version on described server number.
Whether comparison module 24 is equal with described second cryptographic hash for more described first cryptographic hash.
First display module 25, if be yes for the comparative result of described comparison module, display update success message.
Second display module 26, if be no for the comparative result of described comparison module, display update failed message.
The embodiment of the present invention and embodiment of the method four belong to same design, and its technique effect brought is also identical, specifically please refer to the description of embodiment of the method four, repeats no more herein.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above disclosedly be only a kind of preferred embodiment of the present invention, certainly the interest field of the present invention can not be limited with this, one of ordinary skill in the art will appreciate that all or part of flow process realizing above-described embodiment, and according to the equivalent variations that the claims in the present invention are done, still belong to the scope that invention is contained.

Claims (20)

1. a update method for file, is characterized in that, comprising:
The update request that server receiving terminal sends, described update request comprises: the current version of file to be updated number and target version number;
If exist and number delta package set associated with described target version number of described current version in the database preset, from described delta package set, choose the minimum delta package of size as target delta package; Wherein, described delta package set comprises at least two delta package, and the Incremental Updating Algorithm type that each delta package uses is not identical;
Described server returns to described terminal and upgrades response, the described Incremental Updating Algorithm type upgrading response and comprise described target delta package and the use of described target delta package.
2. the method for claim 1, is characterized in that, also comprises:
If there is not the target delta package set associated with described target version number with described current version number in described default database, at least two kinds of Incremental Updating Algorithm types according to presetting generate at least two corresponding delta package;
Using described at least two delta package as with number delta package set associated with described target version number of described current version;
Be stored to number delta package set associated with described target version number of described current version in described default database.
3. method as claimed in claim 2, is characterized in that, described using described at least two delta package set as number delta package set associated with described target version number of described current version, also comprise:
Obtain the size of each delta package in described delta package set, the Incremental Updating Algorithm type of use and memory address;
The index list item of described delta package set is generated according to the size of each delta package, the Incremental Updating Algorithm type of use and memory address in described delta package set.
4. the method as described in claim 1-3 any one, it is characterized in that, if exist and number delta package set associated with described target version number of described current version in described default database, from described delta package set, choose the minimum delta package of size comprise as target delta package:
Inquire about in described default database and whether exist and the described current version number index list item associated with described target version number, if yes, determine to exist and number delta package set associated with described target version number of described current version in described default database;
The minimum delta package of size is chosen as target delta package according to being recorded in described delta package set in described index list item; Wherein, described index list item comprises at least two records, and every bar record comprises the size of delta package, the Incremental Updating Algorithm type of use and memory address.
5. method as claimed in claim 4, it is characterized in that, described update request also comprises: the actual performance parameter of described terminal, and in described index list item, every bar record also comprises: demand performance parameter;
Describedly in described delta package set, determine that the minimum delta package of size comprises as target delta package according to described index list item:
Actual performance parameter according to described terminal determines from described delta package set the delta package satisfying the demands performance parameter;
The minimum delta package of size is chosen as target delta package from described satisfying the demands the delta package of performance parameter.
6. method as claimed in claim 5, it is characterized in that, described actual performance parameter and described demand performance parameter comprise: one or more in memory size, CPU frequency and OS Type.
7. a file updating method, is characterized in that, comprising:
Terminal obtains current version number and the target version number of file to be updated, and sends update request to server; Wherein, described update request comprises described current version number and described target version number;
Described terminal receives the renewal response that described server returns according to described current version number and described target version number, describedly upgrades response and comprises the Incremental Updating Algorithm type that target delta package and described target delta package use;
Described file to be updated is updated to described target version number by described current version number according to described target delta package by described terminal.
8. method as claimed in claim 7, it is characterized in that, described update request also comprises the actual performance parameter of described terminal;
The current version number that described terminal obtains file to be updated also comprises with target version number:
Described terminal obtains described actual performance parameter, and wherein, described actual performance parameter comprises: one or more in the memory size of described terminal, CPU frequency and OS Type.
9. as claimed in claim 7 or 8 method, is characterized in that, described terminal also comprises after according to described target delta package described file to be updated being updated to described target version number by described current version number:
Obtain the first cryptographic hash of the file of the described target version number after upgrading, and obtain second cryptographic hash of file of described target version on described server number;
Whether more described first cryptographic hash is equal with described second cryptographic hash;
If yes, display update success message;
If NO, display update failed message.
10. a server, is characterized in that, comprising:
Receiver module, for the update request that receiving terminal sends, described update request comprises: the current version of file to be updated number and target version number;
Choose module, if for existing and number delta package set associated with described target version number of described current version in default database, choose the minimum delta package of size as target delta package from described delta package set; Wherein, described delta package set comprises at least two delta package, and the Incremental Updating Algorithm type that each delta package uses is not identical;
Returning module, upgrading response for returning to described terminal, the described Incremental Updating Algorithm type upgrading response and comprise described target delta package and the use of described target delta package.
11. servers as claimed in claim 10, is characterized in that, also comprise:
Generation module, if for not existing in described default database and number delta package set associated with described target version number of described current version, at least two kinds of Incremental Updating Algorithm according to presetting generate at least two delta package;
Relating module, for using described at least two delta package as with number delta package set associated with described target version number of described current version;
Memory module, for being stored to number delta package set associated with described target version number of described current version in described default database.
12. servers as claimed in claim 11, is characterized in that, described memory module is also for obtaining the size of each delta package in described delta package set, the Incremental Updating Algorithm type of use and memory address; The index list item of described delta package set is generated according to the size of each delta package, the Incremental Updating Algorithm type of use and memory address in described delta package set.
13. servers as described in claim 10-12 any one, is characterized in that, described in choose module and comprise:
Query unit, whether exist and the described current version number index list item associated with described target version number for inquiring about in described default database, if yes, then determine to exist and number delta package set associated with described target version number of described current version in described default database;
Choose unit, for choosing the minimum delta package of size as target delta package according to being recorded in described delta package set in described index list item; Wherein, described index list item comprises at least two records, and every bar record comprises the size of delta package, the Incremental Updating Algorithm type of use and memory address.
14. servers as claimed in claim 13, it is characterized in that, described update request also comprises: the actual performance parameter of described terminal, and in described index list item, every bar record also comprises: demand performance parameter;
Described unit of choosing is specifically for determining to satisfy the demands the delta package of performance parameter from described delta package set according to the actual performance parameter of described terminal; The minimum delta package of size is chosen as target delta package from described satisfying the demands the delta package of performance parameter.
15. servers as claimed in claim 14, is characterized in that, described actual performance parameter and described demand performance parameter comprise: one or more in memory size, CPU frequency and OS Type.
16. 1 kinds of terminals, is characterized in that, comprising:
Sending module, for obtaining current version number and the target version number of file to be updated, and sends update request to server; Wherein, described update request comprises described current version number and described target version number;
Receiver module, for receiving the renewal response that described server returns according to described current version number and described target version number, describedly upgrading response and comprises the Incremental Updating Algorithm type that target delta package and described target delta package use;
Synthesis module, for being updated to described target version number by described file to be updated by described current version number according to described target delta package.
17. terminals as claimed in claim 16, it is characterized in that, described update request also comprises the actual performance parameter of described terminal;
Described sending module is also for obtaining described actual performance parameter, and wherein, described actual performance parameter comprises: one or more in the memory size of described terminal, CPU frequency and OS Type.
18. terminals as described in claim 16 or 17, is characterized in that, also comprise:
Acquisition module, for obtaining the first cryptographic hash of the file of the described target version after renewal number, and obtains second cryptographic hash of file of described target version on described server number;
Whether comparison module is equal with described second cryptographic hash for more described first cryptographic hash;
First display module, if be yes for the comparative result of described comparison module, display update success message;
Second display module, if be no for the comparative result of described comparison module, display update failed message.
19. 1 kinds of file updating methods, is characterized in that, comprising:
Terminal obtains current version number and the target version number of file to be updated, and sends update request to server; Wherein, described update request comprises described current version number and described target version number;
Described server receives the described update request that described terminal sends;
If exist and number delta package set associated with described target version number of described current version in the database preset, from described delta package set, choose the minimum delta package of size as target delta package; Wherein, described delta package set comprises at least two delta package, and the Incremental Updating Algorithm type that each delta package uses is not identical;
Described server returns to described terminal and upgrades response, the described Incremental Updating Algorithm type upgrading response and comprise described target delta package and the use of described target delta package;
Described terminal receives described renewal response;
Described file to be updated is updated to described target version number by described current version number according to described target delta package by described terminal.
20. 1 kinds of file update systems, comprise the server as described in claim 11-17 any one and the terminal as described in claim 18-20 any one.
CN201410529184.0A 2014-10-08 2014-10-08 file updating method, related device and system Active CN104978215B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410529184.0A CN104978215B (en) 2014-10-08 2014-10-08 file updating method, related device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410529184.0A CN104978215B (en) 2014-10-08 2014-10-08 file updating method, related device and system

Publications (2)

Publication Number Publication Date
CN104978215A true CN104978215A (en) 2015-10-14
CN104978215B CN104978215B (en) 2020-01-31

Family

ID=54274752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410529184.0A Active CN104978215B (en) 2014-10-08 2014-10-08 file updating method, related device and system

Country Status (1)

Country Link
CN (1) CN104978215B (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105739971A (en) * 2016-01-20 2016-07-06 网易(杭州)网络有限公司 Verification file generation method and device and verification file using method and device
CN106201577A (en) * 2016-06-27 2016-12-07 竞技世界(北京)网络技术有限公司 A kind of method and device updating Lua file
CN106844210A (en) * 2017-01-20 2017-06-13 网易(杭州)网络有限公司 The acquisition methods and device of event modification information
CN107015821A (en) * 2016-01-28 2017-08-04 腾讯科技(深圳)有限公司 The method and apparatus of incremental update
CN107038039A (en) * 2016-02-04 2017-08-11 腾讯科技(深圳)有限公司 Data-updating method and device
CN108334771A (en) * 2017-01-17 2018-07-27 杭州海康威视数字技术股份有限公司 A kind of increment upgrade package generates, increment updating method and device
CN108920522A (en) * 2018-06-04 2018-11-30 上海点融信息科技有限责任公司 Data processing method, system and computer readable storage medium for database
CN109285298A (en) * 2018-09-30 2019-01-29 苏州浪潮智能软件有限公司 A kind of method for remote updating applied to bank self-help system
CN109450977A (en) * 2018-10-09 2019-03-08 阿里巴巴集团控股有限公司 Data cached push, update method and device
CN109829141A (en) * 2018-12-28 2019-05-31 陈德芹 A kind of project table generation method and device
CN109829144A (en) * 2018-12-28 2019-05-31 陈德芹 A kind of across table reference method and device of online table
CN109857921A (en) * 2019-01-11 2019-06-07 平安科技(深圳)有限公司 A kind of document management method and document file management system updated based on data
CN110119381A (en) * 2019-05-17 2019-08-13 北京思维造物信息科技股份有限公司 A kind of index updating method, device, equipment and medium
CN110390064A (en) * 2019-07-25 2019-10-29 深圳市腾讯计算机***有限公司 File updating method, device and system, storage medium and electronic device
CN113094063A (en) * 2021-03-02 2021-07-09 厦门亿联网络技术股份有限公司 Configuration file updating method and device
CN113553090A (en) * 2021-07-26 2021-10-26 网易(杭州)网络有限公司 Update control method and device for client application program
CN114911507A (en) * 2022-07-15 2022-08-16 浙江大华技术股份有限公司 Method and device for updating algorithm package

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724308A (en) * 2012-06-13 2012-10-10 腾讯科技(深圳)有限公司 Software update method and software update system
CN103428188A (en) * 2012-05-25 2013-12-04 北京小米科技有限责任公司 Method and apparatus for file updating, and associated equipment
CN103647816A (en) * 2013-12-03 2014-03-19 北京奇虎科技有限公司 Method and device for upgrading application software
CN103853574A (en) * 2012-12-06 2014-06-11 腾讯科技(深圳)有限公司 Method and system for upgrading software
CN104035800A (en) * 2014-06-19 2014-09-10 广州金山网络科技有限公司 Incremental packet generation method and device, version upgrade method and device, and version upgrade system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428188A (en) * 2012-05-25 2013-12-04 北京小米科技有限责任公司 Method and apparatus for file updating, and associated equipment
CN102724308A (en) * 2012-06-13 2012-10-10 腾讯科技(深圳)有限公司 Software update method and software update system
CN103853574A (en) * 2012-12-06 2014-06-11 腾讯科技(深圳)有限公司 Method and system for upgrading software
CN103647816A (en) * 2013-12-03 2014-03-19 北京奇虎科技有限公司 Method and device for upgrading application software
CN104035800A (en) * 2014-06-19 2014-09-10 广州金山网络科技有限公司 Incremental packet generation method and device, version upgrade method and device, and version upgrade system

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105739971A (en) * 2016-01-20 2016-07-06 网易(杭州)网络有限公司 Verification file generation method and device and verification file using method and device
CN105739971B (en) * 2016-01-20 2019-03-08 网易(杭州)网络有限公司 Verify generation, application method and the device of file
CN107015821A (en) * 2016-01-28 2017-08-04 腾讯科技(深圳)有限公司 The method and apparatus of incremental update
CN107038039A (en) * 2016-02-04 2017-08-11 腾讯科技(深圳)有限公司 Data-updating method and device
CN106201577B (en) * 2016-06-27 2019-06-14 竞技世界(北京)网络技术有限公司 A kind of method and device updating Lua file
CN106201577A (en) * 2016-06-27 2016-12-07 竞技世界(北京)网络技术有限公司 A kind of method and device updating Lua file
CN108334771A (en) * 2017-01-17 2018-07-27 杭州海康威视数字技术股份有限公司 A kind of increment upgrade package generates, increment updating method and device
CN106844210A (en) * 2017-01-20 2017-06-13 网易(杭州)网络有限公司 The acquisition methods and device of event modification information
CN106844210B (en) * 2017-01-20 2019-08-23 网易(杭州)网络有限公司 The acquisition methods and device of event modification information
CN108920522A (en) * 2018-06-04 2018-11-30 上海点融信息科技有限责任公司 Data processing method, system and computer readable storage medium for database
CN109285298A (en) * 2018-09-30 2019-01-29 苏州浪潮智能软件有限公司 A kind of method for remote updating applied to bank self-help system
CN109450977A (en) * 2018-10-09 2019-03-08 阿里巴巴集团控股有限公司 Data cached push, update method and device
CN109450977B (en) * 2018-10-09 2021-12-14 创新先进技术有限公司 Cache data pushing and updating method and device
CN109829141A (en) * 2018-12-28 2019-05-31 陈德芹 A kind of project table generation method and device
CN109829144A (en) * 2018-12-28 2019-05-31 陈德芹 A kind of across table reference method and device of online table
CN109829141B (en) * 2018-12-28 2023-06-09 陈德芹 Project table generation method and device
CN109829144B (en) * 2018-12-28 2023-06-06 陈德芹 Method and device for cross-table referencing of online table
CN109857921A (en) * 2019-01-11 2019-06-07 平安科技(深圳)有限公司 A kind of document management method and document file management system updated based on data
CN110119381A (en) * 2019-05-17 2019-08-13 北京思维造物信息科技股份有限公司 A kind of index updating method, device, equipment and medium
CN110390064A (en) * 2019-07-25 2019-10-29 深圳市腾讯计算机***有限公司 File updating method, device and system, storage medium and electronic device
CN113094063A (en) * 2021-03-02 2021-07-09 厦门亿联网络技术股份有限公司 Configuration file updating method and device
CN113553090A (en) * 2021-07-26 2021-10-26 网易(杭州)网络有限公司 Update control method and device for client application program
CN113553090B (en) * 2021-07-26 2023-07-25 网易(杭州)网络有限公司 Update control method and device for client application program
CN114911507A (en) * 2022-07-15 2022-08-16 浙江大华技术股份有限公司 Method and device for updating algorithm package
CN114911507B (en) * 2022-07-15 2022-09-23 浙江大华技术股份有限公司 Updating method and equipment of algorithm package

Also Published As

Publication number Publication date
CN104978215B (en) 2020-01-31

Similar Documents

Publication Publication Date Title
CN104978215A (en) File updating method, relevant equipment and system
CN102255887B (en) Method and system for providing online services corresponding to multiple mobile devices
CN101930449B (en) Client, brokerage server and method for providing cloud storage
CN102932777B (en) The update method of a kind of terminal applies and user terminal
CN102810066A (en) Terminal adapting method and terminal and server based on terminal characteristic configuration program
CN102855152B (en) The method and system of resource file in upgrade applications
CN100421070C (en) Method and system for managing dynamic configuration data
CN110162529B (en) Data processing method, service server and data processing system
CN104731516A (en) Method and device for accessing files and distributed storage system
CN104903857A (en) Method and terminal for software upgrading
CN105190525A (en) Management of access to a hybrid drive in power saving mode
CN106325879A (en) Method and device for installing driver and electronic equipment
CN102346737A (en) Sharing method and device for hardware equipment driving program
CN104717527A (en) Video transmission method and video transmission device
CN105187523A (en) Method and device for accessing directory
CN104144202A (en) Hadoop distributed file system access method, system and device
CN105337822A (en) Main playback device selection method and related device
CN113721936B (en) Application management method, intelligent terminal, device and storage medium
CN105491082A (en) Remote resource access method and switch equipment
CN104581695A (en) Mobile terminal configuration method and system
EP2200395B1 (en) Managing method, system and device for an appearance packet
US8688867B2 (en) System and methods for communicating between serial communications protocol enabled devices
CN104247532A (en) Method, apparatus, and system for performing unsolicited location-based download
CN111680014B (en) Shared file acquisition method and device, electronic equipment and storage medium
CN101753351B (en) Method for extending and de-extending management information base, method and equipment for searching management object

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