Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in the accompanying drawing, yet should be appreciated that and to realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order to understand the disclosure more thoroughly that these embodiment are provided, and can with the scope of the present disclosure complete convey to those skilled in the art.
The present invention proposes a kind of new data-updating method and corresponding device, method and apparatus of the present invention is fit to be applied to any data processing equipment with data-handling capacity, comprise fixing or mobile data processing equipment, such as PC (PC), server, palmtop PC, smart mobile phone etc.
Suppose in the data treatment facility to store a data file, this data file may constantly need to upgrade, hereinafter to be referred as data.For fear of the data that transmit when the Data Update after the whole renewal that is used for substituting the data before upgrading, the concept of " incremental data " is proposed among the present invention.
In explanation " incremental data " before, we at first define the concept of " full dose data " among the present invention.We with the full dose data definition are: do not rely on the data that data to be updated just can be upgraded these data to be updated.That is to say, as long as the full dose data are passed in the data processing equipment, and with its replacement data to be updated, just finished the renewal of data, and do not needed to carry out any other operation.As seen, the data-updating method of prior art is exactly directly to use the data after the renewal of full dose to replace the method that data to be updated obtain the data through upgrading of full dose in fact.For example, data to be updated are a collection, and this collection comprises a plurality of collection projects, and so, the data after the renewal of a full dose are exactly a new collection that is different from former collection.This new collection can comprise some projects in the original collection, also can not comprise the project in the original collection fully, as long as this new collection is replaced original collection, has just finished Data Update.The benefit of carrying out Data Update with the data after the renewal of full dose is not need to consider what the data content of initial data is, also no matter it is the data of what type, can both directly carry out Data Update.But as previously mentioned, its shortcoming is that the data conveying capacity is large, waste system resource.
Thus, the present invention proposes data-updating method, device and the system based on " incremental data ", and the data after " incremental data " that the present invention proposes refers to upgrade are with respect to the data of the variation of data before upgrading.What so-called variation represented is the data after upgrading and the difference of upgrading front data.That is to say, incremental data is with the data before upgrading and the data after upgrading are carried out the data that certain computing obtains.And specifically adopt which kind of computing, then can decide according to the type of data.
If the data after the data before upgrading and the renewal are numeral, then described operation method can be simple mathematical operation.For example, the data before upgrading are 2, and the data after the renewal are 3, and the data after then incremental data can equal to upgrade deduct the data before upgrading, and namely incremental data is=3-2=1.
If the data after the data before upgrading and the renewal are collection, then described operation method can be a kind of comparison algorithm.For example, collection before upgrading comprises " network address 1 ", " network address 2 ", " network address 3 ", and the collection after upgrading comprise " network address 1 ", " network address 2 ", " network address 3 " and " network address 4 ", then via relatively calculating, obtaining incremental data is " network address 4 ".
Certainly, above example is the fairly simple situation of data type, the present invention can expand to any data type, as long as the suitable computational methods between the data after the data before existence is upgraded and the renewal all can obtain incremental data by these computational methods.
In present network service, for data processing equipment and data transmission system, the data of extensive use are divided into two kinds, and a kind of is descriptive data, and another kind is binary data.Descriptive data is with the data that can be come by the language that the people understands descriptor, be applicable to man-machine interaction, such as the program code data of natural language data, hypertext language data (such as HTML, XML and Json etc.) and high-level programming language (C language, Javascript etc.), etc.For descriptive data, the present invention can select computational methods according to existing data format, also can set special data label in existing data format, is beneficial to the carrying out of calculating.For example, for the data of XML form, can calculate incremental data according to label existing in the XML file, also can oneself define the special tags that is used for incremental data calculating.
For example, for the following code of the XML of renewal that needs be:
The xml code that is used for the full dose data of renewal is:
Then incremental data can for
{0114,creattime,Rep,2010.08.21},
Wherein " 0114 " id of the data before expression is upgraded, creattime represents the tag name under this id, and Rep represents " replacement ", and 2010.08.21 represents to replace content.
This shows, when upgrading descriptive data, incremental data also can be for the descriptive data of describing variable quantity, as a rule, the data of the data volume of incremental data after the renewal of full dose can be little a lot, and are particularly huge for the data before upgrading, and the not too large situation of variable quantity.
Another kind of situation is, data after data before upgrading and the renewal are binary data, binary data referred to herein as the data that are suitable for data processing equipment storage, transmission, binary data is general, stable, need to not be for the different application secondary development, such as the program code after various computer documents (comprising picture, video), the compiling etc.
The computational methods that existed some to compare for general binary data in the prior art.The present invention can directly adopt computational methods of the prior art, and those of ordinary skills also can be by carrying out the computational methods that adaptive variation design is specifically designed to the incremental data of specific data type to known algorithm.
It should be noted that the computational methods that the present invention adopts are preferably reversible algorithm.
Based on above-mentioned principle about incremental data, the data-updating method for data processing equipment of the present invention comprises following two basic steps, as shown in Figure 3.
(1) will send to a data treatment facility by the incremental data that the data before upgrading and the data after the renewal generate;
(2) in this data processing equipment, the data through upgrading according to data to be updated and the formation of this incremental data.
Illustrated how to generate incremental data in the preamble, when utilizing the present invention to carry out Data Update, also needed the data through upgrading according to data to be updated and incremental data generation.That is to say, the present invention also needs to generate the data through upgrading of full dose, and makes the data through upgrading of the full dose of generation replace data to be updated.
According to the present invention, the process that generates the data through upgrading can be the inverse operation that generates incremental data, when the computational methods that generate incremental data are reversible algorithm, so that become possibility according to the data through upgrading of data to be updated and incremental data generation full dose.For example, for the pure mathematics computing in the previous examples, if the data before upgrading are 2, the data after the renewal are 3, data to be updated with upgrade before data identical, also be 2, the algorithm that calculates incremental data upgrades front data for the data after upgrading deduct, and namely incremental data is=3-2=1, so, the algorithm that generates the data through upgrading of full dose is the inverse operation of above-mentioned algorithm, and namely data to be updated add incremental data, and namely the data through upgrading are=2+1=3.
For descriptive incremental data, then described inverse operation can be that the described descriptive incremental data of parsing produces the data through upgrading.For example, for descriptive incremental data 0114, creattime, Rep, 2010.08.21}, it can be resolved to ID is that the value of the label creattime in 0114 replaces with 2010.08.21.
In like manner, for binary data, can use aforesaid algorithm for inversion cause data and the data of incremental data generation through upgrading to be updated that it is calculated that the algorithm of incremental data for binary number.For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with specific embodiment, and with reference to accompanying drawing, the present invention is described in further detail.
The<the first embodiment 〉
Fig. 4 is the scene schematic diagram based on the data-updating method of incremental data of the first embodiment of the present invention.As can be seen from Figure 4, the system architecture of the method for this first embodiment and method shown in Figure 1 is similar.This embodiment realizes be a kind of between client the method for synchrodata, described client comprises uploads client and download client, uploads client and download client and all can carry out exchanges data with a server.
The described client of uploading refers to that described download client refers to for the client from the server downloading data for the client that data is sent to described server.
In order to distinguish the data after each renewal, also for convenience, used this concept of version at this.In the present invention, initial data and each time corresponding version in new capital more of on the initial data basis, carrying out.Version represents with version number.The version number that for example sets initial data can be 1.0.0.0, and the versions of data of upgrading for the first time number be 1.0.0.1, and the versions of data of renewal number is 1.0.0.2 for the second time, by that analogy.According to the present invention, initial data also can be the sky data.
Fig. 5 is the flow chart based on the data-updating method of incremental data of the first embodiment of the present invention.As shown in Figure 5.Method of the present invention comprises three steps:
At first, upload client according to the data before upgrading and the data after upgrading produce incremental data, and during this incremental data uploaded onto the server;
Then, described server receives by described and uploads the described incremental data that client transmits, and this incremental data is preserved at this server;
At last, described server sends to download client with described incremental data, and download client is the data through upgrading according to described data to be updated and the generation of this incremental data.
The prerequisite that said method can be realized is the data of uploading after client storage has the front data of renewal and renewal, preserves data to be updated in the download client, and data to be updated can be sky.In addition, can only preserve incremental data in the server, also can preserve simultaneously the data after the renewal of full dose.
According to the present invention, describedly upload client and download client all can be the arbitrary client that can carry out with described server exchanges data, its number is not limited.
According to the present invention, during with incremental data sends to this server is connected download client, can be according to setting in advance the transmission incremental data, this sets in advance can be certain rule, described rule can be automatically to transmit rule, also can be by the request rule.
Automatically transmitting rule for example is: in a single day described server receives when uploading the incremental data of client upload, just be attached thereto the client that connects to all and send the Data Update notice, inquire whether it needs more new data, return when receiving more new data when arbitrary client, send incremental data to this client.Again for example, in a single day described server receives when uploading the incremental data of client upload, and just the every other client to same user sends incremental data.Certainly, automatically transmitting rule also can have other setting, and for example polling and transmission in case perhaps client links to each other with this server, then inquired and sent, etc.
Server according to the request transmission incremental data of client by request rule.That is to say, server is when only receiving the Data Update request, and just the client to the request of sending sends incremental data.
The framework of the data update system of this first embodiment as shown in Figure 6, wherein 1 is server, 2~5 are client.Server includes communication module and data memory module, and client includes communication module and data update module.The communication module of the communication module of server 1 and each client 2~5 all can be carried out exchanges data.Described client 2~5 respectively conduct is uploaded client or download client, also can be simultaneously both as uploading client, again as download client.
When client was uploaded in conduct, data update module was used for producing incremental data according to the data before upgrading and the data after the renewal; Communication module is used for comprising that the data of incremental data send to described server.
When as download client, communication module is used for from described server receive data, and these data comprise incremental data, and data update module is used for the data of data generation through upgrading according to the data to be updated of this client storage and this reception.
In the present embodiment, the data update module of each client can either be according to the data before upgrading and the data after upgrading produce incremental data, also can generate data through upgrading according to data to be updated and incremental data.Communication module can either be used for uploading data, also is used for downloading data.When the arbitrary client in the client 2~5 had produced incremental data and will comprise that by its communication module the data of incremental data send to server 1, this client was namely as the client of uploading of this renewal; When the arbitrary client in the client 2~5 was passed through its communication module from the server downloading data, this client was the download client of this time upgrading.
The data memory module of server is used for storage by the incremental data of uploading client upload.According to one embodiment of the present invention, server is also preserved the version information of this incremental data when preserving incremental data, for example be a version number.
The communication module of server is used on the one hand from uploading the client incremental data, another side, also be used for according to certain rule, this incremental data sent to the download client that arbitrary needs carry out Data Update, so that this download client is upgraded according to this incremental data.Described rule does not repeat them here as previously mentioned.
Client terminal quantity shown in Figure 5 is 4, but this only is the signal situation.As previously mentioned, the present invention is not restricted for the quantity of client.
The<the second embodiment 〉
Fig. 7 is the flow chart based on the data-updating method of incremental data of the second embodiment of the present invention.
As previously mentioned, the first embodiment has described the flow process of carrying out a Data Update according to data-updating method of the present invention.This second embodiment is the repeatedly renewal that realizes on the basis of the first embodiment based on incremental data.
Repeatedly upgrade the incremental data that produces afterwards for having carried out, because it is to have carried out repeatedly calculating on the basis of initial data, so the redundancy issue of its data may be more serious.In this case, continue to adopt incremental data to upgrade and to obtain relatively better effect.Therefore, among this second embodiment, in server, set a first threshold, when the number of versions of data reaches this first threshold, this server requirement is uploaded the data of client after with the renewal of the full dose of this latest edition and is sent to this server, and preserves the data after the renewal of this full dose at this server.
According to a kind of embodiment of the present invention, the version information of the data after the renewal of also preserving simultaneously this full dose on the server.For data and incremental data after the renewal of the full dose when once upgrading, it can share a version number.
For example, be 20 if server is set first threshold, and the data of having preserved following version in the server,
1.0.0.0 former
1.0.0.1 increase
1.0.0.2 increase
……
1.0.0.18 increase
1.0.0.19 increase (reaching the 20th version)
(wherein, " former " expression initial data, " increasing " expression incremental data can not have initial data)
At this moment, the server requirement data of client after with the renewal of the full dose of 1.0.0.19 version of uploading that send the incremental data of 1.0.0.19 version also send to this server.So, the data of preserving following version in the server:
1.0.0.0 former
1.0.0.1 increase
1.0.0.2 increase
……
1.0.0.18 increase
1.0.0.19 increase
1.0.0.19 complete
(wherein, the data after the renewal of " entirely " expression full dose).
According to other embodiments of the invention, also can be by the data after the renewal of uploading client and determine whether uploading full dose in server.
As previously mentioned, in server, preserve incremental data, when through after repeatedly upgrading, in server, just preserve initial data and based on the incremental data of a plurality of versions of this initial data.Usually, be subject to hardware condition or based on the consideration of system resource, for certain data (for example a software or a file), the quantity of the versions of data that can preserve can not be infinitely great on server.Therefore, can also set another higher limit for the quantity of the versions of data on the server, referred to here as Second Threshold.According to this embodiment of the invention, when the versions of data quantity on the server reaches this Second Threshold, must delete the data than legacy version, to keep no more than this Second Threshold of number of versions of data.
According to a kind of embodiment of the present invention, described Second Threshold is greater than described first threshold.And, when the data of deletion Versions, keep at least data or initial data after the renewal of a full dose.Be more preferably, when the data after the renewal with a plurality of full doses, keep at least the data after the renewal with the full dose of the immediate version of current version.
For example, Second Threshold is 30, so in conjunction with the version operating process of following example explanation according to Second Threshold.Suppose in server, to preserve the data of following version:
1.0.0.0 former
1.0.0.1 increase
1.0.0.2 increase
……
1.0.0.18 increase
1.0.0.19 increase
1.0.0.19 complete
1.0.0.20 increase
……
1.0.0.28 increase
Have again user end to server to upgrade this data when this moment, thereby when preserving new versions of data 1.0.0.29 in server, the version number of these data reach Second Threshold 30.Thereby server deletion version 1.0.0.0 early.In the versions of data 1.0.0.1 to 1.0.0.29 that server is preserved, comprise the data of at least one full dose, for example be that version 1.0.0.19 is complete in this example.
Version updating
In this second embodiment, may have the incremental data of initial data, a plurality of versions on the server, also may there be the data after the renewal of at least one full dose that is transmitted by upload server.In this case, data-updating method of the present invention can further be optimized.For client, its version updating operation can be as described below:
If there are the data of following version on the server:
1.0.0.0 former
1.0.0.1 increase
1.0.0.2 increase
……
1.0.0.18 increase
1.0.0.19 increase
1.0.0.19 complete
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase
According to one embodiment of the present invention, more during new data, server sends to this client with the more new data of latest edition in each user end to server request.The more new data of this latest edition may be incremental data, also may be the data after the renewal of full dose.According to preferred implementation of the present invention, the data after the renewal of the incremental data that has same version and full dose, the data of server after with the renewal of full dose send to client.
According to preferred implementation of the present invention, the user end to server request more can be enclosed the version information of the data to be updated on this client, for example version number during new data.At this moment, server can number compare according to versions of data all on this version number and the server, determines to send to this client the data of which version with this.
In this case, be more preferably, when the data after the renewal that has the full dose be higher than the client current version on the server, the incremental data that server is only selected the data after the renewal of the full dose of this version and version to be higher than the data after the renewal of this full dose sends; Be more preferably, when the data after the renewal that has a more than full dose that is higher than client release on the server, server is only selected the data after the renewal of the full dose of highest version and the incremental data of the version of the data after being higher than the renewal of this full dose sends.
For example, in the example that provides in the above,
(1) when the current versions of data of client (namely sending to the versions of data of server with request) is " 1.0.0.22 ", server can only send to client:
1.0.0.23 increase
(2) when the current versions of data of client (namely sending to the versions of data of server with request) was " 1.0.0.18 ", server can send to client:
1.0.0.19 increase
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase
Also can send:
1.0.0.19 complete
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase.
At this moment, server can make a choice, and usually can decide according to the data volume that sends, and selects to send data volume little.In this example, in general, the data after the renewal of full dose are greater than the incremental data of same version.At this moment, the data volume that front a kind of mode sends is less, and a kind of mode sends before at this moment can selecting.
(3) when the current versions of data of client (namely sending to the versions of data of server with request) was " 1.0.0.1 ", server can send to client:
1.0.0.2 increase
……
1.0.0.19 increase
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase
Also can only send:
1.0.0.19 complete
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase
And this moment, because the version of the incremental data that front a kind of mode need to send is more, so that the data volume that sends may be greater than rear a kind of mode, server can select rear a kind of mode to send.
Yet recited above only is example, when concrete selection sends in which way, can specifically set according to actual conditions.For example, in (2) above-mentioned kind situation, although the data volume when a kind of mode sent before during current upgrade is less.But, if when considering next time renewal or ensuing renewal, consider total transmission data volume, also can select the second way.
Version recovers
According to this second embodiment of the present invention, when storing the data of a plurality of versions on the server, client can also be to server request " version recovery ".So-called version recovers to refer to that client-requested is from the data of server recovery indicated release.
When user end to server sends a version recovery request, enclose simultaneously the version information that needs recovery, for example be a version number.At this moment, the version of the data of server by checking its upper storage, selection sends at least one full dose data and based on the incremental data of these full dose data to this client.
For example, when the data of client-requested from server recovery 1.0.0.21 version, and store on the server:
1.0.0.0 former
1.0.0.1 increase
1.0.0.2 increase
……
1.0.0.18 increase
1.0.0.19 increase
1.0.0.19 complete
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase
At this moment, server can be selected to send to this client
1.0.0.0 former
1.0.0.1 increase
1.0.0.2 increase
……
1.0.0.19 increase
1.0.0.20 increase
1.0.0.21 increase,
Also can select to send to client
1.0.0.19 complete
1.0.0.20 increase
1.0.0.21 increase.
According to a kind of preferred implementation, which kind of mode server can decide in according to the size of the data volume that sends sends data.In this example, if the latter's data volume is less, can select only to send the full dose data of 1.0.0190 version and the incremental data of 1.0.0.20 and 1.0.0.21 version.
Fig. 8 has shown the system architecture diagram of data-updating method according to a second embodiment of the present invention.As shown in Figure 8, basic framework and the first embodiment are similar.
But, also comprise a threshold value control module in the server of this second embodiment, it is used for setting described first threshold and Second Threshold, and according to first threshold, control this communication module and send the instruction of the data after the renewal of uploading full dose to upload server, and according to Second Threshold, control the data of the data memory module deletion Versions of this server, make the no more than Second Threshold of the versions of data of storing.
And this threshold value control module also is used for which version is the control communication module send to download client data.Concrete control method does not repeat them here as previously mentioned.
Intrinsic not relevant with any certain computer, virtual system or miscellaneous equipment with demonstration at this algorithm that provides.Various general-purpose systems also can be with using based on the teaching at this.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.Should be understood that and to utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the specification that provides herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be in the situation that there be these details to put into practice.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires the more feature of feature clearly put down in writing than institute in each claim.Or rather, as following claims reflected, inventive aspect was to be less than all features of the disclosed single embodiment in front.Therefore, follow claims of embodiment and incorporate clearly thus this embodiment into, wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment among the embodiment.Can be combined into a module or unit or assembly to the module among the embodiment or unit or assembly, and can be divided into a plurality of submodules or subelement or sub-component to them in addition.In such feature and/or process or unit at least some are mutually repelling, and can adopt any combination to disclosed all features in this specification (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment make up.Unless in addition clearly statement, disclosed each feature can be by providing identical, being equal to or the alternative features of similar purpose replaces in this specification (comprising claim, summary and the accompanying drawing followed).
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included among other embodiment, the combination of the feature of different embodiment means and is within the scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with compound mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, perhaps realizes with the software module of moving at one or more processor, and perhaps the combination with them realizes.It will be understood by those of skill in the art that and to use in practice microprocessor or digital signal processor (DSP) to realize according to some or all some or repertoire of parts in the device of the embodiment of the invention.The present invention can also be embodied as be used to part or all equipment or the device program (for example, computer program and computer program) of carrying out method as described herein.Such realization program of the present invention can be stored on the computer-readable medium, perhaps can have the form of one or more signal.Such signal can be downloaded from internet website and obtain, and perhaps provides at carrier signal, perhaps provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation of the scope that does not break away from claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or step in the claim.Being positioned at word " " before the element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computer of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to come imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title with these word explanations.