CN106844268B - USB equipment testing system, testing method and testing device - Google Patents

USB equipment testing system, testing method and testing device Download PDF

Info

Publication number
CN106844268B
CN106844268B CN201710081537.9A CN201710081537A CN106844268B CN 106844268 B CN106844268 B CN 106844268B CN 201710081537 A CN201710081537 A CN 201710081537A CN 106844268 B CN106844268 B CN 106844268B
Authority
CN
China
Prior art keywords
tested
host
usb
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.)
Active
Application number
CN201710081537.9A
Other languages
Chinese (zh)
Other versions
CN106844268A (en
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/CN106844268B/en
Publication of CN106844268A publication Critical patent/CN106844268A/en
Application granted granted Critical
Publication of CN106844268B publication Critical patent/CN106844268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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 OR 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 OR 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 OR 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Information Transfer Systems (AREA)

Abstract

The embodiment of the invention discloses a USB equipment testing system, a testing method and a testing device. The system comprises: a controller and a host to be tested; the controller comprises a switching circuit, a first USB interface used for being connected with USB equipment, a second USB interface used for being connected with the host to be tested and a communication interface used for being connected with the host to be tested; the first USB interface, the second USB interface and the communication interface are all connected with the switching circuit, and only one first USB interface is connected with one second USB interface through the switching circuit in each test; and the host to be tested is connected with the controller through the communication interface for communication. By the technical scheme, large-scale automatic testing can be realized, the testing efficiency is improved, and the accuracy of the testing result is improved.

Description

USB equipment testing system, testing method and testing device
Technical Field
The embodiment of the invention relates to a computer technology, in particular to a USB equipment testing system, a testing method and a testing device.
Background
With more and more products using USB (Universal Serial Bus ) interfaces to communicate with external devices, in order to ensure that USB devices can be identified normally, a great deal of USB functional tests are usually required, i.e. the enumeration reliability of USB devices needs to be tested under various operating systems, and therefore, the workload is huge.
At present, most USB equipment testing methods are manually tested by repeatedly plugging and unplugging USB equipment manually so as to connect an external host system for testing. Because the testing workload is huge, and a plurality of USB devices need to be repeatedly tested for many times under different operating systems, the manual testing method can cause the problem of low testing efficiency, and the manual testing cannot be used for large-scale repeated testing, so that the testing times under a single system cannot be expected, and the problems of inaccurate testing results and the like can be caused.
Disclosure of Invention
The embodiment of the invention provides a USB equipment testing system, a testing method and a testing device, which are used for realizing large-scale automatic testing, improving the testing efficiency and improving the accuracy of a testing result.
In a first aspect, an embodiment of the present invention provides a USB device testing system, including a controller and a host to be tested;
The controller comprises a switching circuit, a first USB interface used for being connected with USB equipment, a second USB interface used for being connected with the host to be tested and a communication interface used for being connected with the host to be tested;
The first USB interface, the second USB interface and the communication interface are all connected with the switching circuit, and only one first USB interface is connected with one second USB interface through the switching circuit in each test;
And the host to be tested is connected with the controller through the communication interface for communication.
Further, the number of the first USB interface, the second USB interface, the communication interface and the host to be tested is multiple.
Further, the host to be tested comprises the host to be tested of various control systems.
Further, the controller also comprises an interaction module, and the interaction module is connected with the switching circuit.
In a second aspect, an embodiment of the present invention further provides a method for testing a USB device, where the method includes:
the controller is connected with the host to be tested and the USB equipment according to a connection instruction sent by the currently accessed host to be tested periodically;
detecting and identifying the USB equipment after the host to be tested sends a connection instruction each time, recording a test log according to an identification result, and sending a disconnection instruction to the controller to disconnect the host to be tested from the USB equipment;
when the content of the test log of the currently accessed host to be tested reaches a preset condition, the host to be tested sends a switching instruction to the controller to connect the next host to be tested and the controller for testing until all the hosts to be tested are tested.
Further, the controller switches on the host to be tested and the USB device according to a connection instruction periodically sent by the currently accessed host to be tested, including:
periodically sending a connection instruction to the controller by the host to be tested;
the controller generates test control information according to the connection instruction;
And the controller is connected with the host to be tested and the USB equipment according to the test control information.
Further, detecting and identifying the USB device after each time the host to be tested sends a connection instruction, and recording a test log according to an identification result, including:
After each time of sending a connection instruction, the host to be tested sends an instruction for acquiring identification information to the USB equipment;
if the host to be tested receives the identification information sent by the USB equipment, adding one to the test log record test success times;
if the host to be tested does not acquire the identification information sent by the USB equipment within the timeout time, the test log records the number of test failures plus one.
Further, if the host to be tested does not acquire the identification information sent by the USB device within the timeout period, adding one to the test log record of the test failure times, including:
If the host to be tested does not acquire the identification information transmitted by the USB equipment within the timeout time, the host to be tested transmits an instruction for acquiring the identification information to the USB equipment again;
if the host to be tested receives the identification information sent by the USB equipment, adding one to the test log record test success times;
if the host to be tested still does not acquire the identification information sent by the USB device within the next timeout period, the test log records the number of test failures plus one.
Further, the controller corresponds to a plurality of USB devices;
after all the hosts to be tested are tested, the method further comprises the following steps:
And the controller is switched to the next USB device, and all the steps are repeatedly executed until the test of all the USB devices is completed.
In a third aspect, an embodiment of the present invention further provides a USB device testing apparatus, where the apparatus includes a controller and a host to be tested;
the controller includes:
The device connection module is used for connecting the host to be tested and the USB device according to the connection instruction periodically sent by the currently accessed host to be tested;
the connection disconnection module is used for disconnecting the host to be tested and the USB equipment according to a disconnection instruction sent by the host to be tested;
the host switching module is used for switching on the next host to be tested and the controller for testing according to a switching instruction sent by the currently accessed host to be tested until all the hosts to be tested are tested;
The host to be tested comprises:
the connection instruction sending module is used for periodically sending a connection instruction to the controller;
the equipment detection and identification module is used for detecting and identifying the USB equipment after each time of sending the connection instruction, and recording a test log according to the identification result;
the disconnection instruction sending module is used for sending a disconnection instruction to the controller after the test log is recorded;
And the switching instruction sending module is used for sending a switching instruction to the controller when the content of the test log of the currently accessed host to be tested reaches a preset condition.
Further, the device connection module is specifically configured to:
Generating test control information according to the connection instruction;
And switching on the host to be tested and the USB equipment according to the test control information.
Further, the device detection and identification module includes:
The identification instruction sending sub-module is used for sending an identification information acquisition instruction to the USB equipment after sending a connection instruction each time;
The success number recording sub-module is used for recording the success number of the test in the test log and adding one if the identification information sent by the USB equipment is received;
And the failure number recording sub-module is used for recording the test failure number in the test log if the identification information sent by the USB equipment is not acquired within the timeout time.
Further, the failure times recording submodule is specifically configured to:
If the identification information sent by the USB equipment is not obtained within the timeout period, sending an identification information obtaining instruction to the USB equipment again;
If the identification information sent by the USB equipment is received, adding one to the test log record test success times;
if the identification information sent by the USB equipment is not obtained in the next timeout period, the test log records the number of test failures plus one.
Further, the controller corresponds to a plurality of USB devices;
The controller further comprises:
And the device switching module is used for switching to the next USB device after all the hosts to be tested are tested, and repeatedly executing all the steps until the testing of all the USB devices is completed.
According to the embodiment of the invention, the host to be tested is communicated with the controller through the communication interface in the controller, the first USB interface used for being connected with the USB equipment, the second USB interface used for being connected with the host to be tested and the communication interface used for being connected with the host to be tested are connected with the switching circuit in the controller, and the first USB interface and the second USB interface are directly connected through the switching circuit, so that the advantage that the host to be tested can control the switching circuit in the controller through the communication interface is utilized, the problems of huge workload, low testing efficiency, inaccurate testing result and the like caused by manually connecting the USB equipment with the host to be tested in the prior art are solved, and the effects of large-scale automatic testing, improving testing efficiency and improving testing result accuracy are realized.
Drawings
FIG. 1 is a block diagram of a USB device testing system according to a first embodiment of the present invention;
FIG. 2 is a block diagram of a USB device testing system according to a second embodiment of the present invention;
FIG. 3 is a block diagram of a USB device testing system according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a USB device testing method according to a fourth embodiment of the present invention;
FIG. 5 is a flowchart of a USB device testing method according to a fifth embodiment of the present invention;
FIG. 6 is a flowchart of a USB device testing method according to a sixth embodiment of the present invention;
fig. 7 is a flow chart of a USB device testing method according to a seventh embodiment of the present invention;
fig. 8 is a schematic structural diagram of a USB device testing apparatus according to an eighth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a block diagram of a USB device testing system according to a first embodiment of the present invention. The system is applicable to the situation of USB device test, and the USB device test system provided by the embodiment comprises: a controller 1 and a host 2 to be tested.
Wherein, the controller 1 comprises a switching circuit 11, a first USB interface 12 for connecting with the USB device 3, a second USB interface 13 for connecting with the host 2 to be tested, and a communication interface 14 for connecting with the host 2 to be tested;
The first USB interface 12, the second USB interface 13 and the communication interface 14 are all connected with the switching circuit 11, and only one first USB interface 12 is connected with one second USB interface 13 through the switching circuit 11 in each test;
The host 2 to be tested is connected with the controller 1 through the communication interface 14 for communication.
Specifically, the second USB interface 13 and the communication interface 14 in the controller 1 are respectively connected with the host 2 to be tested, where the communication interface 14 may be a USB interface or a serial interface, two different data channels may be used to connect between the controller 1 and the host 2 to be tested, the data channel connected with the communication interface 14 is used to communicate between the host 2 to be tested and the controller 1, the data channel connected with the second USB interface 13 is used to communicate between the host 2 to be tested and the USB device 3, the switching circuit 11 may include a data selector and a microprocessor, where the data selector is used to gate a circuit, and the microprocessor is used to control the data selector according to an instruction sent by the host 2 to be tested. The host computer 2 to be tested is configured with a system to be tested, and optionally, the system to be tested is a windows operating system.
Illustratively, the host 2 to be tested communicates a gating control instruction to the controller 1 through the communication interface 14, and the switching circuit 11 in the controller 1 controls whether to switch on the first USB interface 12 and the second USB interface 13 connected to the USB device according to the received gating control instruction. The host 2 to be tested is indirectly connected with the USB device 3 through the controller 1, and the controller 1 is beneficial in that gating between the host 2 to be tested and the USB device can be realized, and the gating control process of the controller 1 can be controlled and determined by the host 2 to be tested, so that automatic USB test can be realized, the test efficiency is improved, and the purpose of testing the USB device on a large scale is achieved.
According to the technical scheme, the host to be tested is communicated with the controller through the communication interface in the controller, the first USB interface used for being connected with the USB equipment, the second USB interface used for being connected with the host to be tested and the communication interface used for being connected with the host to be tested are connected with the switching circuit in the controller, the first USB interface and the second USB interface are directly connected through the switching circuit, the advantage that the host to be tested can control the switching circuit in the controller through the communication interface is utilized, the problems that in the prior art, due to the fact that the USB equipment is manually connected with the test host manually, the workload is huge, the test efficiency is low, the test result is inaccurate and the like are solved, and the effects of large-scale automatic test, the test efficiency improvement and the test result accuracy improvement are achieved.
Example two
Fig. 2 is a block diagram of a USB device testing system according to a second embodiment of the present invention, where the structure and the working process of the USB device testing system in the foregoing embodiment are further described in detail, specifically, the number of the first USB interface, the second USB interface, the communication interface, and the host to be tested are further optimized to be multiple.
As shown in fig. 2, the first USB interface includes 3 USB interfaces, which may be used to connect with 3 USB devices, respectively, the second USB interface also includes 3 USB interfaces, which may be used to connect with 3 hosts to be tested, preferably, the hosts to be tested include hosts to be tested of multiple operating systems, for example, the first host to be tested 21 corresponds to an XP system, the second host to be tested 22 corresponds to a 32-bit win7 system, and the third host to be tested 23 corresponds to a 64-bit win8 system. The communication interfaces include a first communication interface 141, a second communication interface 142, and a third communication interface 143.
Specifically, the first USB device 31 is connected to the first device USB interface 121 in the controller 1, the second USB device 32 is connected to the second device USB interface 122, and the third USB device 33 is connected to the third device USB interface 123; the first host under test 21 is connected to the first host USB interface 131 and the first communication interface 141 in the controller 1, the second host under test 22 is connected to the second host USB interface 132 and the second communication interface 142, and the third host under test 23 is connected to the third host USB interface 133 and the third communication interface 143.
Optionally, when the test starts, the switching circuit 11 in the controller 1 may gate the first host to be tested 21 by default, the first host to be tested 21 controls the switching circuit 11 to gate through the first communication interface 141, for example, when the first host to be tested 21 sends a connection instruction, the switching circuit 11 communicates the first host USB interface 131 with the first device USB interface 121 according to the connection instruction and a preset configuration parameter, that is, communicates the first host to be tested 21 with the first USB device 31, where the preset configuration parameter may include the number and number of USB devices to be tested, the test interval, the test number and the types of test systems, after the single test is completed, the first host to be tested 21 controls the switching circuit 11 to disconnect the connection between the first host USB interface 131 and the first device USB interface 121 through the first communication interface 141, after the preset test is repeated, the switching circuit 11 gates the second communication interface 142 according to the switching instruction sent by the first host to be tested 21, that is the second host to be tested 22 and repeats the above process until all the selected types of test systems are tested, and the switching circuit 11 is switched off the second device to be tested, that is the second device to be tested 122 is repeated until all the USB devices are tested in sequence.
The device has the advantages that the controller switching circuit can be selectively connected, so that enumeration test of the USB equipment is realized, the accuracy of test results can be improved, the test efficiency is improved, and the function of large-scale automatic test is realized by repeated test under different system environments in the plurality of hosts to be tested.
According to the technical scheme, through the arrangement of the first USB interfaces, the second USB interfaces, the communication interfaces and the hosts to be tested, the controller can be used for testing the USB devices respectively, the advantage that the controller can adjust switch switching is utilized, the problems that in the prior art, due to the fact that the USB devices are manually connected with the test hosts manually, the workload is huge, the testing efficiency is low, the testing result is inaccurate and the like are solved, and the effects of large-scale automatic testing, testing efficiency and accuracy of the testing result are achieved.
Example III
Fig. 3 is a block diagram of a USB device testing system according to a third embodiment of the present invention, where the structure and the working process of the controller in the foregoing embodiment are further described in detail. The controller may be further optimized to also include an interaction module.
The interaction module can comprise a display screen and a key board, preferably a touch screen, and is used for displaying configuration information and test results and realizing the setting of the parameters of the controller by a user.
As shown in fig. 3, the interaction module 15 is connected to the switching circuit 11, the interaction module 15 is a touch screen, the configuration parameters set by the interaction module 15 may include the serial number and the number of USB devices to be tested, the test interval, the test times and the types of test systems, and before the test, the USB device 3 and the host 2 to be tested are connected to the switching circuit 11 in the controller 1 through the first USB interface 12 and the second USB interface 13, respectively, and meanwhile, the interaction module 15 receives the input configuration parameters and sends the configuration parameters to the switching circuit 11, the switching circuit 11 may determine the gating of the circuit according to the configuration parameters, and the host 2 to be tested is further connected to the switching circuit 11 through the communication interface 14 and the second USB interface 13, and when the test of a single host in the host 2 to be tested is completed, the switching instruction is sent to the controller 1 through the communication interface 14, so as to control the gating between the first USB interface 12 and the second USB interface 13 through the switching circuit 11 until the test of the USB device 3 is completed.
For example, the configuration parameters are set to be 3 USB devices to be tested through the interaction module, the number of the USB devices to be tested is 3, the test interval is 5s, the test times are 100 times, the types of the test systems are an XP system, a 32-bit win7 system and a 64-bit win8 system, the USB devices are respectively USB devices connected with the first three interfaces in the first USB interface and are respectively positioned on different to-be-tested hosts, after the configuration is finished, gating of a switching circuit in the controller is determined according to control information sent by the to-be-tested hosts, the next test is performed at an interval of 5s after the single test is finished, the test times of each to-be-tested host corresponding to the single USB device are 100 times, namely, the test is performed for 100 times, whether the current to-be-tested host is the last host is judged through the configuration parameters, whether the current to-be-tested USB device is the last device is judged, and if yes, the test result is judged to be finished, and the test result is displayed in the interaction module; if not, continuing to perform gating test according to the sequence, and displaying the test result in the interaction module in real time.
In this embodiment, by setting the interaction module in the controller, the controller may dynamically select the USB device to be tested and the type of host to be tested required by each USB device according to the parameters configured by the user, thereby improving the testing efficiency and the testing flexibility and improving the user experience.
Example IV
Fig. 4 is a flow chart of a USB device testing method according to a fourth embodiment of the present invention. The system is applicable to the case of USB device testing, and the method can be performed by USB device testing apparatus, which may be composed of hardware and/or software, and which may be generally integrated in a USB device testing system. The method specifically comprises the following steps:
s410, the controller is connected with the host to be tested and the USB equipment according to the connection instruction periodically sent by the host to be tested which is accessed currently.
Preferably, the sending period may be 5s, that is, a connection instruction is sent every 5s, and the controller switches on the host to be tested and the USB device according to the connection instruction, so that the host to be tested is connected with the USB device.
After the currently accessed host to be tested sends a connection instruction to the controller, the controller generates test control information according to the connection instruction, and the circuit between the host to be tested and the USB device is selectively connected through the test control information.
The method has the advantages that the connection between the USB equipment and the host to be tested is automatic and intelligent, and the connection is not needed to be plugged and pulled manually, so that the test time is shortened, the test efficiency is improved, and conditions are provided for large-scale enumeration test.
S420, detecting and identifying the USB equipment after the host to be tested sends the connection instruction each time, recording a test log according to the identification result, and sending a disconnection instruction to the controller to disconnect the connection between the host to be tested and the USB equipment.
Specifically, after the host to be tested and the USB device are connected, the host to be tested detects and identifies the USB device, the response process is completed according to the USB protocol, the USB device is identified according to the result of the response, so as to determine whether the USB device is successfully identified, the identification result is written into the log of the host to be tested, preferably, the result is written into the log of the host to be tested, and at the same time, the test result is sent to the controller, and the test log is recorded again in the controller. After the test log is recorded, the host to be tested sends a disconnection instruction opposite to the connection instruction to the controller, for example, the connection instruction is 1, and the disconnection instruction is 0. And the controller cuts off the circuit connection between the host to be tested and the USB equipment according to the received disconnection instruction. The test is completed once on-off, and the test result is recorded, so that whether the USB equipment is qualified or not can be automatically judged according to the test result in the test log, and automatic test of the USB equipment is realized.
S430, when the content of the test log of the currently accessed host to be tested reaches a preset condition, the host to be tested sends a switching instruction to the controller to connect the next host to be tested and the controller for testing until all the hosts to be tested are tested.
Preferably, the preset condition may be set to 100 times of testing, that is, when the test result in the content of the test log has 100 pieces, it is determined that the currently accessed host to be tested has finished testing the USB device, and the next host to be tested may be switched to continue testing, so when the content of the test log has 100 pieces, the host to be tested automatically sends a switching instruction to the controller, the controller generates test control information according to the switching instruction, and switches on a circuit between the next host to be tested and the controller according to the test control information until all the hosts to be tested have finished testing.
The device has the advantages that whether the currently accessed host to be tested is judged automatically according to the content of the test log, so that the switching of the host to be tested is automatically completed, the test efficiency is improved, the test of the USB equipment in a plurality of hosts to be tested can be automatically completed, the large-scale automatic test is realized, and the accuracy of the test result is improved for the multiple tests of the USB equipment in one host to be tested.
According to the technical scheme, the controller gates the circuit according to the instruction of the host to be tested, controls the on-off between the USB equipment and the host to be tested, and judges whether the test is completed according to the test result recorded in the test log, so that the problems of huge workload, low test efficiency, inaccurate test result and the like caused by manually connecting the USB equipment and the host to be tested in the prior art are solved, and the effects of large-scale automatic test, test efficiency improvement and test result accuracy improvement are realized.
Example five
Fig. 5 is a flowchart of a USB device testing method according to a fifth embodiment of the present invention. The optimization is performed based on the above embodiment, and a preferred method for testing a USB device is provided, specifically, the controller is further optimized to connect the host to be tested and the USB device according to a connection instruction periodically sent by the currently accessed host to be tested, including: periodically sending a connection instruction to the controller by the host to be tested; the controller generates test control information according to the connection instruction; the controller is connected with the host to be tested and the USB equipment according to the test control information.
S510, the host to be tested sends a connection instruction to the controller.
Specifically, the host to be tested can send a connection instruction to the controller when the connection of the controller is detected, wherein the connection instruction can be binary information different from the disconnection instruction, and the purpose of sending the connection instruction is to control the controller to switch on a circuit between the host to be tested and the USB device so as to facilitate the subsequent USB device test.
S520, the controller generates test control information according to the connection instruction.
Specifically, the test control information may be a binary control signal. Preferably, the data selector is used for controlling the gating of the circuit in the controller, and the data selector is required to complete the on-off control of the circuit according to the binary control signal, so as to provide the control signal for the subsequent specific implementation of the connection between the host to be tested and the USB device.
And S530, the controller is connected with the host to be tested and the USB equipment according to the test control information.
The test control information is a signal for specifically controlling the on-off of the circuit in the controller, and can be different according to the specific chip used for controlling the gating of the circuit in the controller.
The chip used for controlling the circuit gating in the controller is a 4-select 1 data selector, if the test control information is '00', the input end is connected with the first output end, the input end is connected with the USB device, the first output end is connected with the first host to be tested, thus the USB device and the first host to be tested are connected when the input end and the first output end are connected,
S540, detecting and identifying the USB equipment after the host to be tested sends the connection instruction each time, recording a test log according to the identification result, and sending a disconnection instruction to the controller to disconnect the connection between the host to be tested and the USB equipment.
When the connection is disconnected, the test control information is generated as the connection is switched on, the connection between the host to be tested and the USB device is disconnected according to the test control information, preferably, a suspended output end can be reserved in the data selector as a port which is switched on when the connection is disconnected, for example, if a fourth output port in the 4-to-1 data selector is used as a suspended port and is not connected with any host to be tested, and if the test control information is 11, the USB device is connected with one suspended port, namely, the connection between the USB device and the host to be tested is equivalent to disconnection.
S550, waiting for a preset time.
Preferably, the preset time may be 5s, and because there may be a reaction time difference after the USB device is disconnected from the host to be tested, if the next test is performed immediately, the test result may be inaccurate, and the waiting for the preset time has the advantage of ensuring that the next test is performed after the host to be tested is completely disconnected from the USB device, thereby improving the accuracy of the test result.
S560, judging whether the content of the test log of the currently accessed host to be tested reaches a preset condition, if so, executing S570; if not, S510 is performed.
S570, detecting whether all the hosts to be tested are tested, if yes, executing S590, and if not, executing S580.
S580, the host to be tested sends a switching instruction to the controller to switch on the next host to be tested and the controller for testing.
S590, ending the test.
According to the technical scheme of the embodiment, the controller generates the test control information according to the connection instruction periodically sent by the host to be tested, and the on-off between the host to be tested and the USB equipment is completed according to the test control information, so that the effects of improving the test efficiency and improving the accuracy of the test result are achieved.
Example six
Fig. 6 is a flowchart of a USB device testing method according to a sixth embodiment of the present invention. The embodiment optimizes based on the above embodiments, and provides a preferred method for testing a USB device, specifically, detecting and identifying a USB device after each time a host to be tested sends a connection instruction, and recording a test log according to an identification result, where the method further optimizes to include: after each time of sending a connection instruction, the host to be tested sends an instruction for acquiring identification information to the USB equipment; if the host to be tested receives the identification information sent by the USB equipment, adding one to the test log record test success times; if the host to be tested does not acquire the identification information sent by the USB equipment within the timeout time, the test log records the number of test failures plus one.
And S610, the controller is connected with the host to be tested and the USB equipment according to the connection instruction periodically sent by the host to be tested which is accessed currently.
S620, after the host to be tested sends the connection instruction each time, sending an instruction for acquiring the identification information to the USB equipment.
Preferably, after the USB device is connected to the host to be tested, the USB device to be tested is powered on, and the host to be tested can detect that the USB device is connected to the USB device, so that an instruction for acquiring identification information is sent to the USB device according to the USB protocol, so as to test whether the currently connected USB device can be identified.
S630, whether the host to be tested receives the identification information sent by the USB equipment within the timeout time, if so, S640 is executed; if not, S650 is performed.
Preferably, the timeout period may be preset to 5s, specifically, after the host to be tested sends an instruction for acquiring the identification information to the USB device according to the USB protocol, whether the response information sent by the USB device is received within the preset timeout period, where the response information may specifically be identification information of the USB device, including VID (vendor identification, vendor identification code) and PID (productidentification, product identification code) of the USB device. The purpose of detecting the identification information sent by the USB device is to judge whether the USB device can be identified by the host to be detected, namely whether the test of the USB device is successful.
S640, recording the test success times in the test log and adding one.
When the host to be tested receives the identification information sent by the USB device within the timeout period, the USB device is successfully tested, and the number of times of test success in the test log is increased by one, so that the subsequent statistics and judgment of the test result of the USB device are facilitated.
S650, recording the test failure times in the test log and adding one.
If the host to be tested does not receive the identification information sent by the USB device within the timeout period, the USB device test failure is indicated, and one is added to the test failure times in the test log so as to facilitate the subsequent statistics and judgment of the USB device test result. The method has the advantages that the final test result of the USB equipment under the current connected host system environment to be tested can be conveniently obtained by recording the success times and the failure times in the test log, and the test log recorded by the test is enumerated for many times under the same system, so that the test result is more accurate, and the test accuracy is improved.
Preferably, if the host to be tested does not acquire the identification information transmitted by the USB device within the timeout period, the host to be tested transmits an instruction for acquiring the identification information to the USB device again; if the host to be tested receives the identification information sent by the USB equipment, adding one to the test log record test success times; if the host to be tested still does not acquire the identification information sent by the USB device within the next timeout period, the test log records the number of test failures plus one. The method has the advantages that the method can effectively prevent erroneous judgment of the test result caused by the condition that the host to be tested or the USB equipment possibly reacts slowly when the identification information sent by the USB equipment is not obtained and the accuracy of the test result is improved.
And S660, sending a disconnection instruction to the controller to disconnect the host to be tested from the USB device.
S670, when the content of the test log of the currently accessed host to be tested reaches a preset condition, the host to be tested sends a switching instruction to the controller to connect the next host to be tested and the controller for testing until all the hosts to be tested are tested.
According to the technical scheme, after the host to be tested and the USB device are connected each time, the host to be tested sends an instruction for acquiring the identification information to the USB device, detects whether the identification information sent by the USB device is received within the timeout time, further records the success times and the failure times in the test log, judges the final test result of the USB device according to the test log obtained by multiple tests, and achieves the effect of improving the accuracy of the test result.
Example seven
Fig. 7 is a flowchart of a USB device testing method according to a seventh embodiment of the present invention. The optimization is performed based on the above embodiments, and a preferred method for testing USB devices is provided, specifically, a preferred controller corresponds to a plurality of USB devices, and after all hosts to be tested are tested, the method further includes: the controller switches to the next USB device and repeatedly executes all the steps until the test of all the USB devices is completed.
S710, the controller is connected with the host to be tested and the USB equipment according to the connection instruction sent by the host to be tested which is accessed currently.
S720, detecting and identifying the USB equipment after the host to be tested sends the connection instruction each time, recording a test log according to the identification result, and sending a disconnection instruction to the controller to disconnect the connection between the host to be tested and the USB equipment.
S730, waiting for a preset time.
S740, judging whether the content of a test log of the currently accessed host to be tested reaches a preset condition, if so, executing S750; if not, S710 is performed.
S750, detecting whether all hosts to be tested are tested, if yes, executing S770, and if not, executing S760.
S760, the host to be tested sends a switching instruction to the controller to switch on the next host to be tested and the controller for testing.
And S770, detecting whether all USB devices are tested, if yes, executing S790, and if not, executing S780.
Optionally, whether the currently accessed USB device is the last device can be judged through preset configuration parameters, if the currently accessed USB device is the last device, the test of all the USB devices is finished, otherwise, the test is not finished.
For example, when testing is performed by default according to the sequence of the serial numbers of the USB devices from small to large, it is preferable to detect whether all the USB devices are tested according to whether the serial numbers of the current USB devices are the maximum values of all the preset serial numbers, if the serial numbers of the current USB devices are the maximum values, it is indicated that all the USB devices are tested, and if not, it is indicated that the USB devices to be tested need to be tested.
The device has the advantages that a plurality of USB devices can be allowed to be connected with the controller at the same time and tested according to a specific sequence, so that large-scale automatic testing is realized, and the testing efficiency is improved.
S780, the controller is switched to the next USB device.
Optionally, when it is detected that the currently accessed USB device is not the last device to be tested, the next USB device needs to be switched to according to the preset sequence to continue the test. The preset sequence may be the sequence from small to large of the serial numbers of the USB devices, or the sequence from large to small of the serial numbers.
For example, when testing is performed according to the sequence of the serial numbers of the USB devices from small to large by default, the USB devices to be tested are the USB devices No. 1, no. 2 and No. 3, and if the currently accessed USB device No. 1 is switched to the USB device No. 2 for continuing the test; if the current access is the USB device No. 2, switching to the USB device No. 3 to continue testing; and if the currently accessed USB device No. 3 is the USB device, judging that all USB devices are tested, and executing S790.
S790, ending the test.
According to the technical scheme, whether the next USB device needs to be switched to be tested is judged by accessing a plurality of USB devices and detecting whether all the USB devices are tested, so that large-scale automatic testing is realized, and the testing efficiency is improved.
Example eight
Fig. 8 is a schematic structural diagram of a USB device testing apparatus according to an eighth embodiment of the present invention. The device can be suitable for the situation of USB equipment test, can be composed of hardware and/or software, and can be generally integrated in a USB equipment test system. Referring to fig. 8, the usb device testing apparatus includes: the controller 810 and the host under test 820 are described in detail below.
The controller 810 includes:
The device connection module 811 is configured to connect the host to be tested and the USB device according to a connection instruction periodically sent by the currently accessed host to be tested;
a connection disconnection module 812, configured to disconnect the connection between the host to be tested and the USB device according to a disconnection instruction sent by the host to be tested;
The host switching module 813 is configured to switch on a next host to be tested and the controller according to a switching instruction sent by a currently accessed host to be tested, until all the hosts to be tested are tested;
the host 820 to be tested includes:
a connection instruction sending module 821 configured to periodically send a connection instruction to the controller;
The device detection and identification module 822 is configured to detect and identify the USB device after each connection instruction is sent, and record a test log according to the identification result;
the disconnection instruction sending module 823 is used for sending a disconnection instruction to the controller after the test log is recorded;
And the switching instruction sending module 824 is configured to send a switching instruction to the controller when the content of the test log of the currently accessed host to be tested reaches a preset condition.
Optionally, the device turn-on module 811 is specifically configured to:
Generating test control information according to the connection instruction;
And switching on the host to be tested and the USB equipment according to the test control information.
Optionally, the device detection and identification module 822 includes:
The identification instruction sending sub-module is used for sending an identification information acquisition instruction to the USB equipment after sending a connection instruction each time;
The success number recording sub-module is used for recording the success number of the test in the test log and adding one if the identification information sent by the USB equipment is received;
And the failure number recording sub-module is used for recording the test failure number in the test log if the identification information sent by the USB equipment is not acquired within the timeout time.
Optionally, the failure times recording submodule is specifically configured to:
If the identification information sent by the USB equipment is not obtained within the timeout period, sending an identification information obtaining instruction to the USB equipment again;
If the identification information sent by the USB equipment is received, adding one to the test log record test success times;
if the identification information sent by the USB equipment is not obtained in the next timeout period, the test log records the number of test failures plus one.
Optionally, the controller 810 corresponds to a plurality of USB devices;
the controller 810 further includes:
And the device switching module is used for switching to the next USB device after all the hosts to be tested are tested, and repeatedly executing all the steps until the testing of all the USB devices is completed.
The product can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A USB device testing method, comprising:
the controller is connected with the host to be tested and the USB equipment according to a connection instruction sent by the currently accessed host to be tested periodically;
detecting and identifying the USB equipment after the host to be tested sends a connection instruction each time, recording a test log according to an identification result, and sending a disconnection instruction to the controller to disconnect the host to be tested from the USB equipment;
When the content of the test log of the currently accessed host to be tested reaches a preset condition, the host to be tested sends a switching instruction to the controller to connect the next host to be tested and the controller for testing until all the hosts to be tested are tested;
Detecting and identifying the USB equipment after the host to be tested sends the connection instruction each time, recording a test log according to the identification result, and comprising the following steps:
After each time of sending a connection instruction, the host to be tested sends an instruction for acquiring identification information to the USB equipment;
if the host to be tested receives the identification information sent by the USB equipment, adding one to the test log record test success times;
if the host to be tested does not acquire the identification information sent by the USB equipment within the timeout time, the test log records the number of test failures plus one.
2. The method according to claim 1, wherein the controller turns on the host to be tested and the USB device according to a connection instruction periodically sent by the currently accessed host to be tested, including:
periodically sending a connection instruction to the controller by the host to be tested;
the controller generates test control information according to the connection instruction;
And the controller is connected with the host to be tested and the USB equipment according to the test control information.
3. The method of claim 1, wherein if the host to be tested does not acquire the identification information sent by the USB device within the timeout period, adding one to the number of test failures recorded in the test log, includes:
If the host to be tested does not acquire the identification information transmitted by the USB equipment within the timeout time, the host to be tested transmits an instruction for acquiring the identification information to the USB equipment again;
if the host to be tested receives the identification information sent by the USB equipment, adding one to the test log record test success times;
if the host to be tested still does not acquire the identification information sent by the USB device within the next timeout period, the test log records the number of test failures plus one.
4. The method of claim 1, wherein the controller corresponds to a plurality of USB devices;
after all the hosts to be tested are tested, the method further comprises the following steps:
And the controller is switched to the next USB device, and all the steps are repeatedly executed until the test of all the USB devices is completed.
5. A USB device testing system for performing the USB device testing method of any one of claims 1-4, comprising a controller and a host under test;
The controller comprises a switching circuit, a first USB interface used for being connected with USB equipment, a second USB interface used for being connected with the host to be tested and a communication interface used for being connected with the host to be tested;
The first USB interface, the second USB interface and the communication interface are all connected with the switching circuit, and only one first USB interface is connected with one second USB interface through the switching circuit in each test;
And the host to be tested is connected with the controller through the communication interface for communication.
6. The USB device testing system of claim 5, wherein the number of the first USB interface, the second USB interface, the communication interface, and the host to be tested are all plural.
7. The USB device testing system of claim 6, wherein the host under test comprises hosts under test of multiple control systems.
8. The USB device testing system of any one of claims 5-7, wherein the controller further comprises an interaction module, the interaction module coupled to the switching circuit.
9. The USB equipment testing device is characterized by comprising a controller and a host to be tested;
the controller includes:
The device connection module is used for connecting the host to be tested and the USB device according to the connection instruction periodically sent by the currently accessed host to be tested;
the connection disconnection module is used for disconnecting the host to be tested and the USB equipment according to a disconnection instruction sent by the host to be tested;
the host switching module is used for switching on the next host to be tested and the controller for testing according to a switching instruction sent by the currently accessed host to be tested until all the hosts to be tested are tested;
The host to be tested comprises:
the connection instruction sending module is used for periodically sending a connection instruction to the controller;
the equipment detection and identification module is used for detecting and identifying the USB equipment after each time of sending the connection instruction, and recording a test log according to the identification result;
the disconnection instruction sending module is used for sending a disconnection instruction to the controller after the test log is recorded;
The switching instruction sending module is used for sending a switching instruction to the controller when the content of the test log of the currently accessed host to be tested reaches a preset condition;
the device detection and identification module comprises:
The identification instruction sending sub-module is used for sending an identification information acquisition instruction to the USB equipment after sending a connection instruction each time;
The success number recording sub-module is used for recording the success number of the test in the test log and adding one if the identification information sent by the USB equipment is received;
And the failure number recording sub-module is used for recording the test failure number in the test log if the identification information sent by the USB equipment is not acquired within the timeout time.
CN201710081537.9A 2017-02-15 2017-02-15 USB equipment testing system, testing method and testing device Active CN106844268B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

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

Family

ID=59129047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710081537.9A Active CN106844268B (en) 2017-02-15 2017-02-15 USB equipment testing system, testing method and testing device

Country Status (1)

Country Link
CN (1) CN106844268B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108519938B (en) * 2018-04-13 2021-12-28 珠海全志科技股份有限公司 Memory chip compatibility test method, system and test host
CN109828880A (en) * 2019-03-28 2019-05-31 中科安信(深圳)科技有限公司 A kind of serial port switching device on 8 × 12 tunnels
CN110489283A (en) * 2019-07-10 2019-11-22 上海闻泰信息技术有限公司 The test device and method of USB interface
CN111737066A (en) * 2020-05-29 2020-10-02 浪潮电子信息产业股份有限公司 USB signal testing system and method
CN112000374B (en) * 2020-07-13 2024-01-02 深圳市智微智能软件开发有限公司 USB touch screen replacement method, device, equipment and medium applied to android system
CN112565746A (en) * 2020-12-30 2021-03-26 杭州视洞科技有限公司 Automatic pressure test method and process for detecting IP address of wired network port of camera
CN112929905A (en) * 2021-01-28 2021-06-08 博为科技有限公司 Wireless network equipment testing method and device
CN113010388B (en) * 2021-03-24 2022-08-19 深圳市领德创科技有限公司 USB flash disk detection method and system
CN113300906B (en) * 2021-04-21 2022-04-15 深圳市精泰达科技有限公司 Automatic switching method and device for PCIe test fixture Lane
CN113254285B (en) * 2021-05-25 2023-02-28 海光信息技术股份有限公司 Combined type testing device, equipment interface testing method and system
CN113238904B (en) * 2021-05-25 2023-04-28 海光信息技术股份有限公司 Interface switching device, interface testing method and interface switching system
CN113868038B (en) * 2021-08-30 2024-06-04 中科可控信息产业有限公司 Signal testing method, device, computer equipment and storage medium
CN114443385A (en) * 2021-12-28 2022-05-06 苏州浪潮智能科技有限公司 Multi-interface testing device and server system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204719468U (en) * 2015-05-13 2015-10-21 深圳市鼎阳科技有限公司 A kind of many testing of equipments management devices
CN206523872U (en) * 2017-02-15 2017-09-26 深圳怡化电脑股份有限公司 A kind of USB device test system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122260A (en) * 2010-01-08 2011-07-13 鸿富锦精密工业(深圳)有限公司 Test device and test method for universal serial bus (USB) port

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204719468U (en) * 2015-05-13 2015-10-21 深圳市鼎阳科技有限公司 A kind of many testing of equipments management devices
CN206523872U (en) * 2017-02-15 2017-09-26 深圳怡化电脑股份有限公司 A kind of USB device test system

Also Published As

Publication number Publication date
CN106844268A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN106844268B (en) USB equipment testing system, testing method and testing device
US6393588B1 (en) Testing of USB hub
EP2661064B1 (en) Method for identifying universal serial bus host, and electronic device thereof
US20090210608A1 (en) KVM switch and operation method thereof
CN108897647B (en) Test system, test method and device
CN102087334A (en) High-reliability digital quantity acquisition system
CN103364650A (en) Testing system and testing method
CN103970628A (en) Automatic detection system and automatic detection method thereof
CN102236378A (en) Method of monitoring connection status of an electronic device and related electronic device
WO2012171304A1 (en) Tty test method and system of mobile terminal
WO2016184170A1 (en) Smi interface device debugging apparatus and method, and storage medium
CN109992551B (en) USB C-type interface information reading method and information reading circuit
TWI420318B (en) A non-intrusive general-purpose common busbar switching device
CN112347017A (en) PS/2 keyboard dual-host plug-in system with LPC bus interface and switching method
CN101377753A (en) Accessory test device and method
CN108681497B (en) CPCI bus testing device and method
US20050204243A1 (en) Method and testing system for storage devices under test
CN116340073A (en) Test method, device and system
CN213181887U (en) Voltage detection circuit and interactive intelligent panel
CN101222740A (en) Method, device and system for controlling and configuring equipment with multi-version under testing
CN110927477B (en) Non-intrusive load identification detection method and system
CN107704417A (en) The method and its communication system to be communicated with equipment under test
TWI510925B (en) Remote management device for detecting status of controlled computers
CN112596983A (en) Monitoring method for connector in server
CN111007336A (en) Module production test power-on and power-off automatic detection system and method based on serial port communication

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
GR01 Patent grant
GR01 Patent grant