A kind of mobile phone radio frequency test method and system
Technical field
The present invention relates to moving communicating field, in particular a kind of mobile phone radio frequency test method and system.
Background technology
Along with the development of mobile communication technology and improving constantly of people's living standard, the use of mobile phone is more and more universal.Various mobile phones all will pass through various performance tests, and the test of mobile phone radio frequency is wherein the key factor that affects mobile phone communication quality.Therefore,, before mobile phone dispatches from the factory or when mobile communication signal has problems, be necessary mobile phone radio-frequency performance to test.
Existing more common mobile phone radio frequency test macro, as shown in Figure 1, comprise a PC 110, a GPIB card being plugged on described PC, GPIB (industrial instrument bus standard) connecting line 111, a tester 120, as CMU200 or AG8960 etc. (CMU200 and AG8960 are mobile communication testing equipment), a power supply 130.Testing mobile phone 140 is connected with described tester 120 by radio frequency connecting line 112, and is connected with power supply 130 by electric power connection line 113; Described PC 110 uses GPIB connecting line to be connected with described tester 120 by gpib interface, and the mobile phone standard that described radio frequency testing instrument 120 can be corresponding different arranges.
But the mobile phone test system testing efficiency of prior art is low, test macro can only be tested a mobile phone at one time, as need be tested many mobile phones time, just needs multiple test macros simultaneously, and testing cost is high.
Therefore, prior art has yet to be improved and developed.
Summary of the invention
The technical problem to be solved in the present invention is, for the above-mentioned defect of prior art, provides a kind of mobile phone radio frequency test method and system, and it can improve testing efficiency, reduce testing cost.
The technical scheme that technical solution problem of the present invention adopts is as follows:
A kind of mobile phone radio frequency test method, wherein, comprises step:
A, by multiple testers for mobile phone to be measured is tested, be connected with separate unit master control PC by bus;
B, the each tester of initialization and interface equipment;
Whether C, master control PC detect by described bus cycle the mobile phone to be measured being connected with each tester ready;
D, in the time having detected that mobile phone to be measured is ready, the identification number of the ready mobile phone to be measured of automatic acquisition writes in test logic table, and creates and the mobile phone to be measured that writes identification number is tested thread one to one;
E, each test thread of test logic parallel running stipulating according to test logic table, and control each test thread execution one test subroutine corresponding mobile phone to be measured is tested;
In described mobile phone radio frequency test method, create thread pool by main thread, and in each thread pool, can use test subroutine of thread pool timetable function operation;
The variable of described test subroutine is local variable.
Described mobile phone radio frequency test method, wherein, also comprises step after described step e:
F1, each mobile phone test to be measured are complete, and test report is write disc driver by its test thread.。
Described mobile phone radio frequency test method, wherein, also comprises step after described step F 1:
F2, each mobile phone test to be measured are complete, and its test thread shows the test result corresponding with the mobile phone to be measured of described tape identification number by operation interface, and alert is changed this mobile phone to be measured.
Described mobile phone radio frequency test method, wherein, also comprises step after described step F 2:
G, master control PC control the test thread being completed and exit test, and return to step C, carry out successively the Testing And Regulating to next step mobile phone to be measured.
Described mobile phone radio frequency test method, wherein, described bus is gpib bus.
A kind of mobile phone radio frequency test macro, comprises a master control PC, and wherein, it also comprises multiple testers for mobile phone to be measured is tested, and the plurality of tester is connected with described master control PC by bus; Described master control PC comprises:
Initialization module, for the each tester of initialization and interface equipment;
Connection detection module, whether ready for detecting by described bus cycle the mobile phone to be measured being connected with each tester;
Thread creation module, in the time having detected that mobile phone to be measured is ready, the identification number of the ready mobile phone to be measured of automatic acquisition writes in test logic table, and creates and the mobile phone to be measured that writes identification number is tested thread one to one;
Thread execution module, for each tests thread according to the test logic parallel running of test logic table regulation, and controls each test thread execution one test subroutine corresponding mobile phone to be measured is tested.
Described mobile phone radio frequency test macro, wherein, creates thread pool by main thread, and in each thread pool, can use test subroutine of thread pool timetable function operation;
The variable of described test subroutine is local variable.
Described mobile phone radio frequency test macro, wherein, described master control PC further comprises:
Detecting information writing module, complete for each mobile phone test to be measured, test report is write disc driver by its test thread;
Reminding module, complete for each mobile phone test to be measured, its test thread shows the test result corresponding with the mobile phone to be measured of described tape identification number by operation interface, and alert is changed this mobile phone to be measured;
Test thread exits module, for make certain test thread exit test by an instruction.
Described mobile phone radio frequency test macro, wherein, described bus is gpib bus.
Mobile phone radio frequency test method provided by the present invention and system, owing to adopting multiple testers for mobile phone to be measured is tested, be connected with separate unit master control PC by bus, having utilized the multithreading of operating system to realize when single PC controls multiple instruments measures, can on a PC, connect multiple radio frequency testing equipment tests multiple mobile terminals simultaneously, not only can improve testing efficiency, spy can reduce the input to PC simultaneously, has reduced testing cost.
Accompanying drawing explanation
Fig. 1 is mobile phone test system connection diagram in prior art;
Fig. 2 is the mobile phone radio frequency test macro connection diagram that the embodiment of the present invention provides;
Fig. 3 is the mobile phone radio frequency test method flow chart that the embodiment of the present invention provides;
Fig. 4 is the Multi-thread control flow chart that the mobile phone radio frequency test method that provides of the embodiment of the present invention adopts;
Fig. 5 is the mobile phone test system master control PC structured flowchart that the embodiment of the present invention provides.
Embodiment
For making object of the present invention, technical scheme and advantage clearer, clear and definite, developing simultaneously referring to accompanying drawing, the present invention is described in more detail for embodiment.Work as understanding, specific embodiment described herein only, in order to explain the present invention, is not intended to limit the present invention.
A kind of mobile phone radio frequency test macro that the embodiment of the present invention provides, as shown in Figure 2, comprises a master control PC210 and multiple tester 220, and described master control PC210 is connected with described multiple testers 220 by bus.Preferably, described bus adopts gpib bus (General-Purpose Interface Bus general-purpose interface bus), the equipment sum that gpib bus has improved transmission rate and supported simultaneously than Serial Port Line control.Certainly as long as each testing equipment support also can adopt more LAN (local area network (LAN)) bus of the faster support equipment sum of transmission rate to substitute.
Described tester can adopt the tester of CMU200 or AG8960, and each tester 220 connects a mobile phone 240 to be measured.Described system also comprises a multi-channel digital power supply 230, is connected with many mobile phones 240 to be measured, and described multi-channel digital power supply 230 is for providing testing power supply to mobile phone 240 to be measured.
The mobile phone radio frequency test macro of the embodiment of the present invention, forms an Auto-Test System by gpib interface, the automatic test of controllable testing instrument 220 with a separate unit master control PC210.Setting up when mobile phone radio frequency test macro of the present invention, first each testing equipment of choice for use all has general-purpose interface bus, i.e. gpib interface arranges every testing equipment unique GPIB address in this test macro.The master control PC210 using in test macro of the present invention will be equipped with gpib interface card.It and each testing equipment are coupled together to composition Auto-Test System by IEEE488 bus.
In the mobile phone radio frequency test macro of the embodiment of the present invention, the gpib interface card adopting is applicable to PC, by interface, each tester 220 is carried out to programming Control, can realize the GPIB Auto-Test System take master control PC210 as central controller, to realize the test to each mobile phone to be measured.Gpib interface card can directly insert the bus slot of master control PC210, becomes GPIB controller.
Mobile phone radio frequency test macro of the invention process, measures when mainly utilizing the multithreading of operating system to realize single PC to control multiple tester, and as shown in Figures 2 and 3, the mobile phone radio frequency test method of the embodiment of the present invention, mainly comprises the following steps:
Step S310, first, is connected with separate unit master control PC210 by gpib bus for the tester 220 that mobile phone to be measured is tested multiple.And be ready to a multi-channel digital power supply 230, for testing power supply being provided to mobile phone to be measured.
Step S320, the each tester 220 of initialization and interface equipment.And set the parameter of each testing equipment, as GPIB address etc.GPIB address is divided into two parts: the address of the equipment under test between gpib interface board address between one 0~30,1~30.In the time that polylith GPIB card is installed in test macro, just it may be noted that the address of board.For example: two GPIB cards are installed in test macro, and wherein one is made as GPIB0, another piece is GPIB1.If only have a GPIB card, be defaulted as GPIB0; And all testing equipments must have different instrument address in a bus.Instrument address is set on hardware, and different testing equipments has the different methods that instrument address is set.Have plenty of by stirring instrument internal or microswitch below, have plenty of by menu setecting GPIB address is set.After the parameter of the each testing equipment in test macro sets, proceed to next step.
Step S330, each mobile phone 240 to be measured is connected with a tester 220, and the electric power connection line of the mobile phone to be measured of all connections is connected to a multi-channel digital power supply 230.Now, whether the mobile phone to be measured that the main thread in described master control PC210 is connected with each tester by described gpib bus cycle detection is ready, is to connect preparation can test.
Step S340, in the time that the main thread in described master control PC210 has detected that one or more mobile phones to be measured are ready, the identification number of the ready mobile phone to be measured of automatic acquisition writes in test logic table, as identification number ID that gets ready mobile phone to be measured etc. is write in test logic table one by one, and create and write identification number mobile phone to be measured and test one to one thread, as shown in Figure 4, often detected that a mobile phone to be measured connects setup test, host process can create the test thread for this mobile phone to be measured is tested automatically, in Fig. 4, create for to ready the 1st thread that mobile phone to be measured is tested 1, be used for ready the 2nd thread that mobile phone to be measured is tested 2, ... for the thread n that ready n mobile phone to be measured tested, generally n < 30.Then proceed to next step.
Step S350, each test thread of test logic parallel running stipulating according to test logic table, and control each test thread execution one test subroutine corresponding mobile phone to be measured is tested.For example, the mobile phone to be measured which test operator can select write identification number by test logic table is tested, or directly select ready mobile phone to be measured automatically to test, each test thread of the test logic parallel running that can stipulate by test logic table, as shown in Figure 4, thread 1 starts, thread 2 starts ... thread n starts.And each test thread execution one test subroutine is tested corresponding mobile phone to be measured.
In the mobile phone radio frequency test method of the embodiment of the present invention, create Thread Pool (thread pool) by main thread, and in each Thread Pool, can use a test subroutine of Schedule Thread Pool Function (thread pool timetable function) operation.The variable of test subroutine is local variable; And variable refers to the amount that can change at any time in the running of program; Local variable refers in program, the variable that only can access in specific process or function; Therefore, the variable in test subroutine is local variable, can guarantee that variable is independent of each other between each thread.In the present invention, main thread can obtain the attributes such as the Thread ID (Thread Id) of each test program.
Step S360, each mobile phone test to be measured are complete, test report is write disc driver by each test thread, the test of mobile phone to be measured is comprised to electrical parameters measure, battery calibrating, handset identity information etc., automatically its test report is write to corresponding disc driver to store etc. by test thread separately.
Each mobile phone test to be measured is complete, and its test thread shows test results by operation interface, and alert changes this mobile phone to be measured, and this mobile phone to be measured detects completely, and next mobile phone to be measured is changed in prompting.Proceed to next step.
The test thread that S370, main thread control are completed exits test, and returns to step S330, carries out successively the Testing And Regulating to next step mobile phone to be measured.In the present invention, can, by the function in the each test thread of Post Deferred Call To Thread (a kind of program command) instruction operation, therefore can make certain thread exit test by this instruction.In the time that a wait has operated, a worker thread in thread pool will be carried out corresponding call back function.
Therefore, the invention has the advantages that and can use the multiple test subroutines of multiple thread execution, realize the test macro of the many testers of single PC.Test control software described in it in master control PC210 mainly comprises following software function module: as shown in Figure 5,
Initialization module 211, for the each tester of initialization and interface equipment;
Connection detection module 212, whether ready for detecting by described bus cycle the mobile phone to be measured being connected with each tester;
Thread creation module 213, for when having detected that one or more mobile phones to be measured are ready, the identification number of the ready mobile phone to be measured of automatic acquisition writes in test logic table, and creates and write identification number mobile phone to be measured and test one to one thread;
Thread execution module 214, for each tests thread according to the test logic parallel running of test logic table regulation, and controls each test thread execution one test subroutine corresponding mobile phone to be measured is tested.
Detecting information writing module 215, complete for each mobile phone test to be measured, test report is write disc driver by its test thread; The test of mobile phone to be measured is comprised to electrical parameters measure, battery calibrating, handset identity information etc., automatically its test report is write to corresponding disc driver to store etc. by test thread separately.
Reminding module 216, complete for each mobile phone test to be measured, its test thread shows and the described tape identification test result that number mobile phone to be measured is corresponding by operation interface, and alert is changed this mobile phone to be measured;
Test thread exits module 217, for make certain test thread exit test by an instruction.
In sum, the mobile phone radio frequency test method that the embodiment of the present invention provides and system, owing to adopting multiple testers for mobile phone to be measured is tested, be connected with separate unit master control PC by bus, having utilized the multithreading of operating system to realize when single PC controls multiple instruments measures, can on a PC, connect multiple radio frequency testing equipment tests multiple mobile terminals simultaneously, not only can improve testing efficiency, spy can reduce the input to PC simultaneously, has reduced testing cost.
Should be understood that, application of the present invention is not limited to above-mentioned giving an example, and for those of ordinary skills, can be improved according to the above description or convert, and all these improvement and conversion all should belong to the protection range of claims of the present invention.