WO2015081691A1 - 媒体资源共享的方法、共享服务器及共享*** - Google Patents
媒体资源共享的方法、共享服务器及共享*** Download PDFInfo
- Publication number
- WO2015081691A1 WO2015081691A1 PCT/CN2014/080547 CN2014080547W WO2015081691A1 WO 2015081691 A1 WO2015081691 A1 WO 2015081691A1 CN 2014080547 W CN2014080547 W CN 2014080547W WO 2015081691 A1 WO2015081691 A1 WO 2015081691A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- browser
- server
- channel
- media
- sharing
- Prior art date
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
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/256—NAT traversal
- H04L61/2575—NAT traversal using address mapping retrieval, e.g. simple traversal of user datagram protocol through session traversal utilities for NAT [STUN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/256—NAT traversal
- H04L61/2589—NAT traversal over a relay server, e.g. traversal using relay for network address translation [TURN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/1066—Session management
- H04L65/1069—Session establishment or de-establishment
-
- 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/04—Protocols specially adapted for terminals or networks with limited capabilities; specially adapted for terminal portability
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a method for sharing media resources, a shared server, and a sharing system.
- the media resources shared by users include text content, photos and videos. These media resources are usually stored on the user's mobile phone or computer network devices. These network devices are internal to the local area network. There is no fixed external network IP address outside the LAN. To access these network devices, it is usually implemented by NAT (Network Address Translation) traversal or server relay.
- NAT Network Address Translation
- NAT traversal is usually implemented by UDP (User Datagram Protocol).
- UDP hole punching requires a dedicated client to complete, that is, when media resources are shared, a dedicated client is required to browse.
- Media resources which impose restrictions on network devices that share media resources, are less applicable.
- a method for sharing a media resource includes the following steps: a shared server acquires a sharing request of a browser through a bidirectional channel; and acquires an address of the shared server and the browser according to the sharing request Information; performing ICE connectivity testing with the browser according to the obtained address information of the shared server and the browser, and establishing a first media channel; sharing the media resource with the browser through the first media channel .
- the step of acquiring the address information of the shared server and the browser according to the sharing request comprises: returning a request response message to the application server by using the bidirectional channel according to the sharing request, by the application The server forwards the request response message to the browser through the bidirectional channel; receives a NAT address and port of the browser acquired by the application server, and a NAT address and port of the shared server; The bidirectional channel sends the NAT address and port of the shared server to the browser.
- the step of performing the ICE connectivity test with the browser according to the acquired address information of the shared server and the browser, and establishing the first media channel comprises: according to the obtained shared server and the The browser's NAT address and port are associated with the browser
- the step of performing the ICE connectivity test with the browser according to the acquired address information of the shared server and the browser, and establishing the first media channel further includes: if the first media channel If the establishment fails, the application server is used as a relay to establish a second media channel with the browser; and the second media channel shares the media resource with the browser.
- the step of the sharing server acquiring the sharing request of the browser through the bidirectional channel includes: the sharing server and the browser respectively establish a bidirectional channel with the application server; respectively, by using the sharing server and the browser respectively A bidirectional channel established with the application server acquires a sharing request of the browser.
- the step of sharing a media resource with the browser by using the first media channel includes: sending a media resource to a browser by using the first media channel, or receiving, by using the first media channel, the browser to send Media resources.
- a media resource sharing server is further provided, including: a request obtaining module, configured to acquire a sharing request of a browser through a bidirectional channel; The address information obtaining module is configured to acquire the address information of the shared server and the browser according to the sharing request; the first establishing module is configured to set the address information and the address information of the shared server and the browser according to the obtained The browser performs the ICE connectivity test and establishes a first media channel; the first sharing module is configured to share the media resource with the browser through the first media channel.
- the address information obtaining module includes: a returning unit, configured to return a request response message to the application server by using the bidirectional channel according to the sharing request, where the application server responds to the request by using the bidirectional channel Sending a message to the browser; a receiving unit, configured to receive a NAT address and a port of the browser acquired by the application server, and a NAT address and a port of the shared server; and sending, configured to pass the A two-way channel sends the shared server's NAT address and port to the browser.
- the first establishing module is specifically configured to perform an ICE connectivity test with the browser according to the obtained NAT address and port of the browser, and establish a first media channel.
- the method further includes: a second establishing module, configured to: if the first media channel fails to be established, use the application server as a relay to establish a second media channel with the browser; a module, configured to share a media resource with the browser through the second media channel.
- the request obtaining module includes: a channel establishing unit, configured to establish a bidirectional channel with the application server by the sharing server and the browser respectively; and requesting an acquiring unit, configured to pass the sharing server and the browsing The two-way channel established by the device and the application server respectively acquires a sharing request of the browser.
- the first sharing module is specifically configured to send a media resource to the browser through the first media channel, or receive the media resource sent by the browser through the first media channel.
- a media resource sharing system including an application server, a browser, and the shared server, where: the application server is configured to send to a shared server and a browser according to the sharing request. Address information; the browser is configured to send a sharing request to the shared server through the bidirectional channel, and is further configured to cooperate with the shared server for ICE connectivity testing, and establish a first media channel, and is also configured to pass the first media channel and the shared server. Share media resources.
- the application server comprises a registration server and an ICE server.
- the browser supports the Web RTC standard, and the shared server and the browser can perform message interaction through the bidirectional channel established by the application server, in the shared server and After the browser obtains the address information of itself and the other party, the ICE connectivity test can be performed and the first media channel can be established, and the media resource sharing between the shared server and the browser is realized through the first media channel, since many browsers support the Web.
- FIG. 1 is a schematic flowchart of a first embodiment of a method for sharing a media resource according to a second embodiment of the present invention
- FIG. 2 is a schematic diagram of a second embodiment of a method for sharing a media resource according to the present invention
- Figure 4 is a flow chart showing the sharing request of the browser through the bidirectional channel shown in Figure 2
- Figure 5 is a schematic structural view of the first embodiment of the shared server of the present invention
- Figure 6 is a shared view of the present invention
- FIG. 7 is a schematic structural diagram of a request acquisition module shown in FIG. 6
- FIG. 8 is a schematic structural diagram of an address information acquisition module shown in FIG. 6
- FIG. 9 is a structure of a shared system according to an embodiment of the present invention; schematic diagram.
- an embodiment of the present invention provides a method for sharing a media resource, including: Step S101: A shared server acquires a sharing request of a browser through a bidirectional channel; wherein, the bidirectional channel is a Web Socket aisle.
- the browser of this embodiment supports the Web Real-Time Communication (Web Real-Time Communication) standard, and the Web RTC is a technology that supports a web browser for real-time voice conversation or video conversation.
- the shared server and the browser-installed device are on different LANs. When a shared server or browser is used as the external network to access the other party, a NAT (Network Address Translation) device is required to convert and block the URL. Internal network information.
- the sharing request of the browser is obtained by the shared server and the browser respectively establishing a bidirectional channel with the application server.
- the goal of the Web Socket specification is to implement two-way communication with the server in the browser. Browsers with the Web Socket specification include Firefox 4, Chrome 4, Opera 10.70, and Safari 5 browsers.
- the address information of the shared server and the browser is obtained according to the sharing request.
- the application server transits to return the response of the sharing request to the browser.
- the message after receiving the response message, the browser first obtains its address information from the application server, and then the shared server also obtains its address information from the application server.
- the shared server obtains the address information of the shared server and the browser through the application server, and the browser obtains the address information of the browser itself and the shared server through the application server, and can obtain the address information of the own and the other party through the known address information.
- One-step ICE connectivity test The address information includes a NAT address and a port, and includes a relayed IP address and port.
- the NAT address and port are allocated to the shared server and the browser's respective NAT device, and then sent to the application server, and the relayed IP address and port are Assigned by the application server. In this embodiment, the NAT address and port are preferentially used.
- Step S103 performing ICE connectivity testing with the browser according to the obtained address information of the shared server and the browser, and establishing a first media channel; ICE (Interactive Connectivity Establishment) is a kind Comprehensive
- Step S104 Share media resources with the browser by using the first media channel.
- the shared server and the browser share the media resources through the first media channel, and the media resources include text content, photos, and videos, and are packaged as UDP packets before being sent, and then the shared server sends the media to the browser through the first media channel.
- the shared server receives the media resource sent by the browser through the first media channel, and saves the media resource sent by the browser on the shared server.
- the browser of the embodiment supports the Web RTC standard, and the shared server and the browser can perform message interaction through the two-way channel established by the application server, and obtain the address information of the user and the other party respectively in the shared server and the browser.
- the ICE connectivity test can be performed and the first media channel can be established, and the media resource sharing between the shared server and the browser can be realized through the first media channel.
- another embodiment of the present invention provides a method for sharing a media resource.
- the method further includes: Step S105: If the first media channel fails to be established, the application server is used as a relay to establish a second media channel with the browser.
- Step S106 share the media with the browser by using the second media channel. Resources.
- the embodiment further solves the problem that when the first media channel between the shared server and the browser fails to be established, the address information acquired by the shared server and the browser through the application server includes the relay. The IP address and port, the shared server and the browser can still use the server as a relay, establish a second media channel problem with the browser, and share the media resources with the browser, thereby ensuring the shared server and the browser. Normal communication between.
- the step S101 of the sharing server acquiring the sharing request of the browser through the bidirectional channel includes: Step S1011, the sharing server and the browser respectively and the application server Establish a two-way channel; Step S1012: Acquire a sharing request of the browser by using the two-way channel established by the shared server and the browser respectively with the application server.
- the embodiment is specifically: the sharing server and the application server perform a handshake of the Web Socket, and establish a two-way channel, so as to implement two-way communication between the shared server and the application server; the shared server reports the state of the application to the application server, that is, the available or unavailable state; The browser accesses the page of the query sharing service list provided by the application server, and loads the page, and the browser and the application server perform a handshake of the Web Socket to establish a bidirectional channel, so as to implement two-way communication between the browser and the application server, and the browser passes through the bidirectional channel.
- a sharing request is sent to the application server, and the application server forwards the sharing request of the browser to the shared server through the bidirectional channel.
- the step S102 of acquiring the address information of the shared server and the browser according to the sharing request includes: Step S1021, according to the sharing request, Returning the request response message to the application server by the two-way channel, and the application server forwards the request response message to the browser by using the bidirectional channel; Step S1022, receiving the browser acquired by the application server a NAT address and port, and a NAT address and port of the shared server; Step S1023, sending, by the bidirectional channel, the NAT address and port of the shared server to the browser.
- an embodiment of the present invention provides a sharing server, including: a request obtaining module 101, configured to acquire a sharing request of a browser through a bidirectional channel; the browser of the embodiment supports Web RTC (Web Real-Time) Communication, web real-time communication) Standard, Web RTC is a technology that supports web browsers for real-time voice conversations or video conversations.
- the shared server and the browser-installed device are on different LANs.
- a NAT Network Address Translation
- the sharing request of the browser is obtained by the shared server and the browser respectively establishing a bidirectional channel with the application server.
- the goal of the Web Socket specification is to implement two-way communication with the server in the browser.
- Browsers with the Web Socket specification include Firefox 4, Chrome 4, Opera 10.70, and Safari 5 browsers.
- the address information obtaining module 102 is configured to acquire the address information of the shared server and the browser according to the sharing request.
- the application server is transited, and the sharing is returned to the browser.
- the browser After receiving the response message, the browser first obtains the address information from the application server, and then the shared server also obtains the address information from the application server.
- the address information obtaining module 102 of the shared server obtains the address information of the shared server and the browser through the application server, and the browser obtains the address information of the browser itself and the shared server through the application server, and passes through the known own and the other party's address information.
- the address information can be tested for ICE connectivity.
- the address information includes a NAT address and a port, and includes a relayed IP address and port.
- the NAT address and port are allocated to the shared server and the browser's respective NAT device, and then sent to the application server, and the relayed IP address and port are Assigned by the application server. In this embodiment, the NAT address and port are preferentially used.
- the first establishing module 103 is configured to perform an ICE connectivity test with the browser according to the obtained address information of the shared server and the browser, and establish a first media channel;
- ICE Interactive Connectivity Establishment
- the first establishing module 103 of the shared server and the browser can perform the ICE connectivity test by using the known own and the address information of the other party, and establish the first media channel.
- the address information used in this embodiment includes the NAT address and the port.
- the first sharing module 104 is configured to share the media resource with the browser through the first media channel.
- the first shared module 103 of the shared server and the browser share the media resource through the first media channel, and the media resource includes the text content, the photo and the video, etc., and the first sharing module 103 of the shared server may send the message to the browser through the first media channel.
- the media resource; the first sharing module 103 of the shared server may receive the media resource sent by the browser through the first media channel, and save the media resource sent by the browser on the shared server.
- another embodiment of the present invention provides a shared server.
- the foregoing method further includes: a second establishing module 105, configured to: if the first media channel fails to be established, Establishing, by the application server, a second media channel between the browser and the browser;
- the second sharing module 106 is configured to share the media resource with the browser through the second media channel.
- the embodiment further solves the problem that the shared server and the browser obtain the address through the application server when the first media channel between the first setup module 102 and the browser fails to be established.
- the information includes the IP address and port of the relay, and the second establishing module 104 of the shared server and the browser can still use the server as a relay, establish a second media channel with the browser, and share the media resource with the browser.
- the problem This ensures proper communication between the shared server and the browser.
- the request obtaining module 101 includes: a channel establishing unit 1011, configured to establish a bidirectional channel with the application server by the shared server and the browser respectively; 1012. Set to acquire a sharing request of the browser by using the two-way channel established by the shared server and the browser respectively.
- the address information acquiring module 102 includes: a returning unit 1021, configured to return a request response message to the application server by using the bidirectional channel according to the sharing request, where The application server forwards the request response message to the browser through the bidirectional channel; the receiving unit 1022 is configured to receive the NAT address and port of the browser acquired by the application server, and the shared server The NAT address and port; the sending unit 1023 is configured to send the NAT address and port of the shared server to the browser through the bidirectional channel.
- An embodiment of the present invention provides a sharing system, including: an application server, a browser, and a shared server, where: the sharing server is configured to acquire a sharing request of the browser through the bidirectional channel, and obtain address information of the shared server and the browser according to the sharing request.
- the application server is configured to send the address information to the shared server and the browser according to the sharing request;
- the browser is configured to send the sharing request to the shared server through the bidirectional channel, and is further configured to perform the ICE connectivity test with the shared server, and establish the first
- the media channel is also configured to share the media resource with the shared server through the first media channel.
- the application server may also be divided into two servers, that is, a registration server and an ICE server.
- the registration server is used for the shared server and the browser to register the external access address after passing through the NAT device, and serves as a relay server for sharing the server and the browser message interaction; and the ICE server is responsible for allocating the address information of the shared server and the browser, and The sharing service when the shared server and the browser establish a second media channel and the media resource sharing interaction.
- the content sharing server shares the video by real-time audio and video communication with the browser by simulating the Web RTC standard browser peer-to-peer connection (RTPPeerConnection), ICE and media stream processing flow and message.
- RTPPeerConnection Web RTC standard browser peer-to-peer connection
- the shared server and the registration server perform a handshake of the Web Socket to establish a bidirectional channel;
- the shared server reports status information to the registration server.
- the browser accesses the page of the query sharing server provided by the registration server, and loads the page;
- the browser and the registration server perform a handshake of the Web Socket to establish a bidirectional channel
- the browser sends a sharing request to the registration server through the bidirectional channel; 6.
- the registration server forwards the sharing request to the shared server through the bidirectional channel;
- the shared server returns response information to the registration server through the bidirectional channel
- the registration server forwards the response information to the browser through the two-way channel
- the browser creates a local WebRTC connection, obtains the Session Description Protocol (SDP) corresponding to the connection, and registers it with the local WebRTC connection.
- SDP Session Description Protocol
- the browser requests the ICE server to obtain the NAT external network address port pair of the browser and/or the relay address port pair assigned by the ICE server to itself; 10.
- the ICE server returns the list information of the above address port pairs (NAT address and port, relay IP, port, etc.) to the browser;
- the browser sends its own list information and local media surface information to the registration server;
- the registration server sends the list information of the browser and the local media surface information of the browser to the shared server;
- the content sharing server creates a local WebRTC connection corresponding to the browser, obtains the media information of the side of the user and registers it with the local WebRTC connection.
- the shared server requests the ICE server to obtain the external address port pair of the NAT device 1 and/or the relay address port pair assigned to the ICE server by itself;
- the ICE server returns the above address port (NAT address and port, trunk IP, port, etc.) to the browser;
- the shared server sends its own list information and local media surface information to the registration server;
- the registration server sends the list information of the shared server and the media surface information to the browser, so that the WebRTC connection information between the browser and the shared server is negotiated. ;
- the ICE connectivity test is performed between the browser and the shared server according to the known NAT address and port of the other party, and the first media channel is established;
- the shared server sends the required video stream to the browser according to the WebRTC standard SRTP (Secure Real-time Transport Protocol) format through the WebRTC connection channel between the shared server and the browser;
- WebRTC standard SRTP Secure Real-time Transport Protocol
- the browser receives the above WebRTC standard video stream and plays the video through the HTML5 video API.
- the shared server performs Web Socket communication with the registration server, performs peer-to-peer UDP communication with the browser, and performs TCP communication with the ICE server.
- image uploading is implemented based on a browser that supports the Web RTC standard.
- Web RTC server shared by simulating a standard browser point connection (referred RTCPeerConnection) and its affiliated data channel (referred to as D a taCh anne l), ICE and streaming processes and messages in real time audio and video browser Communication, thus saving the stream of pictures sent by the browser. Specific steps are as follows:
- the shared server and the registration server perform a handshake of the Web Socket, and establish a Web Socket channel to implement two-way communication between the shared server and the registration server.
- the shared server reports the status of the content sharing service to the registration server.
- the browser accesses the page of the query content sharing service list provided by the registration server, and loads the page.
- the browser and the registration server perform a handshake of the Web Socket, and establish a Web Socket channel to implement two-way communication between the browser and the registration server.
- the browser sends a request to upload the image file to the shared server through the Web Socket channel to the registration server.
- the registration server forwards the request for uploading the image file by the browser to the shared server through the Web Socket channel.
- the shared server returns a request response to the registration server through the Web Socket channel, and can perform content upload.
- the registration server forwards the request response returned by the shared server to the browser through the Web Socket channel.
- the browser creates a local WebRTC connection and uses this connection to create a local data channel. After that, the media plane information corresponding to the connection and the parameter information of the data channel are obtained, and are uniformly registered to the local WebRTC connection. At the same time, the browser requests the ICE server to obtain the NAT external network address port pair of the browser and/or the relay address port pair assigned to itself by the ICE server.
- the ICE server returns the above address port pair to the browser.
- the browser informs the registration server of the IP and port list information, media plane information, and data channel parameter information obtained from the ICE server.
- the registration server notifies the shared server of the browser's IP and port list information, media plane information, and data channel parameter information.
- the content sharing server creates a local WebRTC connection corresponding to the browser, and creates a local data channel corresponding to the browser side according to the data channel parameters of the browser side. After that, get the media information on your side and register to the local WebRTC connection.
- the shared server requests the ICE server to obtain the NAT external address port pair of the shared server and/or the relay address port pair assigned to itself by the ICE server. 14.
- the ICE server returns the above address port pair to the shared server.
- the shared server informs the registration server of the IP and port list information and local media information obtained from the ICE server.
- the browser and the shared server perform ICE connectivity testing based on the known IP and port list information of the other party to establish a data channel.
- the browser uses the data channel to send the uploaded image and text to the shared server according to the SCRT (Stream Control Transmission Protocol) format of the WebRTC standard.
- SCRT Stream Control Transmission Protocol
- Content Sharing Server The data channel on the C side receives and saves the picture file. It can be seen from the above description that the browser of the present invention supports the Web RTC standard, and the shared server and the browser can perform message interaction through the two-way channel established by the application server, and obtain the address information of itself and the other party in the shared server and the browser respectively. After that, the ICE connectivity test can be performed and the first media channel can be established, and the media resource sharing between the shared server and the browser can be realized through the first media channel. Since many browsers support the Web RTC standard, compared with the prior art.
- the scope of application of resource sharing between the server and the browser is increased in the present invention, and no special client is required to complete; compared to the method of using server relay, the present invention is shared.
- the media resources with a large amount of data are used, the occupation of the application server resources is low, and the network resources are saved.
- the shared server and the browser can still apply the server. Relaying, establishing a second media channel with the browser, and Realize sharing of media resources with the browser, thus ensuring normal communication between the shared server and the browser.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- General Business, Economics & Management (AREA)
- Multimedia (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
一种媒体资源共享的方法、共享服务器及共享***,媒体资源共享的方法包括以下步骤:共享服务器通过双向通道获取浏览器的共享请求;根据所述共享请求获取所述共享服务器与所述浏览器的地址信息;根据获取的所述共享服务器与所述浏览器的地址信息与所述浏览器进行ICE联通性测试,并建立第一媒体通道;通过所述第一媒体通道与所述浏览器共享媒体资源,能够提高服务器与浏览器之间共享媒体资源的通用性,降低成本,节约网络资源。
Description
媒体资源共享的方法、 共享服务器及共享*** 技术领域 本发明涉及通信技术领域, 尤其涉及一种媒体资源共享的方法、 共享服务器及共 享***。 背景技术 随着网络技术的发展, 在两种网络设备上共享媒体资源已经具有多种多样的实现 方法。 用户所共享的媒体资源包括文字内容、 照片及视频等, 这些媒体资源通常存储 在用户的手机或者电脑等网络设备上, 这些网络设备是局域网内部的, 对外没有固定 的外网 IP地址,局域网外部要访问这些网络设备时,一般是通过 NAT (Network Address Translation, 网络地址转换)穿越或者服务器中继的方式来实现。 但是, 使用服务器中继的方式在共享数据量较大的媒体资源时, 对服务器资源的 占用会比较高, 单个服务器同时可服务网络设备的数量减少,造成服务器成本的增加。 而使用 NAT穿越的方式时, 通常是通过 UDP (User Datagram Protocol, 用户数据 包协议) 打洞来实现, UDP打洞需要专用客户端来完成, 即在媒体资源共享时, 需要 专用客户端来浏览媒体资源,造成对共享媒体资源的网络设备的限制,适用范围较小。 发明内容 本发明实施例提供了一种媒体资源共享的方法、 共享服务器及共享***, 旨在提 高服务器与浏览器之间共享媒体资源的通用性, 降低成本, 节约网络资源。 根据本发明的一个方面, 提供了一种媒体资源共享的方法, 包括以下步骤: 共享服务器通过双向通道获取浏览器的共享请求; 根据所述共享请求获取所述共享服务器与所述浏览器的地址信息; 根据获取的所述共享服务器与所述浏览器的地址信息与所述浏览器进行 ICE联通 性测试, 并建立第一媒体通道; 通过所述第一媒体通道与所述浏览器共享媒体资源。
优选地, 所述根据所述共享请求获取所述共享服务器与所述浏览器的地址信息的 步骤包括: 根据所述共享请求, 通过所述双向通道向应用服务器返回请求响应消息, 由所述 应用服务器通过所述双向通道将所述请求响应消息转发给所述浏览器; 接收通过所述应用服务器获取的所述浏览器的 NAT地址与端口,以及所述共享服 务器的 NAT地址与端口; 通过所述双向通道将所述共享服务器的 NAT地址与端口发送至所述浏览器。 优选地, 所述根据获取的所述共享服务器与所述浏览器的地址信息与所述浏览器 进行 ICE联通性测试, 并建立第一媒体通道的步骤包括: 根据获取的所述共享服务器与所述浏览器的 NAT 地址及端口与所述浏览器进行
ICE联通性测试, 并建立第一媒体通道。 优选地, 所述根据获取的所述共享服务器与所述浏览器的地址信息与所述浏览器 进行 ICE联通性测试, 并建立第一媒体通道的步骤之后还包括: 若所述第一媒体通道建立失败, 则以所述应用服务器为中继, 建立与所述浏览器 之间的第二媒体通道; 通过所述第二媒体通道与所述浏览器共享媒体资源。 优选地, 所述共享服务器通过双向通道获取浏览器的共享请求的步骤包括: 所述共享服务器及所述浏览器分别与所述应用服务器建立双向通道; 通过所述共享服务器及所述浏览器分别与所述应用服务器建立的双向通道获取浏 览器的共享请求。 优选地, 所述通过第一媒体通道与所述浏览器共享媒体资源的步骤包括: 通过所 述第一媒体通道向浏览器发送媒体资源, 或者通过所述第一媒体通道接收所述浏览器 发送的媒体资源。 根据本发明的另一方面, 还提供了一种媒体资源共享服务器, 包括: 请求获取模块, 设置为通过双向通道获取浏览器的共享请求;
地址信息获取模块, 设置为根据所述共享请求获取所述共享服务器与所述浏览器 的地址信息; 第一建立模块, 设置为根据获取的所述共享服务器与所述浏览器的地址信息与所 述浏览器进行 ICE联通性测试, 并建立第一媒体通道; 第一共享模块, 设置为通过所述第一媒体通道与所述浏览器共享媒体资源。 优选地, 所述地址信息获取模块包括: 返回单元, 设置为根据所述共享请求, 通过所述双向通道向应用服务器返回请求 响应消息, 由所述应用服务器通过所述双向通道将所述请求响应消息转发给所述浏览 器; 接收单元, 设置为接收通过所述应用服务器获取的所述浏览器的 NAT 地址与端 口, 以及所述共享服务器的 NAT地址与端口; 发送单元,设置为通过所述双向通道将所述共享服务器的 NAT地址与端口发送至 所述浏览器。 优选地, 所述第一建立模块具体设置为根据获取的所述共享服务器与所述浏览器 的 NAT地址及端口与所述浏览器进行 ICE联通性测试, 并建立第一媒体通道。 优选地, 还包括: 第二建立模块, 设置为若所述第一媒体通道建立失败, 则以所述应用服务器为中 继, 建立与所述浏览器之间的第二媒体通道; 第二共享模块, 设置为通过所述第二媒体通道与所述浏览器共享媒体资源。 优选地, 所述请求获取模块包括: 通道建立单元, 设置为所述共享服务器及所述浏览器分别与所述应用服务器建立 双向通道; 请求获取单元, 设置为通过所述共享服务器及所述浏览器分别与所述应用服务器 建立的双向通道获取浏览器的共享请求。 优选地, 所述第一共享模块具体设置为通过所述第一媒体通道向浏览器发送媒体 资源, 或者通过所述第一媒体通道接收所述浏览器发送的媒体资源。
根据本发明的又一个方面, 还提供了一种媒体资源共享***, 包括应用服务器、 浏览器以及上述的共享服务器, 其中: 所述应用服务器设置为根据所述共享请求向共享服务器及浏览器发送地址信息; 所述浏览器设置为通过双向通道向共享服务器发送共享请求, 还设置为与共享服务器 配合进行 ICE联通性测试, 并建立第一媒体通道, 还设置为通过第一媒体通道与共享 服务器共享媒体资源。 优选地, 所述应用服务器包括注册服务器和 ICE服务器。 本发明上述实施例提出的一种媒体资源共享的方法、 共享服务器及共享***, 浏 览器支持 Web RTC标准,共享服务器与浏览器可通过与应用服务器建立的双向通道进 行消息交互, 在共享服务器及浏览器分别获取自身及对方的地址信息后, 可进行 ICE 联通性测试并建立第一媒体通道, 通过第一媒体通道实现共享服务器及浏览器之间的 媒体资源共享, 由于很多浏览器都支持 Web RTC标准,故相比于现有技术中使用 NAT 穿越的方式来说, 本发明在服务器与浏览器之间资源共享适用的范围变大, 不需要专 门的客户端来完成; 相比于使用服务器中继的方式, 本发明在共享数据量较大的媒体 资源时, 对应用服务器资源的占用较低, 降低了成本, 节约了网络资源。 附图说明 图 1是本发明媒体资源共享的方法第一实施例的流程示意图; 图 2是本发明媒体资源共享的方法第二实施例的流程示意图; 图 3是图 2所示获取共享服务器与浏览器的地址信息的流程示意图; 图 4是图 2所示通过双向通道获取浏览器的共享请求的流程示意图; 图 5是本发明共享服务器第一实施例的结构示意图; 图 6是本发明共享服务器第二实施例的结构示意图; 图 7是图 6所示请求获取模块的结构示意图; 图 8是图 6所示地址信息获取模块的结构示意图; 以及 图 9是本发明实施例共享***的结构示意图。 为了使发明的技术方案更加清楚、 明了, 下面将结合附图作进一步详述。
具体实施方式 具体地, 如图 1所示, 本发明一实施例提出一种媒体资源共享的方法, 包括: 步骤 S101 , 共享服务器通过双向通道获取浏览器的共享请求; 其中, 双向通道为 Web Socket通道。 本实施例的浏览器支持 Web RTC(Web Real-Time Communication, 网页实时通信) 标准, Web RTC是一种支持网页浏览器进行实时语音对话或视频对话的技术。 共享服 务器与安装浏览器的设备处于不同的局域网内, 以共享服务器或者浏览器作为外部网 络访问对方时, 均需要通过一个 NAT (Network Address Translation, 网络地址转换) 设备, 以将网址进行转换并屏蔽内部网络的信息。 本实施例通过共享服务器及浏览器 分别与应用服务器建立的双向通道获取浏览器的共享请求。 Web Socket规范的目标是 在浏览器中实现和服务器端双向通信, 具有 Web Socket规范的浏览器包括 Firefox 4、 Chrome 4、 Opera 10.70以及 Safari 5浏览器等。 步骤 S102, 根据所述共享请求获取所述共享服务器与所述浏览器的地址信息; 本实施例中, 当共享服务器接收到共享请求后, 以应用服务器为中转, 向浏览器 返回共享请求的响应消息, 浏览器接收到响应消息后, 首先向应用服务器获取其地址 信息, 然后, 共享服务器也向应用服务器获取其地址信息。 共享服务器通过应用服务器获取共享服务器自身的及浏览器的地址信息, 而浏览 器通过应用服务器获取浏览器自身的及共享服务器的地址信息, 通过已知的自身的及 对方的地址信息才能够进行下一步的 ICE联通性测试。 其中, 地址信息包括 NAT地址与端口, 还包括中继的 IP地址及端口, NAT地址 与端口为共享服务器及浏览器各自的 NAT设备分配后发送给应用服务器,而中继的 IP 地址及端口则由应用服务器进行分配。 本实施例中优先使用 NAT地址与端口。 步骤 S103 ,根据获取的所述共享服务器与所述浏览器的地址信息与所述浏览器进 行 ICE联通性测试, 并建立第一媒体通道; ICE (Interactive Connectivity Establishment, 交互式连接建立) 是一种综合性的
NAT穿越的技术, 在 NAT穿越中较常用。 共享服务器及浏览器通过已知的自身的及对方的地址信息才能进行 ICE联通性测 试, 并建立第一媒体通道, 本实施例中所使用的地址信息包括 NAT地址及端口。
步骤 S104, 通过所述第一媒体通道与所述浏览器共享媒体资源。 共享服务器与浏览器通过第一媒体通道共享媒体资源, 媒体资源包括文字内容、 照片及视频等,在发送前打包为 UDP包后再发送,可以是共享服务器通过第一媒体通 道向浏览器发送媒体资源; 也可以是共享服务器通过第一媒体通道接收浏览器发送的 媒体资源, 并在共享服务器上保存浏览器发送的媒体资源。 与现有技术相比, 本实施例的浏览器支持 Web RTC标准, 共享服务器与浏览器可 通过与应用服务器建立的双向通道进行消息交互, 在共享服务器及浏览器分别获取自 身及对方的地址信息后, 可进行 ICE联通性测试并建立第一媒体通道, 通过第一媒体 通道实现共享服务器及浏览器之间的媒体资源共享, 由于很多浏览器都支持 Web RTC 标准, 故相比于现有技术中使用 NAT穿越的方式来说, 本实施例在服务器与浏览器之 间资源共享适用的范围变大, 不需要专门的客户端来完成; 相比于使用服务器中继的 方式, 本实施例在共享数据量较大的媒体资源时, 对应用服务器资源的占用较低, 降 低了成本, 节约了网络资源。
在一优选的实施例中, 如图 2所示, 本发明另一实施例提出一种媒体资源共享的 方法, 在上述实施例的基础上, 在上述步骤 S102之后, 还包括: 步骤 S105, 若所述第一媒体通道建立失败, 则以所述应用服务器为中继, 建立与 所述浏览器之间的第二媒体通道; 步骤 S106, 通过所述第二媒体通道与所述浏览器共享媒体资源。 本实施例在上述实施例的基础上, 更进一步解决了当共享服务器与浏览器之间的 第一媒体通道建立失败时, 由于共享服务器与浏览器通过应用服务器获取的地址信息 中包括中继的 IP地址及端口, 共享服务器与浏览器仍可以应用服务器为中继, 建立与 浏览器之间的第二媒体通道的问题, 并实现与浏览器共享媒体资源, 从而确保了共享 服务器与浏览器之间的正常通信。
在一优选的实施例中,如图 3所示,上述步骤 S101共享服务器通过双向通道获取 浏览器的共享请求的步骤包括: 步骤 S1011 , 所述共享服务器及所述浏览器分别与所述应用服务器建立双向通道;
步骤 S1012, 通过所述共享服务器及所述浏览器分别与所述应用服务器建立的双 向通道获取浏览器的共享请求。 本实施例具体为: 共享服务器与应用服务器进行 Web Socket的握手, 建立双向通 道, 以便实现共享服务器与应用服务器的双向通讯; 共享服务器向应用服务器上报自 身的状态, 即可用或不可用的状态; 浏览器访问应用服务器提供的查询共享服务列表 的页面,并加载该页面,浏览器与应用服务器进行 Web Socket的握手,建立双向通道, 以便实现浏览器与应用服务器的双向通讯, 浏览器通过双向通道向应用服务器发送共 享请求, 应用服务器把浏览器的共享要求通过双向通道转发给共享服务器。
在一优选的实施例中,如图 4所示,上述步骤 S102根据所述共享请求获取所述共 享服务器与所述浏览器的地址信息的步骤包括: 步骤 S1021 , 根据所述共享请求, 通过所述双向通道向应用服务器返回请求响应 消息, 由所述应用服务器通过所述双向通道将所述请求响应消息转发给所述浏览器; 步骤 S1022, 接收通过所述应用服务器获取的所述浏览器的 NAT地址与端口, 以 及所述共享服务器的 NAT地址与端口; 步骤 S1023 , 通过所述双向通道将所述共享服务器的 NAT地址与端口发送至所述 浏览器。
如图 5所示, 本发明一实施例提出一种共享服务器, 包括: 请求获取模块 101, 设置为通过双向通道获取浏览器的共享请求; 本实施例的浏览器支持 Web RTC(Web Real-Time Communication, 网页实时通信) 标准, Web RTC是一种支持网页浏览器进行实时语音对话或视频对话的技术。 共享服 务器与安装浏览器的设备处于不同的局域网内, 以共享服务器或者浏览器作为外部网 络访问对方时, 均需要通过一个 NAT (Network Address Translation, 网络地址转换) 设备, 以将网址进行转换并屏蔽内部网络的信息。 本实施例通过共享服务器及浏览器 分别与应用服务器建立的双向通道获取浏览器的共享请求。 Web Socket规范的目标是 在浏览器中实现和服务器端双向通信, 具有 Web Socket规范的浏览器包括 Firefox 4、 Chrome 4、 Opera 10.70以及 Safari 5浏览器等。
地址信息获取模块 102, 设置为根据所述共享请求获取所述共享服务器与所述浏 览器的地址信息; 本实施例中, 当接收到共享请求后, 以应用服务器为中转, 向浏览器返回共享请 求的响应消息, 浏览器接收到响应消息后, 首先向应用服务器获取其地址信息, 然后, 共享服务器也向应用服务器获取其地址信息。 共享服务器的地址信息获取模块 102通过应用服务器获取共享服务器自身的及浏 览器的地址信息, 而浏览器通过应用服务器获取浏览器自身的及共享服务器的地址信 息, 通过已知的自身的及对方的地址信息才能够进行 ICE联通性测试。 其中, 地址信息包括 NAT地址与端口, 还包括中继的 IP地址及端口, NAT地址 与端口为共享服务器及浏览器各自的 NAT设备分配后发送给应用服务器,而中继的 IP 地址及端口则由应用服务器进行分配。 本实施例中优先使用 NAT地址与端口。 第一建立模块 103, 设置为根据获取的所述共享服务器与所述浏览器的地址信息 与所述浏览器进行 ICE联通性测试, 并建立第一媒体通道;
ICE (Interactive Connectivity Establishment, 交互式连接建立) 是一种综合性的 NAT穿越的技术, 在 NAT穿越中较常用。 共享服务器的第一建立模块 103及浏览器通过已知的自身的及对方的地址信息才 能进行 ICE联通性测试,并建立第一媒体通道,本实施例中所使用的地址信息包括 NAT 地址及端口。 第一共享模块 104, 设置为通过所述第一媒体通道与所述浏览器共享媒体资源。 共享服务器的第一共享模块 103与浏览器通过第一媒体通道共享媒体资源, 媒体 资源包括文字内容、 照片及视频等, 可以是共享服务器的第一共享模块 103通过第一 媒体通道向浏览器发送媒体资源; 也可以是共享服务器的第一共享模块 103通过第一 媒体通道接收浏览器发送的媒体资源,并在共享服务器上保存浏览器发送的媒体资源。
如图 6所示, 本发明另一实施例提出一种共享服务器, 在上述图 5实施例的基础 上, 还包括: 第二建立模块 105, 设置为若所述第一媒体通道建立失败, 则以所述应用服务器 为中继, 建立与所述浏览器之间的第二媒体通道;
第二共享模块 106, 设置为通过所述第二媒体通道与所述浏览器共享媒体资源。 本实施例在上述实施例的基础上, 更进一步解决了当共享服务器的第一建立模块 102 与浏览器之间的第一媒体通道建立失败时, 由于共享服务器与浏览器通过应用服 务器获取的地址信息中包括中继的 IP地址及端口,共享服务器的第二建立模块 104与 浏览器仍可以应用服务器为中继, 建立与浏览器之间的第二媒体通道, 并实现与浏览 器共享媒体资源的问题。 从而确保了共享服务器与浏览器之间的正常通信。
在一优选的实施例中, 如图 7所示, 上述请求获取模块 101包括: 通道建立单元 1011, 设置为所述共享服务器及所述浏览器分别与所述应用服务器 建立双向通道; 请求获取单元 1012, 设置为通过所述共享服务器及所述浏览器分别与所述应用服 务器建立的双向通道获取浏览器的共享请求。
在一优选的实施例中, 如图 8所示, 上述地址信息获取模块 102包括: 返回单元 1021, 设置为根据所述共享请求, 通过所述双向通道向应用服务器返回 请求响应消息, 由所述应用服务器通过所述双向通道将所述请求响应消息转发给所述 浏览器; 接收单元 1022, 设置为接收通过所述应用服务器获取的所述浏览器的 NAT地址 与端口, 以及所述共享服务器的 NAT地址与端口; 发送单元 1023, 设置为通过所述双向通道将所述共享服务器的 NAT地址与端口 发送至所述浏览器。
本发明一实施例提出一种共享***, 包括: 应用服务器、浏览器以及共享服务器, 其中: 共享服务器设置为通过双向通道获取浏览器的共享请求, 根据共享请求获取共享 服务器与浏览器的地址信息, 根据获取的共享服务器与浏览器的地址信息与浏览器进 行 ICE联通性测试,并建立第一媒体通道,通过第一媒体通道与浏览器共享媒体资源;
应用服务器设置为根据所述共享请求向共享服务器及浏览器发送地址信息; 浏览器设置为通过双向通道向共享服务器发送共享请求, 还设置为与共享服务器 配合进行 ICE联通性测试, 并建立第一媒体通道, 还设置为通过第一媒体通道与共享 服务器共享媒体资源。
在一优选的实施例中, 如图 9所示, 为了减小上述应用服务器的负担并提高效率, 应用服务器也可以分为两个服务器, 即分为一个注册服务器及一个 ICE服务器。 注册 服务器用于共享服务器及浏览器注册各自经过 NAT设备后的对外访问地址,并作为共 享服务器及浏览器消息交互的中转服务器; 而 ICE服务器负责分配共享服务器及浏览 器各自的地址信息, 并作为共享服务器及浏览器建立第二媒体通道之后媒体资源共享 交互时的中转服务。 即, 内容共享服务器通过模拟 Web RTC标准的浏览器点对点连接 ( RTPPeerConnection )、 ICE和媒体流处理流程和消息与浏览器进行实时音视频通讯, 从而共享视频。 以下以应用服务器分为注册服务器及 ICE服务器为例进行详细说明: 1、 共享服务器与注册服务器进行 Web Socket的握手, 建立双向通道;
2、 共享服务器向注册服务器上报状态信息;
3、 浏览器访问注册服务器提供的查询共享服务器的页面, 并加载该页面;
4、 浏览器与注册服务器进行 Web Socket的握手, 建立双向通道;
5、 浏览器通过双向通道向注册服务器发送共享请求; 6、 注册服务器把共享请求通过双向通道转发给共享服务器;
7、 共享服务器通过双向通道向注册服务器返回响应信息;
8、 注册服务器把响应信息通过双向通道转发给浏览器;
9、 浏览器创建本地的 WebRTC 连接, 获取该连接对应的媒体面信息 (Session Description Protocol, 简称 SDP)并注册到本地 WebRTC连接上。 同时, 浏览器向 ICE 服务器请求获取浏览器的 NAT外网地址端口对和 /或 ICE服务器分配给自己的中继地 址端口对;
10、 ICE服务器将上述地址端口对(NAT地址和端口、 中继 IP和端口等)列表信 息返回给浏览器;
11、 浏览器将自身的列表信息以及本地的媒体面信息发送给注册服务器;
12、 注册服务器将浏览器的列表信息以及浏览器的本地的媒体面信息发送给共享 服务器;
13、 内容共享服务器创建与浏览器对应的本地 WebRTC连接, 获取自己这一侧的 媒体面信息并注册到本地 WebRTC连接上。 同时, 共享服务器向 ICE服务器请求获取 NAT设备 1的对外地址端口对和 /或 ICE服务器分配给自己的中继地址端口对;
14、 ICE服务器将上述地址端口 (NAT地址和端口、 中继 IP和端口等)返回给浏 览器;
15、 共享服务器将自身的列表信息以及本地的媒体面信息发送给注册服务器;
16、 注册服务器将共享服务器的列表信息以及媒体面信息发送给浏览器, 如此, 浏览器与共享服务器之间的 WebRTC连接信息完成了协商。;
17、浏览器与共享服务器之间根据已知的对方的 NAT地址和端口进行 ICE联通性 测试, 建立第一媒体通道;
18、 共享服务器通过它与浏览器之间的 WebRTC连接通道, 将所需的视频流按照 WebRTC标准的 SRTP ( Secure Real-time Transport Protocol, 安全实时传输协议) 格式 发送给浏览器;
19、 浏览器接收上述 WebRTC标准视频流并通过 HTML5 video API播放视频。 本实施例中, 共享服务器与注册服务器进行 Web Socket通信, 与浏览器进行点对 点 UDP通信, 与 ICE服务器进行 TCP通信。 在另一优选实施例中, 基于支持 Web RTC标准的浏览器实现图片上传。 共享 服务器通过模拟 Web RTC标准的浏览器点对点连接 (称之为 RTCPeerConnection) 及其附属的数据通道 (称之为 DataChannel)、 ICE和媒体流处理流程和消息与浏览 器进行实时音视频通讯, 从而将浏览器发送来的图片流保存。 具体步骤如下:
1、 共享服务器与注册服务器进行 Web Socket的握手, 建立 Web Socket通道, 以便实现共享服务器与注册服务器的双向通讯。
2、 共享服务器向注册服务器上报内容共享服务的状态。
3、 浏览器访问注册服务器提供的查询内容共享服务列表的页面, 并加载该页 面。
4、 浏览器与注册服务器进行 Web Socket的握手, 建立 Web Socket通道, 以 便实现浏览器与注册服务器的双向通讯。
5、浏览器通过 Web Socket通道向注册服务器发送要求上传图片文件到共享服 务器。
6、注册服务器把浏览器要求上传图片文件的请求通过 Web Socket通道转发给 共享服务器。 7、共享服务器通过 Web Socket通道向注册服务器返回请求响应, 可以进行内 容上传。
8、注册服务器把共享服务器返回的请求响应通过 Web Socket通道转发给浏览 器。
9、 浏览器创建本地的 WebRTC连接, 利用该连接创建本地数据通道。 之后, 获取该连接对应的媒体面信息和数据通道的参数信息, 并统一注册到本地 WebRTC 连接上。 同时, 浏览器向 ICE服务器请求获取浏览器的 NAT外网地址端口对和 /或 ICE服务器分配给自己的中继地址端口对。
10、 ICE服务器将上述地址端口对返回给浏览器。
11、 浏览器将自己从 ICE服务器获取的 IP和端口列表信息及媒体面信息、 数 据通道参数信息等告知注册服务器。
12、 注册服务器将浏览器的 IP和端口列表信息、 媒体面信息和数据通道参数 信息等告知共享服务器。
13、 内容共享服务器创建与浏览器对应的本地 WebRTC连接, 并根据浏览器 侧的数据通道参数创建本地的与浏览器侧相对应的数据通道。 之后, 获取自己这一 侧的媒体面信息并注册到本地 WebRTC连接上。 同时, 共享服务器向 ICE服务器请 求获取共享服务器的 NAT对外地址端口对和 /或 ICE服务器分配给自己的中继地址 端口对。
14、 ICE服务器将上述地址端口对返回给共享服务器。
15、 共享服务器将自己从 ICE服务器获取的 IP和端口列表信息、 本地媒体面 信息告知注册服务器。
16、 注册服务器共享服务器的 IP和端口列表信息、 共享服务器侧的媒体面信 息等告知浏览器。
17、 浏览器与共享服务器之间根据已知的对方的 IP和端口列表信息进行 ICE 联通性测试, 建立数据通道。
18、浏览器利用数据通道将所需上传的图片、文本等按照 WebRTC标准的 SCTP ( Stream Control Transmission Protocol, 流控制传输协议) 格式发送给共享服务器。 19、 内容共享服务器 C侧的数据通道接收并保存图片文件。 通过上面的描述可以看出: 本发明的浏览器支持 Web RTC标准, 共享服务器与浏 览器可通过与应用服务器建立的双向通道进行消息交互, 在共享服务器及浏览器分别 获取自身及对方的地址信息后, 可进行 ICE联通性测试并建立第一媒体通道, 通过第 一媒体通道实现共享服务器及浏览器之间的媒体资源共享, 由于很多浏览器都支持 Web RTC标准, 故相比于现有技术中使用 NAT穿越的方式来说, 本发明例在服务器 与浏览器之间资源共享适用的范围变大, 不需要专门的客户端来完成; 相比于使用服 务器中继的方式, 本发明在共享数据量较大的媒体资源时, 对应用服务器资源的占用 较低, 节约了网络资源; 当共享服务器与浏览器之间的第一媒体通道建立失败时, 共 享服务器与浏览器仍可以应用服务器为中继, 建立与浏览器之间的第二媒体通道, 并 实现与浏览器共享媒体资源, 从而确保了共享服务器与浏览器之间的正常通信。 以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用 本发明说明书及附图内容所作的等效结构或流程变换, 或直接或间接运用在其它相关 的技术领域, 均同理包括在本发明的专利保护范围内。
Claims
1. 一种媒体资源共享的方法, 包括: 共享服务器通过双向通道获取浏览器的共享请求;
根据所述共享请求获取所述共享服务器与所述浏览器的地址信息; 根据获取的所述共享服务器与所述浏览器的地址信息与所述浏览器进行
ICE联通性测试, 并建立第一媒体通道; 通过所述第一媒体通道与所述浏览器共享媒体资源。
2. 根据权利要求 1所述的方法, 其中, 所述根据所述共享请求获取所述共享服务 器与所述浏览器的地址信息的步骤包括:
根据所述共享请求, 通过所述双向通道向应用服务器返回请求响应消息, 由所述应用服务器通过所述双向通道将所述请求响应消息转发给所述浏览器; 接收通过所述应用服务器获取的所述浏览器的 NAT地址与端口,以及所述 共享服务器的 NAT地址与端口; 通过所述双向通道将所述共享服务器的 NAT 地址与端口发送至所述浏览 器。
3. 根据权利要求 2所述的方法, 其中, 所述根据获取的所述共享服务器与所述浏 览器的地址信息与所述浏览器进行 ICE联通性测试, 并建立第一媒体通道的步 骤包括:
根据获取的所述共享服务器与所述浏览器的 NAT 地址及端口与所述浏览 器进行 ICE联通性测试, 并建立第一媒体通道。
4. 根据权利要求 2所述的方法, 其中, 所述根据获取的所述共享服务器与所述浏 览器的地址信息与所述浏览器进行 ICE联通性测试, 并建立第一媒体通道的步 骤之后还包括: 若所述第一媒体通道建立失败, 则以所述应用服务器为中继, 建立与所述 浏览器之间的第二媒体通道;
通过所述第二媒体通道与所述浏览器共享媒体资源。
5. 根据权利要求 2所述的方法, 其中, 所述共享服务器通过双向通道获取浏览器 的共享请求的步骤包括: 所述共享服务器及所述浏览器分别与所述应用服务器建立双向通道; 通过所述共享服务器及所述浏览器分别与所述应用服务器建立的双向通道 获取浏览器的共享请求。
6. 根据权利要求 1所述的方法, 其中, 所述通过第一媒体通道与所述浏览器共享 媒体资源的步骤包括: 通过所述第一媒体通道向浏览器发送媒体资源, 或者通 过所述第一媒体通道接收所述浏览器发送的媒体资源。
7. 一种媒体资源共享服务器, 包括: 请求获取模块, 设置为通过双向通道获取浏览器的共享请求; 地址信息获取模块, 设置为根据所述共享请求获取所述共享服务器与所述 浏览器的地址信息; 第一建立模块, 设置为根据获取的所述共享服务器与所述浏览器的地址信 息与所述浏览器进行 ICE联通性测试, 并建立第一媒体通道; 第一共享模块,设置为通过所述第一媒体通道与所述浏览器共享媒体资源。
8. 根据权利要求 7所述的共享服务器, 其中, 所述地址信息获取模块包括: 返回单元, 设置为根据所述共享请求, 通过所述双向通道向应用服务器返 回请求响应消息, 由所述应用服务器通过所述双向通道将所述请求响应消息转 发给所述浏览器;
接收单元,设置为接收通过所述应用服务器获取的所述浏览器的 NAT地址 与端口, 以及所述共享服务器的 NAT地址与端口;
发送单元,设置为通过所述双向通道将所述共享服务器的 NAT地址与端口 发送至所述浏览器。
9. 根据权利要求 8所述的共享服务器, 其中, 所述第一建立模块具体设置为根据 获取的所述共享服务器与所述浏览器的 NAT地址及端口与所述浏览器进行 ICE 联通性测试, 并建立第一媒体通道。
10. 根据权利要求 8所述的共享服务器, 其中, 还包括: 第二建立模块, 设置为若所述第一媒体通道建立失败, 则以所述应用服务 器为中继, 建立与所述浏览器之间的第二媒体通道; 第二共享模块,设置为通过所述第二媒体通道与所述浏览器共享媒体资源。
11. 根据权利要求 8所述的共享服务器, 其中, 所述请求获取模块包括: 通道建立单元, 设置为所述共享服务器及所述浏览器分别与所述应用服务 器建立双向通道;
请求获取单元, 设置为通过所述共享服务器及所述浏览器分别与所述应用 服务器建立的双向通道获取浏览器的共享请求。
12. 根据权利要求 7所述的共享服务器, 其中, 所述第一共享模块具体设置为通过 所述第一媒体通道向浏览器发送媒体资源, 或者通过所述第一媒体通道接收所 述浏览器发送的媒体资源。
13. 一种媒体资源共享***,包括应用服务器、浏览器以及权利要求 7至 12任一项 所述的共享服务器, 其中:
所述应用服务器设置为根据所述共享请求向共享服务器及浏览器发送地址 信息; 所述浏览器设置为通过双向通道向共享服务器发送共享请求, 还设置为 与共享服务器配合进行 ICE联通性测试, 并建立第一媒体通道, 还设置为通过 第一媒体通道与共享服务器共享媒体资源。 根据权利要求 13 所述的共享***, 其中, 所述应用服务器包括注册服务器和 ICE服务器。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP14867542.4A EP3079328B1 (en) | 2013-12-05 | 2014-06-23 | Media resource sharing method, shared server and shared system |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310653199.3 | 2013-12-05 | ||
CN201310653199.3A CN104702565B (zh) | 2013-12-05 | 2013-12-05 | 媒体资源共享的方法、共享服务器及共享*** |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015081691A1 true WO2015081691A1 (zh) | 2015-06-11 |
Family
ID=53272823
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/080547 WO2015081691A1 (zh) | 2013-12-05 | 2014-06-23 | 媒体资源共享的方法、共享服务器及共享*** |
Country Status (3)
Country | Link |
---|---|
EP (1) | EP3079328B1 (zh) |
CN (1) | CN104702565B (zh) |
WO (1) | WO2015081691A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110392071B (zh) * | 2018-04-18 | 2021-06-22 | 网宿科技股份有限公司 | 流媒体资源的上传、下载方法、分发***及流媒体服务器 |
CN111371829A (zh) * | 2019-10-12 | 2020-07-03 | 杭州海康威视***技术有限公司 | 数据共享方法及装置、终端、服务器和存储介质 |
CN113824803A (zh) * | 2021-11-24 | 2021-12-21 | 飞狐信息技术(天津)有限公司 | 一种多媒体文件共享的方法及相关装置 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1968226A (zh) * | 2006-04-18 | 2007-05-23 | 华为技术有限公司 | 点对点通信中穿越网络地址转换的方法 |
CN102457580A (zh) * | 2010-10-18 | 2012-05-16 | 中兴通讯股份有限公司 | Nat穿越方法及*** |
WO2013107504A1 (en) * | 2012-01-17 | 2013-07-25 | Telefonaktiebolaget L M Ericsson (Publ) | Ice based nat traversal |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100426769C (zh) * | 2005-01-12 | 2008-10-15 | 腾讯科技(深圳)有限公司 | 一种建立对等直连通道的方法 |
CN101478493B (zh) * | 2009-02-10 | 2011-02-02 | 杭州华三通信技术有限公司 | 一种穿越nat的通信方法及设备 |
US7941551B2 (en) * | 2009-02-25 | 2011-05-10 | Microsoft Corporation | Tunneling of remote desktop sessions through firewalls |
CN102447749B (zh) * | 2010-10-15 | 2015-10-28 | 中兴通讯股份有限公司 | 支持nat穿越的集中式p2p***、nat穿越的方法 |
US8601144B1 (en) * | 2012-11-27 | 2013-12-03 | Sansay, Inc. | Systems and methods for automatic ICE relay candidate creation |
-
2013
- 2013-12-05 CN CN201310653199.3A patent/CN104702565B/zh active Active
-
2014
- 2014-06-23 EP EP14867542.4A patent/EP3079328B1/en active Active
- 2014-06-23 WO PCT/CN2014/080547 patent/WO2015081691A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1968226A (zh) * | 2006-04-18 | 2007-05-23 | 华为技术有限公司 | 点对点通信中穿越网络地址转换的方法 |
CN102457580A (zh) * | 2010-10-18 | 2012-05-16 | 中兴通讯股份有限公司 | Nat穿越方法及*** |
WO2013107504A1 (en) * | 2012-01-17 | 2013-07-25 | Telefonaktiebolaget L M Ericsson (Publ) | Ice based nat traversal |
Also Published As
Publication number | Publication date |
---|---|
CN104702565B (zh) | 2019-09-17 |
EP3079328B1 (en) | 2019-06-05 |
EP3079328A4 (en) | 2016-11-30 |
CN104702565A (zh) | 2015-06-10 |
EP3079328A1 (en) | 2016-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230061245A1 (en) | System and Method for Using a Proxy to Communicate Between Secure and Unsecure Devices | |
US20190379735A1 (en) | Method and apparatus for multimedia communication, and storage medium | |
EP3996355B1 (en) | Method for transferring media stream and user equipment | |
CN108259542B (zh) | 资源的传输方法和装置 | |
EP2688307A1 (en) | Wireless communication system for offline participation in a display session | |
JP6983218B2 (ja) | データグラムベースのトランスポート層を介したカプセル化メディアトラフィックの効率的転送 | |
US20140304419A1 (en) | System and terminal for p2p connection in mobile environment and method for p2p connection using the same | |
JP2012501133A (ja) | 固定マルチメディア・デバイスと移動マルチメディア・デバイスの間でビデオ・セッションを移すための方法 | |
US20230291706A1 (en) | Method for accessing network, media gateway, electronic device and storage medium | |
JP6511624B2 (ja) | マルチメディア共有方法、登録方法、サーバー及びプロキシサーバー | |
WO2013155939A1 (zh) | 因特网与运营商网络业务共享方法、服务方及网页网关 | |
WO2015081691A1 (zh) | 媒体资源共享的方法、共享服务器及共享*** | |
JP6393475B2 (ja) | 通信アダプタ装置、通信システム、トンネル通信方法、及びプログラム | |
CN103516573B (zh) | 受限网络中客户端之间的数据传输方法和客户端 | |
WO2016206554A1 (zh) | 数据接收、发送的方法及装置 | |
US20240007509A1 (en) | Interactive calling for internet-of-things | |
CN101094159B (zh) | 一种媒体流私网穿透的方法 | |
CN105812909A (zh) | 一种视频传输方法及装置 | |
JP5586689B2 (ja) | ホームネットワーク、ホームネットワーク間での装置情報共有方法、及びホームネットワークシステム | |
JP5438230B2 (ja) | インターネット接続システム | |
JP5723808B2 (ja) | 通信装置、通信方法、及びプログラム | |
WO2014180415A1 (zh) | 媒体流报文的nat穿越方法、mdu及iptv*** | |
CN116708381B (zh) | 跨网络的数据传输方法、装置和存储介质及电子设备 | |
CN108307149B (zh) | 一种视频代理***及监控方法 | |
KR101151744B1 (ko) | 네트웍 대역이 다른 dvr과 cms 간의 연결 방법 및 그 시스템 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14867542 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
REEP | Request for entry into the european phase |
Ref document number: 2014867542 Country of ref document: EP |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2014867542 Country of ref document: EP |