Detection circuit, electronic device, detection method, storage medium, and program product

By using a combination circuit of switching module, voltage divider module and detection module in electronic devices to calculate the impedance parameters of the pin to be tested, the problem of poor measurement accuracy in the prior art is solved, and more accurate anomaly detection and lifespan extension are achieved.

CN121741271APending Publication Date: 2026-03-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

The current method of determining whether liquid has entered electronic devices by measuring whether the pins of the port to be tested are charged is prone to misjudgment, resulting in poor measurement accuracy.

Method used

A combined circuit consisting of a switching module, a voltage divider module, and a detection module is used. By detecting the electrical parameters of the voltage divider module when the switching module is in different switching states, and using an operational amplifier and impedance components to calculate the impedance parameters of the pin under test, it is possible to determine whether there is an abnormality in the pin under test.

Benefits of technology

It improves the measurement accuracy of the port under test, enabling more accurate determination of whether there is an abnormality in the pin under test, and extends the service life of the port under test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121741271A_ABST
    Figure CN121741271A_ABST
Patent Text Reader

Abstract

The invention relates to a detection circuit, electronic equipment, a detection method, a storage medium and a program product. The detection circuit comprises a switch module, wherein the first end of the switch module is connected with each to-be-detected pin of a to-be-detected port; wherein when the switch module is in different on-off states, the connection lines between the second end of the switch module and different to-be-detected pins are in a conducting state; the voltage dividing module is connected with the second end of the switch module; the detection module is connected with the voltage division module and is configured to detect electrical parameters of the voltage division module when the switch module is in different switch states; the electrical parameters of the voltage dividing module are configured to determine whether each to-be-detected pin is abnormal or not. According to the embodiment of the invention, whether the to-be-detected pins are abnormal or not can be accurately judged, and the measurement precision of the to-be-detected ports is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of electronic devices, and in particular to a detection circuit, an electronic device, a detection method, a storage medium and a program product. BACKGROUND

[0002] With the development of science and technology, in order to ensure that the to-be-detected port works safely and reliably in the electronic device, a detection circuit is usually arranged in the electronic device and connected with the to-be-detected port, which is used to discover whether there is liquid or foreign matter in the to-be-detected port in time, so that corresponding protection measures can be taken to prevent the to-be-detected port from being corroded.

[0003] However, the existing electronic device is prone to misjudgment by measuring whether the pin of the to-be-detected port is electrified to determine whether liquid enters, resulting in poor measurement accuracy. SUMMARY

[0004] To overcome the problems in the related art, the present disclosure provides a detection circuit, an electronic device, a detection method, a storage medium and a program product, which can accurately determine whether each to-be-detected pin is abnormal and improve the measurement accuracy of the to-be-detected port.

[0005] According to a first aspect of an embodiment of the present disclosure, a detection circuit is provided, comprising:

[0006] a switch module, a first end of the switch module being connected with each to-be-detected pin of a to-be-detected port; wherein when the switch module is in different switch states, a connection line between a second end of the switch module and different to-be-detected pins is in a conductive state;

[0007] a voltage division module, connected with the second end of the switch module;

[0008] a detection module, connected with the voltage division module, configured to detect an electrical parameter of the voltage division module when the switch module is in different switch states; the electrical parameter of the voltage division module being configured to determine whether each to-be-detected pin is abnormal.

[0009] In some embodiments, the detection module comprises:

[0010] a signal input end and a signal output end;

[0011] an operational amplifier, a first input end of the operational amplifier being connected with the signal input end, a second input end of the operational amplifier being connected with the voltage division module, and an output end of the operational amplifier being connected with the signal output end, configured to determine the electrical parameter of the voltage division module based on an input voltage of the signal input end and an output voltage of the signal output end.

[0012] In some embodiments, the voltage dividing module comprises:

[0013] a first impedance component connected between the second end of the switch module and the second input terminal of the operational amplifier;

[0014] a second impedance component connected between the signal input terminal and the first input terminal of the operational amplifier;

[0015] a third impedance component connected between the second input terminal of the operational amplifier and the output terminal of the operational amplifier;

[0016] When the switch module is in different switch states, a connection line between the first impedance component and a different one of the to-be-detected pins is in a conductive state.

[0017] In some embodiments, the detection circuit further comprises:

[0018] an overvoltage protection module connected in a connection line between each of the to-be-detected pins and the first end of the switch module, configured to disconnect the to-be-detected pin from the switch module when a pin voltage of the to-be-detected pin is greater than a preset voltage threshold.

[0019] According to a second aspect of the embodiments of the present disclosure, an electronic device is provided, comprising:

[0020] a to-be-detected port having a plurality of to-be-detected pins;

[0021] a detection circuit as described in the first aspect; the switch module of the detection circuit is connected between each of the to-be-detected pins and the voltage dividing module of the detection circuit, and the detection module of the detection circuit is connected with the voltage dividing module;

[0022] a processing module connected with the detection module, configured to calculate an impedance parameter of each of the to-be-detected pins based on the electrical parameter of the voltage dividing module detected by the detection module when the switch module is in different switch states, and determine whether the to-be-detected port is abnormal based on the impedance parameter of each of the to-be-detected pins.

[0023] In some embodiments, the processing module is further configured to calculate a resistance value of each of the to-be-detected pins based on the electrical parameter of the voltage dividing module when the switch module is in different switch states.

[0024] In some embodiments, the processing module is further configured to calculate a resistance value of each of the to-be-detected pins based on the electrical parameter of the voltage dividing module when the switch module is in different switch states.

[0025] In some embodiments, the processing module is further configured to calculate the equivalent capacitance value corresponding to each of the pins to be detected based on the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, and the resistance value of each of the pins to be detected.

[0026] Specifically, if the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to any of the pins to be tested is greater than or equal to the preset capacitance value, then the port to be tested is determined to be abnormal; if the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to each of the pins to be tested is less than the preset capacitance value, then the port to be tested is determined to be normal.

[0027] In some embodiments, the electronic device further includes:

[0028] The control module is connected to the switch module and to the signal input and signal output terminals of the detection module. It is configured to control the switching state of the switch module and the voltage signal input of the signal input terminal, and to receive the voltage signal output of the signal output terminal.

[0029] According to a third aspect of the present disclosure, a detection method is provided, comprising:

[0030] In response to the detection that the switching module in the detection circuit of the electronic device is in an active state, the switching state of the switching module is determined;

[0031] Based on the switch state, the electrical parameters of the voltage divider module in the detection circuit are obtained under the switch state; wherein, the switch module is connected between each pin to be detected of the port to be detected and the voltage divider module;

[0032] Based on the electrical parameters of the voltage divider module, the impedance parameters of each of the pins to be tested are calculated;

[0033] Based on the impedance parameters of each of the pins to be tested, it is determined whether there is an abnormality in the port to be tested.

[0034] In some embodiments, calculating the impedance parameters of each of the pins to be tested based on the electrical parameters of the voltage divider module includes:

[0035] Based on the current value corresponding to the third impedance component of the voltage divider module under different switching states and the impedance parameter of the first impedance component of the voltage divider module, the resistance value of each of the pins to be tested is calculated respectively; wherein, the first impedance component is connected between the second input terminal of the operational amplifier of the detection module in the switching module and the detection circuit, and the third impedance component is connected between the second input terminal of the operational amplifier and the output terminal of the operational amplifier.

[0036] In some embodiments, determining whether the port to be tested is abnormal based on the impedance parameters of each of the pins to be tested includes:

[0037] If the resistance value of any of the pins to be tested is less than or equal to a preset resistance value, it is determined that there is an abnormality in the port to be tested.

[0038] In some embodiments, calculating the impedance parameters of each of the pins to be tested based on the electrical parameters of the voltage divider module further includes:

[0039] Based on the phase difference between the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal of the detection module under different switching states, and the resistance value of each pin to be detected, the equivalent capacitance value corresponding to each pin to be detected is calculated.

[0040] In some embodiments, determining whether the port to be tested is abnormal based on the impedance parameters of each of the pins to be tested includes:

[0041] When the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to any of the pins to be tested is greater than or equal to the preset capacitance value, it is determined that there is an abnormality in the port to be tested.

[0042] When the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to each of the pins to be tested is less than the preset capacitance value, it is determined that there is no abnormality in the port to be tested.

[0043] In some embodiments, obtaining the electrical parameters of the voltage divider module in the detection circuit based on the switching state includes:

[0044] Based on the switch state, determine the input voltage of the signal input terminal of the detection module in the detection circuit and the output voltage of the signal output terminal of the detection module;

[0045] Based on the input voltage at the signal input terminal and the output voltage at the signal output terminal, the current value corresponding to the third impedance component of the voltage divider module is determined.

[0046] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:

[0047] The first determining unit is configured to determine the switching state of the switching module in response to detecting that the switching module in the detection circuit of the electronic device is in an operating state.

[0048] The acquisition unit is configured to acquire the electrical parameters of the voltage divider module in the detection circuit under the switch state; wherein the switch module is connected between each pin to be detected of the port to be detected and the voltage divider module.

[0049] The calculation unit is configured to calculate the impedance parameters of each of the pins to be tested based on the electrical parameters of the voltage divider module.

[0050] The second determining unit is configured to determine whether there is an abnormality in the port to be tested based on the impedance parameters of each of the pins to be tested.

[0051] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, the storage medium storing a computer program or instructions that, when executed by a processor, implement the steps of the method described in the third aspect.

[0052] According to a sixth aspect of the present disclosure, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the method described in the third aspect.

[0053] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0054] This disclosure provides a detection circuit comprising: a switching module, the first end of which is connected to each pin to be tested of a port to be tested; wherein, when the switching module is in different switching states, the connection lines between the second end of the switching module and the different pins to be tested are in a conductive state; a voltage divider module connected to the second end of the switching module; and a detection module connected to the voltage divider module, configured to detect the electrical parameters of the voltage divider module when the switching module is in different switching states; the electrical parameters of the voltage divider module are configured to determine whether each pin to be tested is abnormal. In other words, this disclosure can utilize a switching module, a voltage divider module, and a detection module sequentially connected to each pin to be tested of a port to be tested. The detection module detects the electrical parameters of the voltage divider module when the switching module is in different switching states, allowing the subsequent determination of whether each pin to be tested is abnormal based on the electrical parameters of the voltage divider module. This enables accurate detection of the electrical parameters of the voltage divider module even when a bias voltage exists on the pin to be tested, thereby improving the measurement accuracy for the port to be tested.

[0055] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0056] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0057] Figure 1 This is a schematic diagram of the structure of a detection circuit according to an exemplary embodiment. Figure 1 .

[0058] Figure 2 This is a schematic diagram of the structure of a detection circuit according to an exemplary embodiment. Figure 2 .

[0059] Figure 3 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment.

[0060] Figure 4 This is a schematic diagram of the structure of a conventional electronic device according to an exemplary embodiment. Figure 1 .

[0061] Figure 2 This is a schematic diagram of the structure of a conventional electronic device according to an exemplary embodiment. Figure 6 .

[0062] Figure 7 This is a flowchart illustrating a detection method according to an exemplary embodiment.

[0063] Figure 8 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment.

[0064] Figures 1 to 3 This is a structural block diagram of an electronic device according to an exemplary embodiment.

[0065] Figure 1 Figure labels in the diagram:

[0066] 10-Detection circuit, 11-Switch module, 111-First terminal of switch module, 112-Second terminal of switch module, 100-Test port, 101-Test pin, 12-Voltage divider module, 13-Detection module, 131-Signal input terminal, 132-Signal output terminal, 133-Operational amplifier, 134-First input terminal of operational amplifier, 135-Second input terminal of operational amplifier, 136-Output terminal of operational amplifier, 121-First impedance component, 122-Second impedance component, 123-Third impedance component, 14-Overvoltage protection module, 1-Electronic device, 20-Processing module, 30-Control module. Detailed Implementation

[0067] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0068] The technical solutions provided by the various embodiments of this disclosure are described in detail below with reference to the accompanying drawings.

[0069] Figure 1 This is a schematic diagram of the structure of a detection circuit according to an exemplary embodiment. Figure 1 ,like Figure 2 As shown, the detection circuit 10 may include:

[0070] The switch module 11 has a first end 111 connected to each of the pins 101 to be tested in the port 100 to be tested; wherein, when the switch module 11 is in different switching states, the connection line between the second end 112 of the switch module and the different pins 101 to be tested is in a conductive state.

[0071] Voltage divider module 12 is connected to the second terminal 112 of switch module;

[0072] The detection module 13 is connected to the voltage divider module 12 and is configured to detect the electrical parameters of the voltage divider module 12 when the switch module 11 is in different switching states; the electrical parameters of the voltage divider module 12 are configured to determine whether there is an abnormality in each pin 101 to be tested.

[0073] In this embodiment of the disclosure, the detection circuit can be a circuit for detecting the port to be tested of an electronic device, used to determine whether there is an abnormality in the port to be tested; for example, the detection circuit can determine whether liquid has entered the port to be tested or whether there are foreign objects, so as to take timely measures to prevent liquid or foreign objects from corroding the port to be tested and extend the service life of the port to be tested.

[0074] It should be noted that the type of port to be tested in the electronic device can be set according to the actual application scenario, and this disclosure embodiment does not impose any restrictions. For example, the port to be tested may include: DisplayPort (DP), High-Definition Multimedia Interface (HDMI), Lightning interface, Universal Serial Bus (USB); here, USB port may include Type A port, Type B port, and Type C port, etc.

[0075] Here, the port under test has multiple pins, each with a different function. For example, taking a Type-C port as an example, a Type-C port can include: data pins, power pins, ground pins, configuration channel (CC) pins, and sideband use (SBU) pins, etc. Port erosion typically begins with power pins such as the VBUS pin; therefore, the multiple pins to be tested on the port can be pins located near the VBUS pin in a Type-C port; for example, CC1 pin, CC2 pin, SBU1 pin, and SBU2 pin, etc.

[0076] The data pins include a signal receiving pin (RX pin) and a signal transmitting pin (TX pin), used for bidirectional data transmission with external devices, such as file transfer; the power pin (VBUS pin) is used for power exchange with external devices, enabling forward or reverse charging; the ground pin (GND pin) is used to ground the port under test; the CC pin is used to detect the insertion direction of the male and female connectors of the port under test; and the SBU pin is used to implement auxiliary functions, suitable for transmitting non-USB signals such as audio signals.

[0077] In this embodiment of the disclosure, the switching module may be an electronic component that opens the detection circuit, interrupts the current, or allows the current to flow to other circuits; for example, the switching module may include a switching chip, a field-effect transistor, or a relay.

[0078] Here, the different switching states of the switch module can be understood as follows: the connection line between the second end of the switch module and one of the pins to be tested on the port to be tested is in a conductive state, while the connection line between the second end of the switch module and other pins to be tested on the port to be tested is in a disconnected state.

[0079] Understandably, taking a switch module as an example, when there are four pins to be detected, the switch chip can be a four-to-one switch chip. That is, the switch chip includes four independent input terminals, one output terminal, and three signal control terminals. The four input terminals of the switch chip are connected to the four pins to be detected one by one. The switch chip can select one of the four input terminals for output through the control signal input from the three signal control terminals, that is, select one pin to be detected to conduct with the output terminal of the switch chip, thereby realizing flexible switching of the connection lines between different pins to be detected and the output terminal of the switch chip.

[0080] For example, the signal control terminals of the switch chip may include a first control terminal, a second control terminal, and a third control terminal; wherein the first and second control terminals can both be general purpose input / output (GPIO) ports, and the third control terminal can be an enable (EN) port. The switch chip can be put into operation by receiving an enable signal through the EN port. In this case, the switch chip can switch the connection between different detected pins and the output terminal of the switch chip to a conducting state by adjusting the level of the control signals input to the first and second control terminals. For example, when both the control signals input to the first control terminal and the second control terminal are at a low level, the connection between the first pin to be detected and the output terminal of the switch chip is in a conductive state; when the control signal input to the first control terminal is at a high level and the control signal input to the second control terminal is at a low level, the connection between the second pin to be detected and the output terminal of the switch chip is in a conductive state; when the control signal input to the first control terminal is at a low level and the control signal input to the second control terminal is at a high level, the connection between the third pin to be detected and the output terminal of the switch chip is in a conductive state; when both the control signals input to the first control terminal and the second control terminal are at a high level, the connection between the fourth pin to be detected and the output terminal of the switch chip is in a conductive state.

[0081] It should be noted that the specific type of the switch module can be set according to the actual application scenario, and this disclosed embodiment does not impose any restrictions.

[0082] The voltage divider module described above can be connected to the second terminal of the switch module for voltage division of the pin to be tested. Here, the voltage divider module can be composed of at least one resistive element, or it can be composed of at least one resistive element and at least one inductor element cascaded together, or it can be composed of at least one resistive element and at least one capacitor element cascaded together, or it can be composed of at least one resistive element, at least one inductor element and at least one capacitor element cascaded together. This disclosure does not limit the scope of the embodiments.

[0083] The aforementioned detection module can be a module used to detect the electrical parameters of the voltage divider module; for example, the detection module may include, but is not limited to, a signal input terminal, a signal output terminal, and an operational amplifier.

[0084] It is understandable that when there is an abnormality such as liquid or foreign matter in the port to be tested, the resistance of the port to be tested will decrease or the capacitance will increase. Based on the voltage divider module's voltage division of the pin to be tested, the detection module can detect the voltage or current and other electrical parameters of the voltage divider module, so as to determine whether the impedance parameter of the pin to be tested has changed, and thus determine whether there is an abnormality such as liquid or foreign matter in each pin to be tested.

[0085] It should be noted that, based on the principle of virtual short and virtual open of the operational amplifier in the detection module, the same voltage signal is generated at the positive and negative terminals of the operational amplifier. Then, the voltage is divided by the resistor of the pin to be detected by the voltage divider module, and the electrical parameters of the voltage divider module can be calculated.

[0086] In an operational amplifier, the virtual short refers to the situation where, under ideal conditions, the potentials at the two input terminals of the operational amplifier are equal, as if the two input terminals were shorted together, but in reality, there is no short circuit; hence the term "virtual short." The virtual open refers to the situation where, under ideal conditions, the current flowing into the input terminals of the operational amplifier is zero; this is because the input resistance of an ideal operational amplifier is infinitely large, as if there were an open circuit between the two input terminals, but in reality, there is no open circuit; hence the term "virtual open."

[0087] In this embodiment of the present disclosure, when the switching module is in different switching states, the electrical parameters of the voltage divider module can be detected by the detection module, so as to determine whether there is any abnormality in each pin to be detected by the electrical parameters of the voltage divider module.

[0088] In related technologies, to ensure the safe and reliable operation of the port under test in electronic devices, a detection circuit is typically installed in the electronic device and connected to the port under test. This circuit is used to promptly detect the presence of liquid or foreign matter at the port under test, thereby enabling appropriate protective measures to prevent corrosion. However, the current method in electronic devices that determines whether liquid has entered the port by measuring whether the pins of the port under test are energized is prone to misjudgment, resulting in poor measurement accuracy.

[0089] Based on this, the present disclosure provides a detection circuit comprising: a switching module, the first end of which is connected to each pin to be tested of the port to be tested; wherein, when the switching module is in different switching states, the connection lines between the second end of the switching module and the different pins to be tested are in a conductive state; a voltage divider module connected to the second end of the switching module; and a detection module connected to the voltage divider module, configured to detect the electrical parameters of the voltage divider module when the switching module is in different switching states; the electrical parameters of the voltage divider module are configured to determine whether each pin to be tested is abnormal. In other words, the present disclosure can, by setting a switching module, a voltage divider module, and a detection module sequentially connected to each pin to be tested of the port to be tested, utilize the detection module to detect the electrical parameters of the voltage divider module when the switching module is in different switching states, so that the electrical parameters of the voltage divider module can be used to determine whether each pin to be tested is abnormal. Therefore, even when there is a bias voltage on the pin to be tested, the electrical parameters of the voltage divider module can still be accurately detected by the detection module connected to the voltage divider module, thus more accurately determining whether each pin to be tested is abnormal and improving the measurement accuracy for the port to be tested.

[0090] Figure 2 This is a schematic diagram of the structure of a detection circuit according to an exemplary embodiment. Figure 2 ,like Figure 1 As shown, the detection circuit provided in this embodiment of the present disclosure, in Figure 1 The detection circuit shown is further divided into detection modules. For example, the detection module may include a signal input terminal, a signal output terminal, and an operational amplifier.

[0091] like Figure 2 and Figure 1 As shown, the detection module 13 described above may include:

[0092] Signal input terminal 131 and signal output terminal 132;

[0093] Operational amplifier 133 has its first input terminal 134 connected to signal input terminal 131, its second input terminal 135 connected to voltage divider module 12, and its output terminal 136 connected to signal output terminal 132. It is configured to determine the electrical parameters of voltage divider module 12 based on the input voltage of signal input terminal 131 and the output voltage of signal output terminal 132.

[0094] In this way, by connecting the first input terminal of the operational amplifier to the signal input terminal of the detection module, the second input terminal of the operational amplifier to the voltage divider module, and the output terminal of the operational amplifier to the signal output terminal of the detection module, the electrical parameters of the voltage divider module can be determined by the operational amplifier based on the input voltage of the signal input terminal and the output voltage of the signal output terminal. This can prepare for subsequent determination of whether there are any abnormalities in each pin to be tested, and improve the measurement accuracy of the port to be tested.

[0095] In this embodiment of the disclosure, both the signal input terminal and the signal output terminal are connected to the control module of the electronic device. The signal input terminal can be used to input a voltage signal to the operational amplifier in the detection module, and the signal output terminal can be used to output a voltage signal amplified by the operational amplifier to the control module of the electronic device.

[0096] For example, the signal input terminal of the detection module can receive a pulse-width modulation (PWM) signal; this PWM signal can switch between high and low levels to form a periodic square wave signal. Here, the input voltage at the signal input terminal can be determined based on the peak-to-peak value of the square wave signal, that is, based on the difference between the maximum and minimum values ​​of the square wave signal within one period, i.e., the range between the maximum and minimum voltages.

[0097] Here, the first input terminal of the operational amplifier can be the positive terminal, i.e., the non-inverting input terminal; the input voltage at the first input terminal, i.e., the signal input voltage, has the same phase relationship as the output voltage at the output terminal, i.e., the signal output voltage. The second input terminal of the operational amplifier can be the negative terminal, i.e., the inverting input terminal; the input voltage at the second input terminal has an opposite phase relationship to the output voltage at the output terminal.

[0098] An operational amplifier is a DC-coupled amplifier with high gain and linearity. Its function is to amplify the input signal and, under ideal conditions, perform various mathematical operations such as addition, subtraction, integration, and differentiation. The electrical parameters of the voltage divider module are calculated based on the input voltage at the signal input terminal and the output voltage at the signal output terminal.

[0099] It is understandable that by utilizing the principles of virtual short and virtual open of operational amplifiers, as well as the input voltage at the signal input terminal and the output voltage at the signal output terminal, the voltage or current values ​​and other electrical parameters of each component in the voltage divider module can be better determined.

[0100] It should be noted that, in this embodiment, the voltage value corresponding to the voltage divider module can be determined first based on the input voltage at the signal input terminal and the output voltage at the signal output terminal; then, based on the impedance parameters of the voltage divider module itself, such as the resistance value, the current value and other electrical parameters on the connection line where the voltage divider module is located can be calculated.

[0101] In some embodiments, such as Figure 2 and Figure 1 As shown, the voltage divider module 12 may include:

[0102] The first impedance component 121 is connected between the second terminal 112 of the switching module and the second input terminal 135 of the operational amplifier;

[0103] The second impedance component 122 is connected between the signal input terminal 131 and the first input terminal 134 of the operational amplifier;

[0104] The third impedance component 123 is connected between the second input terminal 135 and the output terminal 136 of the operational amplifier;

[0105] When the switching module 11 is in different switching states, the connection line between the first impedance component 121 and the different detection pins 101 is in a conductive state.

[0106] In this way, by setting the first impedance component, the second impedance component, and the third impedance component of the operational amplifier connected to the switching module and / or the detection module, the resistance of the pin to be tested can be divided, so as to prepare for determining whether there is any abnormality in each pin to be tested based on the electrical parameters of the first impedance component, the second impedance component, and the third impedance component, thereby improving the measurement accuracy of the port to be tested.

[0107] In this embodiment of the present disclosure, the first impedance component can act as a voltage divider for the resistance of the pin to be tested; the detection module can determine the electrical parameters of the first impedance component by determining the electrical parameters of the second impedance component and the third impedance component when the switch module is in different switching states, and then determine the impedance parameters of each pin to be tested, so as to determine whether there is any abnormality in each pin to be tested.

[0108] Understandably, by utilizing the principle of virtual short in operational amplifiers, it can be determined that the input voltage at the first input terminal of the operational amplifier is equal to the input voltage at the second input terminal. At this point, the voltage value corresponding to the third impedance component can be determined as the difference between the input voltage at the signal input terminal and the output voltage at the signal output terminal. Since the impedance value of the third impedance component is known, the current value corresponding to the third impedance component can be calculated. Furthermore, utilizing the principle of virtual open in operational amplifiers, the first and third impedance components can be considered as being connected in series, meaning the current value flowing through the first impedance component is equal to the current value corresponding to the third impedance component, thus determining the current value corresponding to the first impedance component. In the subsequent calculation process of the electronic device's processing module, since the input voltage at the second input terminal of the operational amplifier and the impedance value of the first impedance component are known, the impedance parameters corresponding to the pins to be tested can be calculated. The magnitude of these impedance parameters can then be used to determine whether any abnormalities exist at the pins to be tested.

[0109] Here, the first impedance component, the second impedance component, and the third impedance component can all be resistive elements, or some can be inductive elements, or they can be set as switching elements, etc., and this disclosure does not limit this. The impedance values ​​of these three impedance components can be the same or different. In order to improve the difference between the input signals at the two input terminals of the operational amplifier, this disclosure can set the impedance values ​​of the three impedance components to be different.

[0110] It should be noted that the number of the first impedance component, the second impedance component, and the third impedance component can be set according to the actual application situation, and this embodiment does not impose any restrictions.

[0111] In some embodiments, such as Figure 2 and Figure 3 As shown, the detection circuit 10 may further include:

[0112] The overvoltage protection module 14 is connected to the 111 connection line between each of the pins to be tested 101 and the first end of the switch module. It is configured to disconnect the connection between the pin to be tested 101 and the switch module 11 when the pin voltage of the pin to be tested 101 is greater than a preset voltage threshold.

[0113] In this way, by setting an overvoltage protection module between each pin to be tested and the first terminal of the switching module, the risk of damage to the detection circuit can be reduced, the safety of the detection circuit can be improved, and the service life of the detection circuit can be extended when the pin voltage of the pin to be tested exceeds a preset voltage threshold.

[0114] Here, when the pin voltage of the pin to be tested is less than or equal to a preset voltage threshold, the pin to be tested is connected to the first terminal of the switching module.

[0115] For example, the overvoltage protection module may include: a high-voltage circuit breaker, which, when the pin voltage of the pin to be tested exceeds a preset voltage threshold (i.e., the circuit is overloaded), causes the current to increase, heat generation to intensify, and the deformation of a metal sheet to actuate a mechanism to disconnect the connection between the pin to be tested and the switching module. The overvoltage protection module may also include: an overvoltage protection chip, used to trigger a fuse and disconnect the connection between the pin to be tested and the switching module when the pin voltage of the pin to be tested exceeds a preset voltage threshold.

[0116] It should be noted that the preset voltage threshold can be preset by technicians based on the maximum voltage value in the detection circuit under actual application scenarios, and this disclosure does not impose any restrictions.

[0117] It is understood that the overvoltage protection module in this embodiment can reduce the damage to the detection circuit when the pin voltage of the pin to be detected exceeds a preset voltage threshold, thereby extending the service life of the detection circuit.

[0118] Figure 1 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment, such as... Figure 3 and Figure 1 As shown, this disclosure provides an electronic device 1, which may include:

[0119] The port to be tested 100 has multiple pins to be tested 101;

[0120] As in the above embodiments of this disclosure, the detection circuit 10; the switching module 11 of the detection circuit 10 is connected between each pin to be detected 101 and the voltage divider module 12 of the detection circuit 10, and the detection module 13 of the detection circuit 10 is connected to the voltage divider module 12.

[0121] The processing module 20 is connected to the detection module 13 and is configured to calculate the impedance parameters of each pin to be tested 101 based on the electrical parameters of the voltage divider module 12 detected by the detection module 13 when the switching module 11 is in different switching states, and determine whether there is an abnormality in the port 100 to be tested based on the impedance parameters of each pin to be tested 101.

[0122] In this embodiment of the disclosure, a detection circuit can be set in the electronic device. The switching module of the detection circuit is connected to each pin to be tested of the port to be tested. The processing module of the electronic device can calculate the impedance parameters of each pin to be tested by the electrical parameters of the voltage divider module detected by the detection module in the detection circuit, so as to determine whether there is an abnormality in the port to be tested. This allows for timely detection of abnormalities in the port to be tested, and protective measures such as corrosion prevention can be taken to improve the measurement accuracy of the port to be tested and extend the service life of the port to be tested in the electronic device.

[0123] It should be noted that the aforementioned electronic devices may include mobile terminal devices, smart home devices, etc. Mobile terminal devices may include mobile phones, wearable devices, or tablet computers; smart home devices may include speaker devices or televisions. For example, the detection circuit may be installed on the circuit board of a mobile phone and connected to the phone's charging port, or it may be installed on the circuit board of a television and connected to the television's interface; this disclosure does not impose any limitations on this.

[0124] Here, the processing module can be a core functional module of the electronic device, located on the motherboard of the electronic device, and is used to process data transmitted via the data transmission bus; for example, the processing module may include a central processing unit (CPU) or a microprocessor unit (MPU), etc.

[0125] It is understandable that when there is an abnormality such as liquid or foreign object in the port to be tested, the resistance of the port to be tested will decrease or the capacitance will increase. The processing module can connect to the detection module of the detection circuit, calculate the electrical parameters of the voltage divider module under different switching states sent by the detection module, obtain the impedance parameters of each pin to be tested, and determine whether there is an abnormality such as liquid or foreign object in the port to be tested based on the impedance parameters of each pin to be tested.

[0126] In some embodiments, the processing module is further configured to calculate the resistance value of each pin to be tested based on the electrical parameters of the voltage divider module when the switching module is in different switching states; wherein, when the resistance value of any pin to be tested is less than or equal to a preset resistance value, it is determined that there is an abnormality in the port to be tested.

[0127] In this way, the resistance values ​​of each pin to be tested calculated by the processing module can be compared with the preset resistance values. Based on the comparison results, it can be determined whether there is an abnormality in the port to be tested. This allows for a more accurate determination of the abnormality in the port to be tested, further improving the measurement accuracy of the port to be tested and extending the service life of the port to be tested in electronic devices.

[0128] In this embodiment of the present disclosure, the processing module can calculate the resistance value of each pin to be tested based on the electrical parameters of the voltage divider module under different switching states received; that is, after receiving the electrical parameters of a voltage divider module, the processing module can calculate the resistance value of a pin to be tested corresponding to the electrical parameters.

[0129] It is understandable that, taking the detection module including an operational amplifier and the voltage divider module including a first impedance component, a second impedance component and a third impedance component as an example, the electrical parameters of the voltage divider module may include: the current value corresponding to the third impedance component calculated using the virtual short and virtual open principle of the operational amplifier, and the current value corresponding to the first impedance component.

[0130] Here, the processing module can calculate the sum of the resistance values ​​of the first impedance component and the pin to be tested based on the input voltage of the second input terminal of the operational amplifier and the current value corresponding to the first impedance component. Since the impedance value of the first impedance component is known, the resistance value corresponding to the pin to be tested can be calculated. By comparing the resistance value corresponding to the pin to be tested with the preset resistance value, it can be determined whether there is an abnormality in the pin to be tested.

[0131] It should be noted that if the resistance value of any single pin in the port to be tested is less than or equal to the preset resistance value, then the port to be tested is considered abnormal. If the resistance values ​​of all pins in the port to be tested are greater than the preset resistance value, then the port to be tested can be considered normal. Alternatively, the equivalent capacitance value of the pins to be tested can be used to further determine whether the port to be tested is abnormal.

[0132] For example, the electronic device can preset the resistance value of the pin to be tested to be 5.1 kΩ. When the processing module calculates the resistance value of the pin to be tested to be 500 Ω, the processing module can determine that the pin to be tested is in an abnormal state, that is, the port to be tested is abnormal; when the processing module calculates the resistance value of the pin to be tested to be 5.5 kΩ, the processing module can determine that the pin to be tested is in a normal state, that is, the port to be tested is not abnormal.

[0133] It should be noted that the aforementioned preset resistance value can be a resistance value pre-set in the electronic device, or it can be a resistance value pre-set in the electronic device according to each pin to be tested of the port to be tested. This disclosure embodiment does not impose any limitations.

[0134] In some embodiments, the processing module is further configured to calculate the equivalent capacitance value corresponding to each pin to be detected based on the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, as well as the resistance value of each pin to be detected.

[0135] Specifically, if the resistance value of each pin to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to any pin to be tested is greater than or equal to the preset capacitance value, then the port to be tested is determined to be abnormal; if the resistance value of each pin to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to each pin to be tested is less than the preset capacitance value, then the port to be tested is determined to be normal.

[0136] In this way, the equivalent capacitance value of each pin to be tested can be further calculated by the processing module and compared with the preset capacitance value. Based on the comparison result, it can be determined whether there is an abnormality in the port to be tested. This can further accurately determine the abnormality of the port to be tested, thereby improving the measurement accuracy of the port to be tested and better extending the service life of the port to be tested in electronic devices.

[0137] In this embodiment of the present disclosure, the processing module can calculate the equivalent capacitance value corresponding to each pin to be detected based on the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, as well as the resistance value of each pin to be detected; that is, after receiving the phase difference between a set of voltage signals and the resistance value of the pin to be detected, the processing module can calculate the equivalent capacitance value corresponding to the pin to be detected.

[0138] Understandably, the processing module can first calculate the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, and then calculate the ratio between this phase difference and the resistance value of each pin to be detected. This ratio is approximately equal to the equivalent capacitance value of each pin to be detected.

[0139] Here, since both the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal of the detection module are PWM signals such as square wave level signals, the phase difference between the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal can be the time difference between the two voltage signals input and output by the operational amplifier. Therefore, the processing module can use the ratio between this time difference and the resistance value of the pin to be detected as the equivalent capacitance value of the pin to be detected.

[0140] In this embodiment of the disclosure, after the processing module determines the resistance value and equivalent capacitance value corresponding to each pin to be tested, it can determine whether there is an abnormality in the pin to be tested based on the magnitude between the resistance value and the preset resistance value, and the magnitude between the equivalent capacitance value and the preset capacitance value.

[0141] It should be noted that if the resistance value of any single pin in the port under test is less than or equal to the preset resistance value, there is no need to further determine the relationship between the equivalent capacitance values ​​of each pin and the preset capacitance value; the port under test is directly identified as abnormal. However, if the resistance values ​​of all pins in the port under test are greater than the preset resistance value, then the relationship between the equivalent capacitance values ​​of each pin and the preset capacitance value can be used to further determine whether the port under test is abnormal. In other words, if the resistance values ​​of all pins under test are greater than the preset resistance value, and the equivalent capacitance value corresponding to any pin is greater than or equal to the preset capacitance value, the port under test is determined to be abnormal; conversely, if the resistance values ​​of all pins under test are greater than the preset resistance value, and the equivalent capacitance values ​​corresponding to each pin are less than the preset capacitance value, the port under test is determined to be normal.

[0142] For example, the electronic device can preset the resistance value of the pin to be tested to be 5.1 kΩ and the capacitance value to be 0.5 picofarads. When the processing module calculates that the resistance value of each pin to be tested is 5.5 kΩ and the equivalent capacitance value corresponding to any pin to be tested is 1 picofarad, it can determine that the pin to be tested is in an abnormal state, that is, the port to be tested is abnormal; when the calculated resistance value of each pin to be tested is 5.5 kΩ and the equivalent capacitance value corresponding to each pin to be tested is 0.4 picofarads, it can determine that the pin to be tested is in a normal state, that is, the port to be tested is not abnormal.

[0143] It should be noted that the above-mentioned preset capacitance value can be a capacitance value preset in the electronic device according to the actual application situation, and this disclosure embodiment does not impose any restrictions.

[0144] In some embodiments, such as Figure 3 and Figure 4 As shown, electronic device 1 also includes:

[0145] The control module 30 is connected to the switch module 11 and the signal input terminal 131 and signal output terminal 132 of the detection module 13. It is configured to control the switching state of the switch module 11, the voltage signal input of the signal input terminal 131, and the voltage signal output of the signal output terminal 132.

[0146] In this way, by setting up a control module that connects the switch module and the signal input and signal output terminals of the detection module, the switching state of the switch module and the voltage signal input and output in the detection module can be better controlled, thereby improving the measurement accuracy of the port to be tested and extending the service life of the port to be tested in electronic equipment.

[0147] In this embodiment of the disclosure, the control module may be a power management integrated circuit (PMIC), which is a chip in the display device system that is responsible for the conversion, distribution, detection and other power management of electrical energy. The power management chip can control and monitor the input and output of various voltages and currents in the power system, thereby ensuring the stable and safe operation of the power system.

[0148] Here, the processing module and control module of the electronic device can communicate via the System Power Management Interface (SPMI). The SPMI bus connects the CPU, peripherals, and PMIC of the electronic device, enabling the management and control of the system power supply. The SPMI bus uses serial communication, employing two signal lines for data transmission between the CPU and PMIC: a data line for transmitting commands and data, and a clock line for synchronizing data transmission. Through the SPMI bus, the CPU can send commands and data to the PMIC to adjust the power supply's operating state, including switching the power supply on and off, and adjusting voltage and current. Simultaneously, the PMIC can also send power status information to the CPU for corresponding adjustments and optimizations.

[0149] Understandably, taking the switch module as an example with a switch chip, the control module can connect to the first control terminal, the second control terminal, and the third control terminal of the switch chip; where the first and second control terminals can both be GPIO ports, and the third control terminal can be an EN port. The control module can control the switch chip to be in an active state by inputting a high-level signal to the EN port; or, control the switch chip to be in an inactive state by inputting a low-level signal to the EN port. The control module can also control the input of low-level signals to both the first and second control terminals to make the connection between the first pin to be tested on the port under test and the output terminal of the switching chip conductive, thus enabling the electronic device to detect the first pin under test; or, control the input of a high-level signal to the first control terminal and a low-level signal to the second control terminal to make the connection between the second pin to be tested on the port under test and the output terminal of the switching chip conductive, thus enabling the electronic device to detect the second pin under test; or, control the input of a low-level signal to the first control terminal and a high-level signal to the second control terminal to make the connection between the third pin to be tested on the port under test and the output terminal of the switching chip conductive, thus enabling the electronic device to detect the third pin under test; or, control the input of a high-level signal to both the first and second control terminals to make the connection between the fourth pin to be tested on the port under test and the output terminal of the switching chip conductive, thus enabling the electronic device to detect the fourth pin under test.

[0150] It should be noted that the processing module of the electronic device can acquire the voltage signal input to the signal input terminal by the control module, such as the PWM signal, as well as the voltage signal output terminal of the signal output terminal received by the control module under different switching states, to calculate the impedance parameters corresponding to each pin to be tested, so as to determine whether there is an abnormality in the port to be tested, thereby improving the measurement accuracy of the port to be tested and extending the service life of the port to be tested in the electronic device.

[0151] In related technologies, in order to avoid corrosion of the ports to be tested in electronic devices, there are usually two methods to detect whether there is liquid or foreign matter in the ports to be tested.

[0152] The first type is the DC measurement scheme, such as... Figure 5As shown, a voltage divider resistor 41 is connected to the port to be tested. This resistor 41 divides the voltage at the measurement pin of the Type-C port 40, and the node voltage is measured at node 42. The resistance to ground of the measurement pin is calculated based on the principle of resistor voltage division, thus determining whether liquid is present at the port to be tested. However, this DC measurement method using resistor voltage division has the following problem: after an external device is connected to the Type-C port 40, the measurement pin may become energized due to liquid ingress. At this time, a high level is measured at node 42, which is mistakenly interpreted as the port being tested being in a high-impedance state, indicating no abnormality, leading to a false positive. To solve the problem of energized pins, related technologies have proposed determining liquid ingress by measuring whether the pin is energized. However, this method is also prone to false positives and its measurement accuracy is poor due to the influence of the operating state.

[0153] The second approach is an AC measurement scheme. To address the inaccuracy of DC resistance voltage division measurements, it proposes superimposing an AC signal onto a reference voltage (Vref). For example... Figure 6 As shown, the value of the measurement pin Rx of measurement port 50 can be calculated by measuring the peak-to-peak value of the reference voltage and the AC voltage of the measured pin, thus avoiding the influence of residual voltage on the measurement results. Furthermore, the equivalent capacitance parameter of the liquid can be determined based on the phase difference between the reference signal and the measurement signal, thereby improving the accuracy of liquid measurement. However, this approach requires the addition of an AC signal generator 51 and a voltage bias source 52 to the electronic device, occupying internal space and increasing the thickness of the device, resulting in a poor user experience.

[0154] Based on this, the detection circuit provided in this disclosure can be configured by sequentially connecting a switching module, a voltage divider module, and a detection module to each pin of the port to be tested. The detection module detects the electrical parameters of the voltage divider module when the switching module is in different switching states, and calculates the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider module. Then, the impedance parameters of each pin to be tested are used to determine whether there is an abnormality in the port to be tested. This allows for accurate detection of the electrical parameters of the voltage divider module even when there is a bias voltage on the pin to be tested, thus improving the measurement accuracy for the port to be tested. Simultaneously, it can promptly detect abnormalities in the port to be tested, allowing for the implementation of protective measures such as corrosion prevention to extend the service life of the port to be tested in the electronic device. Furthermore, this disclosure embodiment does not require additional components in the electronic device; it utilizes existing components in the electronic device to achieve the same measurement accuracy for the port to be tested.

[0155] Figure 6 This is a flowchart illustrating a detection method according to an exemplary embodiment, such as...Figure 7 As shown in the embodiments of this disclosure, a detection method may include at least the following steps:

[0156] Step 610: In response to the detection that the switching module in the detection circuit of the electronic device is in an active state, determine the switching state of the switching module;

[0157] Step 620: Based on the switch state, obtain the electrical parameters of the voltage divider module in the detection circuit under the switch state; wherein, the switch module is connected between each pin to be detected at the port to be detected and the voltage divider module;

[0158] Step 630: Calculate the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider module;

[0159] Step 640: Based on the impedance parameters of each pin to be tested, determine whether there is any abnormality in the port to be tested.

[0160] In this embodiment of the disclosure, the above detection method can be applied to the electronic device described in the above embodiment of the disclosure to determine whether there is any abnormality such as liquid or foreign matter in the port to be tested, so as to take timely measures to prevent liquid or foreign matter from corroding the port to be tested and extend the service life of the port to be tested.

[0161] In step 610, when the electronic device detects that the switch module in the detection circuit is in a working state, it can determine the switching state of the switch module by inputting a control signal to the switch module.

[0162] Here, when the electronic device powers on the control module or receives a valid enable signal to activate the control module, it can detect that the switch module is in working condition.

[0163] For example, taking a switch module as a switch chip and a control module as a PMIC chip, the third control terminal of the switch chip can be an EN port connected to the PMIC chip. The electronic device can input a high-level signal to the third control terminal of the switch chip through the PMIC chip, so that the switch chip is in the working state; then, the PMIC chip controls the level signals input to the first and second control terminals of the switch chip to control the switch chip to be in different switching states.

[0164] In steps 620-640, the electronic device can detect the electrical parameters of the voltage divider module under different switching states, and calculate the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider module under different switching states. Then, it can determine whether there is an abnormality in the port to be tested based on the impedance parameters.

[0165] It is understandable that when there is an abnormality such as liquid or foreign object in the port to be tested, the resistance of the port to be tested will decrease or the capacitance will increase. The processing module can connect to the detection module of the detection circuit, calculate the electrical parameters of the voltage divider module under different switching states sent by the detection module, obtain the impedance parameters of each pin to be tested, and determine whether there is an abnormality such as liquid or foreign object in the port to be tested based on the impedance parameters of each pin to be tested.

[0166] Here, the processing module of the electronic device can calculate the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider modules under different switching states. In other words, after receiving the electrical parameters of a voltage divider module, the processing module can calculate the impedance parameter of a pin to be tested corresponding to that electrical parameter.

[0167] The detection method provided in this disclosure can determine the switching state of the switching module when it is in operation, obtain the electrical parameters of the voltage divider module under that switching state, and calculate the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider module. Then, the impedance parameters of each pin to be tested can be used to determine whether there is an abnormality at the port to be tested. This allows for accurate detection of the electrical parameters of the voltage divider module even when there is a bias voltage on the pin to be tested, thus improving the measurement accuracy for the port to be tested. Simultaneously, it enables timely detection of abnormalities at the port to be tested, allowing for the implementation of protective measures such as corrosion prevention to extend the service life of the port to be tested in the electronic device.

[0168] In some embodiments, step 630 may include:

[0169] Based on the current value corresponding to the third impedance component of the voltage divider module under different switching states and the impedance parameter of the first impedance component of the voltage divider module, the resistance value of each pin to be tested is calculated respectively; wherein, the first impedance component is connected between the switching module and the second input terminal of the operational amplifier of the detection module in the detection circuit, and the third impedance component is connected between the second input terminal and the output terminal of the operational amplifier.

[0170] In this way, the resistance value of each pin to be tested can be calculated by using the current value corresponding to the third impedance component of the voltage divider module under different switching states and the impedance parameter of the first impedance component of the voltage divider module. This is to prepare for comparing the resistance value of each pin to be tested with the preset resistance value to determine whether there is an abnormality in the port to be tested. This will enable more accurate determination of the abnormality in the port to be tested, improve the measurement accuracy of the port to be tested, and extend the service life of the port to be tested in electronic equipment.

[0171] In this embodiment of the disclosure, the processing module of the electronic device can calculate the resistance value of each pin to be tested based on the current value corresponding to the third impedance component of the voltage divider module under different switching states and the impedance parameter of the first impedance component of the voltage divider module. That is, after receiving the current value corresponding to the third impedance component of a voltage divider module and the impedance parameter of the first impedance component of the voltage divider module, the processing module can calculate the resistance value of the corresponding pin to be tested.

[0172] Understandably, electronic devices can utilize the principle of virtual short in operational amplifiers to determine that the input voltage at the first input terminal of the operational amplifier is equal to the input voltage at the second input terminal. At this point, the voltage value corresponding to the third impedance component can be determined as the difference between the input voltage at the signal input terminal and the output voltage at the signal output terminal. Since the impedance value of the third impedance component is known, its corresponding current value can be calculated. Furthermore, utilizing the principle of virtual open in operational amplifiers, the first and third impedance components can be considered as being connected in series, meaning the current flowing through the first impedance component is equal to the current value corresponding to the third impedance component, thus determining the current value corresponding to the first impedance component. Then, the processing module of the electronic device can calculate the sum of the resistance values ​​of the first impedance component and the pin to be detected based on the input voltage at the second input terminal of the operational amplifier and the current value corresponding to the first impedance component. Since the impedance value of the first impedance component is known, the resistance value corresponding to the pin to be detected can be calculated. This resistance value can then be compared with a preset resistance value to determine whether there is an abnormality in the pin to be detected.

[0173] In some embodiments, step 640 may include:

[0174] If the resistance value of any pin to be tested is less than or equal to the preset resistance value, it is determined that there is an abnormality in the port to be tested.

[0175] In this way, the calculated resistance values ​​of each pin to be tested can be compared with the preset resistance values. When the resistance value of any pin to be tested is less than or equal to the preset resistance value, it can be determined that there is an abnormality in the port to be tested. This allows for accurate and timely identification of abnormalities in the port to be tested, further improving the measurement accuracy of the port to be tested and extending the service life of the port to be tested in electronic devices.

[0176] In this embodiment of the disclosure, if the resistance value of any one of the pins to be tested in the port to be tested is less than or equal to a preset resistance value, then the port to be tested is considered to be abnormal. If the resistance values ​​of all the pins to be tested in the port to be tested are greater than the preset resistance value, then the port to be tested can be considered to be normal; alternatively, the equivalent capacitance value of the pins to be tested can be used to further determine whether the port to be tested is abnormal.

[0177] For example, the electronic device can preset the resistance value of the pin to be tested to be 5.1 kΩ. When the processing module of the electronic device calculates the resistance value of the pin to be tested to be 500 Ω, the processing module can determine that the pin to be tested is in an abnormal state, that is, the port to be tested is abnormal; when the processing module calculates the resistance value of the pin to be tested to be 5.5 kΩ, the processing module can determine that the pin to be tested is in a normal state, that is, the port to be tested is not abnormal.

[0178] It should be noted that the aforementioned preset resistance value can be a resistance value pre-set in the electronic device, or it can be a resistance value pre-set in the electronic device according to each pin to be tested of the port to be tested. This disclosure embodiment does not impose any limitations.

[0179] In some embodiments, step 630 may further include:

[0180] Based on the phase difference between the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal of the detection module under different switching states, as well as the resistance value of each pin to be detected, the equivalent capacitance value corresponding to each pin to be detected is calculated.

[0181] In this way, by detecting the phase difference between the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal of the detection module under different switching states, as well as the resistance value of each pin to be tested, the equivalent capacitance value of each pin to be tested can be further calculated. This is to prepare for comparing the equivalent capacitance value of each pin to be tested with the preset capacitance value to determine whether there is an abnormality in the port to be tested. This allows for more accurate and timely identification of abnormalities in the port to be tested, improving the measurement accuracy of the port to be tested and extending the service life of the port to be tested in electronic equipment.

[0182] In this embodiment of the disclosure, the processing module of the electronic device can calculate the equivalent capacitance value corresponding to each pin to be detected based on the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, as well as the resistance value of each pin to be detected; that is, after receiving the phase difference between a set of voltage signals and the resistance value of the pin to be detected, the processing module can calculate the equivalent capacitance value corresponding to the pin to be detected.

[0183] Understandably, the processing module can first calculate the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, and then calculate the ratio between this phase difference and the resistance value of each pin to be detected. This ratio is approximately equal to the equivalent capacitance value of each pin to be detected.

[0184] Here, since both the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal of the detection module are PWM signals such as square wave level signals, the phase difference between the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal can be the time difference between the two voltage signals input and output by the operational amplifier. Therefore, the processing module can use the ratio between this time difference and the resistance value of the pin to be detected as the equivalent capacitance value of the pin to be detected.

[0185] In some embodiments, step 640 may include:

[0186] If the resistance value of each pin to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to any pin to be tested is greater than or equal to the preset capacitance value, it is determined that there is an abnormality in the port to be tested.

[0187] If the resistance value of each pin to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to each pin to be tested is less than the preset capacitance value, it is determined that there is no abnormality in the port to be tested.

[0188] In this way, the equivalent capacitance value of each pin to be tested can be calculated and compared with the preset capacitance value. Based on the comparison result, it can be determined whether there is an abnormality in the port to be tested. This can further accurately determine the abnormality of the port to be tested, thereby improving the measurement accuracy of the port to be tested and extending the service life of the port to be tested in electronic devices.

[0189] In this embodiment of the disclosure, after the processing module of the electronic device determines the resistance value and equivalent capacitance value corresponding to each pin to be tested, it can determine whether there is an abnormality in the pin to be tested based on the magnitude between the resistance value and the preset resistance value, and the magnitude between the equivalent capacitance value and the preset capacitance value.

[0190] It should be noted that if the resistance value of any single pin in the port under test is less than or equal to the preset resistance value, there is no need to further determine the relationship between the equivalent capacitance values ​​of each pin and the preset capacitance value; the port under test is directly identified as abnormal. However, if the resistance values ​​of all pins in the port under test are greater than the preset resistance value, then the relationship between the equivalent capacitance values ​​of each pin and the preset capacitance value can be used to further determine whether the port under test is abnormal. In other words, if the resistance values ​​of all pins under test are greater than the preset resistance value, and the equivalent capacitance value corresponding to any pin is greater than or equal to the preset capacitance value, the port under test is determined to be abnormal; conversely, if the resistance values ​​of all pins under test are greater than the preset resistance value, and the equivalent capacitance values ​​corresponding to each pin are less than the preset capacitance value, the port under test is determined to be normal.

[0191] For example, the electronic device can preset the resistance value of the pin to be tested to be 5.1 kΩ and the capacitance value to be 0.5 picofarads. When the processing module calculates that the resistance value of each pin to be tested is 5.5 kΩ and the equivalent capacitance value corresponding to any pin to be tested is 1 picofarad, it can determine that the pin to be tested is in an abnormal state, that is, the port to be tested is abnormal; when the calculated resistance value of each pin to be tested is 5.5 kΩ and the equivalent capacitance value corresponding to each pin to be tested is 0.4 picofarads, it can determine that the pin to be tested is in a normal state, that is, the port to be tested is not abnormal.

[0192] It should be noted that the above-mentioned preset capacitance value can be a capacitance value preset in the electronic device according to the actual application situation, and this disclosure embodiment does not impose any restrictions.

[0193] In some embodiments, step 620 may include:

[0194] Based on the switch state, determine the input voltage at the signal input terminal and the output voltage at the signal output terminal of the detection module in the detection circuit;

[0195] Based on the input voltage at the signal input terminal and the output voltage at the signal output terminal, determine the current value corresponding to the third impedance component of the voltage divider module.

[0196] In this embodiment of the disclosure, the detection module of the electronic device can determine the input voltage of the signal input terminal and the output voltage of the signal output terminal of the detection module in the switching state of the switching module. The voltage difference between the two is determined as the voltage value corresponding to the third impedance component of the voltage divider module. Then, the current value corresponding to the third impedance component of the voltage divider module is determined according to the ratio between the voltage value corresponding to the third impedance component and the resistance value corresponding to the third impedance component.

[0197] Thus, the present invention can accurately detect the electrical parameters of the voltage divider module by connecting the detection module to the voltage divider module even when there is a bias voltage on the pin to be tested. This allows for a more accurate and timely determination of whether there is an abnormality in each pin to be tested, improving the measurement accuracy of the port to be tested and extending the service life of the port to be tested in electronic devices.

[0198] Figure 7 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment. See also... Figure 7 The electronic device provided in this embodiment may include: a first determining unit 710, an acquiring unit 720, a calculating unit 730, and a second determining unit 740.

[0199] The first determining unit 710 is configured to determine the switching state of the switching module in response to the detection of the switching module in the detection circuit of the electronic device being in an operating state.

[0200] The acquisition unit 720 is configured to acquire the electrical parameters of the voltage divider module in the detection circuit under the switching state; wherein, the switching module is connected between each pin to be detected of the port to be detected and the voltage divider module.

[0201] The calculation unit 730 is configured to calculate the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider module.

[0202] The second determining unit 740 is configured to determine whether there is an abnormality in the port to be tested based on the impedance parameters of each pin to be tested.

[0203] The electronic device provided in this disclosure can determine the switching state of the switching module when the switching module is in operation, obtain the electrical parameters of the voltage divider module in the switching state, and calculate the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider module. Then, it can determine whether there is an abnormality in the port to be tested by using the impedance parameters of each pin to be tested. This allows for accurate detection of the electrical parameters of the voltage divider module even when there is a bias voltage on the pin to be tested, through a detection module connected to the voltage divider module, thus more accurately determining whether there is an abnormality in each pin to be tested and improving the measurement accuracy for the port to be tested. Simultaneously, it can promptly detect abnormalities in the port to be tested and take protective measures such as corrosion prevention to extend the service life of the port to be tested in the electronic device.

[0204] for Figure 7 In one possible implementation of the technical solution shown, the calculation unit 730 is specifically configured to: calculate the resistance value of each pin to be detected based on the current value corresponding to the third impedance component of the voltage divider module under different switching states and the impedance parameter of the first impedance component of the voltage divider module; wherein, the first impedance component is connected between the switching module and the second input terminal of the operational amplifier of the detection module in the detection circuit, and the third impedance component is connected between the second input terminal and the output terminal of the operational amplifier.

[0205] for Figure 7 In one possible implementation of the technical solution shown, the second determining unit 740 is specifically configured to: determine that there is an abnormality in the port to be detected when the resistance value of any pin to be detected is less than or equal to a preset resistance value.

[0206] for Figure 7In one possible implementation of the technical solution shown, the calculation unit 730 is further configured to: calculate the equivalent capacitance value corresponding to each pin to be detected based on the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, as well as the resistance value of each pin to be detected.

[0207] for Figure 7 In one possible implementation of the technical solution shown, the second determining unit 740 is further configured to: determine that there is an abnormality in the port to be tested when the resistance value of each pin to be tested is greater than the preset resistance value and the equivalent capacitance value corresponding to any pin to be tested is greater than or equal to the preset capacitance value; and determine that there is no abnormality in the port to be tested when the resistance value of each pin to be tested is greater than the preset resistance value and the equivalent capacitance value corresponding to each pin to be tested is less than the preset capacitance value.

[0208] for Figure 7 In one possible implementation of the technical solution shown, the acquisition unit 720 is specifically configured to: determine the input voltage of the signal input terminal of the detection module and the output voltage of the signal output terminal of the detection module based on the switch state; and determine the current value corresponding to the third impedance component of the voltage divider module based on the input voltage of the signal input terminal and the output voltage of the signal output terminal.

[0209] It should be noted that, regarding Figure 8 The specific manner in which each module performs its operation in the electronic device shown in the embodiments has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0210] Figure 8 This is a structural block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0211] Reference ​ The electronic device may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.

[0212] Processing component 802 typically controls the overall operation of an electronic device, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0213] Memory 804 is configured to store various types of data to support operation of the electronic device. Examples of such data include at least one of the following: instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, and videos. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0214] Power supply component 806 provides power to various components of an electronic device. Power supply component 806 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0215] Multimedia component 808 includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0216] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0217] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0218] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of the electronic device. For example, sensor assembly 814 can detect the on / off state of the electronic device, the relative positioning of components such as the display and keypad of the electronic device, changes in the position of the electronic device or a component within the electronic device, the presence or absence of user contact with the electronic device, the orientation or acceleration / deceleration of the electronic device, and temperature changes of the electronic device. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include an optical sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.

[0219] Communication component 816 is configured to facilitate wired or wireless communication between electronic devices and other devices. The electronic devices can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.

[0220] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0221] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including executable instructions or a computer program, which can be executed by a processing module of an electronic device to complete the detection method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0222] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processing module of an electronic device, enables the electronic device to perform any of the detection methods described in the above embodiments. For example, the method includes: in response to detecting that a switch module in a detection circuit of the electronic device is in an active state, determining a switching state of the switch module; based on the switching state, acquiring electrical parameters of a voltage divider module in the detection circuit under the switching state; wherein the switch module is connected between each pin to be detected of the port to be detected and the voltage divider module; calculating impedance parameters of each pin to be detected based on the electrical parameters of the voltage divider module; and determining whether an anomaly exists in the port to be detected based on the impedance parameters of each pin to be detected.

[0223] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the tuning methods described above.

[0224] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0225] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0226] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A detection circuit, characterized in that, include: A switching module, wherein the first end of the switching module is connected to each pin to be tested of the port to be tested; wherein, when the switching module is in different switching states, the connection line between the second end of the switching module and the different pins to be tested is in a conductive state; The voltage divider module is connected to the second terminal of the switch module; A detection module, connected to the voltage divider module, is configured to detect the electrical parameters of the voltage divider module when the switch module is in different switching states; the electrical parameters of the voltage divider module are configured to determine whether there is an abnormality in each of the pins to be detected.

2. The detection circuit according to claim 1, characterized in that, The detection module includes: Signal input terminal and signal output terminal; An operational amplifier is provided, wherein a first input terminal of the operational amplifier is connected to the signal input terminal, a second input terminal of the operational amplifier is connected to the voltage divider module, and an output terminal of the operational amplifier is connected to the signal output terminal. The operational amplifier is configured to determine the electrical parameters of the voltage divider module based on the input voltage of the signal input terminal and the output voltage of the signal output terminal.

3. The detection circuit according to claim 2, characterized in that, The voltage divider module includes: A first impedance component is connected between the second terminal of the switching module and the second input terminal of the operational amplifier; The second impedance component is connected between the signal input terminal and the first input terminal of the operational amplifier; A third impedance component is connected between the second input terminal and the output terminal of the operational amplifier; When the switching module is in different switching states, the connection lines between the first impedance component and the different pins to be detected are in a conductive state.

4. The detection circuit according to any one of claims 1 to 3, characterized in that, The detection circuit further includes: An overvoltage protection module is connected to the connection line between each of the pins to be tested and the first end of the switch module, and is configured to disconnect the connection between the pin to be tested and the switch module when the pin voltage of the pin to be tested is greater than a preset voltage threshold.

5. An electronic device, characterized in that, include: The port to be tested has multiple pins to be tested; The detection circuit as described in any one of claims 1 to 4; The switching module of the detection circuit is connected between each of the pins to be detected and the voltage divider module of the detection circuit, and the detection module of the detection circuit is connected to the voltage divider module. The processing module, connected to the detection module, is configured to calculate the impedance parameters of each of the pins to be tested based on the electrical parameters of the voltage divider module detected by the detection module when the switching module is in different switching states, and determine whether there is an abnormality in the port to be tested based on the impedance parameters of each of the pins to be tested.

6. The electronic device according to claim 5, characterized in that, The processing module is further configured to calculate the resistance value of each of the pins to be detected based on the electrical parameters of the voltage divider module when the switching module is in different switching states. Specifically, if the resistance value of any of the pins to be tested is less than or equal to a preset resistance value, it is determined that the port to be tested is abnormal.

7. The electronic device according to claim 6, characterized in that, The processing module is further configured to calculate the equivalent capacitance value corresponding to each of the pins to be detected based on the phase difference between the voltage signal input to the signal input terminal of the detection module and the voltage signal output to the signal output terminal of the detection module under different switching states, as well as the resistance value of each of the pins to be detected. Specifically, if the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to any of the pins to be tested is greater than or equal to the preset capacitance value, then the port to be tested is determined to be abnormal; if the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to each of the pins to be tested is less than the preset capacitance value, then the port to be tested is determined to be normal.

8. The electronic device according to any one of claims 5 to 7, characterized in that, The electronic device also includes: The control module is connected to the switch module and to the signal input and signal output terminals of the detection module. It is configured to control the switching state of the switch module and the voltage signal input of the signal input terminal, and to receive the voltage signal output of the signal output terminal.

9. A detection method, characterized in that, include: In response to the detection that the switching module in the detection circuit of the electronic device is in an active state, the switching state of the switching module is determined; Based on the switch state, the electrical parameters of the voltage divider module in the detection circuit are obtained under the switch state; wherein, the switch module is connected between each pin to be detected of the port to be detected and the voltage divider module; Based on the electrical parameters of the voltage divider module, the impedance parameters of each of the pins to be tested are calculated; Based on the impedance parameters of each of the pins to be tested, it is determined whether there is an abnormality in the port to be tested.

10. The method according to claim 9, characterized in that, The calculation of the impedance parameters of each pin to be tested based on the electrical parameters of the voltage divider module includes: Based on the current value corresponding to the third impedance component of the voltage divider module under different switching states and the impedance parameter of the first impedance component of the voltage divider module, the resistance value of each of the pins to be tested is calculated respectively; wherein, the first impedance component is connected between the second input terminal of the operational amplifier of the detection module in the switching module and the detection circuit, and the third impedance component is connected between the second input terminal of the operational amplifier and the output terminal of the operational amplifier.

11. The method according to claim 10, characterized in that, The step of determining whether there is an anomaly at the port to be tested based on the impedance parameters of each of the pins to be tested includes: If the resistance value of any of the pins to be tested is less than or equal to a preset resistance value, it is determined that there is an abnormality in the port to be tested.

12. The method according to claim 10, characterized in that, The calculation of the impedance parameters of each of the pins to be tested based on the electrical parameters of the voltage divider module further includes: Based on the phase difference between the voltage signal input to the signal input terminal and the voltage signal output to the signal output terminal of the detection module under different switching states, and the resistance value of each pin to be detected, the equivalent capacitance value corresponding to each pin to be detected is calculated.

13. The method according to claim 12, characterized in that, The step of determining whether there is an anomaly at the port to be tested based on the impedance parameters of each of the pins to be tested includes: When the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to any of the pins to be tested is greater than or equal to the preset capacitance value, it is determined that there is an abnormality in the port to be tested. When the resistance value of each of the pins to be tested is greater than the preset resistance value, and the equivalent capacitance value corresponding to each of the pins to be tested is less than the preset capacitance value, it is determined that there is no abnormality in the port to be tested.

14. The method according to any one of claims 9 to 13, characterized in that, The step of obtaining the electrical parameters of the voltage divider module in the detection circuit based on the switching state includes: Based on the switch state, determine the input voltage of the signal input terminal of the detection module in the detection circuit and the output voltage of the signal output terminal of the detection module; Based on the input voltage at the signal input terminal and the output voltage at the signal output terminal, the current value corresponding to the third impedance component of the voltage divider module is determined.

15. An electronic device, characterized in that, include: The first determining unit is configured to determine the switching state of the switching module in response to detecting that the switching module in the detection circuit of the electronic device is in an operating state. The acquisition unit is configured to acquire the electrical parameters of the voltage divider module in the detection circuit under the switch state; wherein the switch module is connected between each pin to be detected of the port to be detected and the voltage divider module. The calculation unit is configured to calculate the impedance parameters of each of the pins to be tested based on the electrical parameters of the voltage divider module. The second determining unit is configured to determine whether there is an abnormality in the port to be tested based on the impedance parameters of each of the pins to be tested.

16. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by a processor, the steps of the method described in any one of claims 9 to 14 are implemented.

17. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method described in any one of claims 9 to 14.