The method of synchronous EPG server content and device in a kind of embedded platform
Technical field
The present invention relates to the communications field, more particularly, relate to method and the device of synchronous EPG server content in a kind of embedded platform.
Background technology
At present, in embedded product, particularly Set Top Box, by electronic program guides (EPG, Electronic Program Guide) information of all programs of user can be supplied to, EPG provides by word by Digital Television to user, figure, and image sets becomes human-computer interaction interface, be responsible for the navigation of program and miscellaneous service, user can understand the relevant information (comprising Pgmtime, reproduction time, content summary etc.) of program by EPG.In the exploitation of Set Top Box, based on the graphical interfaces of FrameBuffer (frame buffering) mode, EPG data all for server end are first downloaded to client by a background program by Set Top Box, EPG data are described by unified XML file, and XML (the Extensible Markup Language) file that then gui program parsing is local shows EPG information.In implementation procedure, EPG content is upgraded by the timing of background program and all downloads in local top box, and the EPG content file of server end is real-time change, comprise the file organization mode of EPG content, in the process of this real-time change, Set Top Box upgrades the file of rear this locality at every turn and file organization mode there has also been change, EPG content file so often in the EPG content file of server end and Set Top Box can not synchronized update, makes to lack in Set Top Box in some up-to-date EPG and perhaps gathers a large amount of inactive files.
Summary of the invention
In view of this, the invention provides method and the device of synchronous EPG server content in a kind of embedded platform, under the mode showing EPG content based on FrameBuffer (frame buffering), background program is in the process upgraded, by the contrast of new ancient deed interior joint information, synchronized update is carried out to the EPG content of local client.
For achieving the above object, the embodiment of the present invention provides the method for synchronous EPG server content in a kind of embedded platform, and described method comprises:
EPG request is sent to server;
The server EPG content information that reception server returns;
Client EPG content information and described server EPG content information are compared, is upgraded by the catalogue of comparison to client EPG content information and correspondence thereof.
In said method, preferably, described information comparison is specially: judge the client EPG content file whether presence server returns:
If there is no, in client, the EPG content file that server returns is added;
If existed, then the EPG content file of EPG content file to self that client returns according to server is deleted or is covered.
In said method, preferably, described interpolation is specially:
According to the network address url acquisition EPG content file of the EPG content file that the server of client precognition returns;
Resolve the respective directories that described EPG content file sets up file mid band, obtain the classified information file of corresponding channel according to the network address url of described channel;
Resolve the classified information file of described channel, obtain the description document of film in corresponding channel according to the network address url of film in classified information file;
Resolve described description document, obtain placard picture file corresponding to film according to the network address url of the film placard picture in description document.
In said method, preferably, described deletion or covering are specially:
Judge whether client exists EPG content backup file:
If existed, read in backup file, network address url nodes all in backup file is preserved, and is designated deletion;
Read in this locality and upgraded EPG content file, by the inquiry contrast in the backup file node preserved of all-network address url wherein;
After having contrasted, the node identification that traversal backup file is preserved, deletes channel directory corresponding for the node being designated true;
If there is no, EPG content file, classified information file and/or description document are processed.
In said method, preferably, described the process that EPG content file, classified information file and/or description document are carried out to be specially;
Judge whether the fileinfo in EPG content file, classified information file and/or description document has latest update:
If had, preserve the network address url of all channels in current file information and the mark of all channels is initialized as deletion, backup current file information is fileinfo content .bak form;
The up-to-date fileinfo of server is obtained according to the network address url of client precognition;
Resolve up-to-date fileinfo, the network address url of the fileinfo of all-network address url wherein and current preservation is contrasted, find consistent change mark, be set to false, the channel directory finally the current file information nodes of preservation being designated ture is deleted;
If no, then stet part information.
In said method, preferably, described deletion is:
The EPG synchronous documents consistent with EPG organising content structure is increased at server end;
Client deletes local unnecessary file by downloading described EPG synchronous documents.
For achieving the above object, the embodiment of the present invention additionally provides the device of synchronous EPG server content in a kind of embedded platform, and described device comprises:
Information receiving unit, for sending the server EPG content information that EPG asks also reception server to return to server;
Information comparing unit, server EPG content information client EPG content information and server returned is compared;
Information updating unit, the result according to comparison upgrades client EPG content information.
In said apparatus, preferably, described information updating unit comprises:
Standard judgment sub-unit, for judging the client EPG content whether presence server returns; If do not exist, trigger first and upgrade subelement, if exist, trigger second and upgrade subelement;
First upgrades subelement, for the triggering according to described standard judgment sub-unit, adds the EPG content that server returns in client;
Second upgrades subelement, for the triggering according to described standard judgment sub-unit, deletes the EPG content of client and catalogue thereof or covers.
In said apparatus, preferably, described second upgrades subelement comprises: file erase unit, deletes the EPG content file of client;
File capping unit, covers the EPG content file of client.
The invention provides method and the device of synchronous EPG server content in a kind of embedded platform, ensure that EPG organizational form and the EPG content of server end do not have unnecessary file in client, keep consistent with the EPG content of server completely, achieve the synchronized update of client and server EPG content.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is embodiment of the present invention EPG content synchronization method flow chart;
Fig. 2 is embodiment of the present invention EPG system structural representation;
Fig. 3 is embodiment of the present invention EPG Content Organizing mode structural representation;
Fig. 4 is the refinement flow chart of embodiment of the present invention EPG synchronous method;
Fig. 5 is embodiment of the present invention EPG synchronizer structural representation.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 shows embodiment of the present invention EPG content synchronization method flow chart.As shown in Figure 1, the method comprises:
Step S101: send EPG request to server;
Step S102: the server EPG content information that reception server returns;
Step S103: client EPG content information and described server EPG content information are compared, is upgraded by the catalogue of comparison to client EPG content information and correspondence thereof.
Fig. 2 shows the structural representation of EPG system in the embodiment of the present invention, and EPG system mainly comprises EPG server 101 and client 102. client 102 comprises Set Top Box 103 and Digital Television 104.
In the application of EPG system, Set Top Box 103 sends EPG request to EPG server 101, and EPG server 101 returns the concrete EPG content that Set Top Box 103 needs, and then EPG content is presented to user by GUI mode by Set Top Box 103 in Digital Television 104.
Fig. 3 shows EPG Content Organizing mode structural representation in the embodiment of the present invention, built-in terminal and server define unified document format data to encapsulate EPG content, XML file form is adopted in the embodiment of the present invention, because EPG content is all generally by carrying out sub-channel to program, classification is organized, be a kind of tree in essence, XML file is also a kind of tree, the tree tissue removing description EPG that can be complete; The channel of program, classified information carrys out record respectively by an XML file, has which film in each classification specifically, and the information of these all films also describes respectively by XML file (comprising the url of placard).Like this with regard to have three types file to describe the organizational form of EPG content and concrete substance film.We represent channel directory file respectively by server.xml, index.xml and rss.xml in embodiments of the present invention, classified information file and film description document in channel, the manifestation mode of these three kinds of files as Fig. 2,
Have recorded the network address url (a corresponding url of channel) of the index.xml file 202 of all the elements channel in Server.xml file 201, program can obtain concrete index.xml file 202 by url.
The classified information of all programs in this channel of Index.xml file 202 file record, the leaf node of these classified informations have recorded the url of the rss.xml file 203 of this classification correspondence, and program can obtain concrete rss.xml file 203. by the url of this classification
Rss.xml file 203 have recorded the film descriptor of program of the same type, as film profile, and performer, the url etc. of director and placard.
Fig. 4 shows EPG method flow diagram in the embodiment of the present invention, and when whole program starts, step 301 starts, and enters step 302 and judges whether client exists server.xml file;
If there is not server.xml file in client, then enter step 303, url according to the server.xml file of client precognition obtains server.xml file, then enter step 304, resolve server.xml file set up channel directory and obtain corresponding index.xml file according to the url of each channel;
After getting corresponding index.xml file, enter step 305, resolve the rss.xml file that index.xml file acquisition is all, enter step 306 afterwards, resolve the placard picture file of all films of rss.xml file acquisition.
If there is server.xml file in client, enter step 308, judge whether client exists the backup file having upgraded server.xml file, if there is the backup file of server.xml file, enter step 309, read in this backup file, wherein all url nodes are saved, and be designated and can delete; Then read in the server.xml file of client, by wherein all url inquiry contrast in the backup file node preserved, after having contrasted, the node identification that traversal backup file is preserved, has deleted channel directory corresponding for the node being designated true.
If there is no the backup file of server.xml file, then enter step 310, judges whether the server.xml file of client has latest update, if not, enters step 307 and terminate whole program;
If enter step 311, preserve the url of all channels of current server.xml file, and the mark of all channels is initialized as and can be deleted, backing up current server.xml file is server.xml.bak; Then step 312 is entered, the up-to-date server.xml file of server end is obtained according to the url of precognition, enter step 313, resolve up-to-date server.xml file, all url wherein and the url starting the ancient deed preserved are contrasted, finding consistent change mark, be set to false (unsuppressible-suppression), is finally that the channel directory of true is deleted by the ancient deed node identification of preservation.
Enter step 314 afterwards, the handling process same with server.xml file is carried out to index.xml file, preserve the url of all channels of current index.xml file, and the mark of all channels is initialized as and can be deleted, backing up current index.xml file is index.xml.bak; The up-to-date index.xml file of server end is obtained according to the url of precognition, resolve up-to-date index.xml file, all url wherein and the url starting the ancient deed preserved are contrasted, find consistent change mark, being set to false (unsuppressible-suppression), is finally that the node information of true is deleted by the ancient deed node identification of preservation.
Enter step 315 afterwards, the handling process same with server.xml file is done to rss.xml file, preserve the url of all channels of current rss.xml file, and the mark of all channels is initialized as and can be deleted, backing up current rss.xml file is rss.xml.bak; The up-to-date rss.xml file of server end is obtained according to the url of precognition, resolve up-to-date rss.xml file, all url wherein and the url starting the ancient deed preserved are contrasted, find consistent change mark, be set to false (unsuppressible-suppression), be finally the film picture deletion of true by the ancient deed node identification of preservation, whole EP (end of program).
Fig. 5 shows EPG synchronizer structural representation in the embodiment of the present invention, comprising: information receiving unit 401, information comparing unit 402 and information updating block 403.
After information receiving unit 401 sends EPG request to server, the server EPG content information that reception server returns, the EPG content information received is sent to information comparing unit 402 by information receiving unit 401, the server EPG content that client EPG content information and server return by information contrast unit 402 is compared, and comparison result is sent to information updating unit 403.
Information updating unit 403 upgrades client EPG content information according to comparison result; Information updating unit comprises the first renewal subelement 404 and second and upgrades subelement 405, first upgrades subelement 404 for adding the EPG content that server returns in client, and second upgrades subelement 405 for deleting the EPG content of client and catalogue thereof or cover.
Wherein the second renewal subelement 405 comprises file erase unit 406 and file capping unit 407; File erase unit 406 performs the deletion action to EPG content file, and file covers 407 overlapping operations of execution to EPG content file.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.