Summary of the invention
Technical problem to be solved by this invention is: a kind of method and system of broadcast program are provided, can directly switch broadcast program quickly and efficiently.
For solving technical problem of the present invention, the present invention discloses a kind of method of broadcast program, comprises step:
Whether video server detects current program and closes to an end, if, then finishing the forward direction session management server and send a notification message in current playing programs, the current program of announcement session management server closes to an end, and asks the programme information of next program;
After session management server receives described notification message, search the programme information of next program, transmit a reply message, the programme information of next program is sent to video server to video server;
After video server is received described answer message, when current playing programs finishes, to the video flowing of the next program of receiving terminal for digital television plug-flow.
Wherein, described video server detects the step whether current program close to an end and specifically comprises:
Whether the residue playing duration that video server regularly detects current program is less than or equal to default time threshold values, if then be judged as current program and close to an end.
Wherein, the described session management server step of searching the programme information of next program specifically comprises:
Session management server judges whether current program belongs to the type that direct switching is play;
If, search the programme information of corresponding next program then according to the programme information of current program.
Wherein, after described video server is received described answer message, when current playing programs finishes, specifically comprise to the step of the video flowing of the next program of receiving terminal for digital television plug-flow:
After video server is received described answer message, open the file of next program, read data is to buffering area;
Judge whether current program finishes, if, then to the video flowing of the next program of receiving terminal for digital television plug-flow.
For solving technical problem of the present invention, the present invention also discloses a kind of front end system of broadcast program, comprises session management server and video server; Whether described video server is used to detect current program and closes to an end, if, then finish the forward direction session management server in current playing programs and send a notification message, the current program of announcement session management server closes to an end, and asks the programme information of next program;
After described session management server is used to receive described notification message, search the programme information of next program, transmit a reply message, the programme information of next program is sent to video server to video server;
After described video server is received described answer message, when current playing programs finishes, to the video flowing of the next program of receiving terminal for digital television plug-flow.
Wherein, described session management server comprises first communication module and searches module; Described first communication module is used to receive the notification message that described video server sends, and is used for transmitting a reply message to video server, and the programme information of next program is sent to video server;
The described module of searching is used for searching the programme information of next program after described first communication module receives the notification message of described video server transmission.
Wherein, described session management server also comprises judge module; Described judge module is used for after described first communication module receives the notification message of described video server transmission, judges whether current program belongs to the type that direct switching is play; The described module of searching also is used for according to the programme information of current program, searching the programme information of corresponding next program when described judge module judges that current program belongs to the type of direct switching broadcast.
Wherein, described video server comprises second communication module, detection module and playing module; Whether described detection module is used to detect current program and closes to an end, and is used for judging whether current program finishes after described second communication module is received the answer message of described session management server transmission;
Described second communication module is used for when described detection module detects current program and closes to an end, finishing the forward direction session management server in current playing programs sends a notification message, the current program of announcement session management server closes to an end, and asks the programme information of next program; And the answer message that receives the session management server transmission;
Described playing module is used for when described detection module judges that current program has finished, to the video flowing of the next program of receiving terminal for digital television plug-flow.
Wherein, described playing module also is used for opening the file of next program after described second communication module is received the answer message of described session management server transmission, and read data is to buffering area.
Wherein, whether the residue playing duration of described detection module by the current program of regular detection is less than or equal to default time threshold values and judges whether current program closes to an end.
For solving technical problem of the present invention, the present invention also discloses a kind of system of broadcast program, comprises receiving terminal for digital television, and the above-mentioned all front end systems that are connected with receiving terminal for digital television.
Compared with prior art, the present invention has following beneficial effect: the announcement session management server was searched the programme information of next program when video server of the present invention closed to an end at current program, then when current program finishes, video flowing to the next program of receiving terminal for digital television plug-flow, solved and carried out to cause when program switches receiving terminal for digital television the phenomenon of flower screen or of short duration blank screen to occur in the prior art automatically, realized seamless switching; And the session process step is simple, has simplified the program switching flow, thereby can realize directly switching quickly and efficiently broadcast program.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The method of broadcast program of the present invention may further comprise the steps:
Whether video server detects current program and closes to an end, if, then finishing the forward direction session management server and send a notification message in current playing programs, the current program of announcement session management server closes to an end, and asks the programme information of next program;
After session management server receives described notification message, search the programme information of next program, transmit a reply message, the programme information of next program is sent to video server to video server;
After video server is received described answer message, when current playing programs finishes, to the video flowing of the next program of receiving terminal for digital television plug-flow.
Below to play time shift program with the user by set-top box be that an embodiment is described in detail, as shown in Figure 3.After the user sent the instruction of a certain program of program request to set-top box, set-top box generated the playing programs request, wherein carried the pertinent program information of this program, comprised channel information and time shift temporal information, then, sent the playing programs request to session management server.
In embodiments of the present invention, store the various video programs of playing for the user such as time shift program, direct playing and playback program and request program on the video server in advance.Simultaneously, the time started of all video frequency programs, concluding time, channel identifier, whether record that success, corresponding program information such as video server all are stored in the database in advance, session management server can be visited this database, search corresponding programme information, after receiving the playing programs request that set-top box sends, according to programme information, search corresponding program names and shift time, select suitable video server, send described program names and program start time is carried out video request to it.For time shift program and direct playing and playback program, program start time can be called shift time again.
After video server is received described video request, confirm that it stores this time shift program, return confirmation to session management server, session management server is transmitted described confirmation again to set-top box, simultaneously, video server is opened the file of this time shift program, to the video flowing of this program of set-top box plug-flow.At last, set-top box receives and plays this video flowing.
Video server detects the play position of this program in real time in the process of set-top box plug-flow, judges whether this program is about to play finish, and particularly, has two kinds of detection methods in embodiments of the present invention:
Method 1: video server at first needs program stream data is read in buffering area when plug-flow, therefore the time that runs through program stream data always wants Zao to program stream to the intact time of set-top box plug-flow than video server, therefore, can whether read to finish according to program stream data and judge whether current program is about to play finish, if read and finish, then be judged as and close to an end.The time when finishing of program stream data can being read to the time that session management server sends a notification message, is asked the programme information of next program as video server.But want Zao how long also uncertain owing to run through specifically intact than the plug-flow time of time of program stream data, this need judge according to blocks of files size, playback rate, current played file block size, buffering area number (buffer size is identical with the blocks of files size that reads at every turn) that video server reads at every turn.For example read blocks of files size for B (MB of unit), playback rate are that the size of r (MB/S of unit), current file piece is S (MB of unit), buffering area number m (generally having two) at every turn, run through so than finishing Zao ((m-1) * B+S%B)/r) around.Therefore, this method realizes that simple only need be when file runs through sending a notification message to session management server get final product, and still not configurable, flexibility is not enough, and can not determine how long send a notification message in advance.
Method 2: video server need be analyzed the program of playing when broadcast program, obtain the information such as code check, duration, coded system of program, time threshold values of video server configuration, whether the residue playing duration (being that total program duration deducts the side-play amount of having play) that regularly detects current program then is less than or equal to this time threshold values, if, then be judged as and close to an end, send a notification message, ask the programme information of next program to session management server.This method need realize a timer, and whether regular going detects Rule of judgment satisfies, and is complicated a little in the realization, but it is configurable, more flexible, and how long to send a notification message in advance be controlled.For example be set to 1 minute, promptly just can be judged as finishing only to remain 1 minute from current playing programs when is to deny as if then being judged as greater than 1 minute.Concrete time threshold values can be provided with according to actual conditions.
When being judged as when being, video server finishes the forward direction session management server in current playing programs and sends a notification message, and this notification message is used for the current program of announcement session management server and closes to an end, and next program is play in request.In embodiments of the present invention, this notification message is that the Announce message of standard is expanded, and increases the program_name field, forms the NAnnounce request message, and it can adopt form as follows, and this form is a kind of example:
ANNOUNCE?rtsp://odrm32.comcast.com:554?RTSP/1.0
CSeq:3
Session:123456
Notice:2101″End-of-Stream?Reached″
program_name
After session management server receives NAnnounce message, search the programme information of next program, transmit a reply message, the programme information of next program is sent to video server to video server.
Wherein, the described session management server step of searching the programme information of next program specifically comprises:
Session management server judges earlier whether current program belongs to the type that direct switching is play;
If, search the programme information of corresponding next program then according to the programme information of current program.
In embodiments of the present invention, judging whether to belong to the type that direct switching plays is by judging whether this program is time shift program or direct playing and playback program, if time shift program or direct playing and playback program then belong to the type that direct switching is play.Certainly the judgment rule that judges whether to belong to the type that direct switching plays can be provided with according to actual conditions, is not limited to time shift program and direct playing and playback program.If belong to the type that direct switching is play, illustrate that then this program can directly switch the operation of broadcast, can directly search the next program of current program and play, need not user's manual switchover.
Owing to deposit time started, concluding time and the multiplying power of the program of current broadcast in the session management server in advance, therefore, session management server can be judged the time started of next program according to the concluding time of current playing program, for example: the time started of current playing program sheet is 2010-11-26 17:12:15, concluding time is 2010-11-26 17:30:30, multiplying power is 2, and session management server will be changed the program sheet that time beginning is 2010-11-26 17:30:31.Then, session management server is replied the NAnnounce request message, and the program names of next program is sent to video server; Only need to send program names here, video server carries out plug-flow for this kind situation acquiescence from file header.In embodiments of the present invention, NAnnounce replys message can adopt form as follows, and this form is a kind of example:
RTSP/1.0200?OK
CSeq:3
Session:123456
program_name:xiyouji_2.ts
After video server was received and replied message, when current playing programs finished, the video flowing to the next program of receiving terminal for digital television plug-flow specifically may further comprise the steps:
After video server is received described answer message, open the file of next program, read data is to buffering area;
Judge whether current program finishes, if, then to the video flowing of the next program of receiving terminal for digital television plug-flow.
Particularly, video server begins to prepare for opening next program after receiving and replying message, comprises the file handle of opening next program, and reading of data is loaded into buffering area etc.; Simultaneously, judge whether current program has play end, in case current playing programs finish, with regard to the next program of live play, with the video flowing of next program from the buffering area plug-flow to the corresponding digital television receive terminal, realized seamless switching.Receiving terminal for digital television after receiving the video flowing of described next program, the broadcast of directly decoding,
This shows, the method of the broadcast program of the embodiment of the invention makes the user need not to wait for long time when switching program, has simplified the program switching flow, can realize directly switching quickly and efficiently program, realize seamless switching, greatly improved user experience.
As shown in Figure 4, the front end system 10 of the broadcast program of the embodiment of the invention comprises session management server 11 and video server 12; Whether described video server 12 is used to detect current program and closes to an end, if, then finish forward direction session management server 11 in current playing programs and send a notification message, announcement session management server 11 current programs close to an end, and ask the programme information of next program;
After described session management server 11 is used to receive described notification message, search the programme information of next program, transmit a reply message, the programme information of next program is sent to video server to video server 12;
After described video server 12 is received described answer message, when current playing programs finishes, to the video flowing of the next program of receiving terminal for digital television 20 plug-flows.
Wherein, video server 12 comprises second communication module 121, detection module 122 and playing module 123; Whether detection module 122 is used to detect current program and closes to an end, and concrete detection method comprises two kinds, in the existing description of preamble, repeats no more herein; And be used for after described second communication module 121 is received the answer message of described session management server 11 transmissions, judging whether current program finishes;
Particularly, playing module 123 is in the process of receiving terminal for digital television 20 plug-flows, and detection module 122 detects the play position of this program in real time, judges whether this program is about to play finish.In embodiments of the present invention, can set a time threshold values and judge whether to close to an end, for example be set to 1 minute, promptly just can be judged as in the time that only remains 1 minute from end is to deny as if then being judged as greater than 1 minute.Concrete time threshold values can be provided with according to actual conditions.
Second communication module 121 is used for when detection module 122 detects current program and closes to an end, finishing forward direction session management server 11 in current playing programs sends a notification message, announcement session management server 11 current programs close to an end, and ask the programme information of next program; And the answer message that receives session management server 11 transmissions.In embodiments of the present invention, described notification message is the expansion to Announce message, and particular content repeats no more in the existing description of preamble herein.
Described playing module 123 is used for when described detection module 122 judges that current program has finished, to the video flowing of the next program of receiving terminal for digital television plug-flow; Also be used for opening the file of next program after described second communication module 121 is received the answer message of described session management server 11 transmissions, read data is to buffering area.
In embodiments of the present invention, session management server 11 comprises first communication module 111, searches module 112 and judge module 113.First communication module 111 is used to receive the notification message (NAnnounce request message) that described video server 12 sends, and be used for transmitting a reply message (NAnnounce replys message) to video server 12, the programme information of next program is sent to video server 12; In embodiments of the present invention, replying message is that NAnnounce replys the message particular content in the existing description of preamble, repeats no more herein.
Searching module 112 is used for searching the programme information of next program after described first communication module 111 receives the notification message of described video server 12 transmissions.Concrete lookup method repeats no more in the existing description of preamble herein.
Judge module 113 is used for after described first communication module 111 receives the notification message of described video server 12 transmissions, judges whether current program belongs to the type that direct switching is play; The described module 112 of searching also is used for according to the programme information of current program, searching the programme information of corresponding next program when described judge module 113 judges that current program belongs to the type of direct switching broadcast.Concrete determination methods repeats no more in the existing description of preamble herein.
The embodiment of the invention also provides a kind of system of broadcast program, comprises receiving terminal for digital television 20, and the above-mentioned front end system 10 that is connected with receiving terminal for digital television 20.
Receiving terminal for digital television 20 forward end systems 10 send the playing programs request, and front end system 10 receives described playing programs request, and the corresponding program of plug-flow is to receiving terminal for digital television 20, and receiving terminal for digital television 20 receives and play this program.Whether front end system 20 program of monitoring receiving terminal for digital television 20 current broadcasts in real time closes to an end, if, then search next program, when current program finishes, directly with the video flowing plug-flow of next program to receiving terminal for digital television, receiving terminal for digital television 20 receives and plays next program.
In embodiments of the present invention, receiving terminal for digital television includes but not limited to: and set-top box, network protocol television (Internet Protocol Television, IPTV), digital TV integrated machine etc. has the terminal of receiving digital television function.
In sum, the present invention can solve existing based on RTSP agreement (Real Time StreamingProtocol, real time streaming transport protocol) with the video server of programme mode plug-flow, need carry out to cause when program switches receiving terminal for digital television the phenomenon of flower screen or of short duration blank screen to occur automatically at time shift program or direct playing and playback program, realize seamless switching; And the session process step is simple, has simplified the program switching flow, thereby can realize directly switching quickly and efficiently broadcast program.
More than lift preferred embodiment; the purpose, technical solutions and advantages of the present invention are further described; institute is understood that; the above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all; any modification of being done, be equal to replacement, improvement etc.; all should be included within protection scope of the present invention, the interest field that the present invention advocated should be as the criterion so that the patent application scope is described, but not only limits to the foregoing description.