An automated testing method and testing equipment for multi-channel controlled USB connection continuity.

The automated testing equipment and method for USB connection continuity is developed by using a multi-channel control USB connection automation system. This system utilizes a serial port control module and relays to achieve automated control of USB connections, solving the problem of low efficiency in manual testing in existing technologies and improving testing efficiency and system compatibility.

CN119759673BActive Publication Date: 2026-03-06YUKUAI CHUANGLING INTELLIGENT TECH (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing USB port testing methods rely on manual plugging and unplugging, which is inefficient, time-consuming, and labor-intensive, and cannot efficiently verify USB recognition and compatibility.

Method used

A multi-channel control USB connection continuity automation test method and equipment is adopted. The serial port control module and relay realize the automated control of USB connection. Combined with the computer-designed script M for automated stress testing, the USB virtual serial port and select function are used to process asynchronous data to realize the automated continuity of USB connection.

Benefits of technology

It enables automated testing of USB connections, improving testing efficiency, reducing manual operation costs, enhancing system compatibility and reliability, and is suitable for various operating system environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759673B_ABST
    Figure CN119759673B_ABST
Patent Text Reader

Abstract

This invention provides an automated testing method and equipment for multi-channel controlled USB connection continuity. The method includes the following steps: S1: Connect the USB continuity test box to a 5V power input port; S2: Insert the test USB peripheral into the USB female connector; S3: Insert the USB continuity test male connector into the USB female connector of the terminal under test; S4: Connect the serial port input port to a computer and input serial port control commands to the serial port control module via the computer; S5: After receiving the commands, the serial port control module controls the opening and closing of the serial port relay to realize the continuity of the VCC power supply line. This invention uses automated USB connection continuity testing. By designing a script on the computer to control the continuity of the 5V power input of the USB VCC, the USB connection continuity test can be realized. This invention is reliable, low-cost, and the testing method is simple and easy to operate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of automotive electronic software and USB communication continuity testing, and particularly to an automated testing method and testing equipment for multi-channel controlled USB connection continuity. Background Technology

[0002] Currently, the main testing method for USB ports of smart system devices is to manually hot-plug various brands of test USB flash drives and USB test peripherals on the market, as well as perform manual stress tests by plugging and unplugging USB peripherals, to verify the reliability and compatibility of the USB recognition and USB connection functions of smart system devices. Manual stress testing is time-consuming, labor-intensive, and inefficient. Summary of the Invention

[0003] The purpose of this invention is to address the shortcomings of existing technologies by proposing an automated testing method and testing equipment for multi-channel controlled USB connection continuity.

[0004] To achieve the above objectives, the present invention adopts the following technical solution: a multi-channel controlled USB connection continuity and disconnection automated testing method, comprising the following steps:

[0005] S1: Connect the USB continuity test box to the 5V power input port;

[0006] The continuity test box enables automated stress testing of the USB continuity connection between the vehicle's main unit and the USB external device under test.

[0007] S2: Insert the USB peripheral device for testing into the USB female connector;

[0008] The test USB peripheral is a USB flash drive with a USB serial port;

[0009] S3: Insert the USB continuity test port into the USB female connector of the terminal under test;

[0010] The terminal under test is the vehicle's infotainment system host.

[0011] S4: Connect the serial port command input port to the computer and input serial port control commands to the serial port control module through the computer;

[0012] The computer contains a pre-designed script M;

[0013] The script M is used to describe the USB virtual serial port, and the serial port control commands are sent to the serial port control module through the USB virtual serial port.

[0014] The serial port control module is used to receive serial port control commands and convert the serial port control commands from the corresponding hexadecimal to binary.

[0015] The specific content of script M is as follows:

[0016] S41: Use the COM0COM tool in the Python library to create USB virtual serial port ports COM1, COM2, COM3, and COM4;

[0017] S42: Set the USB virtual serial port parameters;

[0018] S43: Process USB virtual serial port data;

[0019] Use the read function to read data, the write function to write data, and the select function to process asynchronous data.

[0020] Step S43 includes the following steps:

[0021] S431: Set parameters related to the select function;

[0022] The `fd_set` variable is initialized using the `FD_ZERO` function, including `read_fds` and `write_fds`; here, `read_fds` and `write_fds` are used to monitor the readable and writable states, respectively.

[0023] Use the FD_SET function to add the serial port file descriptor to the fd_set to be monitored. The FD_SET function includes the FD_SET-fd&read_fds function and the FD_SET-fd&write_fds function.

[0024] Set the timeout period (timeout) of the struct timeval type variable, and set timeout to 1 second;

[0025] S432: Repeatedly call the select function and process the results;

[0026] Call the select function within an infinite loop;

[0027] Different processing is performed based on the return value ret of the select function;

[0028] The return value ret = select(fd+1,&read_fds,&write_fds,NULL,&timeout);

[0029] fd+1 is the first parameter of the select function, which is the maximum value among all file descriptors to be calculated plus 1;

[0030] The NULL here represents the set of file descriptors for data anomaly events;

[0031] If ret = -1, it means that the select function call has failed. Use the perror function to output the error message and possibly exit the loop.

[0032] If ret = 0, it means that the select function has timed out. You can handle it accordingly as needed (such as resetting the select parameters and calling it again).

[0033] If ret > 0, it means that an event has occurred:

[0034] If FD_ISSET-fd&read_fds is true, it means that there is data to read from the serial port. In this case, you can use the read function to read the serial port data and then process the data. If FD_ISSET-fd&write_fds is true, it means that the serial port is writable, and you can use the write function to send data to the serial port.

[0035] S5: After receiving the command, the serial port control module controls the serial port relay to open and close, thus enabling VCC power supply.

[0036] Power line on / off;

[0037] When the serial port control module sends a closing command, the serial port relay is triggered to close, realizing the circuit closed loop. The USB peripheral starts to power on and can then complete the USB connection with the terminal under test.

[0038] When the serial port control module sends a disconnect command, the serial port relay is triggered to disconnect, thus breaking the circuit. After the VCC power supply of the USB peripheral is disconnected, it stops working, and the USB peripheral can then complete the USB connection disconnection with the terminal under test.

[0039] Furthermore, the automated testing equipment for multi-channel controlled USB connection continuity includes a USB female connector; a serial port control module; a serial port command input port; a 5V power input port; a serial port relay; and a USB continuity test port.

[0040] USB female connector: Insert and test USB peripheral.

[0041] Serial port control module: Used to receive serial port commands and control serial port relays.

[0042] Serial port command input port: Connects to the control computer.

[0043] 5V power input port: supplies power to the serial port control module.

[0044] Serial port relay: Receives commands from the serial port control module and controls the opening and closing of the circuit.

[0045] USB continuity test port: Insert the USB female connector into the terminal being tested.

[0046] The USB female connector is located on the outside of the automated testing equipment. The serial port relay is connected to the USB female connector and is connected to both the serial port control module and the USB continuity test port. The serial port command input port is located inside the serial port control module, and the 5V power input port is connected to the serial port control module.

[0047] Furthermore, each of the USB female connectors is connected in series with the serial port relay, and each of the USB female connectors is equipped with a serial port relay for use with it.

[0048] Furthermore, the serial port relays are connected to the serial port control module in parallel.

[0049] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention uses a multi-channel controlled USB connection continuity automated testing equipment and testing method, and adopts automated stress testing by designing scripts on a computer, which is reliable, low cost, and the testing method is simple and easy to operate. Attached Figure Description

[0050] Figure 1 This is a flowchart of the testing method in Embodiment 1 of the present invention;

[0051] Figure 2 This is a schematic diagram of the circuit structure of Embodiment 1 of the present invention;

[0052] Labeling Explanation: 1-USB female connector; 2-Serial port control module; 3-Serial port command input port; 4-5V power input port; 5-Serial port relay; 6-USB continuity test port. Detailed Implementation

[0053] To provide a further understanding of the purpose, structure, features, and functions of the present invention, detailed descriptions are provided below with reference to specific embodiments.

[0054] An automated testing method for the continuity and disconnection of multiple controlled USB connections includes the following steps:

[0055] S1: Connect the USB continuity test box to the 5V power input port;

[0056] The continuity test box enables automated stress testing of the USB continuity connection between the vehicle's main unit and the USB external device under test.

[0057] S2: Insert the USB peripheral device for testing into the USB female connector;

[0058] The test USB peripheral is a USB flash drive with a USB serial port;

[0059] S3: Insert the USB continuity test port into the USB female connector of the terminal under test;

[0060] The terminal under test is the vehicle's infotainment system host.

[0061] S4: Connect the serial port command input port to the computer and input serial port control commands to the serial port control module through the computer;

[0062] The computer contains a pre-designed script M;

[0063] The script M is used to describe the USB virtual serial port, and the serial port control commands are sent to the serial port control module through the USB virtual serial port.

[0064] The serial port control module is used to receive serial port control commands and convert the serial port control commands from the corresponding hexadecimal to binary.

[0065] The specific content of script M is as follows:

[0066] S41: Use the COM0COM tool in the Python library to create USB virtual serial port ports COM1, COM2, COM3, and COM4;

[0067] S42: Set the USB virtual serial port parameters;

[0068] S43: Process USB virtual serial port data;

[0069] Use the read function to read data, the write function to write data, and the select function to process asynchronous data.

[0070] Step S43 includes the following steps:

[0071] S431: Set parameters related to the select function;

[0072] The `fd_set` variable is initialized using the `FD_ZERO` function, including `read_fds` and `write_fds`; here, `read_fds` and `write_fds` are used to monitor the readable and writable states, respectively.

[0073] Use the FD_SET function to add the serial port file descriptor to the fd_set to be monitored. The FD_SET function includes the FD_SET-fd&read_fds function and the FD_SET-fd&write_fds function.

[0074] Set the timeout period (timeout) of the struct timeval type variable, and set timeout to 1 second;

[0075] S432: Repeatedly call the select function and process the results;

[0076] Call the select function within an infinite loop;

[0077] Different processing is performed based on the return value ret of the select function;

[0078] The return value ret = select(fd+1,&read_fds,&write_fds,NULL,&timeout);

[0079] fd+1 is the first parameter of the select function, which is the maximum value among all file descriptors to be calculated plus 1;

[0080] The NULL here represents the set of file descriptors for data anomaly events;

[0081] If ret = -1, it means that the select function call has failed. Use the perror function to output the error message and possibly exit the loop.

[0082] If ret = 0, it means that the select function has timed out. You can handle it accordingly as needed (such as resetting the select parameters and calling it again).

[0083] If ret > 0, it means that an event has occurred:

[0084] If FD_ISSET-fd&read_fds is true, it means that there is data to read from the serial port. In this case, you can use the read function to read the serial port data and then process the data. If FD_ISSET-fd&write_fds is true, it means that the serial port is writable, and you can use the write function to send data to the serial port.

[0085] By setting up a USB virtual serial port, the system's compatibility is improved. The USB virtual serial port can work normally in multiple operating system environments, can run across platforms, is convenient to use, and saves working time and costs.

[0086] S5: After receiving the instruction, the serial port control module controls the serial port relay to open and close, thereby switching the VCC power supply line on and off.

[0087] When the computer sends a closing command, the serial port relay is triggered to close, realizing the circuit closed loop. The USB peripheral starts to power on and work, thus enabling USB connection with the terminal under test.

[0088] When the computer sends a disconnect command, the serial port relay is triggered to disconnect, thus breaking the circuit. After the VCC power supply of the USB peripheral is disconnected, it stops working, and the USB peripheral can then complete the USB connection disconnection with the terminal under test.

[0089] Therefore, by following this test method and using a multi-channel controlled USB connection continuity test device, automated stress testing of USB connection continuity and multi-channel USB connection continuity testing can be achieved, enabling automated compatibility testing for replacing USB peripherals. Furthermore, the multi-channel controlled USB connection continuity automated test device includes a USB female connector; a serial port control module; and a serial port command input port.

[0090] 5V power input port; serial port relay; USB continuity test port.

[0091] USB female connector: Insert and test USB peripheral.

[0092] Serial port control module: Used to receive serial port commands and control serial port relays.

[0093] Serial port command input port: Connects to the control computer.

[0094] 5V power input port: supplies power to the serial port control module.

[0095] Serial port relay: Receives commands from the serial port control module and controls the opening and closing of the circuit.

[0096] USB continuity test port: Insert the USB female connector into the terminal being tested.

[0097] The USB female connector is located on the outside of the automated testing equipment. The serial port relay is connected to the USB female connector. The serial port relay is connected to both the serial port control module and the USB continuity test port. The serial port command input port is located inside the serial port control module. The 5V power input port is connected to the serial port control module.

[0098] Furthermore, each of the USB female connectors is connected in series with the serial relay, and each USB female connector is equipped with a corresponding serial relay. This ensures that each serial relay can be controlled independently of the USB female connector, preventing electrical signal interference.

[0099] Furthermore, the serial port relays are connected to the serial port control module in parallel. This design ensures a one-to-one connection between the serial port control module and the serial port relays.

[0100] The present invention has been described in the above-described embodiments; however, these embodiments are merely examples for implementing the present invention. It must be noted that the disclosed embodiments do not limit the scope of the present invention. Conversely, any modifications and refinements made without departing from the spirit and scope of the present invention are within the scope of patent protection of the present invention.

Claims

1. A method for automated testing of a multi-path control USB connection, the method comprising: Comprise the following Steps: S1: USB on-off test box access 5V power input; S2: the test USB peripheral is inserted into the USB female head interface; The test USB peripheral is a U disk, USB serial port; S3: the USB on-off test port is inserted into the USB female head interface of the terminal to be tested; S4: the serial port instruction input is connected with the computer, and the serial port control instruction is input to the serial port control module through the computer; The computer is provided with a designed script M; The script M is used to describe the USB virtual serial port, and the serial port control instruction is sent to the serial port control module through the USB virtual serial port; The serial port control module is used for receiving the serial port control instruction; The specific content of the script M is as follows: S41: in the Python library, the USB virtual serial port COM1, COM2, COM3 and COM4 are established through the COM0COM tool; S42: set the USB virtual serial port parameter; S43: process the USB virtual serial port data, including reading data using read function, writing data using write function and processing asynchronous data using select function; S5: the serial port control module receives the instruction and controls the opening and closing of the serial port relay, so as to realize the on-off control of the VCC power supply line.

2. The multi-lane control USB connection de-assertion automated testing method of claim 1, wherein: In step S43, the following steps are included: S431: set the select function related parameters; Initialize the fd_set variable using the FD_ZERO function, including read_fds and write_fds; here, read_fds and write_fds are used to monitor the readable and writable states respectively; Add the serial port file descriptor to the fd_set to be monitored using the FD_SET function, the FD_SET function including the FD_SET-fd &read_fds function and the FD_SET-fd &write_fds function; Set the timeout time of the struct timeval type variable, and the timeout is set to 1 second; S432: loop call select function and process the result; Call the select function in an infinite loop; According to the return value ret of the select function, different processing is carried out; The return value ret = select(fd+1, &read_fds, &write_fds, NULL, &timeout); The fd+1 is the first parameter of the select function, which is the maximum value of all file descriptors to be calculated plus 1; The NULL here represents the file descriptor set of data exception event; If ret =-1, it indicates that the select function call is wrong, the error information is output using the perror function and the loop may be exited; If ret = 0, it means that the select function times out, and the corresponding processing is carried out according to the needs, and the corresponding processing includes resetting the select parameters and calling again; if ret>0, it means that an event occurs; If FD_ISSET-fd&read_fds is true, it means that the serial port has data to read; at this time, the read function is used to read the serial port data, and then the read data is processed; If FD_ISSET-fd &write_fds is true, it means that the serial port is writable, and the write function is used to send data to the serial port.

3. A multi-path control USB connection on-off automation test device, characterized in that: It includes USB host interface, serial port control module, serial port instruction input port and 5V power input port. Serial port relay; USB on-off test port; The USB host interface includes an external measuring device insertion port, an external measuring device insertion port, an external measuring device insertion port, and an external measuring device insertion port. Serial port control module: for receiving serial port instructions and controlling serial port relay; Serial port instruction input port: connected with control computer; 5V power input port: for power supply of serial port control module; Serial port relay: receiving serial port control module instructions and controlling circuit opening and closing; USB on-off test port: inserting the USB host interface of the terminal to be tested; The USB host interface is arranged on the outside of the automatic test equipment, the serial port relay is connected with the USB host interface, the serial port relay is connected with the serial port control module and the USB on-off test port respectively; the serial port instruction input port is arranged in the serial port control module, and the 5V power input port is connected with the serial port control module.

4. The multi-lane control USB connection gating automated test equipment of claim 3, wherein: Each USB host interface is connected with the serial port relay in series, and each USB host interface is provided with a serial port relay used in cooperation.

5. The multi-lane control USB connection gating automated test equipment of claim 3, wherein: The serial port relays are connected with the serial port control module in parallel.

Citation Information

Patent Citations

  • A device automatically controlling connection and disconnection of USB cables and a testing method

    CN106407068A

  • CAN network automatic test box and use method thereof

    CN112650196A