Embodiment
The characteristic sum exemplary embodiment of various aspects of the present invention will be described in detail below.In the following detailed description, propose many details, to provide complete understanding of the present invention.But, it will be apparent to those skilled in the art that the present invention can implement when not needing some details in these details.Below the description of embodiment is only used to by illustrating example of the present invention to provide to better understanding of the present invention.Any concrete configuration that the present invention proposes below being never limited to and algorithm, but cover any amendment of element, parts and algorithm, replacement and improvement under the premise of without departing from the spirit of the present invention.In the the accompanying drawings and the following description, known structure and technology are not shown, to avoid causing the present invention unnecessary fuzzy.
Fig. 1 shows the block diagram of the file management system according to the embodiment of the present invention.As shown in Figure 1, interface layer 102, dispatch layer 104 and accumulation layer 106 is comprised according to the file management system 100 of the embodiment of the present invention.Wherein, interface layer 102 comprise K (K be greater than 0 integer) individual interface layer node, dispatch layer 104 comprise L (L be greater than 0 integer) individual dispatch layer node, accumulation layer 106 comprises 2
n(n be not less than 0 integer) individual accumulation layer node.Here it should be noted that, the interstitial content that interface layer, dispatch layer, accumulation layer comprise can identical also can not be identical, can be interconnected in wired or wireless manner by one or more in LAN (Local Area Network), Metropolitan Area Network (MAN) and internet between interface layer, dispatch layer and accumulation layer, and also can be interconnected in a wired or wireless manner by one or more in LAN (Local Area Network), Metropolitan Area Network (MAN) and internet between interface layer node, between dispatch layer node and between accumulation layer node.Below, the function with regard to interface layer, dispatch layer, accumulation layer is described.
(1) interface layer
In the present embodiment, the developer of any one application software (conveniently, hereinafter referred to application software A) can be registered application software A in file management system 100 by interface layer 102.Particularly, interface layer 102 can receive the registration request for application software A, is application software A distribution software identifier APPID and software key APPKEY, and authorizes corresponding authority for the developer of application software A.When the developer of application software A wants by file management system 100 to the file relevant to application software A (conveniently, hereinafter referred to file F) perform amendment, delete, inquiry and so on file operation or when wanting by file management system 100 storage file F, two kinds of interface modules that the developer of application software A can be provided by interface layer (such as, one is RESTful interface module, another kind is the interface module of compatible Amazon SDK (Software Development Kit) (SDK)) one of to the interface layer input software identifiers APPID of application software A and software key APPKEY, certification is carried out by a pair of one or more the predetermined authentication methods file operation requests relevant to application software A for interface layer.Any one interface layer node (conveniently, hereinafter referred to interface layer node P1) in interface layer 102 all can carry out certification and process to the file operation requests relevant to application software A.In addition, more interface module that is that developed now or that develop in the future can be provided at interface layer as required.
In the present embodiment, interface layer 102 receive for the file F relevant to application software A file operation requests (conveniently, hereinafter referred to file operation requests Q) after, judge whether himself can perform the operation corresponding with file operation requests Q to file F.If interface layer 102 can to the operation that file F performs and file operation requests Q is corresponding without the need to cooperating with dispatch layer 104 and accumulation layer 106, then interface layer 102 directly performs the operation corresponding with file operation requests Q to file F, otherwise file operation requests Q is sent to dispatch layer 104.
In the present embodiment, interface layer 102 can be configured with load balancing control system, is used for realizing load balancing in the middle of interface layer node.Particularly, when interface layer node P1 receives such as file operation requests Q, if interface layer node P1 is in idle condition, then interface layer node P1 can judge whether interface layer 102 self can perform the operation relevant to file operation requests Q to file F, and carries out subsequent treatment according to judged result; If interface layer node P1 is in busy state, then file operation requests Q can be in the interface layer node of idle condition (conveniently from any one being sent to interface layer 102 of interface layer node P1 by SiteServer LBS, hereinafter referred to interface layer node P2), then interface layer node P2 can judge whether interface layer 102 self can perform the operation relevant to file operation requests Q to file F, and carries out subsequent treatment according to judged result.It will be understood by those skilled in the art that when interface layer node P1 receive logging request, registration request and other request time, also can carry out load balancing by process above.
In the present embodiment, interface layer 102 can also be configured with Remote configuration center, the file operation information of operation that the software identifiers for storing each application software causes file to change with software key two tuple, the meeting relevant to each application software and the node configuration information of each interface layer node and joint behavior information.Here, the node configuration information of any one interface layer node refers to the information that communication protocol that this interface layer node adopts, communication port, corresponding relation between physical address to logical address etc. are relevant with the communication capacity between this interface layer node and other interface layer nodes, and the joint behavior information of any one interface layer node refers to the information that the occupancy, the occupancy of network interface card, the occupancy of the network bandwidth etc. of the occupancy of the central processing unit (CPU) of this interface layer node, internal memory are relevant to the information processing capability of this interface layer node.The node configuration information of each interface layer node can be identical, also can be different.
Load balancing control system can utilize the node configuration information of Remote configuration central store and joint behavior information to realize the load balancing between interface layer node.Particularly, when the node configuration information of each interface layer node is identical, when interface layer node P1 receives file operation requests Q, if interface layer node P1 is in busy state, then file operation requests Q can be in the interface layer node of idle condition (conveniently from any one being sent to interface layer 102 of interface layer node P1 by SiteServer LBS, hereinafter referred to interface layer node P2), then interface layer node P2 can judge whether interface layer 102 self can perform the operation relevant to file operation requests Q to file F and carry out subsequent treatment according to judged result.When the node configuration information of each interface layer node is different, when interface layer node P1 receives file operation requests Q, if interface layer node P1 is in busy state, then load balancing control system can communicate with interface layer node P1 according in the node configuration information of Remote configuration central store and joint behavior information option interface layer 102, and any one the interface layer node being in idle condition (conveniently, hereinafter referred to interface layer node P3) and file operation requests Q is sent to interface layer node P3 from interface layer node P1, then interface layer node P3 can judge whether interface layer 102 self can perform the operation relevant to file operation requests Q to file F and carry out subsequent treatment according to judged result.
Particularly, in the present embodiment, any one interface layer node (such as, interface layer node P1) upon actuation, obtain all software identifiers and software key two tuple (APPID, APPKEY) by from Remote configuration center, and be stored in internal memory.When interface layer node P1 is the new two tuple (APPID1 of new opplication software distribution, APPKEY1) time, these new two tuple real-time synchronizations, while two tuples that this is new are stored in the Remote configuration center of interface layer 102, are also stored in the internal memory of total interface node layer by interface layer node P1.
In the present embodiment, when file operation requests Q be such as current region identifier query, the request of fuzzy search file directory tree and so on do not relate to the file operation requests of the file relevant to each application software itself time, interface layer can be responded by the information of inquiring about Remote configuration central store.Wherein, current region identifier refers to the realm identifier of the interface layer node region from external reception file operation requests, and this realm identifier is unique and remain unchanged.Tree is used to manage the file of different application software file directory.When in file management system 100 execute file upload, the operation such as file erase time, respective record can be carried out in the Remote configuration center of interface layer.Therefore, when interface layer receives the request of fuzzy search file directory tree, interface layer can set the title of the application software entrained by request (such as to this fuzzy search file directory in the heart in Remote configuration, application software identifier) carry out searching and mating, thus obtain the file directory tree of this application software.Similar is configured by interface layer node or in the Remote configuration of interface layer, saves the file operation requests of operation note in the heart, all can be processed by interface layer.
In the present embodiment, when file operation requests Q is files passe request, file deletion requests, file acquisition request and file query requests a period of time, interface layer 102 needs file operation requests Q to be sent to dispatch layer 104, to work in coordination with the operation that file F performs and file operation requests Q is corresponding with dispatch layer 104 and accumulation layer 106.Particularly, when file operation requests Q is files passe request, file operation requests Q and file F is sent to dispatch layer 104 by interface layer 102 simultaneously; When file operation requests Q be file deletion requests, file acquisition request or file query requests time, file operation requests Q is only sent to dispatch layer 104 by interface layer 102.
(2) dispatch layer
In the present embodiment, dispatch layer 104 utilizes file operation requests Q to determine the memory location of file F in accumulation layer.Such as, any one dispatch layer node (conveniently, hereinafter referred to dispatch layer node D1) after receiving the file operation requests Q from interface layer, the information that file operation requests Q can be utilized to carry based on hash algorithm determines the concrete memory location of file F in accumulation layer 106.Wherein, the information that file operation requests Q carries includes but not limited to the application software identifier of the application software A corresponding with file operation requests Q, receives the realm identifier of interface layer node region, the filename etc. of file F of file operation requests Q.
Particularly, if accumulation layer 106 comprises a more than accumulation layer node, then in order to balancedly utilize the storage resources of accumulation layer node, dispatch layer 104 can utilize file operation requests Q to obtain cryptographic hash based on consistance hash algorithm, then in the routing table prestored, the accumulation layer node address corresponding with the cryptographic hash calculated is searched, as the memory location of file F in accumulation layer 106.
In the present embodiment, when file operation requests Q is files passe request, file F, after finding the concrete memory location of file F in accumulation layer 106 (that is, the accumulation layer node of storage file F), is sent to this accumulation layer node and stores by dispatch layer 104; When file operation requests Q be file deletion requests, file acquisition request or file query requests time, file operation requests Q, after the accumulation layer node finding the storage file F in accumulation layer 106, is transmitted corresponding accumulation layer node by dispatch layer 104.
Be understandable that, dispatch layer also can be configured with Remote configuration center, for storing node configuration information and the joint behavior information of above-mentioned routing table and each dispatch layer node.Similarly, the node configuration information of any one dispatch layer node refers to the information that communication protocol that this dispatch layer node adopts, communication port, corresponding relation between physical address to logical address etc. are relevant with the communication capacity between this dispatch layer node and other dispatch layer nodes, and the joint behavior information of any one dispatch layer node refers to the information that the occupancy, the occupancy of network interface card, the occupancy of the network bandwidth etc. of the occupancy of the central processing unit (CPU) of this dispatch layer node, internal memory are relevant to the information processing capability of this dispatch layer node.Wherein, above-mentioned routing table is made up of a series of two tuples (key, value), and key is cryptographic hash, and value is the IP address (that is, this routing table have recorded the corresponding relation between cryptographic hash and accumulation layer node) of accumulation layer node.The node configuration information of each dispatch layer node can be identical, also can be different.
In addition, dispatch layer also can be configured with load balancing control system, realizes load balancing for such as utilizing the node configuration information of each dispatch layer node stored in Remote configuration and joint behavior information in the heart in the middle of dispatch layer node.Particularly, when the node configuration information of each dispatch layer node is identical, when any one dispatch layer node D1 receives file operation requests Q, if dispatch layer node D1 is in busy state, then file operation requests Q can be in the dispatch layer node of idle condition (conveniently from any one being sent to dispatch layer 104 of dispatch layer node D1 by SiteServer LBS, hereinafter referred to dispatch layer node D2), then dispatch layer node D2 can utilize file operation requests Q to obtain cryptographic hash based on consistance hash algorithm, then in the routing table prestored, the accumulation layer node address corresponding with the cryptographic hash calculated is searched, as the memory location of file F in accumulation layer 106.When the node configuration information of each dispatch layer node is different, when dispatch layer node D1 receives file operation requests Q, if dispatch layer node D1 is in busy state, then load balancing control system is selected to communicate with dispatch layer node D1 according to the node configuration information of Remote configuration central store and joint behavior information, and any one the dispatch layer node being in idle condition (conveniently, hereinafter referred to dispatch layer node D3) and file operation requests Q is sent to dispatch layer node D3 from dispatch layer node D1, then dispatch layer node D3 can utilize file operation requests Q to obtain cryptographic hash based on consistance hash algorithm, then in the routing table prestored, the accumulation layer node address corresponding with the cryptographic hash calculated is searched, as the memory location of file F in accumulation layer 106.
(3) accumulation layer
In the present embodiment, accumulation layer comprises 2
nindividual accumulation layer node, the file relevant to same application software must not be stored on same accumulation layer node.When the number 2 of accumulation layer node
nbe less than the number 2 of the cryptographic hash that the routing table that prestores in dispatch layer 104 comprises
ntime, (2 can be arranged in each accumulation layer node
(N-n)-1) individual dummy node and will with (2
(N-n)-1) cryptographic hash that individual dummy node is corresponding for file be stored in this accumulation layer node.
When carrying out dilatation to accumulation layer, the number of the accumulation layer node after dilatation is 2 of the accumulation layer node before dilatation
m(m be greater than 0 integer) doubly.Can dispose accumulation layer node according to various ways, include but not limited to according to star, annular or net form to dispose accumulation layer node, and the storage content of adjacent storage layers node can backup each other.Such as, when disposing accumulation layer node according to annular, accumulation layer node is deployed in equally distributed 2 on annulus from beginning to end successively by according to clockwise direction
non individual point.
After dilatation is carried out to accumulation layer, need the file that accumulation layer node stores be moved.Particularly, for any one file F, judge then file F to be migrated to new accumulation layer node by the new accumulation layer node that file F should be stored according to its cryptographic hash, and by file F from former accumulation layer knot removal.
In the present embodiment, when file operation requests Q is files passe request, accumulation layer node, after receiving file F, stores file F; When file operation requests Q be file deletion requests, file acquisition request or file query requests time, accumulation layer node operates carrying out file erase, file acquisition or file polling in file F after receiving file operation requests Q, and via dispatch layer 104, operating result is returned to interface layer 102.It should be noted that, file polling here refers to the information of the creation-time of inquiry file, last modification time, amendment people identifier, file size and so on.
In addition, those skilled in the art are it is to be appreciated that interface layer node mentioned here, dispatch layer node can be realized by computing machine, and accumulation layer node can be realized by current various known non-transient memory storage.
Not only can dynamically, flexibly, efficiently manage file according to the file management method of the embodiment of the present invention and system, and the interface provided is friendly, the developer of application software can manage file as this locality.In addition, this file management system also has good extendability.
In sum, a kind of file management method is this provided.Fig. 2 shows the file management method according to the embodiment of the present invention.As shown in Figure 2, this file management method comprises: receive the file operation requests (that is, step S202) relevant to application software by interface layer; The memory location of file operation requests determination file in accumulation layer (that is, step S204) is utilized by dispatch layer; And based on memory location, by accumulation layer, the operation (that is, step S206) corresponding with file operation requests is performed to file.
In the present embodiment, when receiving file operation requests, judge whether interface layer can perform the operation corresponding with file operation requests; If so, then by interface layer, the operation corresponding with file operation requests is performed to file, otherwise file operation requests is sent to dispatch layer from interface layer.Wherein, file operation requests at least comprises following information: the software identifiers of application software, the realm identifier of interface layer node region receiving file operation requests and the file name of file.
Further, comprised by the process of the memory location of dispatch layer determination file: utilize file operation requests to obtain cryptographic hash based on consistance hash algorithm, in the routing table prestored, then search the memory location of the accumulation layer node address corresponding with the cryptographic hash calculated as file.
The foregoing describe the preferred embodiments of the present invention, but this embodiment is only exemplary, instead of will limit the scope of the invention, and scope of the present invention is by appended claims and equivalents thereof.One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, ROM (read-only memory) or random access memory etc.
In addition, although described the present invention and advantage thereof in detail, having should be appreciated that, when not deviating from purport of the present invention and the scope of claims restriction, various different change, replacement and change can have been carried out; And scope of the present invention is not limited in the embodiment of system, method and the step described in this instructions.Should understand as those of ordinary skill of the present invention, by the present invention, existing or Future Development for perform with according to the substantially identical mode of the technical solution adopted in the present invention or obtain the method for basic identical result and step can be used according to the present invention.