Embodiment
When realizing striding the data sync demonstration of physical network in order to improve, the speed of entity network to access data, reduce and realize cost, the embodiment of the invention provides a kind of method of striding entity network to access data, in this method, when the network platform received the data that the user of a certain physical network writes, in the Intranet of other physical networks, the user of other physical networks obtained data by the visit Intranet with the data sync that writes.The described network platform is meant the entity that can data sharing is provided and communicate with these a plurality of physical networks for a plurality of physical networks, comprises the multi-line machine room of present network insertion merchant exploitation, and any entity that can realize above-mentioned functions.
A kind of method of striding entity network to access data that the embodiment of the invention provides specifically comprises following two
Embodiment:
Embodiment one: real time data is synchronous.
In the present embodiment, in a single day the multi-line machine room receives the data that write of first physical network, and just with the Intranet of this data sync to second physical network, referring to Fig. 2, idiographic flow is as follows:
Step 21: the multi-line machine room receives the data that first physical network writes;
This step is specifically as follows:
Step S01: the user of first physical network sends write data requests to the multi-line machine room, comprises data content to be written in this request, and data content to be written comprises in order to identify the Major key of these data;
Step S02: when the multi-line database server of multi-line machine room receives the write data request, from this request, obtain data to be written.
Step 22: the multi-line machine room is with the data sync that the receives Intranet to second physical network, and the data that are about to receive send to the Intranet of second physical network;
This step specifically can comprise:
Step S11: the bandwidth that the data that first physical network that the multi-line database server of multi-line machine room will receive writes utilize the multi-line machine room to provide sends to the Intranet of second physical network;
Step S12: when the single line machine room of the second physical network Intranet receives from the data of multi-line machine room, the data that receive are kept in the single line database server that is arranged in this machine room.
Step 23: the user of second physical network obtains data by the visit Intranet.
This step specifically can comprise:
Step S21: the user of second physical network sends data access request to the single line database server of Home Network, comprises the Major key of data to be visited in this request;
Step S22: when the single line database server receives described data access request,, search the data of this Major key correspondence according to the Major key in this request;
Step S23: the single line database server sends to described user with the data that find.
Embodiment two: regularly synchronously.
In the present embodiment, the multi-line machine room writes the Intranet of data sync to second physical network with what receive first physical network when satisfying synchronous condition, and referring to Fig. 3 A, wherein a kind of implementation method comprises:
Step 301: the multi-line machine room receives the data that first physical network writes, and preserves the data receive, and writes down this data synchronization state and be synchronous regime not;
This step is specifically as follows:
Step S31: the user of first physical network sends write data requests to the multi-line machine room, comprise data content to be written in this request, data content to be written comprises in order to identify the Major key of these data, the Major key of data can be when data write database, the database server dynamic assignment, perhaps can distribute according to preset rule, be that the overall situation is unique for database;
Step S32: when the multi-line database server of multi-line machine room receives the write data request, the data to be written in this request are preserved;
Step S33: write down described data synchronization state, this moment, this data synchronization state was synchronous regime not, specifically can following dual mode realization:
Mode one:
Definition synchronous regime position is with the synchronous regime of identification data; Preserve the Major key of data and the corresponding relation of synchronous regime position.Suppose to identify not synchronous regime with 0, identify synchronous regime with 1, preserve the corresponding relation of data owner key assignments and 0 this moment;
Mode two:
Preserve the Major key of data, identify these data with this and be in not synchronous regime.
In the above-mentioned dual mode,, when perhaps preserving Major key, can preserve with the form of tabulation at the corresponding relation of preserving Major key and synchronous regime position.In order to improve follow-up seek rate, can also preserve with the form of Hash table, concrete grammar is: utilize hash algorithm to calculate the cryptographic Hash that the data owner key-value pair is answered, the data owner key assignments is kept at the address in the memory block of this cryptographic Hash, this memory block is with the form storage data of chained list.Can be with the corresponding relation of Major key and synchronous regime position, perhaps Major key is kept in the multi-line database server, also can be kept in other entities, for example is kept in the high performance state server.
Step 302: when satisfying synchronous condition, the synchrodata for the treatment of that the multi-line machine room will be preserved sends to the Intranet of second physical network, and will send the data synchronization state and change to synchronous regime;
Specifically can comprise:
Step S41: the multi-line database server of multi-line machine room is when satisfying synchronous condition, treating of the preserving bandwidth that synchrodata utilizes the multi-line machine room to provide is sent to the Intranet of second physical network, and send the data synchronization state and be set to synchronous regime, for aforesaid way one, be that the synchronous regime position that this data owner key-value pair is answered is set to 1; For aforesaid way two, be the Major key deletion of these data that will preserve;
Step S42: when the single line machine room of the second physical network Intranet receives from the data of multi-line machine room, the data that receive are kept in the single line database server that is arranged in this machine room.
Here, satisfy synchronous condition and comprise: the timer expiry of setting perhaps receives synchronous indication.
Step 303: the user of second physical network obtains data by visit Intranet or multi-line machine room.
This step specifically can comprise:
Step S51: the user of second physical network comprises the Major key of data to be checked to multi-line machine room transmit status query requests in this request;
Here, the preparation method that is included in the data owner key assignments in the status query request can send the request that comprises URL for: user, because the corresponding one or more data owner key assignments of common webpage for a URL indication, through background process, the URL that imports for the user matches Major key, this Major key is added to together sending to the multi-line machine room in the request.
Step S52: when the multi-line machine room receives described status query request, inquire about the data synchronization state to be checked in this request, if Query Result is in synchronous regime for these data, then return the response that comprises single line database server sign to described user; If Query Result is in not synchronous regime for these data, then return the response that comprises multi-line database server sign to described user;
Here, the data query synchronous regime specifically has following dual mode:
First kind, state recording mode corresponding to aforesaid way one, when the data query synchronous regime, at first from the corresponding relation of the data owner key assignments preserved and synchronous regime position, search the corresponding relation that comprises the data owner key assignments in the described data query request, then according to this corresponding relation, determine the synchronous regime position that this data owner key-value pair is answered, if the synchronous regime position is 0, illustrate that then data to be checked are in not synchronous regime, are not synchronized in the Home Network; If the synchronous regime position is 1, illustrate that then data to be checked are in synchronous regime, are synchronized in the Home Network.
Second kind, corresponding to the state recording mode of aforesaid way two, when the data query synchronous regime, from the data owner key assignments of preserving, search the data owner key assignments in the described data query request, if find, illustrate that then data to be checked are in not synchronous regime, are not synchronized in the Home Network; If do not find, illustrate that then data to be checked are in synchronous regime, are synchronized in the Home Network.
When data are preserved with the Hash table form in mode one and the mode two, search the corresponding relation that comprises the data owner key assignments in the described data query request for first kind, perhaps second kind of data owner key assignments of searching in the described data query request, its concrete grammar is: utilize hash algorithm to calculate the cryptographic Hash that the data owner key-value pair in the described data query request is answered, search required data from the address for the memory block of this cryptographic Hash again.
Step S53: when the user receives the response that the multi-line machine room returns,, then send data access request to the multi-line database server if comprise the sign of multi-line database server in this response; If comprise the sign of single line database server in this response, then send data access request to the single line database server, comprise the Major key of data to be visited in the request;
Here, the sign of multi-line database server or single line database server comprises: unified resource location (URL) sign, perhaps IP address.
Step S54: when multi-line database server or single line database server receive data access request, according to the Major key in this request, search the data of this Major key correspondence, and the data that find are sent to described user.
Perhaps, referring to Fig. 3 B, the another kind of implementation method of the embodiment of the invention two comprises:
Step 311: the multi-line machine room receives the data that first physical network writes, and preserves the data that receive;
Specifically, repeat no more here with above-mentioned step S31-S32.
Step 312: when satisfying synchronous condition, the synchrodata for the treatment of that the multi-line machine room will be preserved sends to the Intranet of second physical network, and writes down this transmission data synchronization state and be synchronous regime;
Specifically can comprise:
Step S61: the multi-line database server of multi-line machine room is when satisfying synchronous condition, treating of the preserving bandwidth that synchrodata utilizes the multi-line machine room to provide is sent to the Intranet of second physical network, and write down this transmission data synchronization state and be synchronous regime, concrete grammar is: preserve this data owner key assignments and the corresponding relation of synchronous regime position; Perhaps, identify these data and be in synchronous regime by the Major key of these data of record;
Step S62: when the single line machine room of the second physical network Intranet receives from the data of multi-line machine room, the data that receive are kept in the single line database server that is arranged in this machine room.
Here, satisfy synchronous condition and comprise: the timer expiry of setting perhaps receives synchronous indication.
Step 313: the user of second physical network obtains data by visit Intranet or multi-line machine room.
This step specifically can comprise:
Step S71: the user of second physical network comprises the Major key of data to be checked to multi-line machine room transmit status query requests in this request;
Step S72: when the multi-line machine room receives described status query request, inquire about the data synchronization state to be checked in this request, if Query Result is in synchronous regime for these data, then return the response that comprises single line database server sign to described user; If Query Result is in not synchronous regime for these data, then return the response that comprises multi-line database server sign to described user;
Here, the data query synchronous regime specifically has following dual mode:
From the corresponding relation of the data owner key assignments preserved and synchronous regime position, search the corresponding relation that comprises the data owner key assignments in the described data query request, if find, illustrate that then data to be checked are in synchronous regime; If do not find, illustrate that then data to be checked are in not synchronous regime.
Perhaps, from the Major key of record, search the data owner key assignments in the described data query request,, illustrate that then data to be checked are in synchronous regime if find; If do not find, illustrate that then data to be checked are in not synchronous regime.
Step S73: when the user receives the response that the multi-line machine room returns,, then send data access request to the multi-line database server if comprise the sign of multi-line database server in this response; If comprise the sign of single line database server in this response, then send data access request to the single line database server, comprise the Major key of data to be visited in the request;
Here, the sign of multi-line database server or single line database server comprises: URL sign, perhaps IP address.
Step S74: when multi-line database server or single line database server receive data access request, according to the Major key in this request, search the data of this Major key correspondence, and the data that find are sent to described user.
The present invention will be described with instantiation below:
Referring to Fig. 4, in this example, be provided with multi-line database server and state server in the multi-line machine room, the multi-line database server links to each other with state server; There are two and stride physical network: communication network and Netcom's network, communication network links to each other with the multi-line machine room with the Netcom network; Be provided with single line Netcom machine room in Netcom's network, wherein have the single line database server.The user A that supposes communication network writes the data that Major key is A to the multi-line machine room, realize that data specifically comprise in the synchronous demonstration of Netcom's network:
Step 1: it is the data of A that the multi-line database server of multi-line machine room receives the Major key that subscribers to telecommunication network A writes, and these data is preserved, and send the set request that comprises Major key A to state server;
Step 2: when state server receives described set request, preserve the Major key A in this set request, be in not synchronous regime with the data of expression Major key A correspondence;
Step 3: the multi-line database server receives the synchronous indication from state server, is that the data of A send to Netcom's network with the Major key of preserving, and sends the reset request that comprises Major key A to state server;
Step 4: when state server receives described reset request, with the Major key A deletion of preserving; Single line database server in the single line Netcom machine room of Netcom's network receives described Major key when being the data of A, and these data are preserved;
Step 5: the user B of Netcom's network sends the status query request that comprises Major key A to the multi-line machine room;
Step 6: when the state server of multi-line machine room received described status query request, the inquiry back was found not preserve Major key A, and the response that then will comprise the URL sign of single line database server sends to user B;
Step 7: after user B receives described response, send the data access request that comprises Major key A to the single line database server according to the sign of the URL in this response;
Step 8: when the single line database server received described data access request, the Major key of searching preservation was the data of A, and the data that find are sent to user B.
Referring to Fig. 5, the embodiment of the invention provides a kind of system of striding entity network to access data, and this system comprises:
First database server 51 is used to receive the data that first physical network writes; The data that first physical network that receives is write send to second physical network;
User terminal 52 is arranged in second physical network, is used for obtaining the data that first physical network writes from second database server;
Second database server 53 is arranged in second physical network, is used to receive and preserve the data that first physical network that described first database server sends writes; The data that described first physical network is write send to described user terminal.
First database server 51 comprises:
First receiving element is used to receive the data that first physical network writes;
Lock unit is used for when satisfying synchronous condition, and the data that described first receiving element is received send to second physical network, and described synchronous condition comprises: timer expiry, or receive synchronous indication.
First database server 51 further comprises:
The synchronous regime unit is used to be provided with described data synchronization state information;
User terminal 52 is used for, and when described data synchronization state is known in inquiry for synchronous regime, obtains described data from second database server.
As first embodiment, the synchronous regime unit comprises:
The set unit is used for sending the set request of the Major key that comprises described data to state server when described first receiving element receives the data that first physical network writes;
Reset unit is used for after the data that described lock unit receives described first receiving element send to second physical network, sends the reset request of the Major key that comprises described data to state server;
User terminal 52 comprises:
First request unit is used for to state server transmit status query requests;
This system further comprises state server 54, and this state server comprises:
The set response unit is used for preserving the Major key in this set request when receiving described set request;
The response unit that resets is used for when receiving described reset request, with the deletion of the Major key in this reset request of preserving;
The first inquiry response unit when being used to receive described status query request, when determining not preserve the Major key of the data in this status query request, returns notice from described data to described second database server that obtain to described user terminal.
As second embodiment, the synchronous regime unit comprises:
Record cell is used for after the data that described lock unit receives described first receiving element send to second physical network, sends the record request of the Major key that comprises described data to state server;
User terminal 52 comprises:
Second request unit is used for to state server transmit status query requests;
This system further comprises state server 54, and this state server comprises:
The recording responses unit is used for when receiving described record request, preserves the Major key in this record request;
The second inquiry response unit when being used to receive described status query request, when determining to preserve the Major key of the data in this status query request, returns notice from described data to described second database server that obtain to described user terminal.
As the 3rd embodiment, the synchronous regime unit comprises:
State set unit is used for when described first receiving element receives the data that first physical network writes, and the state that sends the Major key that comprises described data to state server is provided with request;
The Status Change unit is used for after the data that described lock unit receives described first receiving element send to second physical network, sends the state change request of the Major key that comprises described data to state server;
User terminal 52 comprises:
The 3rd request unit is used for to state server transmit status query requests;
This system further comprises state server 54, and this state server comprises:
State is provided with response unit, is used for when request being set receiving described state, preserves this state the Major key and the corresponding relation of synchronous regime position not in the request are set;
The Status Change response unit is used for when receiving described state change request, and the not synchronous regime position of the Major key correspondence in this state change request of preserving is changed to synchronous regime position;
The 3rd inquiry response unit, when being used to receive described status query request, when the synchronous regime position of Major key correspondence is for synchronous regime position in this status query request of determine preserving, return notice from described data to described second database server that obtain to described user terminal.
User terminal 52 also comprises:
The 4th request unit is used for sending the data access request that comprises data owner key assignments information to described second database server;
Second database server 53 comprises:
Second receiving element is used to receive and preserve the data that first physical network that described first database server sends writes;
Response unit is used to receive described data access request, searches the data of the Major key correspondence in this data access request, and the data that find are sent to described user terminal.
Referring to Fig. 6, the embodiment of the invention also provides a kind of database server, can be applied to stride in the system of entity network to access data, and this server comprises:
First receiving element 61 is used to receive the data that first physical network writes;
Lock unit 62 is used for the data that described first receiving element receives are sent to second physical network.
This server further comprises:
Synchronous regime unit 63 is used to be provided with described data synchronization state information.
As first embodiment, synchronous regime unit 63 comprises:
Set unit 631 is used for sending the set request of the Major key that comprises described data to state server when described first receiving element receives the data that first physical network writes;
Reset unit 632 is used for after the data that described lock unit receives described first receiving element send to second physical network, sends the reset request of the Major key that comprises described data to state server.
As second embodiment, synchronous regime unit 63 comprises:
Record cell 633 is used for after the data that described lock unit receives described first receiving element send to second physical network, sends the record request of the Major key that comprises described data to state server.
As the 3rd embodiment, synchronous regime unit 63 comprises:
State set unit 634 is used for when described first receiving element receives the data that first physical network writes, and the state that sends the Major key that comprises described data to state server is provided with request;
Status Change unit 635 is used for after the data that described lock unit receives described first receiving element send to second physical network, sends the state change request of the Major key that comprises described data to state server.
Referring to Fig. 7, the embodiment of the invention also provides a kind of state server, can be applied to stride in the system of entity network to access data, and this server comprises:
Record cell 71 is used to write down the data synchronization state that first physical network writes;
Receiving element 72 is used to receive the status query request from the user terminal of second physical network;
Inquiry response unit 73 is used for during for synchronous regime, notifying described user terminal to obtain described data to the Intranet at described user terminal place at the data synchronization state of determining described status query request.
As first embodiment, record cell 71 comprises:
Set response unit 711 is used for when receiving the set request, preserves the Major key in this set request;
First memory cell 712 is used to store described Major key;
The response unit 713 that resets is used for when receiving reset request, with the deletion of the Major key in this reset request of preserving;
Inquiry response unit 73 comprises:
First query unit 731 is used for inquiring about the Major key of the data of whether preserving described status query request;
First response unit 732 is used for when not preserving described Major key, sends the notice that comprises the database server sign to described user terminal, and described database server is arranged in the Intranet at described user terminal place.
As second embodiment, record cell 71 comprises:
Recording responses unit 714 is used for when receiving record request, preserves the Major key in this record request;
Second memory cell 715 is used to store described Major key;
Inquiry response unit 73 comprises:
Second query unit 733 is used for inquiring about the Major key of the data of whether preserving described status query request;
Second response unit 734 is used for when preserving described Major key, sends the notice that comprises the database server sign to described user terminal, and described database server is arranged in the Intranet at described user terminal place.
As the 3rd embodiment, record cell 71 comprises:
State is provided with response unit 716, is used at the state of receiving when request being set, and preserves this state the Major key and the corresponding relation of synchronous regime position not in the request are set;
The 3rd memory cell 717 is used to store described corresponding relation;
Status Change response unit 718 is used for when receiving state change request, and the not synchronous regime position of the Major key correspondence during this state change of preserving is asked changes to synchronous regime position;
Inquiry response unit 73 comprises:
The 3rd inquiry unit 735 is used for inquiring about the synchronous regime position that the data owner key-value pair of described status query request is answered;
The 3rd response unit 736, when being used in synchronous regime position that described data owner key-value pair is answered for synchronous regime position, send the notice that comprises the database server sign to described user terminal, described database server is arranged in the Intranet at described user terminal place.
In the embodiment of the invention, the data that the physical network that receives write by the network platform send to other physical networks, the user of other physical networks just can obtain data by the visit Intranet, improved the speed of data access greatly, and obtain data by the visit Intranet, do not need to pay cost deployment server in the multi-line machine room, saved the cost that the data sync that realizes striding physical network shows greatly.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.