Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although accompanying drawing shows the disclosure
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should be by embodiments set forth here
Limited.On the contrary, it is provided that these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
The present invention proposes a kind of new data-updating method and corresponding device, and methods and apparatus of the present invention is suitable for application
In any data handling equipment with data-handling capacity, including fixing or the data handling equipment of movement, such as individual's electricity
Brain (PC), server, palm PC, smart mobile phone etc..
Assuming that storage has a data file in a data handling equipment, this data file may constantly need to update,
Hereinafter referred to as data.In order to avoid the data after the whole renewal of transmission data before substituting renewal when data update,
The present invention proposes the concept of " incremental data ".
Before explanation " incremental data ", first we define the concept of " the full dose data " in the present invention.We will be complete
Amount data are defined as: be independent of the data that these data to be updated just can be updated by data to be updated.It is to say, only
Full dose data are passed in data handling equipment, and it is replaced data to be updated, just complete the renewal of data, and not
Need to carry out any other operation.Visible, the data-updating method of prior art is exactly the renewal directly using full dose in fact
After data replace data to be updated and obtain the method for data being updated over of full dose.Such as, data to be updated are one
Collection, this collection includes multiple collection project, then, the data after the renewal of a full dose are exactly one and are different from former receipts
Hide the new collection of folder.This new collection can comprise some projects in original collection, it is also possible to does not the most comprise original
Project in collection, as long as this new collection is replaced original collection, just completes data and updates.Use full dose
Data after renewal carry out the benefit of data renewal and are what the data content without the concern for initial data is, the most no matter its
It is what kind of data, can directly carry out data renewal.But, as it was previously stated, its shortcoming to be data transfer big, waste
System resource.
Thus, the present invention proposes data-updating method based on " incremental data ", device and system, and the present invention proposes
" incremental data " refers to that the data after updating are relative to the data of the change of data before updating.What so-called change represented is to update
After data with update before the difference of data.It is to say, incremental data is the data before updating and the data after renewal
Carry out the data that certain computing obtains.And specifically use which kind of computing, then can determine according to the type of data.
If the data before Geng Xining and the data after renewal are numeral, the most described operation method can be simple mathematics fortune
Calculate.Such as, the data before updating are 2, and the data after renewal are 3, then incremental data can deduct equal to the data after updating
Data before renewal, i.e. incremental data are=3-2=1.
If the data before Geng Xining and the data after renewal are collection, the most described operation method can be that one compares calculation
Method.Such as, the collection before renewal includes " network address 1 ", " network address 2 ", " network address 3 ", and the collection after updating include " network address
1 ", " network address 2 ", " network address 3 " and " network address 4 ", then via comparing calculating, obtain incremental data for " network address 4 ".
Certainly, example above is the situation that data type is fairly simple, and the present invention can expand to any data class
Type, simply by the presence of the suitable computational methods between the data after the data before updating and renewal, all can pass through this calculating side
Method obtains incremental data.
In current network service, for data handling equipment and data transmission system, most widely used number
According to being divided into two kinds, one is descriptive data, and another kind is binary data.Descriptive data is with the language that can be more readily understood
Speech describes the data of information, it is adaptable to man-machine interaction, such as natural language data, hypertext language data (such as HTML,
XML and Json etc.) and the program code data of high-level programming language (C language, Javascript etc.), etc..For descriptive
Data, the present invention can select computational methods according to existing data form, it is also possible to sets in existing data form
Special data label, is beneficial to the carrying out calculated.Such as, for the data of XML format, can be according to existing in XML file
Label calculate incremental data, it is also possible to oneself definition for incremental data calculate special tags.
Such as, the code for the following XML needing and updating is:
The xml code of the full dose data for updating is:
Then incremental data can be
0114, creattime, Rep, 2010.08.21},
Wherein " 0114 " representing that the id, creattime of data before updating represents the tag name under this id, Rep represents and " replaces
Change ", 2010.08.21 represents replacement content.
As can be seen here, when updating descriptive data, incremental data can also be the descriptive number for describing variable quantity
According to, as a rule, the data volume of incremental data can be much smaller compared to the data after the renewal of full dose, before updating
Data huge, and the situation that variable quantity is the biggest.
Another kind of situation is, the data before renewal and the data after renewal are binary data, and binary data is at this
Referring to be suitable for data handling equipment storage, the data of transmission, binary data is general, stable, need not should for difference
With secondary development, the program code etc. after the most various computer documentss (including picture, video), compiling.
Some computational methods compared for general binary data are the most there are.The present invention can
Directly to use computational methods of the prior art, those of ordinary skill in the art can also be by fitting known algorithm
The change of answering property designs the computational methods of the incremental data being specifically designed to specific data type.
It should be noted that the computational methods that the present invention uses are preferably reversible algorithm.
Based on the above-mentioned principle about incremental data, the data-updating method for data handling equipment of the present invention includes
Following two basic steps, as shown in Figure 3.
(1) set being sent to a data process by the incremental data of the data genaration after the data before updating and renewal
Standby;
(2) in this data handling equipment, updated data are formed according to data to be updated and this incremental data.
Have been described above and how to generate incremental data, when utilizing the present invention to carry out data renewal, in addition it is also necessary to root
The data being updated over are generated according to data to be updated and incremental data.It is to say, the present invention also need to generate full dose through more
New data, and make generation full dose be updated over data to replace data to be updated.
According to the present invention, the process generating the data being updated over can be to generate the inverse operation of incremental data, increases when generating
The computational methods of amount data are when being reversible algorithm so that generate being updated over of full dose according to data to be updated and incremental data
Data are possibly realized.Such as, for the pure mathematics computing in previous examples, if the data before Geng Xining are 2, the data after renewal are
3, data to be updated are identical with the data before renewal, are also 2, and the algorithm calculating incremental data is that the data after updating deduct more
Data before new, i.e. incremental data is=3-2=1, then, the algorithm of the data being updated over generating full dose is above-mentioned algorithm
Inverse operation, data the most to be updated add incremental data, and the data being i.e. updated over are=2+1=3.
For descriptive incremental data, then described inverse operation can be to resolve described descriptive incremental data to produce warp
The data updated.Such as, for descriptive incremental data, { 0114, creattime, Rep, 2010.08.21} can be solved
Analysis is for being that the value of label creattime in 0114 replaces with 2010.08.21 to ID.
In like manner, for binary data, it is possible to use the aforesaid algorithm calculating incremental data for binary data
Data and incremental data that algorithm for inversion cause is to be updated generate the data being updated over.For make the purpose of the present invention, technical scheme and
Advantage is clearer, and below in conjunction with specific embodiment, and referring to the drawings, the present invention is described in further detail.
<first embodiment>
Fig. 4 is the scene schematic diagram of the data-updating method based on incremental data of the first embodiment of the present invention.From Fig. 4
It can be seen that the method for this first embodiment is similar with the system architecture of the method shown in Fig. 1.This embodiment is accomplished that one
The method of synchrodata among clients, described client includes uploading client and downloads client, upload client and
Download client and all can carry out data exchange with a server.
Described client of uploading refers to that the client for transferring data to described server, described download client are
Refer to the client for downloading data from server.
In order to distinguish the data after updating every time, convenient also for describing, this concept of version is employed at this.At this
In bright, the corresponding version of initial data and the most more new capital carried out on initial data basis.Version version
Number represent.The version number such as setting initial data can be 1.0.0.0, and the versions of data number updated for the first time is
1.0.0.1, the versions of data number that second time updates is 1.0.0.2, by that analogy.According to the present invention, initial data is alternatively sky
Data.
Fig. 5 is the flow chart of the data-updating method based on incremental data of the first embodiment of the present invention.Such as Fig. 5 institute
Show.The method of the present invention includes three steps:
First, upload client and produce incremental data according to the data after the data before updating and renewal, and by this increment
During data are uploaded onto the server;
Then, described server receives is uploaded, by described, the described incremental data that client transmits, and by this incremental data
Preserve on that server;
Finally, described server described incremental data is sent to download client, download client according to described in treat more
New data and this incremental data generate the data being updated over.
The premise that said method is capable of is the data after uploading the data before client preserves renewal and updating, under
Carrying in client and preserve data to be updated, data to be updated can be empty.Additionally, server can only preserve increment number
According to, it is also possible to preserve the data after the renewal of full dose simultaneously.
According to the present invention, described in upload client and download client may each be and can carry out data with described server
Any client of exchange, does not limit its number.
According to the present invention, when incremental data is sent to the download client being connected with this server, can be according in advance
Arranging transmission incremental data, this pre-sets can be certain rule, and described rule can be automatically to forward rule, it is also possible to
It is by request rule.
Automatically forward rule e.g.: described server upon receipt of by when uploading the incremental data of client upload,
Just send data update notification to all connected clients, inquire its need of more new data, as arbitrary client
When end return receives more new data, send incremental data to this client.The most such as, described server is upon receipt of by uploading
During the incremental data of client upload, just send incremental data to the every other client of same user.Certainly, automatically forward
Rule can also have other setting, such as polling and transmission, or once client is connected with this server, then ask
Ask and send, etc..
It is that server sends incremental data according to the request of client by request rule.It is to say, server is only
Receive data more newly requested time, just send incremental data to the client sending request.
As shown in Figure 6, wherein 1 is server to the framework of the data update system of this first embodiment, and 2~5 are client
End.Server includes communication module and data memory module, and client includes communication module and data update module.Service
The communication module of device 1 all can carry out data exchange with the communication module of each client 2~5.Described client 2~5 can be distinguished
As uploading client or downloading client, it is also possible to the most both as uploading client, again as downloading client.
When as when uploading client, data update module is for producing according to the data after the data before updating and renewal
Incremental data;Communication module is for being sent to described server by the data including incremental data.
When as when downloading client, communication module is for receiving data from described server, and these data include increment number
According to, data update module produces, for the data of the data to be updated preserved according to this client and this reception, the number being updated over
According to.
In the present embodiment, the data update module of each client can either be according to the number after the data before updating and renewal
According to producing incremental data, it is also possible to generate, according to data to be updated and incremental data, the data being updated over.Communication module can
It is enough in and uploads data, be also used for downloading data.When any client in client 2~5 creates incremental data and passes through
When the data including incremental data are sent to server 1 by its communication module, this client i.e. uploads visitor as what this updated
Family end;When any client in client 2~5 downloads data by its communication module from server, this client is
The download client this time updated.
The data memory module of server is for storing by the incremental data uploading client upload.According to the present invention one
Planting embodiment, server, when preserving incremental data, also preserves the version information of this incremental data, e.g. one version
Number.
The communication module of server is on the one hand for from uploading client reception incremental data, another side, being additionally operable to basis
Certain rule, is sent to arbitrary download client needing to carry out data renewal, in order to this download client by this incremental data
End is updated according to this incremental data.Described rule is not as it was previously stated, repeat them here.
Client terminal quantity shown in Fig. 5 is 4, but this only illustrates situation.As it was previously stated, the present invention is for client
Quantity be not restricted.
<the second embodiment>
Fig. 7 is the flow chart of the data-updating method based on incremental data of the second embodiment of the present invention.
As it was previously stated, first embodiment describes the data-updating method according to the present invention carries out the stream of a secondary data renewal
Journey.This second embodiment is to realize repeatedly renewal based on incremental data on the basis of first embodiment.
For having carried out the incremental data produced after repeatedly updating, owing to it is to carry out on the basis of initial data
Repeatedly calculate, therefore the redundancy issue of its data may ratio more serious.In this case, continue to use incremental data more
Newly may not obtain the most excellent effect.Therefore, in this second embodiment, set one first in the server
Threshold value, when the number of versions of data reaches this first threshold, this server requirement uploads complete by this latest edition of client
Data after the renewal of amount are sent to this server, and preserve the data after the renewal of this full dose on that server.
According to a kind of detailed description of the invention of the present invention, preserve the data after the renewal of this full dose the most simultaneously
Version information.For the data after the renewal with full dose when once updating and incremental data, it can share a version
Number.
Such as, if server settings first threshold is 20, and server saves the data of following version,
1.0.0.0 it is former
1.0.0.1 increase
1.0.0.2 increase
……
1.0.0.18 increase
1.0.0.19 (reaching the 20th version) is increased
(wherein, " former " represents initial data, and " increasing " represents incremental data, can not have initial data)
Now, server requirement send 1.0.0.19 version incremental data upload the client full dose by 1.0.0.19 version
Renewal after data be also sent to this server.Then, server preserves the data of following version:
1.0.0.0 it is 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 it is complete
(wherein, " entirely " representing the data after the renewal of full dose).
According to other embodiments of the invention, it is also possible to after uploading client and decide whether to upload the renewal of full dose
Data are in server.
As it was previously stated, preserve incremental data in the server, when after repeatedly updating, the most just preserve
Initial data and the incremental data of multiple version based on this initial data.Generally, hardware condition it is limited to or based on system
The consideration of resource, for certain data (such as one software or a file), the versions of data that can preserve on the server
Quantity can not be infinitely great.And hence it is also possible to be another higher limit of quantity set of the versions of data on server, at this
It is referred to as Second Threshold.According to this embodiment of the invention, when the versions of data quantity on server reaches this Second Threshold, must
The data of older version must be deleted, to keep the number of versions of data to be not more than this Second Threshold.
According to a kind of detailed description of the invention of the present invention, described Second Threshold is more than described first threshold.Further, deleting
During the data of Versions, at least retain the data after the renewal of a full dose or initial data.More preferably, many when having
During data after the renewal of individual full dose, at least retain with the renewal of the full dose of the immediate version of current version after data.
Such as, Second Threshold is 30, then combine the example below explanation version operating process according to Second Threshold.Assume
Preserve the data of following version in the server:
1.0.0.0 it is 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 it is complete
1.0.0.20 increase
……
1.0.0.28 increase
When there being user end to server to update this data the most again, thus preserve new versions of data in the server
1.0.0.29, time, the version number of these data reaches Second Threshold 30.Thus server deletes version 1.0.0.0 earlier.At clothes
In the versions of data 1.0.0.1 to 1.0.0.29 that business device preserves, including the data of at least one full dose, it is version the most in this example
This 1.0.0.19 is complete.
Version updating
In this second embodiment, server there may be initial data, the incremental data of multiple version, it is also possible to
There are the data after the renewal of at least one full dose transmitted by upload server.In this case, the data of the present invention are more
New method can further optimize.For client, the operation of its version updating can be as described below:
If there are the data of following version on server:
1.0.0.0 it is 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 it is 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, when each user end to server asks more new data, server will be
The more new data of redaction is sent to this client.The more new data of this latest edition is probably incremental data, it is also possible to complete
Data after the renewal of amount.According to the preferred embodiment of the present invention, when there is the incremental data of same version and full dose more
Data after Xin, the data after the renewal of full dose are sent to client by server.
According to the preferred embodiment of the present invention, user end to server asks enclose in this client during more new data
The version information of data to be updated, such as version number.At this moment, server can be all with on server according to this version number
Versions of data number compare, the data determining to send which version to this client with this.
In this case, more preferably, when the renewal that there is the full dose higher than client current version on server
After data time, server only select the renewal of the full dose of this version after data and version higher than this full dose renewal after
The incremental data of data is transmitted;More preferably, when there is the more than one full dose higher than client release on server
Renewal after data time, server only select the renewal of the full dose of highest version after data and higher than the renewal of this full dose
After the incremental data of version of data be transmitted.
Such as, in example given above,
(1) it is " 1.0.0.22 " when the current versions of data of client (being i.e. sent to the versions of data of server with request)
Time, server can only send to client:
1.0.0.23 increase
(2) it is " 1.0.0.18 " when the current versions of data of client (being i.e. sent to the versions of data of server with request)
Time, 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
Can also send:
1.0.0.19 it is complete
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase.
Now, server can make a choice, and generally can determine according to the data volume sent, and selects to send data
Measure little.In this example embodiment, in general, the data after the renewal of full dose are more than the incremental data of same version.Now, previous
The data volume that the mode of kind sends is less, at this moment can be to select send in former mode.
(3) it is " 1.0.0.1 " when the current versions of data of client (being i.e. sent to the versions of data of server with request)
Time, 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
Can also only send:
1.0.0.19 it is complete
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase
And now, owing to former mode needs the version of incremental data sent more so that the data volume of transmission can
Can be more than latter approach, server can select latter approach to be transmitted.
But, recited above be only example, specifically chosen send in which way time, can be according to practical situation
Concrete setting.Such as, in the case of (2nd) above-mentioned kind, although number when being transmitted in former mode during current renewal
Less according to amount.But, if consider renewal next time or ensuing renewal, consider total transmission data volume, it is possible to
To select the second way.
Version recovers
According to this second embodiment of the present invention, when on server, storage has the data of multiple version, client also may be used
With to server request " version recovery ".So-called version recovers to refer to the number that client request recovers indicated release from server
According to.
When user end to server sends a version recovery request, enclose the version information needing to recover, example simultaneously
A version number in this way.Now, server, by checking the version of the data of storage on it, selects to send at least to this client
One full dose data and incremental data based on these full dose data.
Such as, when client request is from the data of server recovery 1.0.0.21 version, and on server there be storage:
1.0.0.0 it is 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 it is complete
1.0.0.20 increase
1.0.0.21 increase
1.0.0.22 increase
1.0.0.23 increase
Now, server can select to send to this client
1.0.0.0 it is 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,
Can also select to send to client
1.0.0.19 it is complete
1.0.0.20 increase
1.0.0.21 increase.
According to a kind of preferred implementation, server can determine in which way according to the size of the data volume sent
Send data.In this example, if the data volume of the latter is less, can select only to send 1.0.0190 version full dose data and
1.0.0.20 and the incremental data of 1.0.0.21 version.
Fig. 8 shows the system architecture diagram of data-updating method according to the second embodiment of the present invention.As shown in Figure 8,
Basic framework is similar with first embodiment.
But, the server of this second embodiment also includes a threshold control block, it is used for setting described first
Threshold value and Second Threshold, and according to first threshold, control this communication module and send the renewal uploading full dose to upload server
After the instruction of data, and according to Second Threshold, the data memory module controlling this server deletes the data of Versions,
Stored versions of data is made to be not more than Second Threshold.
Further, this threshold control block is additionally operable to control communication module and carries downwards client and send the data of which version.
Concrete control method is not as it was previously stated, repeat them here.
Algorithm and display are not intrinsic to any certain computer, virtual system or miscellaneous equipment relevant provided herein.
Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system
Structure be apparent from.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use various
Programming language realizes the content of invention described herein, and the description done language-specific above is to disclose this
Bright preferred forms.
In description mentioned herein, illustrate a large amount of detail.It is to be appreciated, however, that the enforcement of the present invention
Example can be put into practice in the case of not having these details.In some instances, it is not shown specifically known method, structure
And technology, in order to do not obscure the understanding of this description.
Similarly, it will be appreciated that one or more in order to simplify that the disclosure helping understands in each inventive aspect, exist
Above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes
In example, figure or descriptions thereof.But, the method for the disclosure should not be construed to reflect an intention that i.e. required guarantor
The application claims feature more more than the feature being expressly recited in each claim protected.More precisely, as following
Claims reflected as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
The claims following detailed description of the invention are thus expressly incorporated in this detailed description of the invention, the most each claim itself
All as the independent embodiment of the present invention.
Those skilled in the art are appreciated that and can carry out the module in the equipment in embodiment adaptively
Change and they are arranged in one or more equipment different from this embodiment.Can be the module in embodiment or list
Unit or assembly are combined into a module or unit or assembly, and can put them in addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit excludes each other, can use any
Combine all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed appoint
Where method or all processes of equipment or unit are combined.Unless expressly stated otherwise, this specification (includes adjoint power
Profit requires, summary and accompanying drawing) disclosed in each feature can be carried out generation by providing identical, equivalent or the alternative features of similar purpose
Replace.
Although additionally, it will be appreciated by those of skill in the art that embodiments more described herein include other embodiments
Some feature included by rather than further feature, but the combination of the feature of different embodiment means to be in the present invention's
Within the scope of and form different embodiments.Such as, in the following claims, embodiment required for protection appoint
One of meaning can mode use in any combination.
The all parts embodiment of the present invention can realize with hardware, or to run on one or more processor
Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that and can use in practice
Microprocessor or digital signal processor (DSP) realize the some or all portions in device according to embodiments of the present invention
The some or all functions of part.The present invention is also implemented as the part for performing method as described herein or complete
The equipment in portion or device program (such as, computer program and computer program).Such program realizing the present invention
Can store on a computer-readable medium, or can be to have the form of one or more signal.Such signal is permissible
Download from internet website and obtain, or provide on carrier signal, or provide with any other form.
The present invention will be described rather than limits the invention to it should be noted above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference marks that should not will be located between bracket is configured to limitations on claims.Word " comprises " and does not excludes the presence of not
Arrange element in the claims or step.Word "a" or "an" before being positioned at element does not excludes the presence of multiple such
Element.The present invention and can come real by means of including the hardware of some different elements by means of properly programmed computer
Existing.If in the unit claim listing equipment for drying, several in these devices can be by same hardware branch
Specifically embody.Word first, second and third use do not indicate that any order.These word explanations can be run after fame
Claim.