Summary of the invention
Based on this, be necessary to provide a kind of media data transmission method that can improve response speed.
A kind of media data transmission method comprises:
Sip server receives the media-on-demand request that client is initiated, and extracts resource identification according to described media-on-demand request;
Described sip server obtains corresponding media server and Resource Server according to described resource identification, and described resource identification is sent to described media server;
Described Resource Server obtains the address information of described resource identification and described media server by sip server, and set up UDT according to described address information with described media server and be connected, and connect the media data corresponding with described resource identification sent to media server by described UDT;
Described media server connects by sip server and described client, and the media data corresponding with described resource identification is transmitted to described client.
In embodiment, the step that described Resource Server obtains the address information of described media server by described sip server comprises therein:
Described media server receives the backward described sip server of described resource identification and returns to its address information;
Described sip server sends to described Resource Server by the address information of described media server.
In embodiment, the step that described media server connects by sip server and described client is therein:
Media server is set up UDT by sip server with described client and is connected.
Therein in embodiment, described media server is set up by sip server and described client the step that UDT is connected and is comprised:
The address information that described sip server returns to described media server sends to described client;
Described client sends the UDT connection request according to described address information to described media server, sets up UDT and connects.
Therein in embodiment, the step that described media server will the media data corresponding with described resource identification be transmitted to described client comprises;
Described media server connects the media data corresponding with described resource identification is transmitted to described client by described UDT.
In addition, also be necessary to provide a kind of media data transmission system that can improve response speed.
A kind of media data transmission system, comprise client, sip server, media server and Resource Server, wherein:
The media-on-demand request that sip server is initiated for receiving client, and extract resource identification according to described media-on-demand request, obtain corresponding media server and Resource Server according to described resource identification, and described resource identification is sent to described media server;
Resource Server is for obtaining the address information of described resource identification and described media server by sip server, and set up UDT according to described address information with described media server and be connected, and connect the media data corresponding with described resource identification sent to media server by described UDT;
Media server is used for connecting by sip server and described client, and the media data corresponding with described resource identification is transmitted to described client.
In embodiment, described media server also returns to its address information for receiving the backward described sip server of described resource identification therein;
Described sip server also sends to described Resource Server for the address information by described media server.
In embodiment, described media server also is connected for by sip server, with described client, setting up UDT therein.
In embodiment, described sip server also sends to described client for the address information that described media server is returned therein;
Described client, also for according to described address information, to described media server, sending the UDT connection request, is set up UDT and is connected.
In embodiment, described media server is also for connecting the media data corresponding with described resource identification is transmitted to described client by described UDT therein.
In above-mentioned media data transmission method and system, owing to adopting UDT to be connected between Resource Server and media server, therefore, sip server can only need send to Resource Server by the address information of resource identification and media server, Resource Server can be set up with the UDT of media server and be connected, and connect to media server and send data by this UDT, thereby simplified reciprocal process, improved response speed.And the reliability that UDT connects, higher than traditional udp protocol transmission means, has therefore also improved the mass transfer amount of media data.
Simultaneously, owing to adopting UDT to connect, make media server can only use single port can realize being connected with a plurality of Resource Servers with a plurality of clients (in conventional art due to the restriction of UDP transmission means, need to use a plurality of port numbers), thereby reduced necessary port number, saved computer resource.
Embodiment
In one embodiment, as shown in Figure 1, a kind of media data transmission method, the method computer program that places one's entire reliance upon, this computer program can run on the computer system based on the Feng Luoyiman system.The video/audio VOD system of this computer system based on being formed by client, sip server, media server and Resource Server in prior art.
Media data transmission method based on the video/audio VOD system of the prior art can be with reference to figure 2, as shown in Figure 2, and complete video request-program process mutual following (with reference to GB GBT28181) in prior art:
A1. client sends subsidiary SDP(Session Description Protocol, Session Description Protocol to sip server) the session request.Include the resource identification (MD5 value as corresponding as video resource) of media data of user request and the terminal iidentification (as IP address or the user account of client) of client in this SDP.
The A2.SIP server sends the session request to its forwarding address information of media server request to media server.
A3. media server returns to the response of subsidiary SDP.The forwarding address information such as IP address, port information that includes media server in this SDP.
The A4.SIP server sends the session request of subsidiary SDP to Resource Server.Include forwarding address information and resource identification that aforementioned media server returns in this SDP.
A5. Resource Server sends the response of subsidiary SDP to sip server.The resource address information such as IP address, port information that includes Resource Server in this SDP.
The A6.SIP server sends the ACK of subsidiary SDP to media server.ACK is for connecting confirmation.Include resource address information and the resource identification of Resource Server in this SDP, sip server sends to media server by resource address information and resource identification.
The A7.SIP server sends ACK to Resource Server.Resource Server is that the presentation medium server is ready after receiving ACK.
A8. Resource Server sends media data to media server.Resource Server and media server are crossed UDP message bag transmission of media data according to forwarding address information and resource address information exchange separately.
The A9.SIP server is initiated the session request of subsidiary SDP to media server.The terminal address information such as IP address, port information that includes client in this SDP.This request is for notifying media server to client forwarding media data.
A10. media server returns to the response of subsidiary SDP to sip server.The forwarding address information such as IP address, port information (can be different from the port information in the SDP returned in A3) that includes media server in this SDP.
The A11.SIP server returns to the response of subsidiary SDP to client.Comprise the forwarding address information that the A10 media server returns in this SDP.
A12. client is returned to ACK to sip server.
The A13.SIP server returns to ACK to media server.
A14. client and media server are crossed UDP message bag transmission of media data according to terminal address information and forwarding address information exchange separately.
And in the present embodiment, media data transmission method comprises the following steps:
Step S102, sip server receives the media-on-demand request that client is initiated, and extracts resource identification according to the media-on-demand request.
In the present embodiment, as shown in Figure 3, in reciprocal process A1, client can be passed through SDP protocol encapsulation terminal iidentification and the resource identification corresponding with terminal iidentification, and sends it to sip server.Terminal iidentification can be IP address, machine name or the user name of client.Resource identification is the identification information of the video/audio resource of user's program request, can be MD5 value of resource name, resource etc.
For example, in an application scenarios, user's client user name now logs in, then click the program request link that video resource is corresponding on the program request interface, client is obtained program request and is linked corresponding resource identification, then resource identification and user name is sent it to sip server after by the SDP protocol encapsulation.
Step S104, sip server obtains corresponding media server and Resource Server according to resource identification, and resource identification is sent to this media server.
In the present embodiment, store the resource identification locating information on sip server, can search according to resource identification the Resource Server of the media data that this resource identification of storage is corresponding in the resource identification locating information; Also store the media server state information on sip server, can search according to the media server state information media server of the free time corresponding with resource identification or terminal iidentification.That is to say, media server and Resource Server each can have a plurality ofly, and sip server can obtain suitable media server and Resource Server according to terminal iidentification and/or resource identification.
Step S106, Resource Server is by the address information of sip server Gains resources sign and media server, set up UDT according to address information and media server and be connected, and by UDT connect will be corresponding with resource identification media data send to media server.
In the present embodiment, Resource Server comprises by the step of the address information of sip server Gains resources sign and media server:
Media server receives the backward sip server of resource identification and returns to its address information, and sip server sends to Resource Server by the address information of resource identification and media server.
As shown in Figure 3, in reciprocal process A2, A3, A4 and B1, sip server first sends to resource identification media server (reciprocal process A2), and media server returns to the response (reciprocal process A3) of subsidiary SDP.The address information such as IP address, port information that includes media server in this SDP.Then sip server sends to Resource Server (reciprocal process A4) by this address information and resource identification again, returns to response (reciprocal process B1) after Resource Server receives.
In the present embodiment, as shown in Figure 3, Resource Server is set up before UDT is connected according to address information and media server, media server and Resource Server are accepted respectively the connection confirmation (with reference to reciprocal process B2 and A7 in figure 3) that sip server sends, after Resource Server and media server receive ACK, can confirm that the other side is ready, can initiate UDT and connect.
In the present embodiment, because Resource Server and media server are set up UDT and are connected, make media server not need to know the address information of Resource Server, therefore, reciprocal process B1 and B2 are compared to reciprocal process A5 of the prior art and A6, and Resource Server is without the address informations such as its ip address, port information are sent to media server by sip server.
Step S108, media server connects by sip server and client, and media data that will be corresponding with resource identification is transmitted to client.
In the present embodiment, media server is set up UDT by sip server and client and is connected, and can be specially:
Sip server will be corresponding with resource identification the address information returned of media server send to client.
Client sends the UDT connection request according to address information to media server, sets up UDT and connects.
Further, the step that the media data that media server will be corresponding with resource identification is transmitted to client is: media server by UDT connect will be corresponding with resource identification media data be transmitted to client.
In the present embodiment, sip server can send to the address information of media server client (with reference to the reciprocal process A11 in figure 3) after to Resource Server, sending the connection acknowledge message.Client is after returning to the connection confirmation (with reference to the reciprocal process A12 in figure 3) to sip server, can send UDT connection request (with reference to the reciprocal process B4 in figure 3) to media server, after UDT connects foundation, media server can connect media data is sent to client (with reference to reciprocal process A14 in figure 3) by this UDT.
Owing to adopting UDT to be connected between client and media server, therefore, sip server can only need send to client by the address information of media server, client can be set up with the UDT of media server and be connected, and connect by this UDT the media data corresponding with resource identification that the receiving media server forwards, compared with prior art, simplified reciprocal process (as shown in Figure 3, simplified reciprocal process A9 and A10), thus response speed improved further.
It should be noted that, when a plurality of clients are carried out a sowing time simultaneously, as shown in Figure 3, in reciprocal process A2, can comprise the terminal iidentification corresponding with resource identification, terminal iidentification can be IP address or the user name of client.Media server is to client forwarding media data the time, connect and obtain terminal iidentification according to UDT, then obtain corresponding resource identification according to terminal iidentification, more corresponding media data connects and is transmitted to corresponding client by this resource identification by this UDT, thereby can avoid the mistake of data to send out.
In one embodiment, as shown in Figure 4, a kind of media data transmission system, is characterized in that, comprises client 10, sip server 20, media server 30 and Resource Server 40, wherein:
The media-on-demand request that sip server 20 is initiated for receiving client 10, and extract resource identification according to the media-on-demand request, obtain corresponding media server 30 and Resource Server 40 according to resource identification, and resource identification is sent to media server 30;
Resource Server 40 is for the address information by sip server 20 Gains resources signs and media server 30, and set up UDT according to address information with media server 30 and be connected, and by UDT connect will be corresponding with resource identification media data send to media server 30;
Media server 30 is for connecting by sip server 20 and client 10, and media data that will be corresponding with resource identification is transmitted to client 10.
In the present embodiment, media server 30 also returns to its address information for receiving the backward sip server 20 of resource identification;
Sip server 20 also sends to Resource Server 40 for the address information by media server 30.
In the present embodiment, media server 30 also is connected for by sip server 20, with client 10, setting up UDT.
In the present embodiment, sip server 20 also sends to client 10 for the address information that media server 30 is returned;
Client 10 also, for according to address information, to media server 30, sending the UDT connection request, is set up UDT and is connected.
In the present embodiment, media server 30 also for by UDT, connect will be corresponding with resource identification media data be transmitted to client 10.
In above-mentioned media data transmission method and system, owing to adopting UDT to be connected between Resource Server and media server, therefore, sip server can only need send to Resource Server by the address information of resource identification and media server, Resource Server can be set up with the UDT of media server and be connected, and connect to media server and send data by this UDT, thereby simplified reciprocal process, improved response speed.And the reliability that UDT connects, higher than traditional udp protocol transmission means, has therefore also improved the transmission quality of media data.
Simultaneously, owing to adopting UDT to connect, make media server can only use single port can realize being connected with a plurality of Resource Servers with a plurality of clients (in conventional art due to the restriction of UDP transmission means, need to use a plurality of port numbers), thereby reduced necessary port number, saved computer resource.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, to come the hardware that instruction is relevant to complete by computer program, described program can be stored in a computer read/write memory medium, this program, when carrying out, can comprise the flow process as the embodiment of above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.