Embodiment
One preferable network configuration of distributed file storage system of the present invention comprises server layer of being made up of service node and the client layer of being made up of user node as shown in Figure 2.Wherein, this server layer by several each other the service node that connects of network constitute a backbone node net, and be that the center constitutes an edge node net with each service node.This client layer is made up of several user nodes, and each user node is connected with the backbone node net by the service node in the fringe node net under it respectively, and each user node all has a predetermined communal space.The storage that service node of the present invention is used for supporting node and user node with search, may command is finished the uploading of data file, distributed store, download and transmission.User node among the present invention is as the actual storage node of distribution file, and it not only shares the space on the network, and can use the space of other nodes sharing.These user nodes are finished and being connected of service node by background process, and the management of the communal space etc. mainly provide local file to upload, transmit operation, and provide basic-level support for other expanded application.For example, in the present embodiment, service node 1~4 has constituted this backbone node net, and be that the center has constituted a fringe node net with each service node, safeguard the user node 1~5 under the A~D of its distributed areas respectively, be that user node 1,2 is subordinated to service node 1, user node 3 is subordinated to service node 2, user node 4,5 is subordinated to service node 3, and service node 4 is an empty node, can represent temporarily not have in this region D user node to exist, the user node in this zone adds fashionable, is safeguarded by this service node 4.
In the present invention, the service node in the backbone node net can be selected its operational mode: distributing or centralized.For the decentralized service node, service node is safeguarded the information with other own adjacent or relevant service nodes, offers other and obeys successively or the calculating of the route of user node request; For centralised services node, service node is safeguarded the information of service node in the whole network.Wherein, distributed structure is mainly used in catenet, and centralized configuration is mainly used in small-/medium-sized Intranet.
In the present invention, with each service node is that the center constitutes independently fringe node net, safeguard a distributed chessboard mapping table (CBMP, Chessboard Map) on the whole backbone node network, that safeguarded by each service node, relevant with own fringe node net CBMP forms; Each user node is safeguarded the CBMP information with own adjacent node.Routing algorithm calculates at service node and inserts, searches the path, searches resource distribution information, and information is returned to the client.
As shown in Figure 3, show another preferred embodiment of distributed file storage system of the present invention.In order to satisfy the communication requirement between the user node in the fringe node net, also as the first order node (in aftermentioned Fig. 9, describing in detail in the file copy distributed store process) of file distribution, preferable, the present invention not only backbone node net adopts the loop network topological structure, and the user node in the fringe node net adopts the network topology structure of annular too.For example, in the present embodiment, this service node A~D has constituted annular backbone node net, is the center with service node A, B, C, D respectively, and user node A1~A3, B1~B3, C1~C3, D1~D3 under it have also constituted annular fringe node net.Like this, as transfer files between the user node of need in this fringe node net, then can guarantee the speed of transfer of data between the user node directly by the direct communication between user node A1~A3 in the same fringe node net.
And preferable, the present invention also is provided with one and compiles service node, is connected with the service node of backbone node net, is used to detect connection situation and user's statistics of service node, does not participate in actual transmission service.
Below in conjunction with Fig. 4, describe the structure of service node of the present invention and the function of realization thereof in detail.
As shown in Figure 4, service node of the present invention mainly is made of chessboard mapping service node module, the storage of supporting node and user node and searching.This chessboard mapping service node module is mainly by agreement (Protocol) module, service node storage (SCB, Server Chessboard) module, user node storage (CCB, Client Chessboard) module, monitoring module (Listen) and other miscellaneous function modules constitute.Wherein, this protocol module includes and is used to realize that the quality of data guarantees quality control (Qos) module of management, be used to realize node administration algorithm (DHash) module that node distributes, searches, be used to realize mistake control (Failure Control) module of the control and the management of node failure; This service node memory module is used to store all online service node information, promptly stores service unit mapping table (SCB); This user node memory module is used to store all user node information that log on this service node, promptly stores subscriber unit mapping table (CCB); The request that this monitoring (Listen) module is used to monitor node, and the information exchange of maintenance and other nodes; And service node of the present invention also is provided with a plurality of miscellaneous function modules, and for example, interface layer (Interface) module mainly is the support at third party software; User interface layer (shell) module is responsible for the configuration and the operation of local service node and is provided and compile the communication function of service node; Configuration management (Cont) module is used for the configuration-system parameter; Connection management (Connection Manage) module is used for the connection management of this service node and other nodes; System heart-throb (HeartBeat) module is used for keeping connecting; Bottom connects (Communication) module, is used to provide network connection interface to upper layer application; Log management (Log) module is used for the log management of this service node; Mismanage (ErrManage) module is used to carry out mismanage.
Service node of the present invention can be achieved as follows function:
(1) service node registration: after service node starts, need network domains and at least one neighbor node of configuration oneself.According to above-mentioned information, service node sends the notice of reaching the standard grade, the state of advertised network oneself and identifier, and obtain the interior available service unit maps table (SCB) of own network domains synchronously.Open the process of intercepting at last, accept the connection request of user node.
The storage organization of this service unit mapping table (SCB) can be as shown in the table:
SCBID |
ADDRESS |
CLIENTNUM |
AVAILABLENUM |
AREA |
Server1 |
61.49.22.74 |
100 |
80 |
A |
Server2 |
61.172.171.33 |
500 |
350 |
B |
…… |
…… |
…… |
…… |
…… |
Wherein, can comprise in this service node storage list: service node identifier (SCBID), service node address (ADDRESS), user node number (CLIENTNUM), available section are counted (AVAILABLENUM), distributed areas information such as (AREA).Wherein, this service node identifier (SCBID) can be determined by one 32 identifier as shown in Figure 6A, preceding 16 information of representing this service node, and back 16 reservations are to provide the expansion of the new function of service node.Certainly, be understandable that on behalf of the information of this service node, this service node also can only determine by preceding 16.
(2) user node registration: after user node starts,, need be connected to the default service node, register the user node ID of oneself if install first.Log-on message and source IP address that service node provides according to user node generate unique user identifier (32-bit) and return, and the first-selected service node of designated user node.
Also have a subscriber unit mapping table (CCB) in this service node, its storage organization is as shown in the table:
CCBID |
ADDRESS |
SHARE(M) |
AVOID |
PRI |
STAT |
AREA |
Client1 |
10.8.1.3 |
10 |
5 |
1 |
0 |
A |
Client2 |
192.168.1.200 |
20 |
10 |
0 |
1 |
A |
Client3 |
192.168.1.188 |
50 |
50 |
3 |
1 |
B |
Client4 |
202.88.23.152 |
40 |
5 |
2 |
0 |
C |
Client5 |
61.89.120.48 |
20 |
15 |
1 |
1 |
C |
…… |
…… |
…… |
…… |
…… |
…… |
…… |
Wherein, comprise in this user node message store table (CHT): user node identifier (CCBID), user node address (ADDRESS), the communal space (SHARE (M)), enabled node space (AVAID), priority (PRI), user node presence (STAT), affiliated area information such as (AREA).
This user node identifier (CCBID) can be one 32 bit identifiers shown in Fig. 6 B, the fringe node net under preceding 16 representatives, promptly preceding 16 of service node identifier wherein, back 16 nodal informations of representing this user node oneself.Like this, each independently the fringe node net can hold 65535 user nodes, can there be 65536 independently fringe node nets in whole system, supported number of users is about 4.2 hundred million.
For user node, all safeguard the information of individual other nodes of O (logN); For service node, safeguard all nodal informations in this user network.
(3) user node lands: user node provides ID and the password registered to arrive first-selected service node, if first-selected node is unavailable, then calculates the secondary service node, and attempts landing.After service node receives the request of landing, be transmitted to protocol module and handle, generate the ID of this session of user, send the state request, require the user to return current upstate, and upgrade user's online state (STAT) to the user.
(4) user's search request: search in two kinds of situation: search in the service node and service node between search.Search in the service node, upload (upload) that be primarily aimed at user node operates, if in the data security rank of user node definition, can satisfy the demand of user node on service node, then only carries out searching in this service node; In the time of only can not satisfying the node demand of user node, just initiate internodal search operation; Search between service node, be primarily aimed at file transfer operation, relate to the service node of source user node and purpose user node.
When searching, mainly be to search by file identifier (FCBID).Wherein, shown in Fig. 6 C, this document identifier (FCBID) mainly comprises information such as source user node ID, purpose user node ID, file physical message, file verification value.
And, in service node, also comprise a file storage table, be used to support searching and transmitting of service node, its storage organization is as shown in the table:
FCBID |
OWNER |
TOTALSIZE(K) |
BLOCKS |
PRI |
PEERUSED |
NEXTHOP |
File1 |
YTLJC |
307200 |
600 |
1 |
150 |
61.49.22.74 |
File2 |
Stevens |
20480 |
40 |
2 |
80 |
61.171.111.35 |
…… |
…… |
…… |
…… |
…… |
…… |
…… |
Wherein, can comprise in this table: file identifier (FCBID), paper writer (OWNER), file total length (TOTALSIZE (K)), blocks of files number (BLOCKS), priority (PRI), available section are counted (PEERUSED), next hop address information such as (NEXTHOP).
(5) service node lost efficacy: the improper inefficacy of service node, and can not have a significant effect for the user node that is transmitting, but it is made as the user node of preferred server, can land slowly; So guarantee the announcement early of failure node by heartbeat mechanism between service node.
(6) user node lost efficacy: the improper inefficacy of user node comprises user network fault (can recover) and two kinds of situations of user node information fault (irrecoverable).For recovery situation, the identifying user node state is unavailable; For irrecoverable situation, notify all canned data source nodes, do again data and distribute.
(7) connect maintenance: pass through between service node respectively and the heartbeat of service node and user node maintenance.
In service unit of the present invention (service node), there is following data structure: GU Generic Unit information descriptor NUID (Normal Unit Information Description): be used to store the information that exists of individual node, comprise statistical weight values such as time, zone; Exchanges data cells D EU (Data ExchangeUnit): be used for and other service unit exchange message storehouses, submit to and to search, to store to return and add information etc.; Local node information bank LPIB (Local Peer Information Base): be used for storing all NUID of local subnet, a cover access interface is provided.
Wherein, the data flow of service unit comprises:
Service unit is reached the standard grade, initialization LPIB (loading the LPIB of an existing LPIB or a sky of initialization);
The simultaneous operation of initiation and other service units obtains up-to-date LPIB by the DEU exchange;
When local subscriber units is sent the transmission request, obtain a NUID set from LPIB, and return to subscriber unit;
When this locality has new data cell to reach the standard grade,, initiatively initiate duplicating process according to system call;
(active and passive) dynamically monitors feedback information after request takes place, and upgrades LPIB.
Below in conjunction with Fig. 5, describe the composition structure of user node of the present invention and the function of realization thereof in detail.
As shown in Figure 5, in the present invention, this user node comprises: the user lands module, is used for user's logon operation; User registration module is used for the user and registers operation; The file distribution module is used to issue the shared file operation; The local file administration module is used for uploading/downloading of data file, and the checking of blocks of files; Communal space administration module is used for the shared disk space to system of unified management user node, and the use of the dynamic assignment communal space; Transport module is used to provide interface to superstructure, and the reception of notification data file and transmission; Monitor module, be used for the connection request of monitoring service node or other nodes; Configuration Manager is used for the configuration of local system parameter; Log management module is used for local log management; The bottom link block is used to provide network connection interface to upper layer application.
In the present invention, because the service node of server layer substantially all is to run in the same operating system, as LINUX operating system, and in the user node of client layer, might run in the different operating platforms, in order to realize cross-platform operation, the present invention is preferable is provided with system's supporting layer module in user node, be used to user node to run on different operating platforms and provide support.In addition, user node also is provided with an interface layer module to the support of third party software in the user node of the present invention for convenience, is used to the support of third party software that calling interface is provided.
At user node, can realize following function:
(1) file distribution: make the issue index file, be used for operations such as the uploading of file, transmission.
This issue index file can include file identification information, file block information at least.In the present invention, the file that each is shared or uploads, determine that by the file identifier of a 128-bits is unique shown in Fig. 6 C, this document identification information comprises 32 source user node ID information, purpose user node id information, file physical message and file verification value respectively.This document identifier is generated by the source user node,, after the memory node affirmation, is stored in service node in the file storage table in memory node with file distribution, can be for plucking rope.The Distribution Algorithm of file identification is identical with the Distribution Algorithm of node identification, and the blocks of files that each is independent all stores in the node close with its sign; If this node state is unavailable, then search its subsequent node storage.
Wherein, there are three intrasystem definition in destination node: 1) ALL, represent that all nodes all have the right to use; 2) NONE, expression has only the source user node oneself the right to use to be arranged; 3) AUTH has only the authorized user node ability right to use.The destination node id information of system default is ALL, and promptly all nodes can use this destination node.
(2) file operation (search, download, upload):
Share searching of node, user node only needs to send request to service node.The filename or the FCBID that need search only need be provided when searching, and wherein, filename is searched, and needs the retrieval of service node, and FCBID can be directly from the service node locating file.
Download shared file, at first obtain index file, determine connected node then, the swap file state is responsible for the transmission of file and is finished by transport module.
Upload file, node distribution is determined by Distribution Algorithm and is returned by service node, client according to the nodal information distribution file to interdependent node.
(3) share the use flow process:
One, operate between user node: transfer of data, the source user node sends connection request to all targeted customer's nodes that service node provides; If targeted customer's node can be used, then connect, begin to transmit relevant data block; If targeted customer's node is unavailable, then the source user node sends new node request to service node, transmits other data according to return node.In the present invention, these two operations are carried out simultaneously, are not to transmit by all available just beginning of all nodes, but have enabled node just to pass a part, simultaneously for unavailable node, ask to distribute new enabled node.
Two, operate between user node and service node: the state of the own data block of advertisement service node, and the operating position of the communal space.
Three, user node active operation: remove stale data, send the expired inquiry of data,, then clear data if it is expired to return affirmation to the source user node, and to the server update free space; If the source user node need continue retention data, then initiate the process of a data redistribution by the source user node.
Preferable, in order to guarantee the integrality of data, in the present invention, can realize by following three kinds of methods:
One, node redundancy: the length (Size) that guarantees the data file piecemeal is in a rational interval, and the node redundancy degree is at a confidence band.
Two, one or more user nodes can be virtual super node in this client layer, be used in a scheduled time, keeping whole Mirror Infos of specific user's data, at the different stage and the request type of user node, optionally use these virtual super nodes to carry out the transmission of data.
Three, the chessboard mapping policy is finished automatically by service unit, improves the disk utilance when guaranteeing data integrity.
Preferable, in order to guarantee safety of data transmission, the present invention has also carried out the encryption and the user password protection operation of data.This data encryption operation is meant that the user can encrypt distributed data block to specify cryptographic algorithm, can weigh the back decision between data security and uploading speed by the user, and this user password protection operation is with the privately owned password encryption of user with data file.
Same, in user node, also there is following storage organization, be used to support the operation of being connected between service node and the user node, file etc.:
(1) communal space is used information table, and its storage organization is as shown in the table:
FCBID |
FROM |
BLOCKS |
SIZE(K) |
STARTPOS |
ENDPOS |
AVAILABLETIME |
File1 |
YTLJC |
10 |
5120 |
80 |
90 |
2006-11-22 00:00 |
File2 |
Stevens |
2 |
1024 |
90 |
92 |
2007-01-01 00:00 |
…… |
…… |
…… |
…… |
…… |
…… |
…… |
Wherein, can comprise in this table: file identifier (FCBID), shared file source (FROM), shared file piece number (BLOCKS), length (SIZE (K)), starting position (STARTPOS), end place value (ENDPOS), up duration (AVAILABLETIME).
(2) network connection information table, its storage organization is as shown in the table:
ID |
ADDRESS |
TYPE |
AREA |
UPTIME |
OPTYPE |
001 |
202.84.2.45 |
SERVER |
A |
2006-5-18 12:00 |
find |
002 |
61.36.99.123 |
CLIENT |
C |
2006-5-18 13:40 |
upload |
…… |
…… |
…… |
…… |
…… |
…… |
Wherein, can comprise in this table: network name (ID), the network address (ADDRESS), network type (TYPE), network partition (AREA), update time (UPTIME), action type information such as (OPTYPE).
From the above, whole backbone node net is safeguarded a distributed chessboard mapping (CBMP) table, that this table is safeguarded by each service node, relevant with own fringe node net mapping table is formed, this chessboard mapping table comprises subscriber unit mapping table (CCB), service unit mapping table (SCB), file storage table (FCB) etc., store client layer information, server layer information respectively, reach fileinfo, be used to support the connection of whole network store system.
The present invention also provides the user profile inquiry, offers the third party or compiles server and use, operations such as the auxiliary statistics of finishing user data, user's accounting management.Its basic structure is realized by LDAP (LightweightDirectory Access Protocol), is distributed in relevant service unit.
And in the present invention, system relates to following several file format altogether: configuration file, Summary file, shared library file, summary library file, information bank file.Narration respectively below:
1. configuration file: by the storage of XML form, be respectively applied for subscriber unit and service unit, basic nodal information is provided;
2. Summary file: by the storage of XML form, and do symmetric cryptography and handle, be used to describe the summary info and the distributed intelligence of storage file, generate by subscriber unit, being stored in subscriber unit and service unit simultaneously, can independently sending, is the most important condition that file is downloaded and file sends;
3. shared library file: by the binary format storage, be created on subscriber unit, be used for storing communal space data; For subscriber unit, this file is the inaccessible content, has only subscriber unit software to visit basic related content in needs.Index block in the file can only be used for locating and searching data cell by the service unit instruction access.
4. the library file of making a summary: with the XML file storage, be created on service unit, can only visit, be used for providing the data file Summary file to subscriber unit by service unit.
5. information bank file: with the ldap directory storage, be created on all relevant service units, the information of storage subscriber unit and service unit can be visited by management interface by authorized user.
In the present invention, in order further to guarantee the speed of transfer of data, preferable employing following method for routing carry out the selection of route:
(1) adopt distributed areas: user node Connection Service node serves as preferential with the node of not striding service provider, region.
At the actual state of domestic the Internet, transmission speed has greater loss between the network of cross operator, so service node is only accepted same provider customer's connection in principle, to guarantee the speed of transfer of data between user node; Have only when the service node inefficacy, do not have the optional situation of other service nodes, consider that just the cross operator of user node connects.
Based on this factor, service node or user node can at first be considered the contrast relationship table of " IP-operator " when SCBID that calculates oneself or CCBID.Be somebody's turn to do " IP-operator " contrast relationship table, finish, regularly gather operator's data that domain name distributes tissue (ICANN) to announce, be distributed to other service nodes after the arrangement by a station server.
This IP-ISP correspondence table is as shown in the table:
ISP |
IP_SEGMENT_START |
IP_SEGMENT_END |
UPDATE_TIME |
chinanet |
202.98.106.0 |
202.98.106.63 |
2006-05-18 00:00 |
cnc |
202.99.102.128 |
202.99.102.191 |
2006-05-18 00:00 |
…… |
…… |
…… |
…… |
Wherein, user node is in registration, when landing, and service node is according to the above-mentioned relation table, and decision allows the user to land, or user's the request of landing is forwarded to the service node that is more suitable for matching relationship.
Because the present invention in same service node, forms a fringe node net, can direct communication between the user node in the net.Therefore, for different data security ranks, on inter-network is selected, provide different strategies.For the file transfer in the lower same subnet of data security rank requirement, can directly between two user nodes, communicate by letter, carry out the direct transmission of data, thereby increased the transmission rate of data greatly.
(2) adopt priority: the efficient and the availability of each user node added up, calculated to server layer, arranges the priority of user node in system.Long for line duration, the communal space enough, availability and the high user node of reliability, it is higher priority that its priority is set, the distribution that so both can guarantee shared file is wider, and other user nodes can be downloaded the file that needs by these shared nodes at any time.
(3) node is selected: when user node request memory space, service node is selected different matching method (optimum Match, the poorest coupling, coupling first).
Optimum Match: the blocks of files of searching the free space piece that all nodes provide and needing storage relatively differs minimum piece, thinks best matching result.The purpose of optimum Match is to guarantee to have enough big space piece to offer other users to use.
The poorest coupling: search the free space piece that all nodes provide, maximum piece is offered blocks of files use, think the poorest matching result.The purpose of poor coupling is to guarantee that the remaining space piece is all enough big, is unlikely to lose storage value.
Mate first: from available space list, choose the available block that at first finds and give the user, think to mate first.Pi Pei purpose is that assurance is the shortest to user's request responding time first.
The acquiescence matching way that system node is selected is: mate first.
To describe the method for routing of service node of the present invention below in detail.
Server layer of the present invention when a service node adding or deviated from network, all must send a request message that adds or leave.For each user node, when adding or deviated from network, must send a request message that adds or leave to given server.For the situation of improper deviated from network, finish the synchronous working of network state automatically by the fault processing module.
For the storage of service node and user's dot information, adopted " chessboard mapping (CBMP) " structure, the load balance process to optimize has weakened network " " effect has improved the reliability of service node to focus.
Routing algorithm of the present invention---the basic structure of CBMP algorithm is: this algorithm is given each node, specifies the identifier of a m position size, and this identifier is provided by the Hash formula on basis, as SHA-1.For service node, identifier is produced by its IP address; For user node, identifier produces when the user lands at random, destroys when the user leaves.The length of identifier needs sufficient length, to guarantee can not produce identical identifier to different nodes.User identifier in the MEDDQSN system is elected 32 as, and the service node identifier is elected 16 as.
As shown in Figure 7, chessboard mapping table of the present invention (CBMP) mainly is divided into the storage organization of two layers: service node storage list (SCB), user node storage list (CCB).These two storage list structures are respectively applied for the management to service node (ServiceNode) and user node (ClientNode), and each service node writes down all online service node information, and record logs on all user node information of this node; Each user node is only safeguarded the state information of own with relevant with oneself node, for other nodal informations, needs obtain after server sends request.
Routing algorithm of the present invention can be realized following function:
For service node, can realize:
(1) adding of service node (join): calculate this node identification symbol->specified network territory and neighbor node->notice of reaching the standard grade->synchronous SHT;
(2) the leaving of service node (leave): the notice off-line->check login user->notify the user evacuate->off-line;
(3) the searching of service node (find): location service node->send and search notice;
(4) monitoring of service node (listen): receive the request of other service nodes.
For user node, can realize:
(1) adding of user node (join): verify to land->notify to reach the standard grade->flag state is available;
(2) the leaving of user node (leave): the notice off-line->end the process of sharing->flag state is unavailable;
(3) the searching of user node (find): land in the service node search->as dissatisfied, send search notify other service nodes->upgrade upstate;
(4) monitoring of user node (listen): the search request that receives other user nodes of service node.
Describe distributed store, the transmission method of the data file of system of the present invention in detail below in conjunction with Fig. 8~Figure 11.
In the present invention, the distributed store method based on the data file of system of the present invention comprises:
User node utilizes the service node selection that data file is uploaded and is published on the user node available in the network, forms distribution node;
After user node is with data upload or in the transmission course of data file, service node is the interior enabled node of the whole backbone node network of scheduling automatically, distribute the carrying task, user node uploaded the data file that is distributed in the network by duplicating, distribution is stored on the communal space of a plurality of user nodes, form a plurality of shared nodes, download or transfer files usefulness, thereby on network, make up the vector subspace that forms storage and transmission for user node.
And, in the distribution storage, guarantee a certain amount of data redundancy, with in the network of certain limit, reach the even distribution of file.And after finishing above-mentioned distributed store process, user node also can utilize and include download or the transmission that the shared node that needs the data downloaded file is finished the desired data file.
As shown in Figure 8, show user node and carry out the workflow of file distribution, mainly comprise to network:
(1), registered and login user node 1 is made the issue index file, and transmission includes the upload request of this index file information to landing service node 1, wherein, this index file includes file identification information, file block information at least, and this document identification information comprises source user node ID information, purpose user node id information, file physical message and file verification value.
(2), service node 1 is according to index file information, searches the enabled node state; If the subnet interior nodes of current service node 1 is not enough to satisfy the file of user node 1 and uploads demand, then this service node 1 notifies other service nodes 2 need call the communal space of the user node 2 in its subnet, to obtain enough communal spaces, offer user node 1 and use; Upload demand if the subnet interior nodes of current service node 1 is enough to satisfy the file of user node 1, then do not need to carry out searching between service node 1 and the service node 2; If file transfer then needs to locate the registration service node 2 of destination node, and notify this service node 2;
(3), service node 1 returns enabled node information and gives user node 1; Receive other service nodes 2 of node request, also return enabled node information and give user node 1, and announce the user node 2 that calls in this fringe node net;
(4), user node 1 is according to the node listing that returns, and sends connection request;
(5), the finger daemon of user node 2, receive the connection request of user node 1, return current state and available information; If the communal space is unavailable, then return refusal information, and notice is landed the state of service node 2 changes oneself;
(6) user node 1 receives the return information of node, determines whether to begin transmission; If do not obtain enough node responses, then send new request to service node 1 again, obtain the more nodes tabulation;
(7), determine between user node to connect after, need to prepare the blocks of files and the corresponding check value of transmission, be submitted to transport management module and begin the transfer files piece;
(8), after blocks of files transmission finishes, user node 2 register-file states are given and are called service node Server1.
Present embodiment is that example describes with user node 1 file publishing to user node 2 only, but be understandable that, the source user node is in file publishing, can be connected to simultaneously on a plurality of user nodes in the network, on these a plurality of user nodes of file distribution, these user nodes are distribution node.
As shown in Figure 9, in conjunction with distributed file storage system of the present invention, with a user node upload file to network and in network node the process of distributing storage data be example, further describe the uploading issue, duplicate and the method for distributed store of data file of storage system of the present invention, it comprises:
(1) user node 4 is made the issue index file, and sends the upload request that comprises this index file to service node D.Wherein, this index file has comprised constituent instruments information such as the source user node ID, file ID, file size, filename, blocks of files size of file, and some other about accessory informations such as file block information, file verification values.By this index file, can search, obtain enabled node information fast.
(2) after service node D receives request, this index file information of record in the file storage table of service node D, and from the user node storage list, search enabled node, be enabled node as selecting user node 2,3;
(3) service node D returns available nodal information and gives user node 4; Notify selecteed user node 2 and user node 3 simultaneously, their communal space of notice requisition, and they are connected with user node 4 respectively;
(4) upload file piece 1 is to user node 3 respectively for user node 4, and upload file piece 2 is to user node 5;
(5) file is uploaded and is finished, user node 3 and user node 5 notification service node D and user node 4 completion statuses (so far finished the issue of uploading of file, wherein user node 3 and user node 5 are for uploading the distribution node of issuing process);
(6) service node D computation index file obtains file distribution rank (can obtain the priority of file according to the file identifier that comprises in the index file), and sends synchronization request to other service nodes A, B, C;
(7) after service node A, B, C receive request, search the available subscribers node in the network domains separately, can use, then notify user node 1,7,8,9 synchronization request, space requisition size as determining user node 1,7,8,9; Notify user node 3,5 as blocks of files 1 being copied to user node 7,8, blocks of files 2 to be copied to user node 1,9 simultaneously to user node 1,7,8,9 xcopy pieces 1,2;
(8) after data were duplicated and finished, user node 1,7,8,9 notified fringe node net separately interior service node A, B, C respectively; User node 3,5 notification service node D;
(9) service node A, B, C notification service node D, file distribution storage is finished, and this user node 1,7,8,9 shared node that be the file storage process wherein is for other user node file download/transfer usefulness.
Preferable, in the present invention, replication strategy has adopted the data statistics Distribution Algorithm based on bit manipulation.At first by statistics, the distributed intelligence of obtaining enabled node to greatest extent comprises information such as time range of distribution and regional range of distribution, generates the information bank of distribution statistics pooled applications, offers the copy services node and uses;
Secondly, data copy services node by calling the distribution statistics information bank, obtains the current and statistical information of node, based on the bit manipulation of information, obtains optimized distribution map;
Then, the copy services node is submitted replication strategy to, and the scheduling distribution node is finished duplicating of data;
At last, according to feedback data information in the reproduction process, upgrade statistics information bank continuous item.
As shown in figure 10, show user node of the present invention and search, find and the file that file downloads to local disk is downloaded flow process that it comprises:
(1) registered and login user node 1 sends download request to landing service node 1;
(2) service node 1 is according to demand file information, as filename, the file identifier (FCBID) of request file in download, the shared node in the Network Search; If can not need find the full detail of file in download in this node services sub-network, then need to send search request to other related service nodes 2, seek available user node 2 (this user node 2 is promptly as sharing node);
(3) service node 1 and other related service nodes 2 return in this fringe node net and need the shared information of file in download to give this user node 1 relevant for this in other relevant edge node nets;
(4) user node 1 sends connection request according to the shared node listing that returns;
(5) finger daemon of user node 2 receives the connection request of user node 1, returns the current file bulk state; If blocks of files is unavailable, then return refusal information, and notice is landed the own state of service node 2 changes;
(6) user node 1 receives the return information of node, determines whether to begin to download; If do not obtain enough node responses, can not guarantee data integrity, then send new request to service node 1 again, to obtain more sharing node listing;
(7) determine to connect between user node after, need to prepare downloaded files piece and check value accordingly by shared node, be submitted to transport management module and begin the transfer files piece;
(8) after the blocks of files transmission was finished, user node 2 register-file states were given and are called service node 1;
(9) after download is finished, user node 1 notification service node 1.
And for file transfer, the transmission of especially big file, its transmission course is basic and said process is similar, also will uploading issue, duplicate the process of distributed store through a source file, source file is issued on the shared node that stores in the network, and then downloaded to the transmission that local disk is realized big file by the destination node demand file.Specifically, in document transmission process, in the step 2 of above-mentioned file upload procedure, the registration service node 2 that needs location purpose user node 2, and notify this service node 2, other steps and above-mentioned file are uploaded issue, are duplicated distributed store, process of downloading is basic identical, do not repeat them here.
In addition, based on distributed file storage system of the present invention, by with the combining of wireless, embedded device, can carry out the mail service of big accessory for application such as mobile big capacity storage.
Below in conjunction with Figure 11 A, 11B, 12 application that distributed file storage system of the present invention combines with wireless terminal, mailing system is described respectively.
Shown in Figure 11 A, 11B, whole wireless application network is by service node and user node, the mobile operator wireless network and the wireless base station that provide of distributed file storage system on the internet network, compositions such as user's portable terminal, third party content supplier.Wherein, mobile terminal node need be tied on the user node of P2P network store system, this mobile terminal node does not provide the communal space, but directly uses the shared resource of the user node of its binding, and its operating right is identical with bound fixed-line subscriber node.And storage system is supported the equipment of java environment and Symbian platform, and the third party software interface is provided, can be as the basic-level support of moving transmission.
In the present invention, utilize the wireless application network to carry out that file is uploaded or the process of service such as download comprises the steps:
(1) user at first binds the user node of portable terminal on the storage system, can use the ID of this node to land then, and it is mobile status that service node can identify this node, does not use as the distributed store node.This user is upload file or download in normal way.
(2) third party software can call the interface of storage system, and other value-added services are provided.
In the wireless application process,, need the support of operator for the application of portable terminal.In 3G network, utilize storage system of the present invention, can be to the long-distance video collection, IPTV provides the bottom service of high-quality.
Storage system of the present invention is mainly used in aspects such as the file distribution storage of the Internet, big file transfer, file-sharing.Be example with the big accessory mail below, further specify the application that combines that system of the present invention and third party use.
Because what actual transmissions was used is the smtp/pop agreement, the attachment function that common mailbox provides has considerable restraint on single annex size, and general mailbox is about 10M, can not satisfy demands such as current media application.For the demand that transmits big file, common mode can only be handled with manual files cutting, and inconvenient operation is made mistakes easily, and transmission speed is low and for mailing system very big dependence is arranged.
Based on the consideration of big file transfer, finish file transfer jointly in conjunction with mailing system and storage system.Can solve the restriction of single annex size, improve the efficiency of transmission of annex.
As the support of storage system to the third party software expansion, a series of third party's assemblies are provided, as supporting assembly to mailing system---" system's mail agent module " etc., be arranged on storage system user node and the mail server, be used for when mail has big accessory, call the communal space in the storage system and realize the transmission of big accessory in the mail, so can solve in the existing mailing system restriction for the Email attachment size.
For example, for the big accessory mail transmission between the user node in the storage system, owing on the user node this mail agent module is installed, and can be when carrying out the big accessory mail transmission, the communal space of directly calling in the storage system is carried out the transmission of big accessory.And for the user who does not belong in this storage system, the user only need go up to install and dispose corresponding " system's mail agent module " as the mail agent client component at its mail service platform (as mail server), when carrying out the mail transmission of big accessory, can communicate by letter with storage system, call the communal space in the storage system, as the delivering path of big accessory in the mail, so just can provide big accessory transmitting function at a high speed for the user.
As shown in figure 12, show storage system of the present invention combines the annex transmission that is applied to the big accessory mail with mailing system structure.Wherein be provided with one in the mailing system and act on behalf of module, be connected, be used for realizing the transmission of big accessory mail annex with the server layer network of storage system.The mailing system under the varying environment of the service node of the server layer of storage system and mailing system provides corresponding Agent, is used to transmit user's annex transmission request.In custom system, need to download and install the user side agency of storage system, be used for being connected with the storage system network.Whole network configuration can utilize existing storage system network to realize, can guarantee user's unanimity, and increase the availability (abundant node is arranged) of system.
If there is not the transmission of big file, mailing system works independently, and does not relate to storage system.Send a big file to user recipient (Reciver) if the user is the sender (Sender), mailing system can be done a judgement to the request of annex, and notice " system's mail agent " has the user to ask, " system's mail agent " notice contact mail user sender (Sender), startup file is uploaded flow process; Message body sends to user recipient (Reciver) by mailing system, comprising the index information of annex, user's authority proof etc.After user recipient (Reciver) gets the mail, download annex if click, can directly link the service node of P2P network store system, demand file is downloaded, after service node checking user's the authority proof, user recipient (Reciver) is given in the backspace file distributed intelligence, and user recipient (Reciver) begins to connect other user nodes, receives attachment files.User recipient (Reciver) receives, notification service node " annex end of transmission ", service node circular document distribution node is deleted the shared space of this annex, and the circular mail server receives annex and finish, and can notify the success of user sender (Sender) mail if desired.
In addition, crossing over the problem of NAT, is basic main points for domestic the Internet.MEDDQSN of the present invention crosses over mode except supporting basic UDP, as TURN, STUN, MIDCOM mode; Simultaneously, also provide based on TCP connection and TCP﹠amp; The ICMP mode guarantees the performance such as flow control, Qos in the data transmission procedure.
In sum, storage system of the present invention both can be used as independent application and had offered the client as a high efficiency storage system based on internet, also can be used as basic-level support and used with a large amount of third parties and combine, and improved the performance of whole Network Transmission.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art work as can make various corresponding changes and modification according to the present invention, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.