CN105095313A - Data access method and equipment - Google Patents

Data access method and equipment Download PDF

Info

Publication number
CN105095313A
CN105095313A CN201410219069.3A CN201410219069A CN105095313A CN 105095313 A CN105095313 A CN 105095313A CN 201410219069 A CN201410219069 A CN 201410219069A CN 105095313 A CN105095313 A CN 105095313A
Authority
CN
China
Prior art keywords
user
data
idc
version information
locality
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410219069.3A
Other languages
Chinese (zh)
Other versions
CN105095313B (en
Inventor
童寅
刘浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410219069.3A priority Critical patent/CN105095313B/en
Publication of CN105095313A publication Critical patent/CN105095313A/en
Application granted granted Critical
Publication of CN105095313B publication Critical patent/CN105095313B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention discloses a data access method and equipment. The method comprises: when receiving a data query request message, an IDC queries first data version information corresponding to a user identifier in a local cache cluster and queries second data version information corresponding to the user identifier in a local database; if the first data version information is the same as the second data version information, or the second data version information is newer than the first data version information, the IDC updates user data corresponding to the user identifier in the local cache cluster via the user data corresponding to the user identifier in the local database; and the IDC queries the user data corresponding to the user identifier in the local cache cluster and returns a data query response message carrying the user data corresponding to the user identifier. The data access method in the embodiments of the invention can be used for reducing the network bandwidth cost and guaranteeing the uniformity of the user data obtained by the user, so as to greatly improve the probability of the user for querying the latest user data.

Description

A kind of data access method and equipment
Technical field
The application relates to Internet technical field, especially relates to a kind of data access method and equipment.
Background technology
Along with the development of business; usual meeting disposes IDC (InternetDataCenter respectively at diverse location; Internet data center); as shown in Figure 1, for disposing IDC1 respectively at diverse location, IDC2; the network diagram of IDC3; as: IDC1 is deployed in Beijing, and IDC2 is deployed in Shanghai, and IDC3 is deployed in Guangzhou.In order to avoid the network consumption of accessing across IDC, in each IDC, include cache cluster, and cache cluster is for storing user data.Based on this, when user accesses IDC1, inquire about local cache cluster 1 by by IDC1, and provide user data based on the user data in this cache cluster 1 to user; When user accesses IDC2, inquire about local cache cluster 2 by by IDC2, and provide user data based on the user data in this cache cluster 2 to user; When user accesses IDC3, inquire about local cache cluster 3 by by IDC3, and provide user data based on the user data in this cache cluster 3 to user.
In order to ensure the consistance of the user data that user obtains, need to ensure that cache cluster 1, cache cluster 2 are consistent with the user data stored in cache cluster 3.Based on this, in the prior art, when the user data stored in the cache cluster in certain IDC changes, this IDC needs to send to other IDC the asynchronous message carrying the user data changed, and is utilized the user data stored in the cache cluster of the user data update this locality changed of carrying in this asynchronous message by other IDC.
Such as, when the user data of the user 1 stored in the cache cluster 1 in IDC1 changes, IDC1 sends asynchronous message respectively to IDC2 and IDC3, and carries all customer data (it includes the user data changed) of user 1 in this asynchronous message; IDC2, after receiving asynchronous message, utilizes all customer data of the user 1 carried in this asynchronous message to upgrade all customer data of the user 1 in local cache cluster 2; IDC3, after receiving asynchronous message, utilizes all customer data of the user 1 carried in this asynchronous message to upgrade all customer data of the user 1 in local cache cluster 3.
But, aforesaid way needs all data of carrying certain user in asynchronous message, and all data of user usually larger (as all data maximum possible have the size of a few megabyte), therefore, when the asynchronous message of all data of certain user is carried in transmission, very large network bandwidth expense can be brought.
Summary of the invention
The embodiment of the present application provides a kind of data access method and equipment, to reduce network bandwidth expense.
In order to achieve the above object, the embodiment of the present application provides a kind of data access method, the method is applied in the network comprising multiple Internet data center IDC, wherein, cache cluster and database is comprised in each IDC, said method comprising the steps of: IDC receive from other IDC carry the message of user ID and data version information time, in the cache cluster of this locality, record the corresponding relation between this user ID and this data version information; Described IDC is when receiving the data inquiry request message for user data corresponding to inquiring user mark, inquire about the first data version information that described user ID is corresponding in the cache cluster of this locality, and inquire about the second corresponding in the database of this locality data version information of described user ID; If the first data version information is identical with the second data version information, or the second data version information is newer than the first data version information, then described IDC utilizes the user data that described in the user data update of described user ID correspondence in the database of this locality, user ID is corresponding in the cache cluster of this locality; Described IDC inquires about user data corresponding to described user ID from the cache cluster of this locality, and returns the data query response message carrying user data corresponding to described user ID.
Preferably, in the embodiment of the present application, described IDC receive from other IDC carry the message of user ID and data version information after, described method also comprises: described IDC deletes user data corresponding to this user ID of recording in local cache cluster.
Preferably, in the embodiment of the present application, described method also comprises: described IDC is when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrade the user data that this user ID is corresponding in the cache cluster of this locality, and determine current data version information, and send the message carrying this user ID and this data version information to other IDC.
Preferably, in the embodiment of the present application, described method also comprises: described IDC is when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrade the user data that this user ID is corresponding in the database of this locality, and determine current data version information, in the database of this locality, record the corresponding relation between this user ID and this data version information; And, notify that other IDC upgrades this user ID user data corresponding in the database of this locality, and in the database of this locality, record the corresponding relation between this user ID and this data version information.
The first data version information corresponding in the cache cluster of described user ID in this locality is inquired about at described IDC, and after inquiring about the second corresponding in the database of this locality data version information of described user ID, described method also comprises: if the first data version information is newer than the second data version information, then described IDC determines the type of service that described data inquiry request message is corresponding; If described type of service is the first type of service, then described IDC directly inquires about user data corresponding to described user ID from the database of current this locality, and returns the data query response message carrying user data corresponding to described user ID;
If described type of service is the second type of service, then described IDC sends the data base querying request message carrying described user ID to other IDC, inquire about described user ID user data corresponding in the database of this locality by other IDC, and return the data base querying response message carrying user data corresponding to described user ID to described IDC; Described IDC is after receiving described data base querying response message, the user data that user ID described in the user data update utilizing described user ID corresponding is corresponding in the cache cluster of this locality, and from the cache cluster of this locality, inquire about user data corresponding to described user ID, and return the data query response message carrying user data corresponding to described user ID.
Preferably, described data version information specifically comprises the last temporal information upgrading user data.
On the other hand, a kind of Internet data center IDC is also provided in the embodiment of the present application, be applied in the network comprising multiple IDC, cache cluster and database is comprised in each IDC, described IDC specifically comprises: memory module, for receive from other IDC carry the message of user ID and data version information time, in the cache cluster of this locality, record the corresponding relation between this user ID and this data version information; Enquiry module, for when receiving the data inquiry request message for user data corresponding to inquiring user mark, inquire about the first data version information that described user ID is corresponding in the cache cluster of this locality, and inquire about the second corresponding in the database of this locality data version information of described user ID; Update module, identical with the second data version information for working as the first data version information, or when the second data version information is newer than the first data version information, the user data that described in the user data update utilizing described user ID corresponding in the database of this locality, user ID is corresponding in the cache cluster of this locality; Cache Communication module, for inquiring about user data corresponding to described user ID from the cache cluster of this locality, and returns the data query response message carrying user data corresponding to described user ID.
Described memory module, also for receive from other IDC carry the message of user ID and data version information after, delete the user data that this user ID of recording in local cache cluster is corresponding.
Preferably, in the embodiment of the present application, described update module, also for when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrades the user data that this user ID is corresponding in the cache cluster of this locality; Described Cache Communication module, also for determining current data version information, and sends the message carrying this user ID and this data version information to other IDC.
Preferably, in the embodiment of the present application, described update module, also for when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrades the user data that this user ID is corresponding in the database of this locality; Described memory module, also for determining current data version information, and records the corresponding relation between this user ID and this data version information in the database of this locality; Described IDC also comprises database communication module; Wherein, described database communication module, also for notifying that other IDC upgrades this user ID user data corresponding in the database of this locality, and records the corresponding relation between this user ID and this data version information in the database of this locality.
Described Cache Communication module, also for when the first data version information is newer than the second data version information, determines the type of service that described data inquiry request message is corresponding; If described type of service is the first type of service, then directly from the database of current this locality, inquire about user data corresponding to described user ID, and return the data query response message carrying user data corresponding to described user ID; If described type of service is the second type of service, the data base querying request message carrying described user ID is then sent to other IDC, inquire about described user ID user data corresponding in the database of this locality by other IDC, and return the data base querying response message carrying user data corresponding to described user ID to described IDC; After receiving described data base querying response message, the user data that user ID described in the user data update indicating described update module to utilize described user ID corresponding is corresponding in the cache cluster of this locality, and from the cache cluster of this locality, inquire about user data corresponding to described user ID by described Cache Communication module, and return the data query response message carrying user data corresponding to described user ID.
Preferably, described data version information specifically comprises the last temporal information upgrading user data.
Compared with prior art, the embodiment of the present application at least has the following advantages: in the embodiment of the present application, when upgrading user data, user ID and data version information is comprised in the message that IDC sends to other IDC, and no longer comprise all customer data, size due to user ID and data version information is far smaller than the size of user data, that carries content in the message that therefore IDC sends to other IDC is far smaller than the user data carried in asynchronous message, thus network bandwidth expense can be reduced, and ensure the consistance of the user data that user obtains, the probability making user inquire up-to-date user data improves greatly.
Accompanying drawing explanation
In order to the technical scheme of the embodiment of the present application is clearly described, below the accompanying drawing used required in describing the embodiment of the present application is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the application, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings of the embodiment of the present application.
Fig. 1 is the network diagram of disposing IDC in prior art at diverse location respectively;
Fig. 2 is the application scenarios schematic diagram proposed in the embodiment of the present application one;
Fig. 3 is a kind of data access method schematic flow sheet proposed in the embodiment of the present application one;
Fig. 4 is the structural representation of a kind of IDC proposed in the embodiment of the present application two.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, be clearly and completely described the technical scheme in the application, obviously, described embodiment is only a part of embodiment of the application, instead of whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making the every other embodiment obtained under creative work prerequisite, all belong to the scope of the application's protection.
Embodiment one
For problems of the prior art, the embodiment of the present application one provides a kind of data access method, is applied in the network comprising multiple IDC, and this network can be distributed network, and comprising cache cluster and database in each IDC, this cache cluster and database are all for storing user data.Take Fig. 2 as the application scenarios schematic diagram of the embodiment of the present application, IDC1 can be deployed in Beijing, IDC2 is deployed in Shanghai, IDC3 is deployed in Guangzhou, comprise in IDC1 in cache cluster 1 and database 1, IDC2 comprising in cache cluster 2 and database 2, IDC3 and comprise cache cluster 3 and database 3.When user equipment access IDC, based on the position residing for subscriber equipment, the request of access of subscriber equipment can be assigned on IDC1 or IDC2 or IDC3 by server.Such as, subscriber equipment 1 is when Beijing access IDC, and the request of access of subscriber equipment 1 can be assigned on IDC1 by server; Subscriber equipment 2 is when Shanghai access IDC, and the request of access of subscriber equipment 2 can be assigned on IDC2 by server; Subscriber equipment 3 is when Guangzhou access IDC, and the request of access of subscriber equipment 3 can be assigned on IDC3 by server.
Under above-mentioned application scenarios, as shown in Figure 3, this data access method specifically comprises the following steps:
Step 301, IDC is when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrade the user data that this user ID is corresponding in the cache cluster of this locality, determine current data version information, send the message carrying this user ID and this data version information to other IDC.
In the embodiment of the present application, IDC is when receiving this Data Update request message, also need to upgrade this user ID user data corresponding in the database of this locality, and determine current data version information, and record the corresponding relation between this user ID and this data version information in the database of this locality; And this IDC notifies that other IDC upgrades this user ID user data corresponding in the database of this locality, and records the corresponding relation between this user ID and this data version information in the database of this locality.
In the embodiment of the present application, this data version information specifically includes but not limited to: the last temporal information upgrading user data, as upgraded the time 13:00 of user data for the last time.
Under the application scenarios shown in Fig. 2, suppose that the user data that user A is corresponding is data 1, data 2 and data 3, then: in the cache cluster 1 of IDC1 and database 1, record user identifications (i.e. user A) and corresponding user data (i.e. data 1 will be distinguished, data 2 and data 3), and record user identifications (i.e. user A) and corresponding user data (i.e. data 1 will be distinguished in the cache cluster 2 of IDC2 and database 2, data 2 and data 3), and record user identifications (i.e. user A) and corresponding user data (i.e. data 1 will be distinguished in the cache cluster 3 of IDC3 and database 3, data 2 and data 3).
Suppose that user A needs data 1 to be revised as data 4, then user A can send Data Update request message by corresponding subscriber equipment, this Data Update request message for upgrading user data corresponding to user ID, namely for data 1 corresponding for user A are revised as data 4.On this basis, suppose that this Data Update request message is distributed to IDC1 process by server, then: IDC1, when receiving this Data Update request message, upgrades the user data (being revised as data 4 by data 1) that this user ID (user A) is corresponding in the cache cluster 1 of this locality.Afterwards, suppose that the time of data 1 being revised as data 4 is 13:10, then: IDC1 determines that current data version information is 13:10.
On this basis, further, IDC1 also needs to send to IDC2 the message carrying this user ID (user A) and this data version information (13:10), and IDC1 also needs to send to IDC3 the message carrying this user ID (user A) and this data version information (13:10).
In addition, IDC1, when receiving this Data Update request message, also needs to upgrade this user ID (user A) user data (being revised as data 4 by data 1) corresponding in the database 1 of this locality.Afterwards, suppose that the time of data 1 being revised as data 4 is 13:10, then: IDC1 determines that current data version information is 13:10, and in the database 1 of this locality, record the corresponding relation between this user ID (user A) and this data version information (13:10).Further, IDC1 also needs to notify that IDC2 upgrades this user ID (user A) user data (being revised as data 4 by data 1) corresponding in the database 2 of this locality, and in the database 2 of this locality, record the corresponding relation between this user ID (user A) and this data version information (13:10); IDC1 also needs to notify that IDC3 upgrades this user ID (user A) user data (being revised as data 4 by data 1) corresponding in the database 3 of this locality, and in the database 3 of this locality, record the corresponding relation between this user ID (user A) and this data version information (13:10).Afterwards, IDC2 also needs to upgrade user A user data (being revised as data 4 by data 1) corresponding in the database 2 of this locality, and the corresponding relation in the database 2 of this locality between recording user A and this data version information (13:10); IDC3 also needs to upgrade user A user data (being revised as data 4 by data 1) corresponding in the database 3 of this locality, and the corresponding relation in the database 3 of this locality between recording user A and this data version information (13:10).
Step 302, IDC receives the message of carrying user ID and data version information from other IDC, records the corresponding relation between this user ID and this data version information in the cache cluster of this locality.
In the embodiment of the present application, IDC receive from other IDC carry the message of user ID and data version information after, record on the basis of the corresponding relation between this user ID and this data version information in the cache cluster of this locality, this IDC also needs to delete user data corresponding to this user ID of recording in local cache cluster, i.e. now a record user identifications and data version information in cache cluster.
IDC1 to IDC2 send carry the message of user ID (user A) and data version information (13:10) after, IDC2 receives the message of carrying user ID (user A) and data version information (13:10) from IDC1, and the corresponding relation in the cache cluster 2 of this locality between record user identifications (user A) and data version information (13:10), and from the cache cluster 2 of this locality, delete user data (data 1, data 2 and data 3) corresponding to user ID (user A).
IDC1 to IDC3 send carry the message of user ID (user A) and data version information (13:10) after, IDC3 receives the message of carrying user ID (user A) and data version information (13:10) from IDC1, and the corresponding relation in the cache cluster 3 of this locality between record user identifications (user A) and data version information (13:10), and from the cache cluster 3 of this locality, delete user data (data 1, data 2 and data 3) corresponding to user ID (user A).
Step 303, IDC is when receiving the data inquiry request message for user data corresponding to inquiring user mark, inquire about the first data version information that this user ID is corresponding in the cache cluster of this locality, and inquire about the second corresponding in the database of this locality data version information of this user ID.
Under the application scenarios shown in Fig. 2, suppose that user A needs the user data that inquiring user A is corresponding, then user A can send data inquiry request message by corresponding subscriber equipment, and this data inquiry request message is used for user data corresponding to inquiring user A; On this basis, suppose that this data inquiry request message is distributed to IDC1 process by server, then IDC1 is when receiving this data inquiry request message, directly inquire the user data that this user ID (user A) is corresponding in the cache cluster 1 of this locality, this user data is data 4, data 2 and data 3, and this process repeats no longer in detail at this.
Suppose that user B needs the user data that inquiring user A is corresponding, then user B can send data inquiry request message by corresponding subscriber equipment, and this data inquiry request message is used for user data corresponding to inquiring user A; On this basis, suppose that this data inquiry request message is distributed to IDC2 process by server, then IDC2 is when receiving this data inquiry request message, inquire about the first data version information (13:10) that this user ID (user A) is corresponding in the cache cluster 2 of this locality, and inquire about this user ID (user A) the second data version information (13:10) corresponding in the database 2 of this locality.
Suppose that user C needs the user data that inquiring user A is corresponding, then user C can send data inquiry request message by corresponding subscriber equipment, and this data inquiry request message is used for user data corresponding to inquiring user A; On this basis, suppose that this data inquiry request message is distributed to IDC3 process by server, then IDC3 is when receiving this data inquiry request message, inquire about the first data version information (13:10) that this user ID (user A) is corresponding in the cache cluster 3 of this locality, and inquire about this user ID (user A) the second data version information (13:10) corresponding in the database 3 of this locality.
In the embodiment of the present application, the processing procedure of data inquiry request message is received for IDC2 (or IDC3), before IDC2 (or IDC3) receives data inquiry request message, if the corresponding relation of IDC2 (or IDC3) in the cache cluster 2 of this locality between record user identifications (user A) and data version information (13:10), and the corresponding relation of IDC2 (or IDC3) in the database 2 of this locality between recording user A and data version information (13:10), then the first data version information (13:10) is identical with the second data version information (13:10), and perform step 304, if the corresponding relation of IDC2 (or IDC3) in the database 2 of this locality between recording user A and data version information (13:10), but the corresponding relation of IDC2 (or IDC3) not in the cache cluster 2 of this locality between record user identifications (user A) and data version information (13:10), then the second data version information (13:10) is newer than the first data version information (13:00), and performs step 304, if the corresponding relation of IDC2 (or IDC3) in the cache cluster 2 of this locality between record user identifications (user A) and data version information (13:10), but the corresponding relation of IDC2 (or IDC3) not in the database 2 of this locality between recording user A and data version information (13:10), then the first data version information (13:10) is newer than the second data version information (13:00), and performs step 305.
Step 304, if the first data version information is identical with the second data version information, or the second data version information is newer than the first data version information, then IDC utilizes the user data of user data update user ID correspondence in the cache cluster of this locality of user ID (user ID of namely carrying in data inquiry request message) correspondence in the database of this locality, and the user data that inquiring user mark is corresponding from the cache cluster of this locality, and return the data query response message carrying user data corresponding to user ID.
Before data 1 are revised as data 4 by user A, record user identifications (user A) and corresponding user data (data 1 will be distinguished in the cache cluster 2 of IDC2 and database 2, data 2 and data 3), after data 1 are revised as data 4 by user A, when the first data version information is identical with the second data version information, the user data that record user identifications (user A) is corresponding is not had in the cache cluster 2 of IDC2, record user identifications (user A) and corresponding user data (data 4 in the database 2 of IDC2, data 2 and data 3), when the second data version information is newer than the first data version information, the user data that record user identifications (user A) is corresponding is not had in the cache cluster 2 of IDC2, record user identifications (user A) and corresponding user data (data 4 in the database 2 of IDC2, data 2 and data 3).
Based on this, IDC2 is after receiving the data inquiry request message for user data corresponding to inquiring user mark (user A), this user ID (user A) user data (data 4, data 2 and data 3) corresponding in the database 2 of this locality is utilized to upgrade this user ID (user A) user data corresponding in the cache cluster 2 of this locality, after user data update completes, the user data of this user ID (user A) correspondence in the cache cluster 2 of this locality is data 4, data 2 and data 3.Afterwards, the IDC2 user data (data 4, data 2 and data 3) that inquiring user mark (user A) is corresponding from the cache cluster 2 of this locality, and return the data query response message carrying user data (data 4, data 2 and data 3), returned to the user of user data corresponding to inquiring user mark (user A) by data query response message by data 4, data 2 and data 3.
In addition, the processing procedure of IDC3 is identical with the processing procedure of IDC2, and at this, it is no longer repeated.
Step 305, if the first data version information is newer than the second data version information, then IDC determines the type of service that data inquiry request message is corresponding; If this type of service is the first type of service, then perform step 306; If this type of service is the first type of service, then perform step 307.
Wherein, this first type of service specifically includes but not limited to the business low to business requirement of real-time, as: generate good friend's business or delete good friend's business etc.; This second type of service specifically includes but not limited to the business high to business requirement of real-time, as: order amount of money amendment business etc.
Step 306, the IDC user data that directly inquiring user mark is corresponding from the database of current this locality, and return the data query response message carrying user data corresponding to this user ID.
Before data 1 are revised as data 4 by user A, record user identifications (user A) and corresponding user data (data 1, data 2 and data 3) will be distinguished in the cache cluster 2 of IDC2 and database 2, after data 1 are revised as data 4 by user A, when the first data version information is newer than the second data version information, the user data that record user identifications (user A) is corresponding is not had, by record user identifications (user A) and corresponding user data (data 1, data 2 and data 3) in the database 2 of IDC2 in the cache cluster 2 of IDC2.Based on this, IDC2 is when receiving the data inquiry request message for user data corresponding to inquiring user mark (user A), the type of service corresponding due to this data inquiry request message is low to business requirement of real-time, therefore, IDC2 directly can inquire about user data (i.e. data 1 corresponding to this user ID (user A) from the database 2 of current this locality, data 2 and data 3), and return and carry this user data (data 1, data 2 and data 3) data query response message, namely IDC2 can by data 1, data 2 and data 3 directly return to the user of user data corresponding to inquiring user mark (user A) by this data query response message.
In addition, the processing procedure of IDC3 is identical with the processing procedure of IDC2, and at this, it is no longer repeated.
Step 307, IDC sends the data base querying request message carrying user ID to other IDC, by other IDC after receiving data base querying request message, inquiring user is identified at user data corresponding in local database, and returns the data base querying response message carrying this user data to IDC.
Step 308, IDC is after receiving data base querying response message, user data corresponding to this user ID (user data namely carried in data base querying response message) is utilized to upgrade this user ID user data corresponding in the cache cluster of this locality, from the cache cluster of this locality, inquire about the user data that this user ID is corresponding, and return the data query response message carrying user data corresponding to this user ID.
Before data 1 are revised as data 4 by user A, record user identifications (user A) and corresponding user data (data 1, data 2 and data 3) will be distinguished in the cache cluster 2 of IDC2 and database 2, after data 1 are revised as data 4 by user A, when the first data version information is newer than the second data version information, the user data that record user identifications (user A) is corresponding is not had, by record user identifications (user A) and corresponding user data (data 1, data 2 and data 3) in the database 2 of IDC2 in the cache cluster 2 of IDC2.Based on this, IDC2 is when receiving the data inquiry request message for user data corresponding to inquiring user mark (user A), the type of service corresponding due to this data inquiry request message is high to business requirement of real-time, therefore, IDC2 sends the data base querying request message carrying user ID (user A) to IDC1, IDC1 is after receiving data base querying request message, user data (the i.e. data 4 that inquiring user mark (user A) is corresponding in the database 1 of this locality, data 2 and data 3), and by data base querying response message by user data (i.e. data 4 corresponding for user ID (user A), data 2 and data 3) return to IDC2.Further, IDC2 is after receiving data base querying response message, utilize the user data (data 4, data 2 and data 3) of this user ID (user A) correspondence of carrying in this data base querying response message to upgrade this user ID (user A) user data corresponding in the cache cluster 2 of this locality, the user data that now this user ID (user A) is corresponding in the cache cluster 2 of this locality is data 4, data 2 and data 3.Afterwards, the IDC2 user data (data 4, data 2 and data 3) that inquiring user mark (user A) is corresponding from the cache cluster 2 of this locality, and return the data query response message carrying user data (data 4, data 2 and data 3), namely data 4, data 2 and data 3 are returned to the user of user data corresponding to inquiring user mark (user A) by IDC2 by data query response message.
In addition, the processing procedure of IDC3 is identical with the processing procedure of IDC2, and at this, it is no longer repeated.
In sum, in the embodiment of the present application, when upgrading user data, after IDC upgrades complete user data in the cache cluster of this locality, user ID and data version information is comprised in the message that other IDC sends, and no longer comprise all customer data, size due to user ID and data version information is far smaller than the size of user data, that carries content in the message that therefore IDC sends to other IDC is far smaller than the user data carried in asynchronous message, thus network bandwidth expense can be reduced, and ensure the consistance of the user data that user obtains, the probability making user inquire up-to-date user data improves greatly.
Embodiment two
Conceive based on the application same with said method, the embodiment of the present application provides a kind of IDC, be applied in the network comprising multiple IDC, cache cluster and database is comprised in each IDC, as shown in Figure 4, described IDC specifically comprises: memory module 11, for receive from other IDC carry the message of user ID and data version information time, in cache cluster, record the corresponding relation between this user ID and this data version information; Enquiry module 12, for when receiving the data inquiry request message for user data corresponding to inquiring user mark, inquire about the first data version information that described user ID is corresponding in the cache cluster of this locality, and inquire about the second corresponding in the database of this locality data version information of described user ID; Update module 13, identical with the second data version information for working as the first data version information, or second data version information newer than the first data version information time, the user data that described in the user data update utilizing described user ID corresponding in the database of this locality, user ID is corresponding in the cache cluster of this locality; Cache Communication module 14, for inquiring about user data corresponding to described user ID from the cache cluster of this locality, and returns the data query response message carrying user data corresponding to described user ID.
Preferably, in the embodiment of the present application, described memory module 11, also for receive from other IDC carry the message of user ID and data version information after, delete the user data that this user ID of recording in local cache cluster is corresponding.
Preferably, in the embodiment of the present application, described update module 13, also for when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrades the user data that this user ID is corresponding in the cache cluster of this locality; Described Cache Communication module 14, also for determining current data version information, and sends the message carrying this user ID and this data version information to other IDC.
Preferably, in the embodiment of the present application, described update module 13, also for when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrades the user data that this user ID is corresponding in the database of this locality; Described memory module 11, also for determining current data version information, and records the corresponding relation between this user ID and this data version information in the database of this locality; Described IDC also comprises database communication module 15; Wherein, described database communication module 15, for notifying that other IDC upgrades this user ID user data corresponding in the database of this locality, and records the corresponding relation between this user ID and this data version information in the database of this locality.
Preferably, in the embodiment of the present application, described Cache Communication module 14, also for when the first data version information is newer than the second data version information, determines the type of service that described data inquiry request message is corresponding; If described type of service is the first type of service, then directly from the database of current this locality, inquire about user data corresponding to described user ID, and return the data query response message carrying user data corresponding to described user ID; If described type of service is the second type of service, the data base querying request message carrying described user ID is then sent to other IDC, inquire about described user ID user data corresponding in the database of this locality by other IDC, and return the data base querying response message carrying user data corresponding to described user ID to described IDC; After receiving described data base querying response message, the user data that user ID described in the user data update indicating described update module 13 to utilize described user ID corresponding is corresponding in the cache cluster of this locality, and from the cache cluster of this locality, inquire about user data corresponding to described user ID by described Cache Communication module 14, and return the data query response message carrying user data corresponding to described user ID.
Preferably, in the embodiment of the present application, described data version information specifically includes but not limited to: the last temporal information upgrading user data.
Wherein, the modules of the application's device can be integrated in one, and also can be separated deployment.Above-mentioned module can merge into a module, also can split into multiple submodule further.
In sum, in the embodiment of the present application, when upgrading user data, after IDC upgrades complete user data in the cache cluster of this locality, user ID and data version information is comprised in the message that other IDC sends, and no longer comprise all customer data, size due to user ID and data version information is far smaller than the size of user data, that carries content in the message that therefore IDC sends to other IDC is far smaller than the user data carried in asynchronous message, thus network bandwidth expense can be reduced, and ensure the consistance of the user data that user obtains, the probability making user inquire up-to-date user data improves greatly.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the application can add required general hardware platform by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better embodiment.Based on such understanding, the technical scheme of the application can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform method described in each embodiment of the application.
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, the module in accompanying drawing or flow process might not be that enforcement the application is necessary.
It will be appreciated by those skilled in the art that the module in the device in embodiment can carry out being distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
Above-mentioned the embodiment of the present application sequence number, just to describing, does not represent the quality of embodiment.
Be only several specific embodiments of the application above, but the application is not limited thereto, the changes that any person skilled in the art can think of all should fall into the protection domain of the application.

Claims (12)

1. a data access method, is applied in the network comprising multiple Internet data center IDC, comprises cache cluster and database, it is characterized in that, said method comprising the steps of in each IDC:
IDC receive from other IDC carry the message of user ID and data version information time, in the cache cluster of this locality, record the corresponding relation between this user ID and this data version information;
Described IDC is when receiving the data inquiry request message for user data corresponding to inquiring user mark, inquire about the first data version information that described user ID is corresponding in the cache cluster of this locality, and inquire about the second corresponding in the database of this locality data version information of described user ID;
If the first data version information is identical with the second data version information, or the second data version information is newer than the first data version information, then described IDC utilizes the user data that described in the user data update of described user ID correspondence in the database of this locality, user ID is corresponding in the cache cluster of this locality;
Described IDC inquires about user data corresponding to described user ID from the cache cluster of this locality, and returns the data query response message carrying user data corresponding to described user ID.
2. the method for claim 1, is characterized in that, described IDC receive from other IDC carry the message of user ID and data version information after, described method also comprises:
The user data that this user ID recorded in the cache cluster that described IDC deletion is local is corresponding.
3. the method for claim 1, is characterized in that, described method also comprises:
Described IDC is when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrade the user data that this user ID is corresponding in the cache cluster of this locality, and determine current data version information, and send the message carrying this user ID and this data version information to other IDC.
4. the method for claim 1, is characterized in that, described method also comprises:
Described IDC is when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrade the user data that this user ID is corresponding in the database of this locality, and determine current data version information, in the database of this locality, record the corresponding relation between this user ID and this data version information; And, notify that other IDC upgrades this user ID user data corresponding in the database of this locality, and in the database of this locality, record the corresponding relation between this user ID and this data version information.
5. the method for claim 1, it is characterized in that, inquire about the first data version information corresponding in the cache cluster of described user ID in this locality at described IDC, and after inquiring about the second corresponding in the database of this locality data version information of described user ID, described method also comprises:
If the first data version information is newer than the second data version information, then described IDC determines the type of service that described data inquiry request message is corresponding; If described type of service is the first type of service, then described IDC directly inquires about user data corresponding to described user ID from the database of current this locality, and returns the data query response message carrying user data corresponding to described user ID;
If described type of service is the second type of service, then described IDC sends the data base querying request message carrying described user ID to other IDC, inquire about described user ID user data corresponding in the database of this locality by other IDC, and return the data base querying response message carrying user data corresponding to described user ID to described IDC; Described IDC is after receiving described data base querying response message, the user data that user ID described in the user data update utilizing described user ID corresponding is corresponding in the cache cluster of this locality, and from the cache cluster of this locality, inquire about user data corresponding to described user ID, and return the data query response message carrying user data corresponding to described user ID.
6. the method as described in any one of claim 1-5, is characterized in that, described data version information specifically comprises: the last temporal information upgrading user data.
7. an Internet data center IDC, be applied in the network comprising multiple IDC, comprise cache cluster and database, it is characterized in that in each IDC, described IDC specifically comprises:
Memory module, for receive from other IDC carry the message of user ID and data version information time, in cache cluster, record the corresponding relation between this user ID and this data version information;
Enquiry module, for when receiving the data inquiry request message for user data corresponding to inquiring user mark, inquire about the first data version information that described user ID is corresponding in the cache cluster of this locality, and inquire about the second corresponding in the database of this locality data version information of described user ID;
Update module, identical with the second data version information for working as the first data version information, or second data version information newer than the first data version information time, the user data that described in the user data update utilizing described user ID corresponding in the database of this locality, user ID is corresponding in the cache cluster of this locality;
Cache Communication module, for inquiring about user data corresponding to described user ID from the cache cluster of this locality, and returns the data query response message carrying user data corresponding to described user ID.
8. IDC as claimed in claim 7, is characterized in that,
Described memory module, also for receive from other IDC carry the message of user ID and data version information after, delete the user data that this user ID of recording in local cache cluster is corresponding.
9. IDC as claimed in claim 7, is characterized in that,
Described update module, also for when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrades the user data that this user ID is corresponding in the cache cluster of this locality;
Described Cache Communication module, also for determining current data version information, and sends the message carrying this user ID and this data version information to other IDC.
10. IDC as claimed in claim 7, is characterized in that,
Described update module, also for when receiving the Data Update request message for upgrading user data corresponding to user ID, upgrades the user data that this user ID is corresponding in the database of this locality;
Described memory module, also for determining current data version information, and records the corresponding relation between this user ID and this data version information in the database of this locality;
Described IDC also comprises database communication module; Wherein, described database communication module, for notifying that other IDC upgrades this user ID user data corresponding in the database of this locality, and records the corresponding relation between this user ID and this data version information in the database of this locality.
11. IDC as claimed in claim 7, is characterized in that,
Described Cache Communication module, also for when the first data version information is newer than the second data version information, determines the type of service that described data inquiry request message is corresponding; If described type of service is the first type of service, then directly from the database of current this locality, inquire about user data corresponding to described user ID, and return the data query response message carrying user data corresponding to described user ID; If described type of service is the second type of service, the data base querying request message carrying described user ID is then sent to other IDC, inquire about described user ID user data corresponding in the database of this locality by other IDC, and return the data base querying response message carrying user data corresponding to described user ID to described IDC; After receiving described data base querying response message, the user data that user ID described in the user data update indicating described update module to utilize described user ID corresponding is corresponding in the cache cluster of this locality, and from the cache cluster of this locality, inquire about user data corresponding to described user ID by described Cache Communication module, and return the data query response message carrying user data corresponding to described user ID.
12. IDC as described in any one of claim 7-11, it is characterized in that, described data version information specifically comprises: the last temporal information upgrading user data.
CN201410219069.3A 2014-05-22 2014-05-22 A kind of data access method and equipment Active CN105095313B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410219069.3A CN105095313B (en) 2014-05-22 2014-05-22 A kind of data access method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410219069.3A CN105095313B (en) 2014-05-22 2014-05-22 A kind of data access method and equipment

Publications (2)

Publication Number Publication Date
CN105095313A true CN105095313A (en) 2015-11-25
CN105095313B CN105095313B (en) 2018-12-28

Family

ID=54575762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410219069.3A Active CN105095313B (en) 2014-05-22 2014-05-22 A kind of data access method and equipment

Country Status (1)

Country Link
CN (1) CN105095313B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250419A (en) * 2016-07-22 2016-12-21 乐视控股(北京)有限公司 A kind of data processing method and device
CN107085603A (en) * 2017-03-31 2017-08-22 北京奇艺世纪科技有限公司 A kind of data processing method and device
CN108647357A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 The method and device of data query
CN109413127A (en) * 2017-08-18 2019-03-01 北京京东尚科信息技术有限公司 A kind of method of data synchronization and device
CN109542851A (en) * 2018-11-30 2019-03-29 北京金山云网络技术有限公司 File updating method, apparatus and system
CN110347706A (en) * 2018-04-03 2019-10-18 艾玛迪斯简易股份公司 For handling method, Database Systems and the computer readable storage medium of inquiry
CN110427770A (en) * 2019-06-20 2019-11-08 中国科学院信息工程研究所 A kind of Access and control strategy of database method and system for supporting service security to mark
CN112445783A (en) * 2020-12-16 2021-03-05 中国联合网络通信集团有限公司 Method, device and server for updating database
CN112818059A (en) * 2021-01-27 2021-05-18 百果园技术(新加坡)有限公司 Information real-time synchronization method and device based on container release platform
CN113766027A (en) * 2021-09-09 2021-12-07 瀚高基础软件股份有限公司 Method and equipment for forwarding data by flow replication cluster node

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464895A (en) * 2009-01-21 2009-06-24 阿里巴巴集团控股有限公司 Method, system and apparatus for updating internal memory data
CN102436633A (en) * 2011-11-30 2012-05-02 华为技术有限公司 Data management method and system as well as database system
WO2014015809A1 (en) * 2012-07-25 2014-01-30 腾讯科技(深圳)有限公司 Method for synchronization of ugc master and backup data and system thereof, and computer storage medium
CN103634144A (en) * 2013-11-15 2014-03-12 新浪网技术(中国)有限公司 Method, system and equipment for managing multi-IDC (internet data center) cluster configuration file

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464895A (en) * 2009-01-21 2009-06-24 阿里巴巴集团控股有限公司 Method, system and apparatus for updating internal memory data
CN102436633A (en) * 2011-11-30 2012-05-02 华为技术有限公司 Data management method and system as well as database system
WO2014015809A1 (en) * 2012-07-25 2014-01-30 腾讯科技(深圳)有限公司 Method for synchronization of ugc master and backup data and system thereof, and computer storage medium
CN103634144A (en) * 2013-11-15 2014-03-12 新浪网技术(中国)有限公司 Method, system and equipment for managing multi-IDC (internet data center) cluster configuration file

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250419A (en) * 2016-07-22 2016-12-21 乐视控股(北京)有限公司 A kind of data processing method and device
CN107085603A (en) * 2017-03-31 2017-08-22 北京奇艺世纪科技有限公司 A kind of data processing method and device
CN107085603B (en) * 2017-03-31 2020-04-03 北京奇艺世纪科技有限公司 Data processing method and device
CN109413127A (en) * 2017-08-18 2019-03-01 北京京东尚科信息技术有限公司 A kind of method of data synchronization and device
CN109413127B (en) * 2017-08-18 2022-04-12 北京京东尚科信息技术有限公司 Data synchronization method and device
CN110347706B (en) * 2018-04-03 2022-02-01 艾玛迪斯简易股份公司 Method, database system, and computer-readable storage medium for processing a query
CN110347706A (en) * 2018-04-03 2019-10-18 艾玛迪斯简易股份公司 For handling method, Database Systems and the computer readable storage medium of inquiry
CN108647357A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 The method and device of data query
CN109542851A (en) * 2018-11-30 2019-03-29 北京金山云网络技术有限公司 File updating method, apparatus and system
CN110427770B (en) * 2019-06-20 2021-04-20 中国科学院信息工程研究所 Database access control method and system supporting service security marker
CN110427770A (en) * 2019-06-20 2019-11-08 中国科学院信息工程研究所 A kind of Access and control strategy of database method and system for supporting service security to mark
CN112445783A (en) * 2020-12-16 2021-03-05 中国联合网络通信集团有限公司 Method, device and server for updating database
CN112818059A (en) * 2021-01-27 2021-05-18 百果园技术(新加坡)有限公司 Information real-time synchronization method and device based on container release platform
CN112818059B (en) * 2021-01-27 2024-05-17 百果园技术(新加坡)有限公司 Information real-time synchronization method and device based on container release platform
CN113766027A (en) * 2021-09-09 2021-12-07 瀚高基础软件股份有限公司 Method and equipment for forwarding data by flow replication cluster node
CN113766027B (en) * 2021-09-09 2023-09-26 瀚高基础软件股份有限公司 Method and equipment for forwarding data by stream replication cluster node

Also Published As

Publication number Publication date
CN105095313B (en) 2018-12-28

Similar Documents

Publication Publication Date Title
CN105095313A (en) Data access method and equipment
CN107623729B (en) Caching method, caching equipment and caching service system
CN105224609B (en) Index query method and device
CN109597853B (en) Business scene element serial number generation method, device, medium and computer equipment
CN105338026A (en) Data resource acquisition method, device and system
CN101557427A (en) Method for providing diffluent information and realizing the diffluence of clients, system and server thereof
CN102202087B (en) Method for identifying storage equipment and system thereof
CN111885216B (en) DNS query method, device, equipment and storage medium
CN104750740A (en) Data renewing method and device
KR20210119504A (en) Communication method and apparatus, entity and computer readable storage medium
CN104378452A (en) Method, device and system for domain name resolution
CN107103011B (en) Method and device for realizing terminal data search
CN106792653B (en) Communication number information processing method, device and system
CN104601680A (en) Resource management method and device
CN104572845A (en) File distribution method and device, equipment and system
CN108173952A (en) A kind of data access method and device of content distributing network CDN
US11683316B2 (en) Method and device for communication between microservices
CN111431818B (en) Cross-domain request flow distribution method and device, storage medium and computer equipment
US20160308871A1 (en) Network element data access method and apparatus, and network management system
CN105897754A (en) Data processing system, data pulling method and client
CN104144170A (en) URL filtering method, device and system
CN104424316B (en) A kind of date storage method, data query method, relevant apparatus and system
CN111008220A (en) Dynamic identification method and device of data source, storage medium and electronic device
CN103905512A (en) Data processing method and equipment
US20150100545A1 (en) Distributed database system and a non-transitory computer readable medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191210

Address after: P.O. Box 31119, grand exhibition hall, hibiscus street, 802 West Bay Road, Grand Cayman, Cayman Islands

Patentee after: Innovative advanced technology Co., Ltd

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Co., Ltd.