The method and the device of synchronous EPG server content in a kind of embedded platform
Technical field
The present invention relates to the communications field, more particularly, relate to the method and the device of synchronous EPG server content in a kind of embedded platform.
Background technology
At present, in embedded product, set-top box particularly is by electronic program guides (EPG, Electronic Program Guide) can offer the information of all programs of user, EPG provides by literal to the user by Digital Television, figure, and image sets becomes human-computer interaction interface, be responsible for the navigation of program and miscellaneous service, the user can understand the relevant information (comprising Pgmtime, reproduction time, content summary etc.) of program by EPG.In the exploitation of set-top box, graphical interfaces based on FrameBuffer (frame buffering) mode, set-top box downloads to client by the background program EPG data that server end is all earlier, the EPG data are described by the unified XML file, and local XML (the Extensible Markup Language) file of gui program parsing shows EPG information then.In implementation procedure, the EPG content is upgraded by the timing of background program and is all downloaded in the local set-top box, and the EPG content file of server end is a real-time change, the file organization mode that comprises the EPG content, in the process of this real-time change, set-top box is upgraded back local file and file organization mode at every turn also variation, so often the EPG content file of server end and the EPG content file in the set-top box can not upgrade synchronously, make to lack in the set-top box in some up-to-date EPG perhaps to gather a large amount of inactive files.
Summary of the invention
In view of this, the invention provides the method and the device of synchronous EPG server content in a kind of embedded platform, showing based on FrameBuffer (frame buffering) under the mode of EPG content, background program is in the process of upgrading, by the contrast of nodal information in the new ancient deed, the EPG content of local client is upgraded synchronously.
For achieving the above object, the embodiment of the invention provides the method for synchronous EPG server content in a kind of embedded platform, and described method comprises:
Send the EPG request to server;
The server EPG content information that reception server returns;
Client EPG content information and described server EPG content information are compared, client EPG content information and corresponding catalogue thereof are upgraded by comparison.
In the said method, preferred, described information comparison is specially: judge the EPG content file whether client exists server to return:
If there is no, in client the EPG content file that server returns is added;
If exist, then client is deleted or is covered the EPG content file of self according to the EPG content file that server returns.
In the said method, preferred, described interpolation is specially:
The network address url of the EPG content file that the server of predicting according to client returns obtains the EPG content file;
Resolve described EPG content file and set up the respective directories of 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 the corresponding channel according to the network address url of film in the classified information file;
Resolve described description document, obtain the placard picture file of film correspondence according to the network address url of the film placard picture in the description document.
In the said method, preferred, described deletion or covering are specially:
Judge whether client exists EPG content backup file:
If exist, read in backup file, network address url nodes all in the backup file is preserved, and be designated deletion;
Read in this locality and upgraded the EPG content file, with all-network address url inquiry contrast in the backup file node of preserving wherein;
After contrast was finished, the node sign that the traversal backup file is preserved will be designated the channel directory deletion of the node correspondence of true;
If there is no, EPG content file, classified information file and/or description document are handled.
In the said method, preferred, the described processing that EPG content file, classified information file and/or description document are carried out is specially;
Judge whether the fileinfo in EPG content file, classified information file and/or the description document has latest update:
If have, the network address url that preserves all channels in the current file information also is initialized as deletion with the sign of all channels, and backup current file information is fileinfo content .bak form;
Network address url according to the client precognition obtains the up-to-date fileinfo of server;
Resolve up-to-date fileinfo, the network address url of the fileinfo of wherein all-network address url and current preservation is done contrast, find consistent change sign, be changed to false, at last the current file information nodes of preserving is designated the channel directory deletion of ture;
If no, stet spare information then.
In the said method, preferred, described deletion is:
Increase the EPG synchronous documents consistent at server end with EPG organising content structure;
Client is deleted local unnecessary file by downloading described EPG synchronous documents.
For achieving the above object, the embodiment of the invention also provides the device of synchronous EPG server content in a kind of embedded platform, and described device comprises:
Information receiving unit is used for sending the server EPG content information that EPG asks and reception server returns to server;
The information comparing unit is compared the server EPG content information that client EPG content information and server return;
Information updating unit upgrades client EPG content information according to the result who compares.
In the said apparatus, preferred, described information updating unit comprises:
The standard judgment sub-unit is used to the EPG content of judging whether client exists server to return; Then do not trigger the first renewal subelement if do not exist, then trigger the second renewal subelement if exist;
First upgrades subelement, is used for the triggering according to described standard judgment sub-unit, in client the EPG content that server returns is added;
Second upgrades subelement, is used for the triggering according to described standard judgment sub-unit, and the EPG content and the catalogue thereof of client are deleted or covered.
In the said apparatus, preferred, described second upgrades subelement comprises: the file delete cells, the EPG content file of client is deleted;
The file capping unit covers the EPG content file of client.
The invention provides the method and the device of synchronous EPG server content in a kind of embedded platform, the EPG organizational form and the EPG content that have guaranteed server end do not have unnecessary file in client, keep consistent fully, realized the synchronous renewal of client and server end EPG content with the EPG content of server.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is an embodiment of the invention EPG content synchronization method flow chart;
Fig. 2 is an embodiment of the invention EPG system configuration schematic diagram;
Fig. 3 is an embodiment of the invention EPG content organizational form structural representation;
Fig. 4 is the refinement flow chart of embodiment of the invention EPG method for synchronous;
Fig. 5 is an embodiment of the invention EPG synchronizer structural representation.
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.
Fig. 1 shows embodiment of the invention EPG content synchronization method flow chart.As shown in Figure 1, this method comprises:
Step S101: send the 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, client EPG content information and corresponding catalogue thereof are upgraded by comparison.
Fig. 2 shows the structural representation of EPG system in the embodiment of the invention, and the EPG system comprises that mainly EPG server 101 and client 102. clients 102 comprise set-top box 103 and Digital Television 104.
In the application of EPG system, set-top box 103 is sent the EPG request to EPG server 101, and EPG server 101 returns the concrete EPG content that set-top box 103 needs, and set-top box 103 is presented to the user by the GUI mode with the EPG content on Digital Television 104 then.
Fig. 3 shows EPG content organizational form structural representation in the embodiment of the invention, the unified document format data of built-in terminal and server definition encapsulates the EPG content, adopt the XML file format in the embodiment of the invention, because the EPG content generally all is by program is carried out sub-channel, classification is organized, be a kind of tree in essence, the XML file also is a kind of tree, the tree tissue that removes to describe EPG that can be complete; The channel of program, classified information come record by an XML file respectively, in each concrete classification which film are arranged, and the information of these all films (url that comprises placard) is also described by the XML file respectively.The organizational form and the concrete substance film of EPG content are described with regard to the file that has had three types like this.Respectively by server.xml, index.xml and rss.xml represent the channel directory file in embodiments of the present invention for we, classified information file and film description document in the channel, and the manifestation mode of these three kinds of files such as Fig. 2,
Write down the network address url (the corresponding url of channel) of the index.xml file 202 of all the elements channels in the Server.xml file 201, program can obtain concrete index.xml file 202 by url.
202 file loggings of Index.xml file the classified information of all programs in this channel, the leaf node of these classified informations has write down 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 has write down the film descriptor of program of the same type, as film profile, and performer, the url of director and placard etc.
Fig. 4 shows EPG method flow diagram in the embodiment of the invention, and when the whole procedure startup, step 301 beginning enters step 302 and judges whether client exists the server.xml file;
If there is not the server.xml file in client, then enter step 303, url according to the server.xml file of client precognition obtains the server.xml file, enter step 304 then, resolve the server.xml file and set up channel directory and obtain corresponding index.xml file according to the url of each channel;
After getting access to corresponding index.xml file, enter step 305, resolve the index.xml file and obtain all rss.xml files, enter step 306 afterwards, resolve the placard picture file that the rss.xml file obtains all films.
If there is the server.xml file in client, enter step 308, judge whether client exists the backup file that has upgraded the 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 preserved, and be designated and delete; Read in the server.xml file of client then, with wherein all url inquiry contrast in the backup file node of preserving, after contrast was finished, the node sign that the traversal backup file is preserved will be designated the channel directory deletion of the node correspondence of true.
If there is no the backup file of server.xml file then enters step 310, judges whether the server.xml file of client has latest update, if not then enter step 307 and finish whole procedure;
If enter step 311, preserve the url of current all channels of server.xml file, and the sign of all channels is initialized as and can deletes, backing up current server.xml file is server.xml.bak; Enter step 312 then, url according to precognition obtains the up-to-date server.xml file of server end, enter step 313, resolve up-to-date server.xml file, the url of wherein all url and the ancient deed that begins to preserve is done contrast, find consistent change sign, be changed to false (unsuppressible-suppression), at last the ancient deed node of preserving is designated the channel directory deletion of true.
Enter step 314 afterwards, the index.xml file is carried out the handling process same with the server.xml file, preserve the url of current all channels of index.xml file, and the sign of all channels is initialized as and can deletes, backing up current index.xml file is index.xml.bak; Url according to precognition obtains the up-to-date index.xml file of server end, resolve up-to-date index.xml file, the url of wherein all url and the ancient deed that begins to preserve is done contrast, find consistent change sign, be changed to false (unsuppressible-suppression), at last the ancient deed node of preserving be designated the node information deletion of true.
Enter step 315 afterwards, the rss.xml file is done the handling process same with the server.xml file, preserve the url of current all channels of rss.xml file, and the sign of all channels is initialized as and can deletes, backing up current rss.xml file is rss.xml.bak; Url according to precognition obtains the up-to-date rss.xml file of server end, resolve up-to-date rss.xml file, the url of wherein all url and the ancient deed that begins to preserve is done contrast, find consistent change sign, be changed to false (unsuppressible-suppression), at last the ancient deed node of preserving is designated the film picture deletion of true, whole procedure finishes.
Fig. 5 shows EPG synchronizer structural representation in the embodiment of the invention, comprising: information receiving unit 401, information comparing unit 402 and information updating block 403.
Information receiving unit 401 is after server sends the EPG request, the server EPG content information that reception server returns, information receiving unit 401 sends to information comparing unit 402 with the EPG content information that receives, the server EPG content that client EPG content information and server return is compared in information contrast unit 402, 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 that first upgrades the subelement 404 and the second renewal subelement 405, first upgrades subelement 404 is used in client the EPG content that server returns being added, and second upgrades subelement 405 is used for the EPG content and the catalogue thereof of client are deleted or covered.
Wherein the second renewal subelement 405 comprises file delete cells 406 and file capping unit 407; The deletion action that file delete cells 406 is carried out the EPG content file, file cover 407 overlapping operations of carrying out the EPG content file.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined herein General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.