[go: up one dir, main page]

CN101989978A - Method, device and system for forwarding data by real time streaming protocol (RTSP) proxy - Google Patents

Method, device and system for forwarding data by real time streaming protocol (RTSP) proxy Download PDF

Info

Publication number
CN101989978A
CN101989978A CN2009101095582A CN200910109558A CN101989978A CN 101989978 A CN101989978 A CN 101989978A CN 2009101095582 A CN2009101095582 A CN 2009101095582A CN 200910109558 A CN200910109558 A CN 200910109558A CN 101989978 A CN101989978 A CN 101989978A
Authority
CN
China
Prior art keywords
client
real
rtsp
time streaming
streaming protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2009101095582A
Other languages
Chinese (zh)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN2009101095582A priority Critical patent/CN101989978A/en
Priority to PCT/CN2010/075535 priority patent/WO2011015111A1/en
Publication of CN101989978A publication Critical patent/CN101989978A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/10Architectures or entities
    • H04L65/1045Proxies, e.g. for session initiation protocol [SIP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明实施例公开了一种实时流协议代理转发数据的方法、装置和系统,该方法包括:通过实时流协议代理接收实时流协议客户端的实时流协议RTSP请求;根据所述RTSP请求,生成客户端标识和业务标识的关联关系表;根据该关联关系表,将所述RTSP响应消息转发给与所述客户端标识对应的实时流协议客户端,解决了实时流协议代理无法区分服务器返回的响应消息所归属的实时流协议客户端,从而导致客户端无法接收到该响应消息的问题,完善了RTSP Proxy的功能,简化了实时流协议代理的处理流程。

Figure 200910109558

The embodiment of the present invention discloses a method, device and system for forwarding data by a real-time streaming protocol proxy. The method includes: receiving a real-time streaming protocol RTSP request from a real-time streaming protocol client through a real-time streaming protocol proxy; The association relation table of terminal identification and service identification; According to this association relation table, described RTSP response message is forwarded to the real-time stream protocol client corresponding with described client identification, has solved the response that real-time stream protocol agent can't distinguish server to return The real-time streaming protocol client to which the message belongs leads to the problem that the client cannot receive the response message, improves the function of RTSP Proxy, and simplifies the processing flow of the real-time streaming protocol proxy.

Figure 200910109558

Description

一种实时流协议代理转发数据的方法、装置及系统 A method, device and system for proxy forwarding data of a real-time streaming protocol

技术领域technical field

本发明涉及通信技术领域,特别是涉及一种实时流协议代理转发数据的方法、装置及系统。The invention relates to the field of communication technology, in particular to a method, device and system for forwarding data by a real-time streaming protocol agent.

背景技术Background technique

实时流协议(Real Time Streaming Protocol,RTSP)是专用于媒体点播控制的协议,基于服务器/客户端架构。客户端、服务器都可以主动向对方发送消息。客户端服务器之间要先建立一个TCP连接,以后的会话控制的消息交换都发生在这条连接上。实时流协议2.0定义了几个主要的消息method,用以表示控制所需的主要功能,通过使用这些消息来对媒体流传输进行控制,例如所述消息有描述查询DESCRIBE,获取参数GET_PARAMETER,选项OPTIONS,暂停PAUSE,播放PLAY,重定向REDIRECT,建会话SETUP,设置参数SET_PARAMETER,结束会话TEARDOWN。Real Time Streaming Protocol (RTSP) is a protocol dedicated to media on-demand control, based on server/client architecture. Both the client and the server can actively send messages to each other. A TCP connection must first be established between the client and the server, and all subsequent session control message exchanges will take place on this connection. Real-time streaming protocol 2.0 defines several main message methods to express the main functions required for control, and use these messages to control media stream transmission. For example, the message has description query DESCRIBE, get parameter GET_PARAMETER, option OPTIONS , Pause PAUSE, play PLAY, redirect REDIRECT, build session SETUP, set parameter SET_PARAMETER, end session TEARDOWN.

实时流协议代理RTSP Proxy是介于RTSP协议的客户端RTSP Client(下面简称Client)与RTSP协议的服务器RTSP Server(下面简称Server)之间的网络设备,如图1所示为实时流协议代理架构图,RTSP Proxy具有转发RTSP信令和转发Server到Client的RTP媒体流的功能。RTSP Proxy同时担当服务器和客户端的角色,如图1,对RTSP Client而言,RTSP Proxy就是它的服务器,对RTSP Server而言,RTSP Proxy就是它的客户端。当RTSP Client向RTSP Server发送RTSP请求消息时,RTSP Proxy收到该请求消息后,转发给RTSP Server;当RTSP Server返回响应消息给RTSPClient,RTSP Proxy收到Server的响应消息后转发给RTSP Client。Real-time streaming protocol proxy RTSP Proxy is a network device between the client RTSP Client (hereinafter referred to as Client) of the RTSP protocol and the server RTSP Server (hereinafter referred to as Server) of the RTSP protocol. Figure 1 shows the real-time streaming protocol proxy architecture As shown in the figure, RTSP Proxy has the function of forwarding RTSP signaling and forwarding the RTP media stream from Server to Client. RTSP Proxy plays the role of server and client at the same time, as shown in Figure 1, for RTSP Client, RTSP Proxy is its server, and for RTSP Server, RTSP Proxy is its client. When the RTSP Client sends an RTSP request message to the RTSP Server, the RTSP Proxy forwards it to the RTSP Server after receiving the request message; when the RTSP Server returns a response message to the RTSP Client, the RTSP Proxy forwards it to the RTSP Client after receiving the response message from the Server.

在对现有技术的研究和实践过程中,发明人发现现有技术存在以下问题:当一个RTSP Proxy接入多个RTSP Client时,会收到多个RTSP Client的多个RTSP请求消息,但是由于一个RTSP Proxy与RTSP Server之间的消息承载在同一条网络链路(TCP链接或UDP链接)上,因此RTSP Proxy将该多个请求消息转发给RTSP Server时,RTSP Server无法区分这些消息所归属的RTSP Client,无法为每个RTSP Client创建会话,同时RTSPProxy也无法将RTSP Server返回的响应消息发送给相应的请求端RTSPClient,导致客户端无法接收到该响应消息,影响信令消息的交互。During the research and practice of the prior art, the inventor found that the prior art has the following problems: when an RTSP Proxy accesses multiple RTSP Clients, it will receive multiple RTSP request messages from multiple RTSP Clients, but due to The messages between an RTSP Proxy and the RTSP Server are carried on the same network link (TCP link or UDP link), so when the RTSP Proxy forwards the multiple request messages to the RTSP Server, the RTSP Server cannot distinguish which messages these messages belong to RTSP Client cannot create a session for each RTSP Client, and RTSPProxy cannot send the response message returned by the RTSP Server to the corresponding requesting RTSPClient, resulting in the client being unable to receive the response message and affecting the interaction of signaling messages.

发明内容Contents of the invention

本发明实施例提供一种实时流协议代理RTSP Proxy转发数据的方法、装置及系统,用于解决RTSP Proxy接入多个RTSP协议客户端,RTSP Proxy无法将RTSP Server返回的响应消息发送给相应的请求端RTSP Client,从而导致客户端无法接收到该响应消息的问题。Embodiments of the present invention provide a method, device and system for forwarding data by a real-time streaming protocol proxy RTSP Proxy, which is used to solve the problem that the RTSP Proxy accesses multiple RTSP protocol clients, and the RTSP Proxy cannot send the response message returned by the RTSP Server to the corresponding RTSP Client at the requesting end, which causes the problem that the client cannot receive the response message.

本发明实施例提供的一种实时流协议代理RTSP Proxy转发数据的方法,包括:The embodiment of the present invention provides a real-time streaming protocol agent RTSP Proxy forwarding data method, including:

接收来自多个实时流协议客户端的第一实时流协议RTSP请求;receiving a first real-time streaming protocol RTSP request from a plurality of real-time streaming protocol clients;

根据所述RTSP请求,为所述实时流协议客户端分配客户端标识和业务标识,并生成所述客户端标识和业务标识的关联关系表;According to the RTSP request, assign a client identifier and a service identifier to the real-time streaming protocol client, and generate an association table of the client identifier and the service identifier;

将携带所述业务标识的RTSP请求转发给实时流协议服务器;Forwarding the RTSP request carrying the service identifier to a real-time streaming protocol server;

接收所述实时流协议服务器的第一RTSP响应消息,所述第一RTSP响应消息中携带所述业务标识,并以所述业务标识为索引,通过查找所述关联关系表获得客户端标识,将所述第一RTSP响应消息转发给与所述客户端标识对应的实时流协议客户端。receiving the first RTSP response message from the real-time streaming protocol server, the first RTSP response message carrying the service identifier, and using the service identifier as an index to obtain the client identifier by searching the association table, and The first RTSP response message is forwarded to the real-time streaming protocol client corresponding to the client identifier.

本发明实施例提供的一种实时流协议代理RTSP Proxy转发数据的装置,包括:The embodiment of the present invention provides a real-time streaming protocol proxy RTSP Proxy device for forwarding data, including:

第一接收单元,用于接收来自多个实时流协议客户端的第一实时流协议RTSP请求;A first receiving unit, configured to receive a first real-time streaming protocol RTSP request from multiple real-time streaming protocol clients;

关联关系表生成单元,用于根据所述RTSP请求,为所述实时流协议客户端分配所述客户端标识和业务标识,并生成所述客户端标识和业务标识的关联关系表;An association table generation unit, configured to assign the client ID and service ID to the real-time streaming protocol client according to the RTSP request, and generate an association table between the client ID and the service ID;

第一发送单元,用于将携带所述业务标识的RTSP请求转发给实时流协议服务器;A first sending unit, configured to forward the RTSP request carrying the service identifier to a real-time streaming protocol server;

第二接收单元,用于接收所述实时流协议服务器的第一RTSP响应消息,所述RTSP响应消息中携带所述业务标识;A second receiving unit, configured to receive a first RTSP response message from the real-time streaming protocol server, where the RTSP response message carries the service identifier;

第二发送单元,用于以所述第二接收单元接收的RTSP响应消息中携带的业务标识为索引,通过查找所述关联关系表获得客户端标识,将所述RTSP响应消息转发给与所述客户端标识对应的实时流协议客户端。The second sending unit is configured to use the service identifier carried in the RTSP response message received by the second receiving unit as an index, obtain the client identifier by searching the association table, and forward the RTSP response message to the The client identifier corresponds to the real-time streaming protocol client.

本发明实施例提供的一种实时流协议代理RTSP Proxy转发数据的系统,包括:多个实时流协议客户端、实时流协议代理和实时流协议服务器:The embodiment of the present invention provides a real-time streaming protocol proxy RTSP Proxy system for forwarding data, including: a plurality of real-time streaming protocol clients, real-time streaming protocol agents and real-time streaming protocol servers:

所述实时流协议客户端,与所述实时流协议代理相连接,用于发送第一实时流协议RTSP请求给所述实时流协议代理,并接收所述实时流协议代理返回的RTSP响应消息;The real-time streaming protocol client is connected with the real-time streaming protocol agent, and is used to send the first real-time streaming protocol RTSP request to the real-time streaming protocol agent, and receive the RTSP response message returned by the real-time streaming protocol agent;

所述实时流协议代理,分别与所述实时流协议客户端和所述实时流协议服务器相连接,用于接收来自多个实时流协议客户端的第一实时流协议RTSP请求;根据所述RTSP请求,为所述实时流协议客户端分配所述客户端标识和业务标,并生成所述实时流协议客户端标识和业务标识的关联关系表;将携带所述业务标识的RTSP请求转发给实时流协议服务器;并接收所述服务器的RTSP响应消息,所述RTSP响应消息中携带所述业务标识,并以所述业务标识为索引,通过查找所述关联关系表获得于所述业务标识对应的所述客户端标识,将所述RTSP响应消息转发给与所述客户端标识对应的所述实时流协议客户端。The real-time streaming protocol agent is connected with the real-time streaming protocol client and the real-time streaming protocol server respectively, and is used to receive the first real-time streaming protocol RTSP request from multiple real-time streaming protocol clients; according to the RTSP request , distributing the client identifier and service identifier for the real-time streaming protocol client, and generating an association relationship table between the real-time streaming protocol client identifier and the service identifier; forwarding the RTSP request carrying the service identifier to the real-time streaming protocol server; and receive the RTSP response message of the server, the RTSP response message carries the service identifier, and uses the service identifier as an index to obtain all the corresponding service identifiers by searching the association table The client identifier is used to forward the RTSP response message to the real-time streaming protocol client corresponding to the client identifier.

所述实时流协议服务器,与所述实时流协议代理相连接,用于接收所述实时流协议代理发送的第一RTSP请求,根据不同的所述业务标识,为所述实时流协议客户端建立不同的会话,并返回所述RTSP响应消息给所述实时流协议代理,其中,所述RTSP响应消息中携带所述业务标识。The real-time streaming protocol server is connected to the real-time streaming protocol agent, and is used to receive the first RTSP request sent by the real-time streaming protocol agent, and establish an different sessions, and return the RTSP response message to the real-time streaming protocol agent, wherein the RTSP response message carries the service identifier.

本发明实施例提供一种实时流协议代理转发数据的方法,装置及系统,通过接收来自多个实时流协议客户端的第一实时流协议RTSP请求;根据所述RTSP请求,为所述实时流协议客户端分配客户端标识和业务标识,并生成所述客户端标识和业务标识的关联关系表;将携带所述业务标识的RTSP请求转发给实时流协议服务器;接收所述实时流协议服务器的第一RTSP响应消息,所述第一RTSP响应消息中携带所述业务标识,并以所述业务标识为索引,通过查找所述关联关系表获得客户端标识,将所述第一RTSP响应消息转发给与所述客户端标识对应的实时流协议客户端,解决了RTSP Proxy接入多个RTSP协议客户端,RTSP Proxy无法将RTSP Server返回的响应消息发送给相应的请求端RTSP Client,从而导致客户端无法接收到该响应消息的问题,完善了RTSP Proxy的功能,简化了RTSP Proxy的处理流程。Embodiments of the present invention provide a method, device and system for forwarding data by a real-time streaming protocol agent, by receiving the first real-time streaming protocol RTSP request from multiple real-time streaming protocol clients; according to the RTSP request, the real-time streaming protocol The client allocates a client ID and a service ID, and generates an association table between the client ID and the service ID; forwards the RTSP request carrying the service ID to a real-time streaming protocol server; receives the first request from the real-time streaming protocol server An RTSP response message, carrying the service identifier in the first RTSP response message, and using the service identifier as an index, obtaining the client identifier by searching the association table, and forwarding the first RTSP response message to The real-time streaming protocol client corresponding to the client ID solves the problem that the RTSP Proxy accesses multiple RTSP protocol clients, and the RTSP Proxy cannot send the response message returned by the RTSP Server to the corresponding requesting RTSP Client, resulting in the client The problem of not being able to receive the response message has improved the function of RTSP Proxy and simplified the processing flow of RTSP Proxy.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1为本发明现有技术中的一种实时流协议代理架构图;Fig. 1 is a kind of real-time streaming protocol proxy architecture diagram in the prior art of the present invention;

图2为本发明实施例中的一种实时流协议代理转发数据的方法流程图;Fig. 2 is a flow chart of a method for forwarding data by a real-time streaming protocol agent in an embodiment of the present invention;

图3为本发明实施例中一种实时流协议代理转发数据的具体实现方式流程图;FIG. 3 is a flow chart of a specific implementation of forwarding data by a real-time streaming protocol proxy in an embodiment of the present invention;

图4为本发明实施例中一种会话关联关系表;Fig. 4 is a kind of session correlation table in the embodiment of the present invention;

图5为本发明实施例中另一种会话关联关系表;Fig. 5 is another kind of session correlation table in the embodiment of the present invention;

图6为本发明实施例中另一种实时流协议代理转发数据的具体实现方式流程图;FIG. 6 is a flow chart of a specific implementation of another real-time streaming protocol agent forwarding data in an embodiment of the present invention;

图7为本发明实施例中一种事务关联关系表;FIG. 7 is a transaction association table in an embodiment of the present invention;

图8为本发明实施例中一种实时流协议代理转发数据的装置结构图;Fig. 8 is a device structure diagram of a real-time streaming protocol proxy forwarding data in an embodiment of the present invention;

图9为本发明实施例中的一种实时流协议代理转发数据的系统结构图。FIG. 9 is a system structure diagram of a real-time streaming protocol proxy forwarding data in an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。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 some of the embodiments of the present invention, but 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所示,为本发明实施例中的一种实时流协议代理RTSP Proxy转发数据的方法流程图,包括以下步骤:As shown in Figure 2, it is a flow chart of a method for forwarding data by a real-time streaming protocol proxy RTSP Proxy in an embodiment of the present invention, including the following steps:

步骤S202,接收来自多个实时流协议客户端RTSP Client的第一实时流协议RTSP请求。Step S202, receiving a first real-time streaming protocol RTSP request from multiple real-time streaming protocol clients RTSP Client.

具体为:RTSP Proxy接收多个RTSP Client发送的不同的RTSP请求。Specifically: RTSP Proxy receives different RTSP requests sent by multiple RTSP Clients.

步骤S204,根据所述实时流协议RTSP请求,为所述多个RTSP Client分别分配客户端标识和业务标识,并生成所述实时流协议客户端标识和业务标识的关联关系表,其中所述客户端标识包括:所述客户端的事务标识,或者所述客户端的会话标识。Step S204, according to the real-time streaming protocol RTSP request, assign client identifiers and service identifiers to the multiple RTSP clients respectively, and generate an association table of the real-time streaming protocol client identifiers and service identifiers, wherein the client The terminal identifier includes: the transaction identifier of the client, or the session identifier of the client.

当所述客户端标识为所述客户端的事务标识时,所述为所述RTSPClient分配所述客户端标识和业务标识,并生成所述实时流协议客户端标识和业务标识的关联关系表具体包括:When the client identifier is the transaction identifier of the client, the assigning the client identifier and the service identifier to the RTSPClient, and generating the association table of the real-time streaming protocol client identifier and the service identifier specifically includes :

RTSP Proxy为所述RTSP Client分配所述客户端事务标识和业务标识,并生成所述客户端事务标识和业务标识的关联关系表。The RTSP Proxy assigns the client transaction identifier and service identifier to the RTSP Client, and generates an association table of the client transaction identifier and service identifier.

当所述Client ID为所述客户端的会话标识时,所述为所述RTSPClient分配所述客户端标识和业务标识,并生成所述实时流协议客户端标识和业务标识的关联关系表具体包括:When the Client ID is the session identifier of the client, the distribution of the client identifier and the service identifier for the RTSPClient, and generating the association table of the real-time streaming protocol client identifier and the service identifier specifically includes:

RTSP Proxy为所述RTSP Client分配所述客户端的会话标识和业务标识;RTSP Proxy distributes the session identifier and service identifier of the client for the RTSP Client;

生成所述客户端会话标识、业务标识和所述服务器为所述客户端分配的所述服务器会话标识的关联关系表,其中所述服务器会话标识通过接收所述Server的RTSP响应消息获得。Generating an association table of the client session ID, the service ID, and the server session ID assigned by the server to the client, wherein the server session ID is obtained by receiving an RTSP response message from the Server.

其中,所述RTSP Server服务器侧在处理会话的RTSP请求时,同时存储关于业务标识和所述RTSP Server为所述客户端分配的所述服务器会话标识的关联关系表,以便下次进行会话处理的时候进行使用,当然也可以在服务器侧对该关联关系表不进行存储,可以通过RTSP请求消息中携带的业务标识和服务器会话标识对会话进行进一步处理。Wherein, when the RTSP Server server side is processing the RTSP request of the session, it simultaneously stores the association relationship table about the service identifier and the server session identifier assigned by the RTSP Server to the client, so that the next time the session is processed It can be used at any time, of course, the association relationship table can not be stored on the server side, and the session can be further processed through the service identifier and server session identifier carried in the RTSP request message.

步骤S206,将携带所述业务标识的RTSP请求转发给实时流协议服务器RTSP Server。Step S206, forwarding the RTSP request carrying the service identifier to the RTSP Server.

步骤S208,接收所述RTSP Server的第一RTSP响应消息,所述第一RTSP响应消息中携带所述业务标识,并以所述业务标识为索引,通过查找所述关联关系表获得相应的客户端会话标识,将所述第一RTSP响应消息转发给与所述客户端会话标识对应的所述RTSP Client。Step S208, receiving the first RTSP response message of the RTSP Server, the first RTSP response message carries the service identifier, and uses the service identifier as an index to obtain the corresponding client by searching the association table A session identifier, forwarding the first RTSP response message to the RTSP Client corresponding to the client session identifier.

当所述客户端标识为所述客户端的会话标识时,所述方法还包括:When the client identifier is the session identifier of the client, the method further includes:

RTSP Proxy接收来自所述RTSP Client的第二实时流协议RTSP请求,所述第二实时流协议RTSP请求中携带所述客户端会话标识;RTSP Proxy receives the second real-time streaming protocol RTSP request from the RTSP Client, and the second real-time streaming protocol RTSP request carries the client session identifier;

以所述客户端会话标识为索引,通过查找所述关联关系表,获得与所述客户端对应的所述服务器会话标识和业务标识;Obtaining the server session ID and service ID corresponding to the client by searching the association table with the client session ID as an index;

将所述服务器会话标识和业务标识携带在所述第二RTSP请求中,转发给与所述服务器会话标识对应的RTSP Server,使得所述RTSP Server根据所述服务器会话标识进行会话处理;Carry the server session identifier and the service identifier in the second RTSP request, and forward them to the RTSP Server corresponding to the server session identifier, so that the RTSP Server performs session processing according to the server session identifier;

接收所述RTSP Server返回的第二RTSP响应消息,所述RTSP响应消息中携带所述业务标识,并以所述业务标识为索引,通过查找所述关联关系表,将所述RTSP响应消息转发给与所述客户端标识对应的所述RTSPClient。Receiving the second RTSP response message returned by the RTSP Server, the RTSP response message carries the service identifier, and uses the service identifier as an index to forward the RTSP response message to The RTSPClient corresponding to the client ID.

其中所述第一RTSP请求消息和所述第二RTSP请求消息可以为:查询DESCRIBE,获取参数GET_PARAMETER,选项OPTIONS,暂停PAUSE,播放PLAY,重定向REDIRECT,建会话SETUP,设置参数SET_PARAMETER,结束会话TEARDOWN的任意一种或几种消息,且当第一次RTSP请求消息为会话时,所述第二RTSP请求消息可以为第二次或者第三次等依次向RTSP Rroxy进行请求,且不限于次数。Wherein the first RTSP request message and the second RTSP request message can be: query DESCRIBE, obtain parameter GET_PARAMETER, option OPTIONS, pause PAUSE, play PLAY, redirect REDIRECT, build session SETUP, set parameter SET_PARAMETER, end session TEARDOWN Any one or several kinds of messages, and when the first RTSP request message is a session, the second RTSP request message can be the second or third time to request RTSP Rroxy in turn, and is not limited to the number of times.

上述步骤描述的流程可以应用于会话交互流程和事务交互流程中,例如:典型的播放和结束的会话交互流程,在下面的实施例中会详细进行描述。The process described in the above steps can be applied to a session interaction process and a transaction interaction process, for example, a typical playback and end session interaction process, which will be described in detail in the following embodiments.

本发明实施例通过接收来自多个实时流协议客户端RTSP Client的第一实时流协议RTSP请求;根据所述RTSP请求,生成所述实时流协议客户端标识和业务标识的关联关系表;将携带所述业务标识的RTSP请求转发给实时流协议服务器RTSP Server;通过接收所述RTSP Server的RTSP响应消息,并以RTSP响应消息中携带的所述业务标识为索引,查找所述关联关系表,将所述RTSP响应消息转发给与所述客户端会话标识对应的所述RTSPClient,解决了RTSP Proxy接入多个RTSP协议客户端,,RTSP Proxy无法将RTSP Server返回的响应消息发送给相应的请求端RTSP Client,从而导致客户端无法接收到该响应消息的问题,完善了RTSP Proxy的功能,简化了RTSP Proxy的处理流程。The embodiment of the present invention receives the first real-time streaming protocol RTSP request from a plurality of real-time streaming protocol clients RTSP Client; according to the RTSP request, generates the association table of the real-time streaming protocol client identifier and the service identifier; will carry The RTSP request of the service identifier is forwarded to the real-time streaming protocol server RTSP Server; by receiving the RTSP response message of the RTSP Server, and using the service identifier carried in the RTSP response message as an index, the association table is searched, and the The RTSP response message is forwarded to the RTSPClient corresponding to the client session identifier, which solves the problem that the RTSP Proxy accesses multiple RTSP protocol clients, and the RTSP Proxy cannot send the response message returned by the RTSP Server to the corresponding requesting end RTSP Client, which leads to the problem that the client cannot receive the response message, improves the function of RTSP Proxy, and simplifies the processing flow of RTSP Proxy.

如图3所示,为本发明实施例中一种实时流协议代理RTSP Proxy转发数据的具体实现方式流程图,包括以下步骤:As shown in Figure 3, it is a flow chart of a specific implementation of RTSP Proxy forwarding data for a real-time streaming protocol agent in the embodiment of the present invention, including the following steps:

下面的实施例具体描述当实时流协议客户端RTSP Client发送第一实时流协议RTSP请求消息为会话请求消息,且所述实时流协议客户端标识Client ID为所述客户端的会话标识Client Session ID的情况,但不仅仅限制于会话的应用场景,还可以应用与其它的请求消息中。The following embodiments describe in detail that when the real-time streaming protocol client RTSP Client sends the first real-time streaming protocol RTSP request message as a session request message, and the real-time streaming protocol client identifier Client ID is the session identifier Client Session ID of the client Circumstances, but not only limited to the application scenario of the session, but also can be applied to other request messages.

步骤S300,实时流协议客户端RTSP Client发送实时流协议RTSP请求给实时流协议代理RTSP Proxy。Step S300, the real-time streaming protocol client RTSP Client sends the real-time streaming protocol RTSP request to the real-time streaming protocol proxy RTSP Proxy.

其中,与所述RTSP Proxy连接的RTSP Client有多个,所述RTSP请求是指RTSP Client第一次发送给RTSP Proxy的请求消息,所述请求消息可以为会话请求消息,也可以为其它请求消息。Wherein, there are multiple RTSP Clients connected to the RTSP Proxy, and the RTSP request refers to the request message that the RTSP Client sends to the RTSP Proxy for the first time, and the request message can be a session request message or other request messages .

步骤S302,RTSP Proxy接收多个RTSP Client发送的第一RTSP请求,为所述RTSP Client分配所述客户端会话标识和业务标识,并生成所述实时流协议客户端会话标识、业务标识和服务器会话标识的关联关系表,其中,所述服务器会话标识从返回的第一RTSP响应消息中获取。Step S302, RTSP Proxy receives the first RTSP request sent by multiple RTSP Clients, distributes the client session identifier and service identifier for the RTSP Client, and generates the real-time streaming protocol client session identifier, service identifier and server session An association relationship table of identifiers, wherein the server session identifier is acquired from the returned first RTSP response message.

具体所述客户端会话标识、业务标识和服务器会话标识的关联关系表如图4所示。Specifically, the association relationship table of the client session ID, the service ID and the server session ID is shown in FIG. 4 .

图4为本发明实施例中一种会话关联关系表,表中包括:客户端会话标识,是RTSP Proxy为所述RTSP Client分配的客户端会话标识,对于多个RTSP Client中各个RTSP Client发送的不同的RTSP请求,RTSP Proxy通过客户端会话标识来区分是哪个RTSP Client发送的RTSP请求;所述服务器会话标识,是所述RTSP Server为所述RTSP Client分配的,具体通过RTSP Server返回的响应消息中携带返回的,用于RTSP Server区分RTSPClient;所述业务标识,用于RTSP Proxy区分RTSP Server返回的响应消息对应的业务数据区,也用于RTSP Server区分来之同一个RTSP Proxy的不同会话请求。RTSP Proxy为一次会话分配一个业务标识,在一次会话交互过程中,业务标识保持不变。例如:RTSP Proxy生成客户端的会话标识为“1”则可以表示为:客户端的会话标识-1;业务标识为“X”,则表示为:业务标识-x;根据RTSP响应消息返回的服务器端的会话标识为“A”,则表示为:服务器端的会话标识-A。Fig. 4 is a kind of session correlation table in the embodiment of the present invention, includes in the table: client session identification, is the client session identification that RTSP Proxy distributes for described RTSP Client, sends for each RTSP Client in a plurality of RTSP Clients For different RTSP requests, RTSP Proxy uses the client session ID to distinguish which RTSP Client sent the RTSP request; the server session ID is assigned by the RTSP Server to the RTSP Client, specifically through the response message returned by the RTSP Server The returned one is used by the RTSP Server to distinguish the RTSPClient; the service identifier is used by the RTSP Proxy to distinguish the business data area corresponding to the response message returned by the RTSP Server, and is also used by the RTSP Server to distinguish different session requests from the same RTSP Proxy . RTSP Proxy assigns a service identifier to a session, and the service identifier remains unchanged during a session interaction. For example: RTSP Proxy generates the client's session ID as "1", which can be expressed as: client's session ID -1; business ID is "X", then it is expressed as: business ID -x; according to the server-side session returned by the RTSP response message If the identifier is "A", it means: session identifier-A on the server side.

其中,所述会话关联关系表中还可以包括:会话信息Session-Info选项,用于将所述Client的会话信息、Server的会话信息、Client的地址或者消息参数等信息记录在该选项中,这一点为目前会话中都需要进行描述的,在此就不再具体描述。Wherein, the session association relationship table may also include: a session information Session-Info option, which is used to record information such as the session information of the Client, the session information of the Server, the address of the Client or message parameters in the option, which One point needs to be described in the current conversation, and will not be described in detail here.

步骤S304,RTSP Proxy将携带所述业务标识的第一RTSP请求转发给实时流协议服务器RTSP Server。In step S304, the RTSP Proxy forwards the first RTSP request carrying the service identifier to the RTSP Server.

具体为:通过扩展所述RTSP请求消息,在所述消息中携带所述ServiceID,将所述消息发送给相应的RTSP Server进行处理,其中所述可以RTSPServer为多个,但是具体接收该RTSP请求为RTSP Proxy根据请求的内容决定选择多个RTSP Server中的具体一个RTSP Server来进行处理。Specifically: by extending the RTSP request message, carrying the ServiceID in the message, the message is sent to the corresponding RTSP Server for processing, wherein the RTSP Server can be multiple, but the RTSP request is specifically received as RTSP Proxy decides to select a specific RTSP Server among multiple RTSP Servers for processing according to the content of the request.

步骤S306,RTSP Server接收所述RTSP请求,根据所述请求,为来自同一Proxy的不同业务标识的请求消息,建立不同的会话。Step S306, the RTSP Server receives the RTSP request, and according to the request, establishes different sessions for request messages from different service identifiers of the same Proxy.

步骤S308,RTSP Server为所述RTSP Client分配服务器会话标识,并返回第一RTSP响应请求给所述RTSP Proxy,所述RTSP响应请求中携带所述服务器会话标识和业务标识。In step S308, the RTSP Server assigns a server session ID to the RTSP Client, and returns a first RTSP response request to the RTSP Proxy, and the RTSP response request carries the server session ID and service ID.

步骤S310,RTSP Server存储为所述RTSP Client分配的服务器会话标识和业务标识的关联关系表。Step S310, the RTSP Server stores the association relationship table between the server session identifier and the service identifier assigned to the RTSP Client.

具体服务器会话标识和业务标识的关联关系表为图5所示。The specific relationship table between the server session identifier and the service identifier is shown in FIG. 5 .

图5为本发明实施例中另一种会话关联关系表,存储于RTSP Server侧,所述关联关系表包括:服务器会话标识和业务标识;该服务器会话标识,用于RTSP Server对该客户端已经建立了会话,以便下次该RTSP Client再次请求时,对该会话继续进行处理,避免重复建立会话;所述业务标识,用于RTSP Proxy区分RTSP Server返回的响应消息对应的业务数据区,也用于RTSP Server区分来之同一个RTSP Proxy的不同会话请求。RTSPProxy为一次会话分配一个业务标识,在一次会话交互过程中,业务标识保持不变。例如:RTSP Proxy生成客户端的会话标识为“1”则可以表示为:客户端的会话标识-1;业务标识为“X”,则表示为:业务标识-x;根据RTSP响应消息返回的服务器端的会话标识为“A”,则表示为:服务器端的会话标识-A。Fig. 5 is another kind of session correlation table in the embodiment of the present invention, is stored in RTSP Server side, and described correlation table comprises: server session identification and service identification; This server session identification, is used for RTSP Server to client already A session is established, so that the next time the RTSP Client requests again, the session will continue to be processed to avoid repeated session establishment; the service identifier is used by the RTSP Proxy to distinguish the service data area corresponding to the response message returned by the RTSP Server, and also used The RTSP Server distinguishes different session requests from the same RTSP Proxy. RTSPProxy assigns a service identifier to a session, and the service identifier remains unchanged during a session interaction. For example: RTSP Proxy generates the client's session ID as "1", which can be expressed as: client's session ID -1; business ID is "X", then it is expressed as: business ID -x; according to the server-side session returned by the RTSP response message If the identifier is "A", it means: session identifier-A on the server side.

具体可以参见下面实例的详细说明。For details, please refer to the detailed description of the following examples.

应该注意的是,该步骤310为可选步骤,即在RTSP Server侧可以存储为所述RTSP Client分配的服务器会话标识和业务标识的关联关系表,也可以不进行存储。若RTSP Server不存储该关联关系表时,也可以根据RTSP请求中携带的服务器会话标识进行会话处理。It should be noted that this step 310 is an optional step, that is, the RTSP Server side may store the association table of the server session identifier and the service identifier allocated for the RTSP Client, or may not store it. If the RTSP Server does not store the association table, it can also perform session processing according to the server session identifier carried in the RTSP request.

其中,步骤S308和步骤S310无先后顺序的限制。Wherein, step S308 and step S310 have no sequence limitation.

步骤S312,RTSP Proxy接收RTSP Server返回的RTSP响应消息,将所述RTSP响应消息中携带的服务器会话标识写入所述关联关系表中的服务器会话标识选项中Step S312, the RTSP Proxy receives the RTSP response message returned by the RTSP Server, and writes the server session identifier carried in the RTSP response message into the server session identifier option in the association table

步骤S313,RTSP Proxy根据所述RTSP响应消息中携带的业务标识为索引,通过RTSP Proxy中存储的所述关联关系表找到所述业务标识对应的客户端标识,将所述RTSP响应消息转发给与所述客户端标识对应的所述RTSP Client。Step S313, RTSP Proxy uses the service identification carried in the RTSP response message as an index, finds the client identification corresponding to the service identification through the association relationship table stored in the RTSP Proxy, and forwards the RTSP response message to the The RTSP Client corresponding to the client identifier.

步骤S314,RTSP Client发送第二RTSP请求消息给RTSP Proxy,所述第二请求中携带所述客户端会话标识。Step S314, the RTSP Client sends a second RTSP request message to the RTSP Proxy, and the second request carries the client session identifier.

步骤S316,RTSP Proxy接收所述第二RTSP请求消息,根据所述请求消息中携带的客户端会话标识,查找自身存储的会话关联关系表,获得与所述客户端对应的所述服务器会话标识和业务标识。Step S316, the RTSP Proxy receives the second RTSP request message, searches the session association table stored by itself according to the client session identifier carried in the request message, and obtains the server session identifier and the server session identifier corresponding to the client. Business identity.

其中,所述自身存储的关联关系表为所述客户端会话标识、业务标识和所述服务器为所述客户端分配的所述服务器会话标识的关联关系表,即图4所示。Wherein, the association relationship table stored by itself is an association relationship table of the client session identifier, the service identifier, and the server session identifier allocated by the server to the client, as shown in FIG. 4 .

步骤S318,RTSP Proxy将所述服务器会话标识和业务标识携带在所述RTSP请求中,转发给与所述服务器会话标识对应的RTSP Server。Step S318, RTSP Proxy carries the server session identifier and service identifier in the RTSP request, and forwards it to the RTSP Server corresponding to the server session identifier.

步骤S320,RTSP Server接收所述第二请求消息,根据所述请求消息中携带的服务器会话标识,对所述会话进行处理。Step S320, the RTSP Server receives the second request message, and processes the session according to the server session identifier carried in the request message.

步骤S322,返回第二RTSP响应消息给所述RTSP Proxy,所述第二RTSP响应消息中携带所述业务标识。Step S322, returning a second RTSP response message to the RTSP Proxy, where the second RTSP response message carries the service identifier.

其中,RTSP Server也根据业务标识的值确定是否需要生成多个业务,比如,Server收到同一个Proxy的业务请求时,如果有不同业务标识,Server将视为不同业务请求,会生成多个业务数据区。Among them, the RTSP Server also determines whether multiple services need to be generated according to the value of the service identifier. For example, when the Server receives a service request from the same Proxy, if there are different service identifiers, the Server will treat it as a different service request and generate multiple services. data area.

步骤S324,RTSP Proxy接收所述第二RTSP响应消息,以所述响应消息中携带的所述业务标识为索引,通过查找所述关联关系表,获取所述客户端会话标识。In step S324, the RTSP Proxy receives the second RTSP response message, uses the service identifier carried in the response message as an index, and obtains the client session identifier by searching the association table.

步骤S326,将所述第二RTSP响应消息转发给与所述客户端会话标识对应的所述RTSP Client,使得RTSP Client接收所述RTSP响应消息。Step S326, forwarding the second RTSP response message to the RTSP Client corresponding to the client session identifier, so that the RTSP Client receives the RTSP response message.

其中,根据所述业务标识,可以更新该会话相应的信息,将所述更新后的会话信息写入自身存储的关联关系表中的会话信息Session-Info选项中。Wherein, according to the service identifier, the corresponding information of the session can be updated, and the updated session information can be written into the session information Session-Info option in the association table stored by itself.

上述的交互流程也适用于一个RTSP Proxy需要与多个Server连接的应用场景,只需要在RTSP Proxy与多个RTSP Server之间的信令交互消息中携带业务标识字段即可。The above interaction process is also applicable to the application scenario where an RTSP Proxy needs to be connected to multiple Servers. It only needs to carry the service identification field in the signaling interaction message between the RTSP Proxy and multiple RTSP Servers.

下面结合一个典型的播放和结束的会话交互流程进行具体描述,所述关于RTSP请求包括:建会话Setup、播放Play、暂停Pause以及结束会话Teardown。例如:RTSP Client向RTSP Proxy发送的RTSP请求为SETUP消息,消息举例如下:A typical play and end session interaction process will be described in detail below. The RTSP request includes: set up session Setup, play Play, pause Pause, and end session Teardown. For example: The RTSP request sent by the RTSP Client to the RTSP Proxy is a SETUP message, the message example is as follows:

C->P:SETUP rtsp://foo/twister/video RTSO/1.0C->P:SETUP rtsp://foo/twister/video RTSO/1.0

       CSeq:1CSeq: 1

Transport:RTP/AVP;unicast;client_port=8002-8003Transport: RTP/AVP; unicast; client_port=8002-8003

RTSP Proxy生成客户端会话标识Client Session ID:客户端会话标识Client Session ID-1和业务标识ServiceID:业务标识ServiceID-x,并转发该消息给RTSP Server,消息中携带业务标识ServiceID-x字段或选项,消息举例如下(下面用ServiceID来表示业务标识,但并不是表示唯一使用Service ID表示业务标识,仅以此为例进行说明。所述业务标识,用于RTSP Proxy区分RTSP Server返回的响应消息对应的业务数据区,也用于RTSP Server区分来之同一个RTSP Proxy的不同会话请求的。RTSPProxy为一次会话分配一个业务标识,在一次会话交互过程中,业务标识保持不变的均可以代表该业务标识):RTSP Proxy generates client session ID Client Session ID: client session ID Client Session ID-1 and service ID ServiceID: service ID ServiceID-x, and forwards the message to RTSP Server, the message carries the service ID ServiceID-x field or option , the message example is as follows (ServiceID is used to represent the service identifier below, but it does not mean that the only service ID is used to represent the service identifier, and this is only used as an example for illustration. The service identifier is used by the RTSP Proxy to distinguish the corresponding response message returned by the RTSP Server The business data area is also used by the RTSP Server to distinguish different session requests from the same RTSP Proxy. RTSPProxy assigns a business identifier to a session. During a session interaction, any service identifier that remains unchanged can represent the business logo):

P->S:SETUP rtsp://foo/twister/video RTSP/1.0P->S: SETUP rtsp://foo/twister/video RTSP/1.0

    CSeq:1CSeq: 1

Transport:RTP/AVP;unicast;client_port=10000-10001Transport: RTP/AVP; unicast; client_port=10000-10001

Service-ID:1234Service-ID: 1234

RTSP Server为所述客户端分配的所述服务器会话标识ServerSession ID:Server Session ID-A,并记录收到的业务标识ServiceID-x,处理后返回给RTSP Proxy的响应消息中需要携带ServiceID-x,举例如下:The server session identifier ServerSession ID assigned by the RTSP Server to the client: Server Session ID-A, and record the service identifier ServiceID-x received, after processing, the response message returned to the RTSP Proxy needs to carry ServiceID-x, Examples are as follows:

S->P:RTSP/1.0 200 OKS->P: RTSP/1.0 200 OK

       CSeq:1CSeq: 1

Transport:RTP/AVP;unicast;client_port=10000-10001;Transport: RTP/AVP; unicast; client_port=10000-10001;

                 server_port=12004-12005Server_port=12004-12005

Session:22345679Session: 22345679

Service-ID:1234Service-ID: 1234

RTSP Proxy把根据业务标识ServiceID-x,查找自身存储的关联关系表,找到对应的Client Session ID-1,并记录RTSP Server生成的会话标识:Server Session ID-A,根据该会话标识Server Session ID-A,把响应消息转发给Client,举例如下:RTSP Proxy searches the association table stored by itself according to the service ID ServiceID-x, finds the corresponding Client Session ID-1, and records the session ID generated by the RTSP Server: Server Session ID-A, according to the session ID Server Session ID- A. Forward the response message to the Client, for example as follows:

P->C:RTSP/1.0 200 OKP->C: RTSP/1.0 200 OK

       CSeq:1CSeq: 1

       Transport:RTP/AVP;unicast;client_port=8002-8003;Transport: RTP/AVP; unicast; client_port=8002-8003;

                       server_port=9004-9005server_port=9004-9005

       Session:12345678  Session: 12345678

当RTSP Client向Proxy发送PLAY消息,消息举例如下:When RTSP Client sends PLAY message to Proxy, the message example is as follows:

C->P:PLAY rtsp://foo/twister RTSP/1.0C->P: PLAY rtsp://foo/twister RTSP/1.0

       CSeq:2CSeq: 2

       Range:npt=0-Range: npt=0-

       Session:12345678  Session: 12345678

RTSP Proxy根据客户端的会话标识:Client Session ID-1找到对应的业务标识:ServiceID-x和服务器会话标识Server Session ID-A,在转发给RTSP Server的Play消息中,携带服务器会话标识Server SessionID-A和业务标识:ServiceID-x字段,消息举例如下:RTSP Proxy finds the corresponding business identifier: ServiceID-x and server session identifier Server Session ID-A according to the client's session identifier: Client Session ID-1, and carries the server session identifier Server SessionID-A in the Play message forwarded to the RTSP Server And business identifier: ServiceID-x field, the message example is as follows:

P->S:PLAY rtsp://foo/twister RTSP/1.0P->S: PLAY rtsp://foo/twister RTSP/1.0

       CSeq:2CSeq: 2

       Range:npt=0-Range: npt=0-

       Session:22345679  Session: 22345679

       Service-ID:1234  Service-ID: 1234

RTSP Server根据会话标识Server Session ID-A找到对应的数据区,处理后返回给RTSP Proxy的响应消息中需要携带业务标识:ServiceID-x字段,举例如下:The RTSP Server finds the corresponding data area according to the session identifier Server Session ID-A, and the response message returned to the RTSP Proxy after processing needs to carry the service identifier: ServiceID-x field, for example as follows:

S->P:RTSP/1.0 200 OKS->P: RTSP/1.0 200 OK

       CSeq:2CSeq: 2

Session:22345679Session: 22345679

RTP-Info:url=rtsp://foo/twister/video;RTP-Info:url=rtsp://foo/twister/video;

      seq=10092;rtptime=1120089Seq=10092; rtptime=1120089

Service-ID:1234Service-ID: 1234

RTSP Proxy根据业务标识:ServiceID-x找到对应的客户端的会话标识:Client Session ID-1,根据该客户端的会话标识:Client Session ID-1把响应消息转发给RTSP Client,举例如下:RTSP Proxy finds the corresponding client's session ID: Client Session ID-1 according to the service ID: ServiceID-x, and forwards the response message to the RTSP Client according to the client's session ID: Client Session ID-1, as follows:

P->C:RTSP/1.0 200 OKP->C: RTSP/1.0 200 OK

       CSeq:2CSeq: 2

       Session:12345678  Session: 12345678

       RTP-Info:url=rtsp://foo/twister/video;RTP-Info:url=rtsp://foo/twister/video;

             seq=40023;rtptime=3450012  seq = 40023; rtptime = 3450012

当RTSP Client向RTSP Proxy发送PAUSE消息以及teardown的流程如上述描述的流程相同,在此不再赘述。When the RTSP Client sends a PAUSE message to the RTSP Proxy and the process of teardown is the same as the process described above, it will not be repeated here.

本发明实施例提供一种实时流协议代理RTSP Proxy转发数据的具体实施方法,通过接收来自多个实时流协议客户端RTSP Client的实时流协议RTSP请求;根据所述RTSP请求,生成所述实时流协议客户端标识ClientSession ID和业务标识Service ID的关联关系表;将携带所述Service ID的RTSP请求转发给实时流协议服务器RTSP Server;通过接收所述RTSPServer的RTSP响应消息,并以RTSP响应消息中携带的所述Service ID为索引,查找所述关联关系表,将所述RTSP响应消息转发给与所述ClientSessionID对应的所述RTSP Client,解决了RTSP Proxy接入多个RTSP协议客户端,RTSP Proxy无法将RTSP Server返回的响应消息发送给相应的请求端RTSP Client,从而导致客户端无法接收到该响应消息的问题,完善了RTSP Proxy的功能,简化了RTSP Proxy的处理流程。The embodiment of the present invention provides a specific implementation method for RTSP Proxy forwarding data of a real-time streaming protocol, by receiving real-time streaming protocol RTSP requests from multiple real-time streaming protocol client RTSP Clients; generating the real-time streaming according to the RTSP requests The protocol client identifies the ClientSession ID and the business identification Service ID association table; the RTSP request carrying the Service ID is forwarded to the real-time streaming protocol server RTSP Server; by receiving the RTSP response message of the RTSP Server, and using the RTSP response message The Service ID carried is an index, searches the association table, forwards the RTSP response message to the RTSP Client corresponding to the ClientSessionID, solves the problem of RTSP Proxy accessing multiple RTSP protocol clients, and RTSP Proxy The response message returned by the RTSP Server cannot be sent to the corresponding requesting RTSP Client, which leads to the problem that the client cannot receive the response message, improves the function of RTSP Proxy, and simplifies the processing flow of RTSP Proxy.

图6为本发明实施例中另一种实时流协议代理RTSP Proxy转发数据的具体实现方式流程图,下面结合图6对本发明实施例中另一种实时流协议代理RTSP Proxy转发数据的具体实现方式流程图做具体描述。Fig. 6 is another kind of real-time streaming protocol agent RTSP Proxy concrete implementation manner flow chart of forwarding data in the embodiment of the present invention, the specific implementation manner of another kind of real-time streaming protocol proxy RTSP Proxy forwarding data in the embodiment of the present invention below in conjunction with Fig. 6 The flow chart is described in detail.

下面描述实时流协议代理RTSP Proxy不仅可以接收实时流协议客户端关于会话的RTSP消息外,还可以接收关于事务的RTSP消息,比如选项OPTIONS、查询DESCRIBE、通告ANNOUNCE等消息的应用场景,消息流程只由一对请求和响应消息完成,这类消息称之为事务类消息。Proxy只需要为这类消息创建事务。关于事务的关联关系表中包含客户端事务标识和业务标识,与实时流协议服务器RTSP Server的交互消息携带该业务标识,收到RTSP Server的响应消息,根据业务标识定位关联关系表,把响应消息转发给client,整个事务即结束,具体如下:The following describes the application scenarios in which the real-time streaming protocol proxy RTSP Proxy can not only receive RTSP messages about sessions from the real-time streaming protocol client, but also receive RTSP messages about transactions, such as options OPTIONS, query DESCRIBE, and notify ANNOUNCE. The message flow is only Completed by a pair of request and response messages, such messages are called transactional messages. Proxies only need to create transactions for such messages. The relationship table about the transaction contains the client transaction ID and the business ID, and the interaction message with the real-time streaming protocol server RTSP Server carries the business ID, receives the response message from the RTSP Server, locates the association table according to the business ID, and sends the response message Forwarded to the client, the entire transaction is over, as follows:

步骤S600,实时流协议客户端RTSP Client发送实时流协议RTSP请求给实时流协议代理RTSP Proxy。Step S600, the real-time streaming protocol client RTSP Client sends the real-time streaming protocol RTSP request to the real-time streaming protocol proxy RTSP Proxy.

其中,与所述RTSP Proxy连接的RTSP Client有多个,所述请求消息可以为事务请求消息。Wherein, there are multiple RTSP Clients connected with the RTSP Proxy, and the request message may be a transaction request message.

步骤S602,所述RTSP Proxy接收多个RTSP Client发送的RTSP请求,为所述RTSP Client分配所述客户端的事务标识和业务标识,并生成所述实时流协议客户端标识和业务标识的关联关系表。Step S602, the RTSP Proxy receives the RTSP requests sent by a plurality of RTSP Clients, distributes the client's transaction identifier and service identifier for the RTSP Client, and generates an association relationship table between the real-time streaming protocol client identifier and the service identifier .

具体关于所述客户端标识为客户端事务标识时,生成所述客户端事务标识和业务标识的事务关联关系表如图7所示。Specifically, when the client identifier is a client transaction identifier, a transaction association table of the client transaction identifier and service identifier is generated as shown in FIG. 7 .

图7为本发明实施例中一种事务关联关系表,存储在RTSP Proxy中,表中包括:客户端事务标识,是RTSP Proxy为所述RTSP Client分配的客户端事务标识,对于多个RTSP Client中各个RTSP Client发送的不同的RTSP请求,RTSP Proxy通过客户端事务标识来区分是哪个RTSP Client发送的RTSP请求;所述业务标识,用于RTSP Proxy区分RTSP Server返回的响应消息对应的业务数据区,也用于RTSP Server区分来之同一个RTSP Proxy的不同会话请求。RTSP Proxy为一次会话分配一个业务标识,在一次会话交互过程中,业务标识保持不变。例如:RTSP Proxy生成客户端事务标识为“1”则可以表示为:客户端事务标识-1;业务标识为“Y”,则表示为:业务标识-Y,下面的具体的实例中进行了详细的说明。Fig. 7 is a kind of transaction correlation table in the embodiment of the present invention, is stored in RTSP Proxy, includes in the table: client transaction identification, is the client transaction identification that RTSP Proxy distributes for described RTSP Client, for a plurality of RTSP Clients For different RTSP requests sent by each RTSP Client in RTSP Proxy, RTSP Proxy uses the client transaction ID to distinguish which RTSP Client sent the RTSP request; the business ID is used for RTSP Proxy to distinguish the business data area corresponding to the response message returned by the RTSP Server , also used by RTSP Server to distinguish different session requests from the same RTSP Proxy. RTSP Proxy assigns a service identifier to a session, and the service identifier remains unchanged during a session interaction. For example: RTSP Proxy generates a client transaction ID of "1", which can be expressed as: client transaction ID -1; business ID is "Y", then it is expressed as: business ID -Y, detailed in the following specific examples instruction of.

步骤S604,RTSP Proxy将携带所述Service ID的RTSP请求转发给实时流协议服务器RTSP Server。In step S604, the RTSP Proxy forwards the RTSP request carrying the Service ID to the RTSP Server.

具体为:RTSP Proxy所述RTSP请求消息中通过扩展的字段,携带所述业务标识,将所述消息发送给相应的RTSP Server进行处理,其中所述RTSP Server为多个,但是具体接收该RTSP请求为RTSP Proxy根据请求的内容决定选择多个RTSP Server中的具体一个RTSP Server来进行处理。Specifically: the RTSP request message described by RTSP Proxy carries the service identifier through the extended field, and sends the message to the corresponding RTSP Server for processing, wherein there are multiple RTSP Servers, but specifically receives the RTSP request According to the content of the request, the RTSP Proxy decides to select a specific RTSP Server among multiple RTSP Servers for processing.

步骤S606,RTSP Server接收所述RTSP请求,根据所述请求,RTSPServer为来之同一Proxy的不同Service ID的请求消息进行消息处理。In step S606, the RTSP Server receives the RTSP request, and according to the request, the RTSP Server performs message processing for request messages from different Service IDs of the same Proxy.

步骤S607,返回RTSP响应消息给响应的RTSP Proxy,所述响应消息中携带所述业务标识。Step S607, returning an RTSP response message to the responding RTSP Proxy, the response message carrying the service identifier.

步骤S608,RTSP Proxy接收RTSP Server返回的RTSP响应消息,根据所述RTSP响应消息中携带的业务标识为索引,通过查找RTSP Proxy中存储的所述事务关联关系表,获取客户端事务标识。Step S608, the RTSP Proxy receives the RTSP response message returned by the RTSP Server, and according to the service identification carried in the RTSP response message as an index, obtains the client transaction identification by searching the transaction association table stored in the RTSP Proxy.

步骤S610,RTSP Proxy将所述RTSP响应消息转发给与所述客户端事务标识对应的RTSP Client,使得所述RTSP Client接收所述RTSP Proxy返回的RTSP响应消息。Step S610, the RTSP Proxy forwards the RTSP response message to the RTSP Client corresponding to the client transaction identifier, so that the RTSP Client receives the RTSP response message returned by the RTSP Proxy.

上述的交互流程也适用于一个RTSP Proxy需要与多个Server连接的应用场景,只需要在RTSP Proxy与多个RTSP Server之间的信令交互消息中携带所述业务标识字段即可。The above interaction process is also applicable to the application scenario where an RTSP Proxy needs to be connected to multiple Servers, and only needs to carry the service identification field in the signaling interaction message between the RTSP Proxy and multiple RTSP Servers.

下面结合一个典型事务交互流程进行具体描述,以RTSP请求消息为选项OPTIONS消息为例:The following is a specific description combined with a typical transaction interaction process, taking the RTSP request message as the option OPTIONS message as an example:

该RTSP Client向RTSP Proxy发送Options消息,消息举例如下:The RTSP Client sends an Options message to the RTSP Proxy. Examples of messages are as follows:

C->P:OPTIONS*RTSP/1.0C->P: OPTIONS * RTSP/1.0

       CSeq:0CSeq: 0

       Require:implicit-play  Require: implicit-play

       Proxy-Require:gzipped-messages  Proxy-Require: gzipped-messages

RTSP Proxy首先生成客户端事务标识:Client Transaction ID:ClientTransaction ID-1和关联的业务标识ServiceID:ServiceID-x,RTSP Proxy转发options消息给RTSP Server,消息中增加ServiceID字段,消息举例如下(这里的所述客户端事务标识用Client Transaction ID表示,业务标识用ServiceID表示,但并不是表示唯一使用Service ID表示业务标识,仅以此为例进行说明。所述业务标识,用于RTSP Proxy区分RTSPServer返回的响应消息对应的业务数据区,也用于RTSP Server区分来之同一个RTSP Proxy的不同会话请求的。RTSP Proxy为一次会话分配一个业务标识,在一次会话交互过程中,业务标识保持不变的均可以代表该业务标识):RTSP Proxy first generates the client transaction ID: Client Transaction ID: ClientTransaction ID-1 and the associated business ID ServiceID: ServiceID-x, RTSP Proxy forwards the options message to the RTSP Server, and adds the ServiceID field to the message. The message example is as follows (here all The above-mentioned client transaction ID is represented by Client Transaction ID, and the business ID is represented by ServiceID, but it does not mean that the only service ID is used to represent the business ID, and this is only used as an example for illustration. The business ID is used for RTSP Proxy to distinguish the returned by RTSPServer The business data area corresponding to the response message is also used by the RTSP Server to distinguish different session requests from the same RTSP Proxy. The RTSP Proxy assigns a business identifier to a session, and the service identifier remains unchanged during a session interaction. can represent the business ID):

P->S:OPTIONS*RTSP/1.0P->S: OPTIONS * RTSP/1.0

       CSeq:0CSeq: 0

       Require:implicit-play  Require: implicit-play

       Proxy-Require:gzipped-messages  Proxy-Require: gzipped-messages

       Service-ID:1235  Service-ID: 1235

RTSP Server处理后返回给RTSP Proxy的响应消息中需要携带来自RTSP Proxy的业务标识:ServiceID-x,举例如下:After processing by RTSP Server, the response message returned to RTSP Proxy needs to carry the business identifier from RTSP Proxy: ServiceID-x, for example as follows:

S->P:RTSP/1.0 200 OKS->P: RTSP/1.0 200 OK

       CSeq:0CSeq: 0

       Public:DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE  Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE

       Service-ID:1235  Service-ID: 1235

RTSP Proxy根据业务标识ServiceID-x,查找事务关联关系表,找到对应的事务标识Client Transaction ID-1,根据事务标识把响应消息转发给对应的RTSP Client,消息举例如下:RTSP Proxy searches the transaction association table according to the business identifier ServiceID-x, finds the corresponding transaction identifier Client Transaction ID-1, and forwards the response message to the corresponding RTSP Client according to the transaction identifier. The message example is as follows:

P->C:RTSP/1.0 200 OKP->C: RTSP/1.0 200 OK

       CSeq:0CSeq: 0

       Public:DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE  Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE

同样,当所述RTSP消息为DESCRIBE消息等其它事务消息时,也可以通过上述流程进行处理,这里就不再赘述。Similarly, when the RTSP message is other transaction messages such as DESCRIBE messages, it can also be processed through the above-mentioned flow, and details will not be repeated here.

本发明实施例提供另一种实时流协议代理RTSP Proxy转发数据的具体实施方法,通过接收来自多个实时流协议客户端RTSP Client的实时流协议RTSP请求;根据所述RTSP请求,生成所述实时流协议客户端的事务标识Client Transaction ID和业务标识Service ID的关联关系表;将携带所述Service ID的RTSP请求转发给实时流协议服务器RTSP Server;通过接收所述RTSP Server的RTSP响应消息,并以RTSP响应消息中携带的所述Service ID为索引,查找所述关联关系表,将所述RTSP响应消息转发给与所述Client Transaction ID对应的所述RTSP Client,解决了RTSPProxy接入多个RTSP协议客户端,RTSP Proxy无法将RTSP Server返回的响应消息发送给相应的请求端RTSP Client,从而导致客户端无法接收到该响应消息的问题,完善了RTSP Proxy的功能,简化了RTSP Proxy的处理流程。The embodiment of the present invention provides another specific implementation method for RTSP Proxy forwarding data of a real-time streaming protocol, by receiving real-time streaming protocol RTSP requests from multiple real-time streaming protocol client RTSP Clients; according to the RTSP requests, generating the real-time The association table of the transaction identification Client Transaction ID of the streaming protocol client and the service identification Service ID; the RTSP request carrying the Service ID is forwarded to the real-time streaming protocol server RTSP Server; by receiving the RTSP response message of the RTSP Server, and The Service ID carried in the RTSP response message is an index, the association table is searched, and the RTSP response message is forwarded to the RTSP Client corresponding to the Client Transaction ID, which solves the problem of RTSPProxy accessing multiple RTSP protocols On the client side, RTSP Proxy cannot send the response message returned by RTSP Server to the corresponding requesting RTSP Client, which leads to the problem that the client cannot receive the response message, improves the function of RTSP Proxy, and simplifies the processing flow of RTSP Proxy.

如图8所示,图8为本发明实施例中一种实时流协议代理RTSP Proxy转发数据的装置结构图,包括:As shown in Figure 8, Figure 8 is a device structure diagram of a real-time streaming protocol agent RTSP Proxy forwarding data in an embodiment of the present invention, including:

第一接收单元800,用于接收来自多个实时流协议客户端的第一实时流协议RTSP请求;The first receiving unit 800 is configured to receive a first real-time streaming protocol RTSP request from multiple real-time streaming protocol clients;

关联关系表生成单元802,用于根据所述RTSP请求,为所述实时流协议客户端分配所述客户端标识和业务标识,并生成所述客户端标识和业务标识的关联关系表;An association relationship table generation unit 802, configured to assign the client identifier and service identifier to the real-time streaming protocol client according to the RTSP request, and generate an association relationship table between the client identifier and the service identifier;

第一发送单元804,用于将携带所述业务标识的RTSP请求转发给实时流协议服务器;The first sending unit 804 is configured to forward the RTSP request carrying the service identifier to a real-time streaming protocol server;

第二接收单元806,用于接收所述实时流协议服务器的第一RTSP响应消息,所述RTSP响应消息中携带所述业务标识;The second receiving unit 806 is configured to receive a first RTSP response message from the real-time streaming protocol server, where the RTSP response message carries the service identifier;

第二发送单元808,用于以所述第二接收单元接收的RTSP响应消息中携带的业务标识为索引,通过查找所述关联关系表获得客户端标识,将所述RTSP响应消息转发给与所述客户端标识对应的实时流协议客户端。The second sending unit 808 is configured to use the service identifier carried in the RTSP response message received by the second receiving unit as an index, obtain the client identifier by searching the association table, and forward the RTSP response message to the The real-time streaming protocol client corresponding to the above client identifier.

其中,当所述客户端标识为所述客户端事务标识时,所述关联关系表生成单元802具体用于为所述实时流协议客户端分配客户端事务标识和业务标识,并生成所述客户端事务标识和所述业务标识的关联关系表。Wherein, when the client identifier is the client transaction identifier, the association relationship table generation unit 802 is specifically configured to assign a client transaction identifier and a service identifier to the real-time streaming protocol client, and generate the client transaction identifier. An association relationship table between the terminal transaction identifier and the service identifier.

当所述客户端标识为所述客户端的会话标识时,所述关联关系表生成单元具体用于为所述实时流协议客户端分配所述客户端的会话标识和业务标识;生成所述客户端会话标识、业务标识和所述实时流协议服务器为所述实时流协议客户端分配的服务器会话标识的关联关系表,其中所述服务器会话标识通过接收所述实时流协议服务器的RTSP响应消息获得。When the client identifier is the client's session identifier, the association table generating unit is specifically configured to assign the client's session identifier and service identifier to the real-time streaming protocol client; generate the client session An association table of identifiers, service identifiers, and server session identifiers allocated by the real-time streaming protocol server to the real-time streaming protocol client, wherein the server session identifier is obtained by receiving an RTSP response message from the real-time streaming protocol server.

并且,当所述客户端标识为所述客户端的会话标识时,所述装置还包括:And, when the client identifier is the session identifier of the client, the device further includes:

所述第一接收单元800,还用于接收来自所述实时流协议客户端的第二实时流协议RTSP请求,所述请求中携带所述客户端会话标识;The first receiving unit 800 is further configured to receive a second real-time streaming protocol RTSP request from the real-time streaming protocol client, the request carrying the client session identifier;

获取单元810,用于以所述第一接收单元的所述客户端会话标识为索引,过查找所述关联关系表,获得与所述客户端对应的所述服务器会话标识和业务标识;The acquiring unit 810 is configured to use the client session ID of the first receiving unit as an index to obtain the server session ID and service ID corresponding to the client by searching the association table;

所述第一发送单元804,还用于将所述服务器会话标识和业务标识携带在所述第二RTSP请求中,转发给与所述服务器会话标识对应的实时流协议服务器,使得所述实时流协议服务器根据所述服务器会话标识进行会话处理;The first sending unit 804 is further configured to carry the server session identifier and service identifier in the second RTSP request, and forward them to the real-time streaming protocol server corresponding to the server session identifier, so that the real-time stream The protocol server performs session processing according to the server session identifier;

所述第二接收单元806,还用于接收所述实时流协议服务器返回的第二RTSP响应消息,所述第二RTSP响应消息中携带所述业务标识;The second receiving unit 806 is further configured to receive a second RTSP response message returned by the real-time streaming protocol server, where the second RTSP response message carries the service identifier;

所述第二发送单元808,还用于以所述第二接收单元接收的所述事务标识为索引,通过查找所述关联关系表获得与所述业务标识对应的客户端标识,将所述第二RTSP响应消息转发给与所述客户端标识对应的所述实时流协议客户端。The second sending unit 808 is further configured to take the transaction identifier received by the second receiving unit as an index, obtain the client identifier corresponding to the service identifier by searching the association relationship table, and send the second The second RTSP response message is forwarded to the real-time streaming protocol client corresponding to the client identifier.

需要说明的是:该实时流协议代理RTSP Proxy转发数据的装置中的各个模块可以内置于一种实时流协议代理RTSP Proxy中,也可以为独立的装置,该装置的各部分的交互过程可以参见对图3和图6的实施例的描述,这里就不再赘述。It should be noted that each module in the real-time streaming protocol proxy RTSP Proxy device for forwarding data can be built into a real-time streaming protocol proxy RTSP Proxy, or it can be an independent device. The interaction process of each part of the device can be found in The description of the embodiments shown in FIG. 3 and FIG. 6 will not be repeated here.

本发明实施例提供一种实时流协议代理RTSP Proxy转发数据的装置,通过该装置各个模块的相互交互,将RTSP服务器返回的RTSP响应消息通过所述实时流协议客户端标识和业务标识的关联关系表转发给与所述客户端标识对应的所述RTSP Client,解决了实时流协议代理无法区分服务器返回的响应消息所归属的实时流协议客户端,从而导致客户端无法接收到该响应消息的问题,完善了RTSP Proxy的功能,简化了实时流协议代理的处理流程。The embodiment of the present invention provides a real-time streaming protocol agent RTSP Proxy data forwarding device, through the mutual interaction of each module of the device, the RTSP response message returned by the RTSP server is passed through the association between the real-time streaming protocol client identifier and the service identifier The table is forwarded to the RTSP Client corresponding to the client ID, which solves the problem that the real-time streaming protocol agent cannot distinguish the real-time streaming protocol client that the response message returned by the server belongs to, thus causing the client to fail to receive the response message , improve the function of RTSP Proxy, and simplify the processing flow of real-time streaming protocol proxy.

如图9所示,图9为本发明实施例中的一种实时流协议代理RTSP Proxy转发数据的系统结构图,包括:As shown in Figure 9, Figure 9 is a system structure diagram of a real-time streaming protocol agent RTSP Proxy forwarding data in an embodiment of the present invention, including:

多个实时流协议客户端RTSP Client902、实时流协议代理RTSPProxy904和实时流协议服务器RTSP Server906;Multiple real-time streaming protocol clients RTSP Client902, real-time streaming protocol agent RTSPProxy904 and real-time streaming protocol server RTSP Server906;

所述RTSP Client902,与所述实时流协议代理相连接,用于发送第一实时流协议RTSP请求给所述实时流协议代理,并接收所述实时流协议代理返回的RTSP响应消息;The RTSP Client902 is connected with the agent of the real-time streaming protocol, and is used to send the first real-time streaming protocol RTSP request to the agent of the real-time streaming protocol, and receive the RTSP response message returned by the agent of the real-time streaming protocol;

所述实时流协议代理RTSP Proxy904,分别与所述实时流协议客户端和所述实时流协议服务器相连接,用于接收来自多个实时流协议客户端的第一实时流协议RTSP请求;根据所述RTSP请求,为所述实时流协议客户端分配所述客户端标识和业务标,并生成所述实时流协议客户端标识和业务标识的关联关系表;将携带所述业务标识的RTSP请求转发给实时流协议服务器;并接收所述服务器的RTSP响应消息,所述RTSP响应消息中携带所述业务标识,并以所述业务标识为索引,通过查找所述关联关系表获得于所述业务标识对应的所述客户端标识,将所述RTSP响应消息转发给与所述客户端标识对应的所述实时流协议客户端;The real-time streaming protocol agent RTSP Proxy904 is connected with the real-time streaming protocol client and the real-time streaming protocol server respectively, and is used to receive the first real-time streaming protocol RTSP request from multiple real-time streaming protocol clients; according to the RTSP request, assign the client identification and service mark for the real-time streaming protocol client, and generate the association table of the real-time streaming protocol client identification and service identification; forward the RTSP request carrying the service identification to Real-time streaming protocol server; and receive the RTSP response message of the server, the RTSP response message carries the service identifier, and uses the service identifier as an index to obtain the corresponding service identifier by searching the association table The client identifier of the client, forwarding the RTSP response message to the real-time streaming protocol client corresponding to the client identifier;

所述实时流协议服务器RTSP Server906,与所述实时流协议代理相连接,用于接收所述实时流协议代理发送的第一RTSP请求,根据不同的所述业务标识,为所述实时流协议客户端建立不同的会话,并返回所述RTSP响应消息给所述实时流协议代理,其中,所述RTSP响应消息中携带所述业务标识。The real-time streaming protocol server RTSP Server906 is connected with the real-time streaming protocol proxy, and is used to receive the first RTSP request sent by the real-time streaming protocol proxy, and according to different service identifiers, be the client of the real-time streaming protocol The end establishes different sessions, and returns the RTSP response message to the real-time streaming protocol agent, wherein the RTSP response message carries the service identifier.

当所述客户端标识为客户端会话标识时,When the client identifier is a client session identifier,

所述实时流协议代理具体用于根据所述RTSP请求,为所述实时流协议客户端分配所述客户端标识和业务标识,并生成所述客户端标识和业务标识的关联关系表;The real-time streaming protocol agent is specifically configured to assign the client identifier and service identifier to the real-time streaming protocol client according to the RTSP request, and generate an association table between the client identifier and the service identifier;

所述实时流协议服务器还用于获取并存储所述服务器为所述客户端分配的所述服务器会话标识和所述业务标识的关联关系表,其中,所述业务标识从所述RTSP请求消息中获取。The real-time streaming protocol server is also used to obtain and store the association table of the server session identifier and the service identifier assigned by the server to the client, wherein the service identifier is obtained from the RTSP request message Obtain.

当所述客户端标识为所述客户端会话标识时,When the client identifier is the client session identifier,

所述实时流协议客户端,还用于发送第二实时流协议RTSP请求给所述实时流协议代理,所述请求中携带所述客户端会话标识,以及接收所述实时流协议代理返回的第二RTSP响应;The real-time streaming protocol client is further configured to send a second real-time streaming protocol RTSP request to the real-time streaming protocol agent, the request carries the client session identifier, and receives the second request returned by the real-time streaming protocol agent. 2 RTSP response;

所述实时流协议代理,还用于接收所述第二RTSP请求,将所述客户端会话标识为索引,过查找所述关联关系表,获得与客户端会话标识对应的所述服务器会话标识和业务标识,将所述服务器会话标识和业务标识携带在所述第二RTSP请求中,转发给与所述服务器会话标识对应的实时流协议服务器;并接收所述实时流协议服务器返回的第二RTSP响应消息,所述第二RTSP响应消息中携带所述业务标识;以所述业务标识为索引,通过查找所述关联关系表获取与所述业务标识对应的客户端会话标识,将所述RTSP响应消息转发给与所述客户端会话标识对应的所述实时流协议客户端;The real-time streaming protocol agent is further configured to receive the second RTSP request, identify the client session as an index, and obtain the server session ID and the server session ID corresponding to the client session ID by searching the association table. A service identifier, carrying the server session identifier and the service identifier in the second RTSP request, forwarding to the real-time streaming protocol server corresponding to the server session identifier; and receiving the second RTSP returned by the real-time streaming protocol server Response message, the second RTSP response message carries the service identifier; using the service identifier as an index, obtains the client session identifier corresponding to the service identifier by searching the association table, and sends the RTSP response forwarding the message to the real-time streaming protocol client corresponding to the client session identifier;

所述实时流协议服务器,还用于接收所述实时流协议代理转发的所述第二RTSP请求,根据所述请求中携带的所述服务器会话标识对所述会话进行处理,并返回第二RTSP响应消息给所述实时流协议代理,所述第二RTSP响应消息中携带所述业务标识。The real-time streaming protocol server is further configured to receive the second RTSP request forwarded by the real-time streaming protocol proxy, process the session according to the server session identifier carried in the request, and return the second RTSP request A response message is sent to the real-time streaming protocol agent, and the second RTSP response message carries the service identifier.

当所客户端标识为所述客户端事务标识时,When the client identifier is the client transaction identifier,

所述实时流协议代理具体用于根据所述RTSP请求,为所述实时流协议客户端分配客户端事务标识和业务标识,并生成所述客户端事务标识和所述业务标识的关联关系表。The real-time streaming protocol agent is specifically configured to assign a client transaction identifier and a service identifier to the real-time streaming protocol client according to the RTSP request, and generate an association table of the client transaction identifier and the service identifier.

本发明实施例提供一种实时流协议代理RTSP Proxy转发数据的系统,通过系统中的RTSP Client、RTSP Proxy和RTSP Server之间的相互交互,将RTSP服务器返回的RTSP响应消息通过所述实时流协议客户端标识和业务标识D的关联关系表转发给与所述客户端标识对应的所述RTSP Client,解决了实时流协议代理无法区分服务器返回的响应消息所归属的实时流协议客户端,从而导致客户端无法接收到该响应消息的问题,完善了RTSPProxy的功能,简化了实时流协议代理的处理流程。The embodiment of the present invention provides a real-time streaming protocol agent RTSP Proxy forwarding data system, through the mutual interaction between RTSP Client, RTSP Proxy and RTSP Server in the system, the RTSP response message returned by the RTSP server is passed through the real-time streaming protocol The association table of the client ID and the service ID D is forwarded to the RTSP Client corresponding to the client ID, which solves the problem that the real-time streaming protocol agent cannot distinguish the real-time streaming protocol client to which the response message returned by the server belongs, resulting in The problem that the client cannot receive the response message improves the function of RTSPProxy and simplifies the processing flow of the real-time streaming protocol proxy.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来或通过硬件来实现,基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使一台终端设备(可以是手机,个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general-purpose hardware platform or by hardware. Based on this understanding, the technical solution of the present invention is essentially In other words, the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to make a terminal device (which can be a mobile phone, a personal computer, or a server) , or a network device, etc.) execute the methods described in various embodiments of the present invention.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that, for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications can also be made. It should be regarded as the protection scope of the present invention.

Claims (12)

1. the method for real-time streaming protocol agency forwarding data is characterized in that, comprising:
Reception is from the first real-time streaming protocol RTSP request of a plurality of real-time streaming protocol clients;
According to described RTSP request,, and generate the incidence relation table of described client identification and service identification for described real-time streaming protocol client is distributed client identification and service identification;
The RTSP request of carrying described service identification is transmitted to the real-time streaming protocol server;
Receive a RTSP response message of described real-time streaming protocol server, carry described service identification in the described RTSP response message, and be index with described service identification, obtain client identification by searching described incidence relation table, a described RTSP response message is transmitted to the real-time streaming protocol client corresponding with described client identification.
2. method according to claim 1, it is characterized in that, when described client identification is client transaction when sign, describedly distribute described client identification and service identification, and the incidence relation table that generates described client identification and service identification comprises specifically for described real-time streaming protocol client:
For described real-time streaming protocol client is distributed client transaction sign and service identification, and generate the incidence relation table of described client transaction sign and described service identification.
3. method according to claim 1, it is characterized in that, when described client identification is described client-side session sign, describedly distribute described client identification and service identification, and the incidence relation table that generates described client identification and service identification comprises specifically for described real-time streaming protocol client:
For described real-time streaming protocol client is distributed described client-side session sign and service identification;
Generating described client session sign, service identification and described real-time streaming protocol server is the incidence relation table of the server session sign of described real-time streaming protocol client distribution, and wherein said server session sign is by receiving the RTSP response message acquisition of described real-time streaming protocol server.
4. method according to claim 3 is characterized in that, described method also comprises:
Reception is carried described client session sign from the second real-time streaming protocol RTSP request of described real-time streaming protocol client in the described request;
Be designated index with described client session, cross and search described incidence relation table, obtain described server session sign and the service identification corresponding with described client;
Described server session sign and service identification are carried in described the 2nd RTSP request, be transmitted to and the corresponding real-time streaming protocol server of described server session sign, make described real-time streaming protocol server carry out session and handle according to described server session sign;
Receive the 2nd RTSP response message that described real-time streaming protocol server returns, carry described service identification in described the 2nd RTSP response message, and be index with described service identification, obtain and described service identification clients corresponding sign by searching described incidence relation table, described the 2nd RTSP response message is transmitted to the described real-time streaming protocol client corresponding with described client identification.
5. the device of real-time streaming protocol agency forwarding data is characterized in that, comprising:
First receiving element is used to receive the first real-time streaming protocol RTSP request from a plurality of real-time streaming protocol clients;
The incidence relation table generates the unit, is used for for described real-time streaming protocol client is distributed described client identification and service identification, and generating the incidence relation table of described client identification and service identification according to described RTSP request;
First transmitting element, the RTSP request that is used for carrying described service identification is transmitted to the real-time streaming protocol server;
Second receiving element is used to receive a RTSP response message of described real-time streaming protocol server, carries described service identification in the described RTSP response message;
Second transmitting element, the service identification that is used for carrying with the RTSP response message that described second receiving element receives is an index, obtain client identification by searching described incidence relation table, described RTSP response message is transmitted to the real-time streaming protocol client corresponding with described client identification.
6. device according to claim 5, it is characterized in that, when institute's family end is designated described client transaction sign, described incidence relation table generates the unit and specifically is used to described real-time streaming protocol client to distribute client transaction sign and service identification, and generates the incidence relation table of described client transaction sign and described service identification.
7. device according to claim 5, it is characterized in that, when described client identification was described client-side session sign, described incidence relation table generated the unit and specifically is used to described real-time streaming protocol client to distribute described client-side session sign and service identification; Generating described client session sign, service identification and described real-time streaming protocol server is the incidence relation table of the server session sign of described real-time streaming protocol client distribution, and wherein said server session sign is by receiving the RTSP response message acquisition of described real-time streaming protocol server.
8. device according to claim 7 is characterized in that, when described client identification was described client-side session sign, described device also comprised:
Described first receiving element also is used to receive the second real-time streaming protocol RTSP request from described real-time streaming protocol client, carries described client session sign in the described request;
Acquiring unit is used for being designated index with the described client session of described first receiving element, crosses and searches described incidence relation table, obtains described server session sign and the service identification corresponding with described client;
Described first transmitting element, also be used for described server session sign and service identification are carried at described the 2nd RTSP request, be transmitted to and the corresponding real-time streaming protocol server of described server session sign, make described real-time streaming protocol server carry out session and handle according to described server session sign;
Described second receiving element also is used to receive the 2nd RTSP response message that described real-time streaming protocol server returns, and carries described service identification in described the 2nd RTSP response message;
Described second transmitting element, the described service identification that also is used for receiving with described second receiving element is an index, obtain and described service identification clients corresponding sign by searching described incidence relation table, described the 2nd RTSP response message is transmitted to the described real-time streaming protocol client corresponding with described client identification.
9. the system of real-time streaming protocol agency forwarding data is characterized in that, comprising: a plurality of real-time streaming protocol clients, real-time streaming protocol agency and real-time streaming protocol server;
Described real-time streaming protocol client is connected with described real-time streaming protocol agency, is used to send the first real-time streaming protocol RTSP and asks to described real-time streaming protocol agency, and receive the RTSP response message that described real-time streaming protocol agency returns;
Described real-time streaming protocol agency is connected with described real-time streaming protocol server with described real-time streaming protocol client respectively, is used to receive the first real-time streaming protocol RTSP request from a plurality of real-time streaming protocol clients; According to described RTSP request,, and generate the incidence relation table of described real-time streaming protocol client identification and service identification for described real-time streaming protocol client is distributed described client identification and professional mark; The RTSP request of carrying described service identification is transmitted to the real-time streaming protocol server; And receive the RTSP response message of described server, carry described service identification in the described RTSP response message, and be index with described service identification, by searching the described client identification that described incidence relation table is attained at described service identification correspondence, described RTSP response message is transmitted to the described real-time streaming protocol client corresponding with described client identification;
Described real-time streaming protocol server, be connected with described real-time streaming protocol agency, be used to receive the RTSP request that described real-time streaming protocol agency sends, according to different described service identifications, for described real-time streaming protocol client is set up different sessions, and return described RTSP response message and give described real-time streaming protocol agency, wherein, carry described service identification in the described RTSP response message.
10. system according to claim 9 is characterized in that, when described client identification is the client session sign,
Described real-time streaming protocol agency specifically is used for for described real-time streaming protocol client is distributed described client identification and service identification, and generating the incidence relation table of described client identification and service identification according to described RTSP request;
It is the described client described server session sign of distributing and the incidence relation table of described service identification that described real-time streaming protocol server also is used to obtain and store described server, and wherein, described service identification obtains from described RTSP request message.
11. system according to claim 9 is characterized in that, when described client identification is described client session sign,
Described real-time streaming protocol client also is used to send the second real-time streaming protocol RTSP and asks to carry described client session sign in the described request to described real-time streaming protocol agency, and receives the 2nd RTSP response that described real-time streaming protocol agency returns;
Described real-time streaming protocol agency, also be used to receive described the 2nd RTSP request, described client session is designated index, cross and search described incidence relation table, obtain described server session sign and the service identification corresponding with the client session sign, described server session sign and service identification are carried in described the 2nd RTSP request, are transmitted to and the corresponding real-time streaming protocol server of described server session sign; And receive the 2nd RTSP response message that described real-time streaming protocol server returns, carry described service identification in described the 2nd RTSP response message; With described service identification is index, obtains and described service identification clients corresponding session identification by searching described incidence relation table, and described RTSP response message is transmitted to and the corresponding described real-time streaming protocol client of described client session sign;
Described real-time streaming protocol server, also be used to receive described the 2nd RTSP request that described real-time streaming protocol agency transmits, according to the described server session sign of carrying in the described request described session is handled, and return the 2nd RTSP response message and give described real-time streaming protocol agency, carry described service identification in described the 2nd RTSP response message.
12. system according to claim 9 is characterized in that, when institute's client identification is described client transaction sign,
Described real-time streaming protocol agency specifically is used for according to described RTSP request, for described real-time streaming protocol client is distributed client transaction sign and service identification, and generates the incidence relation table of described client transaction sign and described service identification.
CN2009101095582A 2009-08-05 2009-08-05 Method, device and system for forwarding data by real time streaming protocol (RTSP) proxy Pending CN101989978A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN2009101095582A CN101989978A (en) 2009-08-05 2009-08-05 Method, device and system for forwarding data by real time streaming protocol (RTSP) proxy
PCT/CN2010/075535 WO2011015111A1 (en) 2009-08-05 2010-07-29 Method, device and system for real time streaming protocol proxy forwarding data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101095582A CN101989978A (en) 2009-08-05 2009-08-05 Method, device and system for forwarding data by real time streaming protocol (RTSP) proxy

Publications (1)

Publication Number Publication Date
CN101989978A true CN101989978A (en) 2011-03-23

Family

ID=43543924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101095582A Pending CN101989978A (en) 2009-08-05 2009-08-05 Method, device and system for forwarding data by real time streaming protocol (RTSP) proxy

Country Status (2)

Country Link
CN (1) CN101989978A (en)
WO (1) WO2011015111A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108307149A (en) * 2017-12-29 2018-07-20 上海顶竹通讯技术有限公司 A kind of video proxy system and monitoring method
CN109067860A (en) * 2018-07-20 2018-12-21 山东中创软件工程股份有限公司 A kind of mobile terminal message treatment method and relevant apparatus
CN111988205A (en) * 2019-05-24 2020-11-24 上海诺基亚贝尔股份有限公司 Method for serving remote physical equipment and core proxy equipment
CN114244908A (en) * 2021-11-05 2022-03-25 浙江蓝卓工业互联网信息技术有限公司 Cross-domain RTSP streaming media transmission method
CN114466167A (en) * 2022-02-14 2022-05-10 南京甄视智能科技有限公司 Mechanism for realizing quick real-time stream response under GB28181 communication protocol

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1619853A1 (en) * 2004-07-21 2006-01-25 Siemens Mobile Communications S.p.A. RTSP proxy extended to detect streaming session events and report to valued streaming applications the notified ones
CN1870621A (en) * 2005-08-10 2006-11-29 华为技术有限公司 Method for providing load supporting control of service of user
WO2009074099A1 (en) * 2007-12-06 2009-06-18 Huawei Technologies Co., Ltd. Media stream control method, system and logic entity

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1619853A1 (en) * 2004-07-21 2006-01-25 Siemens Mobile Communications S.p.A. RTSP proxy extended to detect streaming session events and report to valued streaming applications the notified ones
CN1870621A (en) * 2005-08-10 2006-11-29 华为技术有限公司 Method for providing load supporting control of service of user
WO2009074099A1 (en) * 2007-12-06 2009-06-18 Huawei Technologies Co., Ltd. Media stream control method, system and logic entity

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108307149A (en) * 2017-12-29 2018-07-20 上海顶竹通讯技术有限公司 A kind of video proxy system and monitoring method
CN109067860A (en) * 2018-07-20 2018-12-21 山东中创软件工程股份有限公司 A kind of mobile terminal message treatment method and relevant apparatus
CN111988205A (en) * 2019-05-24 2020-11-24 上海诺基亚贝尔股份有限公司 Method for serving remote physical equipment and core proxy equipment
CN111988205B (en) * 2019-05-24 2022-03-04 上海诺基亚贝尔股份有限公司 Method for serving remote physical equipment and core proxy equipment
CN114244908A (en) * 2021-11-05 2022-03-25 浙江蓝卓工业互联网信息技术有限公司 Cross-domain RTSP streaming media transmission method
CN114466167A (en) * 2022-02-14 2022-05-10 南京甄视智能科技有限公司 Mechanism for realizing quick real-time stream response under GB28181 communication protocol
CN114466167B (en) * 2022-02-14 2024-09-20 小视科技(江苏)股份有限公司 Implementation mechanism for quick real-time flow response under GB28181 communication protocol

Also Published As

Publication number Publication date
WO2011015111A1 (en) 2011-02-10

Similar Documents

Publication Publication Date Title
CN103227788B (en) Realize the method and system that Web page application program and SIP equipment carry out communicating
CN102932352B (en) The method of communicating with the client and the server
CN110661801B (en) Data transmission method, device and computer storage medium
CN111147506A (en) Method, system and storage device for playing streaming media data based on HTML5
CN102958107B (en) A kind of method of capability query, communication terminal and application server
CN104348710A (en) Methods and systems for acquiring and correlating web real-time communications (webrtc) interactive flow characteristics
CN101567798A (en) System and method for realizing electronic whiteboard conference based on IP multimedia system configuration
CN102904903B (en) Communication system and communication means
CN105743958A (en) Terminal-to-terminal communication method and device
CN101997822A (en) Streaming media content delivery method, system and equipment
WO2023000940A1 (en) Data processing method and apparatus, and network element device, storage medium and program product
CN104426956B (en) A kind of SOT state of termination method for subscribing, apparatus and system
CN103929623B (en) Video data handling procedure in a kind of video monitoring system
CN102611948A (en) Method for sharing and issuing audios and videos of mobile internet terminal
CN101989978A (en) Method, device and system for forwarding data by real time streaming protocol (RTSP) proxy
CN109618187B (en) Method and device for acquiring video data
CN104683403B (en) For the method for resource-sharing, Resource Server and system
WO2018006678A1 (en) Voice call method and apparatus
CN110971873B (en) Real-time monitoring method, monitoring system and storage medium
CN101547191B (en) A media content aggregation control method and device
CN103828322B (en) Media data transmission method and device
CN116319698A (en) Terminal connection method, electronic device and storage medium
CN111193941B (en) Method, device and equipment for transmitting media data and storage medium
CN108616760A (en) A kind of live broadcasting method, server, main broadcaster end and user terminal based on browser
CN115277569B (en) Multimedia communication method, system, related equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110323