A kind of method of video distribution based on cable home gatewayTechnical field
The present invention relates to gateway technique fields, are a kind of video distribution sides based on cable home gateway specificallyMethod.
Background technique
According to consumption electronic product towards intelligence, mobile, IPization development trend, present home-use intelligent terminalType it is more and more, such as include mobile phone, PAD, smart television, set-top box, other smart home devices etc., traditional home networkIt is impossible to meet provide video distribution and transmission simultaneously for different terminals such as mobile phone, PAD, smart television, OTT set-top boxes for passDemand.
Summary of the invention
It is existing for solving the purpose of the present invention is to provide a kind of method of video distribution based on cable home gatewayIt is impossible to meet the demands for providing video distribution and transmission simultaneously for different terminals to ask for traditional home gateway in technologyTopic.
The present invention is solved the above problems by following technical proposals:
A kind of method of video distribution based on cable home gateway, comprising:
Electronic program guides, the electronics are downloaded from front end tftp server when step S100:cable home gateway is onlineProgram guide is used for the programme information for describing to play out by cable home gateway;
Step S200:cable home gateway powers on and downloads live streaming list from front end tftp server after self-starting(HlsSetup.xml), according to the difference of network scenarios, there are the following two kinds acquisition modes:
1) CMTS network
By the privately owned definition option TLV43 of producer (Vendor Specification), xml document is downloaded simultaneously after CM is onlineParsing.
2) without CMTS network
When CM is online, local dominant frequency point can be locked in communication number at the HFC of each prefecture-level city, then from corresponding frequency pointNetwork_id field value is obtained in NIT table, then from corresponding tftp server according to the network_id field value of acquisitionLocation downloading xml is simultaneously parsed.;
Step S300:cable home gateway obtains dominant frequency point and is locked from configuration file, finds dominant frequency point and corresponds to programNumber video flowing for being 27, analysis service group information simultaneously save service group information ServiceGroupID, and the service group information isLocation information where current home gateway;
Step S400: terminal and cable home gateway are established and are connected to the network;
Step S500: terminal issues live streaming request or on-demand request;
Step S600:cable home gateway sends to terminal and plays video.
Further, the step S400 is specifically included:
Step S410: terminal finds cable home gateway by sending udp broadcast packet, and the udp broadcast packet carries ginsengNumber TYPE, SESSION, METHOD and COMMAND;
After step S420:cable home gateway receives broadcast, link URL is returned to, the link URL includes IP and portInformation;
Step S430: if it find that the success of cable home gateway, terminal include gateway information source to EPG server requestThe rendition list, otherwise terminal request is free of the rendition list of gateway information source;
Request timed out is set, if it exceeds setting expired times, then be judged to finding to fail.
Further, the specific steps of terminal sending live streaming request include: in the step S500
Step A1: terminal calls play interface, sends playing request to cable home gateway, carries in playing request straightRequired parameter is broadcast, the live streaming required parameter includes that channel designation and expectation play type;
Step A2:cable home gateway receives play request, analytic parameter, the live streaming obtained from front end tftp serverCorresponding program is found in list, and configuration is carried out in TS over IP module and obtains corresponding program stream from plug-flow front end, andBroadcasting link is returned to terminal;
Step A3: if terminal, which receives, correctly plays connection, playing request will be initiated to corresponding broadcasting link, such asFruit receives False, then can initiate playing request to IPQAM.
Further, when terminal is mobile terminal in the step A2, cable home gateway receives play request, parsingCorresponding program is found in parameter, the live streaming list obtained from front end tftp server, is completed configuration and is obtained pair from plug-flow front endThe program stream answered, program stream are sliced and generate corresponding .m3u8 file for mobile terminal playing, and are returned to mobile terminalBroadcasting link.
Further, the specific steps of terminal sending on-demand request include: in the step S500
Step B1: terminal is initiated to request with regard to request program to plug-flow front end, and plug-flow front end returns to the ginseng of corresponding request programNumber, the parameter includes frequency point, program number and modulation system;
Step B2: it after terminal receives the parameter of the correspondence request program of plug-flow front end return, is sent out to cable home gatewaySetup request is played, and carries the parameter;
Step B3:cable home gateway receives setup and requests and parse, and locks corresponding frequency point and obtains corresponding program numberThe video flowing of program, analysis obtains the pid information of program, if obtaining information and locking success, TS video flowing is switched to UDP viewFrequency spreads output to terminal, and provides request to terminal and return, and returns to broadcasting link, returns if obtaining information or locking failureReturn False;
Step B4: terminal receives the return value of cable home gateway, if it is broadcasting link just to cable home networkIt closes request to play, just initiates playing request to IPQAM if it is False.
Further, heartbeat connection is kept between the terminal and cable home gateway, is defaulted every 30s and is sent a heartRequest is jumped, is not received by heartbeat server-side continuous 3 times, then removes session, offer service is provided.
Further, further include release process, specifically: when terminal is in cut bank or when exiting broadcasting, terminal toCable home gateway initiates release request, and cable home gateway, which receives request, will release the terminal to the occupancy of resource.
It further include obtaining service group information process, the specific steps are as follows:
Step C1:Cable home gateway reads the dominant frequency point of corresponding prefecture-level city, locking master when online from configuration fileThen frequency point finds the stream that program number is 27 under dominant frequency point, the position where current Cable Modem is resolved to according to corresponding specificationConfidence breath, i.e. service group information, save service group information ServiceGroupID.
Step C2: terminal initiates getSGId request to Cable home gateway, does not carry any parameter.And Cable familyGateway then returns to corresponding SGId to terminal, parses service group information if failed when online, returns to False.ThisRepresenting the Cable home gateway does not support program request to operate.
Further, Cable Modem module, TS over IP module, Route mould built in the cable home gatewayBlock and HLS Server module, in which:
TS over IP module, for the TS stream of specified frequency point and specified PID program to be packaged into IP stream;
HLS Server module flows TS using code rate adaptive mode and is sliced and generates m3u8 playlist, for terminalIt plays;
Cable Modem module, for realizing modulation /demodulation function;
Route module, for realizing Route Selection.
Compared with prior art, the present invention have the following advantages that and the utility model has the advantages that
(1) present invention solve multi-user, multiple terminals, mobile, IPization pain spot, while providing the video of high qualityAnd internet business, user is improved to the stickiness of product.
(2) present invention can be simultaneously mobile phone, the different terminals such as PAD, smart television, OTT set-top box provide video distributionAnd transmission, it supports the various businesses such as high-definition live broadcasting, channel playback, video on demand, meets the needs of user sees TV whenever and wherever possible.
Detailed description of the invention
Fig. 1 is functional block diagram of the present invention in CMTS network service scene;
Fig. 2 is the present invention in EOC, the functional block diagram of PON network business scenario;
Fig. 3 is live streaming flow chart of the invention;
Fig. 4 is program request flow chart of the invention.
Specific embodiment
The present invention is described in further detail below with reference to embodiment, embodiments of the present invention are not limited thereto.
Embodiment 1:
In conjunction with shown in attached drawing 1 and Fig. 2, a kind of method of video distribution based on cable home gateway, including cable familyGateway, Cable Modem module, TS over IP module, Route module and HLS Server mould built in cable home gatewayBlock, in which:
TS over IP module, for the TS stream of specified frequency point and specified PID program to be packaged into IP stream;
HLS Server module flows TS using code rate adaptive mode and is sliced and generates m3u8 playlist, for terminalIt plays;
Cable Modem module, for realizing modulation /demodulation function;
Route module, for realizing Route Selection;
Video distribution process are as follows:
Electronic program guides, the electronics are downloaded from front end tftp server when step S100:cable home gateway is onlineProgram guide is used for the programme information for describing to play out by cable home gateway;
Step S200:cable home gateway powers on and downloads live streaming list from front end tftp server after self-starting(HlsSetup.xml), according to the difference of network scenarios, there are the following two kinds acquisition modes:
1) CMTS network
By the privately owned definition option TLV43 of producer (Vendor Specification), xml document is downloaded simultaneously after CM is onlineParsing.
2) without CMTS network
When CM is online, local dominant frequency point can be locked in communication number at the HFC of each prefecture-level city, then from corresponding frequency pointNetwork_id field value is obtained in NIT table, then from corresponding tftp server according to the network_id field value of acquisitionLocation downloading xml is simultaneously parsed.;
Step S300:cable home gateway obtains dominant frequency point and is locked from configuration file, finds dominant frequency point and corresponds to programNumber video flowing for being 27, analysis service group information simultaneously save service group information ServiceGroupID, and the service group information isLocation information where current home gateway;
Step S400: terminal and cable home gateway are established and are connected to the network;
Step S500: terminal issues live streaming request or on-demand request;
Step S600:cable home gateway sends to terminal and plays video.
Further, the step S400 is specifically included:
Step S410: terminal finds cable home gateway by sending udp broadcast packet, and the udp broadcast packet carries ginsengNumber TYPE, SESSION, METHOD and COMMAND;
After step S420:cable home gateway receives broadcast, link URL is returned to, the link URL includes IP and portInformation;
Step S430: if it find that the success of cable home gateway, terminal include gateway information source to EPG server requestThe rendition list, otherwise terminal request is free of the rendition list of gateway information source;
Request timed out is set, if it exceeds setting expired times, then be judged to finding to fail.
Embodiment 2:
On the basis of embodiment 1, as shown in connection with fig. 3, terminal issues the specific step that live streaming is requested in the step S500Suddenly include:
Step A1: terminal calls play interface, sends to cable home gateway and plays (play) request, in playing requestLive streaming required parameter is carried, the live streaming required parameter includes that channel designation and expectation play type;
Step A2:cable home gateway receives play request, analytic parameter, as desired broadcast message class type Type=1, from sectionMesh list obtains pid information, obtains information success, IGMP multicast is added, pushes out from the channel Eth, return to True and broadcastingLink, and real-time detection heartbeat stop plug-flow, release channel when linking disconnection;If obtaining information failure, returnfalse;If Type=2, multicast address and PcrPid are obtained from the rendition list, if obtaining failure, return to False;Such asFruit obtains successfully, and multicast address and PcrPid information are sent to Linux as message and are sliced, and IGMP multicast is added, fromThe channel ITC pushes out, and returns to True and program multicast address and port, and real-time detection heartbeat, when linking disconnection, stopsPlug-flow, release channel.
Step A3: if terminal, which receives, correctly plays connection, playing request will be initiated to corresponding broadcasting link, such asFruit receives False, then can initiate playing request to IPQAM.
Further, when terminal is mobile terminal in the step A2, cable home gateway receives play request, parsingCorresponding program is found in parameter, the live streaming list obtained from front end tftp server, is completed configuration and is obtained pair from plug-flow front endThe program stream answered, program stream are sliced and generate corresponding .m3u8 file for mobile terminal playing, and are returned to mobile terminalBroadcasting link.
Embodiment 3:
On the basis of embodiment 1, in conjunction with shown in attached drawing 4, terminal issues the specific of on-demand request in the step S500Step includes:
Step B1: terminal is initiated to request with regard to request program to plug-flow front end, and plug-flow front end returns to the ginseng of corresponding request programNumber, the parameter includes frequency point, program number and modulation system;
Step B2: it after terminal receives the parameter of the correspondence request program of plug-flow front end return, is sent out to cable home gatewaySetup request is played, and carries the parameter;
Step B3:cable home gateway receives setup and requests and parse, and locks corresponding frequency point and obtains corresponding program numberThe video flowing of program obtains the pid information of program according to request program number analysis, is added if lockking request frequency point successIGMP multicast carries out plug-flow using the channel Eth, returns to True and multicast address and port, and real-time detection heartbeat, when link is disconnectedWhen opening, stop plug-flow, release channel;False is returned if obtaining information or locking failure;
Step B4: terminal receives the return value of cable home gateway, if it is broadcasting link just to cable home networkIt closes request to play, just initiates playing request to IPQAM if it is False.
Further, heartbeat connection is kept between the terminal and cable home gateway, is defaulted every 30s and is sent a heartRequest is jumped, is not received by heartbeat server-side continuous 3 times, then removes session, offer service is provided.
Further, further include release process, specifically: when terminal is in cut bank or when exiting broadcasting, terminal toCable home gateway initiates release request, and cable home gateway, which receives request, will release the terminal to the occupancy of resource.
It further include obtaining service group information process, the specific steps are as follows:
Step C1:Cable home gateway reads the dominant frequency point of corresponding prefecture-level city, locking master when online from configuration fileThen frequency point finds the stream that program number is 27 under dominant frequency point, the position where current Cable Modem is resolved to according to corresponding specificationConfidence breath, i.e. service group information, save service group information ServiceGroupID.
Step C2: terminal initiates getSGId request to Cable home gateway, does not carry any parameter.And Cable familyGateway then returns to corresponding SGId to terminal, parses service group information if failed when online, returns to False.ThisRepresenting the Cable home gateway does not support program request to operate.
Although reference be made herein to invention has been described for explanatory embodiment of the invention, and above-described embodiment is only this hairBright preferable embodiment, embodiment of the present invention are not limited by the above embodiments, it should be appreciated that those skilled in the artMember can be designed that a lot of other modification and implementations, these modifications and implementations will fall in principle disclosed in the present applicationWithin scope and spirit.