The test macro of simulation USB hot plug process and device
Technical field
The present invention relates to electronic equipment quality test technical field, particularly relate to a kind of test macro and device of simulating USB hot plug process.
Background technology
At present, with USB (universal serial bus) (universal serial bus, USB) electronic equipment (such as computer) of port gets more and more, USB device is also more and more universal, for ensureing that USB HOST and USB DEVICE can normally work, need the quality of often test USB HOST and USB DEVICE when electronic equipment factory inspection and daily servicing.
USB HOST test refers to that model machine is by OTG line circumscribed USB device equipment (as USB flash disk, USB keyboard/mouse, USB portable hard drive etc.), and operates by being connected with the USB HOST interface of model machine.USB DEVICE test refers to that model machine connects computer equipment, and model machine is operated the data of model machine internal storage region by computer equipment as USB DEVICE.
Generally, USB HOST tests and is undertaken by connecting or pull out OTG connecting line by hand, and USB DEVICE is undertaken by connecting or pull out usb line by hand.But when the quantity needing to carry out USB HOST and the USB DEVICE tested is more, even need manually carry out the connection of up to ten thousand times or pull out the operation of usb line, the dull so frequent operation repeated again makes the test duration longer, and efficiency is lower.
Summary of the invention
Embodiment of the present invention technical matters to be solved is, provides a kind of test macro and device of simulating USB hot plug process, improves the efficiency that USB DEVICE and USB HOST tests.
For solving the problems of the technologies described above, the invention provides a kind of test macro of simulating USB hot plug process, comprise USB external equipment, model machine and computing machine, this test macro also comprises proving installation, and this proving installation comprises a USB DEVICE converting interface, the 2nd USB DEVICE converting interface, a USB HOST converting interface, the 2nd USB HOST converting interface, the first speed-sensitive switch, the second speed-sensitive switch, load module and control module.2nd USB HOST converting interface is connected with this USB external equipment, and is connected with this first speed-sensitive switch, the 2nd USB HOST converting interface successively.2nd USB HOST converting interface is connected with the USB HOST interface of this model machine.2nd USB DEVICE converting interface is connected with the USB interface of this computing machine, and is connected with this second speed-sensitive switch, a USB DEVICE converting interface successively.One USBDEVICE converting interface is also connected with the USB DEVICE interface of this model machine, and this load module is connected with control module, and this control module is also connected with this first speed-sensitive switch and the second speed-sensitive switch respectively.
This load module is used for the setting that testing time is carried out in the setting of operation response personnel.
The testing time that this control module is used for setting according to this load module controls this first speed-sensitive switch or the second speed-sensitive switch break-make, to control the connection of a USB HOST converting interface and the 2nd USB HOST converting interface or disconnection or to control connection or the disconnection of a USB DEVICE converting interface and the 2nd USB DEVICE converting interface.
The present invention also provides a kind of proving installation of simulating USB hot plug process, and this proving installation comprises a USB DEVICE converting interface, the 2nd USB DEVICE converting interface, a USB HOST converting interface, the 2nd USB HOST converting interface, the first speed-sensitive switch, the second speed-sensitive switch, load module and control module.2nd USB HOST converting interface is used for being connected with a USB external equipment, and is connected with this first speed-sensitive switch, the 2nd USB HOST converting interface successively.2nd USB HOST converting interface is used for being connected with the USB HOST interface of a model machine.2nd USB DEVICE converting interface is used for being connected with the USB interface of a computing machine, and is connected with this second speed-sensitive switch, a USB DEVICE converting interface successively.One USBDEVICE converting interface is also connected with the USB DEVICE interface of this model machine, and this load module is connected with control module, and this control module is also connected with this first speed-sensitive switch and the second speed-sensitive switch respectively.
This load module is used for the setting that testing time is carried out in the setting of operation response personnel.
The testing time that this control module is used for setting according to this load module controls this first speed-sensitive switch or the second speed-sensitive switch break-make, to control the connection of a USB HOST converting interface and the 2nd USB HOST converting interface or disconnection or to control connection or the disconnection of a USB DEVICE converting interface and the 2nd USB DEVICE converting interface.
A kind of test macro and device of simulating USB hot plug process provided by the invention, by controlling the control realizing the connection/disconnection of USB HOST converting interface and the connection/port of USBDEVICE converting interface to the break-make of a pair speed-sensitive switch, thus simulation USB HOST test and USBDEVICE test.Utilize the present invention, by the manual operation connecting or extract USB line or OTG line of the break-make control simulation of speed-sensitive switch, thus improve the efficiency of USB HOST and USB DEVICE test.
Accompanying drawing explanation
Fig. 1 is a kind of structural representation of simulating the test macro of USB hot plug process in embodiment of the present invention.
Label declaration
Test macro 1
Proving installation 10
One USB DEVICE converting interface 11
2nd USB DEVICE converting interface 12
One USB HOST converting interface 13
2nd USB HOST converting interface 14
First speed-sensitive switch 15
Second speed-sensitive switch 16
Load module 17
Control module 18
Display module 19
USB external equipment 20
Model machine 30
USB HOST interface 31
USB DEVICE interface 32
Computing machine 40
USB interface 41
Embodiment
By describing technology contents of the present invention, structural attitude in detail, realized object and effect, accompanying drawing is coordinated to be explained in detail below in conjunction with embodiment.
Please refer to Fig. 1, be structural representation of simulating the test macro of USB hot plug process a kind of in embodiment of the present invention, this system 1 comprises proving installation 10, USB external equipment 20, model machine 30 and computing machine 40.Wherein, this proving installation 10 comprises USB DEVICE converting interface the 11, the 2nd USB DEVICE converting interface the 12, the one USB HOST converting interface the 13, the 2nd USB HOST converting interface 14, first speed-sensitive switch 15, second speed-sensitive switch 16, load module 17, control module 18 and display module 19.In the present embodiment, this display module 19 is LCD MODULE, and this control module 18 is the microcontroller of a MUC, and this load module 17 can be keyboard.
Wherein, 2nd USB HOST converting interface 14 is connected with this USB external equipment 20, and be connected with the first speed-sensitive switch 15, the 2nd USB HOST converting interface 14 successively, the 2nd USB HOST converting interface 14 is connected with the USB HOST interface 31 of a model machine 30 by USB extended line.2nd USB DEVICE converting interface 12 holds USB interface 41 to be connected by USB extended line with the PC of this computing machine 40, and be connected with the second speed-sensitive switch 16, a USB DEVICE converting interface 11 successively, a USB DEVICE converting interface 11 is also connected with the USB DEVICE interface 32 of this model machine 30 by USB extended line.This load module 17 is connected successively with control module 18 and display module 19, and this control module 18 is also connected with this first speed-sensitive switch 15 and the second speed-sensitive switch 16 respectively.
It is as described below that the test macro 1 of this simulation USB hot plug process carries out the principle of work that USB HOST and USB DEVICE tests.
When needs are tested USB HOST, tester sets the number of times needing test by load module 17, this control module 18 controls this first speed-sensitive switch 15 break-make rapidly according to the testing time that load module 17 sets, to control connection or the disconnection of a USB HOST converting interface 13 and the 2nd USB HOST converting interface 14, and then the operation connecting or disconnect in simulation USB HOST test.
When needs are tested USB DEVICE, tester sets the number of times needing test by load module 17, this control module 18 controls this second speed-sensitive switch 16 break-make rapidly according to the testing time that load module 17 sets, to control connection or the disconnection of a USB DEVICE converting interface 11 and the 2nd USB DEVICE converting interface 12, and then the operation connecting or disconnect in simulation USB DEVICE test.
In the present embodiment, the number of times of needs test of this display module 19 for showing tester and being set by load module 17.
Further, the test macro 1 utilizing this USB to simulate the process of hot plug can carry out the test of USBDEVICE and USB HOST simultaneously, is independent of each other.
A kind of test macro and device of simulating USB hot plug process provided by the invention, by controlling the control realizing the connection/disconnection of USB HOST converting interface and the connection/port of USBDEVICE converting interface to the break-make of a pair speed-sensitive switch, thus simulation USB HOST test and USBDEVICE test.Utilize the present invention, by the manual operation connecting or extract USB line or OTG line of the break-make control simulation of speed-sensitive switch, thus improve the efficiency of USB HOST and USB DEVICE test.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every utilize instructions of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.