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 described network file distribution tree is represented network node, and other nodes represent that Service coverage and downstream site corresponding service coverage wherein are thereon in the level node corresponding service coverage; When network file need be distributed, carry out following steps:
Service coverage node corresponding from described 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 described network file distributed tasks is initiated sends to this network node with the network file in this task.
Further, network file in the described network file distributed tasks is sent to described network node, be specially: the server by preserving the network file in the described network file distributed tasks is or/and other network nodes in the described network file distributed tasks send to described 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 described network file distribution tree is represented network node, and other nodes represent that Service coverage and downstream site corresponding service coverage wherein are thereon in the level node corresponding service coverage;
Task layout module, network file is used for when need be distributed, Service coverage node corresponding from described 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 described 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 by the configuration network file distributing, make in the Service coverage Service coverage that the level node is described thereon that the downstream site of this tree describes, thereby when the distributing network file, by the Service coverage node corresponding under selection and the network file to be distributed from the network file distribution tree, 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, by in this tree, selecting appropriate nodes to select the corresponding business coverage, network file to be sent is sent to 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 network file to be sent can 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 by preserving the network file in the described network file distributed tasks is or/and other network nodes in the described network file distributed tasks, described 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 thereon 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 according to the network file distribution tree of business rule and configuration and network file to be distributed generate the network file distributed tasks that network file distributed tasks and issue generate;
The file distributing module 103 main responsible access request of initiating according to the network node in the network file distributed tasks send to the network node that this initiation is asked with the network file to be distributed in this task.
Here said Service coverage is meant service deployment planning, as, professional related zone and related network node, wherein, can Service coverage be divided into many levels 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 is provided is described.
Referring to Fig. 2, be the network file distribution flow schematic diagram 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, system configuration module 101 comprises root node, leaf node and the intermediate node between root node and leaf node according to the network file distribution tree of Service coverage configuration, and it is multistage that 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 as Service coverage; Leaf node is used for defining the attribute of the network node that receives network file, as 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 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, among Fig. 3 by intermediate node 302,308 describe the one-level subrange, can be divided into a plurality of secondary subranges under the one-level subrange again, among Fig. 3 by intermediate node 303,306,309 describe the secondary subrange, comprise one or more network nodes under the secondary subrange, in Fig. 3 respectively with node 304,305,307,310 expressions, node 304,305,307,310 have described the information of corresponding network node, 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, it is the Service coverage that network file to be distributed 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 selecting from the network file distribution tree 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 the means of adjusting are easily provided for needs according to the 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 (as 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 (as file name, 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, as 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 by the network node network file distributed tasks that inquiry is relevant with oneself automatically, 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), the request of then initiating is to visit the network file in this task;
Mode two: the notification message that sends by the network file dissemination system triggers, in this mode, send the notification to the network node in this task after the task layout module 102 generation network file distributed tasks, the network node that receives this notice is initiated request 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 file name to be distributed listed in the job order and source stored position information with initiate the network node information of 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 be may have access to all leaf nodes in the network file distribution tree.The index record that generates comprises that the sign of corresponding network file distributed tasks list 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 by 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 may comprise a large amount of network node information in the index record,, carry out preliminary judgment mode and can reduce taking of system resource by 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 indicated network file distribution tree of node ID, 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 is the rise time of increase network file distributed tasks in the network file distributed tasks is single or in the corresponding index record further, accordingly, 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 rise time this network node does not generate corresponding network file downloading task (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 as this network node) initiate access request again, thereby avoided initiating access request once more to downloading the network file distributed tasks of finishing.
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 select suitable Service coverage to distribute based on the business rule of this network file distribution tree and this time, thereby when business rule changes, as long as dispose the distribution scope by in the network file distribution tree, reselecting the tree node that adapts, thereby make that the file distributing layoutprocedure is simple and convenient, and then can improve network file distribution efficient.
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 different network file distribution trees according to different Service coverages 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 by 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 by 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 deleted node 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 by software mode, wherein, system configuration module 101 can provide User Interface, and by 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 by this interface system, and select the purpose network node of these files to be distributed according to the network file distribution tree of configuration, thereby generate the network file distributed tasks, as, after selecting network file to be distributed, by from the network file distribution tree, selecting one or more nodes to select the distribution scope of job order, then by carry out generating the order of job order, it is single to generate the network file distributed tasks according to the Service coverage of the node representative of network file to be distributed and selection.
The above embodiment of the present invention can be used in conjunction with the data sharing mechanism of P2P network, perhaps is applied to the P2P network.Embodiments of the invention are applied to the P2P network architecture or when using in conjunction with the data sharing of P2P network mechanism, 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 by 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 (as 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.Usually be distributed identical network file owing to belong to the client node of consolidated network file distributing task, 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 by 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 by 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 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 machine-processed distributing network file of the data sharing of 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 finish identical function but with the different situation of above-mentioned functions module title, all should be within protection scope of the present invention.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art 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.