[go: up one dir, main page]

CN104168457B - Method and device for playing multiple media streams on demand - Google Patents

Method and device for playing multiple media streams on demand Download PDF

Info

Publication number
CN104168457B
CN104168457B CN201410406922.2A CN201410406922A CN104168457B CN 104168457 B CN104168457 B CN 104168457B CN 201410406922 A CN201410406922 A CN 201410406922A CN 104168457 B CN104168457 B CN 104168457B
Authority
CN
China
Prior art keywords
video monitoring
video
client
port number
video surveillance
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.)
Active
Application number
CN201410406922.2A
Other languages
Chinese (zh)
Other versions
CN104168457A (en
Inventor
周迪
陈伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201410406922.2A priority Critical patent/CN104168457B/en
Publication of CN104168457A publication Critical patent/CN104168457A/en
Application granted granted Critical
Publication of CN104168457B publication Critical patent/CN104168457B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明提供一种多路媒体流点播方法及装置,方法包括:使用第一业务链路向视频监控客户端发送目标通道媒体流业务建立通知报文,业务建立通知报文携带视频监控设备的私网IP地址、期望私网端口号,和被NAT网关设备转换后的公网IP地址、期望公网端口号;接收视频监控客户端发送到公网IP地址和期望公网端口号的业务引流报文,建立视频监控设备和视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。利用本发明减少了STUN穿越的打洞过程,提高了监控业务的效率。

The present invention provides a multi-channel media stream on-demand method and device. The method includes: using the first service link to send a target channel media stream service establishment notification message to the video surveillance client, and the service establishment notification message carries the private key of the video surveillance device. Network IP address, expected private network port number, and public network IP address converted by the NAT gateway device, expected public network port number; receive the service diversion report sent by the video surveillance client to the public network IP address and expected public network port number document, establishing a second service link between the video surveillance equipment and the video surveillance client, the diversion message carrying the target channel identifier; using the second service link, sending the media stream of the target channel to the video surveillance client end. Utilizing the invention reduces the hole punching process of STUN traversal and improves the efficiency of monitoring services.

Description

一种多路媒体流点播方法及装置A multi-channel media stream on-demand method and device

技术领域technical field

本发明涉及视频监控技术领域,特别涉及一种多路媒体流点播方法及装置。The invention relates to the technical field of video monitoring, in particular to a multi-channel media stream on-demand method and device.

背景技术Background technique

为了节省公网IP地址的数量和保护私网安全,运营商会在私网出口位置部署NAT(Network Address Translation,网络地址转换)网关设备,该NAT网关设备用于对私网IP地址和公网IP地址进行相互转换,其中,NAT网关设备可以将多个私网IP地址转换为相同的一个公网IP地址,只需利用转换后的不同端口号来区分所对应的私网IP地址。如图1所示,NAT网关设备可以将私网内的(IP1,Port1)、(IP2,Port2)、(IP3,Port3)分别转换为公网的(IPA,PortA1)、(IPA,PortA2)、(IPA,PortA3)。In order to save the number of public network IP addresses and protect private network security, operators will deploy NAT (Network Address Translation, Network Address Translation) gateway devices at the egress of private networks. The addresses are converted to each other. Among them, the NAT gateway device can convert multiple private network IP addresses into the same public network IP address, and only need to use different port numbers after conversion to distinguish the corresponding private network IP addresses. As shown in Figure 1, the NAT gateway device can convert (IP1, Port1), (IP2, Port2), (IP3, Port3) in the private network to (IPA, PortA1), (IPA, PortA2) and (IPA, PortA3).

以视频监控领域为例,视频监控客户端和视频监控设备可以分别位于不同的私网,并且可能是各自均位于某个NAT网关设备下。当视频监控客户端与视频监控设备之间要进行P2P的信令交互和媒体数据传输时,需要通过STUN(Simple Traversal of UDP overNATs,NAT的UDP简单穿越)探测和STUN穿越过程才能通信。Taking the video surveillance field as an example, the video surveillance client and the video surveillance device may be located in different private networks, and may be located under a certain NAT gateway device. When P2P signaling interaction and media data transmission are to be performed between the video surveillance client and the video surveillance device, STUN (Simple Traversal of UDP over NATs, UDP simple traversal of NAT) detection and STUN traversal process are required to communicate.

假设视频监控设备下有一路摄像机,当视频监控客户端要查看该路摄像机对应的实况媒体流数据时,首先,执行STUN探测,通过探测,视频监控设备可以获知该视频监控设备的私网IP地址和发送该摄像机当前实况流的本地端口号在NAT网关设备转换后对应的公网IP地址和公网端口号,例如,假设视频监控设备的私网IP地址是b,当前使用的本地端口号是b1,STUN探测后获得NAT网关设备将(b,b1)转换后对应的(B,B1)。同理,视频监控客户端经过STUN探测获取其私网IP地址和某个端口号被其连接的NAT网关设备转换后的公网IP地址和端口号(C,C1)。经过STUN探测后,接着执行STUN穿越,主要是视频监控客户端与视频监控设备根据探测获得的对端的公网IP地址和公网端口号(可以是由视频服务器相互双方探测信息),通过打洞报文来打通业务链路,比如视频监控客户端打通与上述视频监控设备的(B,B1)之间的业务链路后,视频监控设备和视频监控客户端之间可以开始通信传输实况媒体流数据。Assuming that there is a camera under the video surveillance device, when the video surveillance client wants to view the live media stream data corresponding to the camera, first, perform STUN detection. Through the detection, the video surveillance device can learn the private network IP address of the video surveillance device and the corresponding public network IP address and public network port number of the local port number that sends the current live stream of the camera after conversion by the NAT gateway device. For example, suppose the private network IP address of the video surveillance device is b, and the current local port number is b1, the corresponding (B, B1) after the conversion of (b, b1) by the NAT gateway device is obtained after the STUN detection. Similarly, the video surveillance client obtains its private network IP address and a public network IP address and port number (C, C1) converted by the NAT gateway device connected to it through STUN detection. After the STUN detection, STUN traversal is performed, mainly the public network IP address and public network port number of the opposite end obtained by the video surveillance client and the video surveillance device according to the detection (the information can be detected by both parties of the video server), through hole punching For example, after the video surveillance client opens up the service link with (B, B1) of the video surveillance device above, the video surveillance device and the video surveillance client can start communicating and transmitting live media streams data.

上述是以监控客户端点播一路实况码流为例,如果同时进行多路摄像机实况点播业务,则需要重复进行STUN探测和STUN穿越,不断重复STUN探测过程会引入更多的额外的延时,对监控业务的实时性要求有影响,监控业务的效率很低。The above is an example of a monitoring client ordering one live stream. If multiple cameras are performing live ordering services at the same time, STUN detection and STUN traversal need to be repeated. Repeating the STUN detection process will introduce more additional delays. The real-time requirements of the monitoring service are affected, and the efficiency of the monitoring service is very low.

发明内容Contents of the invention

有鉴于此,本发明提供一种多路媒体流点播方法及装置,以提高监控效率。In view of this, the present invention provides a multi-channel media stream on-demand method and device to improve monitoring efficiency.

本发明实施例提供了一种多路媒体流点播方法,应用于位于监控组网中的视频监控设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述监控组网还包括视频监控客户端和网络地址转换NAT网关设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,所述方法包括:The embodiment of the present invention provides a multi-channel media stream on-demand method, which is applied to video monitoring equipment located in the monitoring network. The video monitoring equipment manages multiple channels, and each channel corresponds to an image acquisition device. The monitoring group The network also includes a video monitoring client and a network address translation NAT gateway device, the video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through the NAT gateway device, and the method includes:

接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;receiving a target channel media stream service request message, and receiving a multiplexed first service link notification message, where the first service link is an established transmission link between the video surveillance device and the video surveillance client;

使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号、以及目标通道标识、和被所述视频监控设备的出口NAT网关设备转换后私网IP地址对应的公网IP地址、期望私网端口号对应的期望公网端口号;Use the IP address and port number of the video surveillance equipment side of the first service link as the source IP address and source port number, and use the IP address and port number of the video surveillance client side of the first service link as the destination IP Address and destination port number, send the target channel media flow service establishment notification message to the video monitoring client, the service establishment notification message carries the private network IP address and the expected private network port number of the video monitoring device, so The desired private network port number is the expected private network port number used by the video monitoring device to send the target channel media stream, and the target channel identifier, and the private network IP address after being converted by the egress NAT gateway device of the video monitoring device The corresponding public network IP address, the desired public network port number corresponding to the desired private network port number;

接收所述视频监控客户端发送到所述公网IP地址和所述期望公网端口号的业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;receiving the service diversion message sent by the video surveillance client to the public network IP address and the desired public network port number, establishing a second service link between the video surveillance device and the video surveillance client, the The diversion message carries the target channel identifier;

利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。Using the second service link, send the media stream of the target channel to the video surveillance client.

本发明实施例还提供了一种多路媒体流点播方法,应用于位于监控组网中的视频监控客户端,所述监控组网还包括视频监控设备和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,所述方法包括:The embodiment of the present invention also provides a multi-channel media stream on-demand method, which is applied to a video monitoring client located in a monitoring network. The monitoring network also includes a video monitoring device and a NAT gateway device. The video monitoring device manages A plurality of channels, each channel corresponds to an image acquisition device, the video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through a NAT gateway device, and the method includes:

发送请求获取所述视频监控设备目标通道媒体流的报文;Sending a message requesting to obtain the media stream of the target channel of the video monitoring device;

接收所述视频监控设备复用第一业务链路发送的目标通道媒体流业务建立通知报文,所述第一业务链路是所述视频监控客户端和所述视频监控设备已建立的传输链路,所述业务建立通知报文携带目标通道标识、所述视频监控设备的私网IP地址和所述视频监控设备发送目标通道媒体流的期望私网端口号、以及经过所述视频监控设备出口NAT网关设备转换所述私网IP地址得到的公网IP地址和转换期望私网端口号得到的期望公网端口号;receiving the target channel media stream service establishment notification message sent by the video surveillance device multiplexing the first service link, the first service link being the established transmission link between the video surveillance client and the video surveillance device The service establishment notification message carries the target channel identifier, the private network IP address of the video monitoring device and the expected private network port number for the video monitoring device to send the media stream of the target channel, and the exit port number of the video monitoring device The NAT gateway device converts the public network IP address obtained by the private network IP address and the desired public network port number obtained by converting the desired private network port number;

在确定所述业务建立通知报文中的所述目标通道标识为请求获取媒体流的通道标识后,向所述公网IP地址和所述期望公网端口号发送引流报文,建立所述视频监控客户端和所述视频监控设备的第二业务链路;After determining that the target channel identifier in the service establishment notification message is a channel identifier requesting to obtain a media stream, a flow diversion message is sent to the public network IP address and the expected public network port number to establish the video monitoring the second service link between the client and the video monitoring device;

接收所述视频监控设备基于第二业务链路发送的目标通道媒体流数据。The target channel media stream data sent by the video monitoring device based on the second service link is received.

本发明实施例还提供了一种多路媒体流点播方法,应用于视频监控网络,所述视频监控网络包括视频监控客户端、视频监控设备、视频监控服务器和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控服务器位于公网,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,所述方法包括:The embodiment of the present invention also provides a multi-channel media stream on-demand method, which is applied to a video surveillance network. The video surveillance network includes a video surveillance client, a video surveillance device, a video surveillance server, and a NAT gateway device. The video surveillance device Manage a plurality of channels, each channel corresponds to an image acquisition device, the video monitoring server is located in the public network, the video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through a NAT gateway device, so The methods described include:

视频监控客户端向视频监控服务器发送请求获取视频监控设备目标通道媒体流业务请求报文;The video monitoring client sends a request message to the video monitoring server to obtain the media stream service of the target channel of the video monitoring device;

所述视频监控服务器查询监控关系表,查看所述视频监控客户端和所述视频监控设备是否已经建立媒体监控关系,如果否,则所述视频监控客户端和所述视频监控设备进行NAT的UDP简单穿越STUN探测和STUN穿越,建立所述视频监控客户端和所述视频监控设备之间的传输链路,所述视频监控设备把所述目标通道媒体流发给所述视频监控客户端,如果是,则继续;The video monitoring server queries the monitoring relationship table, checks whether the video monitoring client and the video monitoring device have established a media monitoring relationship, if not, then the video monitoring client and the video monitoring device perform NAT UDP Simple traversal of STUN detection and STUN traversal, establishing a transmission link between the video surveillance client and the video surveillance device, the video surveillance device sends the target channel media stream to the video surveillance client, if Yes, continue;

视频监控服务器向视频监控设备和视频监控客户端发送复用第一业务链路的报文,并且向视频监控设备发送所述视频监控客户端请求的目标通道媒体流业务请求报文;The video monitoring server sends a message for multiplexing the first service link to the video monitoring device and the video monitoring client, and sends the target channel media stream service request message requested by the video monitoring client to the video monitoring device;

视频监控设备接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;The video monitoring device receives the target channel media stream service request message, and receives the multiplexed first service link notification message, and the first service link is the established transmission link between the video monitoring device and the video monitoring client link;

视频监控设备使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号、以及目标通道标识,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号;The video surveillance device uses the IP address and port number of the video surveillance device side of the first service link as the source IP address and source port number, and uses the IP address and port number of the video surveillance client side of the first service link As the purpose IP address and purpose port number, send the target channel media stream service establishment notification message to the video monitoring client, and the service establishment notice message carries the private network IP address and the desired private network port of the video monitoring device number, and the target channel identification, the desired private network port number is the desired private network port number used by the video surveillance equipment to send the target channel media stream;

视频监控设备所在出口的NAT网关设备在所述业务建立通知报文中填充所述私网IP地址转换得到的公网IP地址、所述期望私网端口号转换得到的期望公网端口号;The NAT gateway device at the exit where the video monitoring device is located fills in the service establishment notification message with the public network IP address obtained by the conversion of the private network IP address and the desired public network port number obtained by the conversion of the desired private network port number;

视频监控客户端收到所述业务建立通知报文,如果所述报文中携带的通道标识和请求的通道标识相同,则向所述业务建立通知报文中所述公网IP地址和所述期望公网端口号发送业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;The video surveillance client receives the service establishment notification message, and if the channel identifier carried in the message is the same as the requested channel identifier, then the public network IP address in the service establishment notification message and the It is expected that the public network port number sends a service diversion message, and establishes a second service link between the video surveillance device and the video surveillance client, and the diversion message carries a target channel identifier;

视频监控设备利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The video surveillance device sends the media stream of the target channel to the video surveillance client by using the second service link.

本发明实施例还提供了一种视频监控设备,位于视频监控组网中,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述监控组网还包括视频监控客户端和网络地址转换NAT网关设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,包括:The embodiment of the present invention also provides a video monitoring device, located in a video monitoring network, the video monitoring device manages multiple channels, each channel corresponds to an image acquisition device, and the monitoring network also includes a video monitoring client And network address translation NAT gateway equipment, described video surveillance client and video surveillance equipment are positioned at different private networks, are connected with public network through NAT gateway equipment respectively, comprise:

接收单元,用于接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;A receiving unit, configured to receive a target channel media stream service request message, and receive a multiplexed first service link notification message, the first service link being established by the video surveillance device and the video surveillance client transmission link;

发送单元,用于使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号、以及目标通道标识、和被所述视频监控设备的出口NAT网关设备转换后私网IP地址对应的公网IP地址、期望私网端口号对应的期望公网端口号;A sending unit, configured to use the IP address and port number of the video surveillance device side of the first service link as the source IP address and source port number, and use the IP address and port number of the video surveillance client side of the first service link The port number is used as the destination IP address and the destination port number to send the target channel media stream service establishment notification message to the video surveillance client, and the service establishment notification message carries the private network IP address of the video surveillance device, the expected private network Network port number, the desired private network port number is the expected private network port number used by the video monitoring device to send the target channel media stream, and the target channel identifier, and is converted by the egress NAT gateway device of the video monitoring device The public network IP address corresponding to the private network IP address, and the desired public network port number corresponding to the desired private network port number;

建立单元,用于接收所述视频监控客户端发送到所述公网IP地址和所述期望公网端口号的业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;An establishment unit, configured to receive a service diversion packet sent by the video surveillance client to the public network IP address and the desired public network port number, and establish a second service between the video surveillance device and the video surveillance client link, the diversion message carries a target channel identifier;

所述发送单元,还用于利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The sending unit is further configured to use the second service link to send the media stream of the target channel to the video surveillance client.

本发明实施例还提供了一种视频监控客户端,位于视频监控组网中,所述监控组网还包括视频监控设备和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,包括:The embodiment of the present invention also provides a video surveillance client, which is located in a video surveillance network. The surveillance network also includes a video surveillance device and a NAT gateway device. The video surveillance device manages multiple channels, and each channel corresponds to An image acquisition device, the video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through a NAT gateway device, including:

发送单元,用于发送请求获取所述视频监控设备目标通道媒体流的报文;A sending unit, configured to send a message requesting to obtain the media stream of the target channel of the video monitoring device;

接收单元,用于接收所述视频监控设备复用第一业务链路发送的目标通道媒体流业务建立通知报文,所述第一业务链路是所述视频监控客户端和所述视频监控设备已建立的传输链路,所述业务建立通知报文携带目标通道标识、所述视频监控设备的私网IP地址和所述视频监控设备发送目标通道媒体流的期望私网端口号、以及经过所述视频监控设备出口NAT网关设备转换所述私网IP地址得到的公网IP地址和转换期望私网端口号得到的期望公网端口号;A receiving unit, configured to receive a target channel media stream service establishment notification message sent by the video monitoring device by multiplexing the first service link, the first service link being the video monitoring client and the video monitoring device The transmission link that has been established, the service establishment notification message carries the target channel identifier, the private network IP address of the video monitoring device and the desired private network port number for the video monitoring device to send the media stream of the target channel, and the The public network IP address obtained by converting the private network IP address and the desired public network port number obtained by converting the desired private network port number through the NAT gateway device at the exit of the video surveillance equipment;

建立单元,用于在确定所述业务建立通知报文中的所述目标通道标识为请求获取媒体流的通道标识后,向所述公网IP地址和所述期望公网端口号发送引流报文,建立所述视频监控客户端和所述视频监控设备的第二业务链路;An establishment unit, configured to send a diversion message to the public network IP address and the desired public network port number after determining that the target channel identifier in the service establishment notification message is a channel identifier requesting to obtain a media stream , establishing a second service link between the video surveillance client and the video surveillance device;

所述接收单元,还用于接收所述视频监控设备基于第二业务链路发送的目标通道媒体流数据。The receiving unit is further configured to receive target channel media stream data sent by the video monitoring device based on the second service link.

本发明实施例提供了一种视频监控网络,所述视频监控网络包括视频监控客户端、视频监控设备、视频监控服务器和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控服务器位于公网,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,包括:An embodiment of the present invention provides a video monitoring network, the video monitoring network includes a video monitoring client, a video monitoring device, a video monitoring server and a NAT gateway device, the video monitoring device manages multiple channels, and each channel corresponds to a Image acquisition equipment, the video monitoring server is located in the public network, the video monitoring client and the video monitoring equipment are located in different private networks, respectively connected to the public network through a NAT gateway device, including:

视频监控客户端,用于向视频监控服务器发送请求获取视频监控设备目标通道媒体流业务请求报文;The video monitoring client is used to send a request message to the video monitoring server to obtain the media stream service of the target channel of the video monitoring device;

所述视频监控服务器,用于查询监控关系表,查看所述视频监控客户端和所述视频监控设备是否已经建立媒体监控关系,如果否,则所述视频监控客户端和所述视频监控设备进行NAT的UDP简单穿越STUN探测和STUN穿越,建立所述视频监控客户端和所述视频监控设备之间的传输链路,所述视频监控设备把所述目标通道媒体流发给所述视频监控客户端,如果是,则继续;The video monitoring server is used to query the monitoring relationship table, check whether the video monitoring client and the video monitoring device have established a media monitoring relationship, if not, then the video monitoring client and the video monitoring device perform UDP of NAT simply traverses STUN detection and STUN traversal, establishes a transmission link between the video surveillance client and the video surveillance device, and the video surveillance device sends the target channel media stream to the video surveillance client end, if yes, continue;

所述视频监控服务器,还用于向视频监控设备和视频监控客户端发送复用第一业务链路的报文,并且向视频监控设备发送所述视频监控客户端请求的目标通道媒体流业务请求报文;The video monitoring server is further configured to send a packet multiplexing the first service link to the video monitoring device and the video monitoring client, and send the target channel media stream service request requested by the video monitoring client to the video monitoring device message;

视频监控设备,用于接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;A video monitoring device, configured to receive a target channel media stream service request message, and receive a multiplexed first service link notification message, the first service link is the video monitoring device and the video monitoring client Established transmission link;

所述视频监控设备,还用于使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号、以及目标通道标识,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号;The video surveillance device is further configured to use the video surveillance device side IP address and port number of the first service link as the source IP address and source port number, and use the video surveillance client side of the first service link The IP address and port number of the destination IP address and the destination port number are used as the destination IP address and the destination port number, and the target channel media stream service establishment notification message is sent to the video monitoring client, and the service establishment notification message carries the private network IP address of the video surveillance device Address, expected private network port number, and target channel identification, the expected private network port number is the expected private network port number used by the video surveillance equipment to send the target channel media stream;

所述视频监控设备所在出口的NAT网关设备,用于在所述业务建立通知报文中填充所述私网IP地址转换得到的公网IP地址、所述期望私网端口号转换得到的期望公网端口号;The NAT gateway device at the exit where the video monitoring device is located is used to fill in the service establishment notification message with the public network IP address obtained through the conversion of the private network IP address and the desired public IP address obtained through the conversion of the desired private network port number. network port number;

所述视频监控客户端,还用于收到所述业务建立通知报文,如果所述报文中携带的通道标识和请求的通道标识相同,则向所述业务建立通知报文中所述公网IP地址和所述期望公网端口号发送业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;The video surveillance client is further configured to receive the service establishment notification message, and if the channel identifier carried in the message is the same as the requested channel identifier, then report to the public in the service establishment notification message The network IP address and the desired public network port number send a service diversion message, establish a second service link between the video surveillance device and the video surveillance client, and the diversion message carries a target channel identifier;

所述视频监控设备,还用于利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The video monitoring device is further configured to use the second service link to send the media stream of the target channel to the video monitoring client.

本发明实施例提供了一种多路媒体流点播方法及装置,视频监控设备与视频监控客户端通过打洞报文进行STUN穿越建立第一业务链路,后续,针对此视频监控设备和此视频监控客户端的业务,可以复用该第一业务链路进行设备间数据报文的传输,在视频监控设备向视频监控客户端发送业务建立通知报文时,将视频监控设备的私网IP地址以及发送目标通道对应的私网端口号添加到该业务建立通知报文中,以及NAT网关设备在接收该报文时进行转换,将转换后的公网IP地址和公网端口号添加到该业务建立通知报文中,以将该业务建立通知报文发送给视频监控客户端,视频监控客户端根据视频监控设备侧转换后的公网IP地址和公网端口号,与视频监控设备建立第二业务链路,并利用第二业务链路获取目标通道的数据,减少了STUN穿越的打洞过程,提高了监控业务的效率。The embodiment of the present invention provides a multi-channel media stream on-demand method and device. The video monitoring device and the video monitoring client perform STUN traversal through punching packets to establish the first service link. Subsequently, for the video monitoring device and the video The business of the monitoring client can reuse the first service link to transmit data packets between devices. When the video monitoring device sends a service establishment notification message to the video monitoring client, the private network IP address of the video monitoring device and The private network port number corresponding to the sending target channel is added to the service establishment notification message, and the NAT gateway device performs conversion when receiving the message, and adds the converted public network IP address and public network port number to the service establishment notification message. In the notification message, the service establishment notification message is sent to the video surveillance client, and the video surveillance client establishes the second service with the video surveillance device according to the converted public network IP address and public network port number on the video surveillance device side. link, and use the second service link to obtain the data of the target channel, which reduces the hole punching process of STUN traversal and improves the efficiency of monitoring services.

附图说明Description of drawings

图1是现有技术提供的一种NAT网关设备网络地址转换示意图;Fig. 1 is a schematic diagram of network address translation of a NAT gateway device provided by the prior art;

图2是本发明实施例提供的多路媒体流点播方法的应用场景图;Fig. 2 is the application scenario diagram of the multi-channel media stream on-demand method provided by the embodiment of the present invention;

图3是本发明实施例提供的方法流程图;Fig. 3 is a flow chart of a method provided by an embodiment of the present invention;

图4是本发明另一实施例提供的方法流程图;Fig. 4 is a flow chart of a method provided by another embodiment of the present invention;

图5是本发明另一实施例提供的方法流程图;Fig. 5 is a flow chart of a method provided by another embodiment of the present invention;

图6是本发明实施例提供的视频监控设备运行的硬件环境架构图;Fig. 6 is a hardware environment architecture diagram of the operation of the video surveillance equipment provided by the embodiment of the present invention;

图7是本发明实施例提供的视频监控设备结构示意图;Fig. 7 is a schematic structural diagram of a video monitoring device provided by an embodiment of the present invention;

图8是本发明实施例提供的视频监控客户端运行的硬件环境架构图;Fig. 8 is a hardware environment architecture diagram of the operation of the video surveillance client provided by the embodiment of the present invention;

图9是本发明实施例提供的视频监控设备结构示意图;Fig. 9 is a schematic structural diagram of a video monitoring device provided by an embodiment of the present invention;

图10是本发明实施例提供的视频监控网络结构示意图。Fig. 10 is a schematic structural diagram of a video surveillance network provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

为了使得本发明实施例提供的多路媒体流点播方法更加容易理解,首先结合图2说明该点播方法可选的一种应用场景,如图2所示,监控系统主要包括:前端设备和后端设备。其中,前端设备可以是摄像机、手动或电动镜头、云台、防护罩、监听器、报警探测器和多功能解码器等,主要用于在自身监控范围内监控现场的目标对象,图2中示出了IPC1、IPC2和IPC3,在此仅以IPC(IP camera,网络摄像机)来表示监控系统的前端设备。其中,后端设备可以是中心控制设备或分控制设备等,如图2示出的视频监控设备即是后端设备,后端设备可以是NVR(Network Video Recorder即网络硬盘录像机)或者DVR(Digital VideoRecorder硬盘录像机),后端设备主要用于接收各个前端设备所采集的现场图像,以使得视频监控客户端在获取某一路通道的数据时,利用与视频监控客户端间的业务链路将该通道的数据发送给视频监控客户端。In order to make the multi-channel media stream on-demand method provided by the embodiment of the present invention easier to understand, an optional application scenario of the on-demand method is first described in conjunction with FIG. 2. As shown in FIG. 2, the monitoring system mainly includes: front-end equipment and back-end equipment. Among them, the front-end equipment can be camera, manual or electric lens, pan/tilt, protective cover, listener, alarm detector and multi-function decoder, etc., which are mainly used to monitor the target objects on the scene within the scope of its own monitoring, as shown in Figure 2 Out of IPC1, IPC2 and IPC3, only IPC (IP camera, network camera) is used here to represent the front-end equipment of the monitoring system. Wherein, the back-end device can be a central control device or a sub-control device, etc., and the video surveillance device shown in Figure 2 is the back-end device, and the back-end device can be an NVR (Network Video Recorder or Network Video Recorder) or a DVR (Digital Video Recorder). VideoRecorder hard disk video recorder), the back-end equipment is mainly used to receive the scene images collected by each front-end equipment, so that when the video surveillance client obtains the data of a certain channel, it uses the business link with the video surveillance client to use the channel The data is sent to the video surveillance client.

其中,如图2所示,视频监控设备接入并管理多个摄像机,每个摄像机对应视频监控设备的一个通道,例如,视频监控客户端获取第一路通道的数据,则说明视频监控客户端是需要获取IPC1采集的现场图像。业务链路为视频监控设备与视频监控客户端间建立的链路,用于实现视频监控设备与视频监控客户端间的信息数据的传递。Among them, as shown in Figure 2, the video surveillance device accesses and manages multiple cameras, and each camera corresponds to a channel of the video surveillance device. For example, if the video surveillance client obtains the data of the first channel, it means that the video surveillance client It is necessary to obtain the live image collected by IPC1. The service link is a link established between the video surveillance device and the video surveillance client, and is used to realize the transmission of information data between the video surveillance device and the video surveillance client.

由于图2中的视频监控设备处于NAT网关设备A的私网侧,视频监控客户端处于NAT网关设备B的私网侧,因此,首先需要执行STUN探测,通过探测,视频监控设备可以获知自身的私网IP地址,以及发送当前码流的私网端口号在NAT网关设备A转换后对应的公网IP地址IPA和公网端口号PortA,同理,视频监控客户端获知自身的私网IP地址、接收当前码流的私网端口号在NAT网关设备B转换后对应的公网IP地址IPB和公网端口号PortB。Since the video surveillance device in Figure 2 is on the private network side of NAT gateway device A, and the video surveillance client is on the private network side of NAT gateway device B, it is first necessary to perform STUN detection. Through detection, the video surveillance device can learn its own The private network IP address and the private network port number that sends the current code stream are converted by the NAT gateway device A to the corresponding public network IP address IPA and public network port number PortA. Similarly, the video surveillance client knows its own private network IP address , The private network port number receiving the current code stream is converted by the NAT gateway device B to the corresponding public network IP address IPB and public network port number PortB.

在视频监控客户端获取某一路通道的数据时,需要视频监控设备和视频监控客户端根据STUN穿越来获取对端的公网IP地址和公网端口号,在穿越成功后,利用穿越过程建立的业务链路获取该某一路通道的数据。When the video surveillance client obtains the data of a certain channel, the video surveillance device and the video surveillance client need to obtain the peer’s public network IP address and public network port number according to STUN traversal. After the traversal is successful, use the service established during the traversal The link obtains the data of the certain channel.

本发明实施例在上述过程的基础上,仅使用一次STUN穿越过程,就能够达到分别获取或同时获取多路通道的媒体流数据,以提高监控效率。On the basis of the above process, the embodiments of the present invention can acquire media stream data of multiple channels separately or simultaneously by using only one STUN traversal process, so as to improve monitoring efficiency.

实施例一Embodiment one

如图3所示,为本发明实施例提供的一种多路媒体流点播方法的流程示意图,本发明实施例的方法是由视频监控设备执行的,视频监控设备管理多个通道,每个通道对应一个图像采集设备,该监控组网还包括视频监控客户端和NAT网关设备,该视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,可以包括以下步骤:As shown in Figure 3, it is a schematic flow diagram of a multi-channel media stream on-demand method provided by the embodiment of the present invention. The method of the embodiment of the present invention is executed by a video monitoring device, and the video monitoring device manages multiple channels, and each channel Corresponding to an image acquisition device, the monitoring network also includes a video monitoring client and a NAT gateway device. The video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through a NAT gateway device. The following steps may be included :

步骤301:接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,该第一业务链路是该视频监控设备和该视频监控客户端已建立的传输链路。Step 301: Receive a target channel media stream service request message, and receive a multiplexed first service link notification message, where the first service link is an established transmission link between the video surveillance device and the video surveillance client.

其中,第一业务链路是利用STUN穿越技术建立的链路。以图2中业务链路a为第一业务链路,该业务链路a用于视频监控设备与视频监控客户端间传输IPC1所采集的媒体流数据,通知报文中携带需要复用的业务链路a的链路标识,例如用“a”表示该业务链路。Wherein, the first service link is a link established by using STUN traversal technology. Take the service link a in Figure 2 as the first service link. This service link a is used to transmit the media stream data collected by IPC1 between the video surveillance equipment and the video surveillance client, and the notification message carries the services that need to be multiplexed. The link identifier of link a, for example, "a" indicates the service link.

视频监控客户端请求察看IPC2实况码流,则此时的IPC2对应视频监控设备的第二通道,则第二通道即为目标通道。When the video monitoring client requests to view the IPC2 live code stream, then the IPC2 at this time corresponds to the second channel of the video monitoring device, and the second channel is the target channel.

视频监控设备收到视频监控客户端请求第二路媒体流数据的请求,例如,此时视频监控客户端想查看IPC2的实况。视频监控设备也收到复用第一业务链路a的通知报文。The video surveillance device receives a request from the video surveillance client for the second channel of media stream data. For example, the video surveillance client wants to view the live broadcast of the IPC2 at this time. The video monitoring device also receives the notification message of multiplexing the first service link a.

步骤302:使用第一业务链路的该视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的该视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向该视频监控客户端发送目标通道媒体流业务建立通知报文,该业务建立通知报文携带该视频监控设备的私网IP地址、期望私网端口号,该期望私网端口号是该视频监控设备发送目标通道媒体流的所期望使用的私网端口号、以及目标通道标识、和被该视频监控设备的出口NAT网关设备转换后私网IP地址对应的公网IP地址、期望私网端口号对应的期望公网端口号。Step 302: Use the IP address and port number of the video surveillance device side of the first service link as the source IP address and source port number, and use the IP address and port number of the video surveillance client side of the first service link as the destination IP address and destination port number, send the target channel media stream service establishment notification message to the video surveillance client, the service establishment notification message carries the private network IP address of the video surveillance device, the desired private network port number, and the desired private network The network port number is the expected private network port number used by the video monitoring device to send the media stream of the target channel, the target channel identifier, and the public network IP corresponding to the private network IP address converted by the egress NAT gateway device of the video monitoring device Address, desired public network port number corresponding to the desired private network port number.

由于现有技术在点播视频监控设备所连接的每一路IPC所采集的数据时,都需要采用STUN探测和STUN穿越过程来建立业务链路,使得监控的延时严重,监控业务的效率很低,因此,本发明实施例已经建立了业务链路a,在后续建立视频监控客户端与视频监控设备传输第二路IPC2所对应码流的业务链路时,利用已经建立的业务链路a向视频监控客户端发送业务建立通知报文,该业务建立通知报文携带视频监控设备的私网IP地址和传输目标通道码流对应的期望私网端口号(IP2,Port2),该业务建立通知报文在经过NAT网关设备A时,NAT网关设备A将(IP2,Port2)转换为公网IP地址和期望公网端口号(IPA,PortA2),并将该(IPA,PortA2)添加在业务建立通知报文中发送给视频监控客户端,以使得视频监控客户端根据该业务建立通知报文与视频监控设备建立业务链路b,从而减少了STUN穿越的打洞过程,提高了监控业务的效率。Because the existing technology needs to use STUN detection and STUN traversal process to establish service links when the data collected by each IPC connected to the video surveillance equipment is broadcast on demand, the delay of monitoring is serious, and the efficiency of monitoring services is very low. Therefore, the embodiment of the present invention has established the service link a, and when the video surveillance client and the video surveillance device transmit the service link corresponding to the second IPC2 code stream, use the established service link a to send video The monitoring client sends a service establishment notification message, which carries the private network IP address of the video surveillance device and the expected private network port number (IP2, Port2) corresponding to the transmission target channel code stream, and the service establishment notification message When passing through the NAT gateway device A, the NAT gateway device A converts (IP2, Port2) into a public network IP address and a desired public network port number (IPA, PortA2), and adds the (IPA, PortA2) in the service establishment notification report The text is sent to the video surveillance client, so that the video surveillance client establishes a service link b with the video surveillance device according to the service establishment notification message, thereby reducing the hole punching process of STUN traversal and improving the efficiency of the surveillance service.

其中,视频监控设备发送的业务建立通知报文中还携带目标通道标识channel2,以使视频监控客户端在接收到该业务建立通知报文时,根据该目标通道标识channel2,判断是否为自身所请求获取数据的目标通道的通道信息,由于视频监控客户端请求获取IPC2的数据,因此该业务建立通知报文中的目标通道标识channel2即为视频监控客户端所请求获取数据的通道。Wherein, the service establishment notification message sent by the video surveillance equipment also carries the target channel identifier channel2, so that when the video surveillance client receives the service establishment notification message, it can judge whether it is requested by itself according to the target channel identifier channel2 The channel information of the target channel for obtaining data. Since the video surveillance client requests to obtain IPC2 data, the target channel identifier channel2 in the service establishment notification message is the channel through which the video surveillance client requests to obtain data.

步骤303:接收该视频监控客户端发送到该公网IP地址和该期望公网端口号的业务引流报文,建立该视频监控设备和该视频监控客户端的第二业务链路,该引流报文携带目标通道标识。Step 303: Receive the traffic diversion packet sent by the video surveillance client to the public network IP address and the expected public network port number, establish a second service link between the video surveillance device and the video surveillance client, and the traffic diversion packet Carry the target channel ID.

步骤304:利用该第二业务链路,发送该目标通道的媒体流给该视频监控客户端。Step 304: Using the second service link, send the media stream of the target channel to the video surveillance client.

视频监控设备在接收视频监控客户端发送的业务引流报文,该引流报文的目的IP地址和目的端口号(IPA,PortA2),分别为视频监控设备的私网IP地址和目标通道对应的期望私网端口号(IP2,Port2)转换后的公网IP地址和期望公网端口号(IPA,PortA2),在视频监控设备接收到视频监控客户端发送的业务引流报文时,利用该引流报文携带的视频监控客户端侧的IP地址和IP端口号,以及根据(IP2,Port2),建立视频监控客户端与视频监控设备传输第二路媒体流数据IPC2实况媒体流所对应的业务链路b。视频监控设备利用该业务链路b将IPC2所采集的媒体流数据发送给视频监控客户端。The video surveillance device is receiving the service diversion packet sent by the video surveillance client. The destination IP address and destination port number (IPA, PortA2) of the diversion packet are respectively the private network IP address of the video surveillance device and the expected channel corresponding to the target channel. The public network IP address converted from the private network port number (IP2, Port2) and the expected public network port number (IPA, PortA2), when the video surveillance device receives the service drainage packet sent by the video surveillance client, use the traffic drainage packet The IP address and IP port number of the video monitoring client side carried in the file, and according to (IP2, Port2), establish the corresponding service link of the video monitoring client and the video monitoring device to transmit the second media stream data IPC2 live media stream b. The video monitoring device uses the service link b to send the media stream data collected by the IPC2 to the video monitoring client.

本发明实施例利用STUN穿越所建立的一个业务链路向视频监控客户端发送业务建立通知报文,从而建立视频监控客户端与视频监控设备传输第二路通道媒体流所对应的业务链路,该业务建立通知报文中携带视频监控设备的私网IP地址以及视频监控设备分配的传输视频监控客户端需要获取数据的目标通道对应媒体流的期望私网端口号,以及经过NAT网关设备在接收该报文时进行转换的公网IP地址和期望公网端口号,视频监控客户端根据视频监控设备侧转换后的公网IP地址和期望公网端口号,与视频监控设备建立第二业务链路,并利用第二业务链路获取目标通道的数据,减少了STUN穿越的打洞过程,提高了监控业务的效率。The embodiment of the present invention utilizes a service link established by STUN to send a service establishment notification message to the video surveillance client, thereby establishing a service link corresponding to the video surveillance client and the video surveillance device transmitting the second channel media stream, The service establishment notification message carries the private network IP address of the video surveillance device and the expected private network port number of the media stream corresponding to the target channel for the video surveillance client to obtain the data allocated by the video surveillance device, and the received This message is the converted public network IP address and expected public network port number, and the video monitoring client establishes a second service link with the video monitoring device based on the converted public network IP address and expected public network port number on the video monitoring device side and use the second service link to obtain the data of the target channel, which reduces the hole punching process of STUN traversal and improves the efficiency of monitoring services.

实施例二Embodiment two

如图4所示,为本发明实施例提供的一种多路媒体流点播方法的流程示意图,本发明实施例的方法是由视频监控客户端执行的,应用于位于监控组网中的视频监控客户端,该监控组网还包括视频监控设备和NAT网关设备,该视频监控设备管理多个通道,每个通道对应一个图像采集设备,该视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,可以包括以下步骤:As shown in Figure 4, it is a schematic flow diagram of a multi-channel media stream on-demand method provided by the embodiment of the present invention. The method of the embodiment of the present invention is executed by the video surveillance client and applied to the video surveillance located in the surveillance network Client, the monitoring network also includes video monitoring equipment and NAT gateway equipment, the video monitoring equipment manages multiple channels, each channel corresponds to an image acquisition device, the video monitoring client and video monitoring equipment are located in different private networks, Connecting to the public network through a NAT gateway device may include the following steps:

步骤401:发送请求获取该视频监控设备目标通道媒体流的报文。Step 401: Send a message requesting to obtain the media stream of the target channel of the video monitoring device.

步骤402:接收该视频监控设备复用第一业务链路发送的目标通道媒体流业务建立通知报文,该第一业务链路是该视频监控客户端和该视频监控设备已建立的传输链路,该业务建立通知报文携带目标通道标识、该视频监控设备的私网IP地址和该视频监控设备发送目标通道媒体流的期望私网端口号、以及经过该视频监控设备出口NAT网关设备转换该私网IP地址得到的公网IP地址和转换期望私网端口号得到的期望公网端口号。Step 402: Receive the target channel media stream service establishment notification message sent by the video surveillance device by multiplexing the first service link. The first service link is the established transmission link between the video surveillance client and the video surveillance device The service establishment notification message carries the target channel identifier, the private network IP address of the video monitoring device and the expected private network port number of the video monitoring device sending the media stream of the target channel, and the NAT gateway device that converts the video monitoring device through the video monitoring device. The public network IP address obtained from the private network IP address and the desired public network port number obtained by converting the desired private network port number.

该目标通道媒体流以视频监控客户端请求获取与视频监控设备所连接的第二路通道channel2所采集的数据为例,在接收到视频监控设备发送的业务建立通知报文后,根据该业务建立通知报文携带的目标通道标识channel2,确定是否与自身请求获取数据的目标通道channel2是否相同,在判断结果相同的情况下,则确定该业务建立通知报文为正确的。若判断结果不相同,则确定该业务通知报文为错误的,则重新向视频监控服务器发送请求获取视频监控设备目标通道媒体流的报文,直到该判断结果相同。The target channel media stream takes the video surveillance client requesting to obtain the data collected by the second channel channel2 connected to the video surveillance device as an example. After receiving the service establishment notification message sent by the video surveillance device, the service establishment Determine whether the target channel identifier channel2 carried in the notification message is the same as the target channel channel2 that the user requests to obtain data. If the judgment results are the same, then determine that the service establishment notification message is correct. If the judging results are not the same, it is determined that the service notification message is wrong, and the message requesting to obtain the media stream of the target channel of the video monitoring device is resent to the video monitoring server until the judging results are the same.

步骤403:在确定该业务建立通知报文中的该目标通道标识为请求获取媒体流的通道标识后,向该公网IP地址和该期望公网端口号发送引流报文,建立该视频监控客户端和该视频监控设备的第二业务链路。Step 403: After determining that the target channel identifier in the service establishment notification message is the channel identifier for requesting to obtain media streams, send a flow diversion message to the public network IP address and the expected public network port number, and establish the video surveillance client end and the second service link of the video surveillance equipment.

步骤404:接收该视频监控设备基于第二业务链路发送的目标通道媒体流数据。Step 404: Receive the target channel media stream data sent by the video monitoring device based on the second service link.

视频监控客户端根据该业务建立通知报文向视频监控设备发送引流报文,其中,将该业务建立通知报文携带的公网IP地址、期望公网端口号作为引流报文的目的IP地址、目的端口号。该引流报文还携带目标通道标识channel2,以使视频监控设备接收到该引流报文根据该目标通道标识channel2,将该目标通道标识channel2所对应的数据发送给视频监控客户端。The video monitoring client sends a traffic diversion message to the video surveillance device according to the service establishment notification message, wherein the public network IP address and the expected public network port number carried in the service establishment notification message are used as the destination IP address of the traffic diversion message, Destination port number. The diversion message also carries the target channel identifier channel2, so that the video surveillance device receives the diversion message and sends the data corresponding to the target channel identifier channel2 to the video surveillance client according to the target channel identifier channel2.

在使得视频监控设备接收到引流报文后,建立视频监控客户端与视频监控设备传输目标通道媒体流的业务链路b。在接收视频监控设备发送的目标通道媒体流数据时通过该业务链路b接收的。After the video monitoring device receives the flow diversion message, a service link b between the video monitoring client and the video monitoring device to transmit the media stream of the target channel is established. Received through the service link b when receiving the target channel media stream data sent by the video surveillance equipment.

本发明实施例视频监控客户端接收视频监控设备发送的业务建立通知报文,由于该业务建立通知报文中携带视频监控设备的私网IP地址、目标通道所对应的期望私网端口号,以及转换后的公网IP地址和期望公网端口号,视频监控客户端根据该转换后的公网IP地址和期望公网端口号与视频监控设备建立该目标通道所对应的业务链路,从而利用该目标通道所对应的业务链路,获取目标通道的数据,从而减少了STUN穿越的打洞过程,提高了监控业务的效率。In the embodiment of the present invention, the video surveillance client receives the service establishment notification message sent by the video surveillance device, because the service establishment notification message carries the private network IP address of the video surveillance device, the desired private network port number corresponding to the target channel, and After the converted public network IP address and expected public network port number, the video monitoring client establishes a service link corresponding to the target channel with the video monitoring device according to the converted public network IP address and expected public network port number, thereby using The service link corresponding to the target channel obtains the data of the target channel, thereby reducing the hole punching process of STUN traversal and improving the efficiency of monitoring services.

实施例三Embodiment three

图5是本发明实施例提供的又一种多路媒体流点播的流程图,应用于视频监控网络,该视频监控网络包括视频监控客户端、视频监控设备、视频监控服务器和NAT网关设备,该视频监控设备管理多个通道,每个通道对应一个图像采集设备,该视频监控服务器位于公网,该视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连。该方法可以包括:5 is a flow chart of another multi-channel media stream on demand provided by the embodiment of the present invention, which is applied to a video surveillance network. The video surveillance network includes a video surveillance client, a video surveillance device, a video surveillance server, and a NAT gateway device. The video surveillance device manages multiple channels, and each channel corresponds to an image acquisition device. The video surveillance server is located in the public network, and the video surveillance client and video surveillance device are located in different private networks, respectively connected to the public network through a NAT gateway device. The method can include:

步骤501:视频监控客户端向视频监控服务器发送请求获取视频监控设备目标通道媒体流业务请求报文。Step 501: the video surveillance client sends a request message to the video surveillance server to obtain the media stream service of the target channel of the video surveillance device.

该业务请求报文携带视频监控客户端请求获取数据的目标通道的通道标识、用户标识、视频监控客户端标识以及视频监控设备的标识。The service request message carries the channel identifier, user identifier, video surveillance client identifier, and video surveillance device identifier of the target channel for which the video surveillance client requests to obtain data.

例如,如图2所示,视频监控客户端请求获取视频监控设备第二路通道所对应IPC2的数据,该数据获取请求携带的监控请求获取数据的目标通道的通道标识为channel2。For example, as shown in FIG. 2 , the video surveillance client requests to obtain the data of IPC2 corresponding to the second channel of the video surveillance device, and the channel identifier of the target channel of the monitoring request to obtain data carried in the data acquisition request is channel2.

步骤502:视频监控服务器根据该用户标识以及视频监控设备的标识,查询预先存储的媒体监控关系表,查看视频监控客户端和视频监控设备是否已经建立媒体监控关系,如果是,则继续。Step 502: The video monitoring server queries the pre-stored media monitoring relationship table according to the user ID and the ID of the video monitoring device to check whether the media monitoring relationship has been established between the video monitoring client and the video monitoring device, and if yes, continue.

其中,该用户标识可以是在视频监控客户端上进行登录的账号和密码。根据用户标识的不同,对应该用户标识的权限也不同。例如,账号可以是:zhanghao;密码可以是******。视频监控服务器对该账号和密码的权限是,可以根据该用户标识查找媒体监控关系表。对其他账号和密码的权限是禁止查找媒体监控关系表。Wherein, the user identifier may be an account number and password for logging in on the video surveillance client. Depending on the user ID, the permissions corresponding to the user ID are also different. For example, the account number can be: zhanghao; the password can be ****. The authority of the video monitoring server for the account and password is that the media monitoring relationship table can be searched according to the user ID. The authority to other accounts and passwords is prohibited from searching the media monitoring relationship table.

视频监控服务器在查看媒体监控关系表时,若媒体监控关系表中包括与该视频监控客户端标识以及视频监控设备的标识所对应的业务链路标识,则表明该视频监控客户端与该视频监控设备间已建立了业务链路。When the video monitoring server checks the media monitoring relationship table, if the media monitoring relationship table includes the service link identification corresponding to the identification of the video monitoring client and the identification of the video monitoring equipment, it indicates that the video monitoring client and the video monitoring A service link has been established between devices.

若媒体监控关系表中不包括与该视频监控客户端标识以及视频监控设备的标识所对应的业务链路标识,表明该视频监控客户端与该视频监控设备间未建立过业务链路,则利用STUN探测技术建立视频监控客户端与该视频监控设备间的业务链路,视频监控服务器记录并将该利用STUN探测技术建立的业务链路的信息保存在媒体监控关系表中。If the media monitoring relationship table does not include the service link identifier corresponding to the identifier of the video surveillance client and the identifier of the video surveillance device, indicating that no service link has been established between the video surveillance client and the video surveillance device, then use The STUN detection technology establishes a service link between the video surveillance client and the video surveillance device, and the video surveillance server records and saves the information of the service link established by using the STUN detection technology in the media monitoring relationship table.

在本发明实施例中,媒体监控关系表如表1所示:In the embodiment of the present invention, the media monitoring relationship table is as shown in Table 1:

表1:Table 1:

根据表1所示,视频监控服务器在根据数据获取请求携带的视频监控客户端标识以及视频监控设备标识在查找该媒体监控关系表时,若该媒体监控关系表中包括该数据获取请求携带的视频监控客户端标识、视频监控设备的标识,则表明视频监控客户端与该视频监控设备间已建立了业务链路;否则,则表明视频监控客户端与该视频监控设备间未建立过业务链路。As shown in Table 1, when the video monitoring server searches the media monitoring relationship table according to the video monitoring client identification and video monitoring device identification carried in the data acquisition request, if the media monitoring relationship table includes the video information carried in the data acquisition request The ID of the surveillance client and the ID of the video surveillance device indicate that a service link has been established between the video surveillance client and the video surveillance device; otherwise, it indicates that no service link has been established between the video surveillance client and the video surveillance device .

以视频监控客户端标识为视频监控客户端1的视频监控客户端与视频监控设备1已建立了业务链路,且仅仅建立了该一条业务链路a为例,该已建立的业务链路是视频监控客户端与视频监控设备间利用STUN穿越技术建立的业务链路。用于使得视频监控客户端根据该已经建立的业务链路a获取视频监控设备的第一路通道所对应IPC1的媒体流数据。Taking the video surveillance client identified as video surveillance client 1 and the video surveillance device 1 having established a service link, and only establishing the service link a as an example, the established service link is The service link established between the video surveillance client and the video surveillance device using the STUN traversal technology. It is used to enable the video surveillance client to obtain the media stream data of the IPC1 corresponding to the first channel of the video surveillance device according to the established service link a.

或者存在多条已建立业务链路,此多条业务链路可以通过其它方式非STUN探测和穿越方式建立,例如可以通过本发明方案方式建立,在此对已建立业务链路方式不进行限制。Or there are multiple established service links, and these multiple service links can be established through other methods other than STUN detection and traversal, for example, they can be established through the solution of the present invention, and the established service link method is not limited here.

步骤503:视频监控服务器向视频监控设备和视频监控客户端发送复用第一业务链路的报文,并且向视频监控设备发送该视频监控客户端请求的目标通道媒体流业务请求报文。Step 503: The video surveillance server sends a packet multiplexing the first service link to the video surveillance device and the video surveillance client, and sends a target channel media stream service request packet requested by the video surveillance client to the video surveillance device.

其中,视频监控服务器向视频监控设备以及视频监控客户端发送的复用第一业务链路的报文中,携带该第一业务链路的标识。Wherein, the message of multiplexing the first service link sent by the video surveillance server to the video surveillance device and the video surveillance client carries the identifier of the first service link.

由于视频监控客户端在预设时间段内未接收到视频监控服务器针对业务请求报文所返回的消息,则会继续向视频监控服务器发送业务请求报文。因此,视频监控服务器需要向视频监控客户端发送复用第一业务链路的报文。视频监控客户端在接收该视频监控服务器发送的复用第一业务链路的报文,会等待视频监控设备利用该已建立的业务链路所发送的消息。Since the video monitoring client does not receive the message returned by the video monitoring server regarding the service request message within the preset time period, it will continue to send the service request message to the video monitoring server. Therefore, the video surveillance server needs to send a packet multiplexing the first service link to the video surveillance client. After receiving the packet sent by the video surveillance server to multiplex the first service link, the video surveillance client will wait for a message sent by the video surveillance device using the established service link.

步骤504:视频监控设备接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,该第一业务链路是该视频监控设备和该视频监控客户端已建立的传输链路。Step 504: The video surveillance device receives the target channel media stream service request message, and receives the notification message of the multiplexed first service link, the first service link is the established transmission link between the video surveillance device and the video surveillance client link.

步骤505:视频监控设备使用第一业务链路的该视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的该视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向该视频监控客户端发送目标通道媒体流业务建立通知报文,该业务建立通知报文携带该视频监控设备的私网IP地址、期望私网端口号、以及目标通道标识,该期望私网端口号是该视频监控设备发送目标通道媒体流的所期望使用的私网端口号。Step 505: The video surveillance device uses the IP address and port number of the video surveillance device side of the first service link as the source IP address and source port number, and uses the IP address and port number of the video surveillance client side of the first service link number as the destination IP address and destination port number, and send the target channel media stream service establishment notification message to the video surveillance client, and the service establishment notification message carries the private network IP address of the video surveillance device, the expected private network port number, And target channel identification, the expected private network port number is the private network port number expected to be used by the video monitoring device to send the media stream of the target channel.

步骤506:NAT网关设备A接收到视频监控设备发送的业务建立通知报文,对业务建立通知报文携带的视频监控设备的私网IP地址、以及目标通道对应的期望私网端口号进行转换,并将转换后的公网IP地址、以及期望公网端口号填充到该业务建立通知报文中,并将业务建立通知报文发送给视频监控客户端所连接的NAT网关设备B,以使NAT网关设备B将该业务建立通知报文发送给视频监控客户端。Step 506: NAT gateway device A receives the service establishment notification message sent by the video surveillance device, and converts the private network IP address of the video surveillance device carried in the service establishment notification message and the desired private network port number corresponding to the target channel, And the converted public network IP address and the expected public network port number are filled in the service establishment notification message, and the service establishment notification message is sent to the NAT gateway device B connected to the video surveillance client, so that the NAT Gateway device B sends the service establishment notification message to the video surveillance client.

同时NAT网关设备把该私网IP地址、期望私网端口号与公网IP地址、期望公网端口号的映射关系保存,以便后续完成公网IP地址、期望公网端口号到私网IP地址、期望私网端口号的地址转换。At the same time, the NAT gateway device saves the mapping relationship between the private network IP address, the expected private network port number and the public network IP address, and the expected public network port number, so that the subsequent completion of the public network IP address, the expected public network port number to the private network IP address , The address translation of the expected private network port number.

步骤507:视频监控客户端收到该业务建立通知报文,如果该报文中携带的通道标识和请求的通道标识相同,则向该业务建立通知报文中该公网IP地址和该期望公网端口号发送的业务引流报文,建立该视频监控设备和该视频监控客户端的第二业务链路,该引流报文携带目标通道标识。Step 507: The video monitoring client receives the service establishment notification message, if the channel identifier carried in the message is the same as the requested channel identifier, then the public network IP address in the service establishment notification message and the expected public IP address in the service establishment notification message are the same. The service diversion packet sent by the network port number establishes a second service link between the video surveillance device and the video surveillance client, and the diversion packet carries a target channel identifier.

其中,视频监控客户端发送的引流报文的公网IP地址、公网端口号由视频监控设备侧的NAT网关设备,根据内部保存的公网和私网地址转换表,转换为视频监控设备对应的私网IP地址和期望私网端口号。具体的,视频监控客户端接收到该业务建立通知报文后,根据视频监控设备的私网IP地址和目标通道对应的期望私网端口号经过NAT网关设备转换后的公网IP地址和期望公网端口号,视频监控客户端发送引流报文,与视频监控设备建立针对第二路通道的业务链路b。在视频监控客户端与视频监控设备每建立一条业务链路,视频监控客户端与视频监控设备均向视频监控服务器发送关于建立的业务链路的信息,视频监控服务器将关于建立的业务链路的信息保存在媒体监控关系表中。Among them, the public network IP address and public network port number of the diversion message sent by the video surveillance client are converted by the NAT gateway device on the video surveillance device side, according to the internally stored public network and private network address conversion table, to the corresponding IP address of the video surveillance device. private network IP address and desired private network port number. Specifically, after the video monitoring client receives the service establishment notification message, it converts the public network IP address and the expected public network port number through the NAT gateway device according to the private network IP address of the video monitoring device and the desired private network port number corresponding to the target channel. The network port number, the video monitoring client sends a traffic diversion message, and establishes a service link b for the second channel with the video monitoring device. Every time a service link is established between the video surveillance client and the video surveillance device, both the video surveillance client and the video surveillance device send information about the established service link to the video surveillance server, and the video surveillance server sends information about the established service link to the video surveillance server. The information is stored in the media monitoring relationship table.

步骤508:视频监控设备利用该第二业务链路,发送该目标通道的媒体流给该视频监控客户端。Step 508: the video surveillance device sends the media stream of the target channel to the video surveillance client by using the second service link.

上述过程均以视频监控客户端点播一路通道的数据的过程,当视频监控客户端同时点播两路或多路通道的数据时,本发明实施例以视频监控客户端同时点播两路通道的数据为例,该方法与图7中点播一路通道的数据的区别可以包括:The above-mentioned process is all based on the process of the video monitoring client ordering the data of one channel. When the video monitoring client is simultaneously ordering the data of two or more channels, the embodiment of the present invention is based on the video monitoring client simultaneously ordering the data of the two channels. For example, the difference between this method and the data of ordering one channel in Figure 7 may include:

在步骤501中,该视频监控客户端向视频监控服务器发送的请求获取视频监控设备目标通道媒体流业务请求报文中,可以携带请求获取媒体流数据的两个目标通道的通道标识,也可以是视频监控客户端向视频监控服务器分别发送两个业务请求报文。In step 501, in the request message sent by the video surveillance client to the video surveillance server to obtain the media stream service of the target channel of the video surveillance device, the channel identifiers of the two target channels that request to obtain the media stream data may be carried, or may be The video surveillance client sends two service request packets to the video surveillance server respectively.

在步骤503中,视频监控服务器向视频监控设备可以发送一个业务请求报文,该业务请求报文中可以携带视频监控客户端请求媒体流的目标通道标识。也可以是发送两个业务请求报文,每个业务请求报文中分别携带对应的视频监控客户端请求媒体流的目标通道标识。In step 503, the video monitoring server may send a service request message to the video monitoring device, and the service request message may carry the target channel identifier of the media stream requested by the video monitoring client. Alternatively, two service request messages may be sent, and each service request message carries the identifier of the target channel for the media stream requested by the corresponding video surveillance client.

在步骤505中,视频监控设备发送的业务建立通知报文中,可以包括两个目标通道所对应的视频监控设备的IP地址、每个目标通道所对应的期望私网端口号,以及公网IP地址和期望公网端口号。也可以是视频监控设备发送两个业务建立通知报文。In step 505, the service establishment notification message sent by the video monitoring device may include the IP address of the video monitoring device corresponding to the two target channels, the expected private network port number corresponding to each target channel, and the public network IP address. Address and desired public network port number. It may also be that the video monitoring device sends two service establishment notification messages.

在步骤506、步骤507中,视频监控客户端接收到业务建立通知报文后,根据业务建立通知报文,分别向对应的视频监控设备发送引流报文。视频监控设备接收到引流报文后利用对应的业务链路返回媒体流数据。In steps 506 and 507, after receiving the service establishment notification message, the video surveillance client sends traffic diversion messages to corresponding video surveillance devices according to the service establishment notification message. After receiving the diversion message, the video surveillance device uses the corresponding service link to return the media stream data.

根据上述方案,视频监控设备与视频监控客户端通过打洞报文进行STUN穿越建立第一业务链路,利用该第一业务链路进行各设备间数据报文的传输,并在视频监控设备向视频监控客户端发送业务建立通知报文时,将视频监控设备的私网IP地址以及视频监控客户端需要获取数据的目标通道对应的期望私网端口号添加到该业务建立通知报文中,以及NAT网关设备在接收该报文时进行转换,将转换后的公网IP地址和期望公网端口号添加到该业务建立通知报文中,以将该业务建立通知报文发送给视频监控客户端,视频监控客户端根据视频监控设备侧转换后的公网IP地址和期望公网端口号,向视频监控设备发送引流报文,并在视频设备接收到引流报文后与视频监控客户端建立第二业务链路,并利用第二业务链路返回目标通道的媒体流数据,减少了STUN穿越的打洞过程,且根据本发明方案,可以同时点播多路通道的数据,提高了监控业务的效率。According to the above solution, the video surveillance device and the video surveillance client implement STUN traversal through hole-punching packets to establish the first service link, use the first service link to transmit data packets between devices, and send When the video surveillance client sends a service establishment notification message, the private network IP address of the video surveillance device and the desired private network port number corresponding to the target channel where the video surveillance client needs to obtain data are added to the service establishment notification message, and The NAT gateway device performs conversion when receiving the message, and adds the converted public network IP address and expected public network port number to the service establishment notification message, so as to send the service establishment notification message to the video surveillance client , the video surveillance client sends a traffic diversion packet to the video surveillance device according to the converted public network IP address and the expected public port number on the video surveillance device side, and establishes a first session with the video surveillance client after the video device receives the traffic diversion packet. Two service links, and use the second service link to return the media stream data of the target channel, reducing the hole punching process of STUN traversal, and according to the solution of the present invention, the data of multiple channels can be ordered at the same time, which improves the efficiency of monitoring services .

如图6、图7所示,本发明实施例提供了一种视频监控设备,位于视频监控组网中,该视频监控设备管理多个通道,每个通道对应一个图像采集设备,监控组网还包括视频监控客户端和网络地址转换NAT网关设备,视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。从硬件层面而言,如图6所示,为本发明实施例视频监控设备所在设备的一种硬件结构图,除了图6所示的CPU、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的设备通常还可以包括其他硬件,如负责处理报文的转发芯片等等。以软件实现为例,如图7所示,作为一个逻辑意义上的装置,是通过其所在设备的CPU将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。本实施例提供的视频监控设备70包括:As shown in Figure 6 and Figure 7, the embodiment of the present invention provides a video monitoring device, located in the video monitoring network, the video monitoring device manages multiple channels, each channel corresponds to an image acquisition device, and the monitoring network also Including the video surveillance client and the network address translation NAT gateway device, the video surveillance client and the video surveillance device are located in different private networks, respectively connected to the public network through the NAT gateway device. The device embodiments can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, as shown in Figure 6, it is a hardware structural diagram of the device where the video surveillance device in the embodiment of the present invention is located, except for the CPU, memory, network interface, and non-volatile memory shown in Figure 6 , the device where the device in the embodiment is located may also generally include other hardware, such as a forwarding chip responsible for processing packets, and the like. Taking software implementation as an example, as shown in Figure 7, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for operation by the CPU of the device where it is located. The video surveillance equipment 70 provided in this embodiment includes:

接收单元701,用于接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;The receiving unit 701 is configured to receive a target channel media stream service request message, and receive a multiplexed first service link notification message, the first service link is the video surveillance device and the video surveillance client Established transmission link;

发送单元702,用于使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号、以及目标通道标识、和被所述视频监控设备的出口NAT网关设备转换后私网IP地址对应的公网IP地址、期望私网端口号对应的期望公网端口号;The sending unit 702 is configured to use the IP address and port number of the video surveillance device side of the first service link as the source IP address and source port number, and use the IP address of the video surveillance client side of the first service link and the port number as the destination IP address and the destination port number, send the target channel media stream service establishment notification message to the video monitoring client, and the service establishment notification message carries the private network IP address, expected Private network port number, the desired private network port number is the expected private network port number used by the video monitoring device to send the target channel media stream, and the target channel identifier, and the egress NAT gateway device of the video monitoring device The public network IP address corresponding to the converted private network IP address, and the desired public network port number corresponding to the desired private network port number;

建立单元703,用于接收所述视频监控客户端发送到所述公网IP地址和所述期望公网端口号的业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;The establishment unit 703 is configured to receive the service diversion message sent by the video surveillance client to the public network IP address and the desired public network port number, and establish a second connection between the video surveillance device and the video surveillance client. A service link, where the diversion message carries a target channel identifier;

所述发送单元,还用于利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The sending unit is further configured to use the second service link to send the media stream of the target channel to the video surveillance client.

如图8、图9所示,本发明实施例提供了一种视频监控客户端,位于视频监控组网中,其中,监控组网还包括视频监控设备和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。从硬件层面而言,如图8所示,为本发明实施例视频监控设备所在设备的一种硬件结构图,除了图8所示的CPU、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的设备通常还可以包括其他硬件,如负责处理报文的转发芯片等等。以软件实现为例,如图9所示,作为一个逻辑意义上的装置,是通过其所在设备的CPU将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。该视频监控客户端90包括:As shown in Figure 8 and Figure 9, the embodiment of the present invention provides a video surveillance client, which is located in a video surveillance network, wherein the surveillance network also includes a video surveillance device and a NAT gateway device, and the video surveillance device manages A plurality of channels, each channel corresponds to an image acquisition device, the video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through a NAT gateway device. The device embodiments can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, as shown in Figure 8, it is a hardware structural diagram of the device where the video surveillance device is located in the embodiment of the present invention, except for the CPU, memory, network interface, and non-volatile memory shown in Figure 8 , the device where the device in the embodiment is located may also generally include other hardware, such as a forwarding chip responsible for processing packets, and the like. Taking software implementation as an example, as shown in Figure 9, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for operation by the CPU of the device where it is located. The video surveillance client 90 includes:

发送单元901,用于发送请求获取所述视频监控设备目标通道媒体流的报文;A sending unit 901, configured to send a message requesting to obtain the media stream of the target channel of the video monitoring device;

接收单元902,用于接收所述视频监控设备复用第一业务链路发送的目标通道媒体流业务建立通知报文,所述第一业务链路是所述视频监控客户端和所述视频监控设备已建立的传输链路,所述业务建立通知报文携带目标通道标识、所述视频监控设备的私网IP地址和所述视频监控设备发送目标通道媒体流的期望私网端口号、以及经过所述视频监控设备出口NAT网关设备转换所述私网IP地址得到的公网IP地址和转换期望私网端口号得到的期望公网端口号;The receiving unit 902 is configured to receive the target channel media stream service establishment notification message sent by the video surveillance device by multiplexing the first service link, the first service link being the video surveillance client and the video surveillance The transmission link that has been established by the device, the service establishment notification message carries the target channel identifier, the private network IP address of the video monitoring device, the expected private network port number for the video monitoring device to send the media stream of the target channel, and the The NAT gateway device at the egress of the video surveillance equipment converts the public network IP address obtained by the private network IP address and the desired public network port number obtained by converting the desired private network port number;

建立单元903,用于在确定所述业务建立通知报文中的所述目标通道标识为请求获取媒体流的通道标识后,向所述公网IP地址和所述期望公网端口号发送引流报文,建立所述视频监控客户端和所述视频监控设备的第二业务链路;The establishment unit 903 is configured to send a flow diversion report to the public network IP address and the desired public network port number after determining that the target channel identification in the service establishment notification message is a channel identification requesting to obtain a media stream document, establishing a second service link between the video surveillance client and the video surveillance device;

所述接收单元902,还用于接收所述视频监控设备基于第二业务链路发送的目标通道媒体流数据。The receiving unit 902 is further configured to receive target channel media stream data sent by the video surveillance device based on the second service link.

如图10所示,本发明实施例提了一种视频监控网络,视频监控网络包括视频监控客户端、视频监控设备、视频监控服务器和NAT网关设备,视频监控设备管理多个通道,每个通道对应一个图像采集设备,视频监控服务器位于公网,视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连。该视频监控网络100包括:As shown in Figure 10, the embodiment of the present invention provides a video surveillance network, the video surveillance network includes a video surveillance client, a video surveillance device, a video surveillance server and a NAT gateway device, the video surveillance device manages multiple channels, each channel Corresponding to an image acquisition device, the video surveillance server is located in the public network, and the video surveillance client and video surveillance device are located in different private networks, respectively connected to the public network through a NAT gateway device. The video surveillance network 100 includes:

视频监控客户端1001,用于向视频监控服务器发送请求获取视频监控设备目标通道媒体流业务请求报文;The video surveillance client 1001 is configured to send a request message to the video surveillance server to obtain a media stream service request for the target channel of the video surveillance device;

所述视频监控服务器1002,用于查询监控关系表,查看所述视频监控客户端和所述视频监控设备是否已经建立媒体监控关系,如果否,则所述视频监控客户端和所述视频监控设备进行NAT的UDP简单穿越STUN探测和STUN穿越,建立所述视频监控客户端和所述视频监控设备之间的传输链路,所述视频监控设备把所述目标通道媒体流发给所述视频监控客户端,如果是,则继续;The video monitoring server 1002 is used to query the monitoring relationship table, check whether the video monitoring client and the video monitoring device have established a media monitoring relationship, if not, then the video monitoring client and the video monitoring device Perform NAT UDP simple traversal STUN detection and STUN traversal, establish a transmission link between the video surveillance client and the video surveillance device, and the video surveillance device sends the target channel media stream to the video surveillance Client, if yes, continue;

所述视频监控服务器1002,还用于向视频监控设备和视频监控客户端发送复用第一业务链路的报文,并且向视频监控设备发送所述视频监控客户端请求的目标通道媒体流业务请求报文;The video monitoring server 1002 is further configured to send a packet multiplexing the first service link to the video monitoring device and the video monitoring client, and send the target channel media stream service requested by the video monitoring client to the video monitoring device request message;

视频监控设备1003,用于接收目标通道媒体流业务请求报文,及接收复用第一业务链路通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;The video monitoring device 1003 is configured to receive a target channel media stream service request message, and receive a multiplexed first service link notification message, the first service link being the video monitoring device and the video monitoring client established transmission links;

所述视频监控设备1003,还用于使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号、以及目标通道标识,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号;The video surveillance device 1003 is further configured to use the video surveillance device side IP address and port number of the first service link as the source IP address and source port number, and use the video surveillance client of the first service link The IP address and port number of the side are used as the destination IP address and the destination port number, and the target channel media stream service establishment notification message is sent to the video surveillance client, and the service establishment notification message carries the private network of the video surveillance device IP address, expected private network port number, and target channel identification, the expected private network port number is the expected private network port number used by the video surveillance equipment to send the target channel media stream;

所述视频监控设备所在出口的NAT网关设备1004,用于在所述业务建立通知报文中填充所述私网IP地址转换得到的公网IP地址、所述期望私网端口号转换得到的期望公网端口号;The NAT gateway device 1004 at the exit where the video monitoring device is located is configured to fill in the service establishment notification message with the public network IP address obtained through the conversion of the private network IP address and the desired IP address obtained through the conversion of the expected private network port number. Public network port number;

所述视频监控客户端1001,还用于收到所述业务建立通知报文,如果所述报文中携带的通道标识和请求的通道标识相同,则向所述业务建立通知报文中所述公网IP地址和所述期望公网端口号发送的业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;The video monitoring client 1001 is further configured to receive the service establishment notification message, and if the channel identifier carried in the message is the same as the requested channel identifier, send the The public network IP address and the service diversion message sent by the desired public network port number establish a second service link between the video surveillance device and the video surveillance client, and the diversion message carries a target channel identifier;

所述视频监控设备1003,还用于利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The video monitoring device 1003 is further configured to use the second service link to send the media stream of the target channel to the video monitoring client.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.

Claims (6)

1.一种多路媒体流点播方法,应用于位于监控组网中的视频监控设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述监控组网还包括视频监控客户端和网络地址转换NAT网关设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,其特征在于,所述方法包括:1. A multi-channel media stream on-demand method is applied to a video surveillance device located in a monitoring network. The video surveillance device manages a plurality of channels, and each channel corresponds to an image acquisition device. The monitoring network also includes a video Monitoring client and network address translation NAT gateway equipment, described video surveillance client and video surveillance equipment are positioned at different private networks, are connected with public network by NAT gateway equipment respectively, it is characterized in that, described method comprises: 接收目标通道媒体流业务请求报文,及接收用于复用第一业务链路的通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;receiving a target channel media stream service request message, and receiving a notification message for multiplexing a first service link, where the first service link is an established transmission between the video surveillance device and the video surveillance client link; 使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号、以及目标通道标识、和被所述视频监控设备的出口NAT网关设备转换后私网IP地址对应的公网IP地址、期望私网端口号对应的期望公网端口号;Use the IP address and port number of the video surveillance equipment side of the first service link as the source IP address and source port number, and use the IP address and port number of the video surveillance client side of the first service link as the destination IP Address and destination port number, send the target channel media flow service establishment notification message to the video monitoring client, the service establishment notification message carries the private network IP address and the expected private network port number of the video monitoring device, so The desired private network port number is the expected private network port number used by the video monitoring device to send the target channel media stream, and the target channel identifier, and the private network IP address after being converted by the egress NAT gateway device of the video monitoring device The corresponding public network IP address, the desired public network port number corresponding to the desired private network port number; 接收所述视频监控客户端发送到所述公网IP地址和所述期望公网端口号的业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;receiving the service diversion message sent by the video surveillance client to the public network IP address and the desired public network port number, establishing a second service link between the video surveillance device and the video surveillance client, the The diversion message carries the target channel identifier; 利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。Using the second service link, send the media stream of the target channel to the video surveillance client. 2.一种多路媒体流点播方法,应用于位于监控组网中的视频监控客户端,所述监控组网还包括视频监控设备和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,其特征在于,所述方法包括:2. A multi-channel media stream on-demand method is applied to a video monitoring client in a monitoring network, and the monitoring network also includes a video monitoring device and a NAT gateway device, and the video monitoring device manages a plurality of channels, each Each channel corresponds to an image acquisition device, and the video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through a NAT gateway device, and it is characterized in that the method includes: 发送请求获取所述视频监控设备目标通道媒体流的报文;Sending a message requesting to obtain the media stream of the target channel of the video monitoring device; 接收所述视频监控设备复用第一业务链路发送的目标通道媒体流业务建立通知报文,所述第一业务链路是所述视频监控客户端和所述视频监控设备已建立的传输链路,所述业务建立通知报文携带目标通道标识、所述视频监控设备的私网IP地址和所述视频监控设备发送目标通道媒体流的期望私网端口号、以及经过所述视频监控设备出口NAT网关设备转换所述私网IP地址得到的公网IP地址和转换期望私网端口号得到的期望公网端口号;receiving the target channel media stream service establishment notification message sent by the video surveillance device multiplexing the first service link, the first service link being the established transmission link between the video surveillance client and the video surveillance device The service establishment notification message carries the target channel identifier, the private network IP address of the video monitoring device and the expected private network port number for the video monitoring device to send the media stream of the target channel, and the exit port number of the video monitoring device The NAT gateway device converts the public network IP address obtained by the private network IP address and the desired public network port number obtained by converting the desired private network port number; 在确定所述业务建立通知报文中的所述目标通道标识为请求获取媒体流的通道标识后,向所述公网IP地址和所述期望公网端口号发送引流报文,建立所述视频监控客户端和所述视频监控设备的第二业务链路;After determining that the target channel identifier in the service establishment notification message is a channel identifier requesting to obtain a media stream, a flow diversion message is sent to the public network IP address and the expected public network port number to establish the video monitoring the second service link between the client and the video monitoring device; 接收所述视频监控设备基于第二业务链路发送的目标通道媒体流数据。The target channel media stream data sent by the video monitoring device based on the second service link is received. 3.一种多路媒体流点播方法,应用于视频监控网络,所述视频监控网络包括视频监控客户端、视频监控设备、视频监控服务器和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控服务器位于公网,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,其特征在于,所述方法包括:3. A multi-channel media stream on-demand method is applied to a video monitoring network, and the video monitoring network includes a video monitoring client, a video monitoring device, a video monitoring server and a NAT gateway device, and the video monitoring device manages a plurality of channels, Each channel corresponds to an image acquisition device, the video monitoring server is located in the public network, the video monitoring client and the video monitoring device are located in different private networks, and are respectively connected to the public network through a NAT gateway device, it is characterized in that the Methods include: 视频监控客户端向视频监控服务器发送请求获取视频监控设备目标通道媒体流业务请求报文;The video monitoring client sends a request message to the video monitoring server to obtain the media stream service of the target channel of the video monitoring device; 所述视频监控服务器查询监控关系表,查看所述视频监控客户端和所述视频监控设备是否已经建立媒体监控关系,如果否,则所述视频监控客户端和所述视频监控设备进行NAT的UDP简单穿越STUN探测和STUN穿越,建立所述视频监控客户端和所述视频监控设备之间的传输链路,所述视频监控设备把所述目标通道媒体流发给所述视频监控客户端,如果是,则继续;The video monitoring server queries the monitoring relationship table, checks whether the video monitoring client and the video monitoring device have established a media monitoring relationship, if not, then the video monitoring client and the video monitoring device perform NAT UDP Simple traversal of STUN detection and STUN traversal, establishing a transmission link between the video surveillance client and the video surveillance device, the video surveillance device sends the target channel media stream to the video surveillance client, if Yes, continue; 视频监控服务器向视频监控设备和视频监控客户端发送复用第一业务链路的报文,并且向视频监控设备发送所述视频监控客户端请求的目标通道媒体流业务请求报文;The video monitoring server sends a message for multiplexing the first service link to the video monitoring device and the video monitoring client, and sends the target channel media stream service request message requested by the video monitoring client to the video monitoring device; 视频监控设备接收目标通道媒体流业务请求报文,及接收用于复用第一业务链路的通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;The video monitoring device receives the target channel media stream service request message, and receives the notification message for multiplexing the first service link, and the first service link is the video monitoring device and the video monitoring client. Established transmission link; 视频监控设备使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号、以及目标通道标识,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号;The video surveillance device uses the IP address and port number of the video surveillance device side of the first service link as the source IP address and source port number, and uses the IP address and port number of the video surveillance client side of the first service link As the purpose IP address and purpose port number, send the target channel media stream service establishment notification message to the video monitoring client, and the service establishment notice message carries the private network IP address and the desired private network port of the video monitoring device number, and the target channel identification, the desired private network port number is the desired private network port number used by the video surveillance equipment to send the target channel media stream; 视频监控设备所在出口的NAT网关设备在所述业务建立通知报文中填充所述私网IP地址转换得到的公网IP地址、所述期望私网端口号转换得到的期望公网端口号;The NAT gateway device at the exit where the video monitoring device is located fills in the service establishment notification message with the public network IP address obtained by the conversion of the private network IP address and the desired public network port number obtained by the conversion of the desired private network port number; 视频监控客户端收到所述业务建立通知报文,如果所述报文中携带的通道标识和请求的通道标识相同,则向所述业务建立通知报文中所述公网IP地址和所述期望公网端口号发送业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;The video surveillance client receives the service establishment notification message, and if the channel identifier carried in the message is the same as the requested channel identifier, then the public network IP address in the service establishment notification message and the It is expected that the public network port number sends a service diversion message, and establishes a second service link between the video surveillance device and the video surveillance client, and the diversion message carries a target channel identifier; 视频监控设备利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The video surveillance device sends the media stream of the target channel to the video surveillance client by using the second service link. 4.一种视频监控设备,位于视频监控组网中,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控组网还包括视频监控客户端和网络地址转换NAT网关设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,其特征在于,包括:4. A video monitoring device, located in a video monitoring network, the video monitoring device manages a plurality of channels, each channel corresponds to an image acquisition device, and the video monitoring network also includes a video monitoring client and network address translation NAT gateway equipment, described video surveillance client and video surveillance equipment are positioned at different private networks, are connected with public network through NAT gateway equipment respectively, it is characterized in that, comprises: 接收单元,用于接收目标通道媒体流业务请求报文,及接收用于复用第一业务链路的通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;A receiving unit, configured to receive a target channel media stream service request message, and receive a notification message for multiplexing a first service link, where the first service link is the video surveillance device and the video surveillance client The established transmission link at the end; 发送单元,用于使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号、以及目标通道标识、和被所述视频监控设备的出口NAT网关设备转换后私网IP地址对应的公网IP地址、期望私网端口号对应的期望公网端口号;A sending unit, configured to use the IP address and port number of the video surveillance device side of the first service link as the source IP address and source port number, and use the IP address and port number of the video surveillance client side of the first service link The port number is used as the destination IP address and the destination port number to send the target channel media stream service establishment notification message to the video surveillance client, and the service establishment notification message carries the private network IP address of the video surveillance device, the expected private network Network port number, the desired private network port number is the expected private network port number used by the video monitoring device to send the target channel media stream, and the target channel identifier, and is converted by the egress NAT gateway device of the video monitoring device The public network IP address corresponding to the private network IP address, and the desired public network port number corresponding to the desired private network port number; 建立单元,用于接收所述视频监控客户端发送到所述公网IP地址和所述期望公网端口号的业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;An establishment unit, configured to receive a service diversion packet sent by the video surveillance client to the public network IP address and the desired public network port number, and establish a second service between the video surveillance device and the video surveillance client link, the diversion message carries a target channel identifier; 所述发送单元,还用于利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The sending unit is further configured to use the second service link to send the media stream of the target channel to the video surveillance client. 5.一种视频监控客户端,位于视频监控组网中,所述视频监控组网还包括视频监控设备和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,其特征在于,包括:5. A video monitoring client, located in a video monitoring network, the video monitoring network also includes a video monitoring device and a NAT gateway device, the video monitoring device manages multiple channels, and each channel corresponds to an image acquisition device , the video monitoring client and the video monitoring device are located in different private networks, respectively connected to the public network through a NAT gateway device, characterized in that, comprising: 发送单元,用于发送请求获取所述视频监控设备目标通道媒体流的报文;A sending unit, configured to send a message requesting to obtain the media stream of the target channel of the video monitoring device; 接收单元,用于接收所述视频监控设备复用第一业务链路发送的目标通道媒体流业务建立通知报文,所述第一业务链路是所述视频监控客户端和所述视频监控设备已建立的传输链路,所述业务建立通知报文携带目标通道标识、所述视频监控设备的私网IP地址和所述视频监控设备发送目标通道媒体流的期望私网端口号、以及经过所述视频监控设备出口NAT网关设备转换所述私网IP地址得到的公网IP地址和转换期望私网端口号得到的期望公网端口号;A receiving unit, configured to receive a target channel media stream service establishment notification message sent by the video monitoring device by multiplexing the first service link, the first service link being the video monitoring client and the video monitoring device The transmission link that has been established, the service establishment notification message carries the target channel identifier, the private network IP address of the video monitoring device and the desired private network port number for the video monitoring device to send the media stream of the target channel, and the The public network IP address obtained by converting the private network IP address and the desired public network port number obtained by converting the desired private network port number through the NAT gateway device at the exit of the video surveillance equipment; 建立单元,用于在确定所述业务建立通知报文中的所述目标通道标识为请求获取媒体流的通道标识后,向所述公网IP地址和所述期望公网端口号发送引流报文,建立所述视频监控客户端和所述视频监控设备的第二业务链路;An establishment unit, configured to send a diversion message to the public network IP address and the desired public network port number after determining that the target channel identifier in the service establishment notification message is a channel identifier requesting to obtain a media stream , establishing a second service link between the video surveillance client and the video surveillance device; 所述接收单元,还用于接收所述视频监控设备基于第二业务链路发送的目标通道媒体流数据。The receiving unit is further configured to receive target channel media stream data sent by the video monitoring device based on the second service link. 6.一种视频监控网络,所述视频监控网络包括视频监控客户端、视频监控设备、视频监控服务器和NAT网关设备,所述视频监控设备管理多个通道,每个通道对应一个图像采集设备,所述视频监控服务器位于公网,所述视频监控客户端和视频监控设备位于不同的私网,分别通过NAT网关设备与公网相连,其特征在于,包括:6. A video monitoring network, the video monitoring network includes a video monitoring client, a video monitoring device, a video monitoring server and a NAT gateway device, the video monitoring device manages a plurality of channels, and each channel corresponds to an image acquisition device, The video monitoring server is located in the public network, and the video monitoring client and the video monitoring equipment are located in different private networks, and are respectively connected to the public network through a NAT gateway device, which is characterized in that, comprising: 视频监控客户端,用于向视频监控服务器发送请求获取视频监控设备目标通道媒体流业务请求报文;The video monitoring client is used to send a request message to the video monitoring server to obtain the media stream service of the target channel of the video monitoring device; 所述视频监控服务器,用于查询监控关系表,查看所述视频监控客户端和所述视频监控设备是否已经建立媒体监控关系,如果否,则所述视频监控客户端和所述视频监控设备进行NAT的UDP简单穿越STUN探测和STUN穿越,建立所述视频监控客户端和所述视频监控设备之间的传输链路,所述视频监控设备把所述目标通道媒体流发给所述视频监控客户端,如果是,则继续;The video monitoring server is used to query the monitoring relationship table, check whether the video monitoring client and the video monitoring device have established a media monitoring relationship, if not, then the video monitoring client and the video monitoring device perform UDP of NAT simply traverses STUN detection and STUN traversal, establishes a transmission link between the video surveillance client and the video surveillance device, and the video surveillance device sends the target channel media stream to the video surveillance client end, if yes, continue; 所述视频监控服务器,还用于向视频监控设备和视频监控客户端发送复用第一业务链路的报文,并且向视频监控设备发送所述视频监控客户端请求的目标通道媒体流业务请求报文;The video monitoring server is further configured to send a packet multiplexing the first service link to the video monitoring device and the video monitoring client, and send the target channel media stream service request requested by the video monitoring client to the video monitoring device message; 视频监控设备,用于接收目标通道媒体流业务请求报文,及接收用于复用第一业务链路的通知报文,所述第一业务链路是所述视频监控设备和所述视频监控客户端已建立的传输链路;A video monitoring device, configured to receive a target channel media stream service request message, and receive a notification message for multiplexing a first service link, where the first service link is the video monitoring device and the video monitoring The transmission link established by the client; 所述视频监控设备,还用于使用第一业务链路的所述视频监控设备侧IP地址和端口号作为源IP地址和源端口号,使用第一业务链路的所述视频监控客户端侧的IP地址和端口号作为目的IP地址和目的端口号,向所述视频监控客户端发送目标通道媒体流业务建立通知报文,所述业务建立通知报文携带所述视频监控设备的私网IP地址、期望私网端口号、以及目标通道标识,所述期望私网端口号是所述视频监控设备发送目标通道媒体流的所期望使用的私网端口号;The video surveillance device is further configured to use the video surveillance device side IP address and port number of the first service link as the source IP address and source port number, and use the video surveillance client side of the first service link The IP address and port number of the destination IP address and the destination port number are used as the destination IP address and the destination port number, and the target channel media stream service establishment notification message is sent to the video monitoring client, and the service establishment notification message carries the private network IP address of the video surveillance device Address, expected private network port number, and target channel identification, the expected private network port number is the expected private network port number used by the video surveillance equipment to send the target channel media stream; 所述视频监控设备所在出口的NAT网关设备,用于在所述业务建立通知报文中填充所述私网IP地址转换得到的公网IP地址、所述期望私网端口号转换得到的期望公网端口号;The NAT gateway device at the exit where the video monitoring device is located is used to fill in the service establishment notification message with the public network IP address obtained through the conversion of the private network IP address and the desired public IP address obtained through the conversion of the desired private network port number. network port number; 所述视频监控客户端,还用于收到所述业务建立通知报文,如果所述报文中携带的通道标识和请求的通道标识相同,则向所述业务建立通知报文中所述公网IP地址和所述期望公网端口号发送业务引流报文,建立所述视频监控设备和所述视频监控客户端的第二业务链路,所述引流报文携带目标通道标识;The video surveillance client is further configured to receive the service establishment notification message, and if the channel identifier carried in the message is the same as the requested channel identifier, then report to the public in the service establishment notification message The network IP address and the desired public network port number send a service diversion message, establish a second service link between the video surveillance device and the video surveillance client, and the diversion message carries a target channel identifier; 所述视频监控设备,还用于利用所述第二业务链路,发送所述目标通道的媒体流给所述视频监控客户端。The video monitoring device is further configured to use the second service link to send the media stream of the target channel to the video monitoring client.
CN201410406922.2A 2014-08-18 2014-08-18 Method and device for playing multiple media streams on demand Active CN104168457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410406922.2A CN104168457B (en) 2014-08-18 2014-08-18 Method and device for playing multiple media streams on demand

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410406922.2A CN104168457B (en) 2014-08-18 2014-08-18 Method and device for playing multiple media streams on demand

Publications (2)

Publication Number Publication Date
CN104168457A CN104168457A (en) 2014-11-26
CN104168457B true CN104168457B (en) 2017-05-17

Family

ID=51912062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410406922.2A Active CN104168457B (en) 2014-08-18 2014-08-18 Method and device for playing multiple media streams on demand

Country Status (1)

Country Link
CN (1) CN104168457B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105721625A (en) * 2016-02-03 2016-06-29 迈普通信技术股份有限公司 Method for implementing communication between private network devices, private network devices and center end device
CN105933198B (en) * 2016-04-21 2020-01-14 浙江宇视科技有限公司 Device for establishing direct connection VPN tunnel
CN106412505A (en) * 2016-09-29 2017-02-15 浙江大华技术股份有限公司 Video display method and apparatus in P2P mode
CN106454416B (en) * 2016-10-21 2019-12-13 浙江宇视科技有限公司 A method and device for synchronous playback
CN107027007B (en) * 2017-04-12 2019-07-05 南京三宝弘正视觉科技有限公司 A kind of video sharing method and system
CN110366008B (en) * 2018-03-26 2021-10-08 阿里巴巴(中国)有限公司 Multimedia resource request identification method, device and storage medium
CN110891185A (en) * 2019-11-21 2020-03-17 深圳警翼软件技术有限公司 Method for realizing distributed storage of acquisition workstations in internet scene without public network IP address
CN112449111A (en) * 2020-11-13 2021-03-05 珠海大横琴科技发展有限公司 Monitoring equipment processing method and device
CN114363665B (en) * 2021-12-16 2023-11-07 深圳市捷视飞通科技股份有限公司 Multi-service code stream pushing method, system, computer equipment and storage medium
CN114866854B (en) * 2022-04-20 2023-12-05 杭州博联智能科技股份有限公司 Video access mode dynamic allocation method, system, electronic equipment and storage medium
CN115942006B (en) * 2022-12-06 2024-05-28 北京中电兴发科技有限公司 Method suitable for multiplexing multiple paths of videos by network single port

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094159A (en) * 2007-07-18 2007-12-26 中兴通讯股份有限公司 Method for penetrating through private network of media stream
CN101465858A (en) * 2008-12-31 2009-06-24 中兴通讯股份有限公司 Method for implementing private network penetration of monitoring business, network appliance and server
CN103716589A (en) * 2013-12-26 2014-04-09 浙江宇视科技有限公司 Method and device for reducing NVR live forwarding relay

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102148879A (en) * 2010-10-22 2011-08-10 华为技术有限公司 Port mapping method and device and communication system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094159A (en) * 2007-07-18 2007-12-26 中兴通讯股份有限公司 Method for penetrating through private network of media stream
CN101465858A (en) * 2008-12-31 2009-06-24 中兴通讯股份有限公司 Method for implementing private network penetration of monitoring business, network appliance and server
CN103716589A (en) * 2013-12-26 2014-04-09 浙江宇视科技有限公司 Method and device for reducing NVR live forwarding relay

Also Published As

Publication number Publication date
CN104168457A (en) 2014-11-26

Similar Documents

Publication Publication Date Title
CN104168457B (en) Method and device for playing multiple media streams on demand
CN110301126B (en) Conference server
KR101758681B1 (en) Communication system, and data transmitting method in the system
TWI434595B (en) Connection establishing management methods for use in a network system and systems thereof
CN108259542B (en) Resource transmission method and device
CN109450923B (en) Video transmission system and method
CN104883390B (en) A kind of method and device accessing third party's video monitoring equipment
US20100088427A1 (en) Selective Routing of Data Transmission Between Clients
KR101647938B1 (en) Method and System for Providing Media Streaming By Interworking Heterogeneous Network through a Mobile Communication Network
CN113014885B (en) Railway video resource interconnection convergence system and method
WO2012174927A1 (en) Video monitoring system and method for traversing media through network address translation device
CN104270604A (en) Method, system and device for obtaining real-time video data of IPC
CN109391704B (en) Cross-private-network access method and device for video monitoring equipment
JP2020113970A (en) Method for remotely controlling video camera and video monitoring system
CN110740300A (en) Multimedia data transmission method, system, client and video monitoring equipment
CN106331195B (en) Data receiving and sending method and device
US20220191254A1 (en) Methods and systems for proxy relay implementation for client-server connections over wide area network
CN108632233B (en) A kind of alarming check method and apparatus
CN104601944B (en) Method for connecting to media stream providing device and media stream system
CN102075588B (en) Method and system for realizing network address translation (NAT) transversing and equipment
CN111935511B (en) Dynamic video stream access system and method based on http-dns
CN106789999B (en) Method and device for tracking video source
CN108810475A (en) A kind of Android video monitoring apparatus based on Onvif standards and Sip agreements
CN110113620B (en) Video resource real-time playing and collecting method and system based on private network environment
CN106534790A (en) Method and apparatus for automatically adjusting video media stream transmission path

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant