Otg function detection method, system, device and apparatus

CN115718684BActive Publication Date: 2026-10-27SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211475151.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-25
Publication Date
2026-10-27
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种OTG功能检测方法、系统、装置及设备,用以改善OTG功能测试方案存在效率较低、检测成本高的问题

Benefits of technology

[0023]第七方面,本发明还提供一种芯片或芯片模组,芯片或芯片模组与存储器耦合,用于执行所述存储器中存储的计算机程序,使得所述电子设备执行上述任一方面的任意一种可能的设计的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115718684B_ABST
    Figure CN115718684B_ABST
Patent Text Reader

Abstract

The application provides an OTG function detection method, system, device and equipment. The OTG function automatic detection can be executed by a host computer. The method comprises the following steps: the host computer sends a first control instruction to a first to-be-detected device and a second to-be-detected device. The first control instruction is used for configuring the first to-be-detected device as a power supply device and the second to-be-detected device as a powered device. A USB interface of the first to-be-detected device is connected with a USB interface of the second to-be-detected device through a USB OTG line. The host computer receives a first detection signal from the first to-be-detected device through a first transmission line and receives a second detection signal from the second to-be-detected device through a second transmission line. Whether the OTG function of a first transmission direction of the USB OTG line is normal is determined according to the first detection signal and the second detection signal. The method can improve the problems of low efficiency and high detection cost of the OTG function test scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communications, and more particularly to an OTG function detection method, system, apparatus, and device. Background Technology

[0002] Currently, USB interfaces are ubiquitous on mobile devices such as smartphones and smartwatches. The development of USB technology has enabled personal computers (PCs) and other devices to connect together at various data transfer speeds in a simple and cost-effective manner. The Universal Serial Bus (USB) On-The-Go (OTG) interface protocol technology enables data transfer between devices without a host. OTG technology allows for the expansion of USB interfaces on mobile devices, enriching their functionality.

[0003] To determine the performance of data transmission paths between hardware devices during product manufacturing, performance testing of OTG input and output functions is necessary. During testing, external devices typically need to be connected and unplugged for bidirectional testing. To ensure the accuracy of hardware system test results, manual multiple plugging and unplugging of external devices and judgment of transmission results are usually performed to evaluate the product under test. This method of testing USB OTG functionality is not only inefficient, but also inconvenient due to the limited lifespan of USB interfaces, making repeated plugging and unplugging for verification difficult and failing to guarantee the stability of the product's function. Therefore, existing OTG function testing solutions suffer from low efficiency, reduced lifespan, and high testing costs. Summary of the Invention

[0004] The purpose of this invention is to provide an OTG function testing method, system, device, and equipment to improve the problems of low efficiency and high testing cost in OTG function testing schemes.

[0005] In a first aspect, the present invention provides an OTG function detection method, the method comprising: Send a first control command to the first device under test and the second device under test. The first control command is used to configure the first device under test as a power supply device and the second device under test as a power receiving device. The USB interface of the first device under test and the USB interface of the second device under test are connected through a USB OTG cable. A first detection signal is received from the first device under test via a first transmission line, and a second detection signal is received from the second device under test via a second transmission line. Based on the first detection signal and the second detection signal, determine whether the OTG function of the first transmission direction of the USB OTG cable is normal.

[0006] The beneficial effect is that the above method can realize unidirectional testing of OTG function and can detect the stability of OTG function in a certain transmission direction.

[0007] In one possible design, the method also includes: Send a second control command to the first device under test and the second device under test, wherein the second control command is used to configure the first device under test as a power receiving device and the second device under test as a power supply device; The third detection signal is received from the first device under test via the first transmission line, and the fourth detection signal is received from the second device under test via the second transmission line. Based on the third and fourth detection signals, determine whether the OTG function of the second transmission direction of the USB OTG cable is normal.

[0008] By configuring the first device under test (DUT) as a powered device and the second DUT as a powered device using the second control command, and based on the third and fourth detection signals, it is possible to determine whether the OTG function of the second transmission direction of the USB OTG cable is normal. The above method can realize bidirectional testing of the OTG function. Bidirectional testing can automatically detect the change of the host to the slave, reduce the plugging and unplugging of cable connections, and improve the efficiency of testing.

[0009] In one possible design, before sending the first control command to the first device under test and the second device under test, the following steps are included: The device under test is connected to the USB interface of the first device via a first USB data cable; and the device under test is connected to the USB interface of the second device via a second USB data cable. Sending a first control command to the first device under test and the second device under test, including: A first control command is sent to the first device under test via the first USB data cable; a first control command is sent to the second device under test via the second USB data cable.

[0010] Signal transmission between the device under test (DUT) and the host computer can be achieved through the first USB data cable and the second USB data cable, so that the host computer can control the DUT.

[0011] In one possible design, before sending the first control command to the first device under test and the second device under test, the following steps are included: Connecting the first device under test (DUT) via a short-range wireless network; and connecting the second DUT via a short-range wireless network; Sending a first control command to the first device under test and the second device under test, including: The first control command is sent to the first device under test and the second device under test via the short-range wireless network.

[0012] A short-range wireless network can be used to establish a connection between the device under test (DUT) and the host computer, thereby completing signal transmission and enabling the host computer to control the DUT.

[0013] In one possible design, the first detection signal includes a first analog power supply voltage signal and a first analog power supply current signal of the first device under test; the second detection signal includes a second analog power supply voltage signal and a second analog power supply current signal of the second device under test. Based on the first detection signal and the second detection signal, determine whether the OTG function of the USB OTG cable in the first transmission direction is normal, including: The first analog power supply voltage signal and the first analog power supply current signal of the first device under test are converted into the first digital power supply voltage signal and the first digital power supply current signal of the first device under test; the second analog power supply voltage signal and the second analog power supply current signal of the second device under test are converted into the second digital power supply voltage signal and the second digital power supply current signal of the second device under test. When the first power supply voltage digital signal and the first power supply current digital signal of the first device under test, and the second power supply voltage digital signal and the second power supply current digital signal of the second device under test meet the preset requirements, it is determined that the OTG function of the first transmission direction of the USB OTG cable is normal, and the first transmission direction is the first device under test supplying power to the second device under test.

[0014] By converting the analog power supply voltage signal and the analog power supply current signal, the voltage and current status of the USB interface of the device under test can be analyzed based on the converted digital power supply voltage signal and digital power supply current signal, thereby determining the transmission performance of the first transmission direction of the USB OTG cable.

[0015] In one possible design, the third detection signal includes a third analog supply voltage signal and a third analog supply current signal of the first device under test; the fourth detection signal includes a fourth analog supply voltage signal and a fourth analog supply current signal of the second device under test. Based on the third and fourth detection signals, determine whether the OTG function of the second transmission direction of the USB OTG cable is normal, including: The analog signals of the third power supply voltage and the third power supply current of the first device under test are converted into digital signals of the third power supply voltage and the third power supply current of the first device under test; the analog signals of the fourth power supply voltage and the fourth power supply current of the second device under test are converted into digital signals of the fourth power supply voltage and the fourth power supply current of the second device under test. When the third power supply voltage digital signal and the third power supply current digital signal of the first device under test, and the fourth power supply voltage digital signal and the fourth power supply current digital signal of the second device under test meet the preset requirements, it is determined that the OTG function of the second transmission direction of the USB OTG cable is normal, and the second transmission direction is that the second device under test supplies power to the first device under test.

[0016] By converting the analog power supply voltage signal and the analog power supply current signal, the voltage and current status of the USB interface of the device under test can be analyzed based on the converted digital power supply voltage signal and digital power supply current signal, thereby determining the transmission performance of the second transmission direction of the USB OTG cable.

[0017] Secondly, the present invention also provides an OTG function testing system, which includes a first device under test, a second device under test, a USB OTG cable, a first transmission line, a second transmission line, and a host computer. The host computer is used to send a first control command to the first device under test and the second device under test. The first control command is used to configure the first device under test as a power supply device and the second device under test as a power receiving device. The USB interface of the first device under test and the USB interface of the second device under test are connected through a USB OTG cable. The first device under test is used to transmit a first detection signal of the first device under test to the host computer via a first transmission line; The second device under test is used to transmit the second detection signal of the second device under test to the host computer through the second transmission line; The host computer is further configured to receive a first detection signal from the first device under test via a first transmission line, and a second detection signal from the second device under test via a second transmission line; and to determine whether the OTG function of the first transmission direction of the USB OTG cable is normal based on the first detection signal and the second detection signal.

[0018] The host computer in this system can execute any of the possible design methods described in the first aspect above.

[0019] Thirdly, the present invention also provides an OTG function detection device, which includes modules / units that execute any of the possible design methods described in the second aspect above. These modules / units can be implemented in hardware or by hardware executing corresponding software.

[0020] Fourthly, the present invention provides an electronic device including a processor and a memory. The memory stores one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the terminal device is able to implement any of the possible design methods described in the second aspect above.

[0021] Fifthly, the present invention also provides a computer-readable storage medium comprising a computer program that, when executed on an electronic device, causes the electronic device to perform any of the possible designs of any of the foregoing aspects.

[0022] In a sixth aspect, the present invention also provides a method comprising a computer program product, which, when the computer program product is run on a terminal, causes the electronic device to perform any of the possible designs of any of the foregoing aspects.

[0023] In a seventh aspect, the present invention also provides a chip or chip module coupled to a memory for executing a computer program stored in the memory, thereby enabling the electronic device to perform any possible design method of any of the above aspects.

[0024] For the beneficial effects of the second to seventh aspects mentioned above, please refer to the description in the first aspect mentioned above. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of an OTG application scenario; Figure 2 This is a schematic diagram of an OTG function detection system architecture provided by the present invention; Figure 3 This is a schematic diagram of another OTG function detection system architecture provided by the present invention; Figure 4 A schematic diagram of the structure of a terminal device provided by the present invention; Figure 5 This is a schematic diagram of an OTG function detection method provided by the present invention; Figure 6 This is a schematic diagram of another OTG function detection method provided by the present invention; Figure 7 This is a schematic diagram of an OTG function detection device provided by the present invention; Figure 8This is a schematic diagram of an electronic device structure provided by the present invention. Detailed Implementation

[0026] Before detailing the embodiments of the present invention, some terms used in the embodiments of the present invention will be explained below to facilitate understanding by those skilled in the art.

[0027] 1. OTG technology OTG technology is mainly used for connection and data transmission between various mobile devices such as mobile phones.

[0028] The USB connector interface is a master-slave interface, requiring a host device for data transmission. USB OTG technology, however, enables data transfer between devices without a host. A terminal supporting USB OTG (i.e., the terminal device described in this embodiment) is in device mode when used alone. When an OTG device is connected, it pulls down the device type identifier (ID) signal in the USB standard signal, causing the terminal device to switch from device mode to host mode, thus enabling interaction between the two devices.

[0029] 2. Universal Serial Bus (USB) USB is an external bus standard used to regulate the connection and communication between computers and external devices. It is an interface technology used in the PC field. There are three main types of USB interfaces: Standard Downstream Port (SDP), Dedicated Charging Port (DCP), and Charge Downstream Port (CDP).

[0030] The five pins of the USB interface are VCC, UD-, UD+, ID, and GND, which can be categorized into three types: power lines, data lines, and OTG status lines. The USB line signal composite switch controls the opening and closing of the power and data lines in the USB interface, while the OTG status lines are directly controlled by the main control chip to achieve the effect of switching OTG modes.

[0031] Currently, using OTG technology, mobile phones can be directly connected to USB external devices such as USB flash drives, MP3 players, keyboards, and game controllers for data transfer, input operations, or charging, without the need for a computer as an intermediary. Figure 1As shown, an OTG cable directly connects a mobile phone and a USB flash drive. The phone can read information from the USB flash drive and copy and transfer files, essentially allowing the USB flash drive to expand the phone's storage. This means that when traveling, carrying only an OTG cable and a high-capacity USB flash drive is sufficient. Take photos, copy them to the USB flash drive at night, and the phone will have enough space to take new photos the next day. Furthermore, in outdoor environments or where fixed power outlets are difficult to find, OTG technology allows for on-the-go charging between two electronic devices. To charge different electronic devices via OTG, connect the two devices with a charging cable, manually select one device as the power source, and the other as the receiving device. Therefore, testing the OTG function is essential. Before connecting external devices to the USB ports of products such as mobile phones, tablets, digital cameras, and printers, to ensure the accuracy of the USB data transmission direction and to ensure that the OTG function of the USB in each product is normal after testing, a board-level inspection of the PCBA after surface mounting is required. USB devices are divided into master devices and slave devices. Data transmission can only be achieved when a master device is connected to a slave device. OTG devices can act as both master and slave devices, so it is necessary to verify the accuracy of the USB data transmission function when a USB device is used as a master or slave device.

[0032] Current OTG testing systems are limited to testing via external switching devices and adapters. Furthermore, verifying OTG functionality requires connecting and replacing other master and slave devices, necessitating manual connection of multiple cables, which fails to meet the requirements for rapid testing. After component placement at the factory, quickly determining the reliability of the placement and testing the OTG function is crucial. Manual testing consumes significant time, hindering the rapid verification of the accuracy of OTG functionality within the hardware system.

[0033] To address this, the present invention provides an OTG function testing method. This method eliminates the need for adapters, relays, or switches. Two devices under test (DUTs) are connected via a USB OTG cable, and a host computer controls the master-slave relationship between the two DUTs for charging or receiving power. This verifies the accuracy of the USB data transmission function of the DUTs when they act as master or slave devices. The method eliminates the need for manual plugging / unplugging or external switches for device connection and disconnection, and the entire testing process is fully automated, enabling the detection of the bidirectional OTG transmission capability of the DUTs.

[0034] The technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings. In the description of the embodiments of the present invention, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the present invention. As used in the specification and appended claims of the present invention, the singular expressions “a,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present invention, “at least one” and “one or more” refer to one or more (including two). The term “and / or” is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.

[0035] References to "one embodiment" or "some embodiments" as used in this specification mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the invention. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically emphasized. The term "connection" includes both direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.

[0036] In embodiments of the present invention, the terms "exemplarily" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplarily" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0037] like Figure 2As shown in the diagram, this embodiment of the invention provides a framework diagram of an OTG function testing system. The system includes a first device under test (DUT) 201, a second DUT 202, a USB OTG cable 300, a first transmission line 401, a second transmission line 402, and a host computer 500. The USB interface of the first DUT 201 and the USB interface of the second DUT 202 are connected via the USB OTG cable. The first DUT 201 is connected to the host computer 500 via the first transmission line 401, and the second DUT 202 is connected to the host computer 500 via the second transmission line 402. One end of the first transmission line 401 can be a probe, and the other end can be a USB interface; similarly, one end of the second transmission line 402 can be a probe, and the other end can be a USB interface.

[0038] The host computer 500 can send control commands to the first device under test 201 and the second device under test 202 via wired or near-field wireless networks to control the status of the master and slave devices. The host computer 500 can also acquire detection signals from the first device under test 201 and the second device under test 202 via the first transmission line 401 and the second transmission line 402 to analyze whether the OTG function of the first device under test 201 and the second device under test 202 is normal. The near-field wireless network can be a WiFi hotspot network, a WiFi P2P network, a Bluetooth network, a Zigbee network, or a near-field communication (NFC) network, etc.

[0039] In some embodiments of the present invention, such as Figure 3 As shown, the host computer 500 includes a PC 502 and a controller 501, wherein the controller 501 includes an analog-to-digital converter. The USB OTG cable 300 mainly includes an A end and a B end. Before reverse charging, the user can connect the A end of the USB OTG cable 300 to the USB interface 2011 of the first device under test 201, and connect the B end of the USB OTG cable 300 to the USB interface 2022 of the second device under test 202. The first device under test 201 can output power from the USB interface 2011 to the A end of the USB OTG cable 300. The power received at the A end of the USB OTG cable 300 is transferred to the B end of the USB OTG cable 300 and input to the second device under test 202 through the USB interface 2022. The second device under test 202 can then use the power input from the USB interface 2022 to operate or charge. The controller 501's interface 5011 is connected to the first device under test 201 via the first transmission line 401, and the controller 501's interface 5012 is connected to the second device under test 202 via the second transmission line 402. One end of the first transmission line 401 can be a probe, and the other end can be a USB interface.

[0040] It should be noted that the shape of the USB OTG cable 300 in this embodiment of the invention can be linear, or it can be a non-linear shape such as square or circular. This embodiment of the invention does not impose many restrictions on the shape of the USB OTG cable 300.

[0041] It should be noted that the interface type of the B end of the USB OTG cable 300 is equivalent to the interface type of the USB interface. In other words, the USB OTG cable 300 does not change the interface type of the USB interface, and the first device under test 201 and the second device under test 202 can identify the interface type of the USB interface through the USB OTG cable 300.

[0042] The TOG function detection method provided in this embodiment of the invention can be applied to, for example... Figure 4 The terminal device shown has OTG functionality. Figure 4 A hardware configuration block diagram of the terminal device 400 is shown.

[0043] In some embodiments, the terminal device 400 includes at least one of a tuner 410, a communicator 420, a data acquisition unit 430, an external device interface 440, a controller 450, a display 460, an audio output interface 470, a memory, a power supply, and a user interface 480.

[0044] In some embodiments, the controller includes a central processing unit, a video processor, an audio processor, a graphics processor, random access memory (RAM), read-only memory (ROM), and a first to an nth interface for input / output.

[0045] In some embodiments, the display 460 includes a display screen component for presenting an image and a driving component for driving the image display. The display 460 is used to receive image signals output from the controller and to display video content, image content, menu control interface components, and user control UI interfaces, etc.

[0046] In some embodiments, the display 460 may be at least one of a liquid crystal display, an OLED display, and a projection display, and may also be a projection device and a projection screen.

[0047] In some embodiments, the tuner 410 receives broadcast television signals via wired or wireless reception and demodulates audio and video signals, such as EPG data signals, from a plurality of wireless or wired broadcast television signals.

[0048] In some embodiments, the communicator 420 is a component for communicating with external devices or servers according to various communication protocol types. For example, the communicator may include at least one of a communication protocol chip or a near-field communication protocol chip, and an infrared receiver. In some embodiments, the communication protocol chip may be a wireless fidelity (WiFi) module, a Bluetooth module, or a wired Ethernet module. The terminal device 400 can establish the transmission and reception of control signals and data signals with the control device 400 or the server 400 through the communicator 420.

[0049] In some embodiments, the collector 430 is used to collect signals from the external environment or to interact with the outside world. For example, the collector 430 includes a light receiver, a sensor for collecting ambient light intensity; or, the collector 430 includes an image collector, such as a camera, which can be used to collect external environmental scenes, user attributes, or user interaction gestures; or, the collector 430 includes a sound collector, such as a microphone, for receiving external sounds. In some embodiments, the external device interface 440 may include, but is not limited to, one or more of the following interfaces: High Definition Multimedia Interface (HDMI), analog or data high-definition component input interface (component), composite video input interface (CVBS), USB input interface (USB), RGB port, etc. It may also be a composite input / output interface formed by multiple interfaces mentioned above.

[0050] In some embodiments, the controller 450 and the tuner 410 may be located in different separate devices, that is, the tuner 410 may also be located in an external device of the main device where the controller 450 is located, such as an external set-top box.

[0051] In some embodiments, the controller 450 controls the operation of the display device and responds to user operations through various software control programs stored in memory. The controller 450 controls the overall operation of the terminal device 400. For example, in response to receiving a user command to select a UI object to display on the display 460, the controller 450 can perform operations related to the object selected by the user command.

[0052] In some embodiments, the object can be any of the optional objects, such as a hyperlink, an icon, or other operable controls. Operations related to the selected object include: displaying links to hyperlinked pages, documents, images, etc., or performing operations corresponding to the program associated with the icon.

[0053] In some embodiments, the controller includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), RAM, ROM, a first to an nth interface for input / output, a communication bus, etc.

[0054] A central processing unit (CPU) is used to execute operating system and application instructions stored in memory, as well as various interactive instructions received from external input, to execute various applications, data, and content in order to ultimately display and play various audio and video content. A CPU can include multiple processors, such as a main processor and one or more subprocessors.

[0055] In some embodiments, a graphics processor is used to generate various graphical objects. In some embodiments of the present invention, the graphical object may include at least one of icons, operation menus, and user-input command-displayed graphics. The graphics processor includes an arithmetic logic unit (ALU) that performs calculations based on various user-input interactive commands and displays various objects according to display attributes; it also includes a renderer that renders the various objects obtained based on the ALU, the rendered objects being displayed on a display.

[0056] In some embodiments, a video processor is configured to receive an external video signal and, according to a standard encoding and decoding protocol of the input signal, perform at least one of the following video processing operations: decompression, decoding, scaling, noise reduction, frame rate conversion, resolution conversion, image synthesis, etc., to obtain a signal that can be directly displayed or played on a terminal device 400.

[0057] In some embodiments, the video processor includes at least one of a demultiplexing module, a video decoding module, an image compositing module, a frame rate conversion module, and a display formatting module. The demultiplexing module demultiplexes the input audio and video data streams. The video decoding module processes the demultiplexed video signal, including decoding and scaling. The image compositing module, such as an image synthesizer, overlays and blends a graphical user interface (GUI) signal generated by a graphics generator based on user input or its own output with the scaled video image to generate a displayable image signal. The frame rate conversion module converts the input video frame rate. The display formatting module modifies the received frame rate-converted video output signal to conform to a display format, such as outputting RGB data signals.

[0058] In some embodiments, an audio processor is configured to receive external audio signals, perform decompression and decoding according to a standard codec protocol of the input signal, and at least one of the following processes: noise reduction, digital-to-analog conversion, and amplification, to obtain a sound signal that can be played in a speaker.

[0059] In some embodiments, the user can input user commands through a graphical user interface displayed on the display 460, and the user input interface receives the user input commands through the graphical user interface. Alternatively, the user can input user commands by inputting specific sounds or gestures, and the user input interface receives the user input commands by recognizing the sounds or gestures through sensors.

[0060] In some embodiments, a user interface is the medium through which an application or operating system interacts and exchanges information with a user, converting information between its internal form and a form acceptable to the user. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an icon, window, control, or other interface element displayed on the screen of an electronic device. In some possible embodiments, controls may include at least one of the following visual interface elements: icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0061] In some embodiments, the user interface 480 is an interface that can be used to receive control input (such as physical buttons on the display device body, or others).

[0062] In specific implementation, the aforementioned terminal device 400 can be a mobile phone, tablet computer, handheld computer, personal computer (PC), cellular phone, personal digital assistant (PDA), wearable device (such as smartwatch), smart home device (such as television), in-vehicle computer, game console, and augmented reality (AR) / virtual reality (VR) device, etc. This embodiment does not impose any special restrictions on the specific device form of the terminal device 400.

[0063] based on Figure 2 The system shown and Figure 4 The terminal device shown in the figure illustrates a flowchart of an OTG function detection method provided in this embodiment of the invention. Figure 5 As shown, the method includes the following steps: S501, the host computer sends the first control command to the first device under test and the second device under test.

[0064] The first control command is used to configure the first device under test (DUT) as a power supply device and the second DUT as a power receiving device. The USB interfaces of the first and second DUTs are connected via a USB OTG cable. In this embodiment, the USB interface is selected according to the interface model of the DUT (Micro, Mini, Type C, Lightning).

[0065] In one possible implementation, the host computer sends a first control command to the first device under test (DUT) via a first USB data cable; the host computer also sends the first control command to the second DUT via a second USB data cable, wherein the host computer is connected to the USB interface of the first DUT via the first USB data cable; and to the USB interface of the second DUT via the second USB data cable. In another possible implementation, the host computer sends the first control command to both the first and second DUTs via a short-range wireless network, wherein the host computer is connected to the first DUT via a short-range wireless network; and to the second DUT via a short-range wireless network.

[0066] S502, the first device under test transmits the first detection signal of the first device under test to the host computer through the first transmission line.

[0067] The first detection signal can be the first power supply voltage analog signal and the first power supply current analog signal of the USB interface of the first device under test, such as the current value and voltage value of the power bus Vbus pin in the USB interface of the first device under test.

[0068] S503, the second device under test transmits the second detection signal of the second device under test to the host computer through the second transmission line.

[0069] The second detection signal can be the second power supply voltage analog signal and the second power supply current analog signal of the USB interface of the second device under test, such as the current value and voltage value of the power bus Vbus pin in the USB interface of the second device under test.

[0070] S504, the host computer receives a first detection signal from the first device under test through the first transmission line, and receives a second detection signal from the second device under test through the second transmission line.

[0071] S505, the host computer determines whether the OTG function of the first transmission direction of the USB OTG cable is normal based on the first detection signal and the second detection signal.

[0072] In one implementation of this step, the host computer can consist of a controller and a PC. The analog-to-digital converter in the controller converts the analog signals of the first power supply voltage and current of the first device under test (DUT) into digital signals of the first power supply voltage and current of the first DUT, and converts the analog signals of the second power supply voltage and current of the second DUT into digital signals of the second power supply voltage and current of the second DUT. Then, when the digital signals of the first power supply voltage and current of the first DUT, and the digital signals of the second power supply voltage and current of the second DUT, meet preset requirements, it is determined that the OTG function of the first transmission direction of the USB OTG cable is normal, and the first transmission direction is power supply from the first DUT to the second DUT. Conversely, if the voltage and current values ​​are too low, it can be considered that no current loop is formed in the Vbus pin. Since two DUTs are currently connected, it can be considered that the USB interface of the first DUT is faulty or the OTG function of the first transmission direction of the USB OTG cable is abnormal. Therefore, the above method can achieve unidirectional testing of the OTG function and can detect the stability of the OTG function in a certain transmission direction.

[0073] Optionally, the OTG function detection method can also achieve bidirectional detection, that is, the method can also include the following steps.

[0074] S506, the host computer sends a second control command to the first device under test and the second device under test.

[0075] The second control command is used to configure the first device under test as a powered device and the second device under test as a powered device.

[0076] S507, the first device under test transmits the third detection signal of the first device under test to the host computer through the first transmission line.

[0077] S508, the second device under test transmits the fourth detection signal of the second device under test to the host computer through the second transmission line.

[0078] S509, the host computer receives the third detection signal from the first device under test through the first transmission line, and receives the fourth detection signal from the second device under test through the second transmission line.

[0079] S510: The host computer determines whether the OTG function of the second transmission direction of the USB OTG cable is normal based on the third and fourth detection signals.

[0080] In one implementation of this step, the host computer can consist of a controller and a PC. The analog-to-digital converter in the controller converts the analog signals of the third supply voltage and third supply current of the first device under test (DUT) into digital signals of the third supply voltage and third supply current of the first DUT, and converts the analog signals of the fourth supply voltage and fourth supply current of the second DUT into digital signals of the fourth supply voltage and fourth supply current of the second DUT. Then, when the digital signals of the third supply voltage and third supply current of the first DUT, and the digital signals of the fourth supply voltage and fourth supply current of the second DUT, meet preset requirements, it is determined that the OTG function of the second transmission direction of the USB OTG cable is normal, and the second transmission direction is power supply from the first DUT to the second DUT. Conversely, if the voltage and current values ​​are too low, it can be assumed that no current loop is formed in the Vbus pin. Since two DUTs are currently connected, it can be assumed that the USB interface of the second DUT is faulty or the OTG function of the second transmission direction of the USB OTG cable is abnormal.

[0081] In one possible embodiment, the host computer not only monitors the status of each device under test as a master or slave, but also displays the test results. If there is a fault, the results are saved in a fixed path document. The fault status storage file is named by time so that testers can easily view it.

[0082] Combination Figure 6 In this embodiment, S601, the PC first initializes information, mainly including registers, memory, and communication protocols. Then, S602, the host computer adapts the detection port according to the correspondence between the port and the device under test (DUT). S603, the host computer selects the master / slave device. S604, the host computer sends control commands to the DUT. S605, since power is always provided by the host device in OTG, after determining the host status, the host computer collects detection signals from the two DUT devices through the controller, such as voltage and current information. S606, the host computer compares the detection signals with the test indicators. S607, the host computer determines whether a fault exists based on the comparison result. If so, S608 is executed; otherwise, S609 is executed. S608, the host computer stores the fault information of the master or slave device. S609, the host computer displays that the detection result is normal.

[0083] As can be seen, bidirectional testing can automatically detect changes from host to slave, reducing the need for plugging and unplugging cables and improving testing efficiency. This method comprehensively covers OTG functional test items, accurately locates faults, provides complete test results, and offers flexible and efficient USB interface testing. Corresponding information recording allows for tracking of test issues, thereby enabling overall control of the product's surface mount quality.

[0084] In some embodiments of the present invention, an OTG function detection device is also disclosed, such as... Figure 7 As shown, this device is used to implement the methods described in the above method embodiments, and includes: a sending unit 701, used to send a first control command to a first device under test and a second device under test, the first control command being used to configure the first device under test as a power supply device and the second device under test as a power receiving device, wherein the USB interface of the first device under test and the USB interface of the second device under test are connected via a USB OTG cable; a receiving unit 702, used to receive a first detection signal from the first device under test via a first transmission line, and receive a second detection signal from the second device under test via a second transmission line; and a processing unit 703, used to determine whether the OTG function of the first transmission direction of the USB OTG cable is normal based on the first detection signal and the second detection signal. All relevant content of each step involved in the above method embodiments can be referenced to the functional description of the corresponding functional module, and will not be repeated here.

[0085] In other embodiments of the present invention, an electronic device is disclosed, which can correspond to the host computer in the above method embodiments, such as... Figure 8 As shown, the electronic device may include: one or more processors 801; a memory 802; a display 803; one or more application programs (not shown); and one or more computer programs 804. These devices can be connected via one or more communication buses 805. The one or more computer programs 804 are stored in the memory 802 and configured to be executed by the one or more processors 801. The one or more computer programs 804 include instructions that can be used to perform actions such as... Figure 5 and Figure 6 And the various steps in the corresponding embodiments.

[0086] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0087] In the various embodiments of the present invention, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0088] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0089] The above description is merely a specific implementation of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of the present invention should be covered within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be determined by the protection scope of the claims.

Claims

1. An OTG function detection method, applied to a host computer, characterized in that, The method includes: Send a first control command to the first device under test and the second device under test. The first control command is used to configure the first device under test as a power supply device and the second device under test as a power receiving device. The USB interface of the first device under test and the USB interface of the second device under test are connected through a USB OTG cable. The first detection signal is received from the power bus Vbus pin of the USB interface of the first device under test via the first transmission line, and the second detection signal is received from the power bus Vbus pin of the USB interface of the second device under test via the second transmission line. Based on the first detection signal and the second detection signal, determine whether the OTG function of the first transmission direction of the USB OTG cable is normal.

2. The method according to claim 1, characterized in that, The method further includes: Send a second control command to the first device under test and the second device under test, the second control command being used to configure the first device under test as a power receiving device and the second device under test as a power supply device; The third detection signal is received from the first device under test via the first transmission line, and the fourth detection signal is received from the second device under test via the second transmission line. Based on the third and fourth detection signals, determine whether the OTG function of the second transmission direction of the USB OTG cable is normal.

3. The method according to claim 1 or 2, characterized in that, Sending a first control command to the first device under test and the second device under test, including: The host computer sends a first control command to the first device under test (DUT) via a first USB data cable; and sends a first control command to the second DUT via a second USB data cable, wherein the host computer is connected to the USB interface of the first DUT via the first USB data cable; and to the USB interface of the second DUT via the second USB data cable.

4. The method according to claim 1 or 2, characterized in that, Sending a first control command to the first device under test and the second device under test, including: A first control command is sent to the first device under test (DUT) and the second DUT via a short-range wireless network, wherein the host computer is connected to the first DUT via the short-range wireless network; and the host computer is connected to the second DUT via the short-range wireless network.

5. The method according to claim 1 or 2, characterized in that, The first detection signal includes a first analog power supply voltage signal and a first analog power supply current signal of the first device under test; the second detection signal includes a second analog power supply voltage signal and a second analog power supply current signal of the second device under test. Based on the first detection signal and the second detection signal, determine whether the OTG function of the USB OTG cable in the first transmission direction is normal, including: The first analog power supply voltage signal and the first analog power supply current signal of the first device under test are converted into the first digital power supply voltage signal and the first digital power supply current signal of the first device under test; the second analog power supply voltage signal and the second analog power supply current signal of the second device under test are converted into the second digital power supply voltage signal and the second digital power supply current signal of the second device under test. When the first power supply voltage digital signal and the first power supply current digital signal of the first device under test, and the second power supply voltage digital signal and the second power supply current digital signal of the second device under test meet the preset requirements, it is determined that the OTG function of the first transmission direction of the USB OTG cable is normal, and the first transmission direction is the first device under test supplying power to the second device under test.

6. The method according to claim 2, characterized in that, The third detection signal includes the third power supply voltage analog signal and the third power supply current analog signal of the first device under test; the fourth detection signal includes the fourth power supply voltage analog signal and the fourth power supply current analog signal of the second device under test; Based on the third and fourth detection signals, determine whether the OTG function of the second transmission direction of the USB OTG cable is normal, including: The analog signals of the third power supply voltage and the third power supply current of the first device under test are converted into digital signals of the third power supply voltage and the third power supply current of the first device under test; the analog signals of the fourth power supply voltage and the fourth power supply current of the second device under test are converted into digital signals of the fourth power supply voltage and the fourth power supply current of the second device under test. When the third power supply voltage digital signal and the third power supply current digital signal of the first device under test, and the fourth power supply voltage digital signal and the fourth power supply current digital signal of the second device under test meet the preset requirements, it is determined that the OTG function of the second transmission direction of the USB OTG cable is normal, and the second transmission direction is the second device under test supplying power to the first device under test.

7. An OTG function detection system, characterized in that, It includes a first device under test, a second device under test, a USB OTG cable, a first transmission line, a second transmission line, and a host computer; The host computer is used to send a first control command to the first device under test and the second device under test. The first control command is used to configure the first device under test as a power supply device and the second device under test as a power receiving device. The USB interface of the first device under test and the USB interface of the second device under test are connected through a USB OTG cable. The first device under test is used to transmit a first detection signal of the first device under test to the host computer via a first transmission line; The second device under test is used to transmit the second detection signal of the second device under test to the host computer through the second transmission line; The host computer is further configured to receive a first detection signal from the power bus Vbus pin of the USB interface of the first device under test via a first transmission line, and receive a second detection signal from the power bus Vbus pin of the USB interface of the second device under test via a second transmission line; and determine whether the OTG function of the first transmission direction of the USB OTG line is normal based on the first detection signal and the second detection signal.

8. The system according to claim 7, characterized in that, The host computer is also used to send a second control command to the first device under test and the second device under test, the second control command being used to configure the first device under test as a power receiving device and the second device under test as a power supply device; The host computer is also used to receive a third detection signal from the first device under test via the first transmission line and a fourth detection signal from the second device under test via the second transmission line; and to determine whether the OTG function of the second transmission direction of the USB OTG cable is normal based on the third detection signal and the fourth detection signal.

9. An OTG function detection device, the device being applied to a host computer, characterized in that, The device includes; The transmitting unit is used to send a first control command to a first device under test and a second device under test. The first control command is used to configure the first device under test as a power supply device and the second device under test as a power receiving device. The USB interface of the first device under test and the USB interface of the second device under test are connected through a USB OTG cable. The receiving unit is configured to receive a first detection signal from the power bus Vbus pin of the USB interface of the first device under test via a first transmission line, and to receive a second detection signal from the power bus Vbus pin of the USB interface of the second device under test via a second transmission line. The processing unit is configured to determine whether the OTG function of the first transmission direction of the USB OTG cable is normal based on the first detection signal and the second detection signal.

10. The apparatus according to claim 9, characterized in that, The device further includes: The sending unit is further configured to send a second control command to the first device under test and the second device under test, wherein the second control command is configured to configure the first device under test as a power receiving device and the second device under test as a power supply device; The receiving unit is further configured to receive a third detection signal from the first device under test via a first transmission line, and a fourth detection signal from the second device under test via a second transmission line. The processing unit is further configured to determine whether the OTG function of the second transmission direction of the USB OTG cable is normal based on the third detection signal and the fourth detection signal.

11. The apparatus according to claim 9 or 10, characterized in that, The sending unit sends a first control command to the first device under test and the second device under test, specifically for: The host computer sends a first control command to the first device under test (DUT) via a first USB data cable; and sends a first control command to the second DUT via a second USB data cable, wherein the host computer is connected to the USB interface of the first DUT via the first USB data cable; and the host computer is connected to the USB interface of the second DUT via the second USB data cable.

12. The apparatus according to claim 9 or 10, characterized in that, Sending a first control command to the first device under test and the second device under test, specifically for: Connecting the first device under test (DUT) via a short-range wireless network; and connecting the second DUT via a short-range wireless network; A first control command is sent to the first device under test (DUT) and the second DUT via a short-range wireless network; wherein, the host computer is connected to the first DUT via the short-range wireless network; the host computer is connected to the second DUT via the short-range wireless network.

13. The apparatus according to claim 9 or 10, characterized in that, The first detection signal includes a first analog power supply voltage signal and a first analog power supply current signal of the first device under test; the second detection signal includes a second analog power supply voltage signal and a second analog power supply current signal of the second device under test. The processing unit determines whether the OTG function of the USB OTG cable in the first transmission direction is normal based on the first detection signal and the second detection signal, specifically for: The first analog power supply voltage signal and the first analog power supply current signal of the first device under test are converted into the first digital power supply voltage signal and the first digital power supply current signal of the first device under test; the second analog power supply voltage signal and the second analog power supply current signal of the second device under test are converted into the second digital power supply voltage signal and the second digital power supply current signal of the second device under test. When the first power supply voltage digital signal and the first power supply current digital signal of the first device under test, and the second power supply voltage digital signal and the second power supply current digital signal of the second device under test meet the preset requirements, it is determined that the OTG function of the first transmission direction of the USB OTG cable is normal, and the first transmission direction is the first device under test supplying power to the second device under test.

14. The apparatus according to claim 10, characterized in that, The third detection signal includes the third power supply voltage analog signal and the third power supply current analog signal of the first device under test; the fourth detection signal includes the fourth power supply voltage analog signal and the fourth power supply current analog signal of the second device under test; The processing unit determines whether the OTG function of the second transmission direction of the USB OTG cable is normal based on the third detection signal and the fourth detection signal, specifically for: The analog signals of the third power supply voltage and the third power supply current of the first device under test are converted into digital signals of the third power supply voltage and the third power supply current of the first device under test; the analog signals of the fourth power supply voltage and the fourth power supply current of the second device under test are converted into digital signals of the fourth power supply voltage and the fourth power supply current of the second device under test. When the third power supply voltage digital signal and the third power supply current digital signal of the first device under test, and the fourth power supply voltage digital signal and the fourth power supply current digital signal of the second device under test meet the preset requirements, it is determined that the OTG function of the second transmission direction of the USB OTG cable is normal, and the second transmission direction is the second device under test supplying power to the first device under test.

15. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.

16. An electronic device, characterized in that, include: Processor and memory; The memory is used to store computer programs; The processor is configured to execute a computer program stored in the memory to cause the electronic device to perform the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • System and method for testing serial bus communication circuit

    CN106921408A

  • Testing system, testing method, testing device, and storage medium

    CN109298266A