Differential Pair Detection Method and Related Device

By switching between the data channel and the voltage test channel, detecting the single-ended voltage of the USB interface differential pair and calculating the voltage difference, the USB Hub compatibility problem is solved to ensure that the device is recognized by the system and operates stably.

CN115825821BActive Publication Date: 2025-07-08SHENZHEN XFANIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211467008.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-07-08
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

Compatibility issues of USB Hub. The existing technology cannot efficiently detect problems such as short circuit, air welding and virtual welding of USB Hub differential pairs, resulting in the device being unable to be recognized by the system or working stably.

Method used

By switching between the data channel and the voltage test channel, detecting the single-ended voltage of the USB interface differential pair, and calculating the voltage difference, determining the short circuit, off circuit or normal state, improving the compatibility of the USB Hub.

Benefits of technology

It realizes efficient detection of the short-circuit status of the USB Hub differential pair, ensuring that the device is recognized by the system and works stably, and improving the compatibility of the USB Hub.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115825821B_ABST
    Figure CN115825821B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a differential pair detection method and related device. The method includes: switching a data channel to a data transmission channel; detecting a first single-ended voltage and a second single-ended voltage of a first transmission line, and a third single-ended voltage and a fourth single-ended voltage of a second transmission line; switching the data channel to a voltage test channel, determining a fifth single-ended voltage and a sixth single-ended voltage of the first transmission line, and a seventh single-ended voltage and an eighth single-ended voltage of the second transmission line; determining a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference; determining a short circuit detection result; and sending the short circuit detection result to a second device. By adopting the embodiment of the present application, it is possible to detect the single-ended voltages of the USB interface differential pair of a USB Hub under different channels, calculate the voltage differences of the single-ended voltages detected twice, and determine the short circuit state of the USB interface differential pair through the voltage differences, which is beneficial to improving the compatibility of the USB Hub.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of USB technology, and in particular to a differential pair detection method and related devices. Background Art

[0002] USB Hub (Universal Serial Bus Hub) is widely used in people's daily life, and the types of devices that can be used with USB Hub are gradually diversified. However, the problem that comes with it is the compatibility of USB Hub. For the problem that USB Hub cannot be used, manual detection is inefficient and time-consuming. Summary of the invention

[0003] The embodiments of the present application provide a differential pair detection method and related devices, which can push user target content to users based on determined points of interest, which is conducive to accurately pushing content that users are interested in to users.

[0004] In a first aspect, an embodiment of the present application provides a differential pair detection method, which is applied to a first device, wherein the first device is connected to a USB interface differential pair of a second device and a target USB Hub, respectively, and the USB interface differential pair includes a first transmission line and a second transmission line, and the method includes:

[0005] Switching the data channel to a data transmission channel, wherein the data channel includes the data transmission channel and a voltage test channel;

[0006] detecting a first single-ended voltage and a second single-ended voltage of the first transmission line, and a third single-ended voltage and a fourth single-ended voltage of the second transmission line;

[0007] Switching the data channel to the voltage test channel to determine a fifth single-ended voltage and a sixth single-ended voltage of the first transmission line, and a seventh single-ended voltage and an eighth single-ended voltage of the second transmission line;

[0008] calculating a difference between the first single-ended voltage and the fifth single-ended voltage, a difference between the second single-ended voltage and the sixth single-ended voltage, a difference between the third single-ended voltage and the seventh single-ended voltage, and a difference between the fourth single-ended voltage and the eighth single-ended voltage to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference;

[0009] When any voltage difference among the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference is less than a preset voltage threshold, determining that the short circuit detection result is that a short circuit exists;

[0010] When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold, it is determined that the short - circuit detection result is an open circuit;

[0011] When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold, it is determined that the short - circuit detection result is normal;

[0012] Send the short - circuit detection result to the second device.

[0013] In a second aspect, an embodiment of the present application provides a differential - pair detection system, which is applied to a first device. The system includes:

[0014] A switch control module, which is respectively connected to the USB interface differential pair of the target USB Hub and the control center, and is used for the control center to control the switching of the data channel to the data transmission channel, and for switching the data channel to the voltage detection channel;

[0015] A voltage detection module, which is respectively connected to the USB interface differential pair and the control center, and is used for detecting the first single - ended voltage and the second single - ended voltage of the first transmission line of the USB interface differential pair, and the third single - ended voltage and the fourth single - ended voltage of the second transmission line after the switch control module switches the data channel to the data transmission channel; and is further used for detecting the fifth single - ended voltage and the sixth single - ended voltage of the first transmission line of the USB interface differential pair, and the seventh single - ended voltage and the eighth single - ended voltage of the second transmission line after the switch control module switches the data channel to the voltage detection channel, and for sending the first voltage, the second voltage, the third voltage, the fourth voltage, the fifth voltage, the sixth voltage, the seventh voltage, and the eighth voltage to the control center;

[0016] The control center, connected to the device communication module, is configured to calculate the differences between the received first single-ended voltage and the fifth single-ended voltage, the second single-ended voltage and the sixth single-ended voltage, the third single-ended voltage and the seventh single-ended voltage, and the fourth single-ended voltage and the eighth single-ended voltage, to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference; and is further configured to determine that the short-circuit detection result is a short circuit when any one of the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference is less than a preset voltage threshold; determine that the short-circuit detection result is an open circuit when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold; determine that the short-circuit detection result is normal when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold, and send the short-circuit detection result to the device communication module;

[0017] The device communication module, connected to the second device, is configured to receive the short-circuit detection result and send the short-circuit detection result to the second device.

[0018] In a third aspect, an embodiment of the present application provides a differential pair detection device applied to a first device. The first device is respectively connected to a second device and a USB interface differential pair. The USB interface differential pair includes a first transmission line and a second transmission line. The device includes: a channel switching unit, a detection unit, a determination unit, a calculation unit, and a sending unit, where,

[0019] The channel switching unit is configured to switch the data channel to the data transmission channel, where the data channel includes the data transmission channel and the voltage test channel;

[0020] The detection unit is configured to detect the first single-ended voltage and the second single-ended voltage of the first transmission line, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line;

[0021] The determination unit is configured to switch the data channel to the voltage test channel and determine the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line;

[0022] The calculation unit is configured to calculate the differences between the first single-ended voltage and the fifth single-ended voltage, the second single-ended voltage and the sixth single-ended voltage, the third single-ended voltage and the seventh single-ended voltage, and the fourth single-ended voltage and the eighth single-ended voltage, to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference;

[0023] The determining unit is further configured to determine that the short - circuit detection result indicates a short circuit when any one of the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference is less than a preset voltage threshold.

[0024] The determining unit is further configured to determine that the short - circuit detection result indicates an open circuit when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold.

[0025] The determining unit is further configured to determine that the short - circuit detection result indicates normal status when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold.

[0026] The sending unit is configured to send the short - circuit detection result to the second device.

[0027] In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing some or all of the steps described in any one of the methods in the first aspect or the second aspect of the embodiments of the present application.

[0028] In a fifth aspect, an embodiment of the present application provides a computer - readable storage medium. The computer - readable storage medium stores a computer program for electronic data exchange. The computer program causes a computer to execute some or all of the steps described in any one of the methods in the first aspect or the second aspect of the embodiments of the present application.

[0029] It can be seen that in the embodiment of the present application, the first device can switch the data channel to the data transmission channel, detect the first single-ended voltage and the second single-ended voltage of the first transmission line, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line. Then, the first device switches the data channel to the voltage test channel, determines the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line. The first device further calculates the differences between the first single-ended voltage and the fifth single-ended voltage, the second single-ended voltage and the sixth single-ended voltage, the third single-ended voltage and the seventh single-ended voltage, and the fourth single-ended voltage and the eighth single-ended voltage, obtaining the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference. Finally, the first device determines the short-circuit detection result based on the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference, and sends the short-circuit detection result to the second device. In this way, it is realized to detect the single-ended voltages of the differential pairs of the USB interfaces of the USB Hub under different channels, calculate the voltage differences of the single-ended voltages detected twice, and judge the short-circuit state of the differential pairs of the USB interfaces through the voltage differences, which is beneficial to improving the compatibility of the USB Hub. Description of the Drawings

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0031] Figure 1 is a schematic structural diagram of a differential pair detection system provided by an embodiment of the present application;

[0032] Figure 2 is a schematic flowchart of a differential pair detection method provided by an embodiment of the present application;

[0033] Figure 3a is a schematic structural diagram of a differential pair detection system provided by an embodiment of the present application;

[0034] Figure 3b is a schematic structural diagram of a voltage detection module provided by an embodiment of the present application;

[0035] Figure 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

[0036] Figure 5 is a schematic diagram of a differential pair detection device provided by an embodiment of the present application. Detailed Embodiments

[0037] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the protection scope of this application.

[0038] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0039] Referring to "embodiments" herein means that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0040] 1) The electronic devices involved in the embodiments of this application can include various handheld devices, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem with wireless communication functions, as well as various forms of user equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal device (terminal device), and so on. For the sake of convenience of description, the above-mentioned devices are collectively referred to as electronic devices. In this application, the above-mentioned electronic devices can also include servers.

[0041] 2) A USB Hub is a device that can expand one USB interface into multiple interfaces and enable the expanded interfaces to be used simultaneously. The interface protocol version of the USB Hub can be USB2.0, USB2.1, USB3.0, USB3.1, and USB3.2. The number of interfaces of the USB Hub can be 4 or 7, which is not limited here. The USB Hub can be connected to a PC device, and the PC device can automatically recognize the connected USB Hub and other USB devices connected to the expanded interfaces of the USB Hub.

[0042] Currently, when a USB Hub cannot be recognized by the connected system, the system cannot identify the reason why the USB Hub cannot be used, and cannot distinguish problems such as short circuits, open soldering, and false soldering in the differential pair data lines of the USB Hub. Moreover, USB devices connected to the USB expansion interface often cannot work stably or cannot be recognized by the system when their own power is too large or when multiple USB devices are connected to multiple expansion interfaces simultaneously, resulting in poor compatibility of the USB Hub.

[0043] To address the above problems, the present application proposes a differential pair detection method and related device, which will be described in detail below.

[0044] Please refer to Figure 1 , Figure 1 which is a schematic architecture diagram of a differential pair detection system provided by an embodiment of the present application. The system architecture may include a first device 100a, a target USB Hub 100b, and a second device 100c.

[0045] Among them, the first device 100a is respectively connected to the second device 100c and the target USB Hub 100b. The target USB Hub 100b includes a USB upstream interface and multiple USB downstream interfaces. Each USB interface corresponds to a differential pair, and a differential pair corresponds to two transmission lines, namely, a first transmission line and a second transmission line.

[0046] Among them, the first device 100a includes two transmission channels, a data transmission channel and a voltage detection channel. The first device can detect the single-ended voltages of the two transmission lines of the differential pair of the USB interface in the target USB Hub 100b in the data transmission channel and the voltage detection channel respectively.

[0047] Among them, the second device 100c can be a PC host, which is used to receive the short circuit detection result sent by the first device 100a and the detection data sent by the first device 100a, and process and analyze the detection data.

[0048] Among them, after the first device 100a is initialized and within a preset time, after receiving the start short circuit detection signal sent by the second device 100c, it starts to perform short circuit detection on the target USB Hub 100b.

[0049] Among them, the first device 100a can detect the protocol version of the USB interface of the target USB Hub 100b. The first device may include multiple voltage detection modules. Each voltage detection module corresponds to a differential pair of the USB interface of the target USB Hub 100b. The multiple voltage detection modules are used to detect the single-ended voltages of the first transmission line and the second transmission line of the corresponding USB interface differential pair simultaneously or one by one.

[0050] Among them, the first device 100a may include a USB power supply, which is used to start powering the USB interface when the power supply of the USB interface is insufficient.

[0051] In a possible example, the first device 100a may switch the data channel to the data transmission channel, detect the first single-ended voltage and the second single-ended voltage of each USB interface differential pair of the first transmission line of the target USB Hub 100b, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line. Then, the first device 100a switches the data channel to the voltage test channel, determines the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line. Then, the first device 100a calculates the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, to obtain the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference. Finally, the first device 100a determines the short-circuit detection result of each USB interface differential pair according to the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference, and sends the short-circuit detection result to the second device 100c. In this way, the first device 100a detects the single-ended voltage of the USB interface differential pair of the target USB Hub 100b under different channels, calculates the voltage difference, and judges the short-circuit state of the USB interface differential pair through the voltage difference, which is beneficial to improving the compatibility of the USB Hub.

[0052] It should be noted that in this application, "multiple" may refer to two or more, and will not be elaborated hereinafter.

[0053] Please refer to Figure 2 , Figure 2 which is a schematic flow chart of a differential pair detection method provided by an embodiment of this application, and is applied to the first device. The first device is respectively connected to the second device and the USB interface differential pair of the target USB Hub. The USB interface differential pair includes a first transmission line and a second transmission line. As shown in the figure, this differential pair detection method includes the following operations.

[0054] S201. Switch the data channel to the data transmission channel, where the data channel includes the data transmission channel and the voltage test channel.

[0055] Among them, the target USB Hub includes multiple USB interfaces, each USB interface corresponds to a differential pair, and each differential pair corresponds to two transmission lines. The USB interface differential line here can be the differential pair corresponding to any one of the multiple interfaces of the target USB Hub.

[0056] Among them, the first device can be simultaneously connected to multiple USB interfaces of the target USB Hub, and can simultaneously detect the single-ended voltages of differential pairs of multiple USB interfaces.

[0057] S202. Detect the first single-ended voltage and the second single-ended voltage of the first transmission line, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line.

[0058] Among them, after the first device receives the start short-circuit detection signal sent by the second device within a preset time after initialization, it starts to initiate the short-circuit detection of the USB Hub.

[0059] Among them, the first device includes a protocol detection module. Before detecting the first single-ended voltage and the second single-ended voltage of the first transmission line, the protocol detection module needs to first detect the protocol version of the target USB Hub. The protocol detection module can be CyUSB3014, and the protocol detection module is also used to collect data of the target USB Hub and transfer data of the high-speed USB Hub.

[0060] Among them, the first single-ended voltage of the first transmission line corresponds to the single-ended voltage of the second transmission line, the third single-ended voltage corresponds to the fourth single-ended voltage. The first single-ended voltage corresponds to RX+ of the USB interface differential pair, the third single-ended voltage corresponds to RX- of the USB interface differential pair, the second single-ended voltage corresponds to TX+ of the USB interface differential pair, and the fourth single-ended voltage corresponds to TX- of the USB interface differential pair.

[0061] S203. Switch the data channel to the voltage test channel, and determine the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line.

[0062] Among them, the fifth single-ended voltage of the first transmission line corresponds to the single-ended voltage of the seventh transmission line, the sixth single-ended voltage corresponds to the eighth single-ended voltage. The fifth single-ended voltage corresponds to RX+ of the USB interface differential pair, the seventh single-ended voltage corresponds to RX- of the USB interface differential pair, the sixth single-ended voltage corresponds to TX+ of the USB interface differential pair, and the eighth single-ended voltage corresponds to TX- of the USB interface differential pair.

[0063] S204. Calculate the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference.

[0064] S205. When any one of the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference is less than a preset voltage threshold, determine that the short-circuit detection result is that there is a short circuit.

[0065] S206. When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold, determine that the short-circuit detection result is that there is an open circuit.

[0066] Among them, an open circuit in the USB interface differential pair means that there are solder voids and poor soldering in the USB interface differential pair.

[0067] S207. When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold, determine that the short-circuit detection result is that the state is normal.

[0068] Among them, the preset voltage threshold can be 0.

[0069] Among them, when the first voltage difference is less than the preset voltage threshold, it is determined that there is a short circuit at the signal input end of the first transmission line; when the second voltage difference is less than the preset voltage threshold, it is determined that there is a short circuit at the signal output end of the first transmission line; when the third voltage difference is less than the preset voltage threshold, it is determined that there is a short circuit at the signal input end of the second transmission line; when the fourth voltage difference is less than the preset voltage threshold, it is determined that there is a short circuit at the signal output end of the second transmission line.

[0070] Among them, when there are solder voids or poor soldering in any transmission line of the USB differential pair, the differential pair is open-circuited and cannot continue to transmit differential signals.

[0071] S208. Send the short-circuit detection result to the second device.

[0072] Among them, the short-circuit detection results include that there is a short circuit, an open circuit, and a normal state in the USB interface differential pair. For different short-circuit detection results, the signals sent by the first device to the second device are different. For example: when the short-circuit detection result is that there is a short circuit in the USB interface differential pair, the first device sends 0*16 to the second device; when the short-circuit detection result is that there is an open circuit in the USB interface differential pair, the first device sends 0*15 to the second device; when the short-circuit detection result is that the USB interface differential pair is in a normal state, the first device sends 0*14 to the second device.

[0073] It can be seen that in the embodiment of the present application, the first device can switch the data channel to the data transmission channel, detect the first single-ended voltage and the second single-ended voltage of the first transmission line, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line. Then, the first device switches the data channel to the voltage test channel, determines the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line. The first device further calculates the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, to obtain the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference. Finally, the first device determines the short-circuit detection result according to the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference, and sends the short-circuit detection result to the second device. In this way, the single-ended voltages of the differential pairs of the USB interfaces of the USB Hub are detected under different channels, the voltage differences of the single-ended voltages detected twice are calculated, and the short-circuit state of the differential pairs of the USB interfaces is judged by the voltage differences, which is beneficial to improving the compatibility of the USB Hub.

[0074] In a possible example, after determining that the short-circuit detection result is normal, the above method may further include the following steps: detecting the power supply voltage of each of the multiple USB interfaces of the target USB Hub to obtain a plurality of first power supply voltages, where the target USB Hub includes a plurality of the USB interface differential pairs, and each of the USB interface differential pairs corresponds to one of the USB interfaces; when any one of the plurality of first power supply voltages is less than the first preset power supply voltage threshold, determining the state of the USB power supply corresponding to the plurality of USB interfaces; if the state of the USB power supply is the unstarted state, determining that the USB power supply starts abnormally; if the state of the USB power supply is the started state, then detecting the power supply voltage of each of the multiple USB interfaces to obtain a plurality of second power supply voltages; judging whether each of the plurality of second power supply voltages falls within the preset power supply voltage range; if any one of the plurality of second power supply voltages is lower than the lower limit value of the preset power supply voltage range, determining that the USB power supply is abnormal; if each of the plurality of second power supply voltages falls within the preset power supply voltage range, determining that the USB power supply is normal.

[0075] Among them, when multiple devices are connected to the USB Hub simultaneously, there is often a situation of insufficient power supply for the USB interfaces, resulting in the devices connected to the USB interfaces not being recognized by the system or the devices connected being unstable due to insufficient power supply.

[0076] Among them, the target USB Hub includes a USB power supply, which can be used to supply power to the USB interfaces corresponding to the USB interface differential pairs. That is, when the target USB Hub itself detects insufficient supply voltage, it can activate the USB power supply to supply power to the USB interfaces, so that the supply voltage of the USB interfaces can be stabilized within a preset supply voltage range.

[0077] Among them, the first device can simultaneously and in real time monitor the supply voltage of each USB interface among multiple USB interfaces of the target USB Hub. When the USB interface is greater than or equal to the first preset supply voltage threshold, the USB interface can meet the requirements of the connected device, and the connected device can operate stably. The first preset supply voltage threshold can be set manually or by default by the system, and no limitation is made here.

[0078] In a specific implementation, the first device can obtain in real time the first supply voltage of each USB interface among multiple USB interfaces of the target USB Hub. When the first supply voltage of any USB interface is less than the first preset supply voltage threshold, determine the startup status of the USB power supply. And when the USB power supply starts up normally, determine whether the second supply voltage corresponding to each USB interface among the multiple USB interfaces falls within the preset supply voltage range to determine whether the USB power supply is working properly. If any of the multiple second supply voltages is lower than the lower limit value of the preset supply voltage range, it is determined that the USB power supply is abnormal. If each of the multiple second supply voltages falls within the preset supply voltage range, it is determined that the USB power supply is normal.

[0079] It can be seen that in this example, the first device can judge whether the USB power supply is abnormal through the supply voltages of multiple USB interfaces of the target USB Hub, which is beneficial to ensuring that the devices connected to the USB interfaces can be recognized by the system and operate stably, and is beneficial to improving the compatibility of the USB Hub.

[0080] In a possible example, before detecting the first single-ended voltage and the second single-ended voltage of the first transmission line, the above method may include the following steps: detecting the protocol version of the USB interface differential pair, where the protocol version includes USB2.0 protocol, USB2.1 protocol, USB3.0 protocol, USB3.1 protocol, and USB3.2 protocol.

[0081] Among them, the first device may include a protocol detection module, which is CyUSB3014 and can be connected to the USB interface of the target USB Hub for detecting which protocol version among USB2.0 protocol, USB2.1 protocol, USB3.0 protocol, USB3.1 protocol, and USB3.2 protocol the USB interface is.

[0082] It can be seen that in this example, the first device can use CyUSB3014 to detect the protocol version of the USB interface of the target USB Hub, which is beneficial to determining the target power and the preset time threshold according to the protocol version subsequently.

[0083] In a possible example, the above method may include the following steps: determining the target power according to the protocol version; adjusting the preset load to the target power load; detecting the third power supply voltage of the USB interface corresponding to the USB interface differential pair; judging whether the third power supply voltage is greater than the second preset power supply voltage threshold; if the third power supply voltage is greater than or equal to the second preset power supply voltage threshold, determining that the USB interface supports access to the target power load; if the third power supply voltage is less than the second preset power supply voltage threshold, determining that the USB interface does not support access to the target power load.

[0084] Among them, when a high-power USB device is connected to a USB interface of the target USB Hub, the USB interface often has insufficient power supply. At this time, the power supply voltage required by the USB interface is greater than the upper limit of the preset power supply voltage range and greater than the second preset power supply voltage threshold to meet the stable operation requirements of the high-power USB device.

[0085] Among them, when the first device detects the power supply voltage of the target USB Hub, it can adjust the load connected to the USB interface of the target USB Hub. Of course, it can also detect the power supply voltage under no-load conditions.

[0086] Among them, the target power is associated with the protocol version of the USB interface. Different protocol versions correspond to different target powers. Generally, the higher the protocol version, the greater the target power. The target power refers to the maximum power of the USB device that can be supported under the current USB interface protocol version.

[0087] Among them, when powered by the USB power supply, it can be judged whether the third power supply voltage of the USB interface at this time is greater than the second preset power supply voltage threshold to judge whether the USB interface of the target USB Hub supports a USB device reaching the target power. The second preset voltage threshold is greater than the first preset voltage threshold.

[0088] It can be seen that in this example, the first device can judge whether the USB interface supports access to the target power USB device when powered by the USB power supply through the third power supply voltage of the USB interface of the target USB Hub, which is beneficial to ensuring that the target power USB device connected to the USB interface can be recognized by the system and operate stably, and is beneficial to improving the compatibility of the USB Hub.

[0089] In a possible example, if the target USB Hub includes a short-circuit protection circuit, the above method may further include the following steps: detecting the short-circuit recovery time of the protection circuit; determining a preset time threshold according to the protocol version; comparing the short-circuit recovery time with the preset time threshold; if the short-circuit recovery time is less than the preset time threshold, determining that the short-circuit protection circuit has recovered from the short circuit normally; if the short-circuit recovery time is greater than or equal to the preset time threshold, determining that the short-circuit protection circuit has an abnormal short-circuit recovery.

[0090] Among them, the short-circuit protection circuit of the USB Hub is used to automatically cut off the power supply of the USB power supply to the USB interface of the USB Hub when a short circuit occurs in the USB power output line, or when the USB device connected to the USB interface of the USB Hub is not within the support range of the current protocol version of the USB Hub, the power supply of the USB power supply to the USB interface of the USB Hub is automatically cut off.

[0091] Among them, when the short-circuit fault of the USB power supply disappears or a USB device within the support range of the current protocol version of the current target USB Hub is connected, the short-circuit protection circuit can automatically resume the power supply of the USB power supply to the USB interface of the USB Hub.

[0092] Among them, the preset time threshold is associated with the protocol version, and the preset time threshold can be set manually or by default by the system, which is not limited here.

[0093] In a specific implementation, when the first device eliminates the short-circuit fault of the USB power supply or switches to connect a USB device within the support range of the current protocol version of the current target USB Hub, it starts to record the recovery time of the short-circuit protection circuit until the USB power supply can start to supply power to the USB interface of the target USB Hub normally, and obtains the short-circuit recovery time of the short-circuit protection circuit. Then, the first device determines the preset time threshold according to the protocol version of the target USB Hub. Further, the first device determines whether the short-circuit recovery of the short-circuit protection circuit is abnormal according to the comparison between the short-circuit recovery time and the preset time threshold. If the short-circuit recovery time is less than the preset time threshold, it is determined that the short-circuit protection circuit has recovered from the short circuit normally; if the short-circuit recovery time is greater than or equal to the preset time threshold, it is determined that the short-circuit protection circuit has an abnormal short-circuit recovery.

[0094] It can be seen that in this example, the first device can detect the short-circuit recovery time of the short-circuit protection circuit of the target USB Hub, and determine whether the short-circuit protection circuit of the USB Hub has an abnormal short-circuit recovery according to the relationship between the short-circuit recovery time and the preset time threshold, which is beneficial to ensuring that the USB Hub can handle short-circuit faults and resume stable operation in a timely manner.

[0095] In a possible example, to determine the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line, the above method may include the following steps: detecting a plurality of fifth single-ended detected voltages and a plurality of sixth single-ended detected voltages of the first transmission line of the USB interface differential pair, and a plurality of seventh single-ended detected voltages and a plurality of eighth single-ended detected voltages of the second transmission line; respectively screening out the maximum voltage value and the minimum voltage value among the plurality of fifth single-ended detected voltages, the maximum voltage value and the minimum voltage value among the plurality of sixth single-ended detected voltages, the maximum voltage value and the minimum voltage value among the plurality of seventh single-ended detected voltages, and the maximum voltage value and the minimum voltage value among the plurality of eighth single-ended detected voltages, to obtain a plurality of fifth target detected voltages, a plurality of sixth target detected voltages, a plurality of seventh target detected voltages, and a plurality of eighth target detected voltages; respectively calculating the mean values of the plurality of fifth target detected voltages, the plurality of sixth target detected voltages, the plurality of seventh target detected voltages, and the plurality of eighth target detected voltages, to obtain corresponding fifth target detected mean voltages, sixth target detected mean voltages, seventh target detected mean voltages, and eighth target detected mean voltages; using the fifth target detected mean voltage as the fifth single-ended voltage, using the sixth target detected mean voltage as the sixth single-ended voltage, using the seventh target detected mean voltage as the seventh single-ended voltage, and using the eighth target detected mean voltage as the eighth single-ended voltage.

[0096] Among them, the first device needs to detect the single-ended voltages of the first transmission line and the second transmission line a preset number of times to obtain a plurality of fifth single-ended detected voltages, a plurality of sixth single-ended detected voltages, a plurality of seventh single-ended detected voltages, and a plurality of eighth single-ended voltages.

[0097] Among them, the fifth single-ended detected voltage of the first transmission line corresponds to the single-ended detected voltage of the seventh transmission line, the sixth single-ended detected voltage corresponds to the eighth single-ended detected voltage, the fifth single-ended detected voltage corresponds to RX+ of the USB interface differential pair, the seventh single-ended detected voltage corresponds to RX- of the USB interface differential pair, the sixth single-ended detected voltage corresponds to TX+ of the USB interface differential pair, and the eighth single-ended detected voltage corresponds to TX- of the USB interface differential pair.

[0098] It can be seen that in this example, the first device detects the single-ended voltages a preset number of times, screens out the maximum voltage value and the minimum voltage value among the plurality of single-ended voltages, and then calculates the mean value of the plurality of single-ended voltages as the fifth single-ended voltage, the sixth single-ended voltage, the seventh single-ended voltage, and the eighth single-ended voltage that are ultimately used to calculate the voltage difference, which is beneficial to reducing the error of short-circuit detection.

[0099] In a possible example, when the USB port of the target USB Hub includes a Type-C interface, the first device can obtain the capability data information sent by the target USB interface, that is, the Type-C interface; determine the power supply current capability of the target USB interface according to the capability data information; determine the first power supply requirement according to the power supply current capability, where the first power supply requirement includes a first power supply current; send the first power supply requirement to the target USB interface; detect the fourth power supply voltage of the target USB interface; determine the second power supply current according to the fourth power supply voltage and the resistance value of the preset load; when the first power supply current is equal to the second power supply current, determine that the power supply of the target USB interface is normal; when the first power supply current is greater than the second power supply current, determine that the power supply of the target USB interface is abnormal.

[0100] Wherein, the capability data information is the default power supply capability information of the target USB interface, including the power supply current capability.

[0101] Wherein, the first power supply requirement is the maximum power supply capability value within the power supply capability range of the target USB interface, used to determine whether the target USB interface can provide the power supply current corresponding to the power supply current capability. For example, when the power supply capability of the target USB interface is 9V / 100a, the first power supply requirement is 9V / 100a.

[0102] Optionally, to further test whether the target USB interface can meet different power supply requirements of the same USB device, the first device can send a second power supply requirement and a third power supply requirement to the target USB interface respectively, where the power supply capability value corresponding to the third power supply requirement is greater than the power supply capability value corresponding to the second power supply requirement, the second power supply requirement includes a third power supply current, and the third power supply requirement includes a fourth power supply current; respectively detect the fifth power supply voltage and the sixth power supply voltage corresponding to the target USB interface, where the second power supply requirement corresponds to the fifth power supply voltage and the third power supply requirement corresponds to the sixth power supply voltage; further determine the fifth power supply current corresponding to the fifth power supply voltage and the sixth power supply current corresponding to the sixth power supply voltage, and determine whether the target USB interface can supply power according to different power supply requirements of the same USB device according to the magnitude relationship between the third power supply current and the fifth power supply current and the magnitude relationship between the fourth power supply current and the sixth power supply current, which is beneficial to improving the intelligence of the power supply of the USB interface of the USB Hub.

[0103] As Figure 3a shown, Figure 3a is a schematic structural diagram of a differential pair detection system provided by an embodiment of the present application, which is applied to the first device 100a. The differential pair detection system includes:

[0104] The switch control module 31 is respectively connected to the USB interface differential pair of the target USB Hub 100b and the control center 33, and is used for the control center 33 to control the switching of the data channel to the data transmission channel, and for switching the data channel to the voltage detection channel;

[0105] The voltage detection module 32 is respectively connected to the USB interface differential pair and the control center 33, and is used for detecting the first single-ended voltage and the second single-ended voltage of the first transmission line of the USB interface differential pair, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line after the switch control module 31 switches the data channel to the data transmission channel; It is also used for detecting the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line of the USB interface differential pair, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line after the switch control module 31 switches the data channel to the voltage detection channel, and sending the first voltage, the second voltage, the third voltage, the fourth voltage, the fifth voltage, the sixth voltage, the seventh voltage and the eighth voltage to the control center 33;

[0106] The control center 33 is connected to the device communication module 34, and is used for calculating the difference between the received first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage to obtain the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference; It is also used for determining that the short-circuit detection result is a short circuit when any one of the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference is less than the preset voltage threshold; when the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference are all equal to the preset voltage threshold, determining that the short-circuit detection result is an open circuit; when the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference are all greater than the preset voltage threshold, determining that the short-circuit detection result is normal, and sending the short-circuit detection result to the device communication module 34;

[0107] The device communication module 34 is connected to the second device 100c, and is used for receiving the short-circuit detection result and sending the short-circuit detection result to the second device 100c.

[0108] Among them, the switch control module 31 is composed of a hardware circuit.

[0109] Among them, the differential pair detection system further includes a protocol detection module 35, the protocol detection module is CyUSB3014, and the protocol detection module 35 is differentially connected to the USB interface of the target USB Hub for detecting the USB protocol version of the USB interface.

[0110] Among them, the differential pair detection system may further include a load adjustment module for adjusting the load connected to the USB interface of the target USB Hub.

[0111] Among them, as Figure 3b shown, Figure 3b is a schematic structural diagram of a voltage detection module provided by an embodiment of the present application. The voltage detection module 32 includes: a control module 321, a detection module 322, a calculation module 323, and a data transmission module 324.

[0112] Among them, the control module 321 is respectively connected to the detection module 322 and the control center 33. The control module 321 is used to receive the voltage detection signal sent by the control center and control the detection module 322 to detect the single-ended voltages of the USB interface differential pair, including a first single-ended voltage, a second single-ended voltage, a third single-ended voltage, a fourth single-ended voltage, multiple fifth single-ended detection voltages, multiple sixth single-ended detection voltages, multiple seventh single-ended detection voltages, and multiple eighth single-ended detection voltages.

[0113] The detection module 322 is connected to the calculation module 323 and is used to send the first single-ended voltage, the second single-ended voltage, the third single-ended voltage, the fourth single-ended voltage, multiple fifth single-ended detection voltages, multiple sixth single-ended detection voltages, multiple seventh single-ended detection voltages, and multiple eighth single-ended detection voltages to the calculation module 323.

[0114] Among them, the calculation module 323 is connected to the data transmission module 324 and is used to respectively screen out the maximum voltage value and the minimum voltage value among multiple fifth single-ended detection voltages, the maximum voltage value and the minimum voltage value among multiple sixth single-ended detection voltages, the maximum voltage value and the minimum voltage value among multiple seventh single-ended detection voltages, and the maximum voltage value and the minimum voltage value among multiple eighth single-ended detection voltages, so as to obtain multiple fifth target detection voltages, multiple sixth target detection voltages, multiple seventh target detection voltages, and multiple eighth target detection voltages; respectively calculate the means of the multiple fifth target detection voltages, the means of the multiple sixth target detection voltages, the means of the multiple seventh target detection voltages, and the means of the multiple eighth target detection voltages, so as to obtain corresponding fifth target detection mean voltages, sixth target detection mean voltages, seventh target detection mean voltages, and eighth target detection mean voltages; use the fifth target detection mean voltage as the fifth single-ended voltage, use the sixth target detection mean voltage as the sixth single-ended voltage, use the seventh target detection mean voltage as the seventh single-ended voltage, and use the eighth target detection mean voltage as the eighth single-ended voltage; and send the first single-ended voltage, the second single-ended voltage, the third single-ended voltage, the fourth single-ended voltage, the fifth single-ended voltage, the sixth single-ended voltage, the seventh single-ended voltage, and the eighth single-ended voltage to the data transmission module 324.

[0115] Among them, the data transmission module 324 is connected to the control center 33 and is used to send the first single-ended voltage, the second single-ended voltage, the third single-ended voltage, the fourth single-ended voltage, the fifth single-ended voltage, the sixth single-ended voltage, the seventh single-ended voltage, and the eighth single-ended voltage to the control center 33.

[0116] Among them, the target USB Hub 100b includes multiple USB interfaces, each USB interface corresponds to a differential pair, and each differential pair corresponds to a pair of transmission lines, namely the first transmission line and the second transmission line.

[0117] Among them, the first device 100a may include multiple voltage detection modules 32, and each voltage detection module 32 corresponds to each USB interface differential pair of the target USB Hub 100b. Therefore, the first device can simultaneously detect the short-circuit states of multiple USB interface differential pairs of the target USB Hub 100b, that is, there is a short circuit, there is an open solder joint or a virtual solder joint, and the state is normal.

[0118] It can be seen that in the embodiment of the present application, the switch control module 31 in the first device 100a can switch the data channel to the data transmission channel. The voltage detection module 32 detects the first single-ended voltage and the second single-ended voltage of the first transmission line of the USB interface differential pair of the target USB Hub 100b, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line. Then, the switch control module 31 in the first device 100a switches the data channel to the voltage test channel, and the voltage detection module 32 further determines the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line, and sends the first voltage, the second voltage, the third voltage, the fourth voltage, the fifth voltage, the sixth voltage, the seventh voltage, and the eighth voltage to the control center 33. The control center 33 calculates the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, obtaining the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference. Finally, the control center 33 determines the short-circuit detection result according to the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference, and sends the short-circuit detection result to the device communication module 34, and the device communication module sends the short-circuit detection result to the second device 100c. In this way, the single-ended voltages of the USB interface differential pair of the USB Hub are detected under different channels, the voltage differences of the single-ended voltages detected twice are calculated, and the short-circuit state of the USB interface differential pair is judged by the voltage difference, which is beneficial to improving the compatibility of the USB Hub.

[0119] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application, applied to the first device. The first device is respectively connected to the second device and the USB interface differential pair of the target USB Hub. The USB interface differential pair includes a first transmission line and a second transmission line. As shown in the figure, the electronic device includes a processor, a memory, a communication interface, and one or more programs. Among them, the above one or more programs are stored in the above memory, and the above one or more programs are configured with instructions for the above processor to execute the following steps:

[0120] Switch the data channel to the data transmission channel, where the data channel includes the data transmission channel and the voltage test channel;

[0121] Detect the first single-ended voltage and the second single-ended voltage of the first transmission line, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line;

[0122] Switch the data channel to the voltage test channel, and determine the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, as well as the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line;

[0123] Calculate the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference;

[0124] When any one of the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference is less than a preset voltage threshold, determine that the short-circuit detection result is that there is a short circuit;

[0125] When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold, determine that the short-circuit detection result is that there is an open circuit;

[0126] When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold, determine that the short-circuit detection result is normal;

[0127] Send the short-circuit detection result to the second device.

[0128] It can be seen that in the embodiments of the present application, the electronic device can switch the data channel to the data transmission channel, detect the first single-ended voltage and the second single-ended voltage of the first transmission line, as well as the third single-ended voltage and the fourth single-ended voltage of the second transmission line. Then, the electronic device switches the data channel to the voltage test channel, determines the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, as well as the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line. Further, the electronic device calculates the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference. Finally, the electronic device determines the short-circuit detection result according to the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference, and sends the short-circuit detection result to the second device. In this way, it is realized to detect the single-ended voltages of the differential pairs of the USB interfaces of the USB Hub under different channels, calculate the voltage differences of the single-ended voltages detected twice, and judge the short-circuit state of the USB interface differential pair through the voltage differences, which is beneficial to improving the compatibility of the USB Hub.

[0129] In a possible example, after determining that the short-circuit detection result is normal, the above program further includes instructions for performing the following steps:

[0130] Detect the power supply voltage of each of the multiple USB interfaces of the target USB Hub to obtain a plurality of first power supply voltages, where the target USB Hub includes a plurality of USB interface differential pairs, and each USB interface differential pair corresponds to one of the USB interfaces;

[0131] When any one of the plurality of first power supply voltages is less than a first preset power supply voltage threshold, determine the state of the USB power supply corresponding to the plurality of USB interfaces;

[0132] If the state of the USB power supply is the unstarted state, determine that the USB power supply starts abnormally;

[0133] If the state of the USB power supply is the started state, then detect the power supply voltage of each of the multiple USB interfaces to obtain a plurality of second power supply voltages;

[0134] Determine whether each of the plurality of second power supply voltages falls within the preset power supply voltage range;

[0135] If any one of the plurality of second power supply voltages is lower than the lower limit value of the preset power supply voltage range, determine that the USB power supply is abnormally powered;

[0136] If each of the plurality of second power supply voltages falls within the preset power supply voltage range, determine that the USB power supply is normally powered.

[0137] In a possible example, before detecting the first single-ended voltage and the second single-ended voltage of the first transmission line, the above program further includes instructions for performing the following steps:

[0138] Detect the protocol version of the USB interface differential pair, where the protocol version includes USB2.0 protocol, USB2.1 protocol, USB3.0 protocol, USB3.1 protocol, and USB3.2 protocol.

[0139] In a possible example, the above program further includes instructions for performing the following steps:

[0140] Determine the target power according to the protocol version;

[0141] Adjust the preset load to the target power load;

[0142] Detect the third power supply voltage of the USB interface corresponding to the USB interface differential pair;

[0143] Determine whether the third power supply voltage is greater than a second preset power supply voltage threshold;

[0144] If the third power supply voltage is greater than or equal to the second preset power supply voltage threshold, it is determined that the USB interface supports access to the target power load;

[0145] If the third power supply voltage is less than the second preset power supply voltage threshold, it is determined that the USB interface does not support access to the target power load.

[0146] In a possible example, if the target USB Hub includes a short-circuit protection circuit, the above program further includes instructions for performing the following steps:

[0147] Detect the short-circuit recovery time of the protection circuit;

[0148] Determine a preset time threshold according to the protocol version;

[0149] Compare the short-circuit recovery time with the preset time threshold;

[0150] If the short-circuit recovery time is less than the preset time threshold, it is determined that the short-circuit protection circuit has normal short-circuit recovery;

[0151] If the short-circuit recovery time is greater than or equal to the preset time threshold, it is determined that the short-circuit protection circuit has abnormal short-circuit recovery.

[0152] In a possible example, in terms of determining the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line, the above program includes instructions for performing the following steps:

[0153] Detect a plurality of fifth single-ended detection voltages and a plurality of sixth single-ended detection voltages of the first transmission line of the USB interface differential pair, and a plurality of seventh single-ended detection voltages and a plurality of eighth single-ended detection voltages of the second transmission line;

[0154] Respectively screen out the maximum voltage and the minimum voltage among the plurality of fifth single-ended detection voltages, the maximum voltage and the minimum voltage among the plurality of sixth single-ended detection voltages, the maximum voltage and the minimum voltage among the plurality of seventh single-ended detection voltages, and the maximum voltage and the minimum voltage among the plurality of eighth single-ended detection voltages, to obtain a plurality of fifth target detection voltages, a plurality of sixth target detection voltages, a plurality of seventh target detection voltages, and a plurality of eighth target detection voltages;

[0155] Calculate the means of the multiple fifth target detection voltages, the means of the multiple sixth target detection voltages, the means of the multiple seventh target detection voltages, and the means of the multiple eighth target detection voltages respectively to obtain corresponding fifth target detection mean voltages, sixth target detection mean voltages, seventh target detection mean voltages, and eighth target detection mean voltages;

[0156] Use the fifth target detection mean voltage as the fifth single-ended voltage, use the sixth target detection mean voltage as the sixth single-ended voltage, use the seventh target detection mean voltage as the seventh single-ended voltage, and use the eighth target detection mean voltage as the eighth single-ended voltage.

[0157] The above mainly introduces the solution of the embodiment of the present application from the perspective of the execution process on the method side. It can be understood that in order for an electronic device to implement the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments provided in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0158] The embodiments of the present application can divide the functional units of the electronic device according to the above method examples. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, only a logical function division, and there can be other division methods in actual implementation.

[0159] In the case of dividing each functional module corresponding to each function, Figure 5 A schematic diagram of a differential pair detection device is given, which is applied to a first device. The first device is differentially connected to a second device and a USB interface differential pair respectively. The USB interface differential pair includes a first transmission line and a second transmission line. As Figure 5 shown, the differential pair detection device 500 may include: a channel switching unit 501, a detection unit 502, a determination unit 503, a calculation unit 504, and a sending unit 505, where,

[0160] The channel switching unit 501 is used to switch the data channel to the data transmission channel, where the data channel includes the data transmission channel and the voltage test channel;

[0161] The detection unit 502 is configured to detect a first single-ended voltage and a second single-ended voltage of the first transmission line, and a third single-ended voltage and a fourth single-ended voltage of the second transmission line;

[0162] The determination unit 503 is configured to switch the data channel to the voltage test channel, and determine a fifth single-ended voltage and a sixth single-ended voltage of the first transmission line, and a seventh single-ended voltage and an eighth single-ended voltage of the second transmission line;

[0163] The calculation unit 504 is configured to calculate differences between the first single-ended voltage and the fifth single-ended voltage, between the second single-ended voltage and the sixth single-ended voltage, between the third single-ended voltage and the seventh single-ended voltage, and between the fourth single-ended voltage and the eighth single-ended voltage, to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference;

[0164] The determination unit 503 is further configured to, when any one of the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference is less than a preset voltage threshold, determine that the short-circuit detection result is that there is a short circuit;

[0165] The determination unit 503 is further configured to, when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold, determine that the short-circuit detection result is that there is an open circuit;

[0166] The determination unit 503 is further configured to, when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold, determine that the short-circuit detection result is normal;

[0167] The sending unit 505 is configured to send the short-circuit detection result to the second device.

[0168] It can be seen that in the embodiment of the present application, the first device can switch the data channel to the data transmission channel, detect the first single-ended voltage and the second single-ended voltage of the first transmission line, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line. Then, the first device switches the data channel to the voltage test channel, determines the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line. The first device further calculates the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, to obtain the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference. Finally, the first device determines the short-circuit detection result according to the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference, and sends the short-circuit detection result to the second device. In this way, the single-ended voltages of the USB interface differential pairs of the USB Hub are detected under different channels, the voltage differences of the single-ended voltages detected twice are calculated, and the short-circuit state of the USB interface differential pair is judged by the voltage difference, which is beneficial to improving the compatibility of the USB Hub.

[0169] In a possible example, after determining that the short-circuit detection result is in a normal state, the determining unit 503 is further specifically configured to:

[0170] Detect the power supply voltage of each of the multiple USB interfaces of the target USB Hub to obtain a plurality of first power supply voltages, where the target USB Hub includes a plurality of the USB interface differential pairs, and each of the USB interface differential pairs corresponds to one of the USB interfaces;

[0171] When any one of the plurality of first power supply voltages is less than a first preset power supply voltage threshold, determine the state of the USB power supply corresponding to the plurality of USB interfaces;

[0172] If the state of the USB power supply is an unstarted state, determine that the USB power supply starts abnormally;

[0173] If the state of the USB power supply is a started state, then detect the power supply voltage of each of the multiple USB interfaces to obtain a plurality of second power supply voltages;

[0174] Judge whether each of the plurality of second power supply voltages falls within the preset power supply voltage range;

[0175] If any one of the plurality of second power supply voltages is lower than the lower limit value of the preset power supply voltage range, determine that the USB power supply is abnormally powered;

[0176] If each of the multiple second supply voltages falls within the preset supply voltage range, it is determined that the USB power supply is normal.

[0177] In a possible example, before detecting the first single-ended voltage and the second single-ended voltage of the first transmission line, the detection unit 502 is further specifically configured to:

[0178] Detect the protocol version of the USB interface differential pair, where the protocol version includes USB2.0 protocol, USB2.1 protocol, USB3.0 protocol, USB3.1 protocol, and USB3.2 protocol.

[0179] In a possible example, the determination unit 503 is further specifically configured to:

[0180] Determine the target power according to the protocol version;

[0181] Adjust the preset load to the target power load;

[0182] Detect the third supply voltage of the USB interface corresponding to the USB interface differential pair;

[0183] Determine whether the third supply voltage is greater than a second preset supply voltage threshold;

[0184] If the third supply voltage is greater than or equal to the second preset supply voltage threshold, it is determined that the USB interface supports access to the target power load;

[0185] If the third supply voltage is less than the second preset supply voltage threshold, it is determined that the USB interface does not support access to the target power load.

[0186] In a possible example, if the target USB Hub includes a short-circuit protection circuit, the determination unit 503 is specifically configured to:

[0187] Detect the short-circuit recovery time of the protection circuit;

[0188] Determine a preset time threshold according to the protocol version;

[0189] Compare the short-circuit recovery time with the preset time threshold;

[0190] If the short-circuit recovery time is less than the preset time threshold, it is determined that the short-circuit protection circuit short-circuit recovery is normal;

[0191] If the short-circuit recovery time is greater than or equal to the preset time threshold, it is determined that the short-circuit protection circuit short-circuit recovery is abnormal.

[0192] In a possible example, in terms of determining the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line, the determining unit 503 is further specifically configured to:

[0193] Detect a plurality of fifth single-ended detection voltages and a plurality of sixth single-ended detection voltages of the first transmission line of the USB interface differential pair, and a plurality of seventh single-ended detection voltages and a plurality of eighth single-ended detection voltages of the second transmission line;

[0194] Respectively screen out the maximum voltage and the minimum voltage in the plurality of fifth single-ended detection voltages, the maximum voltage and the minimum voltage in the plurality of sixth single-ended detection voltages, the maximum voltage and the minimum voltage in the plurality of seventh single-ended detection voltages, and the maximum voltage and the minimum voltage in the plurality of eighth single-ended detection voltages, to obtain a plurality of fifth target detection voltages, a plurality of sixth target detection voltages, a plurality of seventh target detection voltages, and a plurality of eighth target detection voltages;

[0195] Respectively calculate the mean values of the plurality of fifth target detection voltages, the mean values of the plurality of sixth target detection voltages, the mean values of the plurality of seventh target detection voltages, and the mean values of the plurality of eighth target detection voltages, to obtain corresponding fifth target detection mean voltages, sixth target detection mean voltages, seventh target detection mean voltages, and eighth target detection mean voltages;

[0196] Use the fifth target detection mean voltage as the fifth single-ended voltage, use the sixth target detection mean voltage as the sixth single-ended voltage, use the seventh target detection mean voltage as the seventh single-ended voltage, and use the eighth target detection mean voltage as the eighth single-ended voltage.

[0197] It should be noted that all relevant contents of the steps involved in the above method embodiments can be cited in the function descriptions of the corresponding functional modules, and will not be repeated here.

[0198] The electronic device provided in this embodiment is used to execute the above differential pair detection method, and thus can achieve the same effect as the above implementation method.

[0199] The embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute some or all of the steps of any method recorded in the above method embodiments, and the above computer includes an electronic device.

[0200] The embodiments of the present application also provide a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps of any one of the methods described in the foregoing method embodiments. The computer program product may be a software installation package, and the computer includes a control platform.

[0201] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, some steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0202] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0203] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.

[0204] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0205] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0206] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of this application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.

[0207] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory, and the memory can include: flash drives, read-only memories, random access memories, magnetic disks, or optical discs, etc.

[0208] The above has introduced the embodiments of this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A differential pair detection method, characterized in that Applied to a first device, the first device is differentially connected to a second device and a USB interface differential pair of a target USB Hub respectively, the USB interface differential pair includes a first transmission line and a second transmission line, and includes: Switch the data channel to the data transmission channel, wherein the data channel includes the data transmission channel and a voltage test channel; Detect a first single-ended voltage and a second single-ended voltage of the first transmission line, and a third single-ended voltage and a fourth single-ended voltage of the second transmission line; Switch the data channel to the voltage test channel, determine a fifth single-ended voltage and a sixth single-ended voltage of the first transmission line, and a seventh single-ended voltage and an eighth single-ended voltage of the second transmission line; Calculate the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference; When any one of the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference is less than a preset voltage threshold, determine that the short-circuit detection result is that there is a short circuit; When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold, determine that the short-circuit detection result is that there is an open circuit; When the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold, determine that the short-circuit detection result is normal; Send the short-circuit detection result to the second device.

2. The method according to claim 1, characterized in that, After determining that the short-circuit detection result is normal, the method further includes: Detect the supply voltage of each of the multiple USB interfaces of the target USB Hub to obtain a plurality of first supply voltages, wherein the target USB Hub includes a plurality of the USB interface differential pairs, and each USB interface differential pair corresponds to one of the USB interfaces; When any one of the plurality of first supply voltages is less than a first preset supply voltage threshold, determine the state of the USB power supply corresponding to the plurality of USB interfaces; If the state of the USB power supply is an unstarted state, determine that the USB power supply starts abnormally; If the state of the USB power supply is a started state, then detect the supply voltage of each of the multiple USB interfaces to obtain a plurality of second supply voltages; Judge whether each of the plurality of second supply voltages falls within a preset supply voltage range; If any one of the plurality of second supply voltages is lower than the lower limit value of the preset supply voltage range, determine that the USB power supply is abnormally powered; If each of the plurality of second supply voltages falls within the preset supply voltage range, determine that the USB power supply is normally powered.

3. The method according to claim 1, characterized in that Before detecting the first single-ended voltage and the second single-ended voltage of the first transmission line, the method further includes: Detect the protocol version of the differential pair of the USB interface, where the protocol version includes USB2.0 protocol, USB2.1 protocol, USB3.0 protocol, USB3.1 protocol, and USB3.2 protocol.

4. The method according to claim 3, wherein The method further includes: Determine the target power according to the protocol version; Adjust the preset load to the target power load; Detect the third power supply voltage of the USB interface corresponding to the differential pair of the USB interface; Judge whether the third power supply voltage is greater than the second preset power supply voltage threshold; If the third power supply voltage is greater than or equal to the second preset power supply voltage threshold, determine that the USB interface supports access to the target power load; If the third power supply voltage is less than the second preset power supply voltage threshold, determine that the USB interface does not support access to the target power load.

5. The method according to claim 3, characterized in that, If the target USB Hub includes a short-circuit protection circuit, the method further includes: Detect the short-circuit recovery time of the protection circuit; Determine the preset time threshold according to the protocol version; Compare the short-circuit recovery time with the preset time threshold; If the short-circuit recovery time is less than the preset time threshold, determine that the short-circuit protection circuit short-circuit recovery is normal; If the short-circuit recovery time is greater than or equal to the preset time threshold, determine that the short-circuit protection circuit short-circuit recovery is abnormal.

6. The method according to claim 1, wherein The determining the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line includes: Detect a plurality of fifth single-ended detection voltages and a plurality of sixth single-ended detection voltages of the first transmission line of the differential pair of the USB interface, and a plurality of seventh single-ended detection voltages and a plurality of eighth single-ended detection voltages of the second transmission line; Respectively screen out the maximum voltage and the minimum voltage in the plurality of fifth single-ended detection voltages, the maximum voltage and the minimum voltage in the plurality of sixth single-ended detection voltages, the maximum voltage and the minimum voltage in the plurality of seventh single-ended detection voltages, and the maximum voltage and the minimum voltage in the plurality of eighth single-ended detection voltages, to obtain a plurality of fifth target detection voltages, a plurality of sixth target detection voltages, a plurality of seventh target detection voltages, and a plurality of eighth target detection voltages; Respectively calculate the mean values of the plurality of fifth target detection voltages, the mean values of the plurality of sixth target detection voltages, the mean values of the plurality of seventh target detection voltages, and the mean values of the plurality of eighth target detection voltages, to obtain the corresponding fifth target detection mean voltage, sixth target detection mean voltage, seventh target detection mean voltage, and eighth target detection mean voltage; Take the fifth target detection mean voltage as the fifth single-ended voltage, take the sixth target detection mean voltage as the sixth single-ended voltage, take the seventh target detection mean voltage as the seventh single-ended voltage, and take the eighth target detection mean voltage as the eighth single-ended voltage.

7. A differential pair detection system, characterized in that, Applied to the first device, it includes: The switch control module is respectively connected to the USB interface differential pair of the target USB Hub and the control center, and is used for the control center to control the switching of the data channel to the data transmission channel, and for switching the data channel to the voltage detection channel; The voltage detection module is respectively connected to the USB interface differential pair and the control center, and is used for detecting the first single-ended voltage and the second single-ended voltage of the first transmission line of the USB interface differential pair, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line after the switch control module switches the data channel to the data transmission channel; it is also used for detecting the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line of the USB interface differential pair, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line after the switch control module switches the data channel to the voltage detection channel, and sending the first single-ended voltage, the second single-ended voltage, the third single-ended voltage, the fourth single-ended voltage, the fifth single-ended voltage, the sixth single-ended voltage, the seventh single-ended voltage and the eighth single-ended voltage to the control center; The control center is connected to the device communication module, and is used for calculating the differences between the received first single-ended voltage and the fifth single-ended voltage, the second single-ended voltage and the sixth single-ended voltage, the third single-ended voltage and the seventh single-ended voltage, and the fourth single-ended voltage and the eighth single-ended voltage to obtain the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference; it is also used for determining that the short-circuit detection result is a short circuit when any one of the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference is less than the preset voltage threshold; determining that the short-circuit detection result is an open circuit when the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference are all equal to the preset voltage threshold; determining that the short-circuit detection result is normal when the first voltage difference, the second voltage difference, the third voltage difference and the fourth voltage difference are all greater than the preset voltage threshold, and sending the short-circuit detection result to the device communication module; The device communication module is connected to the second device, and is used for receiving the short-circuit detection result and sending the short-circuit detection result to the second device.

8. A differential pair detection device, characterized in that, Applied to the first device, the first device is respectively connected to the second device and the USB interface differential pair, and the USB interface differential pair includes a first transmission line and a second transmission line, and includes: a channel switching unit, a detection unit, a determination unit, a calculation unit and a sending unit, where, The channel switching unit is used for switching the data channel to the data transmission channel, where the data channel includes the data transmission channel and the voltage test channel; The detection unit is used for detecting the first single-ended voltage and the second single-ended voltage of the first transmission line, and the third single-ended voltage and the fourth single-ended voltage of the second transmission line; The determining unit is configured to switch the data channel to the voltage test channel, and determine the fifth single-ended voltage and the sixth single-ended voltage of the first transmission line, and the seventh single-ended voltage and the eighth single-ended voltage of the second transmission line; The calculating unit is configured to calculate the difference between the first single-ended voltage and the fifth single-ended voltage, the difference between the second single-ended voltage and the sixth single-ended voltage, the difference between the third single-ended voltage and the seventh single-ended voltage, and the difference between the fourth single-ended voltage and the eighth single-ended voltage, so as to obtain a first voltage difference, a second voltage difference, a third voltage difference, and a fourth voltage difference; The determining unit is further configured to determine that the short-circuit detection result is that there is a short circuit when any one of the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference is less than a preset voltage threshold; The determining unit is further configured to determine that the short-circuit detection result is that there is an open circuit when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all equal to the preset voltage threshold; The determining unit is further configured to determine that the short-circuit detection result is normal when the first voltage difference, the second voltage difference, the third voltage difference, and the fourth voltage difference are all greater than the preset voltage threshold; The sending unit is configured to send the short-circuit detection result to the second device.

9. An electronic device, characterized in that, It includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing the steps in the method according to any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, A computer program for electronic data exchange is stored, wherein the computer program causes a computer to execute the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Data storage method and device

    CN106649172A

  • Full-function automatic detection equipment for USB Type-C interface

    CN213337968U