Background technology
Multicasting technology is to send the Network Connection realizing point-to-multipoint delivery between server and terminal.Because energyEnough effectively reduce offered load and send server load, so multicasting technology real time data transmit multimedia conferencing,Data copy, play and all many-sides such as emulation are all widely used.
Fig. 1 is the typical multicast network system schematic diagram being applied to net cast.Such as Fig. 1, multicast network system includesMulticast server 01, router 02, switch 03 and video playing terminal 04.Multicast server 01 and router 02 connect, useIn providing live video stream;Video playing terminal 04 is then connected by switch 03 and router 02.For realizing a multicast groupIn member management, i.e. realize video playing terminal 04 and can add, leave a certain specific multicast group, router 02, exchangeIn machine 03 and video playing terminal 04, there is multicast member management protocol.Multicast member management protocol includes the Internet group pipe in territoryReason agreement (Internet Group Management Protocol, IGMP).IGMP agreement runs on video playing terminal 04And and the multicast router 02 that is joined directly together of video playing terminal 04 between, on the one hand by IGMP protocol video playback terminal 04Notice local router 02 wishes to add and receive the information of certain particular multicast group, and on the other hand router 02 is assisted by IGMPIn view periodically inquiry LAN, whether certain member of known group is active, i.e. this network segment the most still has and belongs to certainThe member of individual multicast group, the collection realizing networked network group membership's relation and maintenance.
Because IGMP agreement is to operate in video playing terminal 04 and the Multicast Routing being joined directly together with video playing terminalBetween device 02, and in actual application, video playing terminal 04 and router more than 02 are connected by switch.For effectively suppressing multicastData diffusion in switch 03 double layer network such as grade, in addition it is also necessary to Layer 2 Multicast agreement is set in switch 03.At present, useRelatively broad Layer 2 Multicast agreement has igmp snooping agreement and igmp proxy agreement.As a example by using igmp proxy agreement, hand overThe IGMP message changed planes between 03 interception unicast video terminal 04 and router 02 sets up multicast table, the first line of a couplet port of switch 03Perform the role of video playing terminal, the role of second line of a couplet port execution router realizes multicast protocol message forwarding work.But,Switch 03 identifies that multicast message forwards data can take substantial amounts of CPU again and processes the time so that multicast message forwards to be occurred prolongingLate.In video playing terminal 04, multicast message forward delay shows as video playback to postpone, and this delay makes Consumer's Experience dropLow.Therefore, how to effectively reduce video playback when video playing terminal 04 adds multicast group and postpone, and then raising user makesWith experience, it is those skilled in the art's problems of needing to solve.
Summary of the invention
For solving the problem that when existing multicast plays video, the playout-delay time is longer, the present invention provides a kind of and reduces videoThe method of waiting time, the another present invention also provides for a kind of video playing terminal and a kind of audio/video player system.
The present invention provides a kind of method reducing the video playback waiting time, comprises the following steps:
Video playing terminal obtains the first multicast group address and unicast server address;
Video playing terminal sends the multicast request message including the first multicast group address;Video playing terminal sends and comprisesThe unitcast request message of unicast server address;
Video playing terminal judges whether to receive the unicast video stream that unicast server sends;If receiving unicast videoStream, video playing terminal resolves plays unicast video stream;
Video playing terminal judges whether to receive the multicast video streams corresponding with the first multicast group address;If receive withThe multicast video streams that first multicast group address is corresponding, video playing terminal stops playing unicast video stream and switching broadcasting and firstThe multicast video streams that multicast group address is corresponding.
Optionally, also include that video playing terminal sends and include that the multicast of the second multicast group address leaves the step of message.
Optionally, after video playing terminal receives the multicast video streams corresponding with the first multicast group address, transmission comprisesThe clean culture of unicast server address stops message.
The present invention provides a kind of video playing terminal, including:
Address acquisition module, for obtaining the first multicast group address and unicast server address;
Multicast request module, for sending the multicast request message comprising the first multicast group address;
Unitcast request module, for sending the unitcast request message comprising unicast server address;
Judge module, is used for judging whether receive unicast video stream and judge whether to receive and the first multicast group addressCorresponding multicast video streams;
Playing module, for playing unicast video stream, with for receiving and first when receiving unicast video streamStop playing unicast video stream during multicast video streams corresponding to multicast group address and switch broadcasting corresponding with the first multicast group addressMain broadcaster's video flowing.
Optionally, also include: multicast leaves module, include that the multicast of the second multicast group address leaves message for sending.
Optionally, also include: clean culture stopping modular, for receiving the group broadcasting video frequency corresponding with the first multicast group addressSend after stream and include that the clean culture of unicast server address stops message.
The present invention also provides for a kind of audio/video player system, including multicast server, unicast server and regards foregoingFrequently playback terminal;
Described multicast server is used for after described video playing terminal adds corresponding multicast group to described video playbackTerminal sends multicast video streams;
Described unicast server is used for after receiving the unitcast request message that described video playing terminal sends to describedVideo playing terminal sends unicast video stream;The multicast video streams of described multicast server and the clean culture of described unicast server regardFrequency stream content is identical and clock synchronizes.
Optionally, described unicast server is configured to send unicast video stream setting time stopping transmission unicast videoStream.
Optionally, described unicast server is configured to receive clean culture and stops stopping transmission unicast video stream after message.
Optionally, described multicast server and described unicast server are same server.
The method reducing the video render waiting time that the present invention provides, obtains the first multicast group address at video terminalBehind unicast server address, send the multicast request message comprising the first multicast address respectively and comprise unicast server addressUnitcast request message, unicast server receives and sends unicast video stream, road to video playing terminal after unitcast request messageMulticast video streams is sent to video playing terminal after being received multicast request message by device.Because switch is to unicast video stream notDo protocol analysis and just can be forwarded to video playing terminal, so unicast video stream first arrives video playback compared to multicast video streamsTerminal.Video playing terminal resolves and can first resolve unicast video stream broadcasting video, reduces wait time delay when video commences play out,And multicast video streams is play in switching after multicast video streams reaches.
Video playing terminal and audio/video player system that we provide use preceding method to reduce the video playback waiting time,Effect is no longer repeated at this.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out specificallyBright.
Fig. 1 is the method flow diagram reducing the video playback waiting time in the embodiment of the present invention, and Fig. 2 is the embodiment of the present inventionMiddle video playing terminal 1 structural representation, Fig. 3 is audio/video player system structure chart in the embodiment of the present invention.
Such as Fig. 1, the present invention reduces the method for video playback waiting time and comprises the steps.
S101: video playing terminal obtains the first multicast group address and unicast server address.
As play the video frequency program of a certain channel, video playing terminal 1 needs first to know the broadcast address of video flowing,It is multicast group IP address for multicast video streams, is the IP address of unicast server 5 for unicast video stream.OneAs, video playing terminal 1 notifies corresponding server end the most simultaneously, by server end by the group of each channel programBroadcast group address and unicast server address is sent to video playing terminal 1, select with user-friendly video playing terminal 1Platform operates.
S102: video playing terminal sends the multicast request message including the first multicast group address, video playing terminal 1Send the unitcast request message comprising unicast server address.
After video playing terminal obtains the first multicast group address and unicast server address, respectively to router 3 transmission groupBroadcast group request message to add corresponding multicast group with request, send unitcast request message to unicast server 5 to obtain clean culture clothesThe response of business device 5.
The multicast request message comprising the first multicast group address that video playing terminal sends arrives first at switch 2;Hand overChange planes 2 after receiving multicast request message, by monitoring or agent way obtains the message information in multicast request message alsoSetting up multicast forward table, wherein message information includes purpose IP address (namely the first multicast group address), source MAC (alsoBe exactly the video playing terminal 1MAC address sending multicast request message) and switch 2 receive the source port of multicast request message.Multicast request message is sent to router 3 by switch 2 by the port being connected with router 3 subsequently, and router 3 receives groupDetermine, at its corresponding port, there is the multicast member that the first multicast group address is corresponding, video playing terminal after broadcasting request message1 the most just adds the multicast group that the first multicast address is corresponding.If router 3 has had the multicast group of the first multicast group addressMember, then the multicast video streams received can directly be issued by router 3 from aforementioned port;If router 3 does not has first groupBroadcast the multicast member of address, then router 3 sends request message in network, notifies other routers 3 or multicast server 4Multicast video streams is sent to this router 3.After multicast video streams is issued to switch 2, switch 2 is according to the multicast forwarding set upMulticast video streams is distributed to the video playing terminal 1 of correspondence by table.
The unitcast request message comprising unicast server address that video playing terminal 1 sends, after switch 2, exchangesMachine 2 forms unicast forwarding table after obtaining the former MAC Address of unitcast request message and the source port number of correspondence, and by unitcast request reportLiterary composition sends to router 3.Being forwarded by the message of each router 3, unitcast request message arrives unicast server 5.Clean culture takesBusiness device 5 sends unicast video stream after responding unitcast request message in network, and unicast video stream is forwarded to video through router 3The switch 2 of playback terminal 1 correspondence, it is right that unicast video stream is forwarded to by switch 2 according to the target MAC (Media Access Control) address of unicast video streamAnswer the video playing terminal 1 of port.Because unicast video stream is when switch 2 forwards, switch 2 is by reading unicast videoThe target MAC (Media Access Control) address of stream corresponding data frame, finds the port numbers of correspondence, and is circulated by unicast video according to target MAC (Media Access Control) addressIt is dealt in the port numbers of correspondence, it is not necessary to spend substantial amounts of CPU to process the time, so unicast video stream flows down relative to group broadcasting video frequencySend out speed fast.
S103: video playing terminal judges whether to receive the unicast video stream that unicast server sends.
The Frame received is resolved by video playing terminal, it is judged that whether have unicast server 5 in FrameThe unicast video stream started.If receiving the unicast video stream that unicast server 5 sends, then carry out step S104.
S104: video playing terminal resolves plays unicast video stream.
S105: video playing terminal judges whether to receive the multicast video streams corresponding with the first multicast group address.
Along with the broadcasting of unicast video stream, the multicast video streams corresponding with the first multicast group address is also issued to video playbackTerminal 1.The Frame that video playing terminal 1 is received by parsing, it may be judged whether receive multicast video streams;If not receivingTo multicast video streams, then proceed step S104;If receiving multicast video streams, then carry out step S106.
S106: video playing terminal stops playing unicast video stream and switching the master that broadcasting is corresponding with the first multicast group addressBroadcast video flowing.
Because unicast video stream is not done protocal analysis when through switch 2, is directly forwarded, it is not necessary to such as main broadcaster's stream compressionMessage protocol parsing is carried out, so video playing terminal 1 can be arrived prior to multicast video streams quickly and is played when sending out.AsThis, program video can the most quickly be play, and shortens and carries out waiting time when video flowing issues, raising only with multicast modeConsumer's Experience.
In actual applications, video playing terminal 1 can be network machine top box.Using network machine top box, network machine topStoring the server address of large-scale program in box, user may switch between each program.For reducing Communication cost sumExpending according to processing, video playing terminal 1 can send and include that the multicast of the second multicast group address leaves message, to notify router 3Stopping the multicast video streams that multicast group is corresponding before video playing terminal 1 sends, now video playing terminal 1 is configured forThe V2 version of IGMP agreement or V3 version.Certainly, in other embodiments, it is possible to do not have video playing terminal 1 to send and includeThe multicast of the second multicast group address leaves message, but the response inquired about with video playing terminal 1 by router 3 judges router3 the most also have the second multicast group address member.
In preceding method, video playing terminal 1 complete unicast video stream and multicast video streams broadcasting switch after, forSave the network bandwidth, need to stop unicast server 5 and issue unicast video stream.To this end, video playing terminal 1 is receiving and theAfter the multicast video streams that one multicast address is corresponding, the clean culture comprising unicast server address can be sent in network and stop message,Unicast server 5 stops transmission after receiving clean culture stopping message and sends unicast video stream to video playing terminal 1.Certainly, existAlso the stopping that can realizing unicast video stream in other embodiments by other means sends, such as, arrange in unicast server 5One Preset Time, stops after unicast server 5 video stream unicast video stream Preset Time sending unicast video stream.
In addition to providing the method for aforementioned reduction video playback waiting time, the embodiment of the present invention also provides for a kind of video playbackTerminal 1, uses aforesaid method to reduce the video render waiting time.Such as Fig. 2, the video playing terminal 1 in the present embodiment is wrappedInclude address acquisition module 11, multicast request module 12, unitcast request module 13, judge module 14 and playing module 15.Wherein: groundLocation acquisition module 11 is for obtaining the first multicast group address and unicast server address;Multicast request module 12 comprises for transmissionThe multicast request message of the first multicast group address, unitcast request module 13 please for sending the clean culture comprising unicast server addressSeek message, it is judged that module 14 is used for judging whether receive unicast video stream and judge whether to receive and the first multicast group addressCorresponding multicast video streams, playing module 15 for playing unicast video stream and for receiving when receiving unicast video streamStop during to corresponding with the first multicast group address multicast video streams playing unicast video stream and switching broadcasting and the first multicast groupMain broadcaster's video flowing that address is corresponding.
As it was previously stated, if video playing terminal 1 is the equipment such as networking Set Top Box, then be also possible to carry out zapping behaviour when usingMake.The multicast video streams that before no longer playing for notice router 3 video playing terminal 1, program is corresponding, video playing terminal 1 is alsoCan be provided for sending and include that the multicast of the second multicast group address leaves the multicast of message and leaves module 16, in video playing terminal1 receive zapping signal after send comprise the second multicast group address multicast leave message.
As it was previously stated, can be provided for sending clean culture in video playing terminal 1 to stop the clean culture stopping modular 17 of message,After video playing terminal 1 completes the broadcasting switching of unicast video stream and multicast video streams, notify that unicast server 5 stops sendingUnicast video stream.
In addition to providing aforesaid video playing terminal 1, the embodiment of the present invention also provides for a kind of audio/video player system.Such as Fig. 3,Audio/video player system includes multicast server 4, unicast server 5, aforementioned video playback terminal 1, router 3 and switch 2.GroupBroadcast server 4 and unicast server 5 is connected by router 3 and video playing terminal 1.
In the present embodiment, router 3 is configured to contain the router 3 of multicast forwarding function, is specially configured with aforementionedIGMP agreement and multicast routing protocol;Switch 2 is configured to contain the switch 2 of multicast forwarding function, time actually usedCommutative machine 2 configurable I GMP monitoring protocols or igmp proxy agreement.When video playing terminal 1 joins the first multicast address pairAfter the multicast group answered, the multicast video streams that multicast server 4 sends is forwarded by router 3 and switch 2 and delivers to video playbackTerminal 1.After unicast server 5 receives the unitcast request message that video playing terminal 1 sends, unicast server 5 sends listBroadcasting video flowing, unicast video stream sends to video playing terminal 1 after router 3 and switch 2.Certainly, same for ensureingThe unicast video stream of program and multicast video streams are play in video playing terminal 1 without card ground substantially, unicast server 5 and multicastThe video flowing of server 4 should identical and clock synchronization.
Further, for reducing the network bandwidth that unicast video stream takies, optionally, in one embodiment, clean culture takesBusiness device 5 stops sending unicast video stream after being configured to send the unicast video stream setting time;Optionally, in another embodimentIn, unicast server 5 can be configured as stopping sending clean culture after receiving the clean culture stopping message that video playing terminal 1 sendsVideo flowing;During actual application, different modes can be selected to configure unicast server 5 according to real network situation.
Additionally, unicast server 5 and multicast server 4 can be integrated in same station server in actual applications.
Above to the method for reduction video playback waiting time, video playing terminal 1 and the video in the embodiment of the present inventionPlay System is described in detail.This part uses specific embodiment to be explained principle and the embodiment of the present inventionStating, the explanation of above example is only intended to help to understand the core concept of the present invention, in the situation without departing from the principle of the inventionUnder, the every other embodiment that those of ordinary skill in the art are obtained under not making creative work premise, broadly fall intoThe scope of protection of the invention.