Test system and method and electronic equipment
Through the automated control of USB switch and control equipment, the low efficiency and high cost problems caused by manual replacement of equipment in the test of existing USB peripheral devices are solved, and a fully automated test process and device switching are realized, which improves the testing efficiency and platform utilization.
Patent Information
- Application Number
- CN202510525913.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-01
AI Technical Summary
Testing of existing USB peripheral devices requires manual replacement of equipment, resulting in low testing efficiency and high labor costs.
The combination of USB switcher, controller and control device is adopted to automatically switch different USB test devices, and automatically control the test process by analyzing log information and execute corresponding test procedures.
A fully automated USB testing process has been realized, which has improved testing efficiency, reduced manpower investment and improved the utilization rate of the test platform.
Smart Images

Figure CN120407306A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of testing, and particularly relates to a testing system, method, and electronic device. Background Art
[0002] During the verification process of peripheral devices of a USB (Universal Serial Bus) controller, it usually includes function verification of several different transfer types such as control transfer, bulk transfer, interrupt transfer, and isochronous transfer. However, each USB peripheral device may only include some of these transfer types. In testing, if all transfer types need to be covered, different devices need to be replaced for verification.
[0003] For current existing USB peripheral device testing, the USB peripheral device needs to be connected to a testing platform (including a hardware emulator and a speed bridge). After completing the test of one USB peripheral device on the hardware emulator, the USB peripheral device needs to be manually replaced. When replacing the USB peripheral device for testing, the testing system needs to be restarted. Current existing USB peripheral device testing requires a large amount of human participation, resulting in low testing efficiency and high labor costs. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a testing system, method, and electronic device to improve the problems of low testing efficiency and high labor costs in current existing USB peripheral device testing that requires a large amount of human participation.
[0005] The embodiments of this application are implemented as follows:
[0006] In a first aspect, an embodiment of this application provides a testing system, including: a USB switch, a controller, and a control device; the USB switch is used to connect multiple USB test devices and to connect to a testing platform, where the testing platform is used to test each USB test device; the controller is connected to the USB switch, the control device is connected to the controller and is used to connect to the testing platform; the controller is configured to respond to the control of the control device and control the USB switch to switch the current USB test device connected to the testing platform to the next USB test device corresponding to the switching instruction according to the switching instruction; the control device is configured to, after testing the current USB test device, control the controller to send the switching instruction; and obtain the device type of the next USB test device from the testing platform and control the testing platform to execute the corresponding test program according to the device type of the next USB test device.
[0007] In the above embodiments, through the mutual cooperation among the USB switch, the controller, and the control device, the switching between different USB test devices during the test can be automatically achieved, enabling the entire test process to be controlled by an automated test script without manual intervention. It can realize the fully automated test process for various USB test devices and various scenarios, achieving the purposes of improving test efficiency, increasing the utilization rate of the test platform, and reducing labor input.
[0008] Combined with a possible implementation manner of the first aspect embodiment, the control device is further configured to obtain the log information generated during the operation of the test platform, obtain the device type of the USB test device connected to the test platform from the log information, and detect the preset key information in the log information, where when the preset key information is detected, it indicates that the current USB test device test is completed.
[0009] In the above embodiments, the control device analyzes the log information to learn the device type of the USB test device connected to the test platform, so as to control the test platform to execute the corresponding test program according to the device type, achieving precise control of the test process. At the same time, it detects the preset key information in the log information to monitor the test process and controls the controller to achieve device switching, enabling full automation of the test without manual intervention throughout the process. At the same time, based on the existing analysis of the log information for control without introducing other parameters, it can simplify the control process and improve test efficiency while achieving its purpose.
[0010] Combined with a possible implementation manner of the first aspect embodiment, if the device type of the next USB test device is a storage device, the control device is specifically configured to control the test platform to execute the test program corresponding to the storage device; if the device type of the next USB test device is a keyboard and mouse device, the control device is specifically configured to control the test platform to execute the click test program corresponding to the keyboard and mouse device.
[0011] In the above embodiments, different test programs are executed for different device types, thereby ensuring the accuracy of the test.
[0012] Combined with a possible implementation manner of the first aspect embodiment, the multiple USB test devices include keyboard and mouse devices, and the test system further includes: a clicker, the clicker is connected to the controller; the controller is further configured to respond to the control of the control device and send a first control instruction to the clicker; the clicker is configured to automatically click on the keyboard and mouse device based on the first control instruction.
[0013] In the above embodiments, when a keyboard and mouse device is included, by setting a clicker and controlling the clicker, automatic clicking on the keyboard and mouse device is achieved, which is beneficial to improving the test efficiency.
[0014] Combined with a possible implementation manner of the first aspect embodiment, the clicker includes: a bracket and an electric telescopic device including a power control unit and an electromagnetic module; the bracket includes a base and a fixing frame, the fixing frame includes a fixing part located above the base; the electric telescopic device is fixed on the fixing part, and the telescopic end of the electromagnetic module is located above the base. The power on and off of the electromagnetic module is controlled by the power control unit. When the electromagnetic module is powered on, the telescopic end of the electromagnetic module extends, and when the electromagnetic module is powered off, the telescopic end of the electromagnetic module contracts; the power control unit is connected to the controller, and the power control unit is configured to control the power on and off of the electromagnetic module based on the first control instruction; the electromagnetic module is configured to respond to the control of the power control unit, and the telescopic end of the electromagnetic module realizes automatic clicking on the keyboard and mouse device placed on the base or the horizontal plane where the base is located through up and down reciprocating motion.
[0015] In the above embodiments, when using a clicker with the above structure, when controlling the clicker to perform a clicking operation, only the power on and off of the electromagnetic module needs to be controlled through the first control instruction, so as to control the extension or contraction of the telescopic end of the electromagnetic module. By repeating the control, the telescopic end of the electromagnetic module can perform up and down reciprocating motion, thereby realizing repeated clicking on the keyboard and mouse device. It has the advantages of simple structure and simple control principle and is easy to implement.
[0016] Second aspect, the embodiments of the present application also provide a test method, which is applied to a control device. The control device is used to connect a test platform and a controller. Among them, the test platform is used to connect a USB switch, the USB switch is used to connect multiple USB test devices, and the controller is used to connect the USB switch. The method includes: obtaining the device type of the current USB test device connected to the test platform; controlling the test platform to execute a corresponding test program according to the device type of the current USB test device; after testing the current USB test device, controlling the USB switch by the controller to switch the current USB test device to the next USB test device; obtaining the device type of the next USB test device from the test platform and controlling the test platform to execute a corresponding test program according to the device type of the next USB test device.
[0017] According to a possible implementation manner of the embodiments of the second aspect, obtaining the current USB test device connected to the test platform includes: obtaining the log information generated during the operation of the test platform; and obtaining the device type of the current USB test device connected to the test platform from the log information.
[0018] According to a possible implementation manner of the embodiments of the second aspect, the method further includes: detecting preset key information in the log information; and when the preset key information is detected, indicating that the test of the current USB test device is completed.
[0019] According to a possible implementation manner of the embodiments of the second aspect, controlling the test platform to execute a corresponding test program according to the device type of the current USB test device includes: if the device type of the current USB test device is a storage device, controlling the test platform to execute the test program corresponding to the storage device; if the device type of the current USB test device is a keyboard and mouse device, controlling the test platform to execute the click test program corresponding to the keyboard and mouse device.
[0020] According to a possible implementation manner of the embodiments of the second aspect, the controller is further configured to connect to a clicker, and the method further includes: if the device type of the current USB test device is a keyboard and mouse device, controlling the clicker to automatically click on the keyboard and mouse device through the controller.
[0021] In a third aspect, an embodiment of the present application further provides an electronic device, including: a memory and a processor, the processor is connected to the memory; the memory is used for storing a program; the processor is used for calling the program stored in the memory to execute the method provided by the embodiments of the second aspect and / or any possible implementation manner in combination with the embodiments of the second aspect.
[0022] In a fourth aspect, an embodiment of the present application further provides a clicker for clicking on a keyboard and mouse device. The clicker includes: a bracket and an electric telescopic device including a power control unit and an electromagnetic module; the bracket includes a base and a fixing frame, and the fixing frame includes a fixing portion located above the base; the electric telescopic device is fixed on the fixing portion, and the telescopic end of the electromagnetic module is located above the base. The power on and off of the electromagnetic module is controlled by the power control unit. When the electromagnetic module is powered on, the telescopic end of the electromagnetic module extends, and when the electromagnetic module is powered off, the telescopic end of the electromagnetic module contracts; wherein, the electromagnetic module is configured to respond to the control of the power control unit, and the telescopic end of the electromagnetic module realizes automatic clicking on the keyboard and mouse device placed on the base or the horizontal plane where the base is located through reciprocating up and down movement.
[0023] In the above embodiments, for the clicker with the above structure, when controlling the clicker to perform a click operation, only the power supply of the electromagnetic module needs to be controlled to be turned on or off by the power supply control unit, so as to control the extension or contraction of the telescopic end of the electromagnetic module. By repeatedly controlling, the telescopic end of the electromagnetic module can move up and down reciprocally, thereby realizing repeated clicking on the mouse and keyboard devices. It has the advantages of simple structure and simple control principle, and is easy to implement.
[0024] Combined with a possible implementation manner of the fourth aspect of the embodiment, the electromagnetic module includes: a fixing ring, an electromagnetic coil, an elastic member, and an electromagnetic push rod; the fixing ring is fixedly connected to the fixing part; the electromagnetic coil is fixedly connected to the fixing ring and connected to the power supply control unit; the first end of the elastic member is fixedly connected to the fixing ring; the first end of the electromagnetic push rod passes through the electromagnetic coil and is fixedly connected to the second end of the elastic member, and the second end of the electromagnetic push rod can move up and down.
[0025] In the above embodiments, with the electromagnetic module having the above structure, when the electromagnetic module is energized, a magnetic field is generated and a downward force is applied to the electromagnetic push rod, thereby realizing the clicking process. The elastic member is compressed after being pressed by the electromagnetic push rod to generate a reverse force, and can timely return the electromagnetic push rod when the magnetic field of the coil disappears, so that the telescopic end of the electromagnetic module can move up and down reciprocally. The above structure of the electromagnetic module is simple and reliable in performance, and can save the design cost.
[0026] Combined with a possible implementation manner of the fourth aspect of the embodiment, a fixing member is provided on the base, and the fixing member is used to fix the mouse and keyboard devices placed on the base.
[0027] In the above embodiments, the mouse and keyboard devices are fixed to the base by using the fixing member, avoiding errors in testing caused by the movement of the mouse and keyboard devices during the clicking process, which may lead to different clicking positions. By fixing the clicker, the position of each click is the same, thereby improving the test accuracy.
[0028] Combined with a possible implementation manner of the fourth aspect of the embodiment, the fixing frame includes: a first bracket, a second bracket, and a third bracket; the first end of the first bracket is fixedly connected to the base in the vertical direction; the first end of the second bracket is connected to the second end of the first bracket in the horizontal direction; the third bracket is connected to the second end of the second bracket in the vertical direction; the third bracket includes a slide rail, and the electric telescopic device is fixed on the slide rail.
[0029] In the above embodiments, with the fixing frame having the above structure, the position of the electric telescopic device and the mouse and keyboard devices can be adjusted by adjusting the position of the electric telescopic device and the slide rail, so as to be applicable to the testing of different mouse and keyboard devices.
[0030] Other features and advantages of the present application will be described in the following specification. The objectives and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the written specification and the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other accompanying drawings can also be obtained based on these drawings. As shown in the accompanying drawings, the above-mentioned and other objectives, features, and advantages of the present application will be more clearly presented.
[0032] Figure 1 Fig. 1 shows a schematic structural diagram of a test system provided by an embodiment of the present application connected to a test platform and a USB test device.
[0033] Figure 2 Fig. 2 shows another schematic structural diagram of a test system provided by an embodiment of the present application connected to a test platform and a USB test device.
[0034] Figure 3 Fig. 3 shows a schematic structural diagram of a clicker provided by an embodiment of the present application.
[0035] Figure 4 Fig. 4 shows a schematic structural diagram of a bracket in a clicker provided by an embodiment of the present application.
[0036] Figure 5 Fig. 5 shows another schematic structural diagram of a clicker provided by an embodiment of the present application.
[0037] Figure 6 Fig. 6 shows a schematic flowchart of a test method provided by an embodiment of the present application.
[0038] Figure 7 Fig. 7 shows a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] The following will describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. The following embodiments can be used as examples to more clearly illustrate the technical solutions of the present application, but cannot be used to limit the protection scope of the present application. Those skilled in the art can understand that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0040] It should be noted that like reference numerals and letters refer to like items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. At the same time, in the description of the present application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device.
[0041] Furthermore, the term "and / or" in the present application is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone.
[0042] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, the technical term "connection" may be a direct connection or an indirect connection through an intermediate medium. "Connection" may refer to "communication connection", and "communication connection" includes physical (such as cables) or logical (such as connection established by a protocol) connections. Among them, physical connections may be electrical connections through metal wires or optical connections through optical fibers, etc.; logical connections may be wireless connections. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.
[0043] Currently, when using a USB peripheral device to test the design under test in a test platform, after the hardware emulator completes the test of one USB peripheral device, it is necessary to manually replace the USB peripheral device connected to the test platform. After the replacement is completed, the test system needs to be restarted to start the test of the next USB peripheral device. After completing the test of the next USB peripheral device, the above process is repeated, that is, the above process of manually replacing the USB peripheral device connected to the test platform... etc. This test method requires a large amount of human participation, resulting in low test efficiency and high labor costs.
[0044] Given that existing USB peripheral device testing requires a large amount of manpower, resulting in low testing efficiency and high labor costs, embodiments of the present application provide a testing system and testing method thereof. The testing system includes a USB switch, a controller, and a control device. Through the mutual cooperation between the USB switch, the controller, and the control device, switching between different USB test devices during testing can be automatically achieved. This allows the entire testing process to be controlled by an automated test script without the need for human intervention, enabling a fully automated testing process for multiple USB test devices and multiple scenarios, thereby improving testing efficiency, increasing test platform utilization, and reducing manpower investment.
[0045] The following combination Figure 1 The test system provided in an embodiment of the present application is described. The test system includes a USB switch, a controller, and a control device. The control device is connected to the controller, and the controller is connected to the USB switch. In some possible implementations, the control device and the controller can be wirelessly connected.
[0046] In some possible implementations, the test system may further include a clicker. In addition, the test system may further include Figure 1 A test platform, multiple USB test devices (USB test device 1, USB test device 2...USB test device n), etc.
[0047] The USB switch is used to connect multiple USB test devices and to connect to a test platform. The USB switch includes multiple USB interfaces and output ports with hot-swappable features. The multiple USB interfaces are used to connect multiple USB test devices, and the output ports are used to connect to a test platform. The USB switch includes a MUX (multiplexer) chip, which is connected to multiple USB interfaces and output ports. The MUX is a combinational logic circuit that selects a single output signal from multiple input signals. The USB switch can be controlled by a controller to automatically select and switch between multiple USB test devices to select a specific USB test device to connect to the test platform. Since the USB switch has hot-swappable features, there is no need to repeatedly restart after switching devices, which can improve test efficiency.
[0048] The multiple USB test devices connected by the USB switch can include different device types. For example, they can include keyboard and mouse devices, storage devices, etc., and their device types can depend on the test requirements. Among them, the keyboard and mouse devices include USB mouse devices and USB keyboard devices. Since there are many types of USB peripherals, multiple USB test devices that can cover different test types are selected during testing. Each USB test device has a unique identification number to facilitate device identification based on the identification number, and the identification number can be the device model, etc. The USB switch can be connected to each USB test device to be tested in advance, and the other end of the USB switch can be connected to the speed bridge.
[0049] The test platform is used to test each USB test device. The test platform includes a speed bridge and a hardware emulator. The USB DUT (Design Under Test) to be tested runs in the hardware emulator. The USB DUT can be the RTL (Register Transfer Level) code design corresponding to the design to be tested. Since the USB DUT and external devices do not run in the same time dimension and there are differences in their operating frequencies, a speed bridge is needed for connection.
[0050] Different types of test programs are preset in the hardware emulator platform to facilitate the testing of different USB test devices. For example, it includes a click test program corresponding to keyboard and mouse devices, a test program corresponding to storage devices, etc. The click test program corresponding to keyboard and mouse devices can be used to test keyboard and mouse devices, and the test program corresponding to storage devices can be used to test storage devices. The hardware emulator will record the log information generated during operation. For example, the log information is recorded in a log file so that the control device can control the entire test process based on this log information.
[0051] Among them, the click test program corresponding to keyboard and mouse devices can be a test program that clicks on the key values of keyboard and mouse devices. The test is considered successful if the key values returned by the click are detected or the click behavior is detected.
[0052] A controller, configured to respond to the control of a control device and control a USB switch to switch the current USB test device connected to a test platform to the next USB test device corresponding to a switching instruction according to the switching instruction. For example, in one implementation, the control device may send a switching instruction to the controller, the controller receives the switching instruction from the control device, and controls the USB switch based on the switching instruction. In another implementation, the control device may control the USB switch not by sending a switching instruction to the controller, but by logging in to the controller to control the controller to send a switching instruction to the USB switch. For example, after the control device logs in to a Raspberry Pi through a packaged login function (including SSH login, where SSH is a secure network remote login protocol), it directly sends a switching instruction to the USB switch to control the USB switch to perform device switching.
[0053] In some possible implementations, the controller may be a Raspberry Pi. The USB switch can be connected to the Raspberry Pi at the control end by controlling gpio (general purpose input output) pins, and the Raspberry Pi is then connected to the control device through a local area network. The Raspberry Pi can learn the device model of the current USB test device connected to the test platform, and the Raspberry Pi can send information to the control device to inform the control device of the current USB test device connected to the test platform. The Raspberry Pi can respond to the control of the control device and control the USB switch to switch the current USB test device connected to the test platform to the next USB test device corresponding to the switching instruction. In addition, the user can also query the connection status of the USB switch in the Raspberry Pi and perform device switching by manually operating the Raspberry Pi according to requirements.
[0054] The control device is used to connect to the test platform. In one possible implementation, the control device may be connected to the test platform through wireless communication. The control device can control the test platform to test each USB test device. The control device can control the controller to implement the selection and switching of multiple USB test devices by the USB switch. The control device includes, but is not limited to, a server, etc.
[0055] In some embodiments, the control device is configured to control the controller to send a switching instruction after testing the current USB test device; and obtain the device type of the next USB test device from the test platform, and control the test platform to execute the corresponding test program according to the device type of the next USB test device. This process can be repeated multiple times, and the testing of each USB test device can be achieved through repetition. For example, first test USB test device 1, after the test, switch to test USB test device 2, after the test, switch to test USB test device 3, after the test, switch to test USB test device 4, and so on, until the testing of all USB test devices is completed.
[0056] Among them, when the control device controls the controller to send a switching instruction, it can control the controller to send a switching instruction by logging in to the controller. It can also control the controller to forward the switching instruction by sending a switching instruction to the controller.
[0057] When the test platform has finished testing the current USB test device, the control device can control the USB switch through the controller by sending a switching instruction to the controller. When the test platform has finished testing the current USB test device, the control device can judge whether the current USB test device is the last USB test device through the recorded switching information (used to record information such as the device signal of the switched USB test device). If not, control the USB switch to switch to the next USB test device through the controller and update the switching information. After the USB switch switches the current USB test device connected to the test platform to the next USB test device, the control device obtains the device type of the next USB test device from the test platform, and controls the test platform to execute the corresponding test program according to the device type of the next USB test device.
[0058] As an example, it can also be to record information such as the device signal of the switched USB test device in the controller. After the control device logs in to the Raspberry Pi through the encapsulated login function, view the recorded information, judge whether the current USB test device is the last USB test device. If not, control the USB switch to switch to the next USB test device and update the recorded information in the controller.
[0059] In one embodiment, the switching instruction may include the device model of the next USB test device to be switched. Since the control device can learn about the current USB test device connected to the test platform through the controller, the device models of the remaining USB test devices except the current USB test device can be carried in the switching instruction for precise control.
[0060] In another implementation, the switching instruction can be just a general control instruction and may not include the device model of the next USB test device to be switched. In this implementation, the controller can periodically control the USB switch to perform device switching and record the device model of the USB test device for each switching, so as to preferentially control the USB test device that has not been connected to be connected to the test platform.
[0061] In some implementations, the control device is further configured to obtain the device type of the current USB test device connected to the test platform from the test platform, and control the test platform to execute a corresponding test program according to the device type of the current USB test device.
[0062] In some implementations, the control device is further configured to obtain the log information generated during the operation of the test platform, obtain the device type of the USB test device connected to the test platform from the log information, and detect the preset key information in the log information, where when the preset key information is detected, it indicates that the current USB test device has completed the test.
[0063] The control device can obtain or monitor in real time the log information generated during the operation of the test platform. According to this log information, the device type of the current USB test device connected to the test platform can be learned, so as to control the test platform to execute a corresponding test program according to the device type. In some possible implementations, the device type of the USB test device can be informed to the control device by the controller. For example, the controller can inform the device type of the current USB test device or the next USB test device connected to the test platform by interacting with the control device.
[0064] The control device can learn about the test process by detecting the preset key information in the log information, such as whether the test is completed or whether there is an error in the test. Among them, the preset key information for detecting the completion of the USB test device test is different from the preset key information for detecting whether there is an error in the test, and for different types of USB test devices, the preset key information for detecting the completion of their tests is also different. For example, for a USB test device of the USB flash drive type, when "Disk stats" is detected from the log information, it indicates that the test has ended or been completed. The specific preset key information can be set according to the detection needs and will not be exemplified here. By detecting whether the preset key information is included in the log information, it is determined whether the current USB test device has completed the test, so as to switch to the next USB test device in time when the test is completed.
[0065] The log information can also include the test result. According to the test result in the log information, it can be learned whether the current test meets the requirements. If an exception occurs, the control device can output the exception information.
[0066] When the control device controls the test platform to execute the corresponding test program according to the device type of the next USB test device, if the device type of the next USB test device is a storage device, the control device is specifically configured to control the test platform to execute the test program corresponding to the storage device; if the device type of the next USB test device is a keyboard and mouse device, the control device is specifically configured to control the test platform to execute the click test program corresponding to the keyboard and mouse device.
[0067] Similarly, when the control device controls the test platform to execute the corresponding test program according to the device type of the current USB test device, if the device type of the current USB test device is a storage device, the control device is specifically configured to control the test platform to execute the test program corresponding to the storage device; if the device type of the current USB test device is a keyboard and mouse device, the control device is specifically configured to control the test platform to execute the click test program corresponding to the keyboard and mouse device.
[0068] In a possible implementation, if multiple USB test devices include keyboard and mouse devices, as Figure 2 shown, the test system further includes: a clicker, and the clicker is connected to the controller. At this time, the controller is further configured to respond to the control of the control device and send a first control instruction to the clicker to control the clicker to perform a click operation.
[0069] In one implementation, the control device can control the controller by sending a second control instruction to the controller. At this time, the controller can receive the second control instruction from the control device and send the first control instruction to the clicker based on the second control instruction. Among them, the second control instruction is sent by the control device when the device type of the test device connected to the test platform is a keyboard and mouse device.
[0070] In some possible implementations, the first control instruction and the second control instruction can be different. The first control instruction can be a level signal, which can include a high-level signal and a low-level signal. The second control instruction can be a general control instruction.
[0071] In another possible implementation, the control device can also control the clicker not by sending a second control instruction to the controller, but by logging in to the controller. For example, after the control device logs in to the Raspberry Pi through the encapsulated login function, it directly sends a first control instruction to the clicker to control the clicker to perform a click operation.
[0072] The mouse and keyboard device can be fixed to the clicker in advance. The clicker can be connected to the controller through GPIO pins. The clicker is controlled by the controller and can achieve automatic clicking of the mouse and keyboard device under the control of the controller. For example, the clicker is configured to achieve automatic clicking of the mouse and keyboard device based on the first control instruction.
[0073] In some possible implementation manners, such as Figure 3 As shown, the clicker includes: a bracket 10 and an electric telescopic device 20 including a power control unit 21 and an electromagnetic module 23. The electric telescopic device 20 may further include a housing. The power control unit 21 and the electromagnetic module 23 are built into the housing, and an opening for the telescopic end 2341 to extend is provided on the housing. The telescopic end 2341 is located at the opening and outside the housing.
[0074] Among them, the bracket 10 includes a base 11 and a fixing frame 12. The fixing frame 12 includes a fixing part located above the base 11 to facilitate fixing the electric telescopic device 20. The mouse and keyboard device can be fixed on the base 11 or the horizontal plane where the base 11 is located, corresponding to the electric telescopic device 20.
[0075] In some possible implementation manners, the base 11 can be a suction cup base to facilitate fixing the clicker. A fixing member (not shown) can be provided on the base 11. The fixing member is used to fix the mouse and keyboard device placed on the base 11. For example, the fixing member can be a suction cup type fixing member or a pasting type fixing member, etc.
[0076] In some possible implementation manners, the fixing frame 12 can be a fixing frame 12 with a specific shape, such as a fixing frame 12 in an "inverted L shape" or an "S shape", etc., so as to realize the clicking operation on the mouse and keyboard device placed on the base 11 or the horizontal plane where the base 11 is located after the electric telescopic device 20 is fixed on the fixing frame 12. Figure 3 Only the fixing frame 12 in an "inverted L shape" of the fixing frame 12 is shown.
[0077] In some possible implementation manners, such as Figure 4 As shown, the fixing frame 12 includes: a first bracket 121, a second bracket 122, and a third bracket 123. The first end of the first bracket 121 is fixedly connected to the base 11 in the vertical direction; the first end of the second bracket 122 is connected to the second end of the first bracket 121 in the horizontal direction; the third bracket 123 is connected to the second end of the second bracket 122 in the vertical direction; the third bracket 123 includes a slide rail 1231. The electric telescopic device 20 is fixed on the slide rail 1231. Using the slide rail 1231 to fix the electric telescopic device 20 is convenient for adjusting the distance from the mouse and keyboard device. Through holes are spaced on the slide rail 1231, so that after adjusting to a suitable position, the electric telescopic device 20 can be fixed on the slide rail 1231 by using fixing screws passing through the through holes.
[0078] In some possible embodiments, Figure 4 the shown first bracket 121, second bracket 122, and third bracket 123 may be an integrally formed structure.
[0079] As Figure 3 shown in, the electric telescopic device 20 is fixed to the fixing bracket 12, and the telescopic end 2341 of the electromagnetic module 23 is located above the base 11. The power on / off of the electromagnetic module 23 is controlled by the power control unit 21. When the electromagnetic module 23 is powered on, the telescopic end 2341 of the electromagnetic module 23 extends, and when the electromagnetic module 23 is powered off, the telescopic end 2341 of the electromagnetic module 23 retracts.
[0080] The power control unit 21 is connected to the controller. For example, the power control unit 21 is connected to the controller through gpio pins. The power control unit 21 is configured to control the power on / off of the electromagnetic module 23 based on the first control instruction. The power control unit 21 may include a relay. The electromagnetic module 23 may be connected to the power supply VDD through a conductive wire, and the power on / off of the electromagnetic module 23 is controlled through the relay. For example, the control pin (gpio pin) of the power control unit 21 can be connected to a Raspberry Pi. The Raspberry Pi gives a high-level signal to the gpio pin to the relay to control the power-on of the electromagnetic module 23. After the electromagnetic module 23 is powered on, its telescopic end 2341 extends to achieve a click operation. Then the Raspberry Pi gives a low-level signal to the gpio pin to the relay to control the power-off of the electromagnetic module 23. After the electromagnetic module 23 is powered off, its telescopic end 2341 retracts. By continuously controlling the power on / off of the electromagnetic module 23, the up and down reciprocating movement of the telescopic end 2341 of the electromagnetic module 23 is controlled.
[0081] The electromagnetic module 23 is configured to respond to the control of the power control unit 21. The telescopic end 2341 of the electromagnetic module 23 realizes the automatic click on the mouse and keyboard devices placed on the base 11 or the horizontal plane where the base 11 is located through up and down reciprocating movement. For the electromagnetic module 23, which is a key component of the clicker, two signal wires are led out as the positive and negative poles of the electromagnetic module 23 and connected to the relay. The relay leads out the power supply and control pins to control the telescopic state of the electromagnetic module 23.
[0082] In some possible embodiments, as Figure 5 shown, the electromagnetic module 23 includes: a fixing ring 231, an electromagnetic coil 232, an elastic member 233 (which can be a return spring), and an electromagnetic push rod 234. In some embodiments, the fixing bracket 12 in Figure can be replaced with other fixing brackets, for example, replaced with the fixing bracket 12 shown in shown.
[0083] In addition to being a return spring, the elastic member 233 can also be other metal elastic members or non-metal elastic members, such as rubber elastic members, as long as it can achieve timely return of the electromagnetic push rod 234 when the magnetic field of the electromagnetic coil 232 disappears.
[0084] The edge of the fixing ring 231 is fixedly connected to the fixing part (such as a slide rail type fixing part) of the fixing frame 12. The fixing ring 231 is fixed on the slide rail 1231 through the fixing screw 15. The position of the fixing ring 231 fixed on the slide rail 1231 can be adjusted to adjust the distance between the electromagnetic push rod 234 and the peripheral click point placed under the base 11 ( The base 11 shown is a suction cup base).
[0085] The electromagnetic coil 232 is fixedly connected to the fixing ring 231 and connected to the power control unit 21 (including a relay). Two signal lines can be led out at the electromagnetic coil 232 as the positive and negative poles of the electromagnetic module 23 and connected to the relay.
[0086] The first end of the elastic member 233 is fixedly connected to the fixing ring 231, and the first end of the elastic member 233 is fixedly connected to the electromagnetic push rod 234. The elastic member 233 can include, but is not limited to, a return spring.
[0087] The first end of the electromagnetic push rod 234 passes through the electromagnetic coil 233 and is fixedly connected to the second end of the elastic member 233. The second end of the electromagnetic push rod 234 can move up and down, and the second end of the electromagnetic push rod 234 is the telescopic end 2341 of the electromagnetic module 23. For example, when the electromagnetic module 23 is energized to generate a magnetic field and gives a downward force to the electromagnetic push rod 234, the click process is realized. The return spring is compressed to generate a reverse force after the electromagnetic push rod 234 is pressed down, and can timely return the electromagnetic push rod 234 when the coil magnetic field disappears.
[0088] The embodiment of the present application also provides a test method applied to the above control device, where the control device is used to connect a test platform and a controller. The following combines To illustrate the test method shown in the present application.
[0089] S1: Obtain the device type of the current USB test device connected to the test platform.
[0090] In one implementation, the device type of the current USB test device connected to the test platform can be obtained from the test platform. After the test platform starts and enters the system, it will automatically load the USB driver to enumerate devices. After detecting that the device enumeration is completed, it will record it in the log information. The control device can obtain the log information generated during the operation of the test platform and obtain the device type of the current USB test device connected to the test platform from the log information.
[0091] S2: Control the test platform to execute the corresponding test program according to the device type of the current USB test device.
[0092] Different device types correspond to different test programs. For example, the implementation process of S2 may include: if the device type of the current USB test device is a storage device, control the test platform to execute the test program corresponding to the storage device; if the device type of the current USB test device is a keyboard and mouse device, control the test platform to execute the click test program corresponding to the keyboard and mouse device.
[0093] S3: After testing the current USB test device, control the USB switch to switch the current USB test device to the next USB test device through the controller.
[0094] In a possible implementation manner, the test method further includes: detecting preset key information in the log information; when the preset key information is detected, it indicates that the current USB test device has been tested. After testing the current USB test device, control the USB switch to switch the current USB test device to the next USB test device through the controller. For example, it can be to send a switching instruction to the controller, and control the USB switch to switch the current USB test device to the next USB test device through the switching instruction.
[0095] S4: Obtain the device type of the next USB test device from the test platform, and control the test platform to execute the corresponding test program according to the device type of the next USB test device.
[0096] The control device can obtain the log information generated during the operation of the test platform, obtain the device type of the next USB test device from the log information, and control the test platform to execute the corresponding test program according to the device type of the next USB test device. For example, when controlling the test platform to execute the corresponding test program according to the device type of the next USB test device, the process may include: if the device type of the next USB test device is a storage device, control the test platform to execute the test program corresponding to the storage device; if the device type of the next USB test device is a keyboard and mouse device, control the test platform to execute the click test program corresponding to the keyboard and mouse device.
[0097] In a possible implementation manner, if the controller is further used to connect to a clicker, the above test method further includes: if the device type of the current USB test device is a keyboard and mouse device, control the clicker to automatically click on the keyboard and mouse device through the controller.
[0098] The testing method provided in the embodiment of the present application has the same implementation principle and technical effects as those in the aforementioned testing system embodiment. For the sake of brief description, for matters not mentioned in the method embodiment, reference can be made to the corresponding content in the aforementioned testing system embodiment.
[0099] The embodiment of the present application also provides a clicker for clicking keyboard and mouse devices. The structure of the clicker is the same as that of the clicker in the above-mentioned test system, and will not be repeated here.
[0100] The implementation principle and technical effects of the clicker embodiment are the same as those of the clicker in the aforementioned test system embodiment. For the sake of brief description, for matters not mentioned in the clicker embodiment, reference can be made to the corresponding content in the aforementioned test system embodiment.
[0101] like As shown, FIG2 shows a block diagram of an electronic device 700 according to an embodiment of the present application. The electronic device 700 includes a transceiver 701 , a memory 702 , a communication bus 703 , and a processor 704 .
[0102] The transceiver 701, the memory 702, and the processor 704 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 703 or signal lines. Among them, the transceiver 701 is used to send and receive data. The memory 702 is used to store computer programs, wherein the computer program includes at least one software function module that can be stored in the memory 702 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 700. The processor 704 is used to execute the software function module or computer program stored in the memory 702. For example, the processor 704 is used to execute the above-mentioned test method.
[0103] Among them, the memory 702 can be, but is not limited to, random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0104] The processor 704 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 704 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), a Graphics Processing Unit (GPU), an Accelerated Processing Unit, a Multimedia Application Processor (MAP), a microprocessor, etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. Or the processor 704 may also be any conventional processor, etc.
[0105] Among them, the above-mentioned electronic device 700 includes, but is not limited to, a tablet computer, a computer, a server, or the above-mentioned control device, etc.
[0106] The embodiments of the present application also provide a non-volatile computer-readable storage medium (hereinafter referred to as the storage medium), on which a computer program is stored. When the computer program is run by a computer such as the above-mentioned electronic device, it executes the above-mentioned test method.
[0107] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other.
[0108] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0109] In addition, each functional module in various embodiments of the present application can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0110] If the above functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium and includes several instructions for causing a computer device (which can be a personal computer, a laptop, a control device, or an electronic device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned computer-readable storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0111] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A test system, characterized in that, Comprising: A USB switch, a controller, and a control device; The USB switch is used to connect multiple USB test devices and to connect to a test platform, wherein the test platform is used to test each USB test device; The controller is connected to the USB switch, the control device is connected to the controller and is used to connect to the test platform; The controller is configured to respond to the control of the control device and control the USB switch to switch the current USB test device connected to the test platform to the next USB test device corresponding to the switching instruction according to the switching instruction; The control device is configured to, when the current USB test device has been tested, control the controller to send the switching instruction; and obtain the device type of the next USB test device from the test platform, and control the test platform to execute a corresponding test program according to the device type of the next USB test device.
2. The test system according to claim 1, wherein The control device is further configured to obtain the log information generated during the operation of the test platform, and obtain the device type of the USB test device connected to the test platform from the log information, and detect the preset key information in the log information, wherein when the preset key information is detected, it indicates that the current USB test device has been tested.
3. The test system according to claim 1, wherein If the device type of the next USB test device is a storage device, the control device is specifically configured to control the test platform to execute the test program corresponding to the storage device; If the device type of the next USB test device is a keyboard and mouse device, the control device is specifically configured to control the test platform to execute the click test program corresponding to the keyboard and mouse device.
4. The test system according to any one of claims 1-3, characterized in that, The multiple USB test devices include a keyboard and mouse device, and the test system further includes: a clicker, and the clicker is connected to the controller; The controller is further configured to respond to the control of the control device and send a first control instruction to the clicker; The clicker is configured to realize automatic clicking on the keyboard and mouse device based on the first control instruction.
5. The test system according to claim 4, wherein The clicker includes: A bracket, including a base and a fixing frame, and the fixing frame includes a fixing portion located above the base; An electric telescopic device including a power control unit and an electromagnetic module is fixed on the fixing portion, and the telescopic end of the electromagnetic module is located above the base. The power on and off of the electromagnetic module is controlled by the power control unit. When the electromagnetic module is powered on, the telescopic end of the electromagnetic module extends, and when the electromagnetic module is powered off, the telescopic end of the electromagnetic module contracts; The power control unit is connected to the controller, and the power control unit is configured to control the power on and off of the electromagnetic module based on the first control instruction. The electromagnetic module is configured to respond to the control of the power control unit, and the telescopic end of the electromagnetic module reciprocates up and down to achieve automatic clicking of the keyboard and mouse device placed on the base or on the horizontal plane where the base is located.
6. A testing method, characterized in that, Applied to a control device, the control device is used to connect a test platform and a controller, wherein the test platform is used to connect to a USB switch, the USB switch is used to connect to multiple USB test devices, and the controller is used to connect to the USB switch, the method comprising: Obtaining the device type of the current USB test device connected to the test platform; Controlling the test platform to execute a corresponding test program according to the device type of the current USB test device; When the current USB test device is tested, the controller controls the USB switch to switch the current USB test device to the next USB test device; The device type of the next USB test device is obtained from the test platform, and the test platform is controlled to execute a corresponding test program according to the device type of the next USB test device.
7. The method according to claim 6, wherein Obtaining the current USB test device connected to the test platform, including: Obtaining log information generated during the operation of the test platform; The device type of the current USB test device connected to the test platform is obtained from the log information.
8. The method according to claim 7, characterized in that, The method further comprises: Detecting preset key information in the log information; When the preset key information is detected, it indicates that the test of the current USB test device is completed.
9. The method according to claim 6, characterized in that, Controlling the test platform to execute a corresponding test program according to the device type of the current USB test device includes: If the device type of the current USB test device is a storage device, controlling the test platform to execute a test program corresponding to the storage device; If the device type of the current USB test device is a keyboard and mouse device, the test platform is controlled to execute a click test program corresponding to the keyboard and mouse device.
10. The method according to any one of claims 6-9, characterized in that, The controller is further configured to connect to a clicker, and the method further comprises: If the device type of the current USB test device is a keyboard and mouse device, the controller controls the clicker to automatically click the keyboard and mouse device.
11. An electronic device, characterized in that, include: a memory and a processor, wherein the processor is connected to the memory; The memory is used to store programs; The processor is configured to call a program stored in the memory to execute the method according to any one of claims 6 to 10.