CN105872044A - Streaming media multi-level cache network acceleration system and method based on WebRTC - Google Patents
Streaming media multi-level cache network acceleration system and method based on WebRTC Download PDFInfo
- Publication number
- CN105872044A CN105872044A CN201610190708.7A CN201610190708A CN105872044A CN 105872044 A CN105872044 A CN 105872044A CN 201610190708 A CN201610190708 A CN 201610190708A CN 105872044 A CN105872044 A CN 105872044A
- Authority
- CN
- China
- Prior art keywords
- client
- webrtc
- group
- server
- network
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及网络加速领域,特别涉及一种基于WebRTC的流媒体多级缓存网络加速系统和方法。The invention relates to the field of network acceleration, in particular to a streaming media multi-level cache network acceleration system and method based on WebRTC.
背景技术Background technique
将P2P(Peer to Peer)技术引入到CDN系统内,各边缘自治域内的内容服务器与用户的传输方式采用P2P方式。然而,P2P网络拓扑可控性较差,数据的流通具有无序性,同时各客户节点又可在任意时刻加入和退出网络,为系统的稳定性带来了不少挑战。当其中某些在P2P组内网络的用户突然退出P2P组群的时候,可能在P2P组内网络流媒体资源会出现断层的情况,影响用户的流媒体资源的下载过程。其中P2P网络拓扑都是基于C/S架构而建成的,然而到了流媒体传输更加频繁的浏览器系统B/S架构中,就显得不是那么的常用了。The P2P (Peer to Peer) technology is introduced into the CDN system, and the transmission mode between the content server and the user in each edge autonomous domain adopts the P2P mode. However, the controllability of the P2P network topology is poor, and the flow of data is disorderly. At the same time, each client node can join and exit the network at any time, which brings many challenges to the stability of the system. When some network users in the P2P group suddenly quit the P2P group, there may be a fault in the network streaming media resources in the P2P group, which affects the downloading process of the streaming media resources of the users. Among them, the P2P network topology is built based on the C/S architecture, but it is not so commonly used in the browser system B/S architecture where streaming media transmission is more frequent.
发明内容Contents of the invention
本发明的目的在于克服现有技术的缺点与不足,一种基于WebRTC的流媒体多级缓存网络加速系统和方法。The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, a streaming media multi-level cache network acceleration system and method based on WebRTC.
本发明的目的通过如下技术方案实现:The purpose of the present invention is achieved through the following technical solutions:
一种基于WebRTC的流媒体多级缓存网络加速系统,包括CDN网络结构和组内客户端P2P网络组结构,所述组内客户端P2P网络组结构从所述CDN网络结构中缓存资源,所述组内客户端P2P网络包括支持WebRTC的客户端和信令服务器,所述支持WebRTC的客户端应用了浏览器缓存技术。A streaming media multi-level caching network acceleration system based on WebRTC, including a CDN network structure and an intra-group client P2P network group structure, the intra-group client P2P network group structure caches resources from the CDN network structure, the The client P2P network in the group includes a WebRTC-supporting client and a signaling server, and the WebRTC-supporting client applies browser caching technology.
所述支持WebRTC的客户端与所述信令服务器之间通信并实现客户端之间流媒体缓存文件互传都是使用WebRTC通信实现的。The communication between the client supporting WebRTC and the signaling server and the mutual transmission of streaming media cache files between the clients are all implemented by using WebRTC communication.
所述浏览器缓存技术使用的是HTTP协议定义的缓存机制,在HTTP 1.1中,使用了Cache-Control策略。The browser cache technology uses a cache mechanism defined by the HTTP protocol, and in HTTP 1.1, a Cache-Control strategy is used.
本发明的另一目的通过如下技术方案实现:Another object of the present invention is achieved through the following technical solutions:
一种基于WebRTC的流媒体多级缓存网络加速方法,具体包括以下步骤:A WebRTC-based streaming media multi-level cache network acceleration method, specifically comprising the following steps:
S1、借助CDN网络加速服务的优势,搭建一个属于本发明的CDN流媒体网络结构,并把流媒体资源分发到资源服务器和边缘节点缓存服务器中。S1. Building a CDN streaming media network structure according to the present invention by taking advantage of CDN network acceleration services, and distributing streaming media resources to resource servers and edge node cache servers.
S2、由于本系统是在基于WebRTC的浏览器上运行的,根据WebRTC网页实时通信的特性,WebRTC技术支持客户端的点对点连接;所以在客户端连接的时候,引入信令服务器。使得组内的客户端可以实现彼此互相连接,在组内实现了客户端P2P网络结构。S2. Since this system runs on a WebRTC-based browser, according to the real-time communication characteristics of WebRTC web pages, WebRTC technology supports point-to-point connection of clients; therefore, a signaling server is introduced when the client connects. It enables the clients in the group to be connected to each other, and realizes the client P2P network structure in the group.
S3、由于地理位置相近的多个客户端很大可能访问同一个边缘节点缓存服务器,能够把边缘节点缓存服务器和这些客户端划分为一个组。S3. Since multiple clients with close geographic locations are likely to access the same edge node cache server, the edge node cache server and these clients can be divided into a group.
S4、在共同访问同一个边缘节点缓存服务器的组内的客户端中,这些客户端不仅能够从边缘缓存服务器获取资源,也能够从组内的其他客户端获取资源,以此形成流媒体资源的第三级缓存。S4. Among the clients in the group that jointly access the same edge node cache server, these clients can not only obtain resources from the edge cache server, but also obtain resources from other clients in the group, so as to form a streaming media resource Third level cache.
本发明与现有技术相比,具有如下优点和有益效果:Compared with the prior art, the present invention has the following advantages and beneficial effects:
1、本发明大大减少了中心节点数据源和边缘缓存节点数据源的压力。传统CDN每个服务节点如果要获得中心节点数据源数据,均需要直接访问数据源服务器,造成数据源压力大,消耗带宽多,造成中心到边缘的数据链路得不到保障。而通过对CDN服务节点采用P2P方式进行组织,节点之间可以通过P2P方式互相共享、缓存数据,大大降低了中心数据源的压力。1. The present invention greatly reduces the pressure on the central node data source and the edge cache node data source. If each service node of a traditional CDN wants to obtain the data source data of the central node, it needs to directly access the data source server, resulting in high pressure on the data source, high bandwidth consumption, and the lack of guarantee for the data link from the center to the edge. By organizing CDN service nodes in a P2P manner, nodes can share and cache data with each other through P2P, which greatly reduces the pressure on the central data source.
2、本发明中心数据源数据多点备份,提高系统服务能力可靠性。不同服务节点之间对中心数据多点备份,这一策略使得CDN系统整体冗余能力、服务的自我恢复能力得以提高,进一步增强系统稳定性。2. The central data source data of the present invention is backed up at multiple points to improve the reliability of system service capability. Different service nodes back up the central data at multiple points. This strategy improves the overall redundancy capability of the CDN system and the self-recovery capability of services, further enhancing system stability.
3、本发明增加可提供服务的节点数量,提升服务灵活性。通过P2P方式互相共享、缓存数据,使得可以提供服务的节点数量大大增加,同时使得服务节点的服务更加灵活智能。3. The present invention increases the number of nodes that can provide services and improves service flexibility. Share and cache data through P2P, so that the number of nodes that can provide services is greatly increased, and at the same time, the service of service nodes is more flexible and intelligent.
4、本发明增加了系统的可扩展性,提升服务效率。下层内容分发采用P2P技术实现,使得系统的可扩展能力大大提高。整体系统具有良好的弹性,应对用户访问突发性、随意性的情况,保持良好的服务效率。4. The present invention increases the scalability of the system and improves service efficiency. The underlying content distribution is realized by P2P technology, which greatly improves the scalability of the system. The overall system has good flexibility to cope with sudden and random user access and maintain good service efficiency.
5、本发明提高网络的可管理性,避免流量无序。系统将P2P的范围严格限制在某一边缘服务节点的服务区域内,避免了传统P2P技术造成的过多的跨地区、跨ISP造成骨干网拥塞、流量无序的问题。增强了网络的可管理性和服务的可靠性。5. The present invention improves the manageability of the network and avoids disordered flow. The system strictly limits the scope of P2P to the service area of a certain edge service node, avoiding the problems of backbone network congestion and traffic disorder caused by too many cross-regions and cross-ISPs caused by traditional P2P technology. Enhanced network manageability and service reliability.
附图说明Description of drawings
图1为本发明所述的基于WebRTC的流媒体多级缓存网络加速系统结构图;Fig. 1 is the structural diagram of the streaming media multi-level cache network acceleration system based on WebRTC of the present invention;
图2为图1所述系统所采用的JSEP的结构示意图;Fig. 2 is the structural representation of the JSEP adopted by the system described in Fig. 1;
图3为图1所述系统所采用的STUN的搭建位置示意图;Fig. 3 is a schematic diagram of the construction position of the STUN adopted by the system described in Fig. 1;
图4为图1所述系统所采用的信令服务器和STUN服务器速建立起的P2P网络结构示意图;Fig. 4 is the P2P network structure schematic diagram that the signaling server that the system described in Fig. 1 adopts and the STUN server quickly set up;
图5为图1所述系统所采用的浏览器缓存的执行过程流程图。FIG. 5 is a flow chart of the execution process of the browser cache adopted by the system shown in FIG. 1 .
具体实施方式detailed description
下面结合实施例及附图对本发明作进一步详细的描述,但本发明的实施方式不限于此。The present invention will be further described in detail below in conjunction with the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.
本发明提供一种流媒体多级缓存技术的方法,该方法是:The present invention provides a kind of method of streaming media multi-level cache technology, the method is:
1、借助CDN网络加速服务的优势,搭建一个属于本发明的CDN流媒体网络结构,并把流媒体资源分发到资源服务器和边缘节点缓存服务器中。1. With the advantages of CDN network acceleration service, build a CDN streaming media network structure belonging to the present invention, and distribute streaming media resources to resource servers and edge node cache servers.
2、由于本系统是在基于WebRTC的浏览器上运行的,根据WebRTC网页实时通信的特性,WebRTC技术支持客户端的点对点连接。所以在客户端连接的时候,引入信令服务器。使得组内的客户端可以实现彼此互相连接,在组内实现了客户端P2P网络结构。2. Since this system runs on a WebRTC-based browser, according to the real-time communication characteristics of WebRTC web pages, WebRTC technology supports point-to-point connections of clients. So when the client connects, the signaling server is introduced. It enables the clients in the group to be connected to each other, and realizes the client P2P network structure in the group.
3、由于地理位置相近的多个客户端很大可能访问同一个边缘节点缓存服务器,可以把边缘节点缓存服务器和这些客户端划分为一个组。3. Since multiple clients with close geographic locations are likely to access the same edge node cache server, the edge node cache server and these clients can be divided into a group.
4、在共同访问同一个边缘节点缓存服务器的组内的客户端中,这些客户端不仅可以从边缘缓存服务器获取资源,也可以从组内的其他客户端获取资源,以此形成流媒体资源的第三级缓存。4. Among the clients in the group that jointly access the same edge node cache server, these clients can not only obtain resources from the edge cache server, but also obtain resources from other clients in the group, so as to form a stream media resources. Third level cache.
本发明提供一种流媒体多级缓存技术的系统,如图1所示,该系统主要由CDN网络结构和组内客户端P2P网络组结构组成。The present invention provides a streaming media multi-level caching technology system. As shown in FIG. 1 , the system is mainly composed of a CDN network structure and an intra-group client P2P network group structure.
其中虚框部分为新添加的服务器——信令服务器。它的作用是客户端通过访问信令服务器,发布并交换自己的连接信息,其他客户端即可通过信令服务器与其建立连接,实现客户端之间的互联从而建立一个P2P网络。引入信令服务器之后,客户端不仅可以从站点服务器直接获取资源,也可以从互联的其他客户端上获取资源,在站点服务器带宽受限,或是处理能力下降的情况,依然可以正常的访问网站服务。The dashed part is the newly added server—the signaling server. Its function is that the client publishes and exchanges its own connection information by accessing the signaling server, and other clients can establish a connection with it through the signaling server to realize the interconnection between clients and establish a P2P network. After the introduction of the signaling server, the client can not only obtain resources directly from the site server, but also obtain resources from other connected clients. When the bandwidth of the site server is limited or the processing capacity is reduced, the website can still be accessed normally. Serve.
通过引入加速服务前后的对比,可知网络加速服务由如下几部分构成:Through the comparison before and after the introduction of the acceleration service, it can be known that the network acceleration service consists of the following parts:
(1)支持WebRTC的客户端(1) Clients that support WebRTC
这里的网络加速服务是基于WebRTC构建,需要参与的客户端支持WebRTC。使用WebRTC的网络通信部分,可以快速使各个客户端构成P2P网络。无论是PC端还是移动端,Firefox和Chrome浏览器都提供了WebRTC的大部分支持,所以大部分客户端不需要任何安装就可以使用WebRTC。The network acceleration service here is built based on WebRTC, and the participating clients need to support WebRTC. Using the network communication part of WebRTC, each client can quickly form a P2P network. Whether it is a PC or a mobile terminal, Firefox and Chrome browsers provide most of the support for WebRTC, so most clients can use WebRTC without any installation.
(2)信令服务器(2) Signaling server
使用WebRTC来构建客户端的P2P网络,客户端就需要交换各自的信息才能连接在一起,这时候就需要信令服务(Signaling)。信令是一个协调沟通的过程,为了让客户端之间构成会话,客户端需要交换以下信令信息:发起和关闭一个通话控制信息;错误信息;元数据信息;确保通信安全的密钥;网络数据(如主机在外网的IP地址和端口)。客户端的信令处理需要一种来回传递信息的方法,这种机制没有被WebRTC定义,需要自己创建它。JSEP的结构如图2所示:Using WebRTC to build the client's P2P network, the clients need to exchange their own information to connect together. At this time, signaling service (Signaling) is required. Signaling is a process of coordinating communication. In order to form a session between clients, clients need to exchange the following signaling information: initiate and close a call control information; error information; metadata information; keys to ensure communication security; network Data (such as the IP address and port of the host on the external network). The signaling handling on the client side requires a way to pass information back and forth, this mechanism is not defined by WebRTC, you need to create it yourself. The structure of JSEP is shown in Figure 2:
JSEP的结构避免了让浏览器保存状态信息,如果让浏览器保存信令状态,每次当页面重载时,信令就会消失。更好的解决方案是用服务器保存信令状态,即使用信令服务器。WebRTC的信令服务器不过多花费内存和进程,只需要转发信息和保持很少的会话状态数据,所以甚至可以在当前服务器开启一个进程来负责信令的处理。但是信令机制不仅可以用来交换会话的元数据,也能用来传送应用数据,本质上是一个信息服务,所以这里把它作为一个单独的服务器。The structure of JSEP prevents the browser from saving state information. If the browser is allowed to save the signaling state, the signaling will disappear every time the page is reloaded. A better solution is to save the signaling state with a server, i.e. use a signaling server. WebRTC's signaling server does not spend too much memory and processes, and only needs to forward information and maintain very little session state data, so it is even possible to open a process on the current server to be responsible for signaling processing. But the signaling mechanism can be used not only to exchange session metadata, but also to transmit application data. It is essentially an information service, so it is regarded as a separate server here.
(3)STUN/TURN服务器(3) STUN/TURN server
信令交互完成后,客户端就会尝试直接去连接其他客户端。在简单的网络世界里,每一个WebRTC客户端都有一个唯一的地址,这样可以直接通信,但是实际情况下,大多数设备都在一个或多个NAT层后面,使用代理或是防火墙。为了克服真实世界的复杂网络环境,就需要使用STUN服务器来获取外部网络地址,或者使用TURN服务器,它在STUN服务器上加入了中继功能。STUN的搭建位置如图3所示:After the signaling interaction is completed, the client will try to connect directly to other clients. In the simple web world, each WebRTC client has a unique address, so that they can communicate directly, but in reality, most devices are behind one or more NAT layers, using proxies or firewalls. In order to overcome the complex network environment in the real world, it is necessary to use the STUN server to obtain the external network address, or use the TURN server, which adds a relay function to the STUN server. The location of STUN is shown in Figure 3:
STUN服务架设在外网,获取运行在NAT后面的客户端的IP和端口,然后返回地址。STUN的作用就是发现客户端的外网IP和端口,之后的执行步骤即信令服务的执行过程。因此,STUN服务器不需要存储太多的内容也不需要做太多的工作,简单的STUN服务器就可以应付大量的请求。当单纯的STUN无效之后,将会转向使用TURN。TURN服务器的作用是中继数据,它负责在两端间中转音视频、数据流等,但是不是发送数据。TURN具有公共地址,因此每个客户端都可以访问到(无论是否使用了代理或是防火墙)。TURN任务简单,但是数据中转会花费大量带宽,所以TURN需要足够强壮。The STUN service is set up on the external network, obtains the IP and port of the client running behind the NAT, and then returns the address. The role of STUN is to discover the external network IP and port of the client, and the subsequent execution steps are the execution process of the signaling service. Therefore, the STUN server does not need to store too much content or do too much work, and a simple STUN server can handle a large number of requests. When the simple STUN is invalid, it will turn to TURN. The role of the TURN server is to relay data. It is responsible for transferring audio and video, data streams, etc. between the two ends, but not sending data. TURN has a public address, so every client can access it (regardless of using a proxy or firewall). The task of TURN is simple, but data transfer will consume a lot of bandwidth, so TURN needs to be strong enough.
普通使用时,可以使用Google提供的STUN服务器,但是如果作为一款实际应用的产品,需要自己搭建STUN服务器降低使用第三方服务的风险。For normal use, you can use the STUN server provided by Google, but if it is a practical product, you need to build a STUN server yourself to reduce the risk of using third-party services.
由WebRTC客户端,信令服务器和STUN服务器就可以快速建立起P2P网络,达到网络加速的效果,完整的图如图4所示:The WebRTC client, signaling server and STUN server can quickly establish a P2P network to achieve the effect of network acceleration. The complete picture is shown in Figure 4:
2)本发明创造的技术关键点2) Key technical points of the present invention
其中这个三级缓存结构的三个个关键点是,信令服务器、客户端和浏览器缓存技术。The three key points of this three-level cache structure are signaling server, client and browser cache technology.
(1)支持WebRTC的客户端(1) Clients that support WebRTC
这里的网络加速服务是基于WebRTC构建,需要参与的客户端支持WebRTC。使用WebRTC网页实时通信技术,可以使得客户端之间相互传输流媒体资源。无论是PC端还是移动端,Firefox和Chrome浏览器都提供了WebRTC的大部分支持,所以大部分客户端不需要任何安装就可以使用WebRTC。The network acceleration service here is built based on WebRTC, and the participating clients need to support WebRTC. Using WebRTC webpage real-time communication technology can enable clients to transmit streaming media resources to each other. Whether it is a PC or a mobile terminal, Firefox and Chrome browsers provide most of the support for WebRTC, so most clients can use WebRTC without any installation.
(2)信令服务器(2) Signaling server
使用WebRTC来构建客户端,客户端之间要建立彼此的连接就需要交换各自的信息才能形成P2P网络组,这时候就需要信令服务(Signaling)。信令是一个协调沟通的过程,为了让客户端之间构成会话,客户端需要交换以下信令信息:发起和关闭一个通话控制信息;错误信息;元数据信息;确保通信安全的密钥;网络数据(如主机在外网的IP地址和端口)。客户端的信令处理需要一种来回传递信息的方法,这种机制没有被WebRTC定义,需要自己创建它。Using WebRTC to build the client, the clients need to exchange their own information to form a P2P network group in order to establish a connection with each other. At this time, signaling service (Signaling) is required. Signaling is a process of coordinating communication. In order to form a session between clients, clients need to exchange the following signaling information: initiate and close a call control information; error information; metadata information; keys to ensure communication security; network Data (such as the IP address and port of the host on the external network). The signaling handling on the client side requires a way to pass information back and forth, this mechanism is not defined by WebRTC, you need to create it yourself.
在这些客户端与信令服务器之间通信并实现客户端之间流媒体缓存文件互传都是使用WebRTC通信实现的。WebRTC在应用层面提供了三个可供调用的API,分别是MediaStream,用来访问设备的摄像头及话筒获得视频、音频的同步流;RTCPeerConnection,用于构建点对点之间稳定高效的流传输;RTCDataChannel,在点对点之间建立一个低延时、高吞吐的信道,可用来传输任意类型数据。The communication between these clients and the signaling server and the mutual transmission of streaming media cache files between clients are all realized by using WebRTC communication. WebRTC provides three APIs that can be called at the application level, namely MediaStream, which is used to access the camera and microphone of the device to obtain synchronous video and audio streams; RTCPeerConnection, which is used to build stable and efficient stream transmission between point-to-point; RTCDataChannel, Establish a low-latency, high-throughput channel between point-to-point, which can be used to transmit any type of data.
(3)浏览器缓存技术(3) Browser caching technology
在客户端通信技术完善之后,客户端缓存即浏览器缓存技术变得很重要。浏览器都提供了缓存,缓存访问过的站点的图片、文本、脚本文件,甚至可以缓存页面播放器点播的视频文件。浏览器的缓存机制使用的是HTTP协议定义的缓存机制。在HTTP 1.1中,使用了Cache-Control策略。原理是通过指明缓存资源的有效期,来控制浏览器是重新向服务器发出请求获取数据还是从浏览器缓存中读取数据。Cache-Conctrol有多个设置选项,HTTP协议头中Cache-Control的可选值如表格所示:After the client-side communication technology is perfected, client-side caching, that is, browser caching technology, becomes very important. All browsers provide cache, which caches pictures, text, and script files of visited sites, and even caches video files requested by page players. The browser's cache mechanism uses the cache mechanism defined by the HTTP protocol. In HTTP 1.1, the Cache-Control strategy is used. The principle is to control whether the browser re-sends a request to the server to obtain data or reads data from the browser cache by specifying the validity period of the cached resource. Cache-Control has multiple setting options, and the optional values of Cache-Control in the HTTP protocol header are shown in the table:
表1Table 1
字段Last-Modified/If-Modified-Since,Etag/If-None-Match也需要配合Cache-Control使用,关于这四个字段的说明,如表格所示:The fields Last-Modified/If-Modified-Since and Etag/If-None-Match also need to be used in conjunction with Cache-Control. The description of these four fields is shown in the table:
表2Table 2
Etag是资源在服务端的唯一标识符,由服务器自动生成,可以更加精准的控制缓存内容。如果同时使用Last-Modified和Etag,服务器会优先验证Etag,当Etag一致,才会对比Last-Modified。Etag is the unique identifier of the resource on the server side, which is automatically generated by the server and can control the cache content more precisely. If you use Last-Modified and Etag at the same time, the server will verify Etag first, and compare Last-Modified when Etag is consistent.
浏览器缓存的执行过程流程图如图5所示。在这些浏览器缓存流媒体文件之后,其浏览器之间进行文件互传使用的协议是HLS(HTTP Live Streaming),HLS是由苹果公司提出的基于HTTP的流媒体传输协议。它的工作原理是把整个流拆分成一个个很小的文件,这个文件是通过HTTP方式下载的,每次不是下载全部分片,而是下载一部分。当流播放时,客户端可以选择从多个不同的源以不同的速率下载同样的资源,流媒体会话可以适应不同的数据速率。在流播放开始前,客户端会先下载一个extended M3U playlist文件(m3u8索引文件),文件包含元数据,用于寻找网络中可用的媒体流。由于HLS只请求HTTP报文,所以很容易使用CDN来传输分发流媒体,而且与实时传输协议不同,HLS可以穿过任何允许HTTP数据通过的防火墙或是代理服务器。The flow chart of the execution process of browser caching is shown in Figure 5. After these browsers cache streaming media files, the protocol used for file transfer between browsers is HLS (HTTP Live Streaming). HLS is an HTTP-based streaming media transmission protocol proposed by Apple. Its working principle is to split the entire stream into small files. This file is downloaded through HTTP. Instead of downloading all fragments each time, it downloads a part. When streaming, the client can choose to download the same resource at different rates from multiple different sources, and the streaming session can accommodate different data rates. Before streaming starts, the client will first download an extended M3U playlist file (m3u8 index file), which contains metadata and is used to find media streams available in the network. Since HLS only requests HTTP packets, it is easy to use CDN to transmit and distribute streaming media, and unlike real-time transport protocols, HLS can pass through any firewall or proxy server that allows HTTP data to pass through.
在这种CDN网络结构下,通过增加边缘缓存服务器和内部负责调度的DNS,合理地让用户请求到总是距离最近的缓存服务器,这样有效地减少了中心站的的访问压力。即使某个节点遭遇访问延迟或是被攻击,也可以通过冗余节点,快速响应用户的请求。由于CDN的体系结构,它具有本地加速、远程加速、带宽优化、服务端镜像和抗攻击的的特点。其中抗攻击的特点是因为CDN这个一个大的集群,广泛分布且具有智能冗余机制,可以有效地预防黑客入侵以及各种DDoS攻击对服务访问的影响,保证数据安全,提供更优的服务质量。Under this CDN network structure, by adding edge cache servers and internal DNS responsible for scheduling, it is reasonable for users to request the cache server that is always the closest, which effectively reduces the access pressure of the central station. Even if a node encounters access delay or is attacked, it can quickly respond to user requests through redundant nodes. Due to the CDN architecture, it has the characteristics of local acceleration, remote acceleration, bandwidth optimization, server mirroring and attack resistance. The anti-attack feature is that CDN, a large cluster, is widely distributed and has an intelligent redundancy mechanism, which can effectively prevent hacking and various DDoS attacks from affecting service access, ensure data security, and provide better service quality .
共享同一个边缘节点服务器的组内客户端P2P网络组结构。在这个网络结构中新添加的服务器——信令服务器。它的作用是客户端通过访问信令服务器,发布并交换自己的连接信息,其他客户端即可通过信令服务器与其建立连接,实现客户端之间的互联。而在引入信令服务器之后,组内的客户端可以实现彼此互相连接,在组内实现了P2P网络。组内的客户端不仅可以从边缘缓存服务器获取资源,也可以从组内的其他客户端获取资源,通过利用组内客户端P2P网络加速技术与CDN网络结构融合,形成客户端流媒体资源的第三级缓存策略,客户端就近和多层缓存节点访问站点资源,实现流媒体网络加速服务。在组内客户端的P2P网络中,由于客户端之间可以互传资源,在多个客户端上传资源时,客户端下载几乎可以达到自身带宽的最大速度而不受服务器端带宽的限制。而且在这个组内的P2P网络结构中,客户端可通过访问信令服务器以此获得其它客户端的连接信息,从而合理地选择最近的客户端进行连接。这样就能减少对边缘节点服务器的访问压力。Intra-group client P2P network group structure sharing the same edge node server. The newly added server in this network structure is the signaling server. Its function is that the client publishes and exchanges its own connection information by accessing the signaling server, and other clients can establish a connection with it through the signaling server to realize the interconnection between clients. After the signaling server is introduced, the clients in the group can be connected to each other, and a P2P network is realized in the group. Clients in the group can obtain resources not only from the edge cache server, but also from other clients in the group. By using the client P2P network acceleration technology in the group to integrate with the CDN network structure, the client streaming media resources are formed. The three-level caching strategy allows the client to access site resources from the nearest and multi-layer caching nodes to realize streaming media network acceleration services. In the P2P network of the clients in the group, since the clients can transfer resources to each other, when multiple clients upload resources, the client download can almost reach the maximum speed of its own bandwidth without being limited by the bandwidth of the server. Moreover, in the P2P network structure within this group, the client can obtain the connection information of other clients by accessing the signaling server, so as to reasonably select the nearest client for connection. In this way, the access pressure to the edge node server can be reduced.
WebRTC来构建客户端的P2P网络实现方式:WebRTC to build a client-side P2P network implementation:
(1)支持WebRTC的客户端(1) Clients that support WebRTC
这里的网络加速服务是基于WebRTC构建,需要参与的客户端支持WebRTC。使用WebRTC网页实时通信技术,可以使得客户端之间相互传输流媒体资源。无论是PC端还是移动端,Firefox和Chrome浏览器都提供了WebRTC的大部分支持,所以大部分客户端不需要任何安装就可以使用WebRTC。The network acceleration service here is built based on WebRTC, and the participating clients need to support WebRTC. Using WebRTC webpage real-time communication technology can enable clients to transmit streaming media resources to each other. Whether it is a PC or a mobile terminal, Firefox and Chrome browsers provide most of the support for WebRTC, so most clients can use WebRTC without any installation.
(2)信令服务器(2) Signaling server
使用WebRTC来构建客户端,客户端之间要建立彼此的连接就需要交换各自的信息才能形成P2P网络组,这时候就需要信令服务(Signaling)。信令是一个协调沟通的过程,为了让客户端之间构成会话,客户端需要交换以下信令信息:发起和关闭一个通话控制信息;错误信息;元数据信息;确保通信安全的密钥;网络数据(如主机在外网的IP地址和端口)。客户端的信令处理需要一种来回传递信息的方法,这种机制没有被WebRTC定义,需要自己创建它。JSEP的结构如图2所示:JSEP的结构避免了让浏览器保存状态信息,如果让浏览器保存信令状态,每次当页面重载时,信令就会消失。更好的解决方案是用服务器保存信令状态,即使用信令服务器。WebRTC的信令服务器不过多花费内存和进程,只需要转发信息和保持很少的会话状态数据,所以甚至可以在当前服务器开启一个进程来负责信令的处理。但是信令机制不仅可以用来交换会话的元数据,也能用来传送应用数据,本质上是一个信息服务,所以这里把它作为一个单独的服务器。Using WebRTC to build the client, the clients need to exchange their own information to form a P2P network group in order to establish a connection with each other. At this time, signaling service (Signaling) is required. Signaling is a process of coordinating communication. In order to form a session between clients, clients need to exchange the following signaling information: initiate and close a call control information; error information; metadata information; keys to ensure communication security; network Data (such as the IP address and port of the host on the external network). The signaling handling on the client side requires a way to pass information back and forth, this mechanism is not defined by WebRTC, you need to create it yourself. The structure of JSEP is shown in Figure 2: the structure of JSEP prevents the browser from saving state information. If the browser is allowed to save the signaling state, the signaling will disappear every time the page is reloaded. A better solution is to save the signaling state with a server, i.e. use a signaling server. WebRTC's signaling server does not spend too much memory and processes, and only needs to forward information and maintain very little session state data, so it is even possible to open a process on the current server to be responsible for signaling processing. But the signaling mechanism can be used not only to exchange session metadata, but also to transmit application data. It is essentially an information service, so it is regarded as a separate server here.
上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiment is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the above-mentioned embodiment, and any other changes, modifications, substitutions, combinations, Simplifications should be equivalent replacement methods, and all are included in the protection scope of the present invention.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610190708.7A CN105872044A (en) | 2016-03-30 | 2016-03-30 | Streaming media multi-level cache network acceleration system and method based on WebRTC |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610190708.7A CN105872044A (en) | 2016-03-30 | 2016-03-30 | Streaming media multi-level cache network acceleration system and method based on WebRTC |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105872044A true CN105872044A (en) | 2016-08-17 |
Family
ID=56626484
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610190708.7A Pending CN105872044A (en) | 2016-03-30 | 2016-03-30 | Streaming media multi-level cache network acceleration system and method based on WebRTC |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105872044A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108259542A (en) * | 2016-12-29 | 2018-07-06 | 腾讯科技(深圳)有限公司 | The transmission method and device of resource |
CN108418789A (en) * | 2018-01-22 | 2018-08-17 | 网宿科技股份有限公司 | A communication system based on WebRTC, its communication method, and a signaling server |
CN110139119A (en) * | 2019-05-20 | 2019-08-16 | 湖南康通电子股份有限公司 | P2P live audio distribution method, device and the storage medium of digit broadcasting system |
WO2019200630A1 (en) * | 2018-04-18 | 2019-10-24 | 网宿科技股份有限公司 | Method and system for transmitting streaming media resource |
CN110381350A (en) * | 2019-06-25 | 2019-10-25 | 杭州叙简科技股份有限公司 | Multichannel playing back videos synchronization system and its processing method based on webrtc |
CN111686444A (en) * | 2019-03-14 | 2020-09-22 | 就肆电竞股份有限公司 | Peer-to-peer network acceleration system and method thereof |
WO2021213184A1 (en) * | 2020-04-21 | 2021-10-28 | Bai Yang | Distributed election-based end-to-end content distribution network system and distribution method |
CN116436904A (en) * | 2023-05-04 | 2023-07-14 | 江苏常熟农村商业银行股份有限公司 | Streaming media data push method, device, server and storage medium |
CN116884393A (en) * | 2023-08-03 | 2023-10-13 | 北京中科深智科技有限公司 | A pressure-elastic multi-level buffering generative AI communication method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101051980A (en) * | 2007-05-21 | 2007-10-10 | 华为技术有限公司 | File data distributing method and relative device |
CN101193294A (en) * | 2006-11-29 | 2008-06-04 | 中兴通讯股份有限公司 | A video content service system and service method |
CN102065150A (en) * | 2011-01-18 | 2011-05-18 | 乐视网信息技术(北京)股份有限公司 | Data transmission system and method based on P2P (Peer-to-Peer) network and CDN (Content Delivery Network) |
-
2016
- 2016-03-30 CN CN201610190708.7A patent/CN105872044A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101193294A (en) * | 2006-11-29 | 2008-06-04 | 中兴通讯股份有限公司 | A video content service system and service method |
CN101051980A (en) * | 2007-05-21 | 2007-10-10 | 华为技术有限公司 | File data distributing method and relative device |
CN102065150A (en) * | 2011-01-18 | 2011-05-18 | 乐视网信息技术(北京)股份有限公司 | Data transmission system and method based on P2P (Peer-to-Peer) network and CDN (Content Delivery Network) |
Non-Patent Citations (5)
Title |
---|
FLÁVIO RIBEIRO NOGUEIRA BARBOSA1, LUIZ FERNANDO GOMES SOARES: "Towards the Application of WebRTC Peer-to-Peer to Scale Live Video Streaming over the Internet", 《ANAIS DO IX WORKSHOP DE REDES P2P, DINÂMICAS, SOCIAIS E ORIENTADAS A CONTEÚDO - WP2P+》 * |
JOÃO LUÍS GONÇALVES DOMINGOS: "《Website file download acceleration using WebRTC》", 31 October 2015 * |
JUKKA K. NURMINEN, ANTONY J. R. MEYN,等: "P2P Media Streaming with HTML5 and WebRTC", 《INFOCOM"2013 DEMO/POSTER SESSION》 * |
MARTIN KIRKHOLT MELHUS: "《P2P Video Streaming with HTML5 and WebRTC》", 30 June 2015 * |
杨仲谋,方景龙,王大全: "基于WebRTC的去中心化CDN技术研究", 《工业控制计算机》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108259542B (en) * | 2016-12-29 | 2020-02-07 | 腾讯科技(深圳)有限公司 | Resource transmission method and device |
CN108259542A (en) * | 2016-12-29 | 2018-07-06 | 腾讯科技(深圳)有限公司 | The transmission method and device of resource |
CN108418789A (en) * | 2018-01-22 | 2018-08-17 | 网宿科技股份有限公司 | A communication system based on WebRTC, its communication method, and a signaling server |
CN108418789B (en) * | 2018-01-22 | 2021-09-17 | 网宿科技股份有限公司 | WebRTC-based communication system, communication method thereof and signaling server |
WO2019200630A1 (en) * | 2018-04-18 | 2019-10-24 | 网宿科技股份有限公司 | Method and system for transmitting streaming media resource |
CN110392020A (en) * | 2018-04-18 | 2019-10-29 | 网宿科技股份有限公司 | Method and system for transmitting streaming media resources |
CN111686444A (en) * | 2019-03-14 | 2020-09-22 | 就肆电竞股份有限公司 | Peer-to-peer network acceleration system and method thereof |
CN110139119B (en) * | 2019-05-20 | 2020-08-04 | 湖南康通电子股份有限公司 | P2P audio live broadcast distribution method, device and storage medium of digital broadcast system |
CN110139119A (en) * | 2019-05-20 | 2019-08-16 | 湖南康通电子股份有限公司 | P2P live audio distribution method, device and the storage medium of digit broadcasting system |
CN110381350A (en) * | 2019-06-25 | 2019-10-25 | 杭州叙简科技股份有限公司 | Multichannel playing back videos synchronization system and its processing method based on webrtc |
CN110381350B (en) * | 2019-06-25 | 2021-07-30 | 杭州叙简科技股份有限公司 | Multi-channel video playback synchronization system based on webrtc and its processing method |
WO2021213184A1 (en) * | 2020-04-21 | 2021-10-28 | Bai Yang | Distributed election-based end-to-end content distribution network system and distribution method |
CN116436904A (en) * | 2023-05-04 | 2023-07-14 | 江苏常熟农村商业银行股份有限公司 | Streaming media data push method, device, server and storage medium |
CN116436904B (en) * | 2023-05-04 | 2024-06-07 | 江苏常熟农村商业银行股份有限公司 | Streaming media data push method, device, server and storage medium |
CN116884393A (en) * | 2023-08-03 | 2023-10-13 | 北京中科深智科技有限公司 | A pressure-elastic multi-level buffering generative AI communication method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105872044A (en) | Streaming media multi-level cache network acceleration system and method based on WebRTC | |
Anjum et al. | Survey on peer-assisted content delivery networks | |
US20230164397A1 (en) | Distributed election-based end-to-end content distribution network system and distribution method | |
CN104967685B (en) | Streaming Media multi-level buffer network accelerating method based on Flash P2P | |
JP5050095B2 (en) | Method, system, and node for P2P content sharing | |
KR101355767B1 (en) | Peer-to-peer group communication in content centric networking | |
Koponen et al. | A data-oriented (and beyond) network architecture | |
Popa et al. | HTTP as the Narrow Waist of the Future Internet | |
Lu et al. | An Analysis and Comparison of CDN-P2P-hybrid Content Delivery System and Model. | |
US20120096116A1 (en) | Content distribution network using a web browser and locally stored content to directly exchange content between users | |
US11716368B2 (en) | Multicast overlay network for delivery of real-time video | |
US20100115613A1 (en) | Cacheable Mesh Browsers | |
Rhinow et al. | P2P live video streaming in WebRTC | |
US20080040420A1 (en) | Content distribution network | |
CN103634692A (en) | CDN (content distribution network) and P2P (peer-to-peer) based hybrid stream media video-on-demand system | |
KR20130009867A (en) | Network based peer-to-peer traffic optimization | |
Almeida et al. | Information Centric Networks–Design Issues, Principles and Approaches | |
Srinivasan et al. | ActiveCDN: Cloud computing meets content delivery networks | |
JP2016504678A (en) | Method, system and apparatus for content caching and distribution in an IP network | |
WO2016180284A1 (en) | Service node allocation method, device, cdn management server and system | |
Kumar et al. | Software‐defined content delivery network at the edge for adaptive video streaming | |
Riad et al. | A framework for cloud P2P VoD system based on user's behavior analysis | |
Alghamdi et al. | Fog-Based CDN Architecture Using ICN Approach for Efficient Large-Scale Content Distribution | |
CN104394483A (en) | Traffic local optimization method in internet video-on-demand system | |
US20220368729A1 (en) | Active speaker tracking using a global naming scheme |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160817 |