Test method, device and equipment of universal serial bus module, medium and product
By automating the connection link switching of the USB module testing equipment and using artificial intelligence analysis, the problem of low testing efficiency of USB modules has been solved, and efficient and accurate test result generation and problem localization have been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAMEN UNISOC TECH CO LTD
- Filing Date
- 2026-01-28
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies for testing USB modules are inefficient, requiring manual plugging and unplugging of devices, which results in significant manpower expenditure for testers and makes it difficult to quickly locate problems.
By intelligently switching between automated control devices and connected devices, a physical connection link of a universal serial bus is established. Operation logs are obtained by combining Bluetooth or serial port monitoring channels, and test data is analyzed using artificial intelligence models to achieve automated testing.
It improves the efficiency and accuracy of USB module testing, reduces manual intervention, ensures the timeliness and completeness of data acquisition, and supports the flexibility and stability of different testing environments.
Smart Images

Figure CN122044972A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated testing technology, and in particular to a testing method, apparatus, device, medium, and product for a universal serial bus module. Background Technology
[0002] Universal Serial Bus (USB), as a widely used high-speed serial communication interface standard, has become an indispensable component of modern electronic devices. A USB module refers to the collective hardware circuitry, firmware, and software drivers necessary for implementing USB protocol communication in embedded devices (such as mobile phones, tablets, IoT devices, and chip platforms). Its core function is to establish a reliable data channel and control interface between the device's operating system and the external USB world. With technological advancements, the application scenarios of USB modules have become increasingly complex, encompassing various functional modes from traditional peripheral connections to audio transmission, network sharing, and device debugging. This increasing complexity of testing scenarios presents challenges for testing devices containing USB modules.
[0003] In related technologies, testers typically manually plug and unplug the USB module from other devices to switch between different test scenarios. During testing, manual operations such as circuit connection / disconnection and device replacement are required, and testers must constantly monitor the device's status to successfully test the USB module.
[0004] However, existing technologies are inefficient for testing USB modules. Summary of the Invention
[0005] This application provides test, electronic equipment, media, and products for Universal Serial Bus (USB) modules to address the technical problem of low efficiency in prior art testing of USB modules.
[0006] In a first aspect, embodiments of this application provide a testing method for a universal serial bus module, applied to a control device in a testing system. The testing system further includes a connection device, a device under test, and an external device. The method includes:
[0007] Obtain test instructions for the device under test; wherein, the test instructions include a test mode;
[0008] According to the test mode, a connection control command is sent to the connection device to control the connection device to establish a first connection link or establish a second connection link; wherein, the first connection link is a Universal Serial Bus physical connection link between the control device and the device under test, and the second connection link is a Universal Serial Bus physical connection link between the device under test and at least one of the external devices.
[0009] Monitor the test data of the device under test;
[0010] Based on the test data, generate test results corresponding to the test instructions.
[0011] Here, this application embodiment provides an automated and intelligent testing method for a device under test (DUT) containing a USB module. The DUT, external devices, and control devices are all connected to a connecting device. When the DUT needs to be tested, the control device can control the connecting device to establish a connection link under the specific test mode. This includes a Universal Serial Bus (USB) physical connection link between the control device and the DUT in the first scenario and a USB physical connection link between the DUT and at least one external device in the second scenario. Through intelligent control of the connecting device, there is no need to manually plug and unplug the connection lines of the device to which the USB module belongs. The intelligent control realizes the switching of test modes and the construction of test scenarios, thereby achieving efficient testing of the USB module and improving the efficiency of USB module testing.
[0012] Optionally, the monitoring of test data of the device under test includes:
[0013] The system acquires the operating logs generated by the device under test during the testing process through a preset monitoring channel.
[0014] This embodiment of the application acquires the operating logs of the device under test (DUT) during the testing process through a preset monitoring channel. This preset monitoring channel ensures the reliability and accuracy of the operating log acquisition, achieving standardized and non-intrusive data collection and ensuring the timeliness, completeness, and consistency of the data. The acquired operating logs provide a raw and reliable data foundation for subsequent test result analysis and problem localization, thereby supporting the automation and intelligent closed loop of the entire testing process, further reducing manual intervention and improving the overall efficiency and reliability of test execution.
[0015] Optionally, the preset monitoring channel includes a Bluetooth monitoring channel between the control device and the device under test, or a serial monitoring channel between the control device and the device under test.
[0016] This application embodiment enables the acquisition of operation logs via either a Bluetooth monitoring channel or a serial port monitoring channel, providing two different monitoring methods: wireless and wired communication, offering a reliable and flexible data acquisition path. The Bluetooth monitoring channel supports wireless, contactless log acquisition, suitable for mobile or inconvenient wiring test environments; the serial port channel provides stable, high-speed wired transmission. These two standardized interfaces ensure that operation logs can be transmitted from the device under test to the control device in real time and completely, avoiding data loss or errors that may occur due to manual export or transfer, further guaranteeing the data foundation for automated testing, adapting to different test environments, and further improving the flexibility and stability of USB module testing.
[0017] Optionally, generating test results corresponding to the test instructions based on the test data includes:
[0018] According to the preset test model, the operation log is subjected to test analysis and processing to obtain the test results corresponding to the test data; wherein, the test results include test status judgment results and / or problem location information, the preset test model is trained by training samples in a preset artificial intelligence database, and the training samples include operation log samples and test result labels corresponding to the operation log samples to train the original test model.
[0019] This application embodiment introduces a preset test model trained on artificial intelligence (AI) to automate the analysis of operation logs, thereby realizing the intelligent generation of test results. This model can quickly and accurately identify patterns and diagnose problems in massive and complex log data, and automatically output test results such as clear test status and specific problem location information. Compared with the traditional testing method that relies on testers to manually read and analyze logs, it reduces human involvement, lowers labor costs, and improves the efficiency and accuracy of problem discovery and location.
[0020] Optionally, after performing test analysis processing on the running logs according to a preset test model to obtain the test results corresponding to the test data, the method further includes:
[0021] Based on the test results corresponding to the test data, the preset artificial intelligence database is updated to obtain the updated artificial intelligence database;
[0022] The preset test model is trained based on the updated artificial intelligence database.
[0023] Here, this embodiment of the application uses the running logs and corresponding analysis results generated by each test as new training samples to feed back and update the artificial intelligence database and its driven test model, thereby realizing continuous optimization of AI testing. This enables the test model to continuously absorb the latest test cases and experience, dynamically analyze and judge the accuracy and coverage, further improve the testing efficiency and problem localization accuracy of the USB module, and further improve the reliability of the USB module.
[0024] Optionally, the connection device is a programmable switch matrix;
[0025] Accordingly, the step of sending a connection control command to the connection device according to the test mode to control the connection device to establish a first connection link or establish a second connection link includes:
[0026] According to the test mode, a connection control command is sent to the programmable switch matrix to establish a first connection link or a second connection link by switching the connection channels inside the programmable switch matrix.
[0027] The programmable switch matrix includes any one of a multiplexer, an analog switch array, a relay array, a solid-state relay array, and a programmable logic device.
[0028] In this application, the embodiments establish different physical connection links by switching internal channels of a programmable switch matrix, providing a reliable hardware foundation for automated connection control. The programmable switch matrix can execute electrical signal on / off control with high precision and speed, replacing manual plugging and unplugging operations. Specifically, various implementation methods, such as multiplexers, enable flexible, stable, and reliable switching of test modes, further improving the testing efficiency of devices containing USB modules.
[0029] Optionally, the test modes include device mode and host mode;
[0030] Accordingly, the step of sending a connection control command to the connection device according to the test mode to control the connection device to establish a first connection link or establish a second connection link includes:
[0031] If the test mode is device mode, a first connection control command is sent to the connected device to control the connected device to establish a first connection link;
[0032] If the test mode is host mode, a second connection control command is sent to the connection device to control the connection device to establish a second connection link.
[0033] Here, this embodiment of the application divides the test mode into device mode and host mode, and precisely corresponds them with two different connection control commands and physical connection links. This accurately reflects the two basic working modes of the USB module in practical applications: as an operated device or as a host controlling peripherals. This allows the automated testing scheme to systematically cover all core test scenarios. Triggering different connection and control logic for different modes ensures the accuracy of test actions and the realism of the scenarios. This provides a foundation for comprehensively verifying the functionality, performance, and compatibility of the USB module under different roles, guaranteeing the comprehensiveness, automation, and accuracy of USB testing.
[0034] Secondly, embodiments of this application provide a testing apparatus for a universal serial bus module, comprising:
[0035] The acquisition module is used to acquire test instructions for the device under test; wherein, the test instructions include test modes;
[0036] The sending module is used to send connection control commands to the connection device according to the test mode, so as to control the connection device to establish a first connection link or establish a second connection link; wherein, the first connection link is a universal serial bus physical connection link between the control device and the device under test, and the second connection link is a universal serial bus physical connection link between the device under test and at least one external device.
[0037] The monitoring module is used to monitor the test data of the device under test;
[0038] The generation module is used to generate test results corresponding to the test instructions based on the test data.
[0039] Optionally, the monitoring module is specifically used for:
[0040] The system acquires the operating logs generated by the device under test during the testing process through a preset monitoring channel.
[0041] Optionally, the preset monitoring channel includes a Bluetooth monitoring channel between the control device and the device under test, or a serial monitoring channel between the control device and the device under test.
[0042] Optionally, the generation module is specifically used for:
[0043] According to the preset test model, the operation log is subjected to test analysis and processing to obtain the test results corresponding to the test data; wherein, the test results include test status judgment results and / or problem location information, the preset test model is trained by training samples in a preset artificial intelligence database, and the training samples include operation log samples and test result labels corresponding to the operation log samples to train the original test model.
[0044] Optionally, after the generation module performs test analysis processing on the running logs according to a preset test model to obtain the test results corresponding to the test data, the above-mentioned device further includes an update module, used for:
[0045] Based on the test results corresponding to the test data, the preset artificial intelligence database is updated to obtain the updated artificial intelligence database;
[0046] The preset test model is trained based on the updated artificial intelligence database.
[0047] Optionally, the connection device is a programmable switch matrix;
[0048] Accordingly, the sending module is specifically used for:
[0049] According to the test mode, a connection control command is sent to the programmable switch matrix to establish a first connection link or a second connection link by switching the connection channels inside the programmable switch matrix.
[0050] The programmable switch matrix includes any one of a multiplexer, an analog switch array, a relay array, a solid-state relay array, and a programmable logic device.
[0051] Optionally, the test modes include device mode and host mode;
[0052] Accordingly, the sending module is specifically used for:
[0053] If the test mode is device mode, a first connection control command is sent to the connected device to control the connected device to establish a first connection link;
[0054] If the test mode is host mode, a second connection control command is sent to the connection device to control the connection device to establish a second connection link.
[0055] Thirdly, embodiments of this application provide a testing system, including a control device, a connection device, a device under test, and an external device;
[0056] The connection device is connected to the control device, the device under test, and the external device respectively;
[0057] The control device is used to: acquire test instructions for the device under test; and send connection control instructions to the connection device according to the test mode; wherein the test instructions include the test mode.
[0058] The connection device is used to: establish a first connection link or establish a second connection link according to the connection control command sent by the control device; wherein, the first connection link is a universal serial bus physical connection link between the control device and the device under test, and the second connection link is a universal serial bus physical connection link between the device under test and at least one of the external devices;
[0059] The control device is also used to: monitor the test data of the device under test; and generate test results corresponding to the test instructions based on the test data.
[0060] Fourthly, embodiments of this application provide a control device for a universal serial bus module, including: a memory and a processor;
[0061] The memory stores computer-executed instructions;
[0062] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0063] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0064] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0065] The test method, electronic device, medium, and product for the Universal Serial Bus (USB) module provided in this application embodiment enable the control device to establish a connection link under the test mode according to the specific test mode when testing the device under test is required. This includes a USB physical connection link between the control device and the device under test in the first scenario and a USB physical connection link between the device under test and at least one external device in the second scenario. Through intelligent control of the connection device, manual plugging and unplugging of the connection lines of the device to which the USB module belongs is eliminated. Intelligent control enables the switching of test modes and the construction of test scenarios, thereby achieving efficient testing of the USB module and improving the efficiency of USB module testing. Attached Figure Description
[0066] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0067] Figure 1 A schematic diagram of the structure of a testing system provided in this application embodiment. Figure 1 ;
[0068] Figure 2 A schematic diagram of the structure of a testing system provided in this application embodiment. Figure 2 ;
[0069] Figure 3 A flowchart illustrating the test method for the universal serial bus module provided in this application. Figure 1 ;
[0070] Figure 4 A flowchart illustrating the testing method for a universal serial bus module provided in this application embodiment. Figure 2 ;
[0071] Figure 5 A schematic diagram of test steps for a test scenario provided in this application embodiment. Figure 1 ;
[0072] Figure 6 A schematic diagram of test steps for a test scenario provided in this application embodiment. Figure 2 ;
[0073] Figure 7 A schematic diagram of the structure of a test device for a universal serial bus module provided in an embodiment of this application;
[0074] Figure 8 This is a schematic diagram of the structure of a control device for a universal serial bus module provided in an embodiment of this application.
[0075] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0076] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0077] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0078] First, let me explain the terms used in this application:
[0079] Device mode scenario: A scenario in which a device containing a USB chip has the ability to interact with the outside world via USB.
[0080] Host mode scenario: A scenario in which a device containing a USB chip can interact with peripherals (such as a mouse or USB flash drive).
[0081] Android Debug Bridge (ADB): A USB-connected mode that is a commonly used feature in the development, testing, and debugging of Android devices.
[0082] Media Transfer Protocol (MTP) mode: mainly used for transferring media files such as music, photos and videos, allowing users to connect smart devices (such as smartphones, tablets or digital cameras) to a computer via USB and manage media files on these devices on the computer.
[0083] Musical Instrument Digital Interface Mode (MIDI): A data transmission mode based on the MIDI protocol that allows musical devices to transmit notes, control signals, and clock information digitally. When a mobile phone or other musical device is connected to a computer via USB, MIDI mode can be selected for data transmission, thus enabling the device to function as a MIDI device and communicate with music production software on the computer.
[0084] Remote Network Driver Interface Specification (RNDIS) mode: A USB-based communication protocol. In USB RNDIS mode, USB devices (such as smartphones and tablets) can act as network adapters, connecting to a computer via USB to enable internet access.
[0085] Device node: A device node is a file used in the operating system to represent a device, providing a way for user space and kernel space to communicate. In the operating system, everything is a file, including devices; therefore, devices are also managed as files.
[0086] In related technologies, testers typically manually plug and unplug the USB module from other devices to switch between different test scenarios. During testing, manual operations such as circuit connection / disconnection and device replacement are required, and testers must constantly monitor the device's status to successfully test the USB module.
[0087] Due to their high frequency of use and complex application scenarios, system testing of USB modules often presents the following challenges: USB can act as both a host and a device, supports hot-swapping, and can connect to various peripherals such as mice, keyboards, and Universal Serial Bus Flash Drives (USB flash drives). This necessitates manual insertion and removal of the device from different peripherals during testing, manual on / off switching, and device replacement. Testers also need to constantly monitor the device's status, which is extremely labor-intensive. Because of the complexity of USB scenarios, test logs are often numerous and easily reflect issues from other modules, making problem localization difficult. It requires manual searching through a large volume of logs to find problematic entries. For problem analysts, the sheer volume of output data after testing makes quickly locating the relevant issue time-consuming. Furthermore, manual judgment is prone to operational errors and the possibility of overlooking important information, leading to ignored problems and incorrect analysis. The aforementioned problems not only lead to a waste of manpower but also hinder analysis and processing after problem discovery, and prolong debugging time after USB issues arise, thus impeding the overall project progress. In summary, existing technologies for USB module testing are inefficient, resulting in low efficiency in testing and subsequent problem analysis and resolution.
[0088] To address the aforementioned technical issues, embodiments of this application provide a testing method, apparatus, device, medium, and product for a Universal Serial Bus (USB) module. The device under test (DUT), external devices, and control devices are all connected to a connecting device. When the DUT needs to be tested, the control device can control the connecting device to establish a connection link under the specific test mode. This includes a USB physical connection link between the control device and the DUT in a first scenario and a USB physical connection link between the DUT and at least one external device in a second scenario. The USB module is then automatically tested through automatically switched connection links.
[0089] Specifically, in the verification process of the USB module in this application embodiment, since the module has a wide range of functions and application scenarios, the test machine can be divided into two modes: the test machine acts as the device and the test machine acts as the host, so as to realize the automatic switching of test modes.
[0090] Optionally, embodiments of this application apply AI to the USB module testing and verification process, and combine it with a multiplexer (MUX) hardware box to build a system capable of fully automated USB module verification. This system, with its specialized hardware structure, verifies, tests, and analyzes the relevant functions of the USB module. This approach significantly reduces manpower and the time spent troubleshooting errors, automating the testing process and reducing labor costs.
[0091] Optionally, embodiments of this application can self-train the AI to continuously improve the accuracy of problem discovery and analysis.
[0092] Optionally, the embodiments of this application can realize the testing of USB modules and interrupt devices containing USB modules, and can also be extended to any product such as chips, modules or terminals with USB function. Specifically, it can be applied to the verification of any product containing USB intellectual property core (IP).
[0093] Optionally, in terms of hardware structure, this application proposes an automated verification system for USB modules based on a MUX hardware box design, thereby greatly reducing manpower input; in terms of software, AI is applied to the system, so that the system can generate and improve detailed test reports based on historical data and real-time test results, including log information, to facilitate further analysis and problem localization.
[0094] The AI system can intelligently assess the compatibility of USB interfaces with various peripherals based on historical data and real-time test results, predict potential compatibility issues, and continuously provide more in-depth analysis reports as historical data accumulates.
[0095] The MUX hardware box can switch the connection mode between the host computer and the test device according to commands issued from the host computer, and control the connection and on / off modes between the test machine and the device under test, without the need for manual plugging and unplugging or replacement of devices. In this embodiment, the host computer is the control device.
[0096] Optionally, Figure 1 A schematic diagram of the structure of a testing system provided in this application embodiment. Figure 1 ,like Figure 1 As shown, the test system provided in this application embodiment includes a control device 11, a connection device 12, a device under test 13, and an external device 14.
[0097] Understandable, Figure 1 This is merely illustrative; the number of external devices provided in this application embodiment may be one or more, and this application embodiment does not impose specific limitations.
[0098] Optionally, any two of the control device 11, connection device 12, device under test 13, and external device 14 can be connected via a USB cable.
[0099] Optionally, in a test system, a control device 11, a connection device 12, a device under test 13, and at least one corresponding external device 14 constitute a test subsystem. In specific implementation, a test system may include any number of test subsystems.
[0100] Optionally, Figure 2 A schematic diagram of the structure of a testing system provided in this application embodiment. Figure 2 ,like Figure 2 As shown, the embodiments of this application can realize parallel testing of multiple devices under test 13, thereby improving the overall test throughput and efficiency.
[0101] The device under test 13 is equipped with a USB module. This embodiment of the application tests the function of the USB module in the device under test 13.
[0102] Optionally, the device under test 13 can be a smartphone, tablet, IoT module, embedded development board, or any chip or terminal product with an integrated USB controller.
[0103] Optionally, the control device 11 can be a personal computer (PC), a server, or a dedicated test controller. The control device 11 is mainly responsible for executing test logic, sending control commands to the connected device 12, receiving and analyzing data from the device under test 13, and managing the entire test process.
[0104] Optionally, the control device 11 runs test management software and an AI analysis module.
[0105] Optionally, the external device 14 can be any USB peripheral device that needs to be connected to the device under test 13 in USB host mode testing. Examples include, but are not limited to, USB mice, USB keyboards, USB flash drives, USB headsets, USB network adapters, or other dedicated USB Human Interface Devices (HID) or mass storage devices. These external devices 14 are used to verify the device under test 13's capabilities for recognition, enumeration, or functional interaction when acting as a USB host.
[0106] Optionally, the connection device 12 can be a programmable switch matrix or a connection control device with similar functionality. The core function of the connection device 12 is to receive instructions from the control device 11 and dynamically and programmably switch its internal physical connection paths. Specifically, the connection device 12 can be, for example, a switching board built on a MUX chip, a switch box composed of relay arrays, a matrix module composed of solid-state switches, or a customized switch logic circuit implemented using a Field-Programmable Gate Array (FPGA). The connection device 12 is a key hardware entity for automating test connections and replacing manual plug-and-play operations.
[0107] The prerequisite for using the above testing system is that the test can run normally and other modules do not affect the normal operation of the USB module.
[0108] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the test system architecture of the universal serial bus module. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or divide some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 or Figure 2 The components shown can be implemented in hardware, software, or a combination of both.
[0109] In the specific implementation process, the control device 11 includes a data acquisition device, a processing device, and a display device.
[0110] Data acquisition devices may include input / output interfaces or communication interfaces, and can be connected to processing devices through input / output interfaces or communication interfaces.
[0111] The processing device can control the connection device to establish a connection link under the specific test mode, including a universal serial bus physical connection link between the control device and the device under test in the first scenario and a universal serial bus physical connection link between the device under test and at least one external device in the second scenario. The USB module can then be automatically tested through the automatically switched connection links.
[0112] The display device can also be a touch screen or the screen of a terminal device, used to receive user commands while displaying the above content, so as to realize interaction with the user.
[0113] It should be understood that the aforementioned processing device can be implemented by a processor reading instructions from memory and executing those instructions, or it can be implemented by a chip circuit.
[0114] Furthermore, the network architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0115] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0116] Figure 3 A flowchart illustrating the test method for the universal serial bus module provided in this application. Figure 1 The execution entity of this application embodiment can be Figure 1 or Figure 2 Control device 11, such as Figure 3 As shown, the method includes:
[0117] S301: Obtain test instructions for the device under test.
[0118] The test instructions include test modes.
[0119] Optionally, the test command can be initiated by the user through the input / output interface or input / output unit of the control device, or sent by the user through the connection channel between other terminal devices and the control device.
[0120] Optionally, the test command may be generated by the control device in response to the fault information of the device under test, or it may be automatically triggered according to a preset periodic test command.
[0121] S302: According to the test mode, send a connection control command to the connected device to control the connected device to establish a first connection link or establish a second connection link.
[0122] The first connection link is a physical connection link of a universal serial bus between the control device and the device under test, and the second connection link is a physical connection link of a universal serial bus between the device under test and at least one external device.
[0123] Optionally, the connecting device is a programmable switch matrix; accordingly, according to the test mode, a connection control command is sent to the connecting device to control the connecting device to establish a first connection link or establish a second connection link, including: according to the test mode, sending a connection control command to the programmable switch matrix to establish a first connection link or establish a second connection link by switching the connection channels inside the programmable switch matrix;
[0124] The programmable switch matrix includes any one of the following: multiplexer, analog switch array, relay array, solid-state relay array, and programmable logic device.
[0125] In this application, the embodiments establish different physical connection links by switching internal channels of a programmable switch matrix, providing a reliable hardware foundation for automated connection control. The programmable switch matrix can execute electrical signal on / off control with high precision and speed, replacing manual plugging and unplugging operations. Specifically, various implementation methods, such as multiplexers, enable flexible, stable, and reliable switching of test modes, further improving the testing efficiency of devices containing USB modules.
[0126] Optionally, the test mode includes device mode and host mode; correspondingly, according to the test mode, a connection control command is sent to the connected device to control the connected device to establish a first connection link or establish a second connection link, including: if the test mode is device mode, a first connection control command is sent to the connected device to control the connected device to establish a first connection link; if the test mode is host mode, a second connection control command is sent to the connected device to control the connected device to establish a second connection link.
[0127] Here, this embodiment of the application divides the test mode into device mode and host mode, and precisely corresponds them with two different connection control commands and physical connection links. This accurately reflects the two basic working modes of the USB module in practical applications: as an operated device or as a host controlling peripherals. This allows the automated testing scheme to systematically cover all core test scenarios. Triggering different connection and control logic for different modes ensures the accuracy of test actions and the realism of the scenarios. This provides a foundation for comprehensively verifying the functionality, performance, and compatibility of the USB module under different roles, guaranteeing the comprehensiveness, automation, and accuracy of USB testing.
[0128] Among some possible implementation methods, the test scenarios are introduced using the connection device as a MUX circuit, the control device as a host computer, and the device under test as a test machine as an example, including device mode hardware connection test scenarios and host mode hardware connection test scenarios.
[0129] In the test scenario of hardware connection in device mode:
[0130] MUX circuit: Receives commands from the host computer and controls the on / off relationship and timing of the host computer through the MUX hardware box.
[0131] Host computer: Used for sending instructions and processing data for the MUX hardware box. Optionally, the host computer is connected to the test machine via a serial cable to acquire test data.
[0132] Test machine: Connect to the host computer to perform device mode testing.
[0133] In a test scenario for hardware connection in host mode:
[0134] MUX hardware box: Receives commands from the host computer and dynamically controls the on / off status of the tested device and different single or multiple USB peripherals, as well as the timing of on / off; here, peripherals refer to external devices.
[0135] Host computer: Used for sending instructions and processing data for the MUX hardware box. Optionally, the host computer is connected to the test machine via a serial cable.
[0136] Test unit: Used to connect to the peripheral device under test and test the host mode function of the USB module.
[0137] Optionally, whether acting as a host or a device, the relevant AI program is integrated into the host computer, and the host and device are operated on and off through the host computer throughout the process. The final test output results are also analyzed and processed using the AI on the host computer.
[0138] Optionally, the device mode scenarios of the USB module include: ADB mode, MIDI mode, MTP mode and RNDIS mode, etc., and are not limited to the above modes. All USB module device modes can be applied to the solution of the embodiments of this application.
[0139] Optionally, the USB module host scenario is as follows: the device under test acts as the host, connects to various peripherals (such as mouse, keyboard, USB flash drive, headphones, etc.) through the MUX hardware box, and freely controls the on / off status of each peripheral using the MUX hardware box.
[0140] S303: Monitor test data of the device under test.
[0141] Optionally, the monitoring channel can be Bluetooth / serial port, or it can be a network (such as wireless LAN, Ethernet) debugging interface, etc.
[0142] S304: Generate test results corresponding to the test instructions based on the test data.
[0143] Optionally, based on the test data, the test results for this test are generated, and in the event of a failure, a corresponding analysis report and error location information are output.
[0144] Optionally, after outputting the test results, if the test fails, the artificial intelligence module will automatically analyze and output an analysis report and problem location; if it succeeds, the successful data will continue to be used for training the artificial intelligence knowledge base, thereby improving the accuracy of the test results.
[0145] Here, this application embodiment provides an automated and intelligent testing method for a device under test (DUT) containing a USB module. The DUT, external devices, and control devices are all connected to a connecting device. When the DUT needs to be tested, the control device can control the connecting device to establish a connection link under the specific test mode. This includes a Universal Serial Bus (USB) physical connection link between the control device and the DUT in the first scenario and a USB physical connection link between the DUT and at least one external device in the second scenario. Through intelligent control of the connecting device, there is no need to manually plug and unplug the connection lines of the device to which the USB module belongs. The intelligent control realizes the switching of test modes and the construction of test scenarios, thereby achieving efficient testing of the USB module and improving the efficiency of USB module testing.
[0146] Optionally, after generating test results corresponding to test instructions based on test data, embodiments of this application may further analyze the test results and optimize the test.
[0147] Optionally, when a test fails, the cause of the failure can be preliminarily analyzed and located, thereby improving the efficiency of fault handling.
[0148] In some possible implementations, embodiments of this application combine AI with the aforementioned USB module testing method to achieve intelligent analysis and accurate location of USB module testing. Accordingly, Figure 4 A flowchart illustrating the testing method for a universal serial bus module provided in this application embodiment. Figure 2 ,like Figure 4 As shown, the method includes:
[0149] S401: Obtain test commands for the device under test.
[0150] The test instructions include test modes.
[0151] S402: According to the test mode, send a connection control command to the connected device to control the connected device to establish a first connection link or establish a second connection link.
[0152] The first connection link is a physical connection link of a universal serial bus between the control device and the device under test, and the second connection link is a physical connection link of a universal serial bus between the device under test and at least one external device.
[0153] Steps S401 and S402 are similar to steps S301 and S302, and will not be described in detail here.
[0154] Optionally, in device mode, test instructions may include: simulating a host to send a standard device request and performing data transmission stress tests; in host mode, test instructions may include: connecting different models of external USB flash drives, mice, and keyboards to test their enumeration compatibility and current supply capabilities.
[0155] S403: Obtain the operation logs generated by the device under test during the test through a preset monitoring channel.
[0156] This application embodiment acquires the operating logs of the device under test (DUT) during testing through a pre-defined monitoring channel. This pre-defined monitoring channel ensures the reliability and accuracy of the operating log acquisition, achieving standardized and non-intrusive data collection and ensuring the timeliness, completeness, and consistency of data acquisition. The acquired operating logs provide a raw and reliable data foundation for subsequent test result analysis and problem localization, thereby supporting the automation and intelligent closed loop of the entire testing process, further reducing manual intervention and improving the overall efficiency and reliability of test execution. This application embodiment effectively solves the technical problem of low efficiency in testing and subsequent problem analysis and resolution.
[0157] Optionally, the preset monitoring channels include a Bluetooth listening channel between the control device and the device under test, or a serial port listening channel between the control device and the device under test.
[0158] It should be noted that the preset monitoring channels (such as Bluetooth and serial ports) are used to obtain the internal operating status logs, debugging information or system error codes of the device under test. This information is usually generated independently outside of the USB communication link.
[0159] The first or second USB physical connection link established through the connecting device is mainly used for test items that require actual USB communication, such as USB protocol conformance testing, data transfer rate testing, device enumeration testing, or interoperability testing with external devices.
[0160] Optionally, the control device integrates the operation logs from the monitoring channel and the communication data captured on the USB link, and performs comprehensive analysis through an AI model to achieve comprehensive and intelligent testing and diagnosis of the USB module from the underlying physical connection to the higher-level protocol, and from the internal state to the external interaction.
[0161] This application embodiment enables the acquisition of operation logs via either a Bluetooth monitoring channel or a serial port monitoring channel, providing two different monitoring methods: wireless and wired communication, offering a reliable and flexible data acquisition path. The Bluetooth monitoring channel supports wireless, contactless log acquisition, suitable for mobile or inconvenient wiring test environments; the serial port channel provides stable, high-speed wired transmission. These two standardized interfaces ensure that operation logs can be transmitted from the device under test to the control device in real time and completely, avoiding data loss or errors that may occur due to manual export or transfer, further guaranteeing the data foundation for automated testing, adapting to different test environments, and further improving the flexibility and stability of USB module testing.
[0162] S404: Based on the preset test model, perform test analysis and processing on the runtime log to obtain the test results corresponding to the test data.
[0163] The test results include test status judgment results and / or problem location information. The preset test model is trained using training samples from a preset artificial intelligence database. The training samples include running log samples and the test result labels corresponding to the running log samples, which are used to train the original test model.
[0164] Optionally, the preset test model can be a deep learning-based sequence model used to analyze time-series operation logs; or a machine learning-based classification model (such as random forest or support vector machine) used to classify faults based on log features.
[0165] Optionally, the test status judgment result here refers to whether a fault exists or not.
[0166] Optionally, the runtime log may include, but is not limited to, at least one of the following: kernel driver messages, device connection / disconnection event records, power state change records, error codes, and stack trace information.
[0167] Optionally, the problem location information can be specific to: the suspected faulty hardware module, the software driver layer, the specific clause of the protocol violation, or provide specific repair suggestions (such as updating the firmware version or checking the voltage).
[0168] This application embodiment introduces a preset test model trained on artificial intelligence (AI) to automate the analysis of operation logs, thereby realizing the intelligent generation of test results. This model can quickly and accurately identify patterns and diagnose problems in massive and complex log data, and automatically output test results such as clear test status and specific problem location information. Compared with the traditional testing method that relies on testers to manually read and analyze logs, it reduces human involvement, lowers labor costs, and improves the efficiency and accuracy of problem discovery and location.
[0169] Optionally, after performing test analysis and processing on the runtime logs according to a preset test model to obtain the test results corresponding to the test data, the method further includes:
[0170] Based on the test results corresponding to the test data, update the preset artificial intelligence database to obtain the updated artificial intelligence database; based on the updated artificial intelligence database, train the preset test model.
[0171] Optionally, after a test cycle ends, the system can automatically add the operation logs generated during the test and the final confirmed test results as new training samples to the artificial intelligence database. Subsequently, the system can periodically retrain the test model in the background or according to administrator instructions, using the updated database, so that the model can continuously evolve and adapt to new equipment models or failure modes.
[0172] Here, this embodiment of the application uses the running logs and corresponding analysis results generated by each test as new training samples to feed back and update the artificial intelligence database and its driven test model, thereby realizing continuous optimization of AI testing. This enables the test model to continuously absorb the latest test cases and experience, dynamically analyze and judge the accuracy and coverage, further improve the testing efficiency and problem localization accuracy of the USB module, and further improve the reliability of the USB module.
[0173] Optionally, the test results can be automatically generated into a structured test report and uploaded to the product lifecycle management or quality management system, enabling the linkage between test data and production and R&D processes.
[0174] In some embodiments, after the test results are generated, the control device displays the test results on a preset display interface, which may be the display interface of the test device or the display interface of the user's terminal device.
[0175] In some embodiments, if a fault is found after the test results are generated, the fault information is sent to the terminal device of the corresponding staff member to facilitate the staff member in handling the fault and improve the efficiency of fault handling.
[0176] In some embodiments, if a fault is found after the test results are generated, the corresponding fault light will be lit or a fault warning will be triggered by a buzzer or other means, which will facilitate the staff to handle the fault and improve the efficiency of fault handling.
[0177] In one possible implementation, Figure 5 A schematic diagram of test steps for a test scenario provided in this application embodiment. Figure 1 , Figure 5 Taking ADB mode verification and testing as an example, this paper illustrates the automated verification process of USB module device mode.
[0178] The testing steps include:
[0179] Step 5.1: The test machine powers on normally and works properly. Connect the host computer, MUX hardware box, and USB peripherals via USB and serial cables.
[0180] Step 5.2: The host computer issues a command to switch the MUX circuit and prepares the device mode test conditions.
[0181] Step 5.3: The host computer executes the test cases and issues the corresponding test instructions, such as switching the test machine to ADB mode.
[0182] Step 5.4: Read the necessary device nodes generated by the test machine in ADB mode.
[0183] Step 5.5: If the ADB node reads successfully, proceed to step 5.6; otherwise, proceed to step 5.9.
[0184] Step 5.6: The host computer verifies the ADB function by sending ADB-related commands, such as the Android Debug Bridge Pull Command (adb pull), to the command path.
[0185] Step 5.7: If the ADB command is executed successfully, the test is successful and the ADB function test is complete.
[0186] Step 5.8: If the ADB command fails to execute, export the relevant runtime logs to the host computer via serial port.
[0187] If step 5.9 fails to read the ADB node, it indicates a problem during the enumeration process of ADB mode. The running log is then exported to the host computer via serial port.
[0188] Step 5.10: Regardless of whether the test is successful or not, the exported log will be fed into the AI library of the host computer to further improve the database and make the corresponding judgment more accurate in the next test.
[0189] In one possible implementation, Figure 6 A schematic diagram of test steps for a test scenario provided in this application embodiment. Figure 2 , Figure 6 The device under test acts as the host, connecting various peripherals (such as mice, keyboards, USB drives, headphones, etc.) through a MUX hardware box. The MUX hardware box allows for free control of the on / off status of each peripheral. The following example, using a mouse test, illustrates the automated verification process.
[0190] The testing steps include:
[0191] Step 6.1: Power on the test machine normally and connect it to one port of the MUX hardware box (consider it the main port and connect it to the host device).
[0192] Step 6.2: Connect the MUX hardware box to the various peripheral devices to be tested (considered as slave ports). Here, we take a single mouse as an example. Of course, in actual verification, there can be multiple different peripheral devices (these slave ports can be expanded according to the number of peripheral devices to be tested).
[0193] Step 6.3: The host computer can directly operate the MUX hardware box to control the connection between the test machine and the host computer, and at the same time control the path connection between the master port and the slave port on the MUX hardware box.
[0194] Step 6.4: The host computer operates the MUX hardware box by issuing test commands to control the connection between the master port and one, two, or more slave ports, thereby realizing testing in multiple scenarios such as one master and multiple slaves.
[0195] Step 6.5: Read the relevant device nodes of the mouse via the serial port, such as the event events under / dev / input / , and compare the differences before and after the execution of the upper-level command. If the mouse is successfully enumerated, a new event will be added in this directory, such as event6. The node path and name are system-dependent and not limited to this node path and name.
[0196] Step 6.6: After successfully reading the newly added event node after mouse insertion, output the successful operation log, move the mouse and observe the status of the test machine: if there is a display screen, you can observe the status of the display screen; if there is no display screen, enter the following command in the serial port: cat / dev / input / event6 to see that there are events reported.
[0197] Note: Because a mouse is an HID device, it requires manual operation. If it is a USB flash drive, data transfer between the PC and the USB flash drive can be automated.
[0198] Step 6.7: If no new nodes are added, i.e., the node information fails, it indicates that the mouse enumeration process failed, and the failure log is exported.
[0199] Step 6.8: Import the operation logs into the AI database on the host computer. Use AI to parse the relevant logs. If the logs indicate a test failure, quickly locate the problem using the AI's analysis results. Simultaneously, new operation logs continuously update the AI database, dynamically improving the accuracy of AI problem identification with each test.
[0200] Optionally, whether testing host or device functions, when a test case fails, the AI will automatically analyze the exported problem log, compare it with the standard log of the corresponding process in the database, analyze and locate the problem, and output a corresponding analysis report and suggested debugging suggestions. At the same time, the problem log will be stored in the database for easy location of similar problems in the future. If the test case completes normally, the normal log will also be stored in the AI's database as a standard for problem analysis.
[0201] Optionally, for more complex problems, there will inevitably be instances of inaccurate identification after the initial AI recognition, requiring further human intervention. However, after manual processing, the relevant data and results can be manually imported into the AI's database.
[0202] Through continuous stress testing and data enrichment, the accuracy and reliability of AI's judgment on whether there are problems can be further improved, thereby reducing the need for human intervention.
[0203] Figure 7 This is a schematic diagram of the structure of a test device for a universal serial bus module provided in an embodiment of this application, as shown below. Figure 7 As shown, the apparatus provided in this application embodiment includes: an acquisition module 701, a transmission module 702, a monitoring module 703, and a generation module 704. The testing apparatus for the Universal Serial Bus (USB) module can be the aforementioned control device itself, or a chip or integrated circuit that implements the processing device function in a USB module testing system. It should be noted that the division of the acquisition module 701, transmission module 702, monitoring module 703, and generation module 704 is only a logical functional division; physically, they can be integrated or independent.
[0204] The acquisition module is used to acquire test instructions for the device under test; the test instructions include test modes.
[0205] The sending module is used to send connection control commands to the connection device according to the test mode, so as to control the connection device to establish a first connection link or establish a second connection link; wherein, the first connection link is a universal serial bus physical connection link between the control device and the device under test, and the second connection link is a universal serial bus physical connection link between the device under test and at least one external device.
[0206] The monitoring module is used to monitor the test data of the device under test.
[0207] The generation module is used to generate test results corresponding to test instructions based on test data.
[0208] Optionally, the monitoring module is specifically used for:
[0209] The system acquires the operational logs generated by the device under test during the testing process through a preset monitoring channel.
[0210] Optionally, the preset monitoring channels include a Bluetooth listening channel between the control device and the device under test, or a serial port listening channel between the control device and the device under test.
[0211] Optionally, the generation module is specifically used for:
[0212] Based on the preset test model, the operation logs are analyzed and processed to obtain the test results corresponding to the test data. The test results include test status judgment results and / or problem location information. The preset test model is trained using training samples from a preset artificial intelligence database. The training samples include operation log samples and the test result labels corresponding to the operation log samples.
[0213] Optionally, after the generation module performs test analysis and processing on the runtime logs according to a preset test model to obtain the test results corresponding to the test data, the above device further includes an update module for:
[0214] Based on the test results corresponding to the test data, update the preset artificial intelligence database to obtain the updated artificial intelligence database;
[0215] Based on the updated artificial intelligence database, a pre-set test model is trained.
[0216] Optionally, the connecting device is a programmable switch matrix;
[0217] Accordingly, the sending module is specifically used for:
[0218] According to the test mode, a connection control command is sent to the programmable switch matrix to establish a first connection link or a second connection link by switching the connection channels inside the programmable switch matrix.
[0219] The programmable switch matrix includes any one of the following: multiplexer, analog switch array, relay array, solid-state relay array, and programmable logic device.
[0220] Optionally, the test modes include device mode and host mode;
[0221] Accordingly, the sending module is specifically used for:
[0222] If the test mode is device mode, a first connection control command is sent to the connected device to control the connected device to establish a first connection link;
[0223] If the test mode is host mode, a second connection control command is sent to the connected device to control the connected device to establish a second connection link.
[0224] refer to Figure 8 The diagram illustrates a structural schematic of a control device suitable for implementing a universal serial bus module according to embodiments of the present disclosure. This control device can be the aforementioned control device, which can be implemented through a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 8 The control device for the universal serial bus module shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this disclosure.
[0225] like Figure 8 As shown, the control device of the Universal Serial Bus (USB) module may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 802 or a program loaded from storage device 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the control device of the USB module. The processing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. An input / output (I / O) interface 805 is also connected to bus 804.
[0226] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 807 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 808 including, for example, magnetic tapes, hard disks, etc.; and communication devices 809. Communication device 809 allows the control device of the Universal Serial Bus module to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 The diagram illustrates a control device for a universal serial bus module with various devices; however, it should be understood that implementation or possession of all the devices shown is not required. More or fewer devices may be implemented alternatively.
[0227] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by a processing device 801, it performs the functions defined in the methods of embodiments of this disclosure.
[0228] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0229] The aforementioned computer-readable medium may be included in the control device of the aforementioned Universal Serial Bus module; or it may exist independently and not assembled into the control device of the Universal Serial Bus module.
[0230] The aforementioned computer-readable medium carries one or more programs, which, when executed by the control device of the Universal Serial Bus module, cause the control device of the Universal Serial Bus module to perform the method shown in the above embodiments.
[0231] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0232] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0233] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0234] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0235] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0236] The control device of the universal serial bus module in the embodiments of this application can be used to execute the technical solutions in the above-described method embodiments of this application. Its implementation principle and technical effect are similar, and will not be repeated here.
[0237] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement a test method for a universal serial bus module as described above.
[0238] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement a universal serial bus module as described above.
[0239] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0240] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0241] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0242] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0243] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0244] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0245] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0246] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0247] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in application-specific integrated circuits (ASICs). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.
[0248] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0249] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A test method for a universal serial bus module, characterized in that, A control device applied in a testing system, the testing system further including a connection device, a device under test, and external devices, the method comprising: Obtain test instructions for the device under test; wherein, the test instructions include a test mode; According to the test mode, a connection control command is sent to the connection device to control the connection device to establish a first connection link or establish a second connection link; wherein, the first connection link is a Universal Serial Bus physical connection link between the control device and the device under test, and the second connection link is a Universal Serial Bus physical connection link between the device under test and at least one of the external devices. Monitor the test data of the device under test; Based on the test data, generate test results corresponding to the test instructions.
2. The method according to claim 1, characterized in that, The monitoring of test data for the device under test includes: The system acquires the operating logs generated by the device under test during the testing process through a preset monitoring channel.
3. The method according to claim 2, characterized in that, The preset monitoring channels include a Bluetooth monitoring channel between the control device and the device under test, or a serial monitoring channel between the control device and the device under test.
4. The method according to claim 3, characterized in that, The step of generating test results corresponding to the test instructions based on the test data includes: According to the preset test model, the operation log is subjected to test analysis and processing to obtain the test results corresponding to the test data; wherein, the test results include test status judgment results and / or problem location information, the preset test model is trained by training samples in a preset artificial intelligence database, and the training samples include operation log samples and test result labels corresponding to the operation log samples to train the original test model.
5. The method according to claim 4, characterized in that, After performing test analysis and processing on the running logs according to a preset test model to obtain the test results corresponding to the test data, the method further includes: Based on the test results corresponding to the test data, the preset artificial intelligence database is updated to obtain the updated artificial intelligence database; The preset test model is trained based on the updated artificial intelligence database.
6. The method according to any one of claims 1 to 5, characterized in that, The connection device is a programmable switch matrix; Accordingly, the step of sending a connection control command to the connection device according to the test mode to control the connection device to establish a first connection link or establish a second connection link includes: According to the test mode, a connection control command is sent to the programmable switch matrix to establish a first connection link or a second connection link by switching the connection channels inside the programmable switch matrix. The programmable switch matrix includes any one of a multiplexer, an analog switch array, a relay array, a solid-state relay array, and a programmable logic device.
7. The method according to any one of claims 1 to 5, characterized in that, The test modes include device mode and host mode; Accordingly, the step of sending a connection control command to the connection device according to the test mode to control the connection device to establish a first connection link or establish a second connection link includes: If the test mode is device mode, a first connection control command is sent to the connected device to control the connected device to establish a first connection link; If the test mode is host mode, a second connection control command is sent to the connection device to control the connection device to establish a second connection link.
8. A testing device for a universal serial bus module, characterized in that, include: The acquisition module is used to acquire test instructions for the device under test; wherein, the test instructions include test modes; The sending module is used to send connection control commands to the connection device according to the test mode, so as to control the connection device to establish a first connection link or establish a second connection link; wherein, the first connection link is a universal serial bus physical connection link between the control device and the device under test, and the second connection link is a universal serial bus physical connection link between the device under test and at least one external device. The monitoring module is used to monitor the test data of the device under test; The generation module is used to generate test results corresponding to the test instructions based on the test data.
9. A testing system, characterized in that, Includes control equipment, connection equipment, the device under test, and external equipment; The connection device is connected to the control device, the device under test, and the external device respectively; The control device is used to: acquire test instructions for the device under test; and send connection control instructions to the connection device according to the test mode; wherein the test instructions include the test mode. The connection device is used to: establish a first connection link or establish a second connection link according to the connection control command sent by the control device; wherein, the first connection link is a universal serial bus physical connection link between the control device and the device under test, and the second connection link is a universal serial bus physical connection link between the device under test and at least one of the external devices; The control device is also used to: monitor the test data of the device under test; and generate test results corresponding to the test instructions based on the test data.
10. A control device for a universal serial bus module, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.