Summary of the invention
The objective of the invention is provides a kind of peer-to-peer network streaming media on demand method for ensuring service quality and system in order to overcome on the existing the Internet in the streaming media on demand service node streaming media on demand problem in poor service that behavior caused of " hitchhiking ".The present invention has and improves on the Internet service quality in the streaming media on demand service, reduces the advantage of the time of querying node streaming media resource on the Internet.
The program request network that the present invention relates to, streaming media resource data fragmentation, node donut routing table, node prestige parameter, node service quality value, node service response mode, node consistency evaluation of estimate are described below:
I, program request network
The program request network comprises: registrar, streaming media server, super node, four parts of ordinary node.
(1) registrar: be responsible for record and safeguard node in the program request network.
(2) streaming media server: be responsible for streaming media resource being provided to node in the program request network.Simultaneously, when node in the program request network was searched the failure of required stream medium data, streaming media server can provide required stream medium data for them.
(3) ordinary node: for other nodes in the program request network are uploaded stream medium data, other download stream media datas from the program request network, buffer memory and the stream medium data of scheduling from other nodes downloads of program request network.Each ordinary node is all being safeguarded a donut routing table, in the program request network, searches the node of holding required stream medium data fast to make things convenient for it.
(4) super node: online stable node is taken on super node in the auxiliary registrar selection program request network; Safeguard simultaneously and have the ordinary node of certain network distance with it; The ordinary node that super node and it have certain network distance constitutes a program request subnet, be called " bunch ".
II, streaming media resource data fragmentation
For streaming media resource is carried out distributed storage and distributed transmission, need carry out data fragmentation to streaming media resource, every stream medium data sheet comprises data head, two parts of data slice content, and specific descriptions are described below:
(1) data head comprise streaming media resource title, data slice numbering, data slice timestamp;
(2) data slice content, streaming media resource is split into some big or small identical data sheets in the program request network, and each data slice content size is 8KB (kilobytes), wherein: 1K=1024B (byte), 1B (byte)=8Bit (position).The computing formula of last data slice content size of each streaming media resource is following, and its unit is " KB (kilobytes) ".
Last data slice content size=streaming media resource size obtains remainder divided by 8
III, node integration capability value
Registrar is monitored the adding of node in the program request network; When node wants to add the program request network; Registrar with this node join the nearest super node of network distance place bunch in; Safeguarded the integration capability value of this node and this node of initialization simultaneously by this super node, node integration capability value computing formula is following:
Node integration capability value=α * node central processing unit computing capability+β * node memory size+γ * meshed network bandwidth+ψ * node line duration
Wherein: the unit of node central processing unit computing capability is " gigahertz ", and the unit of node memory size is " GB ", and the unit of meshed network bandwidth is " hundred Mbytes ", the unit of node line duration be " hour "; α, beta, gamma, ψ are weight coefficients; Represent their shared weights in node integration capability value, their initialization classification is: α=0.3, β=0.2, γ=0.3; ψ=0.2, and alpha+beta+γ+ψ=1, the initialization integration capability value of super node is 100.
IV, node donut routing table
When node joins the program request network; The super node of being safeguarded needs initialization node donut routing table; Node donut routing table is a list structure; 20 nodal informations are deposited in each unit of chained list, and wherein nodal information comprises: node IP address, service port number, streaming media resource store path.I unit deposited with this node program request distance and is the nodal information of (i-1) * 5 to i * 5 in the chained list, and the program request distance is meant the absolute value of service node reproduction time and the difference of requesting node between sowing time, and its computing formula is following:
Program request distance=service node reproduction time-requesting node is between sowing time between requesting node and the service node
Wherein: the unit of program request distance is " second " between requesting node and the service node, if the streaming media resource that streaming media resource that service node is play and requesting node are broadcast is not same, the program request distance is infinitely great between requesting node and the service node so.
V, node prestige parameter
Requesting node finds service node and after it sent the streaming media service request, service node need provide corresponding streaming media service for it according to the service quality value of requesting node, and node prestige parameter comprises following six:
(1) node identifier: be used for each node of unique identification program request network, the node identifier initialization value is a node IP address.
(2) node provides the service sum: the streaming media service sum that node provided for other nodes in whole life cycle, it is 0 that node provides the total initialization value of service.
(3) node is accepted the service sum: node is accepted the streaming media service sum of other nodes in whole life cycle, it is 0 that node is accepted the total initialization value of service.
(4) node is uploaded the stream medium data amount: it is 0 that the stream medium data total amount that node provided for other nodes in life cycle, node are uploaded stream medium data amount initialization value.
(5) node download stream media data amount: the stream medium data piece total amount that node was accepted in life cycle, node download stream media data amount initialization value is 0.
(6) node value of feedback: after a streaming media service was accomplished, if requesting node, this value was the satisfied value of feedback of request to the streaming media service of service node completion; If service node, this value is a service node to the evaluation value of feedback of the streaming media service of self accomplishing.The initialization value of value of feedback is 0.5.
VI, node service quality value
Each node all has a service quality value to weigh its contribution to the program request network, and the service quality value of node is relevant with the behavior of node in life cycle.The high more expression node of node service quality value is big more to the contribution margin of network, and just its streaming media resource of uploading is many more; Otherwise the streaming media resource that it is uploaded is few more.When node added the program request network for the first time, its initialization service quality value was 0.5, and node p service quality value computing formula is following constantly at t:
Wherein: θ representes that the node service times accounts for the weight of node service quality value, and λ representes that node sends the weight that data volume accounts for the node service quality value, and θ and λ initialization value be respectively 0.5, θ+λ=1.At t constantly, node p service quality value span is following:
VII, node service response mode
When a streaming media service begins; Super node adopts the node service quality value computing formula of above-mentioned VI that the service quality of requesting node is assessed; And a result to requesting node assessment ruling feeds back to service node; Service node receives the ruling result of super node to requesting node, adopts following three kinds of response modes that requesting node is served:
(1) normal response: if the requesting node service quality value in [0.5,1] interval, service node provides normal service to requesting node;
(2) limited response: if the requesting node service quality value [0.25,0.5) interval, service node provides limited service to requesting node;
(3) denial of service: if the requesting node service quality value [0,0.25) interval, service node refusal provides service to requesting node.
VIII, node consistency evaluation of estimate
After the streaming media service of requesting node and service node was accomplished, requesting node and service node need be assessed this service node streaming media service.Requesting node to service node this service assess, be called the requesting node satisfaction, its computing formula is exactly the node service quality value of above-mentioned VI; Service node is this time served self and is assessed, and is called the service node evaluation of estimate, and its computing formula is exactly the node service quality value of above-mentioned VI.The absolute value representation of the difference of satisfaction and evaluation of estimate is the service-conformance property evaluation of service node this time, and its reflection service node is the service quality of service this time, and the node consistency evaluation of estimate computing formula of service node is following:
Node consistency evaluation of estimate=| requesting node satisfaction-service node evaluation of estimate |.
A kind of peer-to-peer network streaming media on demand method for ensuring service quality of the present invention comprises node adding, resource lookup, service response, following four steps of feedback information:
(1) node adds step
New node adds in the program request network after certain bunch, if new node be bunch in preceding 5 nodes, then new node becomes super node, end node adds step; Otherwise bunch in search the most weak super node and the comparison of the integration capability value of its integration capability value and new node.If the integration capability value of new node is greater than the integration capability value of the most weak super node, then new node substitutes the most weak super node, and end node adds step; Otherwise registrar distributes a super node to safeguard new node, and super node duplicates its routing table in the routing table of new node simultaneously, the node prestige parameter of initialization new node, and end node adds step;
(2) resource lookup step
Requesting node is searched through its routing table or super node routing iinformation and is confirmed that the destination node process of holding its required stream medium data is: if 1. " destination node and requesting node in same bunch and bunch in the node number less than 100 "; Then super node becomes the query node near destination node, otherwise requesting node becomes the query node near destination node; 2. in the routing table of query node, search destination node; If in the routing table of query node, find destination node, then query node returns destination node and gives requesting node, ending resource finding step; Otherwise the node near destination node becomes query node; If the routing table of query node has not traveled through; Then continue in the routing table of query node, to search destination node; Routing table up to query node has not traveled through, and query node returns query failure message and gives requesting node, ending resource finding step;
(3) service response step
After requesting node finds destination node, to the required stream medium data of destination node request, after destination node is accepted service request information, to the service quality value of super node query requests node.Super node calculates the service quality value of requesting node according to node service quality value formula, then according to the service response mode of the service quality value ruling destination node of requesting node.If the service quality value of requesting node [0,0.25) interval, then super node is regarded as malicious node with it, super node is deleted it from the program request network, ruling service node refusal provides service to it; If the service quality value of requesting node [0.25,0.5) interval, then super node is regarded as the node of hitchhiking with it, super node ruling destination node provides limited service for it; If the service quality value of requesting node is in [0.5,1], then super node is regarded as normal node with it, and super node ruling destination node provides Priority Service for it;
(4) feedback information step
Destination node is that requesting node provides streaming media service to finish, and requesting node provides the destination node satisfaction of service this time, and destination node provides the service evaluation value of oneself this time, and super node calculates the destination node node consistency evaluation of estimate of service this time.If the node consistency of destination node service is estimated less than 0.5, then super node adds 1 with the value of feedback of destination node, otherwise super node keeps the value of feedback of destination node constant, the ending message feedback step.
A kind of peer-to-peer network streaming media on demand service quality that realizes said method guarantees system, comprises that the node that is linked in sequence adds module, resource lookup module, service response module and feedback information module.
Described node add module by new node add certain bunch of program request network, confirm new node whether can become this bunch super node, registrar assign a super node be responsible for safeguarding new node, super node duplicate its routing table in the new node routing table and the function of the node prestige parameter of initialization new node form.Node adds module and is responsible for a new node adding program request network, and assigns a super node to safeguard the routing table and the node prestige parameter thereof of new node through registrar.
Described resource lookup module by requesting node or super node become near search destination node in the query node of destination node, the routing table through the queries node, query node returns destination node or query failure message forms for the function of requesting node.The resource lookup module is responsible for requesting node and finds the destination node of holding required streaming media resource through query node, and gives requesting node through query node feedback destination node or query failure message.
Described service response module is that requesting node which kind of service, destination node be provided by ruling be requesting node provide the function of respective service form to the required stream medium data of destination node request, destination node to service quality value, the service quality value of super node computation requests node, the super node ruling destination node of super node query requests node by requesting node.It is the service which kind of type requesting node provides that the service response module is responsible for adopting which kind of service response mode through super node ruling destination node; And notify destination node final ruling service response mode through super node, so that destination node provides corresponding streaming media on demand service to request.
The function of the value of feedback that consistency evaluation of estimate of the evaluation of estimate of the satisfaction that described feedback information module is this time served by requesting node purpose of appraisals node, own this service of destination node assessment, the service this time of super node calculating destination node, super node renewal destination node are this time served is formed.The feedback information module is responsible for passing through super node and is calculated destination node consistency evaluation of estimate of service this time, and the service quality of coming the purpose of appraisals node to provide to requesting node is to supervise the streaming media on demand service quality that destination node provides to requesting node.
Based on above-mentioned design to program request network, streaming media resource data fragmentation, node donut routing table, node prestige parameter, node service quality value, node service response mode, node consistency evaluation of estimate, the treatment step of node adding module of the present invention, resource lookup module, service response module and feedback information module is following:
As shown in Figure 3, the first, node adds the treatment step of module
S301: beginning;
S302: new node adds certain bunch of program request network, desires some streaming media resource of program request, jumps to the S303 operation;
S303: if new node be bunch in preceding 5 nodes, then jump to the S304 operation; Otherwise jump to the S305 operation;
S304: new node becomes super node, jumps to the S309 operation;
S305: in this bunch, search the most weak super node, and calculate the integration capability value of this most weak super node and new node, jump to the S306 operation;
S306: if the integration capability value of new node greater than the integration capability value of the most weak super node, then jumps to the S307 operation; Otherwise jump to the S308 operation;
S307: new node substitutes the most weak super node, and preserves the nodal information that this most weak super node is safeguarded, jumps to the S309 operation;
S308: registrar distributes a super node to be responsible for safeguarding new node, and super node duplicates its routing table in the routing table of new node simultaneously, and the node prestige parameter of initialization new node jumps to the S309 operation;
S309: finish.
As shown in Figure 4, the second, the treatment step of resource lookup module
S401: beginning;
S402: requesting node program request streaming media resource, search the destination node of holding this streaming media resource, jump to the S403 operation;
S403: if destination node and requesting node in same bunch, then jump to the S404 operation; Otherwise jump to the S413 operation;
S404: if the node number of this bunch, then jumps to the S405 operation less than 100; Otherwise jump to the S406 operation;
S405: super node becomes near the query node of destination node, jumps to the S407 operation;
S406: requesting node becomes near the query node of destination node, jumps to the S407 operation;
S407: in the routing table of query node, search destination node, jump to the S408 operation;
S408:, then jump to the S409 operation if in the routing table of query node, find destination node; Otherwise jump to the S410 operation;
S409: query node returns destination node and gives requesting node, jumps to the S416 operation;
S410:, then jump to the S411 operation if the routing table of query node has not traveled through; Otherwise jump to the S412 operation;
S411: the node near destination node becomes query node, jumps to the S407 operation;
S412: query node returns query failure message and gives requesting node, jumps to the S416 operation;
S413: requesting node navigates to destination node place bunch through registrar, and in destination node place bunch, searches destination node, jumps to the S414 operation;
S414: if the node number at destination node place bunch then jumps to the S415 operation less than 100; Otherwise jump to the S406 operation;
S415: super node becomes near the query node of destination node, jumps to the S407 operation;
S416: finish.
As shown in Figure 5, the 3rd, the treatment step of service response module
S501: beginning;
S502: after requesting node finds destination node,, jump to the S503 operation to the required stream medium data of destination node request;
S503: after destination node is accepted service request information,, jump to the S504 operation to the service quality value of super node query requests node;
S504: super node calculates the service quality value of requesting node according to the node service quality value formula of above-mentioned VI, then according to the service quality value ruling destination node of requesting node for which kind of service it provides, jump to the S505 operation;
S505: if the service quality value of requesting node [0,0.25) interval, then super node is regarded as malicious node with it, super node is deleted it from the program request network, ruling service node refusal provides service to it, jumps to the S508 operation; Otherwise jump to the S506 operation;
S506: if the service quality value of requesting node [0.25,0.5) interval, then super node is regarded as the node of hitchhiking with it, super node ruling destination node provides limited service for it, jumps to S508 operation; Otherwise jump to the S507 operation;
S507: if the service quality value of requesting node in [0.5,1], then super node is regarded as normal node with it, super node ruling destination node provides normal service for it, jumps to S508 operation; Otherwise jump to the S509 operation;
S508: super node sends to destination node to the ruling result to requesting node, and destination node for requesting node provides corresponding service, jumps to the S509 operation according to this ruling result;
S509: finish.
As shown in Figure 6, the 4th, the treatment step of feedback information module
S601: beginning;
S602: destination node is that requesting node provides streaming media service to finish, and jumps to the S603 operation;
S603: requesting node purpose of appraisals node is the satisfaction of service this time, and the own evaluation of estimate of service this time of destination node assessment jumps to the S604 operation;
S604: super node calculates the destination node consistency evaluation of estimate of service this time through the node consistency evaluation of estimate computing formula of above-mentioned VIII, jumps to the S605 operation;
S605: if the node consistency evaluation of estimate of destination node service this time then jumps to the S606 operation less than 0.5; Otherwise jump to the S607 operation;
S606: requesting node is to this service satisfactory of destination node, and super node adds 1 with the value of feedback of destination node, jumps to the S608 operation;
S607: requesting node is dissatisfied to destination node service this time, and super node adds 0 with the value of feedback of destination node, jumps to the S608 operation;
S608: finish.
The present invention has overcome on the existing the Internet in the streaming media on demand service node ropy problem of streaming media resource order program service that behavior caused of " hitchhiking "; Have the service quality that improves streaming media resource order program service on the Internet, reduce the advantage of the time of querying node streaming media resource on the Internet.
Embodiment
The present invention will be described below in conjunction with accompanying drawing and embodiment, but be not to qualification of the present invention.
As shown in Figure 1 is the network topology structure figure of the present invention's a kind of peer-to-peer network streaming media on demand method for ensuring service quality and system, and it is made up of streaming media server, registrar, super node and ordinary node.
As shown in Figure 2 is the modular structure figure that a kind of peer-to-peer network streaming media on demand of the present invention service quality guarantees system; It comprises that the node that is linked in sequence adds module, resource lookup module, service response module and feedback information module, and wherein: node adds module and comprises that new node adds the program request network, confirms whether new node can become the routing table and the node prestige parameter processing capacity thereof of the super node of this bunch, selected super node initialization new node.The resource lookup module comprise requesting node through its routing table or super node routing iinformation search the destination node of holding required stream medium data, inquiry is returned destination node and is given the requesting node processing capacity.The service response module comprises that requesting node is that which kind of service, destination node are provided is that requesting node provides the respective service processing capacity by ruling to requesting node to the required stream medium data of destination node request, destination node to service quality value, the service quality value of super node computation requests node, the super node ruling destination node of super node query requests node.The feedback information module comprises that the satisfaction of requesting node purpose of appraisals node service this time, evaluation of estimate, the super node of own this service of destination node assessment calculate the consistency evaluation of estimate of destination node service this time, the super node renewal destination node value of feedback processing capacity of service this time.
Particularly, for execution mode of the present invention is described, suppose that at first current streaming media on demand network has 5000 nodes, has 10 streaming media resources.The ordinary node number of program request streaming media resource S is 500; There are 5 super nodes to safeguard 500 ordinary nodes; Streaming media resource is divided into a lot of data slice and it is numbered; Data slice is distributed in the program request network on each node, and the streaming media resource of node program request is to be that unit transmits with the data slice.
Be the description that new node p of the present invention adds the practical implementation process of program request streaming media resource S below, wherein the central processing unit computing capability of new node p is 2.1 " gigahertzs ", and memory size is 2 " GB "; The network bandwidth is 1 " hundred Mbytes "; Line duration be 3 " hour ", α=0.3, β=0.2; γ=0.3, ψ=0.2.
Consult shown in Figure 3ly, first step: node adds module operation embodiment,
S301: beginning;
S302: new node p adds certain bunch of program request network, prepares some streaming media resource of program request, jumps to the S303 operation;
S303: since new node be not bunch in preceding 5 nodes, then jump to the S305 operation;
S305: calculate the integration capability value of new node p, integration capability value=2.1 * 0.3+2 * 0.2+1 * 0.3+3 * 0.2=1.93 of new node p find the most weak super node sp in this bunch, and its integration capability value is 100;
S306: the integration capability of new node p value 1.93 then jumps to the S308 operation less than the integration capability value 100 of the most weak super node sp;
S308: registrar distributes super node sp to be responsible for safeguarding new node p information; Super node sp duplicates its routing table in the donut routing table of new node p simultaneously, the node prestige parameter of initialization new node p, that is: and new node p node identifier is 202.193.75.8; It is 0 that new node p provides the service sum; It is 0 that new node p accepts the service sum, and it is 0 that new node p uploads the stream medium data amount, and new node p download stream media data amount is 0; New node p value of feedback is 0.5, jumps to the S309 operation;
S309: finish;
Consult shown in Figure 4, second step: resource lookup module operation embodiment,
S401: beginning;
S402: requesting node p program request streaming media resource S, requesting node p searches the destination node t that holds streaming media resource S, to bunch in super node sp search purposes node t, jump to S403 operation;
S403: destination node t and requesting node p then jump to the S404 operation in same bunch;
S404: the node number is 500 greater than 100 in this bunch, then jumps to the S406 operation;
S406: requesting node p becomes near the query node of destination node, jumps to the S407 operation;
S407: in the routing table of query node (requesting node p), search destination node t, jump to the S408 operation;
S408: in the routing table of query node (requesting node p), search nearest node b, but node b is not destination node t recently, jumps to the S410 operation near destination node t;
S410: the routing table of query node (requesting node p) has not traveled through, and jumps to the S411 operation;
S411: recently node b is near the node of destination node t, so it becomes query node (node b recently), jumps to the S407 operation;
S407: in the routing table of query node (recently node b), find near the nearest node c of destination node t, node c still is not destination node t recently, jumps to the S410 operation;
S410: the routing table of query node (node b recently) has not traveled through, and jumps to the S411 operation;
S411: recently node c is near the node of destination node t, so it becomes query node (node c recently), jumps to the S407 operation;
S407: in the routing table of query node (node c recently), find destination node t, jump to the S409 operation;
S409: query node (node c recently) returns destination node t and gives requesting node b, jumps to the S416 operation;
S416: finish;
Consult shown in Figure 5, third step: service response module operation embodiment,
S501: beginning;
S502: after requesting node p finds destination node t, send services request, jump to the S503 operation to destination node t;
S503: after destination node t accepts service request information,, jump to the S504 operation to the service quality value of super node sp query requests node;
S504: super node sp is 0.5 (because requesting node p is the node that newly adds the program request network, so its service quality value is an initialization value 0.5) according to the service quality value that node service quality value formula calculates requesting node p, jumps to the S507 operation;
S507: the service quality value of requesting node p is 0.5, and super node sp is regarded as the normal node type with it, and super node ruling destination node provides normal service for it, jumps to the S508 operation;
S508: super node sp sends to destination node t to the ruling result to requesting node p, and destination node t provides normal service according to this ruling result for requesting node p; Jump to the S509 operation;
S509: finish;
Consult shown in Figure 6, the 4th step: feedback information module operation embodiment,
S601: beginning;
S602: destination node t finishes for requesting node p provides streaming media service, jumps to the S603 operation;
S603: requesting node p provides destination node t the satisfaction of service this time, and destination node t provides the service evaluation value of oneself this time, jumps to the S604 operation;
S604: super node sp calculates the node consistency evaluation of estimate of this destination node t service, and (θ and λ initialization value are respectively 0.5 to the node consistency
of destination node t service; See from the requesting node angle: the service times that requesting node obtains service node is 1; Requesting node knows that it is 0 that service node is accepted service times; Requesting node knows that it is 8KB that service node is uploaded data volume, and requesting node knows that service node data download amount is 0KB; See from the service node angle: it is 3 that service node provides service times, and it is 1 that service node is accepted service times, and it is 50KB that service node is uploaded data volume, and service node data download amount is 10KB), jump to the S605 operation;
Node consistency evaluation of estimate=0.208 of S605: destination node t service then jumps to the S606 operation less than 0.5;
S606: requesting node p is to this destination node t service satisfactory, and super node sp adds 1 with the value of feedback of destination node t, jumps to the S608 operation;
S608: finish.