CN106844268A - A kind of USB device test system, method of testing and test device - Google Patents

A kind of USB device test system, method of testing and test device Download PDF

Info

Publication number
CN106844268A
CN106844268A CN201710081537.9A CN201710081537A CN106844268A CN 106844268 A CN106844268 A CN 106844268A CN 201710081537 A CN201710081537 A CN 201710081537A CN 106844268 A CN106844268 A CN 106844268A
Authority
CN
China
Prior art keywords
usb
measured
main frame
test
controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710081537.9A
Other languages
Chinese (zh)
Inventor
黄伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Original Assignee
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd, Shenzhen Yihua Financial Intelligent Research Institute filed Critical Shenzhen Yihua Computer Co Ltd
Priority to CN201710081537.9A priority Critical patent/CN106844268A/en
Publication of CN106844268A publication Critical patent/CN106844268A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/38Universal adapter
    • G06F2213/3812USB port controller

Abstract

The embodiment of the invention discloses a kind of USB device test system, method of testing and test device.The system includes:Controller and main frame to be measured;The controller includes switching circuit, the first USB interface for being connected with USB device, the communication interface for the secondary USB interface that is connected with the main frame to be measured and for being connected with the main frame to be measured;First USB interface, secondary USB interface and the communication interface are connected with the switching circuit, and test every time is only had first USB interface and is connected with a secondary USB interface by the switching circuit;The main frame to be measured is connected with the controller by the communication interface and is communicated.By technical scheme, extensive automatic test can be realized, improve testing efficiency, improve the accuracy of test result.

Description

A kind of USB device test system, method of testing and test device
Technical field
The present embodiments relate to computer technology, more particularly to a kind of USB device test system, method of testing and test Device.
Background technology
With increasing product using USB (Universal Serial Bus, USB) interfaces with it is outer Boundary's equipment is communicated, in order to ensure USB device can be recognized normally, it usually needs carry out substantial amounts of USB functional tests, i.e., Needs test the reliability of enumerating of USB device under various operating systems, therefore, workload is huge.
At present, USB device method of testing be it is most of be, by manual testing, plug USB device to be repeated manually, to connect Extraneous host computer system is tested.Because test job amount is huge, and multiple USB devices need to carry out under different operating system Test is repeated several times, therefore, the method for manual testing can cause the low problem of testing efficiency, and manual testing cannot to be advised greatly The reperformance test of mould so that the testing time under individual system does not reach expection, so as to test result can be caused inaccurate The problems such as.
The content of the invention
The embodiment of the present invention provides a kind of USB device test system, method of testing and test device, with realize it is extensive from Dynamicization is tested, and improves testing efficiency, improves the accuracy of test result.
In a first aspect, the embodiment of the invention provides a kind of USB device test system, the system includes controller and to be measured Main frame;
The controller include switching circuit, for be connected with USB device the first USB interface, for be measured with described The connected secondary USB interface of main frame and the communication interface for being connected with the main frame to be measured;
First USB interface, secondary USB interface and the communication interface are connected with the switching circuit, every time Test is only had first USB interface and is connected with a secondary USB interface by the switching circuit;
The main frame to be measured is connected with the controller by the communication interface and is communicated.
Further, the number of first USB interface, secondary USB interface, communication interface and main frame to be measured is many It is individual.
Further, the main frame to be measured includes the main frame to be measured of various control system.
Further, the controller also includes interactive module, and the interactive module is connected with the switching circuit.
Second aspect, the embodiment of the present invention additionally provides a kind of USB device method of testing, and the method includes:
The link order that controller sends according to the main frame cycle to be measured being currently accessed is connected the main frame to be measured and is set with USB It is standby;
The main frame to be measured sends and detect after link order and recognize the USB device every time, is recorded according to recognition result Test log, and send the connection that open command disconnects the main frame to be measured and the USB device to the controller;
When the content of the test log of the main frame to be measured being currently accessed reaches pre-conditioned, the main frame to be measured is to the control Device processed sends the switching command next main frame to be measured of connection and is tested with the controller, until all host tests to be measured are complete Finish.
Further, the link order that the controller sends according to the main frame cycle to be measured being currently accessed is treated described in connecting Main frame and USB device are surveyed, including:
The main frame cycle to be measured sends link order to controller;
The controller generates testing and control information according to the link order;
The controller connects the main frame to be measured and USB device according to the testing and control information.
Further, the main frame to be measured sends and detect after link order and recognize the USB device every time, according to identification Result records test log, including:
The main frame to be measured sends acquisition identification information instruction after sending link order every time to the USB device;
If the main frame to be measured receives the identification information that the USB device sends, tested into test log record Work(number of times adds one;
If the main frame to be measured does not get the identification information of USB device transmission in time-out time, in test log Record test crash number of times adds one.
Further, if the main frame to be measured does not get the identification information of USB device transmission in time-out time, Then add one in test log record test crash number of times, including:
If the main frame to be measured does not get the identification information of USB device transmission, the master to be measured in time-out time Machine sends acquisition identification information and instructs to the USB device again;
If the main frame to be measured receives the identification information that the USB device sends, tested into test log record Work(number of times adds one;
If the main frame to be measured does not get the identification information of USB device transmission yet in next time-out time, Test log record test crash number of times adds one.
Further, the controller is to that should have multiple USB devices;
After all host tests to be measured are finished, also include:
The controller switches to next USB device, and repeats above-mentioned all steps, until completing to all USB The test of equipment.
The third aspect, the embodiment of the present invention additionally provides a kind of USB device test device, and the device includes controller and treats Survey main frame;
The controller includes:
Equipment connects module, and the link order for being sent according to the main frame cycle to be measured being currently accessed connects described to be measured Main frame and USB device;
Connection disconnects module, the open command for being sent according to the main frame to be measured disconnect the main frame to be measured with it is described The connection of USB device;
Mian engine changeover module, the switching command for being sent according to the main frame to be measured being currently accessed connects next main frame to be measured Tested with the controller, until all host tests to be measured are finished;
The main frame to be measured includes:
Link order sending module, for periodically sending link order to the controller;
Equipment detects identification module, for sending link order every time after detect and recognize the USB device, according to identification Result records test log;
Open command sending module, for sending open command to the controller after test log is recorded;
Switching command sending module, the content for the test log of the main frame to be measured being currently accessed reaches default bar Part, the main frame to be measured sends switching command to the controller.
Further, the equipment connect module specifically for:
Testing and control information is generated according to the link order;
The main frame to be measured and USB device are connected according to the testing and control information.
Further, the equipment detection identification module includes:
Identification instruction sending submodule, identification letter is obtained for being sent to the USB device after transmission link order every time Breath instruction;
Number of success record sub module, if for receiving the identification information that the USB device sends, in test log Record is successfully tested number of times and plus one;
Frequency of failure record sub module, if the identification information for not getting USB device transmission in time-out time, Add one in test log record test crash number of times.
Further, the frequency of failure record sub module specifically for:
If not getting the identification information of USB device transmission in time-out time, acquisition identification information is sent again and is referred to Make to the USB device;
If receiving the identification information that the USB device sends, it is successfully tested number of times in test log record and plus one;
If not getting the identification information of USB device transmission yet in next time-out time, in test log record Test crash number of times adds one.
Further, the controller is to that should have multiple USB devices;
The controller, also includes:
Equipment handover module, after being finished in all host tests to be measured, switches to next USB device, and repeat Above-mentioned all steps are performed, until completing the test to all USB devices.
The embodiment of the present invention is communicated by the way that main frame to be measured is connected by the communication interface in controller with controller, and The first USB interface that to be used to being connected with USB device, for the secondary USB interface that is connected with the main frame to be measured and it is used for The communication interface being connected with main frame to be measured is connected with the switching circuit in controller, and the first USB interface and secondary USB interface It is joined directly together by switching circuit, make use of main frame to be measured that the excellent of the switching circuit in controller can be controlled by communication interface Point, solves in the prior art because workload is huge caused by manually connection USB device and test main frame, testing efficiency It is low, the problems such as test result is inaccurate, realizes extensive automatic test, improve testing efficiency and improve test result The effect of accuracy.
Brief description of the drawings
Fig. 1 is a kind of structure chart of USB device test system that the embodiment of the present invention one is provided;
Fig. 2 is a kind of structure chart of USB device test system that the embodiment of the present invention two is provided;
Fig. 3 is a kind of structure chart of USB device test system that the embodiment of the present invention three is provided;
Fig. 4 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention four is provided;
Fig. 5 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention five is provided;
Fig. 6 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention six is provided;
Fig. 7 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention seven is provided;
Fig. 8 is a kind of structural representation of USB device test device that the embodiment of the present invention eight is provided.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that, in order to just Part rather than entire infrastructure related to the present invention is illustrate only in description, accompanying drawing.
Embodiment one
Fig. 1 is a kind of structure chart of USB device test system that the embodiment of the present invention one is provided.The system is applicable to The situation of USB device test, the USB device test system that the present embodiment is provided includes:Controller 1 and main frame to be measured 2.
Wherein, controller 1 include switching circuit 11, for be connected with USB device 3 the first usb 12, for treat Survey the connected secondary USB interface 13 of main frame 2 and the communication interface 14 for being connected with main frame to be measured 2;
First usb 12, secondary USB interface 13 and communication interface 14 are connected with switching circuit 11, every time test Only one the first usb 12 is connected by switching circuit 11 with a secondary USB interface 13;
Main frame to be measured 2 is connected with controller 1 by communication interface 14 and is communicated.
Specifically, the secondary USB interface 13 in controller 1 is connected with main frame to be measured 2 respectively with communication interface 14, wherein, Communication interface 14 can be USB interface, or serial ports, and two different numbers can be used between controller 1 and main frame to be measured 2 It is connected according to passage, the data channel being connected with communication interface 14 is used to be communicated between main frame to be measured 2 and controller 1, and with The communication that the connected data channel of secondary USB interface 13 is used between main frame to be measured 2 and USB device 3, switching circuit 11 can be wrapped Data selector and microprocessor are included, wherein, data selector is used for the gating of circuit, and microprocessor is used for according to master to be measured The instruction controlled data selector that machine 2 sends.Examining system is configured with main frame to be measured 2, optionally, examining system is Windows operating systems.
Exemplary, main frame to be measured 2 passes on gating control instruction by communication interface 14 to controller 1, in controller 1 Switching circuit 11 is controlled whether to connect the first usb 12 and is connected with the of USB device according to the gating control instruction for receiving Two usb 1s 3.It is indirectly connected to by controller 1 between main frame to be measured 2 and USB device 3, it is advantageous in that can be by control Device 1 realizes the gating between main frame to be measured 2 and USB device, because the gating control process of controller 1 can be controlled by main frame to be measured 2 System is determined, thus can realize automation USB tests, testing efficiency is improved, to reach the purpose of large scale test USB device.
The technical scheme of the present embodiment, is carried out by the way that main frame to be measured is connected by the communication interface in controller with controller Communication, and the first USB interface, the secondary USB interface and use for being connected with main frame to be measured that are connected with USB device will be used for It is connected with the switching circuit in controller in the communication interface being connected with main frame to be measured, and the first USB interface and secondary USB interface It is joined directly together further through switching circuit, make use of main frame to be measured that the switching circuit in controller can be controlled by communication interface Advantage, solves in the prior art because workload is huge caused by manually connection USB device and test main frame, test effect The problems such as rate is low, test result is inaccurate, realizes extensive automatic test, improves testing efficiency and improves test result Accuracy effect.
Embodiment two
Fig. 2 is a kind of structure chart of USB device test system that the embodiment of the present invention two is provided, and the present embodiment is to above-mentioned The structure and the course of work of the USB device test system in embodiment are further elaborated, and specifically meet a USB The number of mouth, secondary USB interface, communication interface and main frame to be measured is further optimized for multiple.
As shown in Fig. 2 the first USB interface includes 3 USB interfaces, can be respectively used to be connected with 3 USB devices, second USB interface also includes 3 USB interfaces, can be respectively used to be connected with 3 main frames to be measured, it is preferred that main frame to be measured includes various behaviour Make the main frame to be measured of system, for example, the first main frame to be measured 21 corresponds to XP systems, the second main frame to be measured 22 corresponds to 32 win7 System, the 3rd main frame to be measured 23 correspond to 64 win8 systems.Communication interface includes that first the 141, second communication of communication interface connects Mouth 142 and third communication interface 143.
Specifically, the first USB device 31 is connected with the first equipment usb 1 21 in controller 1, the second USB device 32 It is connected with the second equipment usb 1 22, the 3rd USB device 33 is connected with the 3rd equipment usb 1 23;First main frame to be measured 21 Be connected with the first host USB interface 131 and the first communication interface 141 in controller 1 respectively, the second main frame to be measured 22 respectively with Second host USB interface 132 is connected with the second communication interface 142, the 3rd main frame to be measured 23 and the 3rd host USB interface 133 and Third communication interface 143 is connected.
Optionally, when a test is begun, the switching circuit 11 in controller 1 can be given tacit consent to the first main frame to be measured of gating 21, the first main frame to be measured 21 controls the gating of switching circuit 11 by the first communication interface 141, for example, when the first main frame to be measured 21 when sending link order, then switching circuit 11 connects the first main frame USB and connects according to link order and default configuration parameter The equipment usb 1 21 of mouth 131 and first, that is, connected the first main frame to be measured 21 and the first USB device 31, wherein, it is default to match somebody with somebody Putting parameter can include needing the kind of USB device numbering and quantity, test interval, testing time and the test system tested Class, after single is completed, the first main frame to be measured 21 controls switching circuit 11 to disconnect the first main frame by the first communication interface 141 The connection of the equipment usb 1 21 of usb 1 31 and first, after the default testing time of retest, switching circuit 11 is according to the The switching command that one main frame to be measured 21 sends gates the second communication interface 142, that is, gate the second main frame to be measured 22 and repeat above-mentioned Process, until the main frame to be measured corresponding to the species of all test systems chosen is completed, the gating of switching circuit 11 the Two equipment usb 1s 22, that is, gate the second USB device 32 and tested, and is repeated in above-mentioned all processes, until three USB device is completed.
Set multiple first USB interfaces, secondary USB interface, communication interface and main frame to be measured to be advantageous in that, can pass through Controller switching circuit carries out selective connection, different in multiple main frames to be measured so as to the enumerating for realizing USB device is tested Retest under kinds System environment can not only improve the accuracy of test result, also improve testing efficiency, realize The function of extensive automatic test.
The technical scheme of the present embodiment, by setting multiple first USB interfaces, secondary USB interface, communication interface and many Individual main frame to be measured, and then multiple USB devices can respectively be tested by controller, make use of controller to adjust switch The advantage of switching, solve in the prior art because caused by manually connection USB device and test main frame workload it is huge, The problems such as testing efficiency is low, test result is inaccurate, realizes extensive automatic test, improves testing efficiency and improve and survey The effect of the accuracy of test result.
Embodiment three
Fig. 3 is a kind of structure chart of USB device test system that the embodiment of the present invention three is provided, and the present embodiment is to above-mentioned The structure and the course of work of the controller in embodiment are further elaborated.Controller can further be optimized for also including Interactive module.
Interactive module may include display screen and keypad, preferably comprise touch-screen, for showing configuration information and survey Test result, and realize setting of the user to controller parameter.
As shown in figure 3, interactive module 15 is connected with switching circuit 11, interactive module 15 is touch-screen, by interactive module 15 configuration parameters for setting can include the USB device numbering and quantity, test interval, testing time and the survey that need to be tested The species of test system, it is exemplary, before being tested, USB device 3 and main frame to be measured 2 are passed through into the first USB interface respectively 12 and the upper controller 1 of the connection of secondary USB interface 13 in switching circuit 11, meanwhile, interactive module 15 receives the configuration ginseng of input Count and send into switching circuit 11, switching circuit 11 can determine the gating of circuit according to the configuration parameter, main frame to be measured 2 also leads to Cross communication interface 14 and secondary USB interface 13 is connected with switching circuit 11, the individual host in completing to main frame to be measured 2 every time Test when, switching command is sent to controller 1 by communication interface 14, control the first USB interface with by switching circuit 11 Gating between 12 and secondary USB interface 13, until completing the test to USB device 3.
For example, it is 3 to be set to need the USB device quantity tested by configuration parameter by interactive module, including 1 Number USB device, No. 2 USB devices and No. 3 USB devices, test interval are 5s, and testing time is 100 times, the kind of test system Class be XP systems, 32 win7 systems and 64 win8 systems, wherein, these USB devices be respectively with the first USB interface The connected USB device of first three interface, and test system is located on different main frames to be measured respectively, after being provided with, according to be measured The control information that main frame sends determines the gating of switching circuit in controller, and being spaced 5s after single test terminates is carried out next time Test, and the testing time of each main frame to be measured corresponding to single USB device is 100 times, that is, be just switched to after testing 100 times Next main frame to be measured, and judge whether current main frame to be measured is last main frame by the configuration parameter, and judge to work as Before the USB device tested whether be last equipment, if so, then discriminating test is finished, and test result is included In interactive module;If it is not, then continuing to carry out gating test in sequence, and test result is included in interactive module in real time.
In the present embodiment, by setting interactive module in the controller so that controller can according to the parameter of user configuring, The main frame species to be measured of test required for the USB device and each USB device of test needed for being dynamically selected, so as to improve The flexibility of test is improve while testing efficiency, Consumer's Experience is improved.
Example IV
Fig. 4 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention four is provided.The system is applicable In the situation of USB device test, the method can be performed by USB device test device, and the device can be by hardware and/or software Composition, and can typically be integrated in USB device test system.Specifically include as follows:
The link order that S410, controller send according to the main frame cycle to be measured being currently accessed connects main frame to be measured and USB Equipment.
Preferably, the transmission cycle can be 5s, i.e., a link order is sent per 5s, and controller connects according to the link order The logical main frame to be measured and USB device so that be connected between main frame to be measured and USB device.
Exemplary, after the main frame to be measured being currently accessed sends link order to controller, controller refers to according to the connection Order generation testing and control information, the circuit for selecting to connect between main frame to be measured and USB device by testing and control information.
Main frame to be measured is connected according to link order to be advantageous in that with USB device so that between USB device and main frame to be measured Connection automation, intelligent, without by manually carrying out plug connection, so as to shorten the testing time, improve testing efficiency, Also for extensive enumeration test provides condition.
S420, main frame to be measured send and detect after link order and recognize USB device every time, are recorded according to recognition result and tested Daily record, and send the connection that open command disconnects main frame to be measured and USB device to controller.
Specifically, connecting after main frame to be measured and USB device, the Host Detection to be measured simultaneously recognizes USB device, according to USB Agreement completes answering, and result according to response recognizes USB device, so that judge whether USB device recognizes successfully, and will Recognition result is write in the daily record of main frame to be measured, it is preferred that while writing the result into host log to be measured, also will test Result is sent to controller, and a test log is re-recorded in the controller.Complete test log record after, main frame to be measured to Controller sends the open command opposite with link order, and such as link order is 1, then open command is 0.Controller is according to connecing The open command of receipts disconnects the circuit connection between main frame to be measured and USB device.Break-make is to complete once to test, and is recorded Test result, so that whether test result automatic decision USB device that can be in test log is qualified, realizes automation and surveys Examination USB device.
S430, when the content of the test log of the main frame to be measured being currently accessed reaches pre-conditioned, main frame to be measured is to control Device sends the switching command next main frame to be measured of connection and is tested with controller, until all host tests to be measured are finished.
Preferably, the pre-conditioned testing time that could be arranged to is 100 times, i.e., when test result in the content of test log When having 100, then judge that the main frame to be measured being currently accessed has been completed to USB device, can switch to next main frame to be measured after It is continuous to be tested, therefore, when existing 100 test log contents, main frame to be measured sends switching command, control from trend controller Device processed generates testing and control information according to the switching command, and next main frame to be measured and controller are connected according to the testing and control information Between circuit, until all main frames to be measured are all completed.
So set and be advantageous in that, can be come the main frame to be measured that automatic decision is currently accessed according to the content of test log It is no to be completed, so as to be automatically performed the switching of main frame to be measured, testing efficiency is improve, and USB device can be automatically performed and exist Test in multiple main frames to be measured, realizes extensive automatic test, the multiple survey to USB device in a main frame to be measured Examination also improves the accuracy of test result.
The technical scheme of the present embodiment, is gated according to the instruction of main frame to be measured by controller to circuit, controls USB Break-make between equipment and main frame to be measured, and judged to test whether to complete according to the test result recorded in test log, so that Solve in the prior art because workload is huge, testing efficiency is low caused by manually connection USB device and test main frame, The problems such as test result is inaccurate, realizes extensive automatic test, improves testing efficiency and improves the standard of test result The effect of true property.
Embodiment five
Fig. 5 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention five is provided.It is more than the present embodiment State and optimize based on embodiment, there is provided preferred USB device method of testing, specifically, by controller according to currently connecing The link order that the main frame cycle to be measured for entering sends is connected main frame to be measured and is further optimized for USB device, including:Main frame to be measured Cycle sends link order to controller;Controller generates testing and control information according to link order;Controller is controlled according to test Information processed connects main frame to be measured and USB device.
S510, main frame to be measured send link order to controller.
Specifically, main frame to be measured can send link order to controller when detecting and being connected with controller, wherein, even It can be the binary message for being different from open command to connect instruction, and the purpose for sending link order is to control controller to connect to treat The circuit surveyed between main frame and USB device, in order to subsequently carry out USB device test.
S520, controller generate testing and control information according to link order.
Specifically, testing and control information can be binary control signal.Preferably, it is used to control circuit in controller Gating is data selector, and data selector needs to complete the break-make control of circuit according to binary control signal, so that Control signal is provided subsequently to implement the connection between main frame to be measured and USB device.
S530, controller connect main frame to be measured and USB device according to testing and control information.
Testing and control information is the signal of specific control connecting and disconnecting of the circuit in controller, and the testing and control information can be according to control In device be used for control circuit gate specific chip it is different and different.
Exemplary, the chip for controlling circuit to gate is used in controller for 4 select 1 data selector, if testing and control is believed It is " 00 " to cease, then connect input and the first output end, and input is connected with USB device, and the first output end is treated with first Survey main frame to be connected, thus USB device and the first main frame to be measured be switched on when input and the first output end is connected,
S540, main frame to be measured send and detect after link order and recognize USB device every time, are recorded according to recognition result and tested Daily record, and send the connection that open command disconnects main frame to be measured and USB device to controller.
When disconnecting with connecting and being connected, testing and control information is generated, master to be measured is disconnected according to testing and control information The connection of machine and USB device, it is preferred that a hanging output end can be reserved in data selector and is connected as when disconnecting Port, if for example selecting the 4th output port in 1 data selector as hanging port using 4, be not connected to any main frame to be measured, If testing and control information is " 11 ", the USB device port hanging be connected, that is, be equal to disconnect USB device with it is to be measured Connection between main frame.
S550, wait Preset Time.
Preferably, Preset Time can be 5s, may there is reaction after being disconnected with main frame to be measured due to USB device Time difference, if tested at once next time, test result may be made inaccurate, wait Preset Time to be advantageous in that, can To ensure that main frame to be measured is just tested after being fully disconnected with USB device next time, so as to improve the accuracy of test result.
S560, that whether the content of the test log of the main frame to be measured being currently accessed reaches is pre-conditioned, if so, then performing S570;If it is not, then performing S510.
Whether S570, all main frames to be measured of detection are completed, if then performing S590, if it is not, then performing S580.
S580, main frame to be measured send the next main frame to be measured of switching command connection to controller and controller is tested.
S590, test terminate.
The technical scheme of the present embodiment, the link order sent according to the main frame cycle to be measured by controller generates test control Information processed, the break-make between main frame to be measured and USB device is completed according to testing and control information, realize raising testing efficiency and Improve the effect of the accuracy of test result.
Embodiment six
Fig. 6 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention six is provided.It is more than the present embodiment State and optimize based on each embodiment, there is provided preferred USB device method of testing, specifically, main frame to be measured is sent out every time Send and detect after link order and recognize USB device, recording test log according to recognition result is further optimized for including:Master to be measured Machine sends acquisition identification information instruction after sending link order every time to USB device;If main frame to be measured receives USB device transmission Identification information, then be successfully tested number of times and plus one in test log record;If main frame to be measured does not get USB in time-out time The identification information that equipment sends, then add one in test log record test crash number of times.
The link order that S610, controller send according to the main frame cycle to be measured being currently accessed connects main frame to be measured and USB Equipment.
S620, main frame to be measured send acquisition identification information instruction after sending link order every time to USB device.
Preferably, after USB device connects main frame to be measured, that is, it is powered on, main frame to be measured can just detect USB device and connect Enter, instructed to USB device so as to send acquisition identification information according to usb protocol, whether can with testing the USB device being currently accessed It is identified.
Whether S630, main frame to be measured receive the identification information of USB device transmission in time-out time, if so, then performing S640;If it is not, then performing S650.
Preferably, time-out time can be preset as 5s, specifically, main frame to be measured sends according to usb protocol to USB device obtaining After taking identification information instruction, if the response message of USB device transmission, the response message are received within default time-out time Be specifically as follows the identification information of USB device, including the VID of the USB device (vendor identification, supplier knows Other code) and PID (productidentification, product ID).The purpose of the identification information that detection USB device sends Be to judge whether USB device can be identified by main frame to be measured, i.e. testing whether successfully to USB device.
S640, it is successfully tested number of times and plus one in test log record.
When main frame to be measured receives the identification information of USB device transmission in time-out time, illustrate that USB device is tested into Work(, then being successfully tested on number of times in test log Jia one, in order to statistics subsequently to USB device test result and sentence It is disconnected.
S650, test log record test crash number of times add one.
If main frame to be measured does not receive the identification information of USB device transmission in time-out time, illustrate that USB device is tested Failure, it is necessary to Jia one on test crash number of times in test log, in order to subsequently to the statistics of USB device test result with Judge.Number of success is recorded in test log to be advantageous in that with the frequency of failure, can easily draw USB device current The final result tested under the mainframe system environment to be measured for accessing, and the test day that multiple enumeration test is recorded under same system Will causes that test result is more accurate, improves the accuracy of test.
Preferably, if main frame to be measured does not get the identification information of USB device transmission, main frame to be measured in time-out time Acquisition identification information is sent again to instruct to the USB device;If main frame to be measured receives the identification letter that the USB device sends Breath, then be successfully tested number of times and plus one in test log record;If main frame to be measured does not get USB yet in next time-out time The identification information that equipment sends, then add one in test log record test crash number of times.The knowledge of USB device transmission is not being got Send to obtain identification information and instruct again in the case of other information and be advantageous in that, can effectively prevent because of main frame to be measured or USB Equipment is likely to occur the erroneous judgement of test result caused by the slow situation of reaction, improves the accuracy of test result.
S660, the connection that open command disconnection main frame to be measured and USB device are sent to controller.
S670, when the content of the test log of the main frame to be measured being currently accessed reaches pre-conditioned, main frame to be measured is to control Device sends the switching command next main frame to be measured of connection and is tested with controller, until all host tests to be measured are finished.
The technical scheme of the present embodiment, by the way that after connection main frame to be measured with USB device, main frame to be measured is to USB every time Equipment sends and obtains identification information instruction, and detects whether to receive the identification information of USB device transmission in time-out time, enters And number of success and the frequency of failure are recorded in test log, test the test log that obtains and judge USB device with multiple Final testing result, realizes the effect of the accuracy for improving test result.
Embodiment seven
Fig. 7 is a kind of schematic flow sheet of USB device method of testing that the embodiment of the present invention seven is provided.It is more than the present embodiment State and optimize based on each embodiment, there is provided preferred USB device method of testing, specifically, preferably controller correspondence There are multiple USB devices, be further optimized for after all host tests to be measured are finished, also include:Controller switches to next USB device, and above-mentioned all steps are repeated, until completing the test to all USB devices.
The link order that S710, controller send according to the main frame to be measured being currently accessed connects main frame to be measured and USB device.
S720, main frame to be measured send and detect after link order and recognize USB device every time, are recorded according to recognition result and tested Daily record, and send the connection that open command disconnects main frame to be measured and USB device to controller.
S730, wait Preset Time.
S740, that whether the content of the test log of the main frame to be measured being currently accessed reaches is pre-conditioned, if so, then performing S750;If it is not, then performing S710.
Whether S750, all main frames to be measured of detection are completed, if then performing S770, if it is not, then performing S760.
S760, main frame to be measured send the next main frame to be measured of switching command connection to controller and controller is tested.
Whether S770, all USB devices of detection are completed, if then performing S790, if it is not, then performing S780.
Optionally, the configuration parameter by pre-setting can determine whether whether the USB device being currently accessed is last Equipment, if the USB device being currently accessed is last equipment, illustrates that all USB devices are completed, and otherwise explanation is gone back It is not completed.
Exemplary, when order of the acquiescence according to USB device numbering from small to large is tested, then preferably can be with root Whether it is that the maximum of all preset numbers is completed detecting whether all USB devices according to the numbering of current USB device, If the numbering of current USB device is maximum, illustrate that all USB devices are completed, if it is not the highest, then explanation is gone back Having USB device to be measured needs to be tested.
So set and be advantageous in that, multiple USB devices can be allowed while being connected with controller, and according to particular order Tested respectively, realized extensive automatic test, improve testing efficiency.
S780, controller switch to next USB device.
Optionally, when it is not last Devices to test to detect the USB device being currently accessed, then need according to default Order switches to next USB device and proceeds test.Wherein, preset order can be USB device numbering from small to large, It can be numbering order from big to small.
Exemplary, when order of the acquiescence according to USB device numbering from small to large is tested, it is necessary to the USB of test Equipment is No. 1, No. 2 and No. 3 USB device, if what is be currently accessed is No. 1 USB device, switches to No. 2 USB devices and proceeds Test;If what is be currently accessed is No. 2 USB devices, switches to No. 3 USB devices and proceed test;And if be currently accessed be No. 3 USB devices, then judge that all USB devices are completed, and perform S790.
S790, test terminate.
The technical scheme of the present embodiment, by accessing multiple USB devices, and detects whether all USB devices have been tested Finish and proceed test judging whether to need to switch to next USB device, it is achieved thereby that large-scale automatic test, And improve testing efficiency.
Embodiment eight
Fig. 8 is a kind of structural representation of USB device test device that the embodiment of the present invention eight is provided.The device is applicable In the situation of USB device test, the device can be made up of hardware and/or software, and can typically be integrated in USB device test system In.With reference to Fig. 8, USB device test device includes:Controller 810 and main frame to be measured 820, are carried out specifically to each module below It is bright.
Controller 810 includes:
Equipment connects module 811, and the link order for being sent according to the main frame cycle to be measured being currently accessed connects described Main frame to be measured and USB device;
Connection disconnects module 812, the open command for being sent according to the main frame to be measured disconnect the main frame to be measured with The connection of the USB device;
Mian engine changeover module 813, the switching command for being sent according to the main frame to be measured being currently accessed connects next to be measured Main frame is tested with the controller, until all host tests to be measured are finished;
Main frame to be measured 820 includes:
Link order sending module 821, for periodically sending link order to the controller;
Equipment detects identification module 822, for sending link order every time after detect and recognize the USB device, according to Recognition result records test log;
Open command sending module 823, for sending open command to the controller after test log is recorded;
Switching command sending module 824, for the test log of the main frame to be measured being currently accessed content reach it is default Condition, the main frame to be measured sends switching command to the controller.
Optionally, equipment connect module 811 specifically for:
Testing and control information is generated according to the link order;
The main frame to be measured and USB device are connected according to the testing and control information.
Optionally, equipment detection identification module 822 includes:
Identification instruction sending submodule, identification letter is obtained for being sent to the USB device after transmission link order every time Breath instruction;
Number of success record sub module, if for receiving the identification information that the USB device sends, in test log Record is successfully tested number of times and plus one;
Frequency of failure record sub module, if the identification information for not getting USB device transmission in time-out time, Add one in test log record test crash number of times.
Optionally, the frequency of failure record sub module specifically for:
If not getting the identification information of USB device transmission in time-out time, acquisition identification information is sent again and is referred to Make to the USB device;
If receiving the identification information that the USB device sends, it is successfully tested number of times in test log record and plus one;
If not getting the identification information of USB device transmission yet in next time-out time, in test log record Test crash number of times adds one.
Optionally, controller 810 pairs should have multiple USB devices;
Controller 810 also includes:
Equipment handover module, after being finished in all host tests to be measured, switches to next USB device, and repeat Above-mentioned all steps are performed, until completing the test to all USB devices.
The said goods can perform the method that any embodiment of the present invention is provided, and possess the corresponding functional module of execution method And beneficial effect.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes, Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also More other Equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (10)

1. a kind of USB device test system, it is characterised in that including controller and main frame to be measured;
The controller include switching circuit, for be connected with USB device the first USB interface, for the main frame to be measured Connected secondary USB interface and the communication interface for being connected with the main frame to be measured;
First USB interface, secondary USB interface and the communication interface are connected with the switching circuit, every time test Only one the first USB interface is connected by the switching circuit with a secondary USB interface;
The main frame to be measured is connected with the controller by the communication interface and is communicated.
2. USB device test system according to claim 1, it is characterised in that first USB interface, the 2nd USB connect The number of mouth, communication interface and main frame to be measured is multiple.
3. USB device test system according to claim 2, it is characterised in that the main frame to be measured includes various control The main frame to be measured of system.
4. the USB device test system according to claim any one of 1-3, it is characterised in that the controller also includes Interactive module, the interactive module is connected with the switching circuit.
5. a kind of USB device method of testing, it is characterised in that including:
The link order that controller sends according to the main frame cycle to be measured being currently accessed connects the main frame to be measured and USB device;
The main frame to be measured sends and detect after link order and recognize the USB device every time, is recorded according to recognition result and tested Daily record, and send the connection that open command disconnects the main frame to be measured and the USB device to the controller;
When the content of the test log of the main frame to be measured being currently accessed reaches pre-conditioned, the main frame to be measured is to the controller Send the switching command next main frame to be measured of connection to be tested with the controller, until all host tests to be measured are finished.
6. method according to claim 5, it is characterised in that the controller is according to the main frame cycle to be measured being currently accessed The link order of transmission connects the main frame to be measured and USB device, including:
The main frame cycle to be measured sends link order to controller;
The controller generates testing and control information according to the link order;
The controller connects the main frame to be measured and USB device according to the testing and control information.
7. method according to claim 5, it is characterised in that the main frame to be measured is detected simultaneously after sending link order every time The USB device is recognized, test log is recorded according to recognition result, including:
The main frame to be measured sends acquisition identification information instruction after sending link order every time to the USB device;
If the main frame to be measured receives the identification information that the USB device sends, it is successfully tested in test log record secondary Number Jia one;
If the main frame to be measured does not get the identification information of USB device transmission in time-out time, in test log record Test crash number of times adds one.
8. method according to claim 7, it is characterised in that if the main frame to be measured is not obtained in time-out time To the identification information that USB device sends, then add one in test log record test crash number of times, including:
If the main frame to be measured does not get the identification information of USB device transmission in time-out time, the main frame to be measured is again The secondary acquisition identification information that sends is instructed to the USB device;
If the main frame to be measured receives the identification information that the USB device sends, it is successfully tested in test log record secondary Number Jia one;
If the main frame to be measured does not get the identification information of USB device transmission yet in next time-out time, in test Log recording test crash number of times adds one.
9. method according to claim 5, it is characterised in that the controller is to that should have multiple USB devices;
After all host tests to be measured are finished, also include:
The controller switches to next USB device, and repeats above-mentioned all steps, until completing to all USB devices Test.
10. a kind of USB device test device, it is characterised in that including controller and main frame to be measured;
The controller includes:
Equipment connects module, and the link order for being sent according to the main frame cycle to be measured being currently accessed connects the main frame to be measured With USB device;
Connection disconnects module, and the open command for being sent according to the main frame to be measured disconnects the main frame to be measured and the USB The connection of equipment;
Mian engine changeover module, the switching command for being sent according to the main frame to be measured being currently accessed connects next main frame to be measured and institute State controller to be tested, until all host tests to be measured are finished;
The main frame to be measured includes:
Link order sending module, for periodically sending link order to the controller;
Equipment detects identification module, for sending link order every time after detect and recognize the USB device, according to recognition result Record test log;
Open command sending module, for sending open command to the controller after test log is recorded;
Switching command sending module, the content for the test log of the main frame to be measured being currently accessed reaches pre-conditioned, institute State main frame to be measured and send switching command to the controller.
CN201710081537.9A 2017-02-15 2017-02-15 A kind of USB device test system, method of testing and test device Pending CN106844268A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710081537.9A CN106844268A (en) 2017-02-15 2017-02-15 A kind of USB device test system, method of testing and test device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710081537.9A CN106844268A (en) 2017-02-15 2017-02-15 A kind of USB device test system, method of testing and test device

Publications (1)

Publication Number Publication Date
CN106844268A true CN106844268A (en) 2017-06-13

Family

ID=59129047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710081537.9A Pending CN106844268A (en) 2017-02-15 2017-02-15 A kind of USB device test system, method of testing and test device

Country Status (1)

Country Link
CN (1) CN106844268A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108519938A (en) * 2018-04-13 2018-09-11 珠海全志科技股份有限公司 Storage chip compatibility test method, system and test main frame

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108519938A (en) * 2018-04-13 2018-09-11 珠海全志科技股份有限公司 Storage chip compatibility test method, system and test main frame

Similar Documents

Publication Publication Date Title
CN101778307B (en) Device for testing functions of set top box
CN102654951B (en) Automatic electronic experimental teaching system
CN206523872U (en) A kind of USB device test system
CN102176140B (en) Remote control controlled area network (CAN) bus testing device and method
CN102087334A (en) High-reliability digital quantity acquisition system
CN101788945B (en) Diagnostic test system and method for electronic system with multiple circuit boards or multiple modules
CN107037230B (en) A kind of active and standby detectable signal processing method and processing device of nuclear power station main pump revolving speed, rack
CN102331569B (en) Intelligent interactive detection apparatus for detection on electric energy meter
CN103354511B (en) A kind of TCN network MVB physical layer consistency test system and method
CN102385378A (en) Offline-detection auxiliary apparatus for new energy automobiles
CN104951421B (en) A kind of automatic numbering of serial bus communication equipment and kind identification method and device
CN101110051A (en) Test approach for debugging serial port function with single board and system thereof
CN106844268A (en) A kind of USB device test system, method of testing and test device
CN104994459B (en) Terminal digital power amplifier configuration method and device
CN206400286U (en) A kind of test system based on hardware in loop equipment
CN106610885A (en) Server failure detection system and method
CN112328101A (en) KVM multi-system joint control method and device based on OSD
CN103376435A (en) Coil testing device and coil testing method
WO2016184170A1 (en) Smi interface device debugging apparatus and method, and storage medium
CN111435143A (en) Universal testing device and method
CN101441590A (en) Mainboard failure diagnosis device and method and mainboard monitoring device and method
CN109581104B (en) Method for testing touch screen of vehicle-mounted entertainment system
CN103645730B (en) A kind of motion control card with self-checking function and detection method
CN205247152U (en) High convenient main website controller
CN101630158A (en) Industrial control system and serial communication method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination