CN115981927A - Device and method for batch testing of USB (universal serial bus) equipment based on windows system - Google Patents

Device and method for batch testing of USB (universal serial bus) equipment based on windows system Download PDF

Info

Publication number
CN115981927A
CN115981927A CN202211083864.5A CN202211083864A CN115981927A CN 115981927 A CN115981927 A CN 115981927A CN 202211083864 A CN202211083864 A CN 202211083864A CN 115981927 A CN115981927 A CN 115981927A
Authority
CN
China
Prior art keywords
usb
equipment
testing
tested
information
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
CN202211083864.5A
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 Ganzhen Intelligent Co ltd
Original Assignee
Shenzhen Ganzhen Intelligent Co ltd
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 Ganzhen Intelligent Co ltd filed Critical Shenzhen Ganzhen Intelligent Co ltd
Priority to CN202211083864.5A priority Critical patent/CN115981927A/en
Publication of CN115981927A publication Critical patent/CN115981927A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a device and a method for testing USB equipment in batches based on a windows system, which comprises the following steps: at least 2 USB slots and a control module; the control module is electrically connected with the USB slot and used for carrying out batch test on the USB equipment to be tested in the following modes: acquiring inherent information of the USB equipment to be tested through the USB slot 1; enumerating the USB equipment to be tested through the Window system, and binding the current inherent information of the USB equipment to be tested with the USB slot by utilizing a registry in the windows system to form a pairing group; directly appointing the USB equipment to be tested according to the inherent information acquired by the USB slot to finish batch testing; the device has the advantages of simple structure and clear grouping, and can realize batch USB function test of the same equipment.

Description

Device and method for testing USB (Universal Serial bus) equipment in batch based on windows system
Technical Field
The invention relates to the field of USB testing, in particular to a device and a method for testing USB equipment in batches based on a windows system.
Background
USB is the bus standard of the hot plug dynamic connection device, and is very convenient to use; however, when a plurality of similar devices access simultaneously, the application layer cannot distinguish which device needs to communicate with currently, for example, ADB communication only performs dynamic numbering according to an access sequence to the maximum extent; however, if the similar accessed devices do not have any device identification information, the devices cannot be distinguished through the temporary dynamic numbers; similarly, for example, the CapId used by the OpenCV vision processing library is only a serial number dynamically allocated by a windows system, and when a large batch of USB tests are performed, the problem that equipment cannot be distinguished occurs, so that production is affected;
a device and method for testing USB devices in batch is urgently needed to be developed.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a device and a method for batch testing of USB equipment based on a windows system, which are used for solving at least one of the technical problems.
Specifically, the technical scheme is as follows:
an apparatus for batch testing USB devices based on windows system, comprising:
the USB interface device comprises at least 2 USB slots, a USB interface module and a USB interface module, wherein the USB slots are used for being connected with external USB equipment to be tested;
the control module is electrically connected with the USB slots and used for testing the USB devices to be tested in batches in the following mode:
acquiring inherent information of the USB equipment to be tested through the USB slot;
enumerating the USB equipment to be tested through the Window system, and binding the inherent information of the current USB equipment to be tested with the USB slot by utilizing a registry in the windows system to form a pairing group;
and directly appointing the USB equipment to be tested according to the inherent information acquired by the USB slot to finish batch testing.
The step of acquiring the inherent information of the USB device to be tested through the USB slot includes:
polling the USB slot through the control module to find the USB equipment to be tested on the USB bus;
acquiring a BusNumber accessed to a USB port in the USB equipment to be tested, and establishing a USB standard protocol communication pipeline with the USB equipment to be tested;
acquiring all port number PortNumber arrays of the USB port passing through the root port number;
combining the BusNumber array and the PortNumber array to obtain a port identifier;
and acquiring the inherent information of the USB equipment to be tested through the port identification of the USB port and the USB standard protocol communication pipeline.
The inherent information of the USB device to be tested comprises the following steps:
and one or more of PID, VID, interface type, interface subtype, interface protocol and BCD code of the USB device to be tested.
The control module includes:
the control unit is electrically connected with the USB slot;
the visual acquisition communication module is in data interaction with the USB slot and is used for testing visual equipment;
the audio acquisition communication module is in data interaction with the USB slot and is used for testing audio equipment by combining the inherent information;
the serial port communication module is used for carrying out data interaction with the USB slot and testing serial port equipment;
the ADB communication module is in data interaction with the USB slot and is used for testing the mobile equipment;
and the storage module performs data interaction with the control unit and is used for storing the windows system, the video analysis processing library, the audio analysis processing library, the serial port communication processing library and the ADB processing library.
The process of testing the video equipment comprises the following steps:
enumerating all video equipment information in the windows system through DirectShow to obtain a real-time serial number of the video equipment in the windows system and corresponding DevicePath information;
inquiring the windows system registry according to the DevicePath information, and matching the hardware ID of the corresponding video equipment;
binding the hardware ID of the video equipment with the PID, VID and the real-time serial number in the inherent information with the corresponding USB slot;
and testing the audio equipment by using the video analysis processing library.
In the process of testing the audio equipment, the method comprises the following steps:
obtaining IID and SID of the audio equipment registered in a registry of the windows system by enumerating DirectSoundConsture information of all DirectSound in the windows system;
acquiring corresponding DevicePath information from the windows system registry through the SID;
inquiring the windows system registry according to the DevicePath information, and matching the hardware ID of the corresponding audio equipment;
corresponding the hardware ID of the audio equipment to the PID and VID in the inherent information, and binding the corresponding USB slot with the IID of the audio equipment;
and testing the audio equipment by utilizing the audio analysis processing library.
In the process of testing the serial device, the method comprises the following steps:
enumerating information of all plug-and-play devices in the windows system, wherein the information comprises serial port names of the serial port devices;
acquiring corresponding DevicePath information from the windows system registry through the device name;
resolving the DevicePath information to obtain VID and PID of the serial port equipment;
matching the serial port information with the PID and the VID, and binding the corresponding USB slot with the serial port equipment;
and testing the serial equipment by using the serial communication processing library.
When testing the mobile device, the method comprises the following steps:
constructing an ADB processing library;
and establishing a message interaction channel according to the requirement of the mobile equipment by utilizing the ADB processing library to complete the communication between the mobile equipment and the corresponding USB slot.
The step of constructing an ADB processing library comprises the following steps:
packaging an I/O read-write operation module of the mobile equipment for the second time based on the library of the USB slot;
secondly encapsulating the write operation of the buffer area in the I/O read-write operation module into a message format defined by ADB specification, and finishing instruction sending support of a character string format;
the reading operation of the I/O cache region is encapsulated into the analysis of an ADB format, so that a character string message returned by the instruction is analyzed;
and through the sending and receiving of the instructions, the ADB processing library is formed.
A method for testing USB equipment in batches based on the device comprises the following steps:
starting a monitoring thread, monitoring a USB bus and system registration information in real time, binding the current inherent information of the USB equipment to be tested and the corresponding USB slot when detecting that a USB port is accessed into the USB equipment to be tested, and establishing communication;
the testing of all the USB equipment to be tested is completed through the scheduling of the relevant processing library;
the correlation processing library comprises:
one or more of a video analysis processing library, an audio analysis processing library, a serial communication processing library or an ADB processing library.
The invention has at least the following beneficial effects:
the device for testing the USB equipment in batches based on the windows system obtains the inherent information of the USB equipment to be tested through the USB slot when detecting that the USB slot is connected with the USB equipment to be tested; enumerating the USB equipment to be tested through the Window system, and binding the inherent information of the current USB equipment to be tested with the USB slot by utilizing a registry in the windows system to form a pairing group; when the USB socket is used, the USB equipment to be tested is directly appointed according to the inherent information acquired by the USB socket, and one-to-one correspondence between the USB socket and the USB equipment to be tested is realized; the device has the advantages of simple structure and clear grouping, and can realize batch USB function test of the same equipment;
the method for testing the USB equipment in batch based on the windows system comprises the steps of monitoring a USB bus and system registration information in real time, binding the current inherent information of the USB equipment to be tested with the corresponding USB slot when detecting that a USB port is accessed into the USB equipment to be tested, and establishing communication; the testing of all the USB equipment to be tested is completed through the scheduling of the relevant processing library; the method has the advantages of simple process and quick binding, and is very suitable for batch detection of the USB equipment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a system block diagram of the apparatus of the present invention;
FIG. 2 is a flow chart of a batch test performed by the apparatus of FIG. 1;
FIG. 3 is a flow chart of obtaining intrinsic information;
FIG. 4 is a flow chart of testing a vision acquisition module;
FIG. 5 is a flow chart of testing an audio acquisition module;
FIG. 6 is a flow chart of testing serial communication;
FIG. 7 is a flow chart of testing a mobile device;
FIG. 8 is a general flowchart of a method for batch testing USB devices based on a windows system according to the present invention;
FIG. 9 is a diagram of a hardware system based on the method of FIG. 8;
FIG. 10 is a working interface of the hardware system of FIG. 9 in operation;
1, a USB slot; 2. a control module; 201. a control module; 202. a vision acquisition communication module; 203. an audio acquisition communication module; 204. a serial port communication module; 205.Adb communication module;
Detailed Description
Those skilled in the art can understand that the modules in the device in the implementation scenario may be distributed in the device in the implementation scenario according to the implementation scenario description, and may also be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into multiple sub-modules.
The noun explains:
BusNumber: numbering a bus;
PortNumber: a port number;
PID: product number inside the manufacturer
VID: the manufacturer numbers;
DevicePath: device directory, devicePath: unique character strings of Windows identification devices;
DirectSoundCapture: audio capture;
ID of audio device: the name of the audio device;
SID: a secure identifier;
ADB: all are called as follows: the Android Debug Bridge is a command line tool with various functions, and can enable a user to communicate with Android equipment;
CLSID _ VideoInputDeviceCategory: a video capture device class;
hwid: a hardware ID;
the content of the CapID: a visual device serial number;
IID (Interface identifier): an interface identifier;
windows Management Instrumentation: is used in Windows to provide a common interface and object model for accessing management information about operating systems, devices, applications and services;
DUT: a device under test;
the present invention provides the following examples:
referring to fig. 1-2, an apparatus for batch testing USB devices based on a windows system includes: at least 2 USB slots 1 and a control module 2; the USB slot 1 is used for being connected with external USB equipment to be tested; the control module 2 is electrically connected with the USB slot 1 and used for testing the USB equipment to be tested in batches in the following mode:
acquiring inherent information of the USB equipment to be tested through the USB slot 1; enumerating the USB equipment to be tested through the Window system, and binding the inherent information of the current USB equipment to be tested with the USB slot 1 by utilizing a registry in the windows system to form a pairing group; and directly appointing the USB equipment to be tested according to the inherent information acquired by the USB slot 1 to finish batch testing.
Specifically, as shown in fig. 3, the step of "obtaining the inherent information of the USB device to be tested through the USB slot 1" includes: polling the USB slot 1 through the control module 2 to find the USB equipment to be tested on the USB bus; acquiring a BusNumber accessed to a USB port in the USB equipment to be tested, and establishing a USB standard protocol communication pipeline with the USB equipment to be tested; acquiring all port number PortNumber arrays of the USB port passing through the root port number; combining the BusNumber array and the PortNumber array to obtain a port identifier; acquiring inherent information of the USB equipment to be tested through the port identification of the USB port and the USB standard protocol communication pipeline;
when the USB device is actually used, the device on the USB bus is searched through USB device polling to obtain the BusNumber, namely the device bus address number, of the device to be tested, a USB standard protocol communication pipeline is established with the device to analyze all port number PortNumber arrays passed by the USB from the root port number, then the BusNumber array and the PortNumber arrays are combined to define the unique port identification of the USB device, and other important information of the device, including PID and VID of a device developer, interface type, interface subtype, interface protocol, BCD code and the like, is obtained through a USB interface descriptor and the pipeline to be matched and used by subsequent information; in this embodiment, BCD encoding can differentiate the rate of the USB;
because different USB devices have different drivers and applications, and need different information acquisition modes, for convenience of description, the present embodiment divides common test devices into 4 types: visual collection communication, audio collection communication, COM serial port communication, ADB special communication, it is inherent:
the control module 2 includes: the system comprises a control unit 201, a visual acquisition communication module 202, an audio acquisition communication module 203, a serial port communication module 204, an ADB communication module 205 and a storage module 206; the control unit 201 is electrically connected with the USB slot 1; the vision acquisition communication module 202 performs data interaction with the USB slot 1, and is used for testing a vision device; the audio acquisition communication module 203 performs data interaction with the USB slot 1 and is used for testing audio equipment by combining the inherent information; the serial port communication module 204 performs data interaction with the USB slot 1 and is used for testing serial port equipment; the ADB communication module 205 performs data interaction with the USB slot 1, and is used for testing a mobile device; the storage module 206 performs data interaction with the control unit 201, and is configured to store the windows system, the video analysis processing library, the audio analysis processing library, the serial communication processing library, and the ADB processing library;
as shown in fig. 4, the process of testing the video device includes: enumerating all video equipment information in the windows system through DirectShow to obtain a real-time serial number of the video equipment in the windows system and corresponding DevicePath information; inquiring the windows system registry according to the DevicePath information, and matching the hardware ID of the corresponding video equipment; binding the hardware ID of the video equipment with the PID, VID and the real-time serial number in the inherent information with the corresponding USB slot 1; testing the audio equipment by utilizing the video analysis processing library;
in actual production, a large number of algorithms are generally required at an application layer, and more application libraries are involved, such as an open source OpenCV visual processing library; it is necessary that the USB device can bind with the CapId (visual device serial number) of the visual application library to normally communicate. Therefore, the USB device needs to enumerate all DirectShow device information in the system, mainly obtains the "real-time registration serial number" generated in real time by the current registration device, i.e. the dynamic serial number allocated by the system, which will change with accessing the same kind of devices, and CLSID _ videoinputdevice category, queries the system registry according to the DevicePath of the enumeration device, matches the corresponding hwid with the obtained PID, VID, and device ID, and completes the unique binding of the USB port and CapId; finally, in an application layer, a real-time registration serial number can be obtained through a USB port and used as the Capid of the OpenCV library;
in addition, in the embodiment, the USB3.0 high-definition visual acquisition device and the USB2.0 common visual acquisition device are further distinguished by BCD encoding; the characteristics that part of USB equipment has different acquisition resolution due to interface rate are utilized, and further subdivision can be performed on similar equipment during application so as to correspond to more complex equipment scheduling.
As shown in fig. 5, the process of testing the audio device includes: obtaining IID and SID of the audio equipment registered in a registry of the windows system by enumerating DirectSoundConsture information of all DirectSound in the windows system; acquiring corresponding DevicePath information from the windows system registry through the SID; inquiring the windows system registry according to the DevicePath information, and matching the hardware ID of the corresponding audio equipment; corresponding the hardware ID of the audio equipment to the PID and VID in the inherent information, and binding the corresponding USB slot 1 with the IID of the audio equipment; and testing the audio equipment by utilizing the audio analysis processing library.
In actual production, the IID of the USB port and the audio device needs to be bound; firstly, enumerating DirectSoundConsture equipment information of all DirectSound in a system to obtain information such as IID, SID, equipment Name and the like of registered equipment; then acquiring DevicePath from the system registry through SID, inquiring the system registry according to the DevicePath, matching the corresponding hwid with the acquired PID, VID and device class ID, and finishing the unique binding of the USB port and the IID; finally, in an application layer, the audio equipment can be tested through an audio analysis processing library;
as shown in fig. 6, the process of testing the serial device includes: enumerating information of all plug-and-play devices in the windows system, wherein the information comprises serial port names of the serial port devices; acquiring corresponding DevicePath information from the windows system registry through the device name; VID and PID of the serial port equipment are obtained through the DevicePath information analysis; matching the serial port information with the PID and the VID, and binding the corresponding USB slot 1 with the serial port equipment; testing the serial port equipment by using the serial port communication processing library;
in specific production, serial communication is distinguished by a device name, such as COM 2; the serial number in the name is a serial number dynamically allocated by the system; therefore, plug and play device information in all Win32_ PnPentity of the system needs to be enumerated through Windows Management Instrumentation, and VID and PID need to be analyzed from DevicePath besides the device name; then matching the information inquired in the system registry through the DevicePath with the acquired PID, VID and device class ID of the part 1 to complete the unique binding of the USB port and the name corresponding to the plug-and-play device; finally, a COM name can be obtained through a USB device port, and the name bound for the last time by the device can be used in application;
as shown in fig. 7, when testing a mobile device, such as a mobile phone, the method includes: constructing an ADB processing library; establishing a message interaction channel according to the requirements of the mobile equipment by utilizing the ADB processing library to complete the communication between the mobile equipment and the corresponding USB slot 1; the step of constructing an ADB processing library comprises the following steps: packaging an I/O read-write operation module of the mobile equipment for the second time based on the library of the USB slot 1; secondly encapsulating the write operation of the buffer area in the I/O read-write operation module into a message format defined by ADB specification, and finishing instruction sending support of a character string format; the reading operation of the I/O cache area is encapsulated into ADB format analysis, so that the character string message returned by the instruction is analyzed; constructing the ADB processing library by sending and receiving instructions
In production, the ADB special communication is generally due to the mature communication of the USB device, but the communication condition of the corresponding USB slot cannot be known for various reasons; at the moment, a communication protocol which is the same as that of a mature library needs to be developed based on a USB port, and a hardware layer needs to be developed under the condition that the communication protocol is the same as that of a code library used when the PID and VID of a device developer are obtained, so that the original USB port information is provided for the self-developed special communication; when the method is applied, only the communication library of the ABD needs to be replaced, and the complex processing of the upper layer is kept the same as the original processing;
the ADB is a client-server program, and the embodiment mainly needs to solve the problem of communication interaction between the server and the client of the USB; firstly, packaging an I/O read-write operation module of the USB equipment for the second time based on a library with the same USB port; secondly, the write operation of the I/O buffer area of the USB operation module is secondarily encapsulated into a message format defined by an ADB specification, and the instruction sending support of a character string format is completed; meanwhile, the reading operation of the I/O cache area is encapsulated into the analysis of an ADB format, so that the character string message returned by the instruction is analyzed; various common interactive instruction groups are developed through sending and receiving of the instructions processed by formats, and then a communication library can be formed; then, establishing a message interaction channel between the server and the client according to ADB requirements by using the communication library, completing ADB communication with the USB port equipment, and realizing batch detection;
the present invention provides an embodiment:
with the USB port binding method, the USB device with which the current test needs to communicate to complete the corresponding test requirement can be clearly known in the mass production test, and the mass production test of the USB device can be completed by combining with the production test software;
referring to fig. 8, a method for batch testing USB devices based on the apparatus includes: starting a monitoring thread, monitoring a USB bus and system registration information in real time, binding the current inherent information of the USB equipment to be tested with the corresponding USB slot when detecting that a USB port is accessed into the USB equipment to be tested, and establishing communication; the testing of all the USB equipment to be tested is completed through the scheduling of the relevant processing library; the correlation processing library comprises: one or more of a video analysis processing library, an audio analysis processing library, a serial communication processing library or an ADB processing library;
the method comprises the following specific steps:
starting test software, and loading station configuration which records the test content described previously and USB equipment to be matched with the DUT; then 2 threads are started: 1. starting a USB real-time monitoring thread; 2. starting a test management thread;
a. starting a USB real-time monitoring thread, monitoring the USB bus and system registration information in real time, detecting that the USB port is accessed into the equipment, and binding the inherent information of the USB port and the equipment by the method in the embodiment; in the processing process, the DUT performs special processing, inquires that the DUT is in an access state, and informs a management thread to start testing of the DUT;
b. starting a test flow and a logic management thread, starting a test sub-flow by obtaining a DUT test start notice, wherein the test sub-flow mainly obtains a DUT corresponding to a bound USB port to establish communication, and simultaneously obtains corresponding USB equipment to be matched according to configuration and establishes communication, for example, a matched COM serial port code scanning module is controlled to scan a bar code and then write the bar code into the DUT, and a special ID in information bound by the USB equipment can be combined with a related algorithm processing library; finally, all interfaces and functional tests of the DUT are completed by scheduling each USB device; for example, the color detection of the LED lamp is completed by the USB camera by using OpenCV;
c. the batch test corresponds to starting a plurality of test sub-threads, and scheduling the USB equipment corresponding to the DUT to finish the test;
as shown in fig. 9-10, based on the method provided in the present embodiment, a system applying the method is provided; in the system, for example, mobile equipment used for testing DUTs in batch production is accessed to a PC bus through USB, an interface to be tested of the DUTs, such as HDMI, is accessed to an HDMI acquisition card, visual acquisition communication and audio acquisition communication are divided into a system layer, and the HDMI acquisition card is accessed to the PC bus through USB; an LED indicator light of the DUT needs to automatically identify whether the LED indicator light works normally through a USB camera, and visual acquisition communication accessed to a USB bus is also performed on a system layer; the IR receiving and transmitting test of the DUT is matched with a hardware module for converting COM serial ports into infrared, and the module is also accessed into a system bus through a USB; each USB device forms a test station of a DUT, and a plurality of the device groups form batch production stations of a plurality of DUTs; finally, the test is completed by the method;
the invention also provides an embodiment:
an electronic apparatus for batch testing USB devices, comprising: a storage medium and a processing unit; a storage medium for storing a computer program; the processing unit exchanges data with the storage medium, and is used for executing the computer program through the processing unit when testing is performed, so as to perform the steps of the method for testing the USB devices in batch.
In the electronic device, the storage medium is preferably a storage device such as a mobile hard disk, a solid state disk, or a usb disk; a processing unit, preferably a CPU, for exchanging data with the storage medium, and executing the computer program by the processing unit when notifying the status update, thereby performing the steps of the method for batch testing USB devices as described above.
The CPU described above can perform various appropriate actions and processes according to a program stored in a storage medium. The electronic device also includes peripherals including an input portion for a keyboard, a mouse, etc., and an output portion such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; in particular, the processes described in any of FIGS. 1-4 may each be implemented as a computer software program, according to the disclosed embodiments of the invention.
The invention also provides an embodiment:
a computer-readable storage medium having a computer program stored therein; the computer program, when running, performs the steps of the method of bulk testing USB devices as described above.
In the context of the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The above disclosure is only for a few concrete implementation scenarios of the present invention, however, the present invention is not limited to these, and any variations that can be considered by those skilled in the art are intended to fall within the scope of the present invention. The above-mentioned invention numbers are merely for description and do not represent the merits of the implementation scenarios.

Claims (10)

1. An apparatus for batch testing of USB devices based on windows system, comprising:
the USB interface device comprises at least 2 USB slots, a USB interface module and a USB interface module, wherein the USB slots are used for being connected with external USB equipment to be tested;
the control module is electrically connected with the USB slot and used for carrying out batch test on the USB equipment to be tested in the following modes:
acquiring inherent information of the USB equipment to be tested through the USB slot;
enumerating the USB equipment to be tested through the Window system, and binding the inherent information of the current USB equipment to be tested with the USB slot by utilizing a registry in the windows system to form a pairing group;
and establishing a monitoring thread, and directly appointing the USB equipment to be tested according to the inherent information acquired by the USB slot to finish batch testing.
2. The windows-system-based apparatus for batch testing of USB devices according to claim 1, wherein the step of obtaining the inherent information of the USB devices to be tested through the USB slot includes:
polling the USB slot through the control module to find the USB equipment to be tested on the USB bus;
acquiring a BusNumber accessed to a USB port in the USB equipment to be tested, and establishing a USB standard protocol communication pipeline with the USB equipment to be tested;
acquiring all port number PortNumber arrays of the USB port passing through the root port number;
combining the BusNumber array and the PortNumber array to obtain a port identifier;
and acquiring the inherent information of the USB equipment to be tested through the port identification and the USB standard protocol communication pipeline.
3. The apparatus for batch testing of USB devices based on windows system according to claim 1 or 2, wherein:
the inherent information of the USB device to be tested comprises the following steps:
and one or more of PID, VID, interface type, interface subtype, interface protocol and BCD code of the USB device to be tested.
4. The apparatus for mass testing of USB devices according to claim 1, wherein the control module comprises:
the control unit is electrically connected with the USB slot;
the visual acquisition communication module is used for carrying out data interaction with the USB slot and testing visual equipment;
the audio acquisition communication module is in data interaction with the USB slot and is used for testing audio equipment by combining the inherent information;
the serial port communication module is used for performing data interaction with the USB slot and testing serial port equipment;
the ADB communication module is used for carrying out data interaction with the USB slot and testing the mobile equipment;
and the storage module is in data interaction with the control unit and is used for storing the windows system, the video analysis processing library, the audio analysis processing library, the serial communication processing library and the ADB processing library.
5. The apparatus for testing USB devices in batches based on windows system according to claim 4, wherein the process of testing the video device includes:
enumerating all video equipment information in the windows system through DirectShow to obtain a real-time serial number of the video equipment in the windows system and corresponding DevicePath information;
inquiring the windows system registry according to the DevicePath information, and matching the hardware ID of the corresponding video equipment;
binding the hardware ID, the PID, the VID and the real-time serial number of the video equipment in the inherent information with the corresponding USB slot;
and testing the audio equipment by utilizing the video analysis processing library.
6. The apparatus for testing USB devices in batches based on windows system according to claim 4, wherein the process of testing the audio device includes:
obtaining IID and SID of the audio equipment registered in a registry of the windows system by enumerating DirectSoundConsture information of all DirectSound in the windows system;
acquiring corresponding DevicePath information from the windows system registry through the SID;
inquiring the windows system registry according to the DevicePath information, and matching the hardware ID of the corresponding audio equipment;
corresponding the hardware ID of the audio equipment to the PID and VID in the inherent information, and binding the corresponding USB slot with the IID of the audio equipment;
and testing the audio equipment by using the audio analysis processing library.
7. The device for testing the USB equipment in batches based on the windows system according to claim 4, wherein the process of testing the serial equipment includes:
enumerating information of all serial devices in the windows system, wherein the information comprises serial port names of the serial devices;
acquiring corresponding DevicePath information from the windows system registry through the serial port name;
VID and PID of the serial port equipment are obtained through the DevicePath information analysis;
matching the serial port information with the PID and the VID to enable the corresponding USB slot to be bound with the serial port equipment;
and testing the serial port equipment by using the serial port communication processing library.
8. The windows-system-based apparatus for batch testing of USB devices according to claim 4, wherein the testing of the mobile device comprises:
constructing an ADB processing library;
and establishing a message interaction channel according to the requirement of the mobile equipment by utilizing the ADB processing library to complete the communication between the mobile equipment and the corresponding USB slot.
9. The windows-system-based apparatus for batch testing of USB devices according to claim 8, wherein said building ADB processing library comprises:
packaging an I/O read-write operation module of the mobile equipment for the second time based on the library of the USB slot;
secondly encapsulating the write operation of the buffer area in the I/O read-write operation module into a message format defined by ADB specification, and finishing instruction sending support of a character string format;
the reading operation of the I/O cache area is encapsulated into ADB format analysis, so that the character string message returned by the instruction is analyzed;
and through the sending and receiving of the instructions, the ADB processing library is formed.
10. A method for batch testing USB devices based on the apparatus of any one of claims 1-9, comprising:
starting a monitoring thread, monitoring a USB bus and system registration information in real time, binding the current inherent information of the USB equipment to be tested and the corresponding USB slot when detecting that a USB port is accessed into the USB equipment to be tested, and establishing communication;
the testing of all the USB equipment to be tested is completed through the scheduling of the relevant processing library;
the correlation processing library comprises:
one or more of a video analysis processing library, an audio analysis processing library, a serial communication processing library or an ADB processing library.
CN202211083864.5A 2022-09-06 2022-09-06 Device and method for batch testing of USB (universal serial bus) equipment based on windows system Pending CN115981927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211083864.5A CN115981927A (en) 2022-09-06 2022-09-06 Device and method for batch testing of USB (universal serial bus) equipment based on windows system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211083864.5A CN115981927A (en) 2022-09-06 2022-09-06 Device and method for batch testing of USB (universal serial bus) equipment based on windows system

Publications (1)

Publication Number Publication Date
CN115981927A true CN115981927A (en) 2023-04-18

Family

ID=85965315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211083864.5A Pending CN115981927A (en) 2022-09-06 2022-09-06 Device and method for batch testing of USB (universal serial bus) equipment based on windows system

Country Status (1)

Country Link
CN (1) CN115981927A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627916A (en) * 2023-07-25 2023-08-22 厦门瑞为信息技术有限公司 Automatic test method and system for multi-path camera data acquisition and data backflow
CN116866236A (en) * 2023-05-20 2023-10-10 北京盛和信科技股份有限公司 Router reliability batch test method, system, terminal and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116866236A (en) * 2023-05-20 2023-10-10 北京盛和信科技股份有限公司 Router reliability batch test method, system, terminal and storage medium
CN116866236B (en) * 2023-05-20 2024-04-16 北京盛和信科技股份有限公司 Router reliability batch test method, system, terminal and storage medium
CN116627916A (en) * 2023-07-25 2023-08-22 厦门瑞为信息技术有限公司 Automatic test method and system for multi-path camera data acquisition and data backflow
CN116627916B (en) * 2023-07-25 2023-10-13 厦门瑞为信息技术有限公司 Automatic test method and system for multi-path camera data acquisition and data backflow

Similar Documents

Publication Publication Date Title
CN115981927A (en) Device and method for batch testing of USB (universal serial bus) equipment based on windows system
CN109302522B (en) Test method, test device, computer system, and computer medium
US11302412B2 (en) Systems and methods for simulated device testing using a memory-based communication protocol
WO2019227641A1 (en) Application testing method, apparatus, terminal device and medium
US11074157B2 (en) Splicing screen debugging method, splicing screen and splicing wall
KR101777025B1 (en) test equipment of Display Module
CN104978276A (en) Method, device and system used for detecting software
CN112306495A (en) Picture verification method and device, computer equipment and computer-readable storage medium
CN116302743A (en) USB interface testing method, system, computer equipment and storage medium
CN111427782A (en) Operation method, device, equipment and storage medium of android dynamic link library
CN111693294A (en) Vehicle detection method and device, terminal equipment and storage medium
CN113364747B (en) Debugging method, device and system and data set generation method and device
US9342425B2 (en) Test apparatus and test module
JP5841457B2 (en) Test equipment and test modules
CN112445490A (en) File sequence processing method and device, terminal equipment and storage medium
CN116450511A (en) Information updating method, device, electronic equipment and computer readable medium
CN115905029A (en) System architecture, method, device, equipment, medium and chip for chip verification
CN110825617A (en) Method and device for simulating communication interaction between devices
CN112379967B (en) Simulator detection method, device, equipment and medium
CN114490337A (en) Debugging method, debugging platform, equipment and storage medium
CN111104004A (en) Method and system for matching multi-touch screen with display equipment
CN112783708A (en) DTU hardware testing method, terminal and computer readable storage medium
CN113391931A (en) Remote control method and device based on Bluetooth, computer equipment and storage medium
CN212111668U (en) Express delivery cabinet test fixture
CN117632829A (en) Wi-Fi serial port communication method and device, computer equipment and storage medium

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