Disclosure of Invention
The invention aims to provide an EPG data single-direction and two-direction parallel receiving method and a set top box thereof, and aims to solve the technical problems that the conventional digital television set top box cannot be compatible with data of a unidirectional receiver set top box and the EPG receiving efficiency is low.
The method for receiving the EPG in a single-direction and two-direction in parallel by the set top box comprises the following steps:
firstly, front-end EPG data generation:
step S101, acquiring unidirectional EPG data;
step S102, distinguishing different data types in EPG data, including data of different frequency points and data without distinguishing frequency points;
step S103, generating a file according to the data type and the format;
step S104, marking the file name of the generated file and storing the file name in an EPG bidirectional data server;
secondly, receiving the single-direction and two-direction EPG data in parallel:
step S301, initializing a receiving mark, and marking all receiving fields (Section) as 'not received' for judging the received data in the cache;
step S302, a unidirectional EPG data receiving channel and a filter are set according to the filter information of the data to be received, and the filter does not include the information of the data bit of the appointed field Number (Section Number); downloading the same EPG data from an EPG bidirectional data server, wherein the unidirectional downloading is converted to a step S302, and the bidirectional downloading is converted to a step S304;
step S303, when the unidirectional EPG data receiving channel obtains data, judging a receiving mark according to the Section Number, if the corresponding receiving mark is 'not received', storing the data into a buffer memory and setting the receiving mark to 'received', and if the corresponding receiving mark is 'received', discarding the data;
step S304, according to the current Section receiving mark, searching a Section marked as 'not received' as a target for bidirectional EPG data receiving;
step S305, generating file names according to the filter information of the data to be received and the Section Number of the target Section, wherein the format of the file names is the same as that of the step S102, and two file names for distinguishing two data types of different frequency points and non-distinguishing frequency points are generated at the same time;
step S306, two files are downloaded from the EPG bidirectional data server at the same time, wherein one file returns success, namely the receiving mark is checked, if the file is still not received, the data is stored in the cache and the receiving mark is set to be received;
step S307, determining whether the data is successfully received, if not, repeating step S303 and steps S304 to S306 until the data is successfully received.
The invention also provides a set-top box using the method, which comprises the following steps:
the front-end EPG data generation module is used for acquiring unidirectional EPG data, distinguishing types of different data in the EPG data, generating a file according to the data types and formats, and storing the file in an EPG bidirectional data server;
and the unidirectional and bidirectional parallel EPG data receiving module is used for unidirectional and bidirectional parallel downloading of files from the EPG bidirectional data server and storing the downloaded data in the buffer until the data is completely received successfully.
Compared with the prior art, the invention has the following characteristics:
1. the method is compatible with the original technology, does not need to modify the existing unidirectional network, and can realize the purpose of improving the EPG data receiving efficiency under the condition of ensuring the normal work of the network set top box.
2. Different from a single receiving scheme of the general technology, the invention can realize independent bidirectional receiving of EPG data and unidirectional and bidirectional parallel receiving of EPG data, and has higher flexibility and practicability.
3. The invention can be used for receiving EPG data, and can also be used for other applications with large data volume and frequent data receiving, such as a browser, a VOD service and the like.
Detailed Description
The invention is mainly divided into two parts, namely, the generation of front-end EPG data and the reception of EPG data of a set-top box. The two parts are correlated, and the file name generated by the front-end EPG data directly corresponds to the filter parameter used when the set-top box receives the file name. In addition, the EPG data reception of the set-top box can be further divided into separate bidirectional data reception and one-way and two-way parallel data reception. In parallel data reception, since unidirectional reception is cyclically broadcast data received at random, it cannot be guaranteed that each Section (Section) is sequentially received one by one starting from the first Section (Section) with a guaranteed reception speed, so bidirectional reception of sections (sections) that are not received or are missing by unidirectional reception according to file names, which can skip as a supplement to unidirectional reception, is achieved with the highest efficiency.
When the unidirectional broadcast EPG data is generated at the front end, the EPG data of each frequency point is split into a plurality of small files through different frequency points, different Table IDs and different Section numbers (Section numbers), and the files are put on an EPG bidirectional data server. When the set-top box needs to receive the EPG, the same EPG data is downloaded from the EPG bidirectional data server while a unidirectional receiving channel and a filter are set. And the two directions are carried out simultaneously in one direction and two directions, and the data are stored in the same cache, and are uniformly delivered to an application program for processing after the data are judged to be completely received.
The receiving scheme described in the invention does not affect the existing EPG unidirectional broadcasting and receiving scheme at all, and only serves as the supplement of the unidirectional receiving scheme. The unidirectional reception and the bidirectional reception can be in parallel, thereby improving the reception efficiency of the EPG data. The required EPG data can be received at any time only by bidirectional receiving without the restraint of the current Cable frequency point and the EPG main frequency point, and the receiving efficiency can be improved more obviously for the network environment of the unidirectional single EPG frequency point.
The specific embodiment of the invention is as follows:
first, EPG data generation of front end
The method comprises the steps of obtaining unidirectional EPG data, analyzing data of different frequency points and data of non-distinguishing frequency points in the EPG data, saving different SECTIons as files with the byte size not larger than 4096, dividing the SECTIon files into data files of different frequency points and data files of non-distinguishing frequency points, and placing the generated files on an EPG bidirectional data server.
Please refer to fig. 1 for a detailed method. The front-end EPG data generation method comprises the following steps:
step S101: obtaining unidirectional EPG data;
step S102: distinguishing types of different data in the EPC data;
analyzing data of distinguishing different frequency points and data of non-distinguishing frequency points in EPG data;
data such as SDT _ Actual (Table ID 0x42), EIT _ PF _ Actual, etc. are data for distinguishing different frequency points, and the data correspond to different programs according to the frequency points;
for example, BAT, SDT _ Other and Other data are data without distinct frequency points, and the data broadcast by each frequency point is the same data;
step S103: generating a file according to the data type and the format; that is, different sections are saved as files with no more than 4096 bytes according to different data types and fixed formats. Wherein,
the data storage file names for distinguishing different frequency points are as follows:
[original_network_id]_[transport_stream_id]_[PID]_[table_id]_[table_id_extension]_[section_number].dat
for example: the frequency point frequency is 355MHz, the symbol rate is 6.875MSym/s, the modulation mode is 64QAM, the transport id 10(0xA), the SDT _ Actual and the first selection are stored as files 0_ A _11_42_ A _0.dat
The data storage file name without distinguishing frequency points is as follows:
[original_network_id]_[PID]_[table_id]_[table_id_extension]_[section_number].dat
for example: BAT, Bouquet ID 1, first Section, saved as file 0_11_4A _1_0.dat
The file generation method specifically comprises the following steps: and storing different Section data at different frequency points into different files, and reserving the files according to the number of different EPG sections at each frequency point. After this is done, for a plurality of frequency points, the identical Section is combined into non-differentiated frequency point data in order to reduce the storage and transmission pressure.
Step S104: and saving all the generated files to an EPG bidirectional data server.
Two, two way EPG data reception
Referring to fig. 2, the bidirectional EPG data receiving method includes the following steps:
step S201: generating a file name according to the filter information; the file name of the pre-receiving Section is generated according to the filter information of the data to be received, the format is the same as the step S102 in the front-end EPG data generation, and two file names which distinguish two data types of different frequency points and non-distinguishing frequency points are generated at the same time.
Step S202: downloading files from the EPG bidirectional data server, and simultaneously downloading two files from the EPG bidirectional data server, wherein one file is successfully returned and then stored in a cache;
the generated file names correspond to the file names generated by the server, but the server only stores each Section once, so only one of the two generated file names can download the file, and the other file name returns an error, but the file download is successful as long as one file is downloaded successfully.
The scheme can also have a supplementary scheme, and some specified data such as Section of an SDT table are regarded as non-differentiated frequency point types by default at the server and the terminal, and other specified data are regarded as differentiated different frequency point types. Thus, the server side saves the Section according to the strategy, and the set-top box side also generates a unique Section file name according to the strategy. Thus, the file names can correspond to the data on the server one by one.
Step S203: judging whether the data is completely received successfully, if not, repeating the step S201 and the step S202, and sequentially receiving the next Section until the data is completely received successfully; if successful, then step 204 is included;
step S204: checking the verification information of the data in the cache, and handing the data to an application program for processing the data.
Three, one and two way EPG data parallel reception
Referring to fig. 3, the method for receiving the uni-directional and bi-directional EPG data in parallel includes the following steps:
step S301: initializing the receiving marks of all sections as 'not received' for judging the received data in the cache;
step S302: setting a one-way EPG data receiving channel and a filter according to the filter information of the data to be received, wherein the filter does not include the information of the appointed Section Number data bit;
step S303: when the unidirectional EPG data receiving channel obtains data, judging a receiving mark according to the Section Number, if the corresponding receiving mark is 'not received', storing the data into a buffer memory and setting the receiving mark as 'received'; if the corresponding receiving mark is 'received', discarding the data;
step S304: according to the current Section receiving mark, searching a Section marked as 'not received' as a target for receiving bidirectional EPG data;
step S305: generating file names according to the filter information of the data to be received and the Section Number of the target Section, wherein the format of the file names is the same as that of the step S102, and two file names for distinguishing two data types of different frequency points and non-distinguishing frequency points are generated at the same time;
step S306: simultaneously downloading two files from the EPG bidirectional data server, wherein one file is successfully returned, namely, checking a receiving mark, if the file is still not received, storing the data into a cache and setting the receiving mark as received;
step S307: judging whether the data is received successfully or not, if not, repeating the step S303 and the steps S304 to S306 until the data is received successfully, wherein the step S303 is parallel to the steps S304 to S306;
step S308: releasing a one-way EPG data receiving channel and a filter;
step S309: checking the verification information of the data in the cache and handing the data to the application program for processing the data.
The invention also discloses a set-top box using the method, which comprises the following steps:
the front-end EPG data generation module is used for acquiring unidirectional EPG data, distinguishing types of different data in the EPG data, generating a file according to the data types and formats, and storing the file in an EPG bidirectional data server;
and the single-direction and two-direction EPG data parallel receiving module is used for downloading files from the EPG two-direction data server in a one-way and two-way parallel manner and storing the downloaded data into the buffer.
The invention uses the scheme of bidirectional EPG data reception and compatible unidirectional EPG data reception, utilizes the bidirectional network as the supplement of the unidirectional EPG reception, and the bidirectional network is parallel to the unidirectional network, so that the advantages of the two transmission modes can be complemented. Because the existing bidirectional network is generally used for data transmission of value-added services and is generally in an idle state when a user watches broadcast television, the existing bidirectional network simultaneously utilizes the transmission resources to receive standard EPG data, thereby achieving the purpose of improving the EPG receiving efficiency. Meanwhile, the required EPG data can be received at any time only through bidirectional receiving without the restraint of the current Cable frequency point and the EPG main frequency point, and the receiving efficiency can be improved more obviously for the network environment of the unidirectional single EPG frequency point.