CN100558042C - A P2P live broadcast method based on super nodes - Google Patents
A P2P live broadcast method based on super nodes Download PDFInfo
- Publication number
- CN100558042C CN100558042C CNB2007100534297A CN200710053429A CN100558042C CN 100558042 C CN100558042 C CN 100558042C CN B2007100534297 A CNB2007100534297 A CN B2007100534297A CN 200710053429 A CN200710053429 A CN 200710053429A CN 100558042 C CN100558042 C CN 100558042C
- Authority
- CN
- China
- Prior art keywords
- node
- super
- nodes
- partnership
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 66
- 230000008569 process Effects 0.000 claims abstract description 39
- 238000005304 joining Methods 0.000 claims abstract description 32
- 230000005540 biological transmission Effects 0.000 abstract description 19
- 238000012423 maintenance Methods 0.000 abstract description 3
- 235000008694 Humulus lupulus Nutrition 0.000 abstract description 2
- 230000001934 delay Effects 0.000 abstract description 2
- 239000012634 fragment Substances 0.000 description 24
- 238000007726 management method Methods 0.000 description 15
- 238000005516 engineering process Methods 0.000 description 12
- 230000004044 response Effects 0.000 description 6
- 230000002159 abnormal effect Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000004083 survival effect Effects 0.000 description 5
- 238000009826 distribution Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005315 distribution function Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
本发明涉及一种基于超级节点的P2P直播方法,该方法包括:节点向服务器发送期望节目的节点加入请求信息,服务器处理所述节点加入请求消息完成所述节点加入流媒体直播网络;以及所述节点成功的加入到流媒体直播网络之后,所述节点选择与自己在物理上相近的其他节点建立伙伴关系,再进行数据的传输。因此,本发明使数据在底层物理网络上相近的普通节点之间进行传输,减少了数据转发过程中的跳数以及时延;又由于本发明采用了分层的系统架构,从而降低了主服务器负担,减少了带宽的消耗;同时本发明将节点的管理与数据的传输进行了分离,使维护更加容易。
The present invention relates to a P2P live broadcasting method based on a super node, the method comprising: a node sends a node joining request information of a desired program to a server, and the server processes the node joining request message to complete the joining of the node into a live streaming network; and the After a node successfully joins the live streaming network, the node chooses to establish a partnership with other nodes that are physically close to itself, and then transmits data. Therefore, the present invention enables data to be transmitted between similar common nodes on the underlying physical network, reducing the number of hops and time delays in the data forwarding process; burden, reducing bandwidth consumption; at the same time, the present invention separates node management from data transmission, making maintenance easier.
Description
技术领域 technical field
本发明涉及互联网通信领域,尤其涉及一种基于超级节点的对等网络(peer to peer,P2P)直播方法,以实现实时媒体传输。The invention relates to the field of Internet communication, in particular to a peer-to-peer (P2P) live broadcast method based on super nodes to realize real-time media transmission.
背景技术 Background technique
流媒体技术是一种用流式传输方式在互联网上播放音频、视频等多媒体数据的技术,用户可以边下载边观看,不需要将整个文件下载之后再观看。流媒体技术最初采取的是传统的客户端/服务器(C/S)模式,多媒体数据存放在服务器上,任何客户端想要获得媒体数据,都必须从服务器上获得一份完整的拷贝。在这种模式中服务器必须给每个用户都发送一份完全一样的数据,随着用户增加,向大量用户发送庞大的多媒体数据会使服务器不堪重负,造成服务器端的拥塞。Streaming media technology is a technology that uses streaming to play audio, video and other multimedia data on the Internet. Users can watch while downloading, without downloading the entire file before watching. What stream media technology adopts at first is traditional client/server (C/S) mode, and multimedia data is stored on the server, and any client wants to obtain media data, must obtain a complete copy from server. In this mode, the server must send exactly the same data to each user. As the number of users increases, sending huge multimedia data to a large number of users will overwhelm the server and cause server-side congestion.
为了缓解传统的C/S模式中服务器的压力,代理服务器技术被应用于网络媒体发布中。代理服务器将一些频繁访问的数据存储在本地存储器中,当用户通过代理服务器访问时,如果代理服务器的缓存中有用户需要的数据,就无需访问远程的服务器,只通过本机的缓存为用户服务。代理服务器分担了一部分用户访问,有效的降低了主服务器的压力,可以提高用户的响应速度,并且可以节省网络资源。但是代理服务器的部署会增加媒体发布的硬件成本,保持代理缓存中的内容和主服务器内容的同步也是一个难题。In order to alleviate the pressure on the server in the traditional C/S mode, proxy server technology is applied to network media publishing. The proxy server stores some frequently accessed data in the local storage. When the user accesses through the proxy server, if the cache of the proxy server has the data the user needs, there is no need to access the remote server, and only the local cache serves the user. . The proxy server shares part of user access, effectively reducing the pressure on the main server, improving user response speed, and saving network resources. However, the deployment of proxy servers will increase the hardware cost of media publishing, and it is also a difficult problem to keep the content in the proxy cache and the content of the main server synchronized.
内容发布网络(Content Distribution Network,CDN)是一个建立在互联网之上由分布在不同区域的节点服务器群组成的虚拟网络。CDN的核心思想是将内容从中心推到边缘靠近用户的地方,这样不但有效提高了用户的访问内容的性能,而且有效减轻了中心设备和骨干网络的压力。通过CDN,可以将内容服务从原来的单一中心结构变为分布式的结构。CDN系统有效的解决了代理服务器技术中代理缓存和主服务器间的内容同步问题。但是CDN仍旧是基于C/S结构的分布式媒体服务技术平台,跟地域化管制紧密相连,因此很难降低其扩展的成本,CDN技术在高峰时期对突发流量的适应性、容错性方面仍然存在着一定缺陷,如流媒体服务器带宽占用大,服务器处理能力要求高等。Content Distribution Network (CDN) is a virtual network built on the Internet and composed of node server groups distributed in different regions. The core idea of CDN is to push the content from the center to the edge close to the user, which not only effectively improves the performance of the user's access to content, but also effectively reduces the pressure on the central equipment and the backbone network. Through CDN, the content service can be changed from the original single center structure to a distributed structure. The CDN system effectively solves the content synchronization problem between the proxy cache and the main server in the proxy server technology. However, CDN is still a distributed media service technology platform based on C/S structure, which is closely connected with regional control, so it is difficult to reduce the cost of its expansion. The adaptability and fault tolerance of CDN technology to burst traffic during peak periods are still There are certain defects, such as the bandwidth of the streaming media server is large, and the processing capacity of the server is high.
以上的技术都是在C/S的基本结构上进行发展的,所以不能避免服务器本身带来的系统瓶颈与单点故障的问题。为了解决传统的C/S结构存在的问题,P2P技术得到了广泛的发展,在P2P系统当中不再像传统的C/S结构那样只有服务器来提供数据供用户下载,用户在下载的同时也可以为其他用户提供服务,而且在现实应用当中更多的数据是在用户之间进行传输。随着BT为代表的P2P下载技术流行,P2P技术越来越被人们所关注。The above technologies are all developed on the basic structure of C/S, so the problems of system bottleneck and single point of failure caused by the server itself cannot be avoided. In order to solve the problems existing in the traditional C/S structure, P2P technology has been widely developed. In the P2P system, it is no longer like the traditional C/S structure that only the server provides data for users to download. Users can also download data while downloading. Provide services to other users, and in real applications more data is transmitted between users. With the popularity of P2P downloading technology represented by BT, P2P technology has attracted more and more attention.
但是现有的P2P流媒体技术中没有考虑到覆盖网络和底层物理网络的拓扑匹配问题,节点之间在逻辑的覆盖网络当中很相近,但是很可能在物理网络中相差很远,这样对于延时和传输的速度会较大的影响,用户得到的服务质量不能得到有效的保证,同时系统中的服务器除了进行媒体数据的分发外还要对整个系统进行控制管理,有些系统专门提供了控制管理服务器,但是这样又增加了硬件的投入成本。However, the existing P2P streaming media technology does not consider the topology matching between the overlay network and the underlying physical network. The nodes are very similar in the logical overlay network, but they may be far apart in the physical network. and the speed of transmission will be greatly affected, and the quality of service obtained by users cannot be effectively guaranteed. At the same time, the server in the system must also control and manage the entire system in addition to distributing media data. Some systems specifically provide control and management servers. , but this increases the input cost of hardware.
发明内容 Contents of the invention
本发明的目的是为了解决现有技术中存在的覆盖网络和底层物理网络的拓扑匹配问题,提供了一种基于超级节点的P2P直播方法。The purpose of the present invention is to provide a P2P live broadcast method based on super nodes in order to solve the topology matching problem of the overlay network and the underlying physical network in the prior art.
为了实现上述目的,本发明提供了一种基于超级节点的P2P直播方法,该方法包括:In order to achieve the above object, the present invention provides a P2P live broadcast method based on super nodes, the method comprising:
节点向服务器发送期望节目的节点加入请求信息,服务器根据节点加入请求信息中所述节点要观看的节目,到节目列表中去匹配超级节点;The node sends the node joining request information of the desired program to the server, and the server goes to the program list to match the super node according to the program that the node wants to watch in the node joining request information;
所述匹配超级节点的过程为:将所述节点的标志值与服务器列表中的超级节点的标志值进行比较,如果相同,则节点与该超级节点处于同一个物理网络中或者在物理上相近完成匹配;The process of matching the super node is: compare the flag value of the node with the flag value of the super node in the server list, if they are the same, the node and the super node are in the same physical network or are physically close to each other match;
服务器将匹配成功的所述超级节点的信息返回给所述节点,所述节点根据所述超级节点的信息,向所述超级节点发送所述节点加入请求消息,所述超级节点响应该节点加入请求消息以将所述节点作为普通节点加入流媒体直播网络,并向所述节点返回所管理的普通节点的信息;以及The server returns the information of the successfully matched super node to the node, and the node sends the node joining request message to the super node according to the information of the super node, and the super node responds to the node joining request Message to join the live streaming network with the node as a normal node, and return the information of the managed normal node to the node; and
所述节点成功的加入到流媒体直播网络之后,所述节点选择与自己在物理上相近的其他节点建立伙伴关系,再进行数据的传输。After the node successfully joins the live streaming network, the node chooses to establish a partnership with other nodes that are physically close to itself, and then transmits data.
进一步地,基于超级节点的P2P直播方法还包括:所述节点退出所述流媒体直播网络。Further, the super node-based P2P live broadcast method further includes: the node withdraws from the streaming media live broadcast network.
进一步地,所述节点选择与自己在物理上相近的其他节点建立伙伴关系的过程具体为:Further, the process for the node to choose to establish a partnership with other nodes that are physically close to itself is specifically as follows:
所述节点向超级节点发送建立伙伴关系请求;The node sends a partnership establishment request to the super node;
超级节点根据所述建立伙伴关系请求返回自己的伙伴信息;The super node returns its own partner information according to the partnership establishment request;
所述节点收到超级节点返回的伙伴信息后,从中选择与自己在物理上相近的节点并请求作为其伙伴;After the node receives the partner information returned by the super node, it selects a node that is physically close to itself and requests to be its partner;
被请求节点判断有足够的带宽并且负载没有超过限定值,则与请求节点建立伙伴关系。If the requested node judges that there is enough bandwidth and the load does not exceed the limit value, it will establish a partnership with the requesting node.
进一步地,在所述节点向超级节点发送建立伙伴关系请求和超级节点根据所述建立伙伴关系请求返回自己的伙伴信息之间还包括:Further, between the node sending a partnership establishment request to the super node and the super node returning its own partner information according to the partnership establishment request:
当超级节点收到建立伙伴关系的请求后,判断与所述节点建立伙伴关系后负载没有超过限定值,并且可用带宽满足所述节点的需求,则和所述节点建立伙伴关系。When the supernode receives the request to establish a partnership relationship, it determines that the load does not exceed the limit value after establishing a partnership relationship with the node, and the available bandwidth meets the requirements of the node, and then establishes a partnership relationship with the node.
进一步地,在所述被请求节点判断有足够的带宽并且负载没有超过限定值,与请求节点建立伙伴关系之后还包括以下步骤:Further, after the requested node judges that there is sufficient bandwidth and the load does not exceed a limit value, and establishes a partnership with the requesting node, the following steps are also included:
所述节点判断自己的伙伴数目是否足以满足自己的需求,如果伙伴的数目仍然比较小,所述节点向与自己之间延时小的节点发送建立伙伴关系请求,建立伙伴关系列表。The node judges whether the number of its own partners is sufficient to meet its own needs. If the number of partners is still relatively small, the node sends a request to establish a partnership relationship with a node with a small delay between itself and itself, and establishes a partnership list.
进一步地,所述节点退出所述流媒体直播网络的过程包括以下步骤:Further, the process of the node withdrawing from the live streaming network includes the following steps:
所述节点向其伙伴和其所属的超级节点发送离开消息,通知所述伙伴和所述超级节点将要离开所述流媒体直播网络;The node sends a leaving message to its partner and the super node to which it belongs, notifying the partner and the super node that it will leave the live streaming network;
所述伙伴收到所述离开消息后将所述节点的信息从伙伴列表中删除,所述超级节点收到所述离开消息后,将所述节点的信息从管理的节点列表当中删除,同时通知管理下的其他普通节点以便更新它们的节点列表。The partner deletes the information of the node from the partner list after receiving the leaving message, and the super node deletes the information of the node from the managed node list after receiving the leaving message, and simultaneously notifies Other normal nodes under management in order to update their node lists.
进一步地,所述服务器处理所述节点加入请求消息完成所述节点加入流媒体直播网络具体为:Further, the server processes the node joining request message to complete the node joining the streaming media live network specifically as follows:
服务器将所述节点作为超级节点加入到超级节点列表中,并通知所述节点以超级节点的身份加入流媒体直播网络;以及The server adds the node as a super node to the list of super nodes, and notifies the node to join the live streaming network as a super node; and
所述节点以超级节点的身份加入的流媒体直播网络中。The node joins the live streaming network as a super node.
进一步地,所述节点选择与自己在物理上相近的其他节点建立伙伴关系的过程具体为:Further, the process for the node to choose to establish a partnership with other nodes that are physically close to itself is specifically as follows:
当所述节点作为超级节点时,所述超级节点将自己所管理的普通节点中可用带宽较大并且性能好的节点加入到自己的伙伴列表中,与之建立伙伴关系。When the node acts as a super node, the super node will add the node with larger available bandwidth and better performance among the ordinary nodes it manages to its partner list, and establish a partnership with it.
进一步地,所述节点选择与自己在物理上相近的其他节点建立伙伴关系的过程具体为:Further, the process for the node to choose to establish a partnership with other nodes that are physically close to itself is specifically as follows:
当所述节点作为超级节点时,所述超级节点向网络中的节点请求建立伙伴关系;When the node acts as a super node, the super node requests the nodes in the network to establish a partnership;
被请求节点判断自己的负载没有超过限定值,且带宽比较充足,和超级节点建立伙伴关系;The requested node judges that its load does not exceed the limit value, and the bandwidth is relatively sufficient, and establishes a partnership with the super node;
被请求节点将已经与自己建立伙伴关系的信息返回给超级节点;The requested node returns the information that it has established a partnership with itself to the super node;
所述超级节点从返回的信息中选择与自己之间延时小的节点发送建立伙伴关系的请求,建立伙伴关系列表。From the returned information, the super node selects a node with a small delay between itself and itself to send a request for establishing a partnership relationship, and establishes a partnership list.
进一步地,所述超级节点退出所述流媒体直播网络的过程包括以下步骤:Further, the process of the super node withdrawing from the live streaming network includes the following steps:
所述超级节点向其伙伴和服务器发送离开消息,通知伙伴和服务器自己将要离开网络,所述伙伴收到所述离开消息后将所述超级节点的信息从伙伴列表中删除,服务器收到所述离开消息后,在该超级节点管理下的普通节点列表中选取一个性能好的作为新的超级节点;The super node sends a leave message to its partner and server to notify the partner and server that it will leave the network, the partner deletes the information of the super node from the partner list after receiving the leave message, and the server receives the After leaving the message, select one with good performance as the new super node from the list of ordinary nodes under the management of the super node;
服务器将其他普通节点的信息发送给新的超级节点以使其来构建节点列表;The server sends the information of other ordinary nodes to the new super node so that it can build the node list;
所述超级节点向所述普通节点发送通知消息通知它们由新的超级节点来管理;The super node sends a notification message to the normal nodes informing them that they are managed by a new super node;
普通节点根据所述通知消息更新自己节点列表当中的超级节点信息。Ordinary nodes update the super node information in their own node list according to the notification message.
本发明采用了服务器与超级节点两层管理模式,充分的利用了客户端的性能,尽量使数据在底层物理网络上相近的普通节点之间进行传输,降低了服务器与超级节点的负担,减少了带宽的消耗,同时本发明将节点的管理与数据的传输进行了分离,使维护更加容易。本发明中超级节点与普通节点都只需要管理那些自己需要的节点信息,并能够很好的动态的适应网络的变化,具有良好的可扩展性。The present invention adopts the two-layer management mode of the server and the super node, fully utilizes the performance of the client, and tries to transmit the data between common nodes that are close to each other on the underlying physical network, reducing the burden on the server and the super node, and reducing the bandwidth consumption, and at the same time, the present invention separates node management from data transmission, making maintenance easier. In the present invention, both super nodes and ordinary nodes only need to manage the node information they need, and can dynamically adapt to changes in the network, and have good scalability.
附图说明 Description of drawings
图1为本发明基于超级节点的P2P直播方法所使用的P2P直播系统的结构图;Fig. 1 is the structural diagram of the P2P live broadcast system that the present invention is based on the P2P live broadcast method of super node;
图2为本发明基于超级节点的P2P直播方法的流程图;Fig. 2 is the flowchart of the P2P live broadcasting method based on the super node of the present invention;
图3为详细介绍节点加入阶段的两种情况的流程图;Fig. 3 is the flow chart that introduces two kinds of situations of node joining stage in detail;
图4为描述超级节点与普通节点建立伙伴关系的过程;Figure 4 is a description of the process of establishing a partnership between a super node and an ordinary node;
图5为节点与伙伴节点之间的数据传输流程图。Fig. 5 is a flow chart of data transmission between a node and a partner node.
具体实施方式 Detailed ways
如图1所示为本发明基于超级节点的P2P直播方法所使用的P2P直播系统,本发明的P2P直播系统是由服务器1,超级节点2(Super Node,SN)和普通节点3(Ordinary Node,ON)组成的三层体系结构。其中,如图所示普通节点3可以为位于局域网内。As shown in Figure 1, it is the P2P live broadcast system used by the P2P live broadcast method based on super nodes in the present invention, the P2P live broadcast system of the present invention is composed of
服务器1主要完成媒体数据的分发,管理超级节点2,处理新节点的请求信息功能。数据分发对视频流媒体数据进行分段处理,并记录相关的分段信息,将流媒体数据传输给请求的节点。管理超级节点包括与超级节点进行通信和对超级节点列表进行管理,服务器维护一个超级节点列表,这个列表首先根据节点观看的节目对节点进行分类,对于观看同一个节目的节点再根据在网络上所处的物理位置将节点进行分类,将那些性能好的节点设为超级节点,每个超级节点管理那些在物理位置上与它相近的普通节点。服务器动态的管理这个列表,会定期的根据节点的性能从所有的节点当中选取超级节点进行替换,根据节点的加入退出动态的更新超级节点列表并维护所有节点的信息。服务器会根据自己的负载情况进行负载控制使自己的负载不会过重,从而有效的为系统提供服务。对于新加入节点的请求,服务器会根据节点所观看的节目以及所处的地理位置进行匹配,向新节点返回一个匹配的超级节点,通知其向返回的超级节点请求加入该超级节点管理的覆盖网络当中去。如果没能匹配的超级节点,服务器会通知其以超级节点的身份加入到网络当中。The
超级节点2主要完成数据传输,管理普通节点3,伙伴列表管理,新节点加入请求信息的处理功能。数据传输与服务器的数据分发功能类似,不同的是超级节点除了向其他节点提供数据传输外也像普通的客户端一样进行数据的下载进行播放。超级节点维护两个表,一个是自己管理的普通节点列表,一个是伙伴列表,伙伴是指那些与自己观看同一个节目并与自己进行数据交换的节点。对于普通节点列表超级节点会根据节点的加入退出等操作动态的进行更新并将这些更新信息通知给服务器以便服务器进行节点列表的更新。对于伙伴列表超级节点也会在必要的时候对其进行更新,比如说在一定的时间段内没有找到需要的某个数据段,这时会认为自己的伙伴节点当中没有自己所请求的数据,这时就需要进行伙伴列表的更新。当有新的节点向超级节点发出请求时,超级节点会将节点的相关信息加入到自己的列表当中,通知请求节点以普通节点身份加入自己管理的覆盖网络。The super node 2 mainly completes the data transmission, manages the ordinary node 3, manages the partner list, and processes the request information for new nodes. Data transmission is similar to the data distribution function of the server, the difference is that supernodes, in addition to providing data transmission to other nodes, also download and play data like ordinary clients. A super node maintains two tables, one is a list of ordinary nodes managed by itself, and the other is a list of partners. Partners refer to those nodes that watch the same program as themselves and exchange data with themselves. For the ordinary node list, the super node will dynamically update according to the node's joining and exiting operations, and notify the server of the update information so that the server can update the node list. The super node will also update the partner list when necessary. For example, if it does not find a certain data segment within a certain period of time, it will think that its partner node does not have the data it requested. It is necessary to update the partner list. When a new node sends a request to the super node, the super node will add the relevant information of the node to its own list, and notify the requesting node to join the overlay network managed by itself as a normal node.
普通节点3主要完成数据传输,伙伴节点列表管理功能,通信管理功能。其中数据传输和伙伴节点列表的管理功能与超级节点类似。通信管理主要是和超级节点进行通信,通知超级节点一些更新信息。P2P网络当中的节点的加入与离开是相当的频繁的,为了保证节点确实是存在网络当中的,每个普通节点都会定期的向超级节点发送自己的存活信息,当节点正常离开时也会向超级节点发送离开网络的信息,使超级节点能够及时的更新节点列表对节点进行有效的管理。Common node 3 mainly completes data transmission, partner node list management functions, and communication management functions. Among them, the management functions of data transmission and partner node list are similar to those of super nodes. Communication management is mainly to communicate with the super node and notify the super node of some update information. The joining and leaving of nodes in the P2P network is quite frequent. In order to ensure that the nodes do exist in the network, each ordinary node will regularly send its own survival information to the super node. The node sends the information of leaving the network, so that the super node can update the node list in time to manage the node effectively.
如图2所示为本发明基于超级节点的P2P直播方法的流程图。如图所示该方法包括步骤10:节点向服务器发送期望节目的节点加入请求信息,服务器处理所述节点加入请求消息完成所述节点加入流媒体直播网络;以及步骤20:所述节点成功的加入到流媒体直播网络之后,所述节点选择与自己在物理上相近的其他节点建立伙伴关系,再进行数据的传输。FIG. 2 is a flow chart of the super node-based P2P live broadcast method of the present invention. As shown in the figure, the method includes step 10: the node sends the node joining request information of the desired program to the server, and the server processes the node joining request message to complete the joining of the node into the streaming media live broadcast network; and step 20: the successful joining of the node After arriving at the live streaming network, the node chooses to establish a partnership with other nodes that are physically close to itself, and then transmits data.
即该基于超级节点的P2P直播方法首先可分为三个阶段,第一阶段为节点加入阶段即步骤10所示的内容,该节点加入阶段包括两种情况,一种为服务器根据节点加入请求信息中所述节点要观看的节目,到节目列表中去匹配超级节点;服务器将匹配成功的所述超级节点的信息返回给所述节点,所述节点根据所述超级节点的信息,向所述超级节点发送所述节点加入请求消息,所述超级节点响应该节点加入请求消息以将所述节点作为普通节点加入流媒体直播网络,并向所述节点返回所管理的普通节点的信息。另一种为:服务器将所述节点作为超级节点加入到超级节点列表中,并通知所述节点以超级节点的身份加入流媒体直播网络;以及所述节点以超级节点的身份加入的流媒体直播网络中。第二阶段为伙伴关系建立阶段,第三阶段为数据传输阶段。第二阶段和第三阶段即步骤20所示内容。That is, the P2P live broadcast method based on super nodes can be divided into three stages at first. The first stage is the node joining stage, which is the content shown in
具体参见图3,下面详细介绍节点加入阶段的两种情况。如图所示,Referring to FIG. 3 for details, two situations in the node joining phase are introduced in detail below. as the picture shows,
步骤301:节点向服务器发送节点加入请求信息;Step 301: the node sends node joining request information to the server;
请求信息的内容包括请求节点的IP地址、监听的端口号、节点的hashID值、节点的带宽、处理器速度、内存、节点请求的节目。其中节点的hash ID值是由IP地和端口通过hash算法计算出来的,用来唯一标识节点,节点的带宽,处理器速度和内存用来计算节点的性能。The content of the request information includes the IP address of the requesting node, the listening port number, the hashID value of the node, the bandwidth of the node, the speed of the processor, the memory, and the program requested by the node. Among them, the hash ID value of the node is calculated by the IP address and port through the hash algorithm, which is used to uniquely identify the node, and the bandwidth, processor speed and memory of the node are used to calculate the performance of the node.
步骤302:与超级节点的匹配;Step 302: matching with super nodes;
服务器根据节点要观看的节目到相应的节目列表当中去匹配超级节点,全球互联网根据网络服务提供商信息和地理信息分为多个层次,分别表示ISP,城市、小区(或者高校),建筑。这些信息可以从免费的或者商用的IP地址到网络位置信息的转换数据库中得到,根据得到的这些信息为每个节点产生网络一个位置标志值,这个标志值的长度为40位,其中0~15位表示公网和高校编号,16~31位表示城市编号,32~39位表示ISP编号。匹配过程具体是用请求节点的标志值与服务器列表当中超级节点的标志值进行比较,如果相同则认为请求节点与该超级节点在同一个物理网络中或者说在物理上它们是相近的。如果匹配成功则转步骤303,否则执行步骤307;The server matches the super node with the corresponding program list according to the program the node wants to watch. The global Internet is divided into multiple levels according to the network service provider information and geographic information, respectively representing ISP, city, community (or university), and building. These information can be obtained from the free or commercial IP address to network location information conversion database. According to the obtained information, a network location flag value is generated for each node. The length of this flag value is 40 bits, of which 0 to 15 The 16th to 31st digits represent the city code, and the 32nd to 39th digits represent the ISP number. The matching process is to compare the flag value of the request node with the flag value of the super node in the server list. If they are the same, it is considered that the request node and the super node are in the same physical network or they are physically close. If the matching is successful, go to step 303, otherwise execute
步骤303:返回匹配的超级节点信息;Step 303: return the matching super node information;
服务器将匹配成功的超级节点信息返回给发起请求的节点,返回的信息中包括超级节点的hash ID值,IP地址,监听端口等。同时服务器将请求节点的信息加入到服务器中的该超级节点列表中。The server will return the successfully matched super node information to the requesting node. The returned information includes the super node's hash ID value, IP address, listening port, etc. At the same time, the server adds the information of the request node to the super node list in the server.
步骤304:节点向超级节点发送节点加入请求消息;Step 304: the node sends a node joining request message to the super node;
请求节点从服务器返回的超级节点的信息当中取到超级节点的IP地址与端口号,向这个超级节点发送请求消息,消息的内容与向服务器发送的请求一样。The requesting node obtains the IP address and port number of the super node from the super node information returned by the server, and sends a request message to the super node, and the content of the message is the same as that sent to the server.
步骤305:超级节点处理请求:Step 305: the super node processes the request:
超级节点判断节点所处的网络环境,如果检测到请求节点是处于公网即步骤3051:是否处于防火墙后,如是处于公网,则执行步骤3053:超级节点将发起请求的节点信息加入到自己的节点列表中,否则节点是处于防火墙后的节点,执行步骤3052:超级节点通知其进行NAT穿越,打开相关的服务端口,判断NAT穿越是否成功,如果成功穿越,则执行步骤3053,超级节点将发起请求的请求节点的信息加入到自己的节点列表当中,否则执行步骤3054,拒绝请求节点加入,加入失败。The super node judges the network environment where the node is located. If it detects that the requesting node is in the public network, that is, step 3051: whether it is behind a firewall, if it is in the public network, then perform step 3053: the super node adds the node information that initiated the request to its own In the node list, otherwise the node is a node behind the firewall, execute step 3052: the supernode notifies it to perform NAT traversal, opens the relevant service port, and judges whether the NAT traversal is successful, if successful, then executes
步骤306:返回普通节点信息;Step 306: return common node information;
超级节点向发起请求的节点返回它所管理的普通节点的信息,这些普通节点的信息为以后建立伙伴关系做准备,请求节点以普通节点的身份加入的网络中去,执行步骤309;The super node returns the information of the ordinary nodes it manages to the requesting node, and the information of these ordinary nodes is in preparation for establishing a partnership in the future, and the requesting node joins the network as an ordinary node, and executes
步骤307:服务器将请求节点作为超级节点加入到超级节点列表中,通知请求节点以超级节点的身份加入网络;Step 307: the server adds the requesting node as a super node to the list of super nodes, and notifies the requesting node to join the network as a super node;
步骤308:请求节点以超级节点的身份加入的网络中;Step 308: requesting the node to join the network as a super node;
步骤309:加入过程结束。Step 309: the joining process ends.
在最开始的时候,网络中只有服务器,当第一个节点请求加入网络时,服务器会根据节点请求的节目将该节点作为超级节点加入到节点列表当中,并通知节点以超级节点身份加入到网络,这时候媒体数据只有在服务器与这个节点之间进行传输。对于以后的新节点的加入过程都是一样的。At the beginning, there is only a server in the network. When the first node requests to join the network, the server will add the node as a super node to the node list according to the program requested by the node, and notify the node to join the network as a super node , at this time, the media data can only be transmitted between the server and this node. The process of joining new nodes in the future is the same.
下面介绍该P2P直播方法的第二阶段-伙伴关系建立阶段:The second phase of this P2P live broadcast method - the partnership establishment phase - is described below:
当节点成功的加入到网络之后,节点需要先建立伙伴关系再进行数据的传输。所谓的伙伴是指那与自己观看相同的节目的并且愿意与自己进行数据交换的节点,在本发明中节点不是与网络中所有的观看同一个节目的节点建立伙伴关系,因为网络的规模很大,网络中观看同一个节目的节点很多,一个节点并不需要与所有的节点进行数据的交换即可以满足自己的需求。节点在建立伙伴关系的过程中会通过选择机制来尽量选择那些与自己在物理上相近的节点作为自己伙伴进行数据的交换,这样大大的减少了服务器与超级节点的压力,减小了底层物理传输的带宽与延时。When a node successfully joins the network, the node needs to establish a partnership before transmitting data. The so-called partner refers to the node that watches the same program as itself and is willing to exchange data with itself. In the present invention, the node does not establish a partnership with all nodes watching the same program in the network, because the scale of the network is very large , There are many nodes watching the same program in the network, and a node does not need to exchange data with all nodes to meet its own needs. In the process of establishing a partnership, nodes will use the selection mechanism to try to select those nodes that are physically close to themselves as their partners for data exchange, which greatly reduces the pressure on servers and super nodes, and reduces the underlying physical transmission. bandwidth and latency.
在上述过程中,发起节点加入请求消息的节点,在加入流媒体直播网络时,可以以超级节点方式加入,也可以以普通节点方式加入。当发起请求的节点加入流媒体直播网络后,需要建立伙伴来进行数据交换。下面详细描述超级节点与普通节点建立伙伴关系的过程,如图4所示:In the above process, the node that initiates the node joining request message can join in the mode of super node or ordinary node when joining the live streaming network. When the requesting node joins the live streaming network, it needs to establish a partner for data exchange. The process of establishing a partnership between a super node and an ordinary node is described in detail below, as shown in Figure 4:
步骤400:判断节点类型分为普通节点和超级节点,其中普通节点建立过程包括:Step 400: Judging the type of nodes into ordinary nodes and super nodes, the establishment process of ordinary nodes includes:
步骤401:发送建立伙伴关系请求。Step 401: Send a request to establish a partnership.
所述节点首先向自己所属的超级节点发送建立伙伴关系的请求。因为服务器将网络中的节点已经按照节目对节点进行了分类,所以在同一个超级节点管理下的普通节点与超级节点观看的都是同一个节目,这样普通节点可以直接向超级节点请求建立伙伴关系。The node first sends a request for establishing a partnership relationship to the super node to which it belongs. Because the server has classified the nodes in the network according to the programs, ordinary nodes and super nodes under the management of the same super node watch the same program, so ordinary nodes can directly request the super node to establish a partnership .
步骤402:超级节点判断是否建立伙伴关系Step 402: The super node judges whether to establish a partnership
超级节点是普通的用户,除了提供服务外还要做一些自己的事情,所以不能够将超级节点的所有的硬件资源都用来提供服务,本发发明的目标是使超级节点提供服务而不影响超级节点的正常工作,让超级节点自己感觉的是并没有消耗太多的资源。所以在实践中对超级节点的负载要进行有效的控制,使超级节点的负载值限定一个范围内。Supernodes are ordinary users, and they have to do some other things besides providing services, so all the hardware resources of supernodes cannot be used to provide services. The goal of this invention is to enable supernodes to provide services without affecting The normal work of the super node makes the super node feel that it does not consume too many resources. Therefore, in practice, the load of super nodes should be effectively controlled, so that the load value of super nodes can be limited within a certain range.
当超级节点收到建立伙伴关系的请求后,判断自己的负载与可用带宽情况,如果与请求节点建立伙伴关系后负载没有超过限定值,并且可用带宽比较充足可以满足节点的需求,则执行步骤403:和请求节点建立伙伴关系,否则就不与节点建立伙伴关系,执行步骤404。When the super node receives the request to establish a partnership, it judges its own load and available bandwidth. If the load does not exceed the limit value after establishing a partnership with the requesting node, and the available bandwidth is sufficient to meet the needs of the node, then execute step 403 : establish a partnership relationship with the requesting node, otherwise do not establish a partnership relationship with the node, and execute step 404 .
步骤404:超级节点返回自己的伙伴信息Step 404: The super node returns its partner information
无论请求节点与自己所属的超级节点是否建立了伙伴关系,此时请求节点的伙伴数目是不足以满足需求的,所以超级节点会将已经与自己建立伙伴关系的信息返回给请求节点,与超级节点建立伙伴关系的节点可能有服务器、其他超级节点和自己管理的普通节点,为了保证数据尽量的物理上相近的节点之间进行交换,超级节点会优先选择自己管理的普通节点返回给请求节点。Regardless of whether the requesting node has established a partnership with its super node or not, the number of partners of the requesting node is not enough to meet the demand at this time, so the super node will return the information that it has established a partnership with itself to the requesting node. Nodes that establish partnerships may include servers, other super nodes, and ordinary nodes managed by themselves. In order to ensure that data is exchanged between nodes that are physically similar to each other, super nodes will preferentially select ordinary nodes managed by themselves to return to requesting nodes.
步骤405:节点收到超级节点返回的伙伴信息后,进行选择与自己在物理上相近的被请求节点作为伙伴;Step 405: After receiving the partner information returned by the super node, the node selects the requested node that is physically close to itself as a partner;
请求节点在收到超级节点返回的节点信息后,并不是立即向它们发出建立伙伴关系的请求,而是进行一定的选择以保证伙伴与自己之间是相近的。选择的过程是请求节点检查自己与这些节点之间的延迟,排除那些延迟比较大的节点,向剩下的节点发送建立伙伴关系的请求。After receiving the node information returned by the super node, the requesting node does not immediately send them a request to establish a partnership, but makes a certain selection to ensure that the partner is similar to itself. The selection process is to request the node to check the delay between itself and these nodes, exclude those nodes with relatively large delay, and send a request to establish a partnership to the remaining nodes.
步骤406:被请求节点判断是否建立伙伴关系Step 406: The requested node determines whether to establish a partnership
与超级节点一样也要对普通节点的负载进行一定的控制,接收到请求的节点同样检查自己的负载与带宽情况,如果有足够的带宽并且负载没有超过限定值,就与请求节点建立伙伴关系,否则将与自己已经建立伙伴关系的节点信息返回给请求节点。Like super nodes, it is also necessary to control the load of ordinary nodes. The node receiving the request also checks its own load and bandwidth. If there is enough bandwidth and the load does not exceed the limit value, it will establish a partnership with the requesting node. Otherwise, return the information of the node that has established partnership with itself to the requesting node.
在上述过程可以完成普通节点建立伙伴关系。In the above process, ordinary nodes can complete the partnership establishment.
步骤407:伙伴数目是否足够Step 407: Whether the number of partners is sufficient
经过上述过程请求节点已经和一些节点建立了伙伴关系,这些伙伴在物理上与请求节点是相近的。此时请求节点会判断自己的伙伴数目是是否足以满足自己的需求,如果伙伴的数目仍然比较小,请求节点会向自己所属的超级节点的其他伙伴中那些与自己延时小的节点发送建立伙伴关系请求。Through the above process, the requesting node has established partnerships with some nodes, and these partners are physically close to the requesting node. At this time, the requesting node will judge whether the number of its partners is sufficient to meet its own needs. If the number of partners is still relatively small, the requesting node will send the establishment of a partner to those other partners of the super node to which it belongs. relationship request.
步骤408:建立伙伴关系列表Step 408: Build partnership list
重复上述过程,即重复执行步骤401至步骤407,请求节点最终形成自己的伙伴关系列表,这些伙伴在物理上是相近的,可以使传输延迟比较小。Repeating the above process, that is, repeatedly executing steps 401 to 407, the requesting node finally forms its own partnership list, and these partners are physically close, so that the transmission delay can be relatively small.
其中,超级节点建立过程包括:Among them, the super node establishment process includes:
超级节点建立伙伴关系的过程和普通节点建立伙伴关系的过程有很多相似的地方,这些地方将不再详细的描述,主要对那些不同的地方进行描述,具体的建立过程包括两种,一种与自己管理的节点建立伙伴关系;另一种为:与网络中的某个节点建立伙伴关系,具体如图4所示,包括如下步骤:There are many similarities between the process of establishing a partnership between a super node and that of an ordinary node. These places will not be described in detail, but the differences will be described. The specific establishment process includes two types, one with The node managed by oneself establishes a partnership; the other is: establishes a partnership with a certain node in the network, as shown in Figure 4, including the following steps:
步骤410:与自己管理的节点建立伙伴关系Step 410: Establish partnership with self-managed nodes
超级节点将自己所管理的普通节点当中那些可用带宽比较大并且性能好的节点加入到自己的伙伴列表当中,与之建立伙伴关系。The super node will add those nodes with relatively large available bandwidth and good performance among the ordinary nodes it manages to its partner list, and establish a partnership with it.
步骤411:发送建立伙伴关系请求Step 411: Send a request to establish a partnership
超级节点首先向网络中的某个节点请求建立伙伴关系,对于超级节点来说这个节点最初的时候是服务器,对于本发明的方法中服务器主要是向超级节点进行数据的传输,给普通节点的数据传输是很少的。The super node first requests a certain node in the network to establish a partnership. For the super node, this node is a server at the beginning. For the method of the present invention, the server mainly transmits data to the super node, and the data to the common node Transmissions are minimal.
步骤412:判断是否建立伙伴关系Step 412: Determine whether to establish a partnership
被请求节点判断自己的负载与带宽情况,如果负载没有超过限定值,带宽比较充足,则执行步骤415被请求节点与超级节点建立伙伴关系;如果负载比较大或带宽不够,就不与超级节点建立伙伴关系,执行步骤413。The requested node judges its own load and bandwidth. If the load does not exceed the limit value and the bandwidth is relatively sufficient, then execute step 415. The requested node establishes a partnership with the super node; if the load is relatively large or the bandwidth is not enough, it does not establish a partnership with the super node. partnership, go to step 413.
步骤413:被请求节点返回自己的伙伴信息Step 413: The requested node returns its partner information
被请求节点将已经与自己建立伙伴关系的信息返回给超级节点。The requested node returns the information that it has established a partnership with itself to the super node.
步骤414:超级节点将返回的节点信息当中,排除那些与自己延时比较大的,向剩下的节点发送建立伙伴关系的请求,具体过程同步骤405-408,形成伙伴关系列表,重复上述过程,超级节点最终形成自己的伙伴关系列表,这些伙伴在物理上是相近的。Step 414: Among the node information returned by the super node, exclude those with a relatively large delay with itself, and send a request to establish a partnership to the remaining nodes. The specific process is the same as steps 405-408, forming a partnership list, and repeating the above process , supernodes eventually form their own list of partnerships that are physically close.
在建立伙伴关系之后,节点就可以向伙伴节点请求数据进行数据的交换了。参见图5示出了第三阶段-数据传输阶段的流程图。After the partnership is established, the node can request data from the partner node for data exchange. Referring to FIG. 5 , it shows a flow chart of the third stage—the data transmission stage.
本发明对于数据的管理采用缓存映射BM(Buffer Map)方式,这是现有的P2P流媒体普遍采用的一种数据管理方式。该方式中将视频流媒体数据分割成大小相同的数据片断,用一个缓存映射来存储相关片断的信息,说明自己对于某个数据片断的拥有情况,节点之间交换数据是通过检查彼此的BM来进行的。具体实现中每个节点都会缓存一段时间的数据,BM用一个bit来表示节点对于一个数据片断拥有的情况,1表示节点拥有这个数据片断,0表示没有这个数据片断。The present invention adopts buffer map BM (Buffer Map) mode for the management of data, and this is a kind of data management mode generally adopted by existing P2P streaming media. In this method, the video streaming data is divided into data fragments of the same size, and a cache map is used to store the information of the relevant fragments, indicating the ownership of a certain data fragment. Nodes exchange data by checking each other's BM. ongoing. In the specific implementation, each node will cache data for a period of time. BM uses a bit to indicate the status of the node's possession of a data segment. 1 indicates that the node owns the data segment, and 0 indicates that the data segment does not exist.
本阶段节点根据需要的流媒体数据片断来对其伙伴节点进行数据片断的查询请求,被请求的伙伴节点会根据BM当中的信息查看自己是否拥有这个数据片断,如果拥有就会返回信息通知请求节点自己拥有这个数据片断,事实上拥有某个数据片断的伙伴节点往往不只一个,这样从哪个节点获取这个数据片断节点会进行选择,为了保证数据片断在截止时间之前获得,节点会选择那些与自己的延迟小的节点来进行数据交换。At this stage, the node will query its partner node for data fragments according to the required streaming media data fragments. The requested partner node will check whether it owns the data fragment according to the information in BM. If it has, it will return information to notify the requesting node. I own this data fragment. In fact, there are often more than one partner nodes who own a certain data fragment. In this way, the node will choose which node to obtain this data fragment from. Nodes with low latency to exchange data.
如图5所示节点与伙伴节点之间的数据传输流程图,本阶段的具体步骤如下:As shown in Figure 5, the data transmission flow chart between the node and the partner node, the specific steps at this stage are as follows:
步骤501:形成数据片断集合Step 501: Form a collection of data fragments
建立伙伴关系之后,节点开始请求节目,此时节点会形成一个所需的媒体数据片断相关信息的集合,因为节点需要的数据片断会随着时间的前进而不断的变化,获取到的数据片断信息会从这个集合里删除,而新的请求数据片断信息会加入到这个集合。After the partnership is established, the node starts to request the program. At this time, the node will form a collection of information related to the required media data fragments, because the data fragments required by the node will continue to change as time progresses, and the obtained data fragment information will be deleted from this collection, and new request data fragment information will be added to this collection.
步骤502:节点发起数据请求Step 502: The node initiates a data request
节点首先在这个集合当中选取一个数据片断然后,发起数据请求在伙伴节点当中进行查找。The node first selects a piece of data in this collection, and then initiates a data request to search among the partner nodes.
步骤503:伙伴节点返回响应Step 503: The partner node returns a response
伙伴节点根据节点请求的数据片断来对查看自己的BM,如果发现自己拥有这个数据片断,便向请求节点发送一个响应,告知节点自己拥有这个数据片断,如果没有这个数据片断则返回不拥有该片断的响应。The partner node checks its own BM according to the data fragment requested by the node. If it finds that it owns the data fragment, it sends a response to the requesting node, telling the node that it owns the data fragment. If it does not have the data fragment, it returns that it does not own the fragment. the response to.
步骤504:节点选取伙伴节点Step 504: The node selects a partner node
请求节点判断拥有请求数据片断的节点的数目,如果拥有该片断的节点数目大于一个,则执行步骤505在这些节点当中选取与自己延时最小的节点,如果只有一个节点转步骤506,如果没有拥有这个数据片断的节点转步骤508。The requesting node judges the number of nodes that own the requested data segment. If the number of nodes that own the segment is greater than one, execute
步骤506:节点进行数据传输Step 506: Nodes perform data transmission
请求节点向选取的节点发送数据传输的请求,被选取的节点将拥有的这个数据片断传给数据请求节点。The requesting node sends a request for data transmission to the selected node, and the selected node transmits the data fragment it owns to the data requesting node.
步骤507:节点进行更新集合Step 507: The node performs an update set
请求节点收到该数据片断后从集合中将该数据片断信息删除,并根据时间信息将新的需要的数据片断的信息加入的集合当中,转步骤502。After receiving the data segment, the requesting node deletes the information of the data segment from the collection, and adds the information of the new required data segment to the collection according to the time information, and then goes to step 502 .
步骤508:未查找到数据片断的处理Step 508: Processing of not finding the data fragment
对于每个数据片断本发明会记录最开始发出查询请求时间,以此来跟踪数据片断从最开始查询所经过的时间。当没有找到数据片断的拥有者,判断这个时间是否超过了规定时间T如20秒,如果发现超过了这个值,则执行步骤508认为在节点的伙伴当中没有这个数据片断的拥有者,从而节点进行伙伴列表的更新,然后转步骤502,如果没有超过这个值,则直接转步骤502等待下一次查询。For each data segment, the present invention records the time when the query request is first issued, so as to track the elapsed time of the data segment from the initial query. When the owner of the data fragment is not found, judge whether this time exceeds the specified time T such as 20 seconds, if it is found that this value is exceeded, then execute
本发明通过引入超级节点来分担服务器的控制负载,使服务器能够更好的为系统提供有效的媒体数据分发,系统中超级节点会管理那些与自己在物理网络上相近的节点,这样就可以使得在用户数目比较多的情况下用户基本上从那些与自己在物理上相近的用户上获得数据,从而降低了服务器的连接压力以及数据传输的延迟,这样可以大大减少底层网络带宽的耗费,提高服务质量的性能。The present invention shares the control load of the server by introducing a super node, so that the server can better provide effective media data distribution for the system, and the super node in the system will manage those nodes close to itself on the physical network, so that the When the number of users is relatively large, users basically obtain data from those users who are physically close to themselves, thereby reducing the connection pressure on the server and the delay of data transmission, which can greatly reduce the consumption of underlying network bandwidth and improve service quality performance.
本发明基于超级节点的P2P直播方法除了上述三个阶段之外,还包括节点离开流媒体直播网络这个阶段。下面将介绍节点离开流媒体直播网络阶段的详细过程。该过程包括:普通节点和超级节点正常或异常的离开网络。In addition to the above three stages, the super node-based P2P live broadcast method of the present invention also includes the stage that the node leaves the streaming media live broadcast network. The following will introduce the detailed process of the node leaving the live streaming network stage. The process includes: ordinary nodes and super nodes leave the network normally or abnormally.
普通节点的正常离开过程简单,离开的节点向其伙伴和其所属的超级节点发送离开的消息,通知它们自己将要离开流媒体直播网络,伙伴节点收到此消息后将该节点的信息从自己的伙伴列表当中删除,超级节点收到此消息后将该节点的信息从管理的节点列表当中删除,同时通知管理下的其他普通节点以便它们更新自己的节点列表。此时超级节点并不向服务器发送节点的离开信息,因为在P2P网络中节点随时都可以离开,而节点离开也比较频繁,为了减轻服务器在节点管理方面的开销超级节点采用在向超服务器发送心跳信息时同时发送节点列表的更新信息。The normal leaving process of an ordinary node is simple. The leaving node sends a leaving message to its partner and its super node, informing them that it will leave the live streaming network. After receiving this message, the partner node transfers the information of the node from its own After receiving this message, the supernode deletes the information of the node from the managed node list, and at the same time notifies other ordinary nodes under management so that they can update their own node list. At this time, the super node does not send the node's leaving information to the server, because the node can leave at any time in the P2P network, and the node leaves more frequently. In order to reduce the server's node management overhead The update information of the node list is sent at the same time as the information.
超级节点的正常离开首先其伙伴和向服务器发送离开的消息,通知它们自己将要离开网络,伙伴收到此消息后将该超级节点的信息从伙伴列表中删除,服务器收到此消息后会在该超级节点管理下的普通节点列表当中选取一个性能好的作为新的超级节点来接管这些普通节点,同时通知选择的节点向超级节点的转换。服务器将其他普通节点的信息发送给新的超级节点以使其来构建节点列表,超级节点收到这些信息后会向管理的普通节点发送消息通知它们由新的超级节点来管理,普通节点会根据这个消息更新自己节点列表当中的超级节点信息,以后服务器与这些普通节点便与新的超级节点进行通信。When a supernode leaves normally, first its partners and servers send a leave message to inform them that they are about to leave the network. After receiving this message, the partner deletes the information of the supernode from the partner list. After receiving this message, the server will Select a good performance as a new super node from the ordinary node list under the super node management to take over these ordinary nodes, and notify the selected node to convert to a super node. The server sends the information of other ordinary nodes to the new supernode to build the node list. After receiving the information, the supernode will send a message to the managed ordinary nodes to inform them that they are managed by the new supernode. The ordinary nodes will be based on This message updates the super node information in its own node list, and the server and these ordinary nodes will communicate with the new super node in the future.
节点的异常离开与正常离开的主要区别是节点离开的发现,发现节点离开后的处理与正常离开节点直接通知超级节点或者服务器后的处理过程是一样的,所以这里只对节点异常离开的发现来进行描述。The main difference between a node’s abnormal departure and normal departure is the discovery of the node’s departure. The processing after the node’s departure is found to be the same as that after the normal departure node directly notifies the super node or the server, so here only the abnormal departure of the node is found. to describe.
普通节点的异常离开,普通节点的异常离开在两种情况下会被发现。在本发明中普通节点要定期的向超级节点发送自己的存活信息,而超级节点保存了自己管理的每个普通节点的最后发送存活信息的时间,超级节点会定期的检查这个时间,如果发现某个节点长时间没有发送存活信息就认为该节点已经离开了网络。另一种情况是伙伴节点连续向某个节点发送数据请求而没有得到回应就认为这个节点已经离开网络,这时会通知超级节点此节点已经离开的消息,超级节进行探测如果没有响应则确定该节点已经离开网络。Abnormal departure of ordinary nodes, abnormal departure of ordinary nodes will be found in two cases. In the present invention, ordinary nodes should regularly send their own survival information to super nodes, and super nodes save the last time of sending survival information of each ordinary node managed by themselves, and super nodes will check this time regularly. If a node has not sent survival information for a long time, it is considered that the node has left the network. Another situation is that the partner node continuously sends data requests to a certain node but does not receive a response, and considers that the node has left the network. At this time, it will notify the super node that the node has left the message, and the super node will detect if there is no response. The node has left the network.
超级节点的异常离开的发现与普通节点的离开的发现有些类似,超级节点会定期的向服务器发送自己的存活信息,这样服务器可以发现超级节点的离开,超级节点与普通节点一样与伙伴节点之间进行数据的交换,其伙伴也会发现超级节点的导演离开。另外普通节点会动态的向超级节点发送更新伙伴列表的请求,如果超级节点没有响应就向服务器发送该超级节点离开网络的消息。服务器会进行相应的更新处理。The discovery of abnormal departure of supernodes is somewhat similar to that of ordinary nodes. Supernodes will periodically send their own survival information to the server, so that the server can discover the departure of supernodes. Supernodes, like ordinary nodes, communicate with partner nodes. For data exchange, its partners will also find that the director of the super node has left. In addition, ordinary nodes will dynamically send a request to update the partner list to the super node, and if the super node does not respond, it will send a message to the server that the super node has left the network. The server will update accordingly.
通过以上的处理能够及时的发现网络中的动态信息而进行有效的更新,从而可以动态的适应网络的变化,使得网络受到节点的退出的影响很小。Through the above processing, dynamic information in the network can be discovered in time and effectively updated, so that the network can be dynamically adapted to changes, so that the network is less affected by the withdrawal of nodes.
因此,本发明使数据在底层物理网络上相近的普通节点之间进行传输,减少了数据转发过程中的跳数以及时延;又由于本发明采用了分层的系统架构,从而降低了主服务器负担,减少了带宽的消耗;同时本发明将节点的管理与数据的传输进行了分离,使维护更加容易。Therefore, the present invention enables data to be transmitted between similar common nodes on the underlying physical network, reducing the number of hops and time delays in the data forwarding process; The burden reduces the bandwidth consumption; at the same time, the present invention separates node management from data transmission, making maintenance easier.
最后所应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,其均应涵盖在本发明的权利要求范围当中。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention without limitation. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent replacements of the technical solutions without departing from the spirit and scope of the technical solutions of the present invention shall be covered by the scope of the claims of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100534297A CN100558042C (en) | 2007-09-29 | 2007-09-29 | A P2P live broadcast method based on super nodes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100534297A CN100558042C (en) | 2007-09-29 | 2007-09-29 | A P2P live broadcast method based on super nodes |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101127619A CN101127619A (en) | 2008-02-20 |
CN100558042C true CN100558042C (en) | 2009-11-04 |
Family
ID=39095552
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2007100534297A Expired - Fee Related CN100558042C (en) | 2007-09-29 | 2007-09-29 | A P2P live broadcast method based on super nodes |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100558042C (en) |
Families Citing this family (31)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101282231B (en) * | 2008-05-27 | 2011-02-16 | 中山大学 | Living broadcast system for FBStream flow medium based on P2P network |
CN101771721B (en) * | 2009-01-04 | 2012-08-29 | 中国移动通信集团公司 | Streaming media data transmission method, system and server |
CN101938508B (en) * | 2009-07-01 | 2013-01-02 | 中国电信股份有限公司 | Method and system for shortening time delay in peer-to-peer network streaming media live broadcast system |
CN101895958A (en) * | 2010-03-30 | 2010-11-24 | 华为终端有限公司 | Method and device for self-establishing route in mobile network |
CN102006234A (en) * | 2010-12-09 | 2011-04-06 | 工业和信息化部电信传输研究所 | Method and device for optimizing P2P (Peer-to-Peer) network flow |
CN102014167A (en) * | 2010-12-16 | 2011-04-13 | 国家广播电影电视总局广播科学研究院 | Data sharing system based on peer-to-peer (P2P) mode |
CN102104622A (en) * | 2010-12-16 | 2011-06-22 | 上海一言网络科技有限公司 | Network multimedia terminal information publishing method |
CN102420696A (en) * | 2011-08-17 | 2012-04-18 | 大唐移动通信设备有限公司 | Dynamic networking method, command center node and system |
CN103167047A (en) * | 2011-12-12 | 2013-06-19 | 工业和信息化部电信传输研究所 | Domain name server (DNS) resource recording dynamic update method |
CN102624884B (en) * | 2012-02-29 | 2016-02-17 | 上海聚力传媒技术有限公司 | A kind of method, device and equipment for receiving P2P resource |
CN102833163B (en) * | 2012-08-23 | 2015-03-04 | 桂林电子科技大学 | Peer-to-peer network streaming media broadcasting service quality guarantee method and system |
US9716749B2 (en) | 2012-12-14 | 2017-07-25 | Microsoft Technology Licensing, Llc | Centralized management of a P2P network |
US9413846B2 (en) | 2012-12-14 | 2016-08-09 | Microsoft Technology Licensing, Llc | Content-acquisition source selection and management |
US10391387B2 (en) | 2012-12-14 | 2019-08-27 | Microsoft Technology Licensing, Llc | Presenting digital content item with tiered functionality |
US9374420B2 (en) * | 2012-12-14 | 2016-06-21 | Microsoft Technology Licensing, Llc | Content source selection in a P2P network |
CN103167028A (en) * | 2013-02-21 | 2013-06-19 | 胡凤兵 | User convergence method capable of saving transmission bandwidth and increasing concurrency |
CN103561037B (en) * | 2013-11-11 | 2016-08-17 | 西安诺瓦电子科技有限公司 | Set up the method for display terminal group, remotely control the method and system of display terminal |
CN104717249B (en) * | 2013-12-12 | 2018-04-27 | 北京神州泰岳软件股份有限公司 | Method, proxy server and the system of remote operation application issue |
CN103905544A (en) * | 2014-03-25 | 2014-07-02 | 华为技术有限公司 | Cluster storage system and distribution method of nodes in cluster storage system |
CN105072159B (en) * | 2015-07-17 | 2018-09-18 | 杭州施强教育科技有限公司 | A kind of node administration list structure in P2P networkings and its management method |
CN105827650B (en) * | 2016-05-20 | 2019-04-30 | 浙江宇视科技有限公司 | A kind of media stream forwarding method and device |
CN106028067A (en) * | 2016-06-15 | 2016-10-12 | 南京纳加软件有限公司 | P2P live-broadcasting/on-demand system |
CN106302726B (en) * | 2016-08-15 | 2019-05-28 | 浪潮(北京)电子信息产业有限公司 | A kind of monitoring method and module of the management node of distributed type assemblies data |
CN108322487A (en) * | 2017-01-16 | 2018-07-24 | 深圳市优朋普乐传媒发展有限公司 | P2p nodes selection method and device and node updating method and device |
CN107018181B (en) * | 2017-03-23 | 2019-10-25 | 西安电子科技大学 | Construction method of P2P network based on streaming media live broadcast system |
CN108206834B (en) * | 2018-04-04 | 2021-04-13 | 深圳怡化电脑股份有限公司 | Method, device and system for processing central service request |
CN109218762B (en) * | 2018-09-06 | 2019-11-26 | 百度在线网络技术(北京)有限公司 | Multimedia resource playback method, device, computer equipment and storage medium |
CN109379765A (en) * | 2018-11-14 | 2019-02-22 | 广州虎牙科技有限公司 | A kind of cellular network draws stream method, apparatus, equipment and storage medium |
CN111526375A (en) * | 2019-02-01 | 2020-08-11 | 广州虎牙信息科技有限公司 | Resource distribution method and device |
CN110071942A (en) * | 2019-05-20 | 2019-07-30 | 湖南康通电子股份有限公司 | Networking live streaming stream distributing method, device and the storage medium of digit broadcasting system |
CN111541905B (en) * | 2020-04-17 | 2022-05-20 | 广州虎牙科技有限公司 | Live broadcast method and device, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1822548A (en) * | 2006-03-24 | 2006-08-23 | 南京邮电大学 | Distributed traffic management method based on peer-to-peer network |
CN1968164A (en) * | 2005-11-17 | 2007-05-23 | 中国科学院计算技术研究所 | Global Internet topology knowledge-based P2P application construction method |
CN101030866A (en) * | 2006-03-02 | 2007-09-05 | 北京锐科天智科技有限责任公司 | Distributed network controllable transmission and hard software device |
-
2007
- 2007-09-29 CN CNB2007100534297A patent/CN100558042C/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1968164A (en) * | 2005-11-17 | 2007-05-23 | 中国科学院计算技术研究所 | Global Internet topology knowledge-based P2P application construction method |
CN101030866A (en) * | 2006-03-02 | 2007-09-05 | 北京锐科天智科技有限责任公司 | Distributed network controllable transmission and hard software device |
CN1822548A (en) * | 2006-03-24 | 2006-08-23 | 南京邮电大学 | Distributed traffic management method based on peer-to-peer network |
Non-Patent Citations (5)
Title |
---|
Constructing an Overlay Using a Shared Object Setfor Streaming Services on a P2P Network. Hyunjoo Kim,Heon Y. Yeom.H.-K. Kahng and S. Goto (Eds.): ICOIN 2004, LNCS 3090. 2004 * |
Constructing an Overlay Using a Shared Object Setfor Streaming Services on a P2P Network. Hyunjoo Kim,Heon Y.Yeom.H.-K. Kahng and S.Goto (Eds.):ICOIN 2004, LNCS 3090. 2004 * |
Improvement of Network Load and Fault-Tolerant of P2P DHT Systems. Dai,Bin,Wang,Furong,Tian,Yun.2006 International Conference on Information Technology: Research and Education. 2006 * |
Improvement of Network Load and Fault-Tolerant of P2P DHT Systems. Dai,Bin,Wang,Furong,Tian,Yun.2006 International Conference on Information Technology:Research and Education. 2006 * |
一种基于超级节点的P2P-IPTV体系结构研究. 吴吉义,龚祥国.四川大学学报(工程科学版),第39卷第增刊期. 2007 * |
Also Published As
Publication number | Publication date |
---|---|
CN101127619A (en) | 2008-02-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100558042C (en) | A P2P live broadcast method based on super nodes | |
US20230164397A1 (en) | Distributed election-based end-to-end content distribution network system and distribution method | |
JP5050095B2 (en) | Method, system, and node for P2P content sharing | |
US8112479B2 (en) | Method, system and device for establishing a peer to peer connection in a P2P network | |
CN100544261C (en) | A Data Distribution/Acquisition Method Based on Network Information | |
CN101616169B (en) | Method for selecting service providing entities, system, service selecting entity and service managing entity | |
US20110246608A1 (en) | System, method and device for delivering streaming media | |
US20080037527A1 (en) | Peer-to-Peer Interactive Media-on-Demand | |
EP2227016B1 (en) | A content buffering, querying method and point-to-point media transmitting system | |
US9497035B2 (en) | Method, device, and system for playing media based on P2P | |
CN101355468B (en) | Method for publishing P2P stream medium information | |
WO2010127618A1 (en) | System and method for implementing streaming media content service | |
KR20030056701A (en) | Apparatus and method for providing multimedia streaming service by using point-to-point connection | |
CN102355448A (en) | Cloud streaming media data transmission method and system | |
WO2008148335A1 (en) | A method for client node network topology construction and a system for stream media delivery | |
CN101938508A (en) | Method and system for shortening time delay in peer-to-peer network streaming media live broadcast system | |
US20080040420A1 (en) | Content distribution network | |
CN103095727B (en) | P2p resource location method | |
WO2010105505A1 (en) | Method, user node and server for requesting position information of resource on network | |
CN101997891B (en) | Method, device and system for allocating P2P media stream | |
EP3902279A1 (en) | Audio and video stream distribution method in audio and video stream distribution system, and dynamic parent node | |
CN111556324B (en) | A method, device, device and system for live video broadcasting | |
CN101873248A (en) | Transmission method and device of P2P (peer to peer) stream media | |
CN109788075A (en) | Private network network architecture, data acquisition method and edge server | |
US20080240138A1 (en) | Tree type broadcast system, connection target determination method, connection management device, connection management process program, and the like |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20091104 Termination date: 20120929 |