Background technology
Set top box to demux (demultiplexer) in process of production, it is necessary to carry out pressure test.Demultiplexer pressure testAt present use filter tables of data mode for:
Main thread and sub-line journey are set, tables of data, the tables of data PID (process identification (PID)s for needing to filter are set in main threadSymbol) and the number of times of filtering is needed, and filtering mark (filter.Enable) is set to 1, it is then medium to be fixed in main threadDuration (enough for a long time, such as 5s, 30s), filtering mark (filter.Enable) is set to 0 by fixed duration after reaching, i.e., eventuallyThe only filtering of the tables of data.
A global variable mark (pass_flag) defined in sub-line journey, in main thread waiting process, if demultiplexingWhen device has been filled into corresponding data table PID, global variable mark will be set to 1 in sub-line journey, when global variable mark willPressure test when being set to 1 then to the tables of data passes through.
Above method mainly has two kinds of drawbacks:
One:Because signal transmission is unstable, or some it is abnormal when, it would be possible to cause demux filter tables of data whenIt is long than length during the fixation of defined in main thread.1 is so set to already in the global variable mark of sub-line journey, that is, has been connectReceive filtering tables of data, then also need to wait main thread fixation duration to terminate.
For example, it is assumed that a length of 30s when fixed, and actual demux filters out tables of data and has only used 15s, when this large amount ofBetween will be wasted in the time delay of main thread, finally reduce testing efficiency.
Second, when demux carries out pressure test, such as identical PID tables of data needs continuous reception multiple, such as threeIt is secondary, then as long as getting a tables of data PID in sub-line journey, the global variable mark in subprogram will be set to 1, i.e.,Just having be not filled into tables of data PID many times and final testing result still passes through, and so results in final demux pressure and surveysThe confidence level of examination drastically declines, and even fails.
Therefore it is existing time-consuming serious to demux pressure tests, and it is not high enough to test confidence level, is unsatisfactory for test request.
The content of the invention
In view of this, it is necessary to there is time-consuming serious and confidence level to demultiplexer (demux) pressure test for above-mentionedNot high the problem of, there is provided a kind of set top box demultiplexer method for testing pressure and system.
A kind of set top box demultiplexer method for testing pressure that the present invention is provided, comprises the following steps:
S10:Global enables marks defined in main thread, and sets the tables of data for needing filtering, each tables of dataPID and each filter table PID need the number of times that filters, the global mark that enables is set to 1 when starting test;
S20:One group of global aray variable mark defined in sub-line journey, global aray variable mark is used for recording every numberThe number of times being filtered to according to table PID, is set to the PID that sub-line journey if 1 starts filtering tables of data if the global mark that enables, is filled into oneIt is secondary, record once;
S30:The number of times that main thread is filtered to according to each tables of data PID in setting cycle period detection sub-line journey, ifThe number of times that each tables of data PID is filtered to meets setting range compared with the number of times for needing to filter, then the data meter pressure is surveyedPinged;
S40:If main thread detect all tables of data pressure tests if by the overall situation enable mark be set to 0 by 1 immediately,Terminate test and demux pressure tests pass through.
Further, the step S10 is specially:Setting needs the tables of data of filtering for pat table, SDT tables, NIT tables threeIndividual tables of data.
Further, setting cycle period, which is less than main thread fixation duration divided by all tables of data PID, needs the total of filteringNumber of times.
Further, the setting range is to be not less than to need the 95% of number of times.
A kind of set top box demultiplexer pressure testing system that the present invention is provided, including:
Main thread setup module, defined in main thread one it is global enable mark, and set need to filter tables of data,The PID and each filter table PID of each tables of data need the number of times filtered, and the global mark that enables is set to 1 when starting test;
Sub-line journey setup module, one group of global aray variable mark defined in sub-line journey, global aray variable mark is usedTo record the number of times that each tables of data PID is filtered to, it is set to sub-line journey if 1 if global enable mark and starts to filter tables of dataPID, is filled into and once then records once;
PID filtering times detection modules, main control line journey is according to each tables of data in setting cycle period detection sub-line journeyThe number of times that PID is filtered to, if the number of times that each tables of data PID is filtered to meets setting model compared with the number of times for needing to filterEnclose, then the tables of data pressure test passes through;
Terminate module is tested, detecting all tables of data pressure tests if main thread marks overall situation enable immediately if0 is set to by 1, terminates test and demux pressure tests passes through.
Further, setting needs the tables of data of filtering for pat table, SDT tables, three tables of data of NIT tables.
Further, the setting cycle period, which is less than main thread fixation duration divided by all tables of data PID, needs filteringTotal degree.
Further, the setting range is to be not less than to need the 95% of number of times.
Set top box demultiplexer method for testing pressure of the present invention and system, mark in global enable of main thread definition, setNeeding tables of data, the PID of each tables of data and each filter table PID of filtering needs the number of times filtered, in the definition of sub-line journeyOne group of global aray variable records the number of times that each tables of data PID is filtered to, time that each tables of data PID is filtered toNumber meets setting range compared with the number of times for needing to filter, then the tables of data pressure test passes through, and main thread is circulated according to settingThe number of times that each tables of data PID is filtered in cycle detection sub-line journey, all tables of data pressure tests are detected in main threadPassed through by the way that overall situation enable mark then is set into 0 demux pressure test by 1 immediately, terminate test, can thus led in testLater test is terminated, it is not necessary to wait duration to be fixed, and testing result is accurate, it is with a high credibility, greatly meet test request.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and ExamplesThe present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, notFor limiting the present invention.
Fig. 1 is the flow chart of the set top box demultiplexer method for testing pressure in one embodiment, as shown in figure 1, the partyMethod comprises the following steps:
S10:Global enables marks defined in main thread, and sets the tables of data for needing filtering, each tables of dataPID and each filter table PID need the number of times that filters, the global mark that enables is set to 1 when starting test.
To enable main thread to be controlled pressure test, an overall situation makes defined in main thread in the embodimentEnergy mark is used for the beginning and end that control pressure is tested, and overall situation enable mark is set to 1 test and started, and the overall situation enables mark and putTerminate for 0 test.Then tables of data, the PID of each tables of data and each filter table PID that setting needs filtering neededThe number of times of filter, global enable mark is set to 1 and starts to test after setting.
Further, for convenience of test, the step is specially:Setting needs the tables of data of filtering for pat table (programming associationTable), SDT tables (service describing table), three tables of data of NIT tables (network information table).
S20:One group of global aray variable mark defined in sub-line journey, global aray variable mark is used for recording every numberThe number of times being filtered to according to table PID, is set to the PID that sub-line journey if 1 starts filtering tables of data if the global mark that enables, is filled into oneIt is secondary, record once.
Due to that will be filtered repeatedly for each tables of data, and the number of times being filled into meets and requires that tables of data test is just calculatedPass through, to avoid one group of global aray variable mark defined in sub-line journey in the insecure problem of test result, the step, entirelyInning group variable label is used for recording the number of times that each tables of data PID is filtered to, and each tables of data thus is filled into PIDNumber of times record and accurately judged.
S30:The number of times that main thread is filtered to according to each tables of data PID in setting cycle period detection sub-line journey, ifThe number of times that each tables of data PID is filtered to meets setting range compared with the number of times for needing to filter, then the data meter pressure is surveyedPinged.
After sub-line journey starts filtering tables of data PID, to save the testing time, main thread is detected according to setting cycle periodThe number of times that each tables of data PID is filtered in sub-line journey, grasps PID filtering situation in real time.In sub-line journey filter process,If the number of times that each tables of data PID is filtered to meets setting range compared with the number of times for needing to filter, the data meter pressureTest passes through.
Further, setting cycle period, which is less than main thread fixation duration divided by all tables of data PID, needs the total of filteringNumber of times.
Setting range is to be not less than to need the 95% of number of times.
S40:If main thread detect all tables of data pressure tests if by the overall situation enable mark be set to 0 by 1 immediately,Terminate test and demux pressure tests pass through.
In main thread detection process, if detecting all tables of data pressure tests all meets requirement, to demux pressureTest passes through, and the overall situation is enabled mark and is set to 0 by 1 immediately by main thread, terminates test.Thus in all tables of data pressure testsAll to meet and just complete test after requiring, test is completed again after terminating without waiting for fixed duration.
The set top box demultiplexer method for testing pressure, is marked, setting needs what is filtered in global enable of main thread definitionTables of data, the PID of each tables of data and each filter table PID need the number of times filtered, and one group of global number is defined in sub-line journeyGroup variable label records the number of times that each tables of data PID is filtered to, and the number of times that each tables of data PID is filtered to was with needingThe number of times of filter is compared to setting range is met, then the tables of data pressure test passes through, and main thread is according to setting cycle period detectionThe number of times that each tables of data PID is filtered in thread, detects all tables of data pressure tests in main thread and passes through then by entirelyOffice's enable mark is set to 0 demux pressure test by 1 immediately and passed through, and terminates test, can thus terminate to survey after test passes throughExamination, it is not necessary to wait duration to be fixed, and testing result is accurate, it is with a high credibility, greatly meet test request.
Meanwhile, the present invention also provides a kind of set top box demultiplexer pressure testing system, as shown in Fig. 2 the system includes:
Main thread setup module 100, global enables marks defined in main thread, and sets the data for needing to filterTable, the PID of each tables of data and each filter table PID need the number of times filtered, and the global mark that enables is set to when starting test1。
To enable main thread to be controlled pressure test, main thread setup module 100 is in main line in the embodimentA global mark that enables is used for the beginning and end that control pressure is tested defined in journey, and the overall situation enables mark and is set to 1 testStart, overall situation enable mark, which is set to 0 test, to be terminated.Then main thread setup module 100 sets the tables of data, every for needing to filterThe number of times that the PID of individual tables of data and each filter table PID needs are filtered, global enable mark is set to 1 and starts to survey after settingExamination.
Further, for convenience of testing, the tables of data that main thread setup module 100 sets needs to filter is pat table (programContingency table), SDT tables (service describing table), three tables of data of NIT tables (network information table).
Sub-line journey setup module 200, one group of global aray variable mark defined in sub-line journey, global aray variable markFor recording the number of times that each tables of data PID is filtered to, enable sub-line journey if mark is set to 1 if the overall situation and start to filter tables of dataPID, be filled into and once then record once.
Due to that will be filtered repeatedly for each tables of data, and the number of times being filled into meets and requires that tables of data test is just calculatedPass through, to avoid the insecure problem of test result, the one group of global array defined in sub-line journey of sub-line journey setup module 200 becomesAmount mark, global aray variable mark is used for recording the number of times that each tables of data PID is filtered to, thus by each tables of dataThe number of times for being filled into PID is recorded and accurately judged.
PID filtering times detection module 300, main control line journey is according to each data in setting cycle period detection sub-line journeyThe number of times that table PID is filtered to, if the number of times that each tables of data PID is filtered to meets setting compared with the number of times for needing to filterScope, then tables of data pressure test passes through.
After sub-line journey starts filtering tables of data PID, to save the testing time, PID filtering times detection module 300 is controlledThe number of times that main thread is filtered to according to each tables of data PID in setting cycle period detection sub-line journey, grasps PID mistake in real timeFilter situation.In sub-line journey filter process, if the number of times that each tables of data PID is filtered to is full compared with the number of times for needing to filterSufficient setting range, then tables of data pressure test passes through.
Further, setting cycle period, which is less than main thread fixation duration divided by all tables of data PID, needs the total of filteringNumber of times.
Setting range is to be not less than to need the 95% of number of times.
Terminate module 400 is tested, detecting all tables of data pressure tests if main thread marks overall situation enable if0 is set to by 1 immediately, terminates test and demux pressure tests passes through.
In main thread detection process, if detecting all tables of data pressure tests all meets requirement, to demux pressureTest passes through, and the overall situation is enabled mark and is set to 0 by 1 immediately by the test main control line journey of terminate module 400, terminates test.ThusTest is just completed after all tables of data pressure tests all meet requirement, test is completed again after terminating without waiting for fixed duration.
The set top box demultiplexer pressure testing system, main thread setup module 100 is marked in global enable of main thread definitionNote, sets the number of times for needing the tables of data filtered, the PID of each tables of data and each filter table PID needs to filter, sub-line journeySetup module 200 defines one group of global aray variable in sub-line journey and records the number of times that each tables of data PID is filtered to, oftenThe number of times that individual tables of data PID is filtered to meets setting range compared with the number of times for needing to filter, then the tables of data pressure testPass through, the main control line journey of PID filtering times detection module 300 is according to each tables of data in setting cycle period detection sub-line journeyThe number of times that PID is filtered to, test terminate module 400 detects all tables of data pressure tests in main thread and passed through then by the overall situationEnable mark is set to 0 demux pressure test by 1 immediately and passed through, and terminates test, can thus terminate to survey after test passes throughExamination, it is not necessary to wait duration to be fixed, and testing result is accurate, it is with a high credibility, greatly meet test request.
These are only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit andAny modification, equivalent and improvement for being made within principle etc., should be included within the scope of the present invention.