A kind of support remote mobile reservation high-definition video system and method based on Set Top Box
Technical field
The present invention relates to communication technical field, relate in particular to a kind of support remote mobile reservation high-definition videocorder set-top box system based on Set Top Box.
Background technology
Digital HDTV STB relies on as a kind of the home appliance that television terminal provides integrated information business, comes into huge numbers of families, for user provides interactively digitlization amusement, education and commercialization activity.By Set Top Box, for user provides various personalized subscribed services, developed greatly at present, and user is more and more higher to household electrical appliances amusement requirement, for Set Top Box, programming makes its service variation become a kind of industrial trend.
Mobile phone is as a kind of mobile communication equipment, and function is more and more diversified.By the mobile terminals such as mobile phone and household electrical appliance networking, realizing Long-distance Control, is a trend of Smart Home development.Sensu lato high definition digital set top box is exactly the network terminal being connected with TV, and it links network and mobile phone communicates and will become the first step of controlling household electrical appliance through mobile terminal.
Occur on the market at present the application of a lot of mobile TVs, this application cost is low, be easy to carry, but but needs the support of third party software, and has the shortcomings such as image resolution ratio is low, channel is few, unstable.And the needed flow of mobile TV is larger, the wireless network bandwidth that China operator provides is at present difficult to meet the demand of user to HDTV (High-Definition Television).
Secondly the application that TV set-top box is controlled by Radio Transmission Technology in the communications field at present has its limitation.That Radio Transmission Technology mainly contains is infrared, bluetooth, Wlan etc., and infrared transmission needs point-to-point operation, and transmission range is short, and on its transmission route, can not have barrier; Bluetooth transmission transmission range is short, and a little less than fail safe, is easily subject to external interference; Wlan hardware device is expensive, is not suitable for promoting on a large scale.Therefore, these technology are all not suitable for Long-distance Control.
Summary of the invention
In view of this, the present invention is based on communication of mobile terminal and Set Top Box programming, realize a kind of support remote mobile reservation high-definition video system based on Set Top Box, better met the requirement of user to Digital HDTV STB amusement, realized household appliances intelligent.The present invention realizes like this
A support remote mobile reservation high-definition video system based on Set Top Box, comprising:
Mobile terminal, to realize Remote configuration function, has the internet function of being connected into for Control on Communication;
Set Top Box, for receiving control information and realize recording function.
Further, described mobile terminal is remote handset client, and this remote handset client further comprises:
UI module, for providing the interface of man-machine interaction;
Reservation communication module, for communicating by letter of client and Set Top Box;
Mobile phone control module, the control signal of inputting for converting users is also controlled processing.
Further, described Set Top Box comprises:
Server based on embedded Linux platform, for realizing Remote configuration with remote handset client;
10/100M adaptive network adapter, is connected into the Internet for realizing;
SATA/IDE external hard drive interface, for supporting more than external 80G big capacity hard disk to deposit the HDTV (High-Definition Television) recording.
Further, described server comprises:
Channel information acquisition module, for gathering current all television channel informations and regularly the rendition list of Set Top Box supervisor top box end being upgraded;
Set Top Box code stream receiver module, for receiving HDTV (High-Definition Television) code stream and storing external hard drive into;
Set Top Box reservation communication module, for communicating by letter of Set Top Box and mobile reservation client;
Video recording memory module, for the timed task of the storage of recording a video;
, for the treatment of system, there is situation when abnormal in error handling processing module.
Further, the channel information acquisition module of above-mentioned server is responsible for regularly the rendition list of Set Top Box supervisor top box end being upgraded.Set Top Box reservation communication module is responsible for network monitoring, when mobile phone reservation client communication module is initiated request by the Internet to Set Top Box, Set Top Box reservation communication module allows mobile phone terminal access, and return to current the rendition list, mobile phone terminal reservation communication module is given the rendition list mobile phone terminal UI module simultaneously and is given user and browse, the setting of mobile phone terminal control module monitoring users, and after being encapsulated, information corresponding to result sends to Set Top Box reservation communication module, Set Top Box reservation communication module is delivered to video recording memory module by information, video recording memory module is by inquiring about the rendition list, timer is set, and upgrade subscription time table, after waiting for Pgmtime, trigger video recording storage.The emergency case such as that the error handling processing resume module communicating interrupt of server end, Set Top Box are controlled is malfunctioning, power-off, and error message is recorded in journal file, and according to the processing mode setting in subscription time table, carry out the processing such as remote notification user.
Further, Set Top Box reservation communication module of the present invention communicates by Transmission Control Protocol (SCTP) and mobile terminal.Set Top Box reservation communication module provides following methods interface to call for server or user: Listen () method is used for by calling API the Socket () interface of TCP/IP network, constantly monitor 8008 ports of TCP, find that there is the transfer of data true that comes then to return, otherwise return to fasle to error handling processing module; Accept () method connects for set-top-box server and data, when the socket that accept () method monitors receives connection request, socket () interface will be set up a new socket, the address of this new socket and request connection process is connected simultaneously, simultaneously for this socket sets up an input data queue, the service request of arrival is kept in this queue, until other resume module of server they; DataRecieve () method is used for receiving the data of accept () method queue; DataSend () method is for sending the data-signal that control module sends over.
Further, Set Top Box channel information acquisition module of the present invention is first set up the rendition list file store list on hard disk, and this list is preengage communication module by Set Top Box and read by row, and to return to user after the encapsulation of XML form; When Set Top Box reservation communication module is received user's connection request, this module is called the inquiry of query () method and whether is had the rendition list storage file, finds to exist this document to return to 0, otherwise returns to-1; After receiving query () method return value 0, call createChannel () method, the method creates a First Input First Output, and read the rendition list file by row, all the rendition lists in chronological sequence, exist in the middle of this queue, this sequence sends to Set Top Box reservation communication module by ChannelSend () method, and is upgraded and be shown to cell phone terminal by UI module.
Code stream receiver module of the present invention, by connecting the program channel of appointment, receives the video codeword data stream of this program channel, and is stored in external hard drive, and video is taked AVI compression coding form; When hard-disk capacity is not enough, send a message to error handling processing module.
Further, Set Top Box video recording memory module of the present invention is received after the signal of Set Top Box reservation communication module, calls query () method and channel list file is carried out and result is returned; If query () method returns to 0, Set Top Box video recording memory module is added to a new task in the middle of task queue, and it is consistent with Pgmtime that video recording timer is set, when program starts by the time, timer triggers, and video recording memory module is called code stream receiver module and started video recording; This Set Top Box control module has a timer, and user sends the duration that when selecting this channel and starting to record, this module is obtained this section of video, and timer starts timing video recording, when the time period, is finished, and video recording stops; User also available mobile terminal arranges video time and channel in advance, when the set time, arrives, and timer starts timing video recording.
Further, mobile phone control module of the present invention is by clic_to_response () method, monitor the control signal that client passes over by UI module, and call transfer () method and signal is changed into file format pass to mobile phone reservation communication module; When receiving the data of mobile phone reservation communication module, by transfer () method, be converted to corresponding information.
Beneficial effect of the present invention is as follows:
1, the present invention has realized a kind of support remote mobile reservation high-definition video system based on Set Top Box, this system efficiently solves that modern is busy with one's work and the problem that can not watch in time the TV programme of liking, by shifting to an earlier date book setting, the television program record of liking is got off, system has reliability, stability, and only needs very little flow for communication.
2, the present invention passes through the good mutual of cell phone terminal and HDTV (High-Definition Television) Set Top Box, has realized the function of mobile terminal remote configuration furniture and appliances, for providing from now on how better application to set up good basis, has met the direction of Smart Home development.
Accompanying drawing explanation
Fig. 1 is the integral module frame diagram of system of the present invention;
Fig. 2 is the flow chart between system modules of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described further.
Fig. 1 is the integral module block diagram of the support remote mobile reservation high-definition video system based on Set Top Box of the present invention, this example based on hardware structure comprise: there is the cell phone terminal that is connected into internet function and the high definition interactive digital television Set Top Box with network interface card network interface.The software architecture of cell phone terminal comprises: UI module, mobile phone reservation communication module and mobile phone control module; In high definition digital set top box, have a server platform, this server platform comprises code stream receiver module, channel information acquisition module, reservation communication module, video recording memory module and error message processing module.
The software architecture execution mode of cell phone terminal is as follows: wherein,
UI module, for user interface.This module shows user's information needed with html form web page.It comprises three pages: a page, for showing the channel list information that Set Top Box is returned and channel selection function being provided, then selects information to send to mobile phone control module user; Second page is used for setting the subscription and video recording time, and user only need to set video time and channel information in advance, and mobile phone reservation communication module sends to set-top-box server information, Set Top Box meeting automatically recording video program using after the time period arrives; The 3rd page is used for showing error message.
Mobile phone control module by click_to_response () method, is monitored the control signal that client passes over by UI module, and calls transfer () method and signal is changed into file format pass to mobile phone reservation communication module; When receiving the data of mobile phone reservation communication module, by transfer () method, be converted to corresponding information.
Mobile phone reservation communication module is called Listen () method, the method is by calling the APISocket () interface of TCP/IP network, constantly monitor 8008 ports of TCP, find that there is the transfer of data true that comes then to return, otherwise return to fasle to error handling processing module; When the socket that accept () method monitors receives connection request, socket () interface will be set up a new socket, the address of this new socket and request connection process is connected simultaneously, simultaneously for this socket sets up an input data queue, the service request of arrival is kept in this queue, until other resume module of server they; DataRecieve () method is used for receiving the data of accept () method queue; DataSend () method is for sending the data-signal that control module sends over.
Set-top-box server assembly execution mode is as follows: as shown in Figure 2, and wherein,
Set Top Box reservation communication module communicates by Transmission Control Protocol (HTML (Hypertext Markup Language)) and mobile terminal.Set Top Box reservation communication module provides following methods interface to call for server or user: Listen () method is used for by calling API the Socket () interface of TCP/IP network, constantly monitor 8008 ports of TCP, find that there is the transfer of data true that comes then to return, otherwise return to fasle to error handling processing module; Accept () method connects for set-top-box server and data, when the socket that accept () method monitors receives connection request, socket () interface will be set up a new socket, the address of this new socket and request connection process is connected simultaneously, simultaneously for this socket sets up an input data queue, the service request of arrival is kept in this queue, until other resume module of server they; DataRecieve () method is used for receiving the data of accept () method queue; DataSend () method is for sending the data-signal that control module sends over.
Set Top Box channel information acquisition module is by set up the rendition list file store list on hard disk, and this list is preengage communication module by Set Top Box and read by row, and to return to user after the encapsulation of XML form.When Set Top Box reservation communication module is received user's connection request, this module is called the inquiry of query () method and whether is had the rendition list storage file, finds to exist this document to return to 0, otherwise returns to-1; After receiving query () method return value 0, call createChannel () method, the method creates a First Input First Output, and read the rendition list file by row, all the rendition lists in chronological sequence, exist in the middle of this queue, this sequence sends to Set Top Box reservation communication module by ChannelSend () method, and is upgraded and be shown to cell phone terminal by UI module.
Code stream receiver module connects the program channel of appointment, receives in real time the television video of playing at that time, and is stored in external hard drive, and video is taked AVI compression coding form; When hard-disk capacity is not enough, send a message to error handling processing module.
Video recording memory module is received after the signal of Set Top Box reservation communication module, calls query () method and channel list file is carried out and result is returned; If query () method returns to 0, Set Top Box video recording memory module is added to a new task in the middle of task queue, and it is consistent with Pgmtime that video recording timer is set, when program starts by the time, timer triggers, and video recording memory module is called code stream receiver module and started video recording; This Set Top Box control module has a timer, and user sends the duration that when selecting this channel and starting to record, this module is obtained this section of video, and timer starts timing video recording, when the time period, is finished, and video recording stops; User also available mobile terminal arranges video time and channel in advance, when the set time, arrives, and timer starts timing video recording.
Error handling processing module notifies user reminding user to take corresponding measure when application program or hardware make a mistake, and has ensured the robustness of program.Error handling processing comprises following mistake: InvalidCommandException () user command mistake; ChannelException () is channel error; TimeException () set of time mistake; IllegalSignalException () is that Set Top Box power-off maybe can not detect mistake; NoCapacityException () is the not enough mistake of hard-disk capacity.Later can also be according to the actual error category that increases of application.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of above-described embodiment is to come the hardware that instruction is relevant to complete by program, this program can be stored in a computer-readable recording medium, storage medium can comprise: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc.
The foregoing is only embodiments of the invention, not in order to limit the present invention, all any modifications of making within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.