Summary of the invention
Main purpose of the present invention, for the method, system and device of file resource location in a kind of distributed file system are provided, can complete in different DFS the scheduling of file fragmentation content easily.
The present invention proposes the method for file resource location in a kind of distributed file system, comprises step:
The file access client FAC of distributed file system DFS node, obtains the first burst information by calculating;
Resource localizer FRL obtains the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC, produces segmental identification; When described the first burst information is not present in the file fragmentation table of this DFS node, according to described segmental identification, set the second burst information;
FAC utilizes the FRL of contiguous DFS node, mates location burst content according to described the second burst information.
Preferably, described when described the first burst information is not present in the file fragmentation table of this DFS node, the step of setting the second burst information according to described segmental identification is specially:
When described the first burst information is not present in the file fragmentation table of this DFS node, according to file fragmentation path, obtains the label of file, and extract segmental identification, thereby set the second burst information.
Preferably, described coupling specifically comprises:
The FRL of contiguous DFS node mates, according to file complete trails, mates and/or mate according to the Adelson-Velskii-Landis tree ergodic algorithm that can recall according to retrieve hotspot table; And when the match is successful, location burst content.
Preferably, described FAC utilizes the FRL of contiguous DFS node to mate according to described the second burst information, before the step of location burst content, also comprises:
FRL finds the contiguous DFS node of storage burst content.
Preferably, the step of the contiguous DFS node of described FRL searching storage burst content is specially:
FRL obtains the father node label of the corresponding DFS node of burst content, extracts father node label value; When father node label value does not exist, continue to find the father node label value of father node, until find a father node label value;
Label value step-by-step is analyzed, at label value, only had unique position effectively, return to label position; Otherwise Study document complete trails, obtains the label place value of file under current path;
According to file complete trails and label position, obtain contiguous DFS node.
The present invention also proposes the system of file resource location in a kind of distributed file system, comprising:
FAC, for obtaining the first burst information by calculating; Also, for utilizing the FRL of contiguous DFS node, the second burst information of setting according to FRL is mated, location burst content;
FRL, for obtaining the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC, produce segmental identification; When described the first burst information is not present in the file fragmentation table of this DFS node, according to described segmental identification, set the second burst information.
The another device that proposes file resource location in a kind of distributed file system of the present invention, comprising:
Receiver module, the first burst information of obtaining by calculating for receiving FAC;
Analysis module, for obtaining the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC, produce segmental identification; When described the first burst information is not present in the file fragmentation table of this DFS node, according to described segmental identification, set the second burst information.
Preferably, described analysis module also, specifically for when described the first burst information is not present in the file fragmentation table of this DFS node, obtains the label of file according to file fragmentation path, and extracts segmental identification, thereby sets the second burst information.
Preferably, described analysis module is also for finding the contiguous DFS node of storage burst content.
Preferably, described analysis module also, specifically for obtaining the father node label of the corresponding DFS node of burst content, extracts father node label value; When father node label value does not exist, continue to find the father node label value of father node, until find a father node label value;
Label value step-by-step is analyzed, at label value, only had unique position effectively, return to label position; Otherwise Study document complete trails, obtains the label place value of file under current path;
According to file complete trails and label position, obtain contiguous DFS node.
The present invention proposes again the device of file resource location in a kind of distributed file system, comprising:
Receiver module, the first burst information of obtaining by calculating for receiving FAC;
Analysis module, for obtaining the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC, produce segmental identification; When above-mentioned the first burst information is not present in the file fragmentation table of this DFS node, according to above-mentioned segmental identification, set the second burst information;
Matching module, mates for the second burst information sending according to contiguous FAC, location burst content, and the contiguous FAC of notice extracts.
Preferably, described matching module is also specifically for mating according to retrieve hotspot table, mating and/or mate according to the Adelson-Velskii-Landis tree ergodic algorithm that can recall according to file complete trails; And when the match is successful, location burst content.
The present invention is by adopting the file fragmentation of FRL organize content, realize between different DFS content fragment is adopted to unified sign, thereby can complete easily in different DFS the scheduling of file fragmentation content, make not store the USS of actual content, by scheduling, can provide corresponding media services; In addition, can discharge the storage resources in USS in due course, make storage resources regeneration, improve USS stores service ability.
Embodiment
The present invention is in order to improve IPTV(Internet Protocol Television, IPTV) throughput of system, the real-time of enhancing system, USS(Universal Service Server, universal media server) DFS(Distributed File System, distributed file system have been used).The use of DFS, also makes USS greatly simplify as the business model of media services node.The DFS of USS, adopts the mode of content file burst is stored; And this DFS can pass through FRL(File Resource Locator, file resource locator), manage the non-focus part of content and idle content in USS, and can discharge in due course the storage resources of edge USS.
The present invention is by adopting the file fragmentation of FRL organize content, realize between different DFS content fragment is adopted to unified sign, thereby can complete easily in different DFS the scheduling of file fragmentation content, make not store the USS of actual content, by scheduling, can provide corresponding media services; In addition, can discharge the storage resources in USS in due course, make storage resources regeneration, improve USS stores service ability.
With reference to Fig. 1, the method for file resource location in a kind of distributed file system of proposition one embodiment of the invention, comprising:
The file access client FAC(File access client of step S10, distributed file system DFS node, file access client), by calculating, obtain the first burst information;
Step S11, resource localizer FRL obtain the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC, produce segmental identification; When above-mentioned the first burst information is not present in the file fragmentation table of this DFS node, according to above-mentioned segmental identification, set the second burst information;
Step S12, FAC utilize the FRL of contiguous DFS node, mate location burst content according to above-mentioned the second burst information.
With reference to Fig. 2, the running environment of the present embodiment comprises FAC, FRL, contiguous FRL and contiguous FAS(File Access Server, file access server).
As described in above-mentioned steps S10, FAC is when needs obtain file resource (such as media file etc.), first, FRL to the DFS node at its place sends request, the App(Application of this FRL) application program is by calling the API(Application Programming Interface of DFS node, application programming interface) attribute information of file reading resource; Then, this FAC, by the attribute information of calculation document resource, obtains the first burst information of file resource, and sends to FLR the file complete trails that message is obtained file resource.Above-mentioned attribute information comprises: the father node label of file label, file, file fragmentation number, document control information, document creation time, file modification time, file size and file read-write number etc.; Above-mentioned the first burst information comprises: file complete trails and file fragmentation numbering etc.
As described in above-mentioned steps S11, FLR will obtain file in the sign of this DFS node according to file complete trails, and the first burst information of calculating in conjunction with FAC generates segmental identification.Then, according to this first burst information, in the file fragmentation table of this DFS node, search; If there is this first burst information in file fragmentation table, burst content corresponding to this first burst information is stored in this DFS node, uses existing DFS flow process to read burst content.If there is not this first burst information in file fragmentation table, burst content corresponding to this first burst information is not stored in this DFS node, and FRL can, according to file complete trails, obtain the label of file, and extract the segmental identification of unique identification, thereby set the second burst information.Above-mentioned the second burst information comprises: the file degree of depth, file label, file fragmentation temperature value, file fragmentation numbering and file complete trails etc.
As described in above-mentioned steps S12, above-mentioned FRL, by this second burst information and the contiguous DFS nodal information that stores burst content, sends to FAC.The information that this FAC returns according to FLR, to the FLR initiation resource Location Request of contiguous DFS node.The FRL location burst content of this contiguous DFS node, and notify this FAC to extract.
Above-mentioned coupling specifically comprises that the FRL of contiguous DFS node mates, according to file complete trails, mates and/or mate according to the Adelson-Velskii-Landis tree ergodic algorithm that can recall according to retrieve hotspot table; And when the match is successful, location burst content.
This mates according to retrieve hotspot table, and the FRL that can be contiguous DFS node is retrieve hotspot table first, judges whether coupling; This mates according to file complete trails, can be matching files complete trails, because most of resource is identical in different DFS node upper pathway.The Adelson-Velskii-Landis tree ergodic algorithm that this basis can be recalled mates, and can search for multichannel, and the FRL of contiguous DFS node will enable the Adelson-Velskii-Landis tree ergodic algorithm that can recall, matching files resource.
If the match is successful, FLR distributes contiguous FAS to FAC, and this FAC is to contiguous FAS request burst content.This FAC can set up reliable UDP(User Datagram Protocol, User Datagram Protocol with this vicinity FAS) communication, transmits burst content.
The FRL of this contiguous DFS node, according to this second burst information, can obtain the file degree of depth, file label, file fragmentation sign and file complete trails etc.Because most of resource is identical in different DFS node upper pathway, can, according to file complete trails, adopt HASH algorithmic match; If the match is successful, according to file fragmentation sign, matching files burst information.
The FRL of this contiguous DFS node, according to adopting HASH algorithmic match hot information, if the match is successful, returns to the file fragmentation information recording in hot information; After returning successfully, will, in this hot information, increase the matching times of this document burst information.This hot information is kept in hot spot table.
The FRL of this vicinity DFS node can enable the Adelson-Velskii-Landis tree ergodic algorithm that can recall, matching files information; If the match is successful, using this document information as hot information, be kept in hot spot table, as the foundation of mating next time, and according to file fragmentation label, matching files burst information, positions.
With reference to Fig. 3, the method for file resource location in a kind of distributed file system of proposition another embodiment of the present invention, also comprises before above-mentioned steps S12:
Step S120, FRL find the contiguous DFS node of storage burst content.
As described in above-mentioned steps S120, FRL obtains the father node label of the corresponding DFS node of burst content, extracts father node label value; When father node label value does not exist, continue to find the father node label value of father node, until find a father node label value; Then, this label value step-by-step is analyzed, at label value, only had unique position effectively, return to label position; Otherwise Study document complete trails, obtains the label place value of file under current path, obtain after current label success, current label place value is copied in the memory block of FRL, otherwise this time analyze unsuccessfully, return; According to file complete trails and label position, obtain contiguous DFS node, and be saved in the memory block of FRL again.
This FRL also can enactment document resource hot information, this hot information can be used for the triggering of drop-down business; All data that FRL also can analyze memory block are combined into elongated type, return to caller, and it is successfully that juxtaposition is called state.
Above-described embodiment is the management to file burst information under DFS by FRL, and making different DFS share storage information becomes possibility, can improve the throughput of DFS; More make to burst content, to adopt unified sign to become a reality between different DFS, and then can complete easily the scheduling of the burst content of different DFS, make not store the DFS node (USS) of actual content, by scheduling, also can provide corresponding media services; Can discharge the valuable storage resources in USS in due course in addition, make storage resources regeneration, improve the stores service ability of USS.
With reference to Fig. 4, the system of file resource location in a kind of distributed file system of proposition one embodiment of the invention, comprising:
FAC20, for obtaining the first burst information by calculating; Also, for utilizing the FRL of contiguous DFS node, according to above-mentioned the second burst information, mate location burst content;
FRL30, for obtaining the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC20, produce segmental identification; When above-mentioned the first burst information is not present in the file fragmentation table of this DFS node, according to above-mentioned segmental identification, set the second burst information.
Above-mentioned FRL30 also, specifically for when above-mentioned the first burst information is not present in the file fragmentation table of this DFS node, obtains the label of file according to file fragmentation path, and extracts segmental identification, thereby sets the second burst information.
Above-mentioned coupling specifically comprises that the FRL30 of contiguous DFS node mates, according to file complete trails, mates and/or mate according to the Adelson-Velskii-Landis tree ergodic algorithm that can recall according to retrieve hotspot table; And when the match is successful, location burst content.
Above-mentioned FRL30 is also for finding the contiguous DFS node of storage burst content.
Above-mentioned FRL30 obtains the father node label of the corresponding DFS node of burst content, extracts father node label value; When father node label value does not exist, continue to find the father node label value of father node, until find a father node label value; Then, this label value step-by-step is analyzed, at label value, only had unique position effectively, return to label position; Otherwise Study document complete trails, obtains the label place value of file under current path, obtain after current label success, current label place value is copied in the memory block of FRL30, otherwise this time analyze unsuccessfully, return; According to file complete trails and label position, obtain contiguous DFS node, and be saved in the memory block of FRL30 again.
Above-mentioned FAC20 can, according to contiguous DFS node and the second burst information obtained, extract required burst content from contiguous DFS node.
With reference to Fig. 5, the device 300 of file resource location in a kind of distributed file system of proposition one embodiment of the invention, comprising:
Receiver module 31, the first burst information of obtaining by calculating for receiving FAC;
Analysis module 32, for obtaining the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC, produce segmental identification; When above-mentioned the first burst information is not present in the file fragmentation table of this DFS node, according to above-mentioned segmental identification, set the second burst information.
Above-mentioned analysis module 32 can obtain file in the sign of this DFS node according to file complete trails, and the first burst information of calculating in conjunction with FAC generates segmental identification.Then, according to this first burst information, in the file fragmentation table of this DFS node, search; If there is this first burst information in file fragmentation table, burst content corresponding to this first burst information is stored in this DFS node, uses existing DFS flow process to read burst content.If there is not this first burst information in file fragmentation table, burst content corresponding to this first burst information is not stored in this DFS node, can, according to file complete trails, obtain the label of file, and extract the segmental identification of unique identification, thereby set the second burst information.
Above-mentioned analysis module 32 is also for finding the contiguous DFS node of storage burst content.This analysis module 32 can obtain the father node label of the corresponding DFS node of burst content, extracts father node label value; When father node label value does not exist, continue to find the father node label value of father node, until find a father node label value; Then, label value step-by-step is analyzed, at label value, only had unique position effectively, return to label position; Otherwise Study document complete trails, obtains the label place value of file under current path, obtain after current label success, current label place value is copied in memory block, otherwise this time analyze unsuccessfully, return; According to file complete trails and label position, obtain contiguous DFS node again.
With reference to Fig. 6, the device 301 of file resource location in the another kind of distributed file system of proposition one embodiment of the invention, comprising: matching module 33, mates for the second burst information sending according to contiguous FAC, location burst content, and the contiguous FAC of notice extracts.
Above-mentioned matching module 33 is also specifically for mating according to retrieve hotspot table, mating and/or mate according to the Adelson-Velskii-Landis tree ergodic algorithm that can recall according to file complete trails; And when the match is successful, location burst content.
This mates according to retrieve hotspot table, can be first retrieve hotspot table, judges whether coupling; This mates according to file complete trails, can be matching files complete trails, because most of resource is identical in different DFS node upper pathway.The Adelson-Velskii-Landis tree ergodic algorithm that this basis can be recalled mates, and can be for multichannel and searches, and enables the Adelson-Velskii-Landis tree ergodic algorithm that can recall, matching files resource.
If the match is successful, 33 of this matching modules distribute contiguous FAS to FAC, and this FAC is to contiguous FAS request burst content.This FAC can set up reliable UDP communication with this vicinity FAS, transmits burst content.
This matching module 33, according to this second burst information, can obtain the file degree of depth, file label, file fragmentation sign and file complete trails etc.Because most of resource is identical in different DFS node upper pathway, can, according to file complete trails, adopt HASH algorithmic match; If the match is successful, according to file fragmentation sign, matching files burst information.
This matching module 33 also can, according to adopting HASH algorithmic match hot information, if the match is successful, return to the file fragmentation information recording in hot information; After returning successfully, will, in this hot information, increase the matching times of this document burst information.This hot information is kept in hot spot table.
This matching module 33 also can be enabled the Adelson-Velskii-Landis tree ergodic algorithm that can recall, matching files information; If the match is successful, using this document information as hot information, be kept in hot spot table, as the foundation of mating next time, and according to file fragmentation label, matching files burst information, positions.
With reference to Fig. 7, in the distributed file system of the present embodiment, the device 301 of file resource location, also can comprise receiver module 31 and analysis module 32; This receiver module 31, the first burst information of obtaining by calculating for receiving FAC; This analysis module 32, for obtaining the file identification at this DFS node according to file complete trails, and the first burst information that this document sign is obtained by calculating in conjunction with FAC, produce segmental identification; When above-mentioned the first burst information is not present in the file fragmentation table of this DFS node, according to above-mentioned segmental identification, set the second burst information.Wherein, above-mentioned matching module 33 can be used for for contiguous FAC location burst content; And, this receiver module 31 and analysis module 32, the FAC that can be used for this DFS node analyzes the contiguous DFS node that burst content can be provided.
The foregoing is only the preferred embodiments of the present invention; not thereby limit the scope of the claims of the present invention; every equivalent structure or conversion of equivalent flow process that utilizes specification of the present invention and accompanying drawing content to do; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.