Disclosure of Invention
In view of this, the invention provides a USBIF certification triggering method, a device under test and a vehicle, which can realize USBIF certification of the device under test without a special test fixture, save test cost and shorten research and development period.
The invention provides a USBIF authentication triggering method, which is applied to tested equipment and comprises the following steps: the USBIF authentication triggering method is applied to the tested equipment, and comprises the following steps: reading test information of a USB flash disk inserted into a USB interface in the tested equipment; comparing the pre-written trigger information with the test information; when the trigger information is consistent with the test information, automatically triggering a corresponding test mode according to the test information; and when the trigger information is inconsistent with the test information, prompting information of replacing different U disks.
Specifically, the step of comparing the pre-written trigger information with the test information further includes: receiving different trigger information written in by test information aiming at different USB flash disks; and storing the trigger information into a trigger information list.
Specifically, the step of receiving different trigger information written by test information for different usb disks includes: and the plurality of test modes in the tested device correspond to the test information in the plurality of U disks one by one, and the test information in each U disk corresponds to one test mode in the trigger information.
Specifically, the test information includes name information, manufacturer information, and PID values of the usb disk.
The present invention also provides a device under test, comprising: a memory for storing executable program code; and the processor is used for calling the executable program codes in the memory to realize the USBIF authentication triggering method execution steps, and the USBIF authentication triggering method execution steps comprise: reading test information of a USB flash disk inserted into a USB interface in the tested equipment; comparing the pre-written trigger information with the test information; when the trigger information is consistent with the test information, automatically triggering a corresponding test mode according to the test information; and when the trigger information is inconsistent with the test information, prompting information of replacing different U disks.
Specifically, the step executed by the processor before executing the step of comparing the pre-written trigger information with the test information includes: receiving different trigger information written in by test information aiming at different USB flash disks; and storing the trigger information into a trigger information list.
Specifically, the step of executing, by the processor, the step of receiving different trigger information written for test information of different usb disks specifically executes a step including: and the plurality of test modes in the tested device correspond to the test information in the plurality of U disks one by one, and the test information in each U disk corresponds to one test mode in the trigger information.
Specifically, the test information includes name information, manufacturer information, and PID values of the usb disk.
The invention also provides a vehicle comprising the tested equipment.
Specifically, according to the USBIF certification triggering method, the device under test and the vehicle provided by this embodiment, the test information of the USB disk inserted into the USB interface of the device under test is read, and the pre-written trigger information is compared with the test information, so that the corresponding test mode is automatically triggered according to the test information when the trigger information is consistent with the test information, and the prompt information for replacing different USB disks is prompted when the trigger information is inconsistent with the test information, thereby achieving USBIF certification of the device under test, without using a special test fixture, saving test cost, and shortening the development cycle.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Detailed Description
To further explain the technical means and effects of the present invention adopted to achieve the predetermined objects, the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.
Fig. 1 is a flowchart illustrating a USBIF authentication triggering method according to a first embodiment of the present invention. The embodiment is a USBIF authentication triggering method executed by a device under test. As shown in fig. 1, the USBIF authentication triggering method of the present embodiment may include the following steps:
step S11: and reading the test information of the USB flash disk inserted on the USB interface in the tested equipment.
Specifically, in an embodiment, when the user inserts the USB disk into the USB interface of the device under test, the device under test reads test information of the USB disk, for example, the test information may include, but is not limited to, name information, manufacturer information, vid (vendor id) value, pid (product id) value, and the like of the USB disk.
Specifically, in an embodiment, the application software in the device under test needs to write a preset PID value for triggering the usb disk into the application software in advance, and when the obtained PID value of the usb disk is compared with the written preset PID value, if the triggered PID value of the usb disk is consistent with the preset PID value, the test mode corresponding to the PID value of the usb disk is triggered.
Specifically, in one embodiment, the test information includes name information, manufacturer information, and PID values of the usb disk.
Step S12: and comparing the pre-written trigger information with the test information.
Specifically, in an embodiment, the device under test compares the pre-written trigger information with the test information one by one to determine whether the trigger information has a PID value corresponding to the test information.
Specifically, in an embodiment, the trigger information is a fixed preset PID value defined by the USBIF association, and specifically, each test mode in the device under test corresponds to the preset PID value one by one as follows:
specifically, when the trigger information coincides with the test information, step S13 is executed. If the trigger information does not match the test information, step S14 is executed.
Step S13: and automatically triggering the corresponding test mode according to the test information.
Specifically, in an embodiment, when the trigger information is consistent with the test information, for example, a PID value of the triggered usb disk is consistent with a preset PID value, the device under test automatically triggers a test mode corresponding to the PID value of the usb disk according to the test information, so that the USBIF authentication of the device under test can be implemented without a special test fixture, thereby saving the test cost.
Step S14: and prompting to replace prompt information of different USB flash disks.
Specifically, in an embodiment, when the trigger information is inconsistent with the test information, for example, when the trigger information does not have a preset PID value corresponding to the PID value of the usb disk clock, the device under test generates the prompt information and displays the prompt information to remind the user to replace different usb disks for the USBIF authentication test, thereby improving user experience.
Referring to fig. 2, fig. 2 is a flowchart illustrating a USBIF authentication triggering method according to a second embodiment of the present invention. As shown in fig. 1 to fig. 2, the USBIF authentication triggering method according to this embodiment further includes the following steps before the step of comparing the pre-written triggering information with the test information:
step S21: different trigger information for test information writing of different U disks is received.
Specifically, in an embodiment, the device under test receives setting information triggered by a user to set different trigger information written in the test information for different usb disks, for example, application software in the device under test needs to program a preset PID value of the triggering usb disk into the application software in advance, so as to be able to trigger with the usb disks, the number of the usb disks may be, but is not limited to, 4, for example, when the test mode of the device under test increases, the number of the usb disks also increases with the test mode of the device under test. Specifically, when 4 USB flash disks are inserted into the USB interface of the tested device one by one, the PID values of the USB flash disks read by the tested device are respectively corresponding to the PID values of the test fixture, so that the USB interfaces of the tested device are inserted into different USB flash disks to enter different test modes, the purpose of USBIF authentication test is achieved, a special test fixture is not needed, and the test cost is saved.
Step S22: and storing the trigger information into a trigger information list.
Specifically, in an embodiment, the device under test stores all preset PID values in the trigger information and PID values in each usb disk in a corresponding manner in the trigger information list.
Referring to fig. 3, fig. 3 is a flowchart illustrating a USBIF authentication triggering method according to a third embodiment of the present invention. As shown in fig. 1 to fig. 3, the step of receiving different trigger information written in the test information for different usb disks in the USBIF certification triggering method provided in this embodiment specifically includes the following steps:
step S31: and the plurality of test modes in the tested device correspond to the test information in the plurality of U disks one by one, and the test information in each U disk corresponds to one test mode in the trigger information.
Specifically, in an embodiment, the device under test corresponds a plurality of test patterns in the device under test to the test information in the plurality of usb disks one to one, and the test information in each usb disk corresponds to one test pattern in the trigger information. Specifically, each test mode corresponds to one preset PID value in the trigger information, and each preset PID value corresponds to a PID value of the USB disk, so that when the USB disk is inserted into the USB interface of the device under test, the device under test searches for the corresponding preset PID value according to the PID value of the test information in the USB disk, and then triggers the corresponding test mode according to the preset PID value, thereby achieving the purpose of the USBIF certification test, without a special test fixture, and saving the test cost.
Specifically, in an embodiment, the USBIF authentication triggering method provided in this embodiment does not need to determine the VID value, for example, if the preset PID values triggered by the functional test in the device under test are four types, i.e., 0x0101,0x0102,0x0103, and 0x0104, the disks of 4U need to be selected to correspond to each other. Specifically, the PID value 0x12a0 in the first usb disk corresponds to 0x0101 of the preset PID value. The PID value 0xA012 in the second usb disk corresponds to 0x0102 of the preset PID value, and so on.
Specifically, in an embodiment, after the device under TEST corresponds the PID value of the USB disk to the application software of the device under TEST, and the user inserts the corresponding USB disk into the USB interface of the device under TEST, the device under TEST detects the PID value of the USB disk, and if the PID value is 0x12a0, the device under TEST determines that the VID value is 0x1a0a and the preset PID value is 0x0101, and triggers the TEST mode TEST _ SE0 NAK _ PID corresponding to the preset PID value of 0x0101 to perform the TEST.
Specifically, in the USBIF certification triggering method provided in this embodiment, the test information of the USB disk inserted into the USB interface of the device under test is read, and the pre-written trigger information is compared with the test information, so that the corresponding test mode is automatically triggered according to the test information when the trigger information is consistent with the test information, and the prompt information for replacing different USB disks is prompted when the trigger information is inconsistent with the test information, thereby implementing the USBIF certification of the device under test, without using a special test fixture, saving the test cost, and shortening the development cycle.
Fig. 4 is a block diagram of a device under test 100 according to a fourth embodiment of the present invention. As shown in fig. 4, the device under test 100 provided in this embodiment includes a memory 110 and a processor 120.
In particular, in one embodiment, memory 110 is used to store executable program code. A processor 120 for calling the executable program code in the memory 110 to implement the USBIF authentication trigger method, the steps performed by the USBIF authentication trigger method including: reading test information of a USB flash disk inserted into a USB interface in a device to be tested; comparing the pre-written trigger information with the test information; when the trigger information is consistent with the test information, automatically triggering a corresponding test mode according to the test information; and when the trigger information is inconsistent with the test information, prompting information of replacing different U disks.
Specifically, in an embodiment, the step executed by the processor 120 before executing the step of comparing the pre-written trigger information with the test information includes: receiving different trigger information written in by test information aiming at different USB flash disks; and storing the trigger information into a trigger information list.
Specifically, in an embodiment, the step of executing, by the processor 120, the step of receiving different trigger information written for test information of different usb disks includes: and the plurality of test modes in the tested device correspond to the test information in the plurality of U disks one by one, and the test information in each U disk corresponds to one test mode in the trigger information.
Specifically, in one embodiment, the test information includes name information, manufacturer information, and PID values of the usb disk.
Specifically, in an embodiment, the trigger information is a fixed preset PID value defined by the USBIF association, and specifically, each test mode in the device under test corresponds to the preset PID value one by one as follows:
specifically, in an embodiment, the USBIF authentication triggering method provided in this embodiment does not need to determine the VID value, for example, if the preset PID values triggered by the functional test in the device under test are four types, i.e., 0x0101,0x0102,0x0103, and 0x0104, the disks of 4U need to be selected to correspond to each other. Specifically, the PID value 0x12a0 in the first usb disk corresponds to 0x0101 of the preset PID value. The PID value 0xA012 in the second usb disk corresponds to 0x0102 of the preset PID value, and so on.
Specifically, in an embodiment, after the device under TEST corresponds the PID value of the USB disk to the application software of the device under TEST, and the user inserts the corresponding USB disk into the USB interface of the device under TEST, the device under TEST detects the PID value of the USB disk, and if the PID value is 0x12a0, the device under TEST determines that the VID value is 0x1a0a and the preset PID value is 0x0101, and triggers the TEST mode TEST _ SE0 NAK _ PID corresponding to the preset PID value of 0x0101 to perform the TEST.
For the specific process of implementing each function of each functional unit of the device under test 100, please refer to the specific contents described in the embodiments shown in fig. 1 to fig. 3, which is not described herein again.
Specifically, the device under test provided by this embodiment automatically triggers the corresponding test mode according to the test information when the trigger information is consistent with the test information by reading the test information of the USB disk inserted into the USB interface of the device under test and comparing the pre-written trigger information with the test information, and prompts to replace the prompt information of different USB disks when the trigger information is inconsistent with the test information, thereby implementing the USBIF certification of the device under test, without using a special test fixture, saving the test cost, and shortening the development cycle.
Fig. 5 is a block diagram of a vehicle 200 according to a fifth embodiment of the present invention. As shown in fig. 5, the present embodiment provides a vehicle 200 including a device under test 210. Specifically, please refer to the description of the device under test 100 in the embodiment shown in fig. 4 for a specific structure of the device under test 210, which is not described herein again.
Specifically, in the vehicle provided in this embodiment, the test information of the USB disk inserted into the tested device is read, and the pre-written trigger information is compared with the test information, so that the corresponding test mode is automatically triggered according to the test information when the trigger information is consistent with the test information, and the prompt information for replacing different USB disks is prompted when the trigger information is inconsistent with the test information, thereby implementing the USBIF certification of the tested device, without using a special test fixture, saving the test cost, and shortening the development cycle.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored, where the computer-readable storage medium is, for example, a non-volatile memory such as an optical disc, a hard disc, or a flash memory. The computer-executable instructions are used to make a computer or similar computing device perform various operations of the USBIF authentication triggering method.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the terminal class embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant points, reference may be made to part of the description of the method embodiment.