A device interface detection method and apparatus

CN115685016BActive Publication Date: 2026-09-22LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211361383.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-02
Publication Date
2026-09-22
Estimated Expiration
2042-11-02

AI Technical Summary

Technical Problem

[0002]对于支持双接口的电子设备,如:手机、平板电脑或其他电子设备,如果两个接口能够同时给电子设备自身充电和对外充电,那么,若因用户的意外操作,将同一个电子设备上的两个充放电接口直连,就会造成电池能量在两个充放电接口之间循环消耗,造成不必要的电能损失

Benefits of technology

[0032]从上述技术方案可以看出,本申请公开的设备接口检测方法及装置,确定电子设备的第一接口及第二接口的电能传输状态,若第一接口和第二接口的电能传输状态不同,则检测第一接口对应的第一电流表征值及第二接口对应的第二电流表征值,若确定第一电流表征值与第二电流表征值的差值小于预设阈值,则确定第一接口与第二接口之间处于导体直接连接状态。本方案通过对电子设备的第一接口对应的第一电流表征值进行检测,同时对电子设备的第二接口对应的第二电流表征值进行检测,并基于第一电流表征值与第二电流表征值之间的差值确定第一接口与第二接口是否处于导体直接连接状态,避免了第一接口与第二接口处于导体直接连接状态时,无法及时确定而导致的电能在同一个电子设备的两个接口之间循环消耗导致的电能损失的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115685016B_ABST
    Figure CN115685016B_ABST
Patent Text Reader

Abstract

The application discloses a device interface detection method and device, determines the power transmission state of the first interface and the second interface of the electronic device, if the power transmission state of the first interface and the second interface is different, detects the first current characteristic value corresponding to the first interface and the second current characteristic value corresponding to the second interface, if it is determined that the difference between the first current characteristic value and the second current characteristic value is less than a preset threshold, it is determined that the first interface and the second interface are in a conductor direct connection state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of device interfaces, and in particular to a device interface testing method and apparatus. Background Technology

[0002] For electronic devices that support dual interfaces, such as mobile phones, tablets, or other electronic devices, if the two interfaces can charge the electronic device itself and charge external devices simultaneously, then if the user accidentally connects the two charging and discharging interfaces on the same electronic device directly, the battery energy will be consumed in a cycle between the two charging and discharging interfaces, resulting in unnecessary energy loss. Summary of the Invention

[0003] In view of the above, this application provides a device interface detection method and apparatus, the specific solution of which is as follows:

[0004] A device interface detection method, comprising:

[0005] Determine the power transmission status of the first and second interfaces of the electronic device;

[0006] If the power transmission states of the first interface and the second interface are different, then the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface are detected.

[0007] If the difference between the first current characterization value and the second current characterization value is determined to be less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

[0008] Furthermore, the step of determining that the first interface and the second interface are in a direct conductor connection state if the difference between the first current characterization value and the second current characterization value is less than a preset threshold includes:

[0009] If it is determined that the difference between the first current value and the second current value at the first moment is less than a preset threshold, then after an interval of the first preset time, the first current value and the second current value at the second moment are obtained.

[0010] If the difference between the first current value and the second current value at the second moment is determined to be less than the preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

[0011] Furthermore, the step of determining that the first interface and the second interface are in a direct conductor connection state if the difference between the first current characterization value and the second current characterization value is less than a preset threshold includes:

[0012] If it is determined that within a second preset time period, the difference between the average value of the first current and the average value of the second current at the first interface is less than a preset threshold, then it is determined that the first interface and the second interface are in a state of direct conductor connection.

[0013] Furthermore, if it is determined that the difference between the first current value and the second current value at the first moment is less than a preset threshold, then obtaining the first current value and the second current value at the second moment after a first preset time interval includes:

[0014] If the difference between the first current value and the second current value at the first moment is determined to be less than a preset threshold, the power transmitted through the first interface or the second interface is controlled to increase or decrease, and the first current value and the second current value at the second moment when the power transmitted through the first interface or the second interface increases or decreases are obtained.

[0015] Furthermore, it also includes:

[0016] If it is determined that the first interface and the second interface are in a direct conductor connection state, control the first interface or the second interface to turn off the power transmission function.

[0017] Furthermore, determining the power transmission status of the first interface and the second interface of the electronic device includes:

[0018] When it is determined that the first interface of the electronic device is connected to the first external device and the second interface is connected to the second external device, the power transmission status of the first interface and the second interface of the electronic device is determined.

[0019] Furthermore, the detection of the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface includes:

[0020] The first current characterization value corresponding to the first interface is detected by the first sampling resistor, and the second current characterization value corresponding to the second interface is detected by the second sampling resistor.

[0021] or,

[0022] The first current value corresponding to the first interface is detected by the first ammeter, and the second current value corresponding to the second interface is detected by the second ammeter.

[0023] A device interface testing apparatus, comprising:

[0024] A current detection structure is used to detect a first current characterization value corresponding to a first interface of an electronic device and a second current characterization value corresponding to a second interface.

[0025] The power management module is used to determine the power transmission status of the first interface and the second interface of the electronic device. If the power transmission status of the first interface and the second interface are different, the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface are detected by the current detection structure. If it is determined that the difference between the first current characterization value and the second current characterization value is less than a preset threshold, it is determined that the first interface and the second interface are in a direct conductor connection state.

[0026] Furthermore, the current detection structure includes:

[0027] A first sampling resistor is disposed between the first interface and the power management module, and is used to detect the first current characterization value corresponding to the first interface;

[0028] The second sampling resistor is disposed between the second interface and the power management module and is used to detect the second current characterization value corresponding to the second interface.

[0029] Furthermore, the current detection structure includes:

[0030] A first ammeter is installed at the first interface to detect the first current characterization value corresponding to the first interface;

[0031] A second ammeter is installed at the second interface to detect the second current characterization value corresponding to the second interface.

[0032] As can be seen from the above technical solution, the device interface detection method and apparatus disclosed in this application determine the power transmission status of the first interface and the second interface of the electronic device. If the power transmission status of the first interface and the second interface are different, the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface are detected. If the difference between the first current characterization value and the second current characterization value is less than a preset threshold, it is determined that the first interface and the second interface are in a direct conductor connection state. This solution detects the first current characterization value corresponding to the first interface of the electronic device and simultaneously detects the second current characterization value corresponding to the second interface of the electronic device. Based on the difference between the first current characterization value and the second current characterization value, it determines whether the first interface and the second interface are in a direct conductor connection state. This avoids the problem of power loss caused by the inability to determine in time when the first interface and the second interface are in a direct conductor connection state, which leads to the circulation and consumption of power between the two interfaces of the same electronic device. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a flowchart of a device interface detection method disclosed in an embodiment of this application;

[0035] Figure 2 This is a schematic diagram illustrating a direct connection between a first interface and a second interface as disclosed in an embodiment of this application;

[0036] Figure 3 This is a flowchart of a device interface detection method disclosed in an embodiment of this application;

[0037] Figure 4 This is a flowchart of a device interface detection method disclosed in an embodiment of this application;

[0038] Figure 5 This is a flowchart of a device interface detection method disclosed in an embodiment of this application;

[0039] Figure 6a This is a circuit diagram of a first interface and a second interface in a direct conductor connection state as disclosed in an embodiment of this application;

[0040] Figure 6b This is a circuit diagram of a first interface and a second interface in a direct conductor connection state as disclosed in an embodiment of this application;

[0041] Figure 7 This is an equivalent circuit diagram of a first interface and a second interface in a direct conductor connection state disclosed in an embodiment of this application;

[0042] Figure 8 This is a schematic diagram of the structure of a device interface detection device disclosed in an embodiment of this application. Detailed Implementation

[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] This application discloses a device interface testing method, the flowchart of which is shown below. Figure 1 As shown, it includes:

[0045] Step S11: Determine the power transmission status of the first and second interfaces of the electronic device;

[0046] Step S12: If the power transmission states of the first interface and the second interface are different, then detect the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface.

[0047] Step S13: If the difference between the first current characterization value and the second current characterization value is less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

[0048] If an electronic device has two interfaces, such as two USB interfaces (specifically USB Type-C interfaces), both interfaces can be used to charge the electronic device itself and to charge other devices. If the two interfaces on the same electronic device are directly connected by a conductor, such as... Figure 2 As shown, electronic devices transmit power through one interface and receive power through another interface, causing power to be transferred between the two interfaces. During the transfer process, power is consumed, resulting in unnecessary power loss.

[0049] To avoid this problem, this solution monitors the power transmission status of the two interfaces of the electronic device and determines the difference between the current characterization values ​​corresponding to the two interfaces. Based on this difference, it is determined whether the two interfaces are in a state of direct connection through a conductor, thereby avoiding the problem of power loss caused by the direct connection of the two interfaces of the same electronic device through a conductor.

[0050] The power transfer status of the first and second interfaces of the electronic device is determined. The power transfer status of an interface indicates whether the electronic device is receiving power or outputting power through that interface. If the power transfer status of an interface is receiving power, then that interface is connected to an external device, and the external device charges the electronic device through that interface. If the power transfer status of an interface is outputting power, then that interface is connected to an external device, and the electronic device charges the external device through that interface.

[0051] If the power transmission states of the first and second interfaces are the same—that is, the first interface outputs power and the second interface also outputs power, or the first interface receives power and the second interface also receives power—then, when the power transmission states of the first and second interfaces are the same, neither the first nor the second interface can be directly connected by a conductor, regardless of whether they are outputting or receiving power. If the first and second interfaces are directly connected by a conductor, then one interface must be outputting power while the other is receiving power. Therefore, when the power transmission states of the first and second interfaces are the same, no further testing is required.

[0052] If the power transmission states of the first interface and the second interface are different, that is, one of the first interface and the second interface outputs power while the other interface receives power, it is possible that the first interface is connected to an external device and the second interface is connected to another external device, or it is possible that the first interface and the second interface are directly connected through a conductor. Therefore, when the power transmission states of the first interface and the second interface are different, it is necessary to further detect the difference between the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface.

[0053] The first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface are obtained respectively. The difference between the first current characterization value and the second current characterization value is obtained. The difference is compared with a preset threshold. If the difference is less than the preset threshold, it can be preliminarily determined that the first interface and the second interface are in a direct conductor connection state. If the difference is not less than the preset threshold, it is directly determined that the first interface and the second interface are not in a direct conductor connection state, but are connected to an external device through the first interface and to another different external device through the second interface.

[0054] After confirming that the first interface and the second interface are directly connected by a conductor, the user can be reminded by prompting, or the internal connection between the first interface and the second interface can be directly disconnected inside the electronic device to avoid forming a circuit, thereby avoiding the loss of electrical energy caused by the direct connection between the first interface and the second interface by a conductor.

[0055] In this embodiment, the conductor in the direct connection between the first interface and the second interface via a conductor can be a connecting wire.

[0056] The device interface detection method disclosed in this embodiment determines the power transmission status of a first interface and a second interface of an electronic device. If the power transmission status of the first interface and the second interface are different, a first current characterization value corresponding to the first interface and a second current characterization value corresponding to the second interface are detected. If the difference between the first current characterization value and the second current characterization value is less than a preset threshold, it is determined that the first interface and the second interface are in a direct conductor connection state. This solution detects the first current characterization value corresponding to the first interface of the electronic device and simultaneously detects the second current characterization value corresponding to the second interface of the electronic device. Based on the difference between the first current characterization value and the second current characterization value, it determines whether the first interface and the second interface are in a direct conductor connection state. This avoids the problem of power loss caused by the inability to determine in time when the first interface and the second interface are in a direct conductor connection state, which leads to the circulation and consumption of power between the two interfaces of the same electronic device.

[0057] This embodiment discloses a device interface detection method, the flowchart of which is as follows: Figure 3 As shown, it includes:

[0058] Step S31: Determine the power transmission status of the first interface and the second interface of the electronic device;

[0059] Step S32: If the power transmission states of the first interface and the second interface are different, detect the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface.

[0060] Step S33: If it is determined that the difference between the first current value and the second current value at the first moment is less than a preset threshold, then after an interval of the first preset time, the first current value and the second current value at the second moment are obtained.

[0061] Step S34: If it is determined that the difference between the first current value and the second current value at the second moment is less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

[0062] When detecting the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface, the current value can be directly detected, and the difference between the current values ​​can be used to determine whether the first interface and the second interface are in a direct conductor connection state.

[0063] Specifically, firstly, the first current value corresponding to the first interface and the second current value corresponding to the second interface are obtained at the first moment, and it is determined whether the difference between the first current value and the second current value at the first moment is less than a preset threshold.

[0064] If the difference between the first current value and the second current value detected at the first moment is not less than a preset threshold, it indicates that the first interface and the second interface of the electronic device are not directly connected through a conductor. At this time, the first interface and the second interface are connected to different external devices to transmit electrical energy. If the difference between the first current value and the second current value detected at the first moment is less than the preset threshold, it can be determined that the first interface and the second interface of the electronic device may be in a state of direct conductor connection, or the first interface and the second interface may be connected to different external devices. It is just that at a certain moment, such as the first moment, the transmitted current is the same or the difference is small. At this time, further judgment is required to ensure the accuracy of the judgment.

[0065] The further determination is as follows: after the first moment, after an interval of a first preset time, the second moment is reached, the first current value corresponding to the first interface at the second moment and the second current value corresponding to the second interface at the second moment are obtained, and it is determined whether the difference between the first current value and the second current value at the second moment is less than a preset threshold.

[0066] If the difference between the first current value and the second current value detected at the second moment is not less than a preset threshold, it can be determined that the first interface and the second interface of the electronic device are not directly connected by a conductor. The difference between the first current value and the second current value at the first moment is less than the preset threshold, which means that the electrical energy transmitted by the two interfaces is the same at that moment, and not that the electrical energy transmitted by the two interfaces is the same at any time.

[0067] If the difference between the first current value and the second current value detected at the second moment is less than a preset threshold, it can be directly determined that the two interfaces are directly connected by a conductor based on the fact that the difference between the currents transmitted by the two interfaces at the first moment is less than the preset threshold, and the difference between the currents transmitted by the two interfaces at the second moment is still less than the preset threshold.

[0068] Furthermore, after determining that the difference between the first current value and the second current value at the first moment is less than a preset threshold, after an interval of a first preset time, it is determined whether the difference between the first current value and the second current value at the second moment is less than the preset threshold. The interval of the first preset time can be: without performing any processing on the line including the first interface and the second interface, but directly after the first moment, after an interval of the first preset time, detecting the first current value and the second current value at the second moment, that is, determining whether the difference between the current values ​​of the two interfaces is continuously less than the preset threshold by continuous judgment. If it is continuously less than the preset threshold, it can be directly determined that the two interfaces are directly connected by a conductor. If it is not continuously less than the preset threshold, it can be determined that the two interfaces are not directly connected, but are connected to different external devices respectively.

[0069] Alternatively, it can be: if the difference between the first current value and the second current value at the first moment is determined to be less than a preset threshold, then the power transmitted through the first interface or the second interface is controlled to increase or decrease, and the first current value and the second current value at the second moment when the power transmitted through the first interface or the second interface increases or decreases are obtained.

[0070] That is: after determining that the difference between the first current value and the second current value at the first moment is less than a preset threshold, after a first preset time interval, it is determined whether the difference between the first current value and the second current value at the second moment is less than the preset threshold. However, during the first preset time interval, the line needs to be adjusted. Specifically, the power transmitted by the first interface or the second interface is controlled to change, which can be increased or decreased. The other interface is not adjusted. Then, at the second moment, the first current value corresponding to the first interface and the second current value corresponding to the second interface are detected again.

[0071] In this situation, if the two interfaces are connected to different external devices, the difference between the two detected current values ​​will change and will no longer meet the condition that the difference is less than the preset threshold. That is, if the amount of electrical energy transmitted by the first interface changes, but the amount of electrical energy transmitted by the second interface does not change, then the first current value corresponding to the first interface will also change, while the current value corresponding to the second interface will remain unchanged. This will cause the difference between the two current values ​​to be greater than the preset threshold. Therefore, when the difference between the first current value and the second current value at the second moment is detected to be not less than the preset threshold, it can be determined that the two interfaces are connected to different external devices and the two interfaces are not directly connected through a conductor.

[0072] Alternatively, one interface can be directly controlled to stop transmitting power, while the other interface remains unadjusted. When the two interfaces are connected to different external devices, the current value detected by the interface that stops transmitting power should be 0, while the current value of the unadjusted interface remains unchanged. The difference will also be greater than the preset threshold, thus determining that the two interfaces are connected to different external devices.

[0073] If the two interfaces are in a direct connection state, when the electrical energy transmitted by one interface changes, the electrical energy transmitted by the other interface will also change accordingly. Therefore, the difference between the first current value and the second current value detected at the second moment is still less than the preset threshold. Based on this, it can be determined that the first interface and the second interface are in a direct connection state. Alternatively, if one interface stops transmitting electrical energy and the other interface does not adjust, then when the two interfaces are in a direct connection state, neither interface can transmit electrical energy, and the current values ​​corresponding to both interfaces will be 0, which also meets the condition that the difference between the first current value and the second current value is less than the preset threshold.

[0074] Therefore, when the power transmitted through one of the two interfaces is adjusted, as long as it can be determined that the difference between the first current value and the second current value detected after the power adjustment is still less than the preset threshold, it can be directly determined that the first interface and the second interface are in a direct conductor connection state; if the difference between the first current value and the second current value detected in this case is not less than the preset threshold, it can be determined that the first interface and the second interface are connected to different external devices respectively, and no direct connection has occurred.

[0075] For example, if the first interface is controlled to stop supplying power and the second interface is not adjusted, then only when the first interface and the second interface are directly connected can the first current value corresponding to the first interface be detected as 0, and at the same time, the second current value corresponding to the second interface is also 0, so that the difference between the first current value and the second current value is less than the preset threshold.

[0076] Additionally, it should be noted that the comparison between the difference between the first current value and the second current value and the preset threshold involved in this embodiment can be a comparison between the absolute value of the first current value and the absolute value of the second current value and the preset threshold.

[0077] The preset threshold can be 0 or any other small positive number.

[0078] The device interface detection method disclosed in this embodiment determines the power transmission status of a first interface and a second interface of an electronic device. If the power transmission status of the first interface and the second interface are different, the method detects the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface. If the difference between the first current value and the second current value at a first moment is less than a preset threshold, the method obtains the first current value and the second current value at a second moment after a first preset time interval. If the difference between the first current value and the second current value at the second moment is less than the preset threshold, the method determines that the first interface and the second interface are in a direct conductor connection state. This solution detects the first current characterization value corresponding to the first interface of the electronic device and simultaneously detects the second current characterization value corresponding to the second interface of the electronic device. Based on the difference between the first current value and the second current value at different moments, it determines whether the first interface and the second interface are in a direct conductor connection state. This avoids the problem of power loss caused by the inability to determine in time when the first interface and the second interface are in a direct conductor connection state, which leads to the circulation and consumption of power between the two interfaces of the same electronic device.

[0079] This embodiment discloses a device interface detection method, the flowchart of which is as follows: Figure 4 As shown, it includes:

[0080] Step S41: Determine the power transmission status of the first interface and the second interface of the electronic device;

[0081] Step S42: If the power transmission states of the first interface and the second interface are different, detect the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface.

[0082] Step S43: If it is determined that within the second preset time period, the difference between the first average current and the second average current at the first interface is less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

[0083] When detecting the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface, the average current value within a time period can be detected, and the difference between the average current values ​​can be used to determine whether the first interface and the second interface are in a direct conductor connection state.

[0084] Specifically, a second preset duration is directly set, the first average current of the first interface within the second preset duration is detected, and the second average current of the second interface within the second preset duration is detected, so as to obtain the difference between the first average current and the second average current. The difference is then compared with a preset threshold to determine whether the difference is less than the preset threshold.

[0085] The current value corresponding to the first interface is continuously detected within a second preset time period, and after the second preset time period ends, the first average current value corresponding to the first interface is calculated based on the continuously detected current value corresponding to the first interface; similarly, the current value corresponding to the second interface is continuously detected within a second preset time period, and after the second preset time period ends, the second average current value corresponding to the second interface is calculated based on the continuously detected current value corresponding to the second interface.

[0086] The difference between the first average current and the second average current is calculated, and the absolute value of the difference is compared with a preset threshold.

[0087] If the difference is not less than the preset threshold, it can be directly determined that the first interface and the second interface are connected to different external devices, and the first interface and the second interface are not directly connected through a conductor.

[0088] If the difference is less than the preset threshold, it indicates that the current difference between the first interface and the second interface is small within the second preset time period. It can be directly determined that the first interface and the second interface are in a direct conductor connection state, and no further detection is required.

[0089] Alternatively, to ensure the accuracy of the determination of whether the first interface and the second interface are in a direct conductor connection state, the current values ​​of the first interface and the second interface can be monitored after it is determined that the difference between the average value of the first current and the average value of the second current within the second preset time period is less than a preset threshold.

[0090] At this point, the following steps can be taken: After a second preset time period, detect the first current value corresponding to the first interface and the second current value corresponding to the second interface at a certain moment. Compare the difference between the two current values ​​detected at that moment with a preset threshold. Based on the comparison result, determine whether the first interface and the second interface are in a direct conductor connection state. If the difference between the two current values ​​detected at that moment is still less than the preset threshold, it can be determined that the first interface and the second interface are in a direct conductor connection state based on the fact that the difference between the average values ​​of the two currents within the second preset time period is less than the preset threshold and the difference between the two current values ​​at that moment is less than the preset threshold. If the difference between the two current values ​​detected at that moment is not less than the preset threshold, it can be determined that the first interface and the second interface are not in a direct conductor connection state.

[0091] Alternatively, after the second preset duration, the average current of the first interface and the second interface is monitored for another preset duration, and the difference between the average current of the two interfaces is compared with a preset threshold. Based on the comparison result, it is finally determined whether the first interface and the second interface are in a direct conductor connection state.

[0092] Alternatively, it can be done by controlling one of the interfaces to stop transmitting power after a second preset time period, and after stopping the transmission of power, monitoring the current values ​​of the two interfaces at a certain moment, and finally determining whether the first interface and the second interface are in a direct conductor connection state based on the comparison result of the difference between the two current values ​​and a preset threshold.

[0093] The device interface detection method disclosed in this embodiment determines the power transmission status of a first interface and a second interface of an electronic device. If the power transmission status of the first interface and the second interface are different, the method detects the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface. If it is determined that within a second preset time period, the difference between the average value of the first current and the average value of the second current at the first interface is less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state. This solution detects the first current characterization value corresponding to the first interface of the electronic device and simultaneously detects the second current characterization value corresponding to the second interface of the electronic device. Based on the difference between the first current value and the second current value at different times, it determines whether the first interface and the second interface are in a direct conductor connection state. This avoids the problem of power loss caused by the inability to determine in time when the first interface and the second interface are in a direct conductor connection state, which leads to the circulation and consumption of power between the two interfaces of the same electronic device.

[0094] This embodiment discloses a device interface detection method, the flowchart of which is as follows: Figure 5 As shown, it includes:

[0095] Step S51: Determine the power transmission status of the first interface and the second interface of the electronic device;

[0096] Step S52: If the power transmission states of the first interface and the second interface are different, detect the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface.

[0097] Step S53: If the difference between the first current characterization value and the second current characterization value is less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

[0098] Step S54: Control the first interface or the second interface to turn off the power transmission function.

[0099] When it is determined that the first interface and the second interface are in a direct conductor connection state, in order to avoid the power consumption caused by the circulation of power between the first interface and the second interface, a prompt message can be output to remind the user that the first interface and the second interface are currently in a direct conductor connection state and that the direct connection needs to be disconnected to avoid power consumption.

[0100] Furthermore, while outputting prompts, it can also automatically control one or two interfaces to shut down the power transmission function.

[0101] When one of the interfaces disables power transmission, even if the other interface is still transmitting power, the interface with the power transmission function disabled no longer has the ability to transmit the received power. Therefore, a loop cannot be formed, which avoids the problem of power consumption caused by the circular transmission of power between the first and second interfaces.

[0102] Specifically, the power transmission function of the interface that supplies power to the outside can be turned off, or the power transmission function of the interface that charges internally can be turned off, or both the first and second interfaces can be turned off to ensure that power cannot be transmitted between the two interfaces.

[0103] In addition, the power transmission function of the first or second interface is turned off. When the direct connection between the conductors of the first and second interfaces is detected to have ended, that is, when the user manually disconnects the connection between the first and second interfaces, the power transmission function of the first or second interface is restored to ensure power transmission when the first or second interface is connected to other external devices normally.

[0104] Furthermore, the device interface detection method disclosed in this embodiment may also include:

[0105] When it is determined that the first interface of the electronic device is connected to the first external device and the second interface is connected to the second external device, the power transmission status of the first interface and the second interface of the electronic device is determined.

[0106] When the power management module in the electronic device determines that both the first interface and the second interface of the electronic device are in a connected state, that is, the first interface is connected to the first external device and the second interface is connected to the second external device, it initiates the judgment on whether the first interface and the second interface are in a direct conductor connection state, and determines whether the external devices connected to the first interface and the second interface are both electronic devices.

[0107] If both the first and second interfaces are connected, a determination is made as to whether the first and second interfaces are in a direct conductor connection state. This determination first identifies whether the power transmission states of the first and second interfaces are different; that is, whether one interface is supplying power externally while the other is charging internally. If so, the subsequent determination continues; otherwise, the current determination is terminated. In other words, if both the first and second interfaces are charging internally, they must be connected to two different external devices. Similarly, if both interfaces are supplying power externally, they must be connected to two different connection devices. Further determination: if it is determined that the first and second interfaces are in a direct conductor connection state, then the first external device connected to the first interface is actually the electronic device itself, and the second external device connected to the second interface is also actually the electronic device itself.

[0108] If the power management module only determines that the first interface is connected while the second interface is idle, no further judgment is needed. In this case, it is impossible for the first and second interfaces to be directly connected as conductors, and data or power can be transmitted directly based on the first interface. Similarly, if the power management module only determines that the second interface is connected while the first interface is idle, no further judgment is needed, and it is impossible for the first and second interfaces to be directly connected as conductors, and data or power can be transmitted directly based on the second interface.

[0109] Furthermore, the detection of the first and second current characterization values ​​can be achieved using a galvanometer or a sampling resistor, i.e.:

[0110] The first current value corresponding to the first interface is detected by the first ammeter, and the second current value corresponding to the second interface is detected by the second ammeter.

[0111] or,

[0112] The first current characterization value corresponding to the first interface is detected by the first sampling resistor, and the second current characterization value corresponding to the second interface is detected by the second sampling resistor.

[0113] If the current is measured using an ammeter, the ammeter can be directly connected to the circuit to detect the current. Figure 6a The diagram shown is a circuit diagram of an electronic device when the first interface and the second interface are in a direct conductor connection state, including: first interface Type C1, second interface Type C2, first ammeter A1, second ammeter A2, first charging chip Charge IC1, second charging chip Charge IC2, and power management module PMU.

[0114] If the current characterization value is detected by a sampling resistor, then the sampling resistor is connected in series with the circuit, such as... Figure 6b The diagram shown is a circuit diagram of an electronic device when the first interface and the second interface are in a direct conductor connection state, including: first interface Type C1, second interface Type C2, first sampling resistor R1, second sampling resistor R2, first charging chip Charge IC1, second charging chip Charge IC2, and power management module PMU.

[0115] The first interface is connected to the first charging chip through the first sampling resistor, the second interface is connected to the second charging chip through the second sampling resistor, the first interface is connected to the power management module through the first sampling resistor, the second interface is connected to the power management module through the second sampling resistor, and the first interface and the second interface are connected by a connecting cable.

[0116] The charging and discharging of the first interface is controlled by the first charging chip, and the charging and discharging of the second interface is controlled by the second charging chip. The power management module is used to determine whether the first interface and the second interface are in a state of direct connection through a conductor, and can control the first interface or the second interface to turn off the power transmission function when it is determined that the first interface and the second interface are in a state of direct connection through a conductor.

[0117] The first and second interfaces can be Type C interfaces or other types of interfaces, such as Type A interfaces. There are no restrictions on their interface types here. Figure 6a and Figure 6b This is for illustrative purposes only.

[0118] When the first interface and the second interface are in a direct connection state, it is as follows: Figure 6a or Figure 6b As shown, if the first interface and the second interface are not directly connected, then there is no connecting line between the first interface and the second interface.

[0119] Taking the detection of current characterization values ​​through sampling resistors as an example, when the first interface and the second interface are directly connected by a connecting line, the equivalent circuit is as follows: Figure 7 As shown, this is actually equivalent to the first sampling resistor and the second sampling resistor being connected in series. Figure 7 The power source in this context is the battery of the electronic device. Figure 7The 0101 in the code represents the current of the sampling resistor, i.e., the current of the first sampling resistor Current-A and the current of the second sampling resistor Current-B. When the first sampling resistor and the second sampling resistor are connected in series, the current of the first sampling resistor and the second sampling resistor are the same.

[0120] The device interface detection method and apparatus disclosed in this application determine the power transmission status of a first interface and a second interface of an electronic device. If the power transmission status of the first interface and the second interface are different, a first current characterization value corresponding to the first interface and a second current characterization value corresponding to the second interface are detected. If the difference between the first current characterization value and the second current characterization value is less than a preset threshold, it is determined that the first interface and the second interface are in a direct conductor connection state, and the power transmission function of the first interface or the second interface is turned off. This solution detects the first current characterization value corresponding to the first interface of the electronic device and simultaneously detects the second current characterization value corresponding to the second interface of the electronic device. Based on the difference between the first current characterization value and the second current characterization value, it determines whether the first interface and the second interface are in a direct conductor connection state. This avoids the problem of power loss caused by the inability to determine in time when the first interface and the second interface are in a direct conductor connection state, which leads to the circulation and consumption of power between the two interfaces of the same electronic device.

[0121] This embodiment discloses a device interface detection device, the structural schematic diagram of which is shown below. Figure 8 As shown, it includes:

[0122] Current detection structure 81 and power management module 82.

[0123] The current detection structure 81 is used to detect the first current characterization value corresponding to the first interface of the electronic device and the second current characterization value corresponding to the second interface.

[0124] The power management module 82 is used to determine the power transmission status of the first interface and the second interface of the electronic device. If the power transmission status of the first interface and the second interface are different, the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface are detected by the current detection structure. If it is determined that the difference between the first current characterization value and the second current characterization value is less than a preset threshold, it is determined that the first interface and the second interface are in a direct conductor connection state.

[0125] Furthermore, the current sensing structure includes:

[0126] A first sampling resistor is disposed between the first interface and the power management module, and is used to detect the first current characterization value corresponding to the first interface;

[0127] The second sampling resistor is located between the second interface and the power management module and is used to detect the second current characterization value corresponding to the second interface.

[0128] Furthermore, the current sensing structure includes:

[0129] A first galvanometer is installed at the first interface to detect the first current characterization value corresponding to the first interface;

[0130] The second ammeter is installed at the second interface and is used to detect the second current characterization value corresponding to the second interface.

[0131] The device interface detection apparatus disclosed in this embodiment is based on the device interface detection method disclosed in the above embodiment, and will not be described again here.

[0132] The device interface detection apparatus disclosed in this application determines the power transmission status of a first interface and a second interface of an electronic device. If the power transmission status of the first interface and the second interface are different, it detects a first current characterization value corresponding to the first interface and a second current characterization value corresponding to the second interface. If the difference between the first current characterization value and the second current characterization value is less than a preset threshold, it determines that the first interface and the second interface are in a direct conductor connection state. This solution detects both the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface of the electronic device, and determines whether the first interface and the second interface are in a direct conductor connection state based on the difference between the two current characterization values. This avoids the problem of power loss caused by the inability to determine in time when the first interface and the second interface are in a direct conductor connection state, which leads to the circulation and consumption of power between the two interfaces of the same electronic device.

[0133] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0134] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0135] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0136] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A device interface detection method, applied to an electronic device, the electronic device including a first interface and a second interface, wherein the first interface and the second interface are both capable of charging the electronic device itself and charging other devices, wherein... include: Determine the power transmission status of the first and second interfaces of the electronic device; If the power transmission states of the first interface and the second interface are different, then the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface are detected. If the difference between the first current characterization value and the second current characterization value is determined to be less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

2. The method according to claim 1, wherein, The step of determining that the first interface and the second interface are in a direct conductor connection state if the difference between the first current characterization value and the second current characterization value is less than a preset threshold includes: If it is determined that the difference between the first current value and the second current value at the first moment is less than a preset threshold, then after an interval of the first preset time, the first current value and the second current value at the second moment are obtained. If the difference between the first current value and the second current value at the second moment is determined to be less than the preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

3. The method according to claim 1, wherein, The step of determining that the first interface and the second interface are in a direct conductor connection state if the difference between the first current characterization value and the second current characterization value is less than a preset threshold includes: If it is determined that within a second preset time period, the difference between the average value of the first current and the average value of the second current at the first interface is less than a preset threshold, then it is determined that the first interface and the second interface are in a state of direct conductor connection.

4. The method according to claim 2, wherein, If it is determined that the difference between the first current value and the second current value at the first moment is less than a preset threshold, then after an interval of a first preset time, the first current value and the second current value at the second moment are obtained, including: If the difference between the first current value and the second current value at the first moment is determined to be less than a preset threshold, the power transmitted through the first interface or the second interface is controlled to increase or decrease, and the first current value and the second current value at the second moment when the power transmitted through the first interface or the second interface increases or decreases are obtained.

5. The method according to claim 1, wherein, Also includes: If it is determined that the first interface and the second interface are in a direct conductor connection state, control the first interface or the second interface to turn off the power transmission function.

6. The method according to claim 1, wherein, Determining the power transmission status of the first and second interfaces of the electronic device includes: When it is determined that the first interface of the electronic device is connected to the first external device and the second interface is connected to the second external device, the power transmission status of the first interface and the second interface of the electronic device is determined.

7. The method according to claim 1, wherein, The detection of the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface includes: The first current characterization value corresponding to the first interface is detected by the first sampling resistor, and the second current characterization value corresponding to the second interface is detected by the second sampling resistor. or, The first current value corresponding to the first interface is detected by the first ammeter, and the second current value corresponding to the second interface is detected by the second ammeter.

8. A device interface detection apparatus, applied to an electronic device, the electronic device including a first interface and a second interface, wherein the first interface and the second interface are both capable of charging the electronic device itself and charging other devices, comprising: A current detection structure is used to detect a first current characterization value corresponding to a first interface of an electronic device and a second current characterization value corresponding to a second interface. The power management module is used to determine the power transmission status of the first interface and the second interface of the electronic device. If the power transmission status of the first interface and the second interface are different, the first current characterization value corresponding to the first interface and the second current characterization value corresponding to the second interface are detected by the current detection structure. If the difference between the first current characterization value and the second current characterization value is determined to be less than a preset threshold, then it is determined that the first interface and the second interface are in a direct conductor connection state.

9. The apparatus according to claim 8, wherein, The current detection structure includes: A first sampling resistor is disposed between the first interface and the power management module, and is used to detect the first current characterization value corresponding to the first interface; The second sampling resistor is disposed between the second interface and the power management module and is used to detect the second current characterization value corresponding to the second interface.

10. The apparatus according to claim 8, wherein, The current detection structure includes: A first ammeter is installed at the first interface to detect the first current characterization value corresponding to the first interface; A second ammeter is installed at the second interface to detect the second current characterization value corresponding to the second interface.

Citation Information

Patent Citations

  • Looped network fault detection method and device, electronic equipment and storage medium

    CN115267431A