A kind of Digital Television EPG Data Receiving and analytic method
Technical field
The present invention relates to digital television application technical data message pick-up and analytic method, particularly a kind of Digital Television EPG Data Receiving and analytic method.
Background technology
EPG(Electronic Program Guide, electric program menu) provide all interior TV program information of a period of time in " channel-time " mode, realize the function of browse of professional and descriptor, be basic function indispensable in the Digital Television; The EPG data are packed at front end, be embedded in the SI form and in network (transmission system, can transmit one group of transport stream) in transmission, STB terminal is responsible for the transport stream packets that all business information that Section(is used for this standard is defined become GB/T17975.1-2000) Data Receiving and parsing.
Reception and the analytic method that STB terminal is commonly used has at present:
Method A. is provided with and startup EPG data filter, according to SI form standard, the section that is embedded with the EPG data that filter is received forms segment, forms the table(form by segment again), again according to from table to segment again the order to section resolve; The EPG data are to be embedded into SI EIT(Event Information Table) in, forming structure is that 8 section form a segment, and 8 segment are arranged at most in the table;
Method B. is provided with and starts the EPG data filter, and according to SI form standard, each section that is embedded with the EPG data that filter is received stores in the interim buffer memory, just begins to resolve each section after waiting all section to collect;
Though more than two kinds of methods feasible, following problem points is arranged:
Method A. characteristics are section will be formed segment and table according to standard, and not only operating process complexity, and risk is bigger, in case any problem appears in the assembling link, whole EPG data can't be resolved.
Method B. compares with method A, does not need assembling process, only the section that receives need be stored in the interim buffer memory, just begin to resolve after waiting section to collect, and interim buffer memory will be as much as possible greatly.
Whether above-mentioned two kinds of methods all collect section the threshold of the resolution data as whether, if certain section because send, transmission or receive unusual in the link and can't normally receive the time, the parsing of data will be subjected to very big influence, especially the current information subsequently to having relatively high expectations in real time.
Summary of the invention
Technical problem to be solved by this invention is to overcome the EPG Data Receiving that exists in the prior art and the flow process challenge of parsing, a kind of Digital Television EPG Data Receiving and analytic method are proposed, do not need section is assembled into segment, again segment is formed form, all data reception modules and data resolution module all are based on the section cell data, and, can handle section in real time because handle in real time by the multitask module, do not need bigger interim buffer memory.
The technical solution used in the present invention:
A kind of Digital Television EPG Data Receiving and analytic method, to section receive, parsing and condition monitoring, concrete steps comprise:
A. initialization EPG module is carried out data filter, execution in step b by filter to section;
B. data reception module receives the section that is embedded with the EPG data, and section is stored in the interim buffer memory, if interim buffer memory is full, loses this section, and data reception module continues to receive next section data; Otherwise store the section data in interim buffer memory, execution in step c;
C. data resolution module is in running status always, if free of data in the interim buffer memory, the data resolution module effect is a parse state of monitoring section in real time; Otherwise execution in step d;
If in the d. interim buffer memory section that does not resolve is arranged, the data resolution module effect is to resolve data cached section, and the data after will resolving are stored; Otherwise execution in step c;
If e. all section all resolve and finish execution in step c; Otherwise execution in step d.
Described initialization EPG module comprises creates data reception module, data resolution module, semaphore, message queue.
Described data resolution module is monitored the parse state while of section in real time, also monitors internal memory user mode, data user mode in real time.
When described data reception module received section, version number and CRC by section judged whether section is correct.
After described section resolved through data resolution module, resolution data was stored in Ram or Flash.
In sum, owing to adopted technique scheme, the invention has the beneficial effects as follows:
The reception of EPG data and parsing all are to be unit with section, do not need to carry out data combination, data processing method is simple, and data reception module and data resolution module deal with data are that asynchronous process (so-calledly asynchronously refers to storage that Data Receiving only is responsible for receiving in interim buffer memory, only be responsible for reading of data from buffer memory and resolve, resolve and the monitor data parse state, the internal memory user mode, the data user mode), do not need too big interim buffer memory by Data Receiving task and the real-time processing of data parsing task, be whether the data parsing link collects data and do not rely on requirement, neither influence information rate, promoted the efficient of data parsing again greatly, for the user provides real-time EPG data in time.
Description of drawings
The present invention will illustrate by example and with reference to the mode of accompanying drawing, wherein:
Accompanying drawing 1 is that Digital Television EPG of the present invention receives and the analytic method flow chart.
Embodiment
Disclosed all features in this specification, or the step in disclosed all methods or the process except mutually exclusive feature and/or step, all can make up by any way.
Disclosed arbitrary feature in this specification (comprising any accessory claim, summary and accompanying drawing) is unless special narration all can be replaced by other equivalences or the alternative features with similar purpose.That is, unless special narration, each feature is an example in a series of equivalences or the similar characteristics.
It is shown in Figure 1 that the present invention solves the problems of the technologies described above the technical scheme such as the flow process that are adopted, at first carries out the EPG module initialization, and then to section receive, parsing and condition monitoring, concrete steps comprise:
A. initialization EPG module is carried out data filter, execution in step b by filter to section;
B. data reception module receives the section that is embedded with the EPG data, and section is stored in the interim buffer memory, if interim buffer memory is full, loses this section, and data reception module continues to receive next section data; Otherwise store the section data in interim buffer memory, execution in step c;
C. data resolution module is in running status always, if free of data in the interim buffer memory, the data resolution module effect is a parse state of monitoring section in real time; Otherwise execution in step d;
If in the d. interim buffer memory section that does not resolve is arranged, the data resolution module effect is to resolve data cached section, and the data after will resolving are stored; Otherwise execution in step c;
If e. all section all resolve and finish execution in step c; Otherwise execution in step d;
If in the f. interim buffer memory section that does not resolve is arranged, resolve this section data, with storage Ram or the Flash after resolving; If all section all resolve and finish, execution in step e.
The EPG data processing is by initialization EPG module, data filter, data reception module, and data resolution module is realized.
Initialization EPG module comprises creates data reception module, data resolution module, semaphore, message queue
Data filter is realized by filter.Section is the section of same table section, only a filter need be set, as the 0x51 that is designated of form, 0x52 ... 0x5f all belongs to 0x5x table section and carries out data filter.
The Data Receiving task is carried out the reception of effective section data, and section is stored in interim buffer memory, and when wherein the Data Receiving task received section, version number and CRC by section judged whether section is correct.
The data parsing task, if in the interim buffer memory data are arranged, it is data cached that the data parsing task act as parsing; If free of data in the interim buffer memory, data parsing task so act as monitor state, i.e. the parse state of monitoring in real time and execution section data, the internal memory user mode, the data user mode, in case in the interim buffer memory data are arranged, the parsing task switches to the parsing data in buffer.
The present invention is not limited to aforesaid embodiment.The present invention expands to any new feature or any new combination that discloses in this manual, and the arbitrary new method that discloses or step or any new combination of process.