CN107402856B - USB port testing method and device and readable storage medium - Google Patents

USB port testing method and device and readable storage medium Download PDF

Info

Publication number
CN107402856B
CN107402856B CN201710549905.8A CN201710549905A CN107402856B CN 107402856 B CN107402856 B CN 107402856B CN 201710549905 A CN201710549905 A CN 201710549905A CN 107402856 B CN107402856 B CN 107402856B
Authority
CN
China
Prior art keywords
port
tested
test
usb
communication function
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
CN201710549905.8A
Other languages
Chinese (zh)
Other versions
CN107402856A (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.)
TCL King Electrical Appliances Huizhou Co Ltd
Original Assignee
TCL King Electrical Appliances Huizhou 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 TCL King Electrical Appliances Huizhou Co Ltd filed Critical TCL King Electrical Appliances Huizhou Co Ltd
Priority to CN201710549905.8A priority Critical patent/CN107402856B/en
Publication of CN107402856A publication Critical patent/CN107402856A/en
Application granted granted Critical
Publication of CN107402856B publication Critical patent/CN107402856B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/2273Test methods
    • 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/221Detection 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 buses, lines or interfaces, e.g. stuck-at or open line faults

Abstract

The invention discloses a test method of a USB port, which comprises the following steps: when a port test instruction is detected, determining whether the current test mode is a USB3.0 port test mode; if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested; when the test completion of the port to be tested is detected, generating and displaying a test result corresponding to the port to be tested; the USB3.0 port comprises a compatible USB2.0 communication function and a new USB3.0 communication function; and when the test of the port to be tested is detected to be completed, generating and displaying a test result corresponding to the port to be tested. The invention also correspondingly provides a testing device of the USB port and a readable storage medium. The invention improves the testing efficiency of the USB3.0 by simplifying the testing process of the USB 3.0.

Description

USB port testing method and device and readable storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a method and an apparatus for testing a USB port, and a readable storage medium.
Background
With the increasing popularity of USB3.0 ports in consumer products, the production process of products equipped with USB3.0 ports requires a more comprehensive and faster test mode to achieve the pre-factory test of the products.
The USB3.0 port is composed of 9 interface lines, data transmission between consumer products such as a television and a carrier such as a U disk is realized, and the transmission speed of the USB3.0 can be as high as 4.8 Gpbs; the production process of the product with the USB3.0 port at present is to use the USB3.0 USB flash disk for testing, the testing method is to enter the menu of the tested equipment to judge whether the external mobile equipment is accessed after the USB flash disk is inserted, namely, after the USB3.0 equipment is inserted, the external menu of the tested equipment is firstly entered to judge whether the external mobile equipment is normal, then the USB3.0 equipment is pulled out to be inserted into the USB2.0 equipment, and then the external menu of the tested equipment is entered to judge whether the external mobile equipment is normal. The process is judged to be tedious by the tester, secondly the tester needs secondary operation plug many times, just can carry out the full function inspection, and such operation judgement process is comparatively loaded down with trivial details, seriously influences the efficiency of the equipment that is equipped with USB3.0 port input in the production process, can't satisfy the high-efficient quick test flow of production line.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method and a device for testing a USB port and a readable storage medium, aiming at improving the testing efficiency of a USB3.0 by simplifying the testing process of the USB 3.0.
In order to achieve the above object, the present invention provides a method for testing a USB port, including the following steps:
when a port test instruction is detected, determining whether the current test mode is a USB3.0 port test mode;
if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested;
and when the test of the port to be tested is detected to be completed, generating and displaying a test result corresponding to the port to be tested.
Optionally, the USB3.0 communication function corresponds to a communication protocol as a USB3.0 communication protocol, and the USB2.0 communication function corresponds to a communication protocol as a USB2.0 communication protocol;
when the port test instruction is detected, the step of determining whether the current test mode is the USB3.0 port test mode comprises the following steps:
and pre-storing the USB3.0 communication protocol and the USB2.0 communication protocol related to the USB3.0 port test in the USB test equipment, so that the USB test equipment generates check information based on the pre-stored USB3.0 communication protocol and the USB2.0 communication protocol and judges whether the port to be tested is abnormal based on the feedback information.
Optionally, when the port test instruction is detected, the step of determining whether the current test mode is the USB3.0 port test mode includes:
if the current test mode is not the USB3.0 port test mode, taking the port to be tested as a USB2.0 port;
generating check information based on a pre-stored USB2.0 communication protocol, and sending the check information to a port to be tested;
and acquiring feedback information generated by the port to be tested based on the check information, and generating and displaying a test result of the USB2.0 communication function according to the feedback information.
Optionally, if the current test mode is the USB3.0 port test mode, the step of taking the port to be tested as the USB3.0 port and testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested respectively includes:
if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively generating verification information based on a USB3.0 communication protocol and a USB2.0 communication protocol;
and sending the verification information to the port to be tested so as to test the USB3.0 communication function and the USB2.0 communication function of the port to be tested respectively.
Optionally, the step of separately testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested includes:
acquiring feedback information generated by the port to be tested based on the check information of the USB2.0 communication protocol, and judging whether the USB2.0 communication function of the port to be tested is abnormal or not based on the feedback information;
and if the USB2.0 communication function of the port to be tested is abnormal, prompting that the pin corresponding to the compatible USB2.0 communication function in the USB3.0 port is abnormal.
Optionally, the step of separately testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested further includes:
acquiring feedback information generated by the port to be tested based on the check information of the USB3.0 communication protocol, and judging whether the USB3.0 communication function of the port to be tested is abnormal or not based on the feedback information;
if the USB3.0 communication function of the port to be tested is abnormal, the pin abnormality corresponding to the USB3.0 communication function of the USB3.0 port is prompted.
Optionally, the step of generating and displaying a test result corresponding to the port to be tested when it is detected that the testing of the port to be tested is completed includes:
when the test completion of the port to be tested is detected, generating a test result corresponding to the port to be tested;
and if the test result of the port to be tested is abnormal, displaying corresponding prompt information for the user to identify.
Optionally, the step of displaying the corresponding prompt information if the test result of the port to be tested is abnormal includes:
and if the test result of the port to be tested is abnormal, prompting the test result of the USB3.0 port by a preset prompting lamp.
In order to achieve the above object, the present invention further provides a testing apparatus for a USB port, including: a memory, a processor, and a test program for a USB port stored on the memory and executable on the processor, wherein:
the testing program of the USB port is executed by the processor to realize the steps of the testing method of the USB port.
In addition, in order to achieve the above object, the present invention further provides a readable storage medium, where a test program of a USB port is stored, and the test program of the USB port implements the steps of the method for testing the USB port when executed by a processor.
The embodiment of the invention provides a method for testing a USB port, which comprises the following steps: when a port test instruction is detected, determining whether the current test mode is a USB3.0 port test mode; if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested; and when the test of the port to be tested is detected to be completed, generating and displaying a test result corresponding to the port to be tested. The USB3.0 port is transmitted to the USB3.0 port through the USB port testing equipment based on communication protocol cross-check information, functions of a USB2.0 port and a USB3.0 port of the USB3.0 port are enumerated, functions of all pins of the UBS3.0 can be enumerated through one-time connection of the USB port testing equipment, repeated connection of the USB testing equipment is reduced, the USB3.0 port is not required to be tested for multiple times through the USB3.0 port testing equipment and the USB2.0 port testing equipment independently, testing of the USB3.0 port can be completed without inserting and pulling different testing equipment for multiple times, an indicating lamp is arranged outside the USB port testing equipment, the state of the port to be tested is judged based on feedback information without entering a peripheral menu of the tested equipment, complex operation in the USB3.0 testing process is omitted, and testers can quickly detect and judge the functions of the USB3.0 port.
Drawings
FIG. 1 is a schematic diagram of a terminal structure of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a pin diagram of a USB3.0 port according to the present invention;
FIG. 3 is a schematic structural diagram of a testing apparatus for a USB port according to the present invention;
FIG. 4 is a flowchart illustrating a method for testing a USB port according to a first embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for testing a USB port according to a second embodiment of the present invention;
FIG. 6 is a detailed flowchart of step S20 of the method for testing the USB port in FIG. 4;
fig. 7 is a detailed flowchart of step S30 of the method for testing the USB port in fig. 4.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The USB3.0 transmission rate is 10 times that of the USB2.0, the USB2.0 rate is 480Mbps, and the USB3.0 rate can reach 4.8 Gbps. Of course, many devices do not require such high rates, but the speed requirements of devices such as hard disks and card readers are still high. USB3.0 will be more power efficient than USB 2.0. Further, USB3.0 is downward compatible, supporting USB2.0 devices. USB3.0 has a standard compatible with the old version, USB3.0 has 9 pins, as shown in fig. 2, where D + \ D-is a compatible USB2.0 pin, and SSRX + \ SSRX- \ SSTX + \ SSTX-pin is a new function of USB3.0, USB3.0 supports an interface of general I/O and will be optimized to reduce power consumption, while improving protocol efficiency in the fields of computers, consumer products, and mobile products, supports a fast synchronous mobile capability, can support both optical and digital component specifications, and has the characteristics of ease of use and plug and play of conventional USB technology.
Mini USB3.0 has an interface which is divided into A, B two kinds of male ports (Plug), and a female port (receptor) which is divided into B and AB, wherein the AB female port is compatible with the A and B male ports in terms of shape, and meanwhile, the pin of the 3.0 version male port is 9 pins, and the pin of the 2.0 version male port is 5 pins. For downward compatibility with version 2.0, USB3.0 employs a 9-pin design, four of whichThe shape and definition of each pin and USB2.0 are the same, and the other 5 pins are specially prepared for USB 3.0. As shown in FIG. 1, the USB3.0 port input device (9 pins D + \ D- \ SSRX + \ SSRX- \ SSTX + \ SSTX- \ V)Bus\GND)。
With the continuous popularization of USB3.0 ports in consumer products, the production process of products with USB3.0 ports requires a more comprehensive and faster test mode to realize the test before the products leave factory; the USB3.0 port is composed of 9 interface lines, and data transmission between a consumer product such as a television and a carrier such as a U disk is realized; at present, the production process of a product equipped with a USB3.0 port is to use a USB3.0 USB disk for testing, and the USB3.0 interface is designed to cover data transmission of USB2.0 functions, as shown in fig. 2, if D + \ D-disconnection in a device equipped with a USB3.0 port input, the USB3.0 USB disk can still be found in a tested device, so that it is impossible to determine whether D + \ D-of the USB3.0 port is normal; if the SSRX + \ SSRX- \ SSTX + \ SSTX-in the device with the USB3.0 port input is disconnected, the USB 3.0U disk can still be identified by the tested device, so that whether the SSRX + \ SSRX- \ SSTX + \ SSTX-pin in the USB3.0 port is normal or not can not be judged; if the USB2.0 USB flash disk is used for testing, the test in the production process will consume more time; the current testing method in the production process is to enter a menu of a tested device to judge whether an external mobile device is accessed after a USB flash disk is inserted, the judging process is complicated, and the state of a port cannot be judged quickly; the complicated USB3.0 port test operation flow directly influences the production efficiency of the equipment with the USB3.0 input port in the production line production process, and the invention is correspondingly provided for improving the USB3.0 test flow.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The testing method of the USB port of the invention is applied to the testing device of the USB port, the testing device of the USB port is shown in figure 3, the testing device of the USB port is installed on the terminal shown in figure 1, can also carry on the testing device of the USB port to test the USB port directly, the embodiment terminal of the invention can be PC, can also be the mobile terminal equipment with display function of the smartphone, panel computer, portable computer, etc., the testing device of the USB port of the invention also includes the test joint of the USB port, the said test joint is shown in figure 2 (supplementary description is the testing device of the USB port of the invention, and USB test equipment are the test hardware of the USB port related to in the invention can be replaced, USB3.0 port test equipment related to in the description, USB2.0 port test equipment is the port test equipment in the prior art).
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a test application program of a USB port.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and processor 1001 may be used to invoke a test application for a USB port stored in memory 1005 and perform the following operations:
when a port test instruction is detected, determining whether the current test mode is a USB3.0 port test mode;
if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested;
and when the test of the port to be tested is detected to be completed, generating and displaying a test result corresponding to the port to be tested.
Further, the processor 1001 may call a test application of the USB port stored in the memory 1005, and also perform the following operations:
the USB3.0 communication function corresponds to the communication protocol to be used as the USB3.0 communication protocol, and the USB2.0 communication function corresponds to the communication protocol to be used as the USB2.0 communication protocol;
when the port test instruction is detected, the step of determining whether the current test mode is the USB3.0 port test mode comprises the following steps:
and pre-storing the USB3.0 communication protocol and the USB2.0 communication protocol related to the USB3.0 port test in the USB test equipment, so that the USB test equipment generates check information based on the pre-stored USB3.0 communication protocol and the USB2.0 communication protocol and judges whether the port to be tested is abnormal based on the feedback information. .
Further, the processor 1001 may call a test application of the USB port stored in the memory 1005, and also perform the following operations:
when the port test instruction is detected, the step of determining whether the current test mode is the USB3.0 port test mode includes:
if the current test mode is not the USB3.0 port test mode, taking the port to be tested as a USB2.0 port;
generating check information based on a pre-stored USB2.0 communication protocol, and sending the check information to a port to be tested;
and acquiring feedback information generated by the port to be tested based on the check information, and generating and displaying a test result of the USB2.0 communication function according to the feedback information.
Further, the processor 1001 may call a test application of the USB port stored in the memory 1005, and also perform the following operations:
if the current test mode is the USB3.0 port test mode, the step of taking the port to be tested as the USB3.0 port and respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested comprises the following steps:
if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively generating verification information based on a USB3.0 communication protocol and a USB2.0 communication protocol;
and sending the verification information to the port to be tested so as to test the USB3.0 communication function and the USB2.0 communication function of the port to be tested respectively.
Further, the processor 1001 may call a test application of the USB port stored in the memory 1005, and also perform the following operations:
the step of respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested comprises the following steps:
acquiring feedback information generated by the port to be tested based on the check information of the USB2.0 communication protocol, and judging whether the USB2.0 communication function of the port to be tested is abnormal or not based on the feedback information;
and if the USB2.0 communication function of the port to be tested is abnormal, prompting that the pin corresponding to the compatible USB2.0 communication function in the USB3.0 port is abnormal.
Further, the processor 1001 may call a test application of the USB port stored in the memory 1005, and also perform the following operations:
the step of testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested respectively further comprises:
acquiring feedback information generated by the port to be tested based on the check information of the USB3.0 communication protocol, and judging whether the USB3.0 communication function of the port to be tested is abnormal or not based on the feedback information;
if the USB3.0 communication function of the port to be tested is abnormal, the pin abnormality corresponding to the USB3.0 communication function of the USB3.0 port is prompted. .
Further, the processor 1001 may call a test application of the USB port stored in the memory 1005, and also perform the following operations:
when the test completion of the port to be tested is detected, the step of generating and displaying the test result corresponding to the port to be tested comprises the following steps:
when the test completion of the port to be tested is detected, generating a test result corresponding to the port to be tested;
and if the test result of the port to be tested is abnormal, displaying corresponding prompt information for the user to identify.
Further, the processor 1001 may call a test application of the USB port stored in the memory 1005, and also perform the following operations:
if the test result of the port to be tested is abnormal, the step of displaying the corresponding prompt message comprises the following steps:
and if the test result of the port to be tested is abnormal, prompting the test result of the USB3.0 port by a preset prompting lamp.
Referring to fig. 4, embodiments of a USB3.0 in the method, apparatus and readable storage medium for testing a USB port of the present invention provide a method for testing a USB port, where the method for testing a USB port includes:
in step S10, when the port test command is detected, it is determined whether the current test mode is the USB3.0 port test mode.
Specifically, the execution main body of the testing method for the terminal USB port of the invention is a USB testing device (also called a testing apparatus for USB port), the USB port is located on a tested device such as a television or a computer, the testing interface (complementary to the description, the testing interface is similar to a USB disk in appearance) in the testing apparatus for the USB port (the USB port includes a USB3.0 port, a USB2.0 port, a USB1.0 port, etc.) is inserted into the USB port of the tested device or triggers a port testing instruction of the USB testing device, as shown in fig. 3, the testing interface has a testing interface 1 and a testing indicator lamp 2 adapted to the USB port, and a control chip IC is provided in the middle, the USB port testing device is preset with a USB3.0 testing mode and a non-USB 3.0 testing mode, wherein the USB3.0 testing mode can test new functions of the USB3.0 and functions compatible with the USB2.0 and the following versions, the non-USB 3.0 testing mode only tests functions of the USB2.0 and the following versions, and the USB testing apparatus determines the testing mode, to determine whether it is in the USB3.0 port test mode.
Step S20, if the current test mode is the USB3.0 port test mode, the port to be tested is used as the USB3.0 port, and the USB3.0 communication function and the USB2.0 communication function of the port to be tested are respectively tested.
If the port testing device is in a USB3.0 port testing mode, the port to be tested is taken as a USB3.0 port, USB testing equipment is inserted into an instrument or equipment provided with the USB3.0 port according to a USB3.0 protocol, whether the functions of pins in the USB3.0 port are abnormal or not is correspondingly detected (the functions of the USB3.0 port comprise a USB3.0 communication function and a compatible USB2.0 communication function), and the USB3.0 communication function and the USB2.0 communication function of the port to be tested are respectively tested.
Specifically, firstly, the USB3.0 port compatible USB2.0 function (enumeration: a state is represented by words with corresponding meanings in a natural language in a programming language, that is, values possibly taken by a variable are considered in advance, and each value is represented by words with clear meanings in a natural language as much as possible, this method is called an enumeration method), whether the USB3.0 port compatible USB2.0 communication function is normal is determined, then the USB3.0 communication function of the USB3.0 port is enumerated, and whether the USB3.0 communication function of the USB3.0 port is normal is determined (it is additionally stated that, when the USB3.0 port is tested, function enumeration of different pins in the USB3.0 port can be adjusted, that is, function enumeration of the USB2.0 communication function is first enumerated, then the USB3.0 communication function is enumerated, or USB3.0 communication function is enumerated first, then the USB2.0 communication function is enumerated, or both the USB2.0 communication function and the USB3.0 communication function are enumerated at the same time).
And step S30, when the testing of the port to be tested is detected to be completed, generating and displaying a testing result corresponding to the port to be tested.
When the test of the USB3.0 port is detected to be finished, the test result of the USB3.0 port is displayed and output, referring to FIG. 3, FIG. 3 is a test device (also called USB test equipment) of the USB port adopted in the invention, and the test device is provided with an interface 1 matched with the USB port and an indicator light 2 for test prompt, and when the port test is finished, the indicator light 2 can prompt the test result through color change (the prompt of the test result can be prompted through the prompt light 2 of the test device, and the USB test equipment can also be connected with a corresponding terminal through information, and the test result is displayed on a display screen of the terminal).
In the present embodiment, when the port test mode is in the USB3.0 test mode, all functions of USB3.0 will be tested, the transmission of the cross-checking information based on the communication protocol is carried out to the USB3.0 port through the USB port test equipment, the functions of the USB2.0 and the USB3.0 of the USB3.0 port are enumerated completely, the functions of all pins of the UBS3.0 can be enumerated by one-time access of the USB port testing equipment, repeated access of the USB testing equipment is reduced, the USB3.0 port can be tested for many times without independently using the USB3.0 port testing equipment and the USB2.0 port testing equipment, the USB3.0 port can be tested without inserting and pulling different testing equipment for many times, an indicator lamp is arranged outside the USB port testing equipment, the state of the port to be tested is judged based on feedback information without entering a peripheral menu of the tested equipment, complicated operation in the USB3.0 testing process is omitted, and a tester can quickly detect and judge the functions of the USB3.0 port.
Further, the testing method of the USB port further comprises the following steps:
the USB3.0 communication function corresponds to the communication protocol to be used as the USB3.0 communication protocol, and the USB2.0 communication function corresponds to the communication protocol to be used as the USB2.0 communication protocol;
and pre-storing the USB3.0 communication protocol and the USB2.0 communication protocol related to the USB3.0 port test in the USB test equipment, so that the USB test equipment generates check information based on the pre-stored USB3.0 communication protocol and the USB2.0 communication protocol and judges whether the port to be tested is abnormal based on the feedback information.
Specifically, the invention sends the check information formed based on different communication protocols to the USB port of the tested device (the tested device, such as a television, a computer, etc.) through the testing device (or called USB testing device) of the USB port, after the USB port receives the check information generated based on the communication protocols, if the USB port stitch is normal, the feedback information of the check information can be correspondingly formed, and the testing process of the USB port is completed, the testing device (or called USB testing device) of the USB port is pre-stored with the corresponding protocol, the USB3.0 port is related to the downward compatibility of the USB2.0 communication function and the new USB3.0 communication function, therefore, different functional protocols are required to be configured (the protocols with different functions are corresponding to different versions, etc. different information), namely, the protocol corresponding to the new USB3.0 communication function is pre-stored in the USB testing device and is called USB3.0 communication protocol, the protocol compatible with the USB2.0 communication function is called a USB2.0 communication protocol, and it should be noted that the USB3.0 communication protocol and the USB2.0 communication protocol are both a type of communication protocol and have different protocol version protocol types, and the USB test equipment may form check information based on the pre-stored communication protocol and send the check information to the USB port to detect whether the port to be tested is abnormal based on the feedback information.
In this embodiment, the USB3.0 communication protocol and the USB2.0 communication protocol related to the USB3.0 port test are pre-stored in the USB test device, so that the USB test device generates the check information based on the pre-stored USB3.0 communication protocol and USB2.0 communication protocol, and determines whether the port to be tested is abnormal based on the feedback information. Different communication protocols are prestored in the USB test equipment, when the USB test equipment is inserted, the verification information can be generated based on the different communication protocols and sent to the USB3.0 port, the different test equipment is not required to be plugged and pulled out from the USB3.0 port for multiple times, and the test flow can be correspondingly reduced.
Referring to fig. 5, in an embodiment of the USB2.0 of the present invention, a method for testing a USB port is provided, where the method for testing a USB port after step S10 includes:
step S40, if the current test mode is not the USB3.0 port test mode, the port to be tested is taken as the USB2.0 port; and generating verification information based on a pre-stored USB2.0 communication protocol, and sending the verification information to a port to be tested.
Specifically, the USB test device may test different versions of USB ports by setting different modes (the USB test device may test a USB3.0 port, a USB2.0 port, or a USB1.0 port), when the USB test device is not in the USB3.0 port test mode, the USB test device may test the USB port to be tested as the USB2.0 port (i.e., only test the functional USB2.0 communication function of the USB2.0 port, or only test the USB3.0 communication function compatible with the USB2.0 function in the USB3.0 port but not test the new USB3.0 communication function in the USB3.0 port), the USB test device may generate corresponding verification information based on the USB2.0 communication protocol to test the USB port to be tested, the USB2.0 port may receive the verification information generated based on the USB2.0 communication protocol and correspondingly form feedback information, the USB test device of the test method for the USB port may, when the USB test device is not in the USB3.0 test mode, correspond to the USB port configured with the USB mode having the 2.0 function, and may communicate at full speed the device configured with the USB2.0, the communication process is based on a physical layer, a link layer and a protocol layer of the USB2.0 specification; and judging that the test is abnormally exited according to a result fed back from the protocol layer.
And step S50, obtaining feedback information generated by the port to be tested based on the verification information, and generating and displaying a test result of the USB2.0 communication function according to the feedback information.
The USB test equipment obtains feedback information formed by the port to be tested according to the USB2.0 communication protocol check information (if the pin of the USB2.0 port has a problem, the check information corresponding to the USB2.0 communication protocol cannot be received, and corresponding feedback information cannot be formed, at this time, the USB test equipment can correspondingly judge that the USB2.0 port is abnormal, the port abnormality comprises a physical layer, a link layer and a protocol layer), the USB test equipment correspondingly forms a test result according to the feedback information, and the test result is prompted through a preset indicator lamp on the USB test equipment.
In this embodiment, the port test of the USB test device not only targets the USB3.0 port, but also tests the USB2.0 port and the following versions, and the test method of the USB port can be applied to the port tests of different versions and correspondingly forms test prompt information, so that the USB test device has higher compatibility and is simple to operate.
Referring to fig. 6, in this embodiment, a method for testing a USB port is provided, where step S20 includes:
step S21, if the current test mode is the USB3.0 port test mode, the port to be tested is taken as the USB3.0 port, and the verification information is respectively generated based on the USB3.0 communication protocol and the USB2.0 communication protocol.
When the USB test device is in the USB3.0 port test mode, that is, the USB test device uses the port to be tested as the USB3.0 port, and needs to test the USB2.0 communication function compatible with the USB3.0 port and the new USB3.0 communication function, that is, the USB test device generates the verification information based on the USB2.0 communication protocol corresponding to the USB2.0 communication function and the USB3.0 communication protocol corresponding to the new USB3. communication function, respectively, and sends the verification information to the port to be tested, so that the verification information of the port to be tested correspondingly forms the feedback information.
Specifically, the test equipment of the USB port configures the USB3.0 port as an overspeed mode port with USB3.0 function, and communicates with the tested equipment equipped with the USB3.0 input port, where the communication process is based on the physical layer, link layer, and protocol layer of the USB3.0 specification; and (3) judging whether the new USB3.0 communication function and the compatible USB2.0 communication function of the port to be tested are abnormal or not based on the feedback information (the step is preferentially carried out in the existing test equipment, and if the USB3.0 communication function in the USB3.0 port is judged to be abnormal, the port can carry out communication in a USB2.0 mode).
And step S22, sending the verification information to the port to be tested to test the USB3.0 communication function and the USB2.0 communication function of the port to be tested respectively.
The verification information is sent to a port to be tested, the USB test equipment acquires feedback information generated by the port to be tested based on the verification information, and in the test of a physical layer: if the USB3.0 port does not receive the verification information generated by the USB test device based on the USB3.0 communication protocol, that is, the feedback information cannot be correspondingly formed, the USB test device may correspondingly obtain the pin with the new USB3.0 communication function of the USB3.0 port, and if the USB3.0 port does not receive the verification information generated by the USB2.0 communication protocol of the USB test device, that is, the feedback information cannot be correspondingly formed, the USB test device may correspondingly obtain the pin with the USB2.0 communication function compatible in the USB3.0 port, and the pin with the protocol compatible in the USB3.0 port may be abnormal, and the USB3.0 port may also receive the corresponding protocol but the protocol is not available, and the USB test device may correspondingly determine whether the USB3.0 port is abnormal according to the received feedback information.
Specifically, feedback information generated by a port to be tested based on check information of a USB2.0 communication protocol is obtained; and judging whether the USB2.0 communication function of the port to be tested is abnormal or not based on the feedback information, and prompting that the compatible USB2.0 communication function in the USB3.0 port corresponds to pin abnormality if the USB2.0 communication function of the port to be tested is abnormal. Acquiring feedback information generated by a port to be tested based on the check information of the USB3.0 communication protocol; and judging whether the USB3.0 communication function of the port to be tested is abnormal or not based on the feedback information, and if the USB3.0 communication function of the port to be tested is abnormal, prompting that the pin corresponding to the USB3.0 communication function of the USB3.0 port is abnormal.
In this embodiment, the function of the USB3.0 port is determined based on the generated verification information of the communication protocol, and when it is detected that the USB3.0 function of the USB3.0 port is abnormal, the USB3.0 port may be correspondingly switched to the USB2.0 function to perform signal transmission, and the testing efficiency of the USB3.0 port is improved by detecting the functions of all pins of the USB3.0 port.
Referring to fig. 7, in the present embodiment, a method for testing a USB port is provided, where step S30 includes:
and step S31, when the test of the port to be tested is detected to be completed, generating a test result corresponding to the port to be tested.
When the USB test equipment detects that the USB3.0 port test is completed, the USB test equipment generates a test result of the USB3.0 port according to the feedback information of the port to be tested.
And step S32, if the test result of the port to be tested is abnormal, displaying corresponding prompt information for the user to identify.
If the test result of the port to be tested is abnormal, the test result of the USB3.0 port is prompted through a preset prompting lamp (namely, one indicating lamp can be used for displaying the compatible USB2.0 communication function, one indicating lamp user displays the new USB3.0 communication function, and whether the test result is abnormal is represented by different colors of the indicating lamp), or the test result is displayed by a terminal display screen which is in communication connection with USB test equipment.
In the embodiment, the test result of the USB port is visually represented by the USB test equipment, the USB port tester makes a quick response to the tested port, the USB port tester is not limited to the indicator lamp and also comprises other communication modes, the test result is quickly fed back to the tester, and the test result can be displayed and output more visually.
The invention also provides a testing device of the USB port.
The testing device of the USB port of the invention comprises: a memory, a processor, and a test program for a USB port stored on the memory and executable on the processor, wherein: the test program of the USB port, when executed by the processor, implements the steps of the test method as the USB port.
The method for implementing the test program of the USB port when executed may refer to various embodiments of the test method of the USB port, and will not be described herein again.
The invention also provides a readable storage medium.
The readable storage medium of the invention stores the test program of the USB port, and the test program of the USB port realizes the steps of the test method of the USB port when being executed by the processor.
The method for implementing the test program of the USB port when executed may refer to various embodiments of the test method of the USB port, and will not be described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A testing method of a USB port is characterized in that a USB3.0 communication function corresponds to a communication protocol as a USB3.0 communication protocol, a USB2.0 communication function corresponds to a communication protocol as a USB2.0 communication protocol, and the testing method of the USB port comprises the following steps:
the USB3.0 communication protocol and the USB2.0 communication protocol related to the USB3.0 port test are pre-stored in the USB test equipment, so that the USB test equipment generates check information based on the pre-stored USB3.0 communication protocol and USB2.0 communication protocol and judges whether the port to be tested is abnormal or not based on the feedback information;
when a port test instruction is detected, determining whether the current test mode is a USB3.0 port test mode;
if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested;
when the test completion of the port to be tested is detected, generating and displaying a test result corresponding to the port to be tested;
if the current test mode is the USB3.0 port test mode, the step of taking the port to be tested as the USB3.0 port and respectively testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested comprises the following steps:
if the current test mode is a USB3.0 port test mode, taking the port to be tested as a USB3.0 port, and respectively generating verification information based on a USB3.0 communication protocol and a USB2.0 communication protocol;
sending the checking information to a port to be tested so as to test the USB3.0 communication function and the USB2.0 communication function of the port to be tested respectively;
the step of testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested respectively further comprises:
acquiring feedback information generated by the port to be tested based on the check information of the USB3.0 communication protocol, and judging whether the USB3.0 communication function of the port to be tested is abnormal or not based on the feedback information;
if the USB3.0 communication function of the port to be tested is abnormal, the pin abnormality corresponding to the USB3.0 communication function of the USB3.0 port is prompted.
2. The method for testing a USB port according to claim 1, wherein the step of determining whether the current test mode is the USB3.0 port test mode when the port test command is detected comprises:
if the current test mode is not the USB3.0 port test mode, taking the port to be tested as a USB2.0 port;
generating check information based on a pre-stored USB2.0 communication protocol, and sending the check information to a port to be tested;
and acquiring feedback information generated by the port to be tested based on the check information, and generating and displaying a test result of the USB2.0 communication function according to the feedback information.
3. The method for testing the USB port according to claim 1, wherein the step of separately testing the USB3.0 communication function and the USB2.0 communication function of the port to be tested comprises:
acquiring feedback information generated by the port to be tested based on the check information of the USB2.0 communication protocol, and judging whether the USB2.0 communication function of the port to be tested is abnormal or not based on the feedback information;
and if the USB2.0 communication function of the port to be tested is abnormal, prompting that the pin corresponding to the compatible USB2.0 communication function in the USB3.0 port is abnormal.
4. The method for testing the USB port according to any one of claims 1 to 3, wherein the step of generating and displaying the test result corresponding to the port to be tested when the test completion of the port to be tested is detected comprises:
when the test completion of the port to be tested is detected, generating a test result corresponding to the port to be tested;
and if the test result of the port to be tested is abnormal, displaying corresponding prompt information for the user to identify.
5. The method for testing the USB port according to claim 4, wherein the step of displaying the corresponding prompt message if the test result of the test of the port to be tested is abnormal includes:
and if the test result of the port to be tested is abnormal, prompting the test result of the USB3.0 port by a preset prompting lamp.
6. A device for testing a USB port, comprising: a memory, a processor, and a test program for a USB port stored on the memory and executable on the processor, wherein:
the test program of the USB port, when executed by the processor, implements the steps of the method of testing a USB port as claimed in any one of claims 1 to 5.
7. A readable storage medium, characterized in that the readable storage medium stores thereon a test program of a USB port, which when executed by a processor implements the steps of the method for testing a USB port according to any one of claims 1 to 5.
CN201710549905.8A 2017-07-06 2017-07-06 USB port testing method and device and readable storage medium Active CN107402856B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710549905.8A CN107402856B (en) 2017-07-06 2017-07-06 USB port testing method and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710549905.8A CN107402856B (en) 2017-07-06 2017-07-06 USB port testing method and device and readable storage medium

Publications (2)

Publication Number Publication Date
CN107402856A CN107402856A (en) 2017-11-28
CN107402856B true CN107402856B (en) 2021-07-06

Family

ID=60405383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710549905.8A Active CN107402856B (en) 2017-07-06 2017-07-06 USB port testing method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN107402856B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752771A (en) * 2019-03-29 2020-10-09 杭州海康威视数字技术股份有限公司 USB port test equipment and system
CN113010356A (en) * 2021-02-22 2021-06-22 深圳市微特精密科技股份有限公司 USB2.0/3.0 interface testing device and testing method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104679620A (en) * 2013-11-28 2015-06-03 英业达科技有限公司 Hot swapping/hot plugging device and method for conducting automatic switching of protocols to establish and test data channel
CN205982507U (en) * 2016-08-23 2017-02-22 广州视睿电子科技有限公司 Testing arrangement of USB3. 0 equipment
CN106649015A (en) * 2016-12-29 2017-05-10 郑州云海信息技术有限公司 Testing device and testing method of USB interface

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8255582B2 (en) * 2010-07-09 2012-08-28 Sae Magnetics (H.K.) Ltd. Optical communication module, universal serial bus cable with the same and processing method of data transfer thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104679620A (en) * 2013-11-28 2015-06-03 英业达科技有限公司 Hot swapping/hot plugging device and method for conducting automatic switching of protocols to establish and test data channel
CN205982507U (en) * 2016-08-23 2017-02-22 广州视睿电子科技有限公司 Testing arrangement of USB3. 0 equipment
CN106649015A (en) * 2016-12-29 2017-05-10 郑州云海信息技术有限公司 Testing device and testing method of USB interface

Also Published As

Publication number Publication date
CN107402856A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
US20100306592A1 (en) Computer system on and off test apparatus and method
EP3122023B1 (en) Smart wristband testing method and testing system thereof
US20160191358A1 (en) Testing method for a smart wristband and testing system thereof
CN103731815A (en) Method and device for achieving mobile phone client software upgrading
KR20190098602A (en) An electronic device and method for controlling an external electronic device based on electro magnetic signals
CN111239617B (en) Control method and device for charge and discharge test, storage medium and system
KR102456456B1 (en) An electronic device having a plurality of displays and control method
JP6140006B2 (en) Information processing apparatus and output control method
CN109298266B (en) Test system, test method, test apparatus, and storage medium
US9336161B2 (en) Keyboard-video-mouse system and method of providing and using the same
CN107402856B (en) USB port testing method and device and readable storage medium
US10165611B2 (en) Bluetooth pairing system and operating method thereof
CN103927242A (en) Display card testing system and display card testing method
CN106776301B (en) Subelement testing method and device
CN116719766A (en) Processing method and handheld device
CN114578790A (en) Unmanned aerial vehicle flight control automatic test method, system, equipment and medium
CN103323767B (en) A kind of method and system thereof of testing bluetooth module on embedded PCB A
CN112199246B (en) Terminal test method and device, storage medium and mobile terminal
US11327818B2 (en) Electronic device and method for managing data input into input field
KR20200079081A (en) Method for sharing content and electronic device thereof
CN111352780B (en) Method and device for determining state of path and readable storage medium
CN110008160B (en) Information processing apparatus
US20140049649A1 (en) Portable device and signal converting method thereof
JP6903978B2 (en) Mobile terminals, server devices, information processing systems, control methods, and programs
CN116953418B (en) Radio frequency test method, system, equipment and computer readable 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
GR01 Patent grant
GR01 Patent grant