A kind of software client is updated method and system with exclusive mode
Technical field
It is particularly a kind of software client is updated with exclusive mode the present invention relates to application software more frontier
Method and system.
Background technology
Existing software client is typically carried out more by the renewal bag program on remote downloading service device to client itself
New upgrading.But in tradition upgrading mode, if there is multiple sources for providing and updating, such as different people or team are simultaneously a
Software product is provided and updates bag, or by the renewal bag of different renewal server updatings, or same team's different time
The unified version number done updates bag, it is also possible to be the renewal bag of different product line of same product (such as Chinese edition, English
Version)), it is likely that cause to update chaotic, be as a result the different software client of same version because the data after updating differ
Cause and generate different operation result.This can all produce negative impact for the normal operation and debugging of program, and ask
Once occurring, the client of different pieces of information content then cannot again be returned to original consistent state to topic, although with non-packing shape
The data of formula storage can be by covering inconsistent states of more newly arriving in a large number, and the client-side program stored with packetized form, by
Realize often through additional mode in the renewal of APMB package, then cannot again update the data recovery one made in all clients
Cause.
The content of the invention
To solve the above problems, it is an object of the invention to provide one kind is updated with exclusive mode to software client
Method and system, software client is updated with exclusive mode, can only pass through identical when software client updates every time
Server carry out, it is ensured that the concordance of renewal.
The present invention solves the technical scheme that adopted of its problem:
A kind of software client is updated method with exclusive mode, including:
The step of updating checking code table, generates in a random basis purpose corresponding with purpose software version number and updates checking
Code, identifying code is updated according to corresponding relation write verification code table by purpose software version number and purpose;
The step of updating bag generation, former software version number is read from the middle of checking code table corresponding with former software version number
Original updates identifying code, purpose software version number purpose corresponding with purpose software version number and updates identifying code, and will be read
Content writes in the lump renewal bag with more new file;
The step of software client updates, the former software version in the software version number and renewal bag of comparison software client
It is number whether consistent, if inconsistent, terminate to update, otherwise, comparison software client updates identifying code with the original updated in bag more
Whether new identifying code is consistent, if inconsistent, terminates to update, and otherwise, reads more new file from renewal bag and software client is entered
Row updates;
The step of version updating, the purpose software version number and purpose that update in bag are updated after identifying code write renewal
Software client.
Wherein, verify that code table is stored in server, version number for logging software client and corresponding with version number
Identifying code.
A kind of software client is updated system with exclusive mode, including:
Checking code table module is updated, identifying code is updated for generating purpose corresponding with purpose software version number, by purpose
Software version number updates identifying code according to corresponding relation write verification code table with purpose;
Bag generation module is updated, it is corresponding with former software version number for reading former software version number from the middle of checking code table
Former identifying code, the purpose software version number purpose corresponding with purpose software version number that updates update identifying code, and will be read
Content and more new file write renewal bag in the lump;
Software client generation module, the former software version number in the software version number and renewal bag of comparison software client
It is whether consistent, if inconsistent, terminate renewal, otherwise, the renewal identifying code of comparison software client updates with the original updated in bag
Whether identifying code is consistent, if inconsistent, terminates to update, and otherwise, read more new file from renewal bag is carried out to software client
Update;
Version updating module, for the purpose software version number and purpose that update in bag to be updated after identifying code write renewal
Software client.
Wherein, verify that code table is stored in server, version number for logging software client and corresponding with version number
Identifying code.
The invention has the beneficial effects as follows:
The present invention adopts a kind of method and system being updated to software client with exclusive mode, generates bag is updated
When, identifying code corresponding with purpose version number is firstly generated, and by the middle of purpose version number and identifying code write verification code table;It
Afterwards, purpose version number purpose identifying code corresponding with purpose version number, original version number and master are read from the middle of checking code table
This number corresponding former identifying code, by the content of reading renewal bag is write together with more new file, during renewal, by contrasting original version
Number client is updated with former identifying code, in whole renewal process, identifying code determines the success or failure for updating, because different server lifes
Into identifying code it is different, therefore, this process ensure that software client, when updating, can only be carried out by identical server,
So as to ensure the concordance of data after updating, also it is consistent operation result.
Description of the drawings
Below in conjunction with the accompanying drawings the invention will be further described with example.
Fig. 1 is that conventional client updates schematic diagram;
Fig. 2 is the method for the invention schematic flow sheet;
Fig. 3 is that invention software client updates flow chart;
Fig. 4 is that client of the present invention updates schematic diagram.
Specific embodiment
Embodiment 1:
With reference to shown in Fig. 1, existing software client is typically by the renewal bag program on remote downloading service device to client
End itself is updated upgrading.But in traditional upgrading mode, typically there is multiple servers for providing and updating bag source, can cause
Update chaotic, be as a result that the different software client of same version is generated different because the data after updating are inconsistent
Operation result.As shown in FIG., there are two server As and B that renewal source is provided in figure, client is with A, B file 2.0
Version, A servers provide C and two more new files of D, and B servers provide two more new files of D and E, if client is from A
Server is obtained and updates bag, then by 2.0-to-3.0 and 3.0-to-4.0 update its contained content after bag include A.TXT,
B.TXT, C.TXT, D.TXT, if obtain updating bag from B servers, by 2.0-to-3.0 and 3.0-to-4.0 bag are updated
Afterwards its contained content includes A.TXT, B.TXT, D.TXT, E.TXT.Which carried out by server because client cannot determine
Update, after the renewal bag on a server of having upgraded, client does not know how to refuse the renewal on other servers
Wrap and avoid continuing to upgrade(After the 2.0-to-3.0 such as upgraded on A servers, client does not know how to refuse to be serviced by B
3.0-to-4.0 on device updates bag).Conversely, service end is also difficult " exclusive " mode to limit the upgrading of client.
For this purpose, the invention provides a kind of method being updated to software client with exclusive mode, server end is deposited
Checking code table is contained, this table describes the relation between version number and identifying code, for each version number, server all can be with
Machine generates an identifying code, and by version number and identifying code write verification code table corresponding with version number.Due to random generation
The uniqueness of checking code table, therefore, can ensure that every time upgrading can only pass through identical server to client by this identifying code
Carry out, so as to the concordance of operation after ensureing the concordance for updating and updating.
With reference to shown in Fig. 2, methods described includes:
The step of updating checking code table, generates in a random basis purpose corresponding with purpose software version number and updates checking
Code, identifying code is updated according to corresponding relation write verification code table by purpose software version number and purpose;
The step of updating bag generation, former software version number is read from the middle of checking code table corresponding with former software version number
Original updates identifying code, purpose software version number purpose corresponding with purpose software version number and updates identifying code, and will be read
Content writes in the lump renewal bag with more new file;
The step of software client updates, the former software version in the software version number and renewal bag of comparison software client
It is number whether consistent, if inconsistent, terminate to update, otherwise, comparison software client updates identifying code with the original updated in bag more
Whether new identifying code is consistent, if inconsistent, terminates to update, and otherwise, reads more new file from renewal bag and software client is entered
Row updates;
The step of version updating, the purpose software version number and purpose that update in bag are updated after identifying code write renewal
Software client.
With reference to shown in Fig. 3, when software client is updated, can be concrete such as institute in figure with autotelic selection server
Show, software client carries out first the contrast of version number after renewal bag is obtained, read in bag original software version number simultaneously from updating
Contrasted with the version number of client itself, if contrast is inconsistent, terminate to update, otherwise, then read in bag former from being updated
Update identifying code and the client identifying code of itself to be contrasted, if contrast is inconsistent, terminate to update, otherwise, illustrate that this takes
To update server, client is updated business device by the more new file in renewal bag to itself, and in the updated, by purpose
Software version number and purpose are updated in identifying code write software client.
The invention provides a kind of software client is updated system with exclusive mode, including:
Checking code table module is updated, for generating purpose corresponding with purpose software version number in a random basis checking is updated
Code, identifying code is updated according to corresponding relation write verification code table by purpose software version number and purpose;
Bag generation module is updated, it is corresponding with former software version number for reading former software version number from the middle of checking code table
Former identifying code, the purpose software version number purpose corresponding with purpose software version number that updates update identifying code, and will be read
Content and more new file write renewal bag in the lump;
Software client generation module, the former software version number in the software version number and renewal bag of comparison software client
It is whether consistent, if inconsistent, terminate renewal, otherwise, the renewal identifying code of comparison software client updates with the original updated in bag
Whether identifying code is consistent, if inconsistent, terminates to update, and otherwise, read more new file from renewal bag is carried out to software client
Update;
Version updating module, for the purpose software version number and purpose that update in bag to be updated after identifying code write renewal
Software client.
Wherein, verify that code table is stored in server, version number for logging software client and corresponding with version number
Identifying code.
The update method of the systems versus software client is identical with approach described above, referring in particular in above method
It is described.
Embodiment 2:
The present embodiment specifically illustrates the process updated by the method for the invention.
With reference to shown in Fig. 4, current client release number is 2.0, and it is 123456 that it updates identifying code.Server generates two
Update bag, the renewal bag of respectively 2.0-to-3.0, the renewal bag of 3.0-to-4.0.Existing client is to upgrade to 3.0 versions
When, service end is first randomly generated one and updates identifying code 654321 with the corresponding purpose of purpose software version number 3.0, and will be soft
Part version number 3.0 is updated in the write verification code table of identifying code 654321 with purpose:
Software version number |
Update identifying code |
1.0 |
000000 |
2.0 |
123456 |
3.0 |
654321 |
Afterwards, former software version number 2.0, former renewal identifying code 123456, purpose software version are read from checking code table
Numbers 3.0, purpose updates identifying code 654321, and the content of reading is fabricated to into 2.0- together with the more new file of 2.0-to-3.0
The renewal bag of to-3.0.
When client updates, the renewal bag of 2.0-to-3.0 is downloaded from service end, check the former software version updated in bag
It is number whether consistent with the software version number of client.The original version number updated in upper example in bag is 2.0, client software version number
It is 2.0.Then this updates bag version correctly, can be updated.Afterwards, former renewal identifying code and the client updated in bag is checked
Renewal identifying code it is whether consistent.Now the renewal identifying code of client is 123456, and the former identifying code that updates updated in bag is
123456, show to update and wrap from the horse's mouth, can proceed to update.Afterwards, client will update the more new file in bag
" C.TXT " is updated in software client, and now file becomes " A.TXT ", " B.TXT ", " C.TXT " in software client, number
Complete according to renewal.Finally purpose software version number, purpose are updated into identifying code write client, respectively as the software of client
Version number and renewal identifying code.Now " software version number " in client becomes 3.0, and " renewal identifying code " becomes 654321.
When client needs to upgrade to 4.0 version, its method is same as described above, now, then after being updated with client
Software version number 3.0 and update identifying code 654321 as checking information, only update content in bag with this both be consistent when,
Can just be updated, otherwise, then update failure.So as to be carried out by identical server when ensureing and updating, it is ensured that update
The concordance of the operation result of the concordance of program, and program afterwards.
The above, simply presently preferred embodiments of the present invention, the invention is not limited in above-mentioned embodiment, as long as
It reaches the technique effect of the present invention with identical means, should all belong to protection scope of the present invention.