Summary of the invention
The present invention is directed to the existing technical problem of prior art, a kind of realization data consistency support method, Apparatus and system are provided, thereby a kind of efficient, practical data consistency security mechanism is provided.
For solving the problems of the technologies described above, the invention provides scheme as follows:
The embodiment of the invention provides a kind of realization data consistency support method, and described method is applied in the data system, comprises a data publisher and at least one data receiver in the described data system; Described method comprises:
When the fail data of preserving as the data receiver is accessed, data receiver direction data publisher sends solicited message, to obtain the latest edition of described fail data, described fail data is the version information of first data of preserving as the data receiver, when being lower than the version information after described the first Data Update that described data publisher sends, be fail data with described the first Data Identification;
The data receiver receives and the latest edition of the described fail data that the save data publisher sends, and described fail data is designated valid data.
Preferably, described method also comprised before the data receiver is fail data with described Data Identification:
Data publisher records the version information after described the first Data Update;
Data publisher sends Data Update notice to the data receiver, comprise in the described notice version information after described the first Data Update and described the first number according to identification information.
Preferably, described data publisher sends Data Update notice to the data receiver and comprises:
Described data publisher sends described Data Update notice to the data receiver who has subscribed to the version information after described the first Data Update.
Preferably, also comprise in the described Data Update notice:
The version information of the data partition under the first data described in the data publisher, comprise highest version information and/or the minimum version information of the total data of preserving in the data partition in the version information of described data partition, described data partition is used for preserving all data that have business association with described the first data;
Described method also comprised before data receiver direction data publisher sends solicited message:
The version information of described first data of preserving as the data receiver, when being lower than the minimum version information in the version information of described data partition or being higher than in the version information of described data partition highest version information, the total data in described the first data place data partition that the data receiver will preserve is designated fail data.
The embodiment of the invention also provides a kind of realization data consistency ensuring equipment, and described application of installation comprises a data publisher and at least one described device in the described data system in a data system; Described device comprises:
Sending module, be used for when the fail data of described device preservation is accessed, the publisher sends solicited message to data, to obtain the latest edition of described fail data, described fail data is the version information of first data of preserving when described device, when being lower than the version information after described the first Data Update that described data publisher sends, described device is fail data with described the first Data Identification;
Processing module be used for to receive and the latest edition of the described fail data that the save data publisher sends, and described fail data is designated valid data.
Preferably, described realization data consistency ensuring equipment also comprises:
Receiver module is used for receiving the Data Update notice that described data publisher sends, and comprises version information after described the first Data Update and the identification information of described the first data in the described notice.
Preferably, also comprise in the Data Update notice that described receiver module receives: the version information of the data partition under the first data described in the data publisher, comprise highest version information and/or the minimum version information of the total data of preserving in the data partition in the version information of described data partition, described data partition is used for preserving all data that have business association with described the first data;
Described processing module also is used for: the version information of described first data of preserving when described device, when being lower than the minimum version information in the version information of described data partition or being higher than in the version information of described data partition highest version information, the total data in described the first data place data partition of preserving is designated fail data.
The embodiment of the invention also provides a kind of realization data consistency ensuring equipment, and described application of installation comprises a described device and at least one data receiver in the described data system in a data system; Described device comprises:
Receiver module, be used for the solicited message that the receive data recipient sends, described request information is that the fail data of preserving as described data receiver is when accessed, described data receiver sends, described request information is used for obtaining the latest edition of described fail data, described fail data is the version information of first data of preserving as described data receiver, when being lower than the version information after described the first Data Update that described device sends, is fail data with described the first Data Identification;
Sending module for the latest edition that sends described fail data to described data receiver, receives and preserves the latest edition of described fail data, and described fail data is designated valid data to be used for described data receiver.
Preferably, described realization data consistency ensuring equipment also comprises:
Logging modle is used for recording the version information after described the first Data Update;
Described sending module also is used for sending the Data Update notice to described data receiver, comprises version information and described the first Data Identification information after described the first Data Update in the described notice.
The embodiment of the invention also provides a kind of realization data consistency safeguards system, comprises a data publisher and at least one data receiver in the described system;
Described data receiver comprises:
Sending module, be used for when the fail data of described data receiver's preservation is accessed, send solicited message to described data publisher, to obtain the latest edition of described fail data, described fail data is the version information of first data of preserving as described data receiver, when being lower than the version information after described the first Data Update that described data publisher sends, described data receiver is fail data with described the first Data Identification;
Processing module be used for to receive and preserves the latest edition of the described fail data that described data publisher sends, and described fail data is designated valid data;
Described data publisher comprises:
Receiver module is used for receiving the solicited message that described data receiver sends;
Sending module is for the latest edition that sends described fail data to described data receiver.
Can find out from the above, realization data consistency support method provided by the invention, Apparatus and system, when accessed by the fail data of preserving as the data receiver, data receiver direction data publisher sends solicited message, to obtain the latest edition of described fail data, described fail data is the version information of first data of preserving as the data receiver, when being lower than the version information after described the first Data Update that described data publisher sends, be fail data with described the first Data Identification; The data receiver receives and the latest edition of the described fail data that the save data publisher sends, and described fail data is designated valid data.Thereby provide a kind of efficient, practical data consistency security mechanism.
Embodiment
The embodiment of the invention provides a kind of realization data consistency support method, and the method is applied in the data system, comprises a data publisher and at least one data receiver in the described data system.
As shown in Figure 2, the method specifically can comprise:
Step 201, when the fail data of preserving as the data receiver is accessed, data receiver direction data publisher sends solicited message, to obtain the latest edition of described fail data, described fail data is the version information of the data of preserving as the data receiver, when being lower than the version information after the described Data Update that described data publisher sends, be fail data with described Data Identification;
Step 202, the data receiver receives and the latest edition of the described fail data that the save data publisher sends, and described fail data is designated valid data.
The embodiment of the invention provides said method, can effectively realize data's consistency between data publisher in the data system and the data receiver.
In the embodiment of the invention, data publisher and data receiver's responsibility is decomposed, wherein, data publisher is responsible for the data notification management, and the data receiver is responsible for the data access management.
The data notification management that data publisher was responsible for specifically can be embodied in the data publisher and be in charge of the versions of data recording of information, and be responsible for when change occurs versions of data information, send update notification to the data receiver, namely the related data publisher of the embodiment of the invention specifically can relate to following operation:
Version information after record data upgrade;
Send Data Update notice to the data receiver, comprise version information after the Data Update and the identification information of data in the described notice.
Owing to comprising at least one data receiver in the embodiment of the invention, therefore, data publisher can be only to the prior data receiver who subscribes to the Data Update notice, and perhaps, but the data publisher also sends the Data Update notice to the intrasystem total data recipient of data.
For the prior data receiver who subscribes to the Data Update notice, but the Data Identification information that comprises in the based on data update notification is obtained the corresponding data of data receiver's preservation and the version information of these data.
And for the data receiver who does not have prior subscription data update notification, receiving Data Update when notice, equally can the based on data identification information, carry out searching of corresponding data, if do not find corresponding data, then this data receiver can be abandoned and namely ignore this Data Update notice.
In addition, the data publisher that the embodiment of the invention is related, when receiving the solicited message of that the data receiver sends, as to be used for obtaining fail data latest version information, also can send to the data receiver latest edition of described fail data, so that the data receiver preserves and upgrades fail data, and fail data is designated valid data.
In the embodiment of the invention, the data access management that the data receiver was responsible for specifically can be embodied in, and data receiver can send the Data Update notice according to the data publisher, judges whether the data of self preserving are effective, and can identify.When fail data was accessed among the data receiver, data receiver direction data publisher sent solicited message, to ask the latest edition of this fail data.
Concrete, after the data receiver received the Data Update notice that the data publisher sends, the version information after the Data Update that comprises in can the based on data update notification and the identification information of data judged whether the data of self preserving lost efficacy.If the version information of the data that the data receiver preserves is lower than the version information after the Data Update that the data publisher sends, then data receiver can be fail data with this Data Identification.Here, the data receiver can according to the identification information of the data that receive, obtain corresponding data and the version information thereof self preserved.
But, the embodiment of the invention is for fear of again occurring in the prior art, after data publisher's data modification, the data that need to finish immediately between data publisher and the recipient cause data publisher and data receiver's system responses is had relatively high expectations synchronously, and a plurality of data receivers send a large amount of synchronization request information and cause the problem of the serious performance bottleneck of data publisher to the data publisher simultaneously, in the data consistency support method that the embodiment of the invention provides, the data receiver is not the Data Update notice that is sending according to the data publisher, after the Data Identification that self is preserved is fail data, send the request message that is used for obtaining this fail data latest edition to the data publisher immediately, but the fail data of preserving the data receiver is when accessed, just trigger data receive direction data publisher asks the operation of the latest edition of fail data, thereby has avoided the again appearance of the existing problem of above-mentioned prior art.
During latest edition data after the data receiver receives fail data that the data publisher sends and upgrades, upgrade this fail data of self preserving, simultaneously, this fail data is designated valid data.
As seen, in the realization data consistency support method that the embodiment of the invention provides, between data publisher and data receiver, can find inconsistent data by the reconciliation mode, and, data receiver can be by putting the mode of fail bit, inconsistent data are identified, and when fail data is triggered (accessed, extraction, read-write etc.), log-on data is new technological process more, to obtain the latest edition of fail data from the data publisher, thereby avoid the Data Update operation on the impact of system, realize that the Real-time Data Uniform of minimum cost is reset.And by the version management data age, system only needs to guarantee that drain process does not get final product, and data need not immediately to finish behind data change synchronously, only need guarantee can finish when data are used by system to get final product synchronously.
In addition, the associate feature of service based data, errorless for guaranteeing that data upgrade in time, the embodiment of the invention also can be set up the data partition version mechanism, and data are carried out data partition according to business association, and sets up the data partition version information.
In the embodiment of the invention, data partition under the data can (every data all have unique major key according to the major key of data, can not repeat between many records, be generally phone number, user ID, Customer ID etc.) carry out hash and divide, such as by hash algorithm etc. major key being calculated, and according to the number delivery of subregion, with all data uniform mappings in a plurality of subregions.
So, when the data publisher sends the Data Update notice to the data receiver, except but the version information and Data Identification of change occurs in distributing data, but the version information of the data partition of distributing data ownership also simultaneously, the version information of data partition specifically can be highest version and/or the minimum version of all data in the data partition.
Illustrate, as shown in Figure 3, in the affiliated data partition of the data that data publisher's one version information changes, comprise some data (data A-I etc.), and, comprise respectively the version information that data are corresponding in the above-mentioned data record information, for example the version information of data A (Version) is: 11011, the Version of data I is: 11888, so, in the Data Update notice, the version information of the data partition under the data described in the data publisher namely can be: the Version11888 (version information is the highest) of the Version11011 of data A (version information is minimum) and/or data I.
The data receiver is when realizing the data access management, and according to the information that comprises in the Data Update notice, i.e. highest version information and the minimum version information of data partition under the data among the data publisher are to the corresponding data of self the preserving processing of comparing.
The version information of the corresponding data of preserving as the data receiver, when being lower than the minimum version information in the version information of data partition under this data among the data publisher or being higher than among the data publisher under these data in the version information of data partition highest version information, the interior total data (for example data A-I in the accompanying drawing 3) of data partition is designated fail data under these data that the data receiver will preserve.
Because the business association of data is close in the same data partition, as all being same client's different pieces of information record, by the data partition version mechanism that the invention described above embodiment provides, can guarantee effectively that the data of access have high consistency when data access.
As seen, the realization data consistency support method that the embodiment of the invention provides, by to a bit (data publisher) data modification, multiple spot (at least one data receiver) data synchronous query update mechanism, have simple, easy row, serious forgiveness advantages of higher, the method can be data center's type systematic provides the access of multiple spot high-performance that good data Replica, renewal and consistency security mechanism is provided.For example at BSS, the method that provides by the embodiment of the invention, can realize client, account and data data's consistencies on each node of business system, account system and charge system such as user's three family information and order relations, therefore can prove, the realization data consistency support method that the embodiment of the invention provides has widely used characteristics.
And related data publisher and data receiver in the embodiment of the invention, but equal persistence data when data are synchronous, need not to carry out data and empty processing.
Below, the implementation procedure of a specific embodiment of the data consistency support method that the embodiment of the invention is provided is carried out detailed description.
Shown in the accompanying drawing 4, this process specifically can comprise:
Step 41, the version information after data publisher's record data upgrade.
During the one data generation version information change of preserving as the data publisher, data publisher records the version information after this Data Update when realizing that its data is upgraded.
Step 42, data publisher sends the Data Update notice to the data receiver.
In this Data Update notice, specifically can comprise the version information after the Data Update, and the identification information of these data.
Further, in this Data Update notice, can also comprise the version information in the affiliated data partition of these data.
Step 43, the data receiver carries out the comparison of versions of data information and processes.
Concrete, the data receiver is after receiving the Data Update notice of data publisher transmission, but the Data Identification information in the based on data update notification, obtain corresponding data and the version information thereof self preserved, and the version information of these data that self is preserved, with the processing of comparing of the up-to-date version information of these data that comprise in the Data Update notice.
If in the Data Update notice, the version information that also comprises data partition under these data are in the data publisher, then the data receiver further can also carry out this versions of data information that self is preserved, the operation that the version information of the data partition in notifying with Data Update (being the version information of the affiliated data partition of these data among the data publisher) is compared and processed.
Step 44, data receiver scheme are based on the version information comparison result, and whether identification data is effective.
If the version information of these data that the data receiver preserves is lower than the version information of these data in the Data Update notice, then the data receiver is fail data with this Data Identification.
Here need to prove, is version information when identical for comparison result, and data receiver can need not to carry out the synchronous renewal of data and process.In addition, because the Data Update notice sends after the information updating of data publisher versions of data, therefore the situation that versions of data information in the Data Update notice is higher than the version information of these data that the data receiver preserves can not appear, if there is, can fault appear the specified data system then.
Further, if the version information of these data that the data receiver preserves, when being lower than the minimum version information in the version information of the data partition that Data Update notice comprises or being higher than in the version information of the data partition that the Data Update notice comprises highest version information, the interior total data of data partition is designated fail data under these data that the data receiver will preserve.
Step 45, data receiver direction data publisher sends solicited message.
When the fail data (can comprise the total data in single data or the data partition here) of data receiver's preservation is accessed, data receiver can send solicited message to the data publisher, is up-to-date edition data afterwards with the renewal of asking this fail data.
Step 46, data publisher sends the latest edition of fail data to the data receiver.
Data publisher can be sent to the data receiver with the latest edition data of fail data when receiving the solicited message of data receiver transmission.
Step 47, the data receiver finishes Data Update.
Data receiver can carry out the renewal of fail data based on the latest edition of the fail data that receives, and the fail data after will upgrading is designated valid data, thereby finishes simultaneous operation.
By above-mentioned steps, can realize in the data system data's consistency between the data publisher and data receiver.
Can find out by foregoing description, realization data consistency support method provided by the invention, when accessed by the fail data of preserving as the data receiver, data receiver direction data publisher sends solicited message, to obtain the latest edition of described fail data, described fail data is the version information of first data of preserving as the data receiver, when being lower than the version information after described the first Data Update that described data publisher sends, is fail data with described the first Data Identification; The data receiver receives and the latest edition of the described fail data that the save data publisher sends, and described fail data is designated valid data.Thereby provide a kind of efficient, practical data consistency security mechanism.
The realization data consistency support method that provides based on the embodiment of the invention, the embodiment of the invention also provides a kind of realization data consistency safeguards system, this system can be a data system, as shown in Figure 5, this system specifically can comprise a data publisher 51 and at least one data receiver 52, and data publisher 51 preserves identical data with data receiver 52.
Wherein, as shown in Figure 6, the data receiver that the embodiment of the invention is related specifically can comprise:
Sending module 61, be used for when the fail data of data receiver's preservation is accessed, the publisher sends solicited message to data, to obtain the latest edition of described fail data, described fail data is the version information of the data of preserving as the data receiver, when being lower than the version information after this Data Update that described data publisher sends, the data receiver is fail data with this Data Identification;
Processing module 62 be used for to receive and the latest edition of the described fail data that the save data publisher sends, and described fail data is designated valid data.
In addition, data receiver 51 can also comprise:
Receiver module 63 is used for the Data Update notice that the receive data publisher sends, and comprises version information and Data Identification information after the Data Update in the described notice.
Also comprise in the Data Update notice that receiver module 63 receives: the version information of the data partition among the data publisher under the data, comprise highest version information and/or the minimum version information of the total data of preserving in the data partition in the version information of described data partition, described data partition is used for preserving all data that have business association with data.
Processing module 62 also is used for: the version information of data of preserving as the data receiver, when being lower than the minimum version information in the version information of described data partition or being higher than in the version information of described data partition highest version information, the total data in this data place data partition of preserving is designated fail data.
Processing module 62 also is used for: the version information of data of preserving as the data receiver, when being lower than the version information after this Data Update that described data publisher sends, the data receiver is fail data with this Data Identification.
The data publisher 52 that the embodiment of the invention is related as shown in Figure 7, specifically can comprise:
Receiver module 71, be used for the solicited message that receive data recipient 51 sends, described request information is that the fail data of preserving as described data receiver 51 is when accessed, the data receiver sends, described request information is used for obtaining the latest edition of described fail data, described fail data is the version information of the data of preserving as the data receiver, when being lower than the version information after this Data Update that data publisher 52 sends, is fail data with this Data Identification;
Sending module 72 is used for sending to data receiver 51 latest edition of described fail data, receives and preserves the up-to-date of described fail data to be used for described data receiver 51, and described fail data is designated valid data.
In addition, data publisher 52 specifically can also comprise:
Logging modle 73 is used for the version information after record data upgrade;
Sending module 72 also is used for sending the Data Update notice to described data receiver 51, comprises version information and described the first Data Identification information after described the first Data Update in the described notice.
Shown in the Data Update notice, further can also comprise: the version information of the data partition among the data publisher under the data, comprise highest version information and/or the minimum version information of the total data of preserving in the data partition in the version information of described data partition, described data partition is used for preserving all data that have business association with data.
Can find out by foregoing description, realization data consistency safeguards system provided by the invention, when accessed by the fail data of preserving as the data receiver, data receiver direction data publisher sends solicited message, to obtain the latest edition of described fail data, described fail data is the version information of first data of preserving as the data receiver, when being lower than the version information after described the first Data Update that described data publisher sends, is fail data with described the first Data Identification; The data receiver receives and the latest edition of the described fail data that the save data publisher sends, and described fail data is designated valid data.Thereby provide a kind of efficient, practical data consistency security mechanism.
The above only is embodiments of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.