Summary of the invention
The present invention proposes a kind of live dispatching patcher that is applied to peer-to-peer network, the operating mechanism of this system is: when client during to cache server request live data, cache server is divided into described client normal live client and postpones live client, cache server provides live data and organizes to normal live client and postpones live client and obtain live file from described normal live client, thereby has improved simultaneously the whole output bandwidth of network having reduced the server burden.For this reason, the present invention proposes following technical scheme:
A kind of live dispatching patcher that is applied to peer-to-peer network comprises at least: a GSLB dns server, and one or more cache server, one or more client, wherein,
The function of GSLB dns server is:
A1, be used for to receive the request of watching that client is sent;
A2, be used for reading the cache server node allocation strategy that pre-defines, according to this strategy the cache server node address of the best offered client, the user can be served fast,
Cache server has following function:
B1, be used for the live file of stored stream media;
B2, be used for to receive the request of watching that the GSLB dns server is transmitted;
B3, be used for after receiving client to watch request this client is divided into normal live client or postpone live client;
B4, be used for providing live file download service to normal live client;
B5, be used for tissue postpone live client after one period time of delay from described normal live client downloads live data,
Client has three functions:
C1, be used for sending the request of watching to the GSLB dns server;
C2, be used for downloading live file or from the live file of other client downloads from the live streaming media server;
C3, be used for providing the P2P download service to other client sections;
C4, be used for the live file of playing stream media.
The present invention further provides a kind of live dispatching method that is applied to peer-to-peer network and comprise following preferred steps:
A, client send the request of watching to the GSLB dns server among the CDN;
B, GSLB dns server are sent to cache server by one group of strategy that pre-defines with the request of this client;
After C, cache server are received client-requested, at first, this client is divided into normal live client or postpones live client, afterwards, to normal live client provide live file download service simultaneously the live client of control lag after one period time of delay from described normal live client downloads live data.
In above-mentioned arbitrary scheme preferably, above-mentioned client is a kind of or combination in smart mobile phone, desktop computer (Desktop), computer all-in-one machine, notebook computer, palmtop PC (PAD), panel computer, the embedded computer.
In above-mentioned arbitrary scheme preferably, above-mentioned client watches that request sends with the http form, and request content comprises direct broadcast band information and client ip address at least.
In above-mentioned arbitrary scheme preferably, thereby above-mentioned GSLB dns server draws position, client location by analyzing client ip information, and according to the client position with client-requested be sent to from client nearest and the lightest cache server of load.
In above-mentioned arbitrary scheme preferably, cache server is received after the request of client the zoning, geographical position according to client, and the client in part zone wherein is decided to be normal live client, and other zones then are decided to be and postpone live client.
In above-mentioned arbitrary scheme preferably, cache server is received and is pro rata distributed normal live client after the request of client or postpone live client.For example, distribute normal live number clients to account for 50% of total number clients, the live number clients of assignment latency accounts for 50% of total number clients.
In above-mentioned arbitrary scheme preferably, preferably write configuration file the time of delay of the live client of above-mentioned delay.
In above-mentioned arbitrary scheme preferably, cache server is by reading described configuration file and obtain delay time information and according to time of delay of the live client of delay time information control lag.
Embodiment
Embodiment 1
As shown in Figure 1, in the P2P network platform, the present invention relates to this relevant member and be: GSLB dns server, Caching Server, client.
The GSLB dns server is two-node cluster hot backup server and principal and subordinate each other.Caching Server is used for stored stream media form programme televised live data.Client is a desktop computer and PDA of a notebook computer and a smart mobile phone.In the present embodiment, exist three class entities to connect, be respectively the connection by Internet between desktop computer, notebook computer, PDA, the smart mobile phone, desktop computer, notebook computer, PDA, smart mobile phone are by the connection of Internet to the connection of Caching Server, Caching Server to the GSLB dns server.
In the present embodiment, above-mentioned desktop computer, notebook, PDA, smart mobile phone have sent the request of watching the CCTV5 TV programme to the GSLB dns server simultaneously, this request sends with the http form, and request content comprises direct broadcast band information and client ip address.This request preferred format is as follows: Get/Channel={ $ channelname}﹠amp; LocalIP={ $ iP}, wherein $ channelname} is channel designation, $ iP} is client ip address, and the request of above-mentioned 4 equipment is as follows:
Desktop computer, Get/Channel=" CCTV5 " ﹠amp; LocalIP=" 123.116.239.173 ";
Notebook, Get/Channel=" CCTV5 " ﹠amp; LocalIP=" 123.116.239.174 ";
PDA,?Get?/Channel=?"CCTV5"&LocalIP="?123.122.75.118";
Smart mobile phone, Get/Channel=" CCTV5 " ﹠amp; LocalIP=" 123.122.75.119 ".
The function of GSLB dns server is:
A1, be used for to receive the request of watching that client is sent;
A2, be used for reading the Caching Server node allocation strategy that pre-defines, according to this strategy best Caching Server node address offered client, the user can be served fast.The selected of optimal node can have multiple strategy, for example nearest, node load is the lightest, perhaps take into account nearest and node load the lightest.
In the present embodiment, the GSLB dns server is used for receiving the request of watching that above-mentioned 4 client devices send and reads wherein client ip address, the GSLB dns server is assert client geographical position and ISP by the IP database, assert through the GSLB dns server, it is CHINAUNICOM's Beijing Company that desktop computer is in Fengtai District, Beijing City ISP, it is CHINAUNICOM's Beijing Company that notebook is in Fengtai District, Beijing City ISP, it is CHINAUNICOM's Beijing Company that PDA is in Haidian District, Beijing City ISP, it is CHINAUNICOM's Beijing Company that smart mobile phone is in Haidian District, Beijing City ISP, and this GSLB dns server is assigned to 4 client-requested the Caching Server of Beijing CDN node afterwards.
Caching Server has following function:
B1, be used for the live file of stored stream media;
B2, be used for to receive the request of watching that the GSLB dns server is transmitted.
B3, be used for after receiving client to watch request this client is divided into normal live client or postpone live client.
B4, be used for providing live file download service to normal live client.
B5, be used for tissue postpone live client after one period time of delay from described normal live client downloads live data.
Described Caching Server receives after the request of client the zoning, geographical position according to client, and the client in part zone wherein is decided to be normal live client, and other zones then are decided to be and postpone live client.
In the present embodiment, Beijing CDN node is that many Caching Server work simultaneously, therefore adds and joins load equalizer, makes Caching Server group collaborative work.A Caching Server in the CDN node of Beijing receive above-mentioned client device that the GSLB dns server transmits watch request after, zoning, geographical position according to client, 2 equipment that will be in the Fengtai District, Beijing City are decided to be normal live client, 2 equipment that will be in the Haidian District, Beijing City are decided to be and postpone live client, be that notebook and desktop computer are normal live client, PDA and smart mobile phone are for postponing live client.Caching Server provides live file download service to notebook and desktop computer, and organizes PDA and smart mobile phone to download live data with the P2P downloading mode from notebook and desktop computer after 10 seconds.
Write configuration file the time of delay of the live client of above-mentioned delay, when needs optimize that P2P shares effect and when revising this delay time, a delay time that only needs to revise configuration file gets final product.In the present embodiment, this configuration file is the XML file, and this XML file preferred format is as follows:
<paras>
<lag>10</lag>
</paras>
Above-mentioned Caching Server is by reading described configuration file and obtain delay time information and according to time of delay of the live client of delay time information control lag.
Client has three functions:
B1, be used for sending the request of watching to the GSLB dns server;
B2, be used for downloading live file or from the live file of other client downloads from the live streaming media server;
B3, be used for providing the P2P download service to other client sections;
B4, be used for the live file of playing stream media.
In the present embodiment, notebook and desktop computer are used for downloading live file and providing the P2P download service to PDA and smart mobile phone from Caching Server; PDA and smart mobile phone are then downloaded live data with the P2P downloading mode from notebook and desktop computer.
Embodiment 2
Shown in figure-1, in the P2P network platform, the present invention relates to this relevant member and be: GSLB dns server, cache server (hereinafter to be referred as Caching Server), client.
The GSLB dns server is two-node cluster hot backup server and principal and subordinate each other.Caching Server is used for stored stream media form programme televised live data.Client is a desktop computer and PDA of a notebook computer and a smart mobile phone.In the present embodiment, exist three class entities to connect, be respectively the connection by Internet between desktop computer, notebook computer, PDA, the smart mobile phone, desktop computer, notebook computer, PDA, smart mobile phone are by the connection of Internet to the connection of Caching Server, Caching Server to the GSLB dns server.
In the present embodiment, above-mentioned desktop computer, notebook, PDA, smart mobile phone have sent the live request of watching of certain special interview with famous person to the GSLB dns server simultaneously, this request sends with the http form, and request content comprises direct broadcast band information and client ip address.This request preferred format is as follows: Get/Channel={ $ channelname}﹠amp; LocalIP={ $ iP}, wherein $ channelname} is channel designation, $ iP} is client ip address, and the request of above-mentioned 4 equipment is as follows:
Desktop computer, Get/Channel=" special interview with famous person direct broadcast band " ﹠amp; LocalIP=" 124.203.129.173 ";
Notebook, Get/Channel=" special interview with famous person direct broadcast band " ﹠amp; LocalIP=" 124.203.164.174 ";
PDA, Get/Channel=" special interview with famous person direct broadcast band " ﹠amp; LocalIP=" 124.203.170.118 ";
Smart mobile phone, Get/Channel=" special interview with famous person direct broadcast band " ﹠amp; LocalIP=" 124.203.178.119 ".
The function of GSLB dns server is:
A1, be used for to receive the request of watching that client is sent;
A2, be used for reading the Caching Server node allocation strategy that pre-defines, according to this strategy best Caching Server node address offered client, the user can be served fast.The selected of optimal node can have multiple strategy, for example nearest, node load is the lightest, perhaps take into account nearest and node load the lightest.
In the present embodiment, the GSLB dns server is used for receiving the request of watching that above-mentioned 4 client devices send and reads wherein client ip address, the GSLB dns server is assert client geographical position and ISP by the IP database, assert through the GSLB dns server, it is Beijing branch company of Tie Tong of China Mobile that desktop computer is in Pinggu district ISP, it is Beijing branch company of Tie Tong of China Mobile that notebook is in Chaoyang District, Beijing City ISP, it is Beijing branch company of Tie Tong of China Mobile that PDA is in Dongcheng District, Beijing during March ISP, it is Beijing branch company of Tie Tong of China Mobile that smart mobile phone is in Shijingshan District, Beijing ISP, this GSLB dns server is assigned to a Caching Server of Beijing CDN node with 4 client-requested afterwards, and the ISP of this Caching Server is Beijing branch company of Tie Tong of China Mobile.
Caching Server has following function:
B1, be used for the live file of stored stream media;
B2, be used for to receive the request of watching that the GSLB dns server is transmitted.
B3, be used for after receiving client to watch request this client is divided into normal live client or postpone live client.
B4, be used for providing live file download service to normal live client.
B5, be used for tissue postpone live client after one period time of delay from described normal live client downloads live data.
Described Caching Server receives and pro rata distributes normal live client after the request of client or postpone live client.For example, distribute normal live number clients to account for 50% of total number clients, the live number clients of assignment latency accounts for 50% of total number clients.
In the present embodiment, Beijing CDN node is that many Caching Server work simultaneously, therefore adds and joins load equalizer, makes Caching Server group collaborative work.Described Caching Server group is divided into Caching Server according to Beijing area ISP: the Caching Server of Beijing UNICOM, the Caching Server of Beijing Tie Tong etc.Above-mentioned Beijing CDN node load balancing device is distributed to the Caching Server of Beijing Tie Tong with the request of watching of the above-mentioned client device that the GSLB dns server is transmitted.Tie Tong Caching Server in Beijing is decided to be normal live client with 50% of above-mentioned client sum in proportion, and other are decided to be and postpone live client, and namely notebook and PDA are normal live client, and desktop computer and smart mobile phone are for postponing live client.Caching Server provides live file download service to notebook and PDA, and organizes desktop computer and smart mobile phone to download live data with the P2P downloading mode from notebook and PDA after 10 seconds.
Write configuration file the time of delay of the live client of above-mentioned delay, when needs optimize that P2P shares effect and when revising this delay time, a delay time that only needs to revise configuration file gets final product.In the present embodiment, this configuration file is the XML file, and this XML file preferred format is as follows:
<paras>
<lag>10</lag>
</paras>
Above-mentioned Caching Server is by reading described configuration file and obtain delay time information and according to time of delay of the live client of delay time information control lag.
Client has three functions:
B1, be used for sending the request of watching to the GSLB dns server;
B2, be used for downloading live file or from the live file of other client downloads from the live streaming media server;
B3, be used for providing the P2P download service to other client sections;
B4, be used for the live file of playing stream media.
In the present embodiment, notebook and PDA are used for downloading live file and providing the P2P download service to desktop computer and smart mobile phone from Caching Server; Desktop computer and smart mobile phone are then downloaded live data with the P2P downloading mode from notebook and PDA.
Mainly by the time of delay of the live client of control lag, the quantity of the live client of control lag has reached two purposes to the technical scheme that the present invention proposes, and the one,, reduced the server burden, the 2nd,, improved the whole output bandwidth of network.
It should be understood that, accompanying drawing of the present invention and elaboration are by simplifying, only described for being well understood to the requisite key element of the present invention, for the purpose of clear and concise, some key elements that in common calculation element, system and method, adopt have been omitted, after having read this specification, those skilled in the art are not difficult to find out these abridged key elements and effect in the present invention thereof.And one of ordinary skill in the art will appreciate that these abridged key elements are for realizing that the present invention also is hope and/or needs.It will be appreciated by those skilled in the art that, present invention includes each technical scheme of Direct function description in specification, also comprise the derivative schemes that is consisted of by these combinations of each technical scheme of Direct function description, even comprised the derivative schemes that the combination by each feature that consists of these each schemes of having described consists of.All improvement based on aim of the present invention all fall within protection scope of the present invention.
Those skilled in the art are not difficult to find out equally, the present invention is improvements over the prior art, it is the combination of these key elements of the prior art being carried out for the technical problem that exists in the solution prior art, this combination a large amount of creative work that condensed is the crystallization of a large amount of theoretical researches of inventor and scientific experiment.Before not reading the present invention, those skilled in the art obviously are not easy to expect each scheme of the present invention, and after having read this specification, those skilled in the art needn't pay creative work again can realize basic technical scheme of the present invention.