Summary of the invention
The embodiment of the invention provides a kind of method for distributing network file and network file dissemination system, realizing according to Service coverage and business rule, and distributing network file simply and easily.
The method for distributing network file that the embodiment of the invention provides comprises:
Set according to Service coverage configuration network file distributing in advance; The leaf node of said network file distribution tree is represented network node, and other nodes represent that Service coverage and downstream site corresponding service coverage wherein are above that in the level node corresponding service coverage; When network file need be distributed, carry out following steps:
Service coverage node corresponding from said network file distribution tree under selection and this network file also generates the network file distributed tasks, comprises the tabulation of network file to be distributed and the information of the all-network node in the selected node corresponding service coverage in this task;
File access request according to the network node in the said network file distributed tasks is initiated sends to this network node with the network file in this task.
Further; Network file in the said network file distributed tasks is sent to said network node; Be specially: the server through preserving the network file in the said network file distributed tasks is or/and other network nodes in the said network file distributed tasks send to said network file the network node of initiating the file access request.
The network file dissemination system that the embodiment of the invention provides comprises:
The system configuration module; Be used for setting according to Service coverage configuration network file distributing in advance; The leaf node of said network file distribution tree is represented network node, and other nodes represent that Service coverage and downstream site corresponding service coverage wherein are above that in the level node corresponding service coverage;
Task layout module; Network file is used for when need be distributed; Service coverage node corresponding from said network file distribution tree under selection and this network file also generates the network file distributed tasks, comprises the tabulation of network file to be distributed and the information of the all-network node in the selected node corresponding service coverage in this task;
The file distributing module is used for the file access request initiated according to the network node of said network file distributed tasks, and the network file in this task is sent to this network node.
The above embodiment of the present invention; Set through the configuration network file distributing; Make in the Service coverage Service coverage that the level node is described above that the downstream site of this tree describes, thus when the distributing network file, through from the network file distribution tree, select and network file to be distributed under the Service coverage node corresponding; For network file to be distributed generates the network file distributed tasks, and send network file to be distributed according to the network file distributed tasks that generates.Because the network file distribution tree disposes according to Service coverage; Wherein each node is represented certain Service coverage; Thereby can be according to business rule; Through in this tree, selecting appropriate nodes to select the corresponding business coverage, network file to be sent is sent to the all-network node in this scope.When the business rule of network file distribution changes; As long as in this network file distribution tree, select appropriate nodes just can network file to be sent be sent to desirable Service coverage once more, and can accomplish the distribution that configuration network file distributing is set, repeatedly used this network file distribution tree to come the configuration network file according to the variation of business rule according to the corresponding business rule.Compared with prior art, realized according to Service coverage distributing network file and according to the variation of business rule configuration network file distributing simply and easily, and improved file distributing efficient, the layoutprocedure when having simplified file distributing.Further; Server through preserving the network file in the said network file distributed tasks is or/and other network nodes in the said network file distributed tasks; Said network file is sent to the network node of initiating the file access request, can make full use of data sharing mechanism based on the P2P network architecture, thereby on the basis of the layoutprocedure when improving file distributing efficient, simplified-file distribution; Further improve file transfer efficient, and reduce the load of server.
Embodiment
Below in conjunction with accompanying drawing the embodiment of the invention is described in detail.
Referring to Fig. 1, the structural representation of the network file dissemination system that provides for the embodiment of the invention.This network file dissemination system comprises: system configuration module 101, task layout module 102 and file distributing module 103.System configuration module 101, task layout module 102 and file distributing module 103 can be closed and be located at a station server, also can the combination in any mode be deployed in the different servers, wherein:
System configuration module 101 mainly provides the configuration feature of Service coverage area configurations and network file receiving terminal; Main being responsible for set according to Service coverage configuration network file distributing; Service coverage under the downstream site in this network file distribution tree is above that in the Service coverage under the level node; The leaf node of distribution tree is then represented the network node in the corresponding service coverage, and this network node is the network file receiving terminal node;
Task layout module 102 main being responsible for generate the network file distributed tasks that network file distributed tasks and issue generate according to business rule and network configured file distributing tree and network file to be distributed;
File distributing module 103 is main is responsible for the access request initiated according to the network node in the network file distributed tasks, the network file to be distributed in this task is sent to the network node of this initiation request.
Here said Service coverage is meant service deployment planning; As; Professional related zone and related network node wherein, can be divided into many levels with Service coverage according to service needed; Each layering corresponding service coverage, last layer is contained the Service coverage of next level.Service coverage can be the geographic range in an area, also can be trans-regional scope, and the network node under the same Service coverage is born identical business function or service usually, thereby has identical business configuration demand.Here said business rule is meant business function or the service of bearing according to network node, to the network node distributing network file of corresponding business coverage, and can be during each distributing network file based on identical or different business rule.
Below in conjunction with Fig. 2, the network file distribution flow that the embodiment of the invention provides is described.
Referring to Fig. 2, be the network file distribution flow sketch map that the embodiment of the invention provides, this flow process mainly comprises:
Step 201, set according to Service coverage configuration network file distributing.
In this step, it is multistage that system configuration module 101 comprises that according to Service coverage network configured file distributing tree root node, leaf node and the intermediate node between root node and leaf node, intermediate node can comprise that one-level also can comprise.Wherein, root node is used for describing the professional total size that covers; Leaf node is used for describing network node information, and the network node that leaf node is described is the receiving terminal network node of the network file of distribution; Intermediate node is used for describing the professional subrange that covers in the total size.Several one-level subrange nodes of one deck definable are as intermediate node under the root node, several secondary subrange nodes of definable again under the one-level subrange node, and recursion in this way is till setting certain node and being leaf node.Intermediate node is used for defining the attribute of the subrange of certain classification, describes like Service coverage; Leaf node is used for defining the attribute of the network node that receives network file, like information such as network node address, identification code, title or geographic areas, place.In the path from the root node to the leaf node the stack of the Service coverage attribute described of the node of process be exactly the Service coverage attribute under this leaf node.In theory, the level of network file distribution tree can infinite expanding, for business rule definition and adjustment provide the foundation.
Fig. 3 has provided a kind of structural representation of network file distribution tree.As shown in Figure 3, this network file distribution tree comprises root node 301, intermediate node 302,303,306,308,309, and leaf node 304,305,307,310.Root node 301 is described the professional total size that covers; Be divided into a plurality of one-level subranges in this total size; Describe the one-level subrange by intermediate node 302,308 among Fig. 3, can be divided into a plurality of secondary subranges under the one-level subrange again, describe the secondary subrange by intermediate node 303,306,309 among Fig. 3; Comprise one or more network nodes under the secondary subrange; Respectively with node 304,305,307,310 expressions, node 304,305,307,310 has been described the information of corresponding network node in Fig. 3, and network node information can comprise that the network address of node is or/and node identification.
Step 202, according to Service coverage under the network file to be distributed and network file distribution tree, generate the network file distributed tasks.
In this step; In order to generate the network file distributed tasks, can pass through task layout module 102, the business rule that adopts according to this time; Be network file to be distributed the Service coverage that will arrive; From the network file distribution tree, select the node of this scope of expression, carry out the network file distributed tasks then and generate instruction, single to generate the network file distributed tasks.The node of from the network file distribution tree, selecting can be a root node, also can be one or more intermediate nodes, also can be leaf node, can also comprise intermediate node and leaf node.If what select is root node, network file then to be distributed will be distributed to all leaf nodes in the represented Service coverage of root node; If selected intermediate node, network file then to be distributed will be distributed to all leaf nodes under this intermediate node; If selected leaf node, network file then to be distributed will directly be distributed to this leaf node.Like this; The system manager just can conveniently select the receiving terminal in the Service coverage; The granularity of its management and selection can be slightly to root node (being the all-network node); And can carefully arrive leaf node (i.e. network node), thereby for the means of adjusting easily being provided according to the needs of Content Distribution Network file.
Because the distributing network file is that unit rather than a concrete file are the unit with certain business packet normally, therefore, task layout module 102 provides job order layout function, and generating with the business packet is the network file distributed tasks list of unit.Comprise with the business packet being the network file tabulation to be distributed of unit and all receiving terminal network node information (like the sign or the network address of network node) of the file in the tabulation of this network file during the network file distributed tasks that generates is single.The information (like file title, file size, file storage location etc.) of network file to be distributed has been described in the network file tabulation; Can also comprise professional use information (for example reproduction time of network file etc.) in this tabulation, comprise that specifically which information need be defined by operation system.Also comprise Service coverage information during the network file distributed tasks is single, this Service coverage is the described Service coverage of selected node from the network file distribution tree.Task layout module 102 singly is saved in designated storage location with the network file distributed tasks that generates; Preferably; The network file distributed tasks stores the network node that all leaf nodes in the network file distribution tree can both have access to into, like the visible server of the overall situation.
Network node in step 203, the network file distributed tasks is initiated the file access request according to this network file distributed tasks.
In this step, trigger network node initiation file access request mode has multiple, and the embodiment of the invention provides following triggering mode:
Mode one: trigger with own relevant network file distributed tasks through the automatic inquiry of network node; In this mode; All leaf nodes in the network file distribution tree are regularly from storing the network node requester network file distributing task of network file distributed tasks; Comprise this node self if inquire the network node that comprises in certain or some network file distributed tasks (being the receiving terminal node of network file to be distributed), then initiation request is to visit the network file in this task;
Mode two: the notification message that sends through the network file dissemination system triggers; In this mode; Send the notification to the network node in this task after task layout module 102 generates the network file distributed tasks, the network node initiation request that receives this notice is to visit the network file in this task.
Before network node is initiated the file access request; Can generate the network file downloading task according to the network file distributed tasks; Comprise listed files in the downloading task; The included file of the included file of this document tabulation and the listed files in the distributed tasks is identical, then according to download policy initiation file access request when carrying out this downloading task.
Step 204, according to the file access request that network node is initiated, network file to be distributed is sent to this network node.
In this step; After file distributing module 103 is received the file access request of network node initiation; According to the file name to be distributed listed in the job order and the network node information of source stored position information and initiation request, obtain network file to be distributed and send it to this network node from the memory location, source of appointment.If job order also uses in the operation system of receiving terminal network node; Then this job order itself also can be used as a file task and puts into the distributed tasks list; So that be distributed to the receiving terminal network node together, to the processing mode of this job order with the same to the processing mode of the file to be distributed in this job order.
In order to improve the efficient of network node requester network file distributing task; The embodiment of the invention can be further after generating the network file distributed tasks; For this task generates index record; This index record is stored in the concordance list, and the network node that this index table stores all may have access to all leaf nodes in the network file distribution tree.The index record that generates comprises that the single sign of corresponding network file distributed tasks is or/and reference address; Also comprise the listed network node information of this job order (sign of receiving terminal node that is network file is or/and information such as the network addresss), also can comprise Service coverage (i.e. the represented Service coverage of selected node in the distribution tree) information of map network file distributing task in the index record.
Accordingly; In triggering mode through the network node network file distributed tasks that inquiry is relevant with oneself automatically; Network node inquire about to as if the index record of network file distributed tasks, and when in index record, comprising the Service coverage information of map network file distributing task, can judge tentatively whether this node self belongs to this Service coverage according to this information; If; Further judge according to the network node information that concordance list comprised again, otherwise, just can make a decision according to the network node information that concordance list comprised.Owing to possibly comprise a large amount of network node information in the index record,, carry out preliminary judgment mode and can reduce taking of system resource through above-mentioned, thereby improve search efficiency if relatively can take one by one than multi-system resource.
When the configuration network file distributing is set; Can also be each tree node distribution node ID, wherein, downstream site ID is provided with according to its superior node ID; To comprise the Service coverage of its superior node representative; Like this, the ID of leaf node just can express from root node to this leaf node the path of process, promptly show the Service coverage and the position of this leaf node in the network file distribution tree of this leaf node.Accordingly; The node ID of receiving terminal node in the network file distribution tree that can comprise network file in the index record; Like this, when network node writes down at search index, just can utilize position and corresponding service coverage in the network file distribution tree that node ID shows; Tentatively judge whether this node self belongs to this Service coverage, thereby improve search efficiency.
In the above-mentioned flow process; In order to reduce repetitive requests to consolidated network file distributing task; So that minimizing offered load; The embodiment of the invention can further increase the rise time of network file distributed tasks in the network file distributed tasks is single or in the corresponding index record, corresponding, the rise time of the corresponding network file distributed tasks of corresponding record after network node generates downloading task.Like this; When network node judges that according to this this network node does not generate corresponding network file downloading task rise time (rise time of the network file distributed tasks that the pairing rise time of the downloading task of up-to-date generation inquires early than this network node in like this network node) initiate access request again, thereby avoided the network file distributed tasks of downloading completion is initiated access request once more.
In the above-mentioned flow process of the embodiment of the invention; In case after setting up the network file distribution tree according to Service coverage; Under the immovable situation of Service coverage, during each distributing network file, can distribute based on the suitable Service coverage of business rule selection of this network file distribution tree and this time; Thereby when business rule changes; As long as dispose the distribution scope, thereby make that the file distributing layoutprocedure is simple and convenient, and then can improve network file distribution efficient through in the network file distribution tree, reselecting the tree node that adapts.
When Service coverage need change, can set up the network file distribution tree according to new Service coverage, and carry out the distribution of network file based on the network file distribution tree that this is newly set up.Can also set up various network file distributing tree according to the different service coverage in advance, when carrying out the network file distribution, select corresponding network file distribution tree, and carry out the distribution of network file based on the network file distribution tree that this is selected.
The network file dissemination system of the embodiment of the invention also provides functions such as the modification, deletion, renewal of network file distribution tree.The system manager can revise the network file distribution tree of having set up through system configuration module 101 according to the situation of change of Service coverage.When the system manager need revise the network file distribution tree according to the service network node of newly establishing; Can pass through to add same node layer at any one deck of network file distribution tree; To expand certain other Service coverage of level; Or through adding lower level node, to increase other degree of depth of Service coverage level.When adding node,, then add lower level node and mean with this newly-increased node to be that root node has added stalk tree if the node that adds is not a leaf node.When deletion of node, if the node of being deleted is not a leaf node, then deletion action means that then deletion is the stalk tree of root with this node.Upgrade operation and be meant the attribute description information of revising certain node.
Said system can mainly realize through software mode; Wherein, System configuration module 101 can provide User Interface, and through the configurable network file distribution tree of this interface system keeper, the operation of configuration network file can comprise operations such as establishment, modification, deletion, renewal.Task layout module 102 also can provide User Interface; The keeper can select network file to be distributed through this interface system; And select the purpose network node of these files to be distributed according to network configured file distributing tree, thus the network file distributed tasks generated, as; After selecting network file to be distributed; Through from the network file distribution tree, selecting one or more nodes,, generate network file distributed tasks list according to the Service coverage of the node representative of network file to be distributed and selection then through carrying out the order that generates job order to select the distribution scope of job order.
The above embodiment of the present invention can combine the data sharing mechanism of P2P network to use, and perhaps is applied to the P2P network.When embodiments of the invention are applied to the P2P network architecture or combine the data sharing mechanism use of P2P network; After user's data access client (also can be described as network node) is landed data access system, can initiate the file access request automatically through aforementioned triggering mode.And; Can utilize the data sharing mechanism of P2P network; The listed network node information in single according to the network file distributed tasks (like the address of network file receiving terminal node or/and sign); Set up data sharing and connect, make the client node of initiating the file access request can be from obtaining network file with other client nodes its equity, that belong to consolidated network file distributing task.Because the client node that belongs to consolidated network file distributing task is usually by the identical network file of distribution; Therefore; According to network file distributed tasks list and utilize the data sharing mechanism of P2P network to set up data sharing to connect; The network node that can visit for request msg targetedly provides lasting data access service, and can improve the load of network file distribution efficient, minimizing server end.
In sum; The embodiment of the invention is through setting up the network file distribution tree with Service coverage; And according to the distribution scope of business rule configuration network file; Thereby generate the network file distributed tasks, can simplify the configuration operation of network file distribution and the flexibility that improves the network file dispense configurations; Automatically initiate the file access request through network node according to the network file distributed tasks, can realize automation, the raising network file distribution efficient of network file distribution; Singly serves as foundation and pass through data sharing mechanism distributing network file with the network file distributed tasks, can alleviate bandwidth resources demand, the raising file transfer efficient of offered load, minimizing network file transmitting terminal based on the P2P network.
Need to prove; The functional module dividing mode of the described network file dissemination system of the embodiment of the invention is not a sole mode; Above-mentioned 3 any type of combinations of functional module; Perhaps can accomplish identical function but with above-mentioned functions module title condition of different, all should be within protection scope of the present invention.
The above; Be merely the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technical staff who is familiar with the present technique field is in the technical scope that the present invention discloses; The variation that can expect easily or replacement all should be forgiven within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claims.