Embodiment
The embodiment of the invention provides a kind of data access method and URL server, can improve reliability, systematic function and the extensibility of NFS.
For ease of explanation, introduce a specific embodiment of the present invention below.As shown in Figure 1, be the schematic network structure in the embodiment of the invention, this network comprises: subscriber equipment, customer access equipment and a plurality of URL server, wherein, subscriber equipment is used to send user access request, customer access equipment is used for subscriber equipment is linked into network, and the URL server is used for the access request that process user equipment sends.
In the present embodiment, need pre-determine a URL server, be example with a URL server below, and the data access method is described in detail.
As shown in Figure 2, embodiment of data access method comprises in the embodiment of the invention:
201, a URL server receives the data access request that the user sends;
In the present embodiment, when the user asks visit data, can send data access request, carry the URL address of the data that need visit in this data access request by the customer access equipment in the network.
NFS in the present embodiment by several independently the URL server form, a URL server wherein can receive the data access request that this user sends from customer access equipment.
202, a URL server judges whether this URL address resource pointed is stored in the URL server, if then execution in step 203, if not, then execution in step 204;
After a URL server parses obtains URL address in the data access request, can judge then whether this URL address resource pointed is stored in the URL server.
The resource that the URL address is pointed to can be Webpage, data resource etc., and for example: during the HTTP visit, URL points to a Webpage; During the FTP visit, URL points to a data resource.
203, according to data access request resource is carried out corresponding read-write operation;
If URL address resource pointed is stored in the URL server, then a URL server can carry out corresponding read-write operation to this resource according to data access request, for example according to data access request resource is made amendment, add, or deletion etc.
This flow process finishes.
204, inquire about the 2nd URL server at resource place pointed, URL address;
If URL address resource pointed is not stored in the URL server, then a URL server is according to the 2nd URL server of this URL address lookup correspondence.
205, to the 2nd URL server forwards data access request.
After inquiring the 2nd corresponding URL server, a URL server can be to the 2nd URL server forwards data access request, so that the 2nd URL server is carried out corresponding read-write operation according to data access request to resource.
This flow process finishes.
In the present embodiment, the one URL server can receive the data access request that the user sends, if the data that definite user need visit are in this locality, then carry out and carry out data processing in this locality, if the data that definite user need visit are at the 2nd URL server, then a URL server can be sent to data access request the 2nd URL server and handles, all preserve separately independently data and metadata in each URL server, metadata in each URL server all only is associated with data in this URL server, and can not be associated with the data in the 2nd URL server, therefore, can not make whole NFS paralyse even some URL servers break down yet, thereby can improve the reliability of NFS;
Secondly, for each URL server, if the data that definite user need visit are not in this locality, then the URL server that data access request can be forwarded to other is handled, promptly in NFS, there is not a server that is specifically designed to deal with data access request and data, therefore there is not bottleneck, thereby can improves system effectiveness, improve the reliability of NFS simultaneously;
Once more, the data that each URL server is stored are relatively independent, data access request also can be transmitted between different URL servers according to concrete needs, promptly in NFS, there is not a server that is specifically designed to the data in each URL server of management, so when needing bigger data capacity, can directly increase new URL server, only needing to revise the corresponding relation of being preserved in each URL server gets final product, therefore the new URL server of increase that in theory can be unlimited, thus the extensibility of NFS improved greatly.
For ease of understanding, with an instantiation data access method in the embodiment of the invention is described in detail below, see also Fig. 3, another embodiment of data access method comprises in the embodiment of the invention:
301, a URL server receives the data access request that the user sends;
In the present embodiment, when the user asks visit data, can send data access request, carry the URL address of the data that need visit in this data access request by the customer access equipment in the network.
In the present embodiment, a URL server can be the information definite URL server of customer access equipment according to each URL server of this locality configuration, and a URL server can have multiple situation in actual applications, for example:
(1), a URL server is the URL server that customer access equipment is selected in each URL server at random.
Under this mode, customer access equipment need not to carry out calculating operation, directly selects a URL server to get final product at random, can effectively reduce the load of customer access equipment like this.
(2), a URL server is the physical location of customer access equipment according to each URL server, selection and the user between a nearest URL server of physical distance.
Under this mode, URL server and the physical distance between the user that customer access equipment is chosen are nearest, thus can faster data access request be sent to the URL server, so that reduce the time of delay of data access.
(3), a URL server is the URL server of customer access equipment according to the load minimum of the current loading condition selection of each URL server.
Under this mode, each URL server needs in real time to report separately loading condition to customer access equipment, and the URL server that customer access equipment is chosen the load minimum comes the effectively load between each URL server of equilibrium of deal with data access request.
Need to prove, the external address that each URL server in the present embodiment is represented is identical, this external address can be Internet protocol (IP, Intemet Protocol) address, it perhaps is the address of non-IP class, for example adopt the address of cable conversion (InfiniBand) mode etc., with the IP address is example, each URL server (being whole NFS) can be 192.168.0.1 to the address that the user embodies, this address can be " www.myweb.com " then during the data of user in this NFS of request visit through domain name change server, and URL address entrained in data access request can be " http://www.myweb.com/html_2/dir22/1.html ".
302, use the URL address in system directory, to mate;
In the present embodiment, in each URL server, all preserve the corresponding relation between device identification and the system directory, be used for representing which device identification corresponding equipment is the resource of which system directory be stored in, for example can be as shown in the table:
Table 1
| Device identification |
Home address |
The URL file system directories |
| Equipment 1 |
??192.168.0.8 |
??http://www.myweb.com/html_2/ |
| Equipment 2 |
??192.168.0.9 |
??http://www.myweb.com/html_2/dir22/ |
The one URL server can mate in the corresponding relation shown in the table 1 according to the URL address in the data access request.
303, the longest system directory corresponding equipment sign that matches in inquiry URL address;
After mate in system directory use URL address, can determine the longest system directory that matches in URL address, with the address between the slash in the URL address is a comparative unit, is exactly the longest system directory that matches with having the system directory of identical at most comparative unit between this URL address.For example in the above-mentioned table 1 that " http://www.myweb.com/html_2/dir22/1.html " preserves in a URL server, the comparative unit identical with system directory http://www.myweb.com/html_2/ is two, the comparative unit identical with system directory http://www.myweb.com/html_2/dir22/ is three, therefore, the longest system directory that matches is " http://www.myweb.com/html_2/dir22/ ", afterwards, a URL server can determine that this system directory corresponding equipment is designated " equipment 2 " again.
304, judge whether the device identification that inquires is the device identification of a URL server, if then execution in step 305, if not, then execution in step 306;
In the present embodiment, a URL server lookup can judge whether this device identification that inquires is the device identification of self after device identification, if, illustrate that then the user asks accessed resources to be stored in this locality, if not, illustrate that then the data that the user asks to visit are not stored in this locality.
305, according to data access request resource is carried out corresponding read-write operation;
If the device identification " equipment 2 " that inquires is the device identification of a URL server, then a URL server can carry out corresponding read-write operation to this resource according to data access request, for example resource is made amendment according to data access request, add, or deletion etc., detailed process is those skilled in the art's a common practise, repeats no more herein.
306, inquire about the 2nd URL server of this device identification correspondence;
If the device identification " equipment 2 " that inquires is not the device identification of a URL server, then inquire about the 2nd URL server of this device identification correspondence again, and the address of definite the 2nd URL server, for example can determine that according to table 1 address of the 2nd URL server is " 192.168.0.9 ".
Need to prove, in the present embodiment be with the IP address as home address be example describe be, in actual applications, the home address of URL server can also be the non-IP class address of other types, for example adopt the address of cable conversion (InfiniBand) mode etc., in NFS, the home address of each URL server is all inequality, so that can carry out intercommunication between the different URL servers.
307, to the 2nd URL server forwards data access request.
After the address that inquires the 2nd corresponding URL server, a URL server can be to the 2nd URL server forwards data access request, so that the 2nd URL server is carried out corresponding read-write operation according to data access request to resource.
Need to prove, if the overabundance of data of storing in a certain URL server, or the Data Growth excessive velocities, then can carry out the transfer of resource, for example:
The one URL server judges whether there is the resource to be transferred that satisfies the jump condition that presets in the local stored resource, if exist, then with resource transfers to the three URL servers to be transferred, and upgrade the device identification of preserving in each URL server and the corresponding relation between the system directory.
For ease of understanding, be that example describes below with the practical application: what preserve in the URL server is resource in " http://www.myweb.com/html_2/ ", suppose " .../html_2/ " following first class catalogue in addition " .../html_2/dir33 ", if the data volume of stored resource has reached the threshold value (for example being 10GB) that presets in should " .../dir33 " catalogue, or the growth rate of stored resource has reached and has preset thresholding (for example being 1GB/ days) in should " .../dir33 " catalogue, in order to alleviate the pressure of a URL server, then stored resource in should " .../dir33 " catalogue can be defined as resource to be transferred, stored resource is transferred to the 3rd URL server in should " .../dir33 " catalogue, the 3rd URL server can be the lighter URL server of load in the existing network file system, perhaps can be a server that increases newly.
Be that example describes with the 3rd URL server for newly-increased server in the present embodiment, when a URL server detects resource to be transferred, if the 3rd URL server is reached the standard grade, then a URL server can send the data transfer request to the 3rd URL server, obtain after the feedback of the 3rd URL server, then a URL server sends this resource to be transferred to the 3rd URL server.
Need to prove, the one URL server and the 3rd URL server all can not carry out data read-write operation in the process that data shift, specifically can be with a URL server and the temporary transient off-line of the 3rd URL server, or read-write is set is designated " forbidding ", in the reason of " forbidding ", can also increase " carrying out data shifts ", when the data access request that sends as the user requires to visit data on the URL server just, then a URL server can return the read-write failed message to the user, can carry cause value and be " carrying out data shifts " in this read-write failed message.
After resource transfers is finished, owing to changed system directory, then also need each URL preserved in the whole NFS device identification and the corresponding relation between the system directory are upgraded, concrete renewal operation is since a URL server, device identification after the one URL server is determined to upgrade according to other resources of resource to be transferred and local preservation and the corresponding relation between the system directory, can be as shown in table 2 below:
Table 2
| Device identification |
Home address |
The URL file system directories |
| Equipment 1 |
??192.168.0.8 |
??http://www.myweb.com/html_2/ |
| Equipment 2 |
??192.168.0.9 |
??http://www.myweb.com/html_2/dir22/ |
| Equipment 3 |
??192.168.0.10 |
??http://www.myweb.com/html_2/dir33/ |
After a URL server has been finished the renewal of corresponding relation, corresponding relation after this renewal can be sent to the 2nd URL server (comprising the 3rd URL server), the corresponding relation preserved separately of each URL server update then, when sending corresponding relation, the part that wherein changes can only be sent, for example: the corresponding relation of a transmitting apparatus 3 and URL file system directories.
Need to prove, in the present embodiment, the jump condition that presets only presets thresholding for the data volume of being with transferring resource reaches, or the data volume grow speed of resource to be transferred reaches and presets thresholding, be understandable that, in actual applications, concrete jump condition can also have more situation, and concrete condition does not limit herein.
In the present embodiment, the one URL server can receive the data access request that the user sends, if the data that definite user need visit are in this locality, then carry out and carry out data processing in this locality, if the data that definite user need visit are at the 2nd URL server, then a URL server can be sent to data access request the 2nd URL server and handles, all preserve separately independently data and metadata in each URL server, metadata in each URL server all only the data in this URL server be associated, and can not be associated with the data in the 2nd URL server, therefore, can not make whole NFS paralyse even some URL servers break down yet, thereby can improve the reliability of NFS;
Secondly, for each URL server, if the data that definite user need visit are not in this locality, then the URL server that data access request can be forwarded to other is handled, promptly in NFS, there is not a server that is specifically designed to deal with data access request and data, therefore there is not bottleneck, thereby can improves system effectiveness, improve the reliability of NFS simultaneously;
Once more, when satisfying the jump condition preset, a URL server can be with the URL server of resource transfers to be transferred to other, thereby can reduce the load of a URL server, the performance of balanced each URL server;
Further, the data that each URL server is stored are relatively independent, data access request also can be transmitted between different URL servers according to concrete needs, promptly in NFS, there is not a server that is specifically designed to the data in each URL server of management, so when needing bigger data capacity, can directly increase new URL server, only needing to revise the corresponding relation of being preserved in each URL server gets final product, therefore the new URL server of increase that in theory can be unlimited, thus the extensibility of NFS improved greatly.
Introduce the URL server in the embodiment of the invention below, see also Fig. 4, the URL server in the embodiment of the invention comprises:
Receiver module 401 is used to receive the data access request that the user sends, and carries the URL address in the data access request;
Detection module 402 is used for judging whether the URL address resource pointed that data access request that receiver module 401 receives is carried is stored in the URL server;
Operational module 403 is used for according to data access request URL address resource pointed being carried out corresponding read-write operation when detection module 402 judges that this URL address resource pointed is stored in a URL server;
Enquiry module 404 is used for detection module 402 and judges when this URL address resource pointed is not stored in a URL server, the 2nd URL server at the resource place that inquiry URL address is pointed;
Forwarding module 405 is used for the 2nd URL server forwards data access request that inquires to enquiry module 404, so that the 2nd URL server is carried out corresponding read-write operation according to data access request to resource;
Wherein, detection module 402 comprises:
Matching unit 4021 is used for using this URL address to mate to inquire about this longest system directory that matches in URL address at system directory;
Device identification query unit 4022 is used for the match query unit 4021 the longest system directory corresponding equipment signs that match;
Determining unit 4023, when the device identification that is used for inquiring when device identification query unit 4022 is the device identification of a URL server, determine that this URL address resource pointed is stored in the URL server, when if this device identification is not the device identification of a URL server, determine that then this URL address resource pointed is not stored in the URL server.
Can further include in the URL server in the present embodiment:
Transfer check module 406 is used to judge whether to exist the resource to be transferred that satisfies the jump condition that presets;
Resource transfers module 407 is used for when transfer check module 406 is determined to have the resource to be transferred that satisfies the jump condition that presets, with the URL server of resource transfers to be transferred to other;
Update module 408 is used for upgrading device identification that each URL server preserves and the corresponding relation between the system directory after resource transfers module 407 is finished resource transfers.
Wherein, update module 408 comprises:
Local update unit 4081 is used for according to the local device identification of preserving of other resource updates of resource to be transferred and self storage and the corresponding relation between the system directory;
Upgrade notification unit 4082, be used for device identification and the corresponding relation between the system directory after upgrading are sent to the 2nd URL server, make local device identification of preserving of the 2nd URL server update and the corresponding relation between the system directory.
For ease of understanding, with a concrete application scenarios URL server implementation example in the embodiment of the invention is described below:
In the present embodiment, when the user asks visit data, can send data access request, carry the URL address of the data that need visit in this data access request.
NFS in the present embodiment by several independently the URL server form, the receiver module 401 of a URL server wherein can receive the data access request that this user sends.
In the present embodiment, in each URL server, all preserve the corresponding relation between device identification and the system directory, be used for representing which device identification corresponding equipment is the resource of which system directory be stored in, detection module 402 can use the URL address to mate in system directory, can determine the longest system directory that matches in URL address afterwards, determine this system directory corresponding equipment sign again, thereby judge whether this device identification that inquires is the device identification of self, if, illustrate that then the user asks accessed resources to be stored in this locality, if not, illustrate that then the data that the user asks to visit are not stored in this locality.
If detection module 402 determines that the device identification that inquires is the device identification of a URL server, then operational module 403 can carry out corresponding read-write operation to this resource according to data access request, for example resource is made amendment according to data access request, add, or deletion etc., detailed process is those skilled in the art's a common practise, repeats no more herein.
If detection module 402 determines that the device identification that inquires is not the device identification of a URL server, then enquiry module 404 is inquired about the 2nd URL server of this device identification correspondence again, and determines the address of the 2nd URL server.
After enquiry module 404 inquired the address of the 2nd corresponding URL server, forwarding module 405 can be to the 2nd URL server forwards data access request, so that the 2nd URL server is carried out corresponding read-write operation according to data access request to resource.
Need to prove, if the overabundance of data of storing in a certain URL server, or the Data Growth excessive velocities, then can carry out the transfer of resource, for example:
Transfer check module 406 judges whether there is the resource to be transferred that satisfies the jump condition that presets in the local stored resource, if exist, then resource transfers module 407 is resource transfers to the three URL servers to be transferred, and update module 408 is upgraded the device identification of preserving in each URL server and the corresponding relation between the system directory.
In the present embodiment, receiver module 401 can receive the data access request that the user sends, if the data that detection module 402 definite users need visit are in this locality, then data processing is carried out in operational module 403 execution in this locality, if the data that detection module 402 definite users need visit are at the 2nd URL server, then enquiry module 404 and forwarding module 405 can be sent to the 2nd URL server with data access request and handle, all preserve separately independently data and metadata in each URL server, metadata in each URL server all only the data in this URL server be associated, and can not be associated with the data in the 2nd URL server, therefore, can not make whole NFS paralyse even some URL servers break down yet, thereby can improve the reliability of NFS;
Secondly, for each URL server, if the data that definite user need visit are not in this locality, then the URL server that data access request can be forwarded to other is handled, promptly in NFS, there is not a server that is specifically designed to deal with data access request and data, therefore there is not bottleneck, thereby can improves system effectiveness, improve the reliability of NFS simultaneously;
Once more, when satisfying the jump condition preset, resource transfers module 407 can be with the URL server of resource transfers to be transferred to other, thereby can reduce the load of a URL server, the performance of balanced each URL server;
Further, the data that each URL server is stored are relatively independent, data access request also can be transmitted between different URL servers according to concrete needs, promptly in NFS, there is not a server that is specifically designed to the data in each URL server of management, so when needing bigger data capacity, can directly increase new URL server, only needing to revise the corresponding relation of being preserved in each URL server gets final product, therefore the new URL server of increase that in theory can be unlimited, thus the extensibility of NFS improved greatly.
Introduce the communication system in the embodiment of the invention below, see also Fig. 5, the communication system embodiment in the embodiment of the invention comprises at least two URL servers, is respectively a URL server 501 and the 2nd URL server 502.
Wherein, the URL server 501 in the present embodiment and the concrete structure of the 2nd URL server 502 and function can be identical with aforementioned URL server shown in Figure 4, repeat no more herein.
Be that example describes with two URL servers only in the present embodiment, be understandable that more URL server can also be arranged in actual applications, concrete quantity does not limit herein.
In the present embodiment, the one URL server 501 can receive the data access request that the user sends, if the data that definite user need visit are in this locality, then carry out and carry out data processing in this locality, if the data that definite user need visit are at the 2nd URL server 502, then a URL server 501 can be sent to the 2nd URL server 502 with data access request and handles, all preserve separately independently data and metadata in each URL server, metadata in each URL server all only the data in this URL server be associated, and can not be associated with the data in other URL server, therefore, can not make whole NFS paralyse even some URL servers break down yet, thereby can improve the reliability of NFS;
Secondly, for each URL server, if the data that definite user need visit are not in this locality, then the URL server that data access request can be forwarded to other is handled, promptly in NFS, there is not a server that is specifically designed to deal with data access request and data, therefore there is not bottleneck, thereby can improves system effectiveness, improve the reliability of NFS simultaneously;
Once more, the data that each URL server is stored are relatively independent, data access request also can be transmitted between different URL servers according to concrete needs, promptly in NFS, there is not a server that is specifically designed to the data in each URL server of management, so when needing bigger data capacity, can directly increase new URL server, only needing to revise the corresponding relation of being preserved in each URL server gets final product, therefore the new URL server of increase that in theory can be unlimited, thus the extensibility of NFS improved greatly.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, above-mentioned program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be a read-only memory, disk or CD etc.
More than a kind of data access method provided by the present invention and URL server are described in detail, for one of ordinary skill in the art, thought according to the embodiment of the invention, part in specific embodiments and applications all can change, therefore, this description should not be construed as limitation of the present invention.