Detection circuit, port module, electronic equipment, detection method and storage medium
By using a detection circuit in the Type-C port module to generate an AC signal to detect the electrical connection between the port module and external devices, the problem of electrochemical corrosion caused by positive pressure on the configuration channel pins is solved, improving safety and compatibility.
Patent Information
- Application Number
- CN202310194928.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
The configuration channel pins of the Type-C port always carry positive pressure during long-term use, which causes electromigration of salt ions in humid environments, causing electrochemical corrosion and connection short circuit problems.
Design a detection circuit that generates AC signals and acts on the configuration channel pins of the port module to determine whether the port module is electrically connected to external devices, reducing the risk of electrochemical corrosion caused by positive pressure and not occupying the ground pin. , keep the port module firmly grounded.
It effectively reduces the frequency of electrochemical corrosion and circuit short-circuit events caused by positive voltage, improves the safety and compatibility of the port module, avoids occupying the ground pin, and conforms to the structural design of the port module.
Smart Images

Figure CN118567915A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of port detection, and in particular to a detection circuit, a port module, an electronic device, a detection method, and a storage medium. Background Art
[0002] Universal Serial Bus (USB) ports are set in electronic devices and are important interfaces for establishing effective information transmission between electronic devices and external devices. Type-C universal serial bus is a common USB port that integrates charging, display, and data transmission functions. The biggest feature of the Type-C port is that it can be plugged in either direction, which solves the defect that USB ports can only transmit power in one direction. The Type-C port has a Configuration Channel pin (CC pin), which can connect to external devices and is used to cooperate with the connection detection between the Type-C port and external devices.
[0003] In the related technology, the CC pin uses DC detection during long-term use, and there is a problem that the CC pin always has positive pressure. At this time, various salt ions are prone to electromigration in a humid environment, causing salt crystals to be generated in a directional manner at one end of the electrode, causing electrochemical corrosion and connection short circuit problems at the Type-C port. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a detection circuit, a port module, an electronic device, a detection method, and a storage medium. Through the detection circuit proposed in the present disclosure, it is possible to detect whether the port module is electrically connected to an external device under the action of an AC signal, thereby reducing the electrochemical corrosion problem caused by the configuration channel pins of the port module always carrying a positive pressure.
[0005] According to a first aspect of an embodiment of the present disclosure, a detection circuit is provided, wherein the detection circuit at least comprises:
[0006] A signal connection port configured as a configuration channel pin of a connection port module;
[0007] a signal generating module, connected to the signal connection port, configured to generate an AC signal, and output the AC signal through the signal connection port;
[0008] An insert detection module is connected to the signal connection port and is configured to detect a detection signal at the signal connection port, wherein the detection signal is formed by the port module under the action of the AC signal;
[0009] The control module is connected to the insertion detection module and is configured to determine whether the port module is electrically connected to an external device based on a detection result of the insertion detection module.
[0010] In some embodiments, the detection circuit further includes:
[0011] an identification module, connected to the signal connection port, and configured to identify the detection signal at the signal connection port;
[0012] The control module is connected to the identification module and is further configured to determine the type of the external device based on the identification result of the identification module.
[0013] In some embodiments, the detection circuit further includes:
[0014] An enabling module, connecting the signal generating module, the insertion detecting module and the identifying module;
[0015] The control module is connected to the enabling module and is configured to control the enabling module to send a first enabling signal to the identification module when it is determined that the port module is electrically connected to the external device, or is configured to control the enabling module to send a second enabling signal to the signal generating module and the insertion detection module when it is determined that the port module is not electrically connected to the external device.
[0016] In some embodiments, the detection circuit further includes:
[0017] A first inverter, comprising a first input terminal and a first output terminal, wherein the first input terminal is connected between the enabling module and the signal generating module, and the first output terminal is connected to the identifying module;
[0018] Wherein, when the enabling module sends the first enabling signal, the level of the input signal of the first input terminal is lower than the level of the output signal of the first output terminal;
[0019] In a case where the enabling module sends the second enabling signal, a level of the input signal of the first input terminal is greater than a level of the output signal of the first output terminal.
[0020] In some embodiments, the enabling module is connected to the signal connection port to form a first branch, a second branch, and a third branch connected in parallel;
[0021] The signal generating module is connected to the first branch;
[0022] The identification module is connected to the second branch;
[0023] The insertion detection module is connected to the third branch.
[0024] In some embodiments, the detection circuit further includes:
[0025] A first signal switch connected to a connection line between the signal generating module and the signal connection port;
[0026] A second signal switch connected to a connection line between the identification module and the signal connection port;
[0027] The control module is connected to the first signal switch and the second signal switch;
[0028] Wherein, when the signal generating module generates the AC signal, the first signal switch is in a closed state, and the second signal switch is in an open state;
[0029] When the identification module identifies, the first signal switch is in an open state, and the second signal switch is in a closed state.
[0030] In some embodiments, the detection circuit further includes:
[0031] A second inverter comprises a second input terminal and a second output terminal, wherein the second input terminal is connected to the first signal switch, and the second output terminal is connected to the second signal switch;
[0032] The control module is connected to the connection line between the first signal switch and the second input end;
[0033] Wherein, when the signal generating module generates the AC signal, the level of the input signal of the second input terminal is greater than the level of the output signal of the second output terminal;
[0034] In a case where the identification module identifies that a level of the input signal of the second input terminal is lower than a level of the output signal of the second output terminal.
[0035] In some embodiments, the first signal switch includes: a first signal terminal, a second signal terminal, and a third signal terminal;
[0036] The first signal end is connected to the signal generating module, the second signal end is connected to the signal connecting port, and the third signal end is connected to the connecting line between the control module and the second input end of the second inverter;
[0037] Wherein, when the level of the input signal of the third signal terminal is greater than the preset level, the first signal terminal is connected to the second signal terminal, and the first signal switch is in a closed state;
[0038] When the level of the input signal of the third signal terminal is less than or equal to the preset level, the connection between the first signal terminal and the second signal terminal is disconnected, and the first signal switch is in an off state.
[0039] In some embodiments, the second signal switch includes: a fourth signal terminal, a fifth signal terminal, and a sixth signal terminal;
[0040] The fourth signal terminal is connected to the identification module, the fifth signal terminal is connected to the signal connection port, and the sixth signal terminal is connected to the second output terminal of the second inverter;
[0041] Wherein, when the level of the input signal of the sixth signal terminal is greater than the preset level, the fourth signal terminal is connected to the fifth signal terminal, and the second signal switch is in a closed state;
[0042] When the level of the input signal of the sixth signal terminal is less than or equal to the preset level, the connection between the fourth signal terminal and the fifth signal terminal is disconnected, and the second signal switch is in an off state.
[0043] In some embodiments, the detection circuit further includes: a voltage divider module connected to the connection line between the signal generating module and the signal connection port, and configured to perform voltage division on the connection line between the signal generating module and the signal connection port.
[0044] In some embodiments, the signal generation module includes:
[0045] a signal generator configured to generate a square wave signal;
[0046] The first filtering unit is connected in series to the connection line between the signal generator and the signal connection port, and is configured to filter the square wave signal to obtain the AC signal.
[0047] In some embodiments, the first filtering unit includes a first capacitive element and a first inductive element;
[0048] The first capacitive element is connected to a connection line between the signal generator and the signal connection port;
[0049] One end of the first inductor element is connected to a connection line between the first capacitive element and the signal connection port, and the other end of the first inductor element is connected to a ground line.
[0050] In some embodiments, the insertion detection module includes:
[0051] An integral filter element, connected to the signal connection port, configured to perform integral filtering processing on the detection signal to obtain a half-wave signal;
[0052] A second filtering unit is configured to filter the half-wave signal to obtain a DC detection signal;
[0053] The detection unit is inserted and connected to the second filtering unit, and is configured to detect the DC detection signal to obtain the detection result.
[0054] In some embodiments, the second filtering unit includes a second capacitive element and a second inductive element;
[0055] The second inductor element is connected to the connection line between the insertion detection unit and the integral filter element;
[0056] One end of the second capacitance element is connected to a connection line between the second inductance element and the insertion detection unit, and the other end of the second capacitance element is connected to a ground line.
[0057] According to a second aspect of an embodiment of the present disclosure, a port module is provided, wherein the port module at least comprises:
[0058] The first aspect of the present disclosure provides a detection circuit;
[0059] Configure channel pins to connect the signal connection port of the detection circuit;
[0060] The connecting circuit is connected to the configuration channel pin and forms a detection signal when the signal connection port of the detection circuit is connected to the configuration channel pin.
[0061] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, wherein the electronic device comprises the port module as described in the second aspect.
[0062] According to a fourth aspect of the embodiments of the present disclosure, a detection method is provided, which is applied in an electronic device. The detection method includes:
[0063] Acquire a detection signal formed by a port module of the electronic device under the action of an AC signal generated by a signal generating module;
[0064] The detection signal is detected by the insertion detection module of the electronic device to obtain a detection result;
[0065] Based on the detection result, it is determined whether the port module is electrically connected to an external device.
[0066] In some embodiments, the detecting the detection signal by the insertion detection module of the electronic device to obtain the detection result includes:
[0067] By inserting the detection module, the detection signal is subjected to integration and filtering processing to obtain a half-wave signal;
[0068] Performing filtering on the half-wave signal to obtain a DC detection signal;
[0069] The DC detection signal is detected to obtain the detection result.
[0070] In some embodiments, determining whether the port module is electrically connected to an external device based on the detection result includes:
[0071] When the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold, determining that the port module is electrically connected to the external device;
[0072] When the absolute value of the amplitude difference is less than or equal to the error threshold, it is determined that the port module is not electrically connected to the external device.
[0073] In some embodiments, the method further comprises:
[0074] Identify the detection signal through an identification module in the electronic device to obtain an identification result;
[0075] Based on the recognition result, the type of the external device is determined.
[0076] In some embodiments, the method further comprises:
[0077] When it is determined that the port module is electrically connected to the external device, controlling the enabling module of the electronic device to generate a first enabling signal, so that the identifying module can identify the detection signal under the enabling effect of the first enabling signal;
[0078] When it is determined that the port module is not electrically connected to the external device, the enabling module is controlled to generate a second enabling signal, so that the signal generating module can continue to generate the AC signal under the enabling effect of the second enabling signal.
[0079] In some embodiments, determining the type of the external device based on the recognition result includes:
[0080] When the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold, obtaining the current detection count;
[0081] If the type of the external device cannot be determined based on the recognition result and the current detection count is less than or equal to the count threshold, acquiring the next detection count until the type of the external device can be determined based on the recognition result, then the acquisition is stopped; or, if the type of the external device cannot be determined based on the recognition result and the current detection count is greater than the count threshold, then the acquisition is stopped;
[0082] Wherein, when the current detection count is obtained for the first time, the current detection count is obtained by adding 1 to the initial value of the count; when the current detection count is not obtained for the first time, the current detection count is obtained by adding 1 to the previous detection count.
[0083] According to a fifth aspect of the embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:
[0084] An acquisition device is configured to acquire a detection signal formed by a port module of the electronic device under the action of an AC signal generated by a signal generation module;
[0085] A detection device, configured to detect the detection signal through the insertion detection module of the electronic device to obtain a detection result;
[0086] The determination device is configured to determine whether the port module is electrically connected to an external device based on the detection result.
[0087] According to a sixth aspect of the embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:
[0088] processor;
[0089] a memory for storing instructions executable by the processor;
[0090] Among them, the processor is configured to execute the detection method proposed in the fourth aspect of the embodiment of the present disclosure.
[0091] According to the seventh aspect of the embodiments of the present disclosure, a non-temporary computer-readable storage medium is provided. When the instructions in the non-temporary computer-readable storage medium are executed by the processor of an electronic device, the electronic device can execute the detection method proposed in the fourth aspect of the embodiments of the present disclosure.
[0092] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0093] The disclosed embodiment proposes a detection circuit, which is applied to a port module (such as a TYPE-C port module) and can generate an AC signal so that the port module can perform preliminary signal detection under the action of the AC signal to determine whether the port module is connected to an external device. In this way, on the one hand, the detection circuit generates an AC signal to act on the configuration channel pin of the port module, thereby reducing the problem that the configuration channel pin always carries positive pressure during the preliminary signal detection process, reducing the frequency of electrochemical corrosion events and circuit short circuit events caused by positive pressure problems, and improving the safety of the port module; on the other hand, compared with the method of connecting a comparator to the ground pin for preliminary detection in the related art, the present disclosure does not occupy the ground pin of the port module, ensuring that the port module is firmly grounded, and does not damage the pin structure of the original port module, which conforms to the structural design of the port module and ensures device compatibility.
[0094] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0096] Figure 1 is a schematic diagram of a detection circuit according to an exemplary embodiment. Figure 1 ;
[0097] Figure 2 is a connection diagram of an identification module of a detection circuit according to an exemplary embodiment;
[0098] Figure 3 is a schematic diagram of a detection circuit according to an exemplary embodiment. Figure 2 ;
[0099] Figure 4 is a schematic diagram of a branch of a detection circuit according to an exemplary embodiment;
[0100] Figure 5 is a circuit diagram of a detection circuit according to an exemplary embodiment;
[0101] Figure 6 is a flow chart of a detection method according to an exemplary embodiment. Figure 1 ;
[0102] Figure 7 is a flow chart of a detection method according to an exemplary embodiment. Figure 2 ;
[0103] Figure 8is a schematic structural diagram of an electronic device according to an exemplary embodiment;
[0104] Fig. 9 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0105] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are only examples of devices and methods consistent with some aspects of the present disclosure.
[0106] In the related art, since the configuration channel pin (CC pin) of the port module (such as the USB Type C port module) can be connected to an external device, a DC signal is usually sent to the CC pin for continuous preliminary detection to determine whether a connection has occurred at the CC pin. After the connection is detected at the CC pin, type identification and information exchange are performed between the CC pin and the external device. It is precisely because of the effect of the DC signal that the CC pin always carries a positive voltage, and various salt ions undergo electromigration in a humid environment, resulting in the directional growth of salt crystals from one end of the electrode, causing electrochemical corrosion and a short circuit in the detection circuit.
[0107] In the solution provided by the related art, a comparator is usually connected to one of the four ground (GND) pins of the Type C port module, and a lower DC voltage is given at the CC pin to detect whether a connection occurs at the CC pin.
[0108] However, for the solution proposed in the related art, firstly, the solution adds a comparator and related reference voltage circuits, and occupies a GND pin, which affects the ground return current of the port module, and because the pins of the Type C port module are symmetrically arranged, the improvement of the ground pin structure will cause signal radiation abnormalities; secondly, the newly added devices proposed in the solution are non-standard designs, and the compatibility is poor when the port module is used in different electronic devices; and, when the solution is applied in the early detection process, the comparator needs to work continuously, resulting in power consumption waste; furthermore, the solution still uses low DC voltage for detection, which essentially cannot change the problem of short circuit caused by electromigration of various salt crystals caused by DC voltage.
[0109] The present disclosure provides a detection circuit. Figure 1 , Figure 1 is a schematic diagram of a detection circuit according to an exemplary embodiment. Figure 1 ,like Figure 1 As shown, the detection circuit includes:
[0110] The signal connection port X is configured as a configuration channel pin CC of the connection port module;
[0111] A signal generating module 2, connected to the signal connection port X, configured to generate an AC signal and output the AC signal through the signal connection port X;
[0112] Insert the detection module 3, connected to the signal connection port X, and configured to detect the detection signal at the signal connection port X, wherein the detection signal is formed by the port module under the action of the AC signal;
[0113] The control module 1 is connected to the insertion detection module 3 and is configured to determine whether the port module is electrically connected to an external device based on a detection result of the insertion detection module 3 .
[0114] Here, the detection circuit of the embodiment of the present disclosure is applied in a port module of an electronic device, such as a USB Type C port module. The detection circuit is connected to the configuration channel pin and can provide an AC signal, so that under the action of the AC signal, the detection circuit can detect whether the port module is electrically connected to an external device based on the configuration channel pin, and overcome a series of problems caused by the configuration channel pin always carrying positive voltage.
[0115] In the present disclosure, the signal connection port can transmit signals with the signal generating module, the insertion detection module and the configuration channel pin, and the AC signal generated by the signal generating module is sent to the configuration channel pin through the signal connection port; the insertion detection module can also receive the detection signal returned through the signal connection port. Here, the port module also has a connection circuit, which connects the configuration channel pin, and forms a detection signal when the signal connection port of the detection circuit is connected to the configuration channel pin. Here, the connection circuit includes a CC signal line and a buffer impedance component, and the buffer impedance component includes a pull-up resistor and / or a pull-down resistor.
[0116] In the embodiment of the present disclosure, the signal generating module includes a signal generator (AC Signal Generator), which includes but is not limited to a single-phase AC power supply, a three-phase AC power supply, etc., and can generate an AC signal. Here, the AC signal includes a square wave signal, a sine wave signal, a triangular wave signal, etc., and the present disclosure does not limit this.
[0117] Here, when the configuration channel pin of the present invention is not connected to an external device, a first detection signal is formed based on a buffer impedance component; when the configuration channel pin of the present invention is connected to the configuration channel pin of an external device, the impedance element in the port circuit of the external device and the buffer impedance component of the connecting circuit in the present application are connected through the CC signal line, and an electrical connection is formed between the port circuit, the detection circuit and the connecting circuit. At this time, the buffer impedance component forms a second detection signal due to the voltage division of the impedance element of the external device; in this way, after the AC signal is transmitted to the configuration channel pin and the connecting circuit through the signal connection port, the port module will generate different detection signals under different connection states.
[0118] In the present disclosure, the detection signal includes a square wave signal, a sine wave signal, a triangle wave signal, etc., and the present disclosure does not impose any limitation on this.
[0119] In the embodiment of the present disclosure, the insertion detection module is connected to the signal connection port, and the detection signal is obtained through the signal connection port. Here, the insertion detection module includes an insertion detection unit, and the insertion detection unit includes: a power management IC (Power Management IC, PMIC), a general purpose input output port (General Porpose Input Output, GPIO). PMIC is an integrated circuit, whose function is to assist in the management of the power supply component located in the port module; GPIO is used to control the output and input through software, and is expressed as a control pin. PMIC and GPIO work together to read or write the detection signal based on the high and low levels of the power supply component and the control pin, and obtain the detection result of the detection signal. Here, the detection result includes the waveform, period, phase, frequency, signal amplitude, signal peak ratio, etc. of the detection signal, and the present disclosure does not limit this.
[0120] In the present disclosure, the control module is configured in the integrated circuit, connected to the insertion detection module, and configured to determine whether the port module is electrically connected to the external device based on different detection results. In some examples, when the signal peak ratio of the detection result is a first ratio, it can be determined that the configured channel pin is not connected to the impedance element of the external device, based on which it is determined that the port module is not connected to the external device. When the signal peak ratio of the detection result is a second ratio, the channel pin can be configured to connect the impedance element of the external device, based on which it is determined that the port module is connected to the external device.
[0121] It should be noted that the control module proposed in the present disclosure is also connected to a signal generating module. When it is determined that the port module is not electrically connected to an external device, the control signal generating module stops generating an AC signal, and after waiting for a preset time, the control signal generating module generates an AC signal again, and controls the insertion detection module to perform detection based on the detection signal again.
[0122] The disclosed embodiment proposes a detection circuit, which is applied to a port module (such as a TYPE-C port module) and can generate an AC signal so that the port module can perform preliminary signal detection under the action of the AC signal to determine whether the port module is connected to an external device. In this way, on the one hand, the detection circuit generates an AC signal to act on the configuration channel pin of the port module, thereby reducing the problem that the configuration channel pin always carries positive pressure during the preliminary signal detection process, reducing the frequency of electrochemical corrosion events and circuit short circuit events caused by positive pressure problems, and improving the safety of the port module; on the other hand, compared with the method of connecting a comparator to the ground pin for preliminary detection in the related art, the present disclosure does not occupy the ground pin of the port module, ensuring that the port module is firmly grounded, and does not damage the pin structure of the original port module, which conforms to the structural design of the port module and ensures device compatibility.
[0123] In some embodiments, see Figure 2 , Figure 2 is a connection diagram of an identification module in a detection circuit according to an exemplary embodiment. Figure 2 As shown, the detection circuit also includes:
[0124] an identification module 4, connected to the signal connection port X, and configured to identify the detection signal at the signal connection port X;
[0125] The control module 1 is connected to the identification module 4 , and is further configured to determine the type of the external device based on the identification result of the identification module 4 .
[0126] Here, the identification module and the insertion detection module can work in coordination; in some examples, the identification work of the identification module can be performed synchronously with the detection work of the insertion detection module; in this way, the control module determines whether the port module is connected to the external device based on the detection result of the insertion detection module, and determines the type of the external device based on the recognition result of the identification module, which can increase the accuracy of judging whether the port module is connected to the external device, and speed up the connection with the external device and the rate of information transmission. In other examples, based on the detection result obtained by the detection work of the insertion detection module, it is determined whether to turn on the identification module; here, if it is determined based on the detection result that the port module is not connected to the external device, the identification module is not turned on; if it is determined based on the detection result that the port module is connected to the external device, the identification module is turned on; in this way, the energy consumption of the identification module can be reduced and the service life of the port module can be increased.
[0127] In the embodiment of the present disclosure, the identification module includes PMIC, GPIO, etc., which can parse the detection signal to obtain the identification result. It should be noted that the identification module proposed in the present disclosure has a filter component, which can filter the AC information of the detection signal. Therefore, the identification result includes DC information corresponding to the detection signal, and the DC information includes voltage parameters, current parameters, etc.
[0128] In some examples, if the voltage parameter of the identification result is at a first voltage level, it is determined that the impedance element of the external device includes a pull-down resistor, and it can be determined that the external device is a device with a downstream port (Downstream Facing Part, DFP), such as a power adapter; when the voltage parameter of the identification result is at a second voltage level, it is determined that the impedance element of the external device includes a pull-up resistor, and it can be determined that the external device is a device with an upstream port (UPstream Facing Part, UFP), such as a USB flash drive, a mobile hard disk; when the voltage parameter of the identification result is at a third voltage level, it can be determined that the impedance element of the external device includes a pull-up resistor and a pull-down resistor, and it can be determined that the external device is a device with a dual role port (Dual Role Part, DRP). Here, the first voltage level, the second voltage level, and the third voltage level are levels with different voltage data. Taking the buffer impedance component in the connection circuit of the port module proposed in the present disclosure as a pull-up resistor as an example, the first voltage level is less than the second voltage level and the third voltage level, and the second voltage level is greater than the third voltage level.
[0129] It should be noted that the port module proposed in the embodiment of the present disclosure is located in the electronic device, and after determining the type of the external device, the signal transmission mode between the electronic device and the external device is determined. For example, when it is determined that the external device is a DFP device, the signal transmission mode is a charge-discharge mode, and the electronic device supplies power to the external device through the port module. In the embodiment of the present disclosure, the detection circuit has an identification module, and the identification function of the identification module can effectively determine the type of the external device, facilitate the determination of the signal transmission mode between the electronic device and the external device, and ensure the connection validity and information transmission validity between the external device and the electronic device.
[0130] In some embodiments, see Figure 3 , Figure 3 is a schematic diagram of a detection circuit according to an exemplary embodiment. Figure 2 ;like Figure 3 As shown, the detection circuit also includes:
[0131] An enabling module 5, connected to the signal generating module 2, the insertion detecting module 3 and the identifying module 4;
[0132] The control module 1 is connected to the enabling module 5, and is configured to control the enabling module 5 to send a first enabling signal to the identification module 4 when it is determined that the port module is electrically connected to the external device, or is configured to control the enabling module 5 to send a second enabling signal to the signal generating module 2 and the insertion detection module 3 when it is determined that the port module is not electrically connected to the external device.
[0133] It should be noted that the control module can connect the signal generating module, the identification module and the insertion detection module through the enabling module.
[0134] Here, the enabling module includes a charge coupled device (CCD), which is a detection element that transmits signals in a coupled manner. The charge coupled device connects the signal generating module, the insertion detection module and the identification module, and can send a first enabling signal to the identification module in a coupled manner, or send a second enabling signal to the signal generating module and the insertion detection module in a coupled manner.
[0135] It should be noted that the first enable signal is used to enable the identification module to start the identification work, and the second enable signal is used to enable the signal generation module to generate the AC signal and enable the insertion detection module to start the detection work.
[0136] By proposing an enabling module, the embodiment of the present disclosure can send different enabling signals to the signal generating module, the insertion detecting module and the identification module under different conditions, thereby ensuring that the signal generating module, the insertion detecting module and the identification module work smoothly.
[0137] In some embodiments, see Figure 4 , Figure 4 is a schematic diagram of a branch circuit of a detection circuit according to an exemplary embodiment. Figure 4 As shown, the enabling module 5 is connected to the signal connection port X to form a first branch P1, a second branch P2 and a third branch P3 connected in parallel;
[0138] The signal generating module 2 is connected to the first branch P1;
[0139] The identification module 4 is connected to the second branch P2;
[0140] The insertion detection module 3 is connected to the third branch P3.
[0141] Here, the signal generation module, the insertion detection module and the identification module are connected in parallel in the detection circuit and can work independently, thereby reducing interference to other modules and ensuring the effective operation of the detection circuit.
[0142] In some embodiments, in combination Figure 4 , the detection circuit further includes:
[0143] A first inverter U1, comprising a first input end and a first output end, wherein the first input end is connected between the enabling module 5 and the signal generating module 2, and the first output end is connected to the identifying module 4;
[0144] Wherein, when the enabling module 5 sends the first enabling signal, the level of the input signal of the first input terminal is lower than the level of the output signal of the first output terminal;
[0145] When the enabling module 5 sends the second enabling signal, the level of the input signal of the first input terminal is greater than the level of the output signal of the first output terminal.
[0146] Here, combined Figure 4 , the first inverter U1 is arranged on the second branch P2.
[0147] The first inverter can reverse the phase of the input signal by 180 degrees. The first inverter includes a first NOT gate circuit, which is a basic unit of a logic circuit, including the first input terminal and the first output terminal. When the first input terminal is at a high level (logic is 1), the first output terminal is at a low level (logic is 0), or when the first input terminal is at a low level (logic is 0), the first output terminal is at a high level (logic is 1), that is, the level states of the first input terminal and the first output terminal are always inverted.
[0148] It should be noted that the first enable signal is a low-level signal, and the second enable signal is a high-level signal. The insertion detection module, the signal generation module, and the identification module can all start working when the input signal is in a high-level state. That is to say, under the action of the first inverter, when the second enable signal is transmitted to the insertion detection module and the signal generation module, the insertion detection module and the signal generation module are enabled, but the second enable signal undergoes a phase change after passing through the first inverter, and the output becomes a low-level state, so when it is transmitted to the identification module, the identification module is not enabled; similarly, the first enable signal does not enable the insertion detection module and the signal generation module, but the first enable signal undergoes a phase change after passing through the first inverter, and the output becomes a high-level state, and enables the identification module when it is transmitted to the identification module.
[0149] The first inverter proposed in the present disclosure can adjust the phase of the first enable signal or the second enable signal, so that the signal generation module, the insertion detection module and the identification module of the detection circuit can cooperate effectively.
[0150] In some embodiments, see Figure 5 , Figure 5is a circuit diagram of a detection circuit according to an exemplary embodiment. Figure 5 As shown, the signal generation module includes:
[0151] A signal generator 21, configured to generate a square wave signal;
[0152] The first filtering unit 22 is connected in series to the connection line between the signal generator 21 and the signal connection port X, and is configured to filter the square wave signal to obtain the AC signal.
[0153] Here, the signal generator (AC Signal Generator) is configured to generate a square wave signal under the action of a first enable signal. Here, the square wave signal carries a DC bias. In some examples, the AC signal proposed in the present disclosure is a sine wave signal or a triangular wave signal, and the first filtering unit filters the square wave signal to obtain a sine wave signal or a triangular signal. The sine wave signal or the triangular wave signal can be transmitted to the configuration channel pin and the connection circuit through the signal connection port so that the port module generates a detection signal. At this time, the waveform of the detection signal is a sine wave or a triangular wave.
[0154] Here, the first filtering unit may include a Wien bridge oscillator circuit, which is an oscillator circuit implemented by RC series / parallel connection, and can filter a square wave signal to form a sine wave signal. The first filtering unit may also include a high-pass filter, and the present disclosure does not limit the composition of the first filtering unit.
[0155] The signal generator and the first filtering unit proposed in the present disclosure can generate a suitable AC signal to ensure the effective operation of the detection circuit.
[0156] In some embodiments, Figure 5 As shown, the first filtering unit 22 includes a first capacitive element C1 and a first inductive element R1;
[0157] The first capacitive element C1 is connected to the connection line between the signal generator 21 and the signal connection port X;
[0158] One end of the first inductor element R1 is connected to a connection line between the first capacitive element C1 and the signal connection port X, and the other end of the first inductor element R1 is connected to a ground line.
[0159] In combination with the above embodiments of the present disclosure, the square wave signal generated by the signal generator forms a sine wave signal after passing through the first capacitive element C1 and the first inductive element R1 in sequence. Here, the square wave signal and the sine wave signal have the same period.
[0160] Through the first capacitor element and the first inductor element proposed in the present disclosure, the square wave signal can be effectively filtered to obtain a sine wave signal, thereby ensuring the effective operation of the detection circuit.
[0161] In some embodiments, Figure 5 As shown, the insertion detection module includes:
[0162] An integral filter element D5, connected to the signal connection port X, and configured to perform integral filtering processing on the detection signal to obtain a half-wave signal;
[0163] The second filtering unit 31 is configured to filter the half-wave signal to obtain a DC detection signal;
[0164] The insertion detection unit 32 is connected to the second filtering unit 31 and is configured to detect the DC detection signal to obtain the detection result.
[0165] The waveform of the detection signal proposed in the present disclosure may be a sine wave or a triangle wave.
[0166] Here, the integral filter element includes an RC integral circuit connected to the signal connection port, the RC integral circuit integrates the detection signal, filters out the negative half-cycle signal, and obtains a half-wave signal, where the period of the half-wave signal is twice the period of the detection signal. The second filtering unit may include a low-pass filter, which filters the half-wave signal to obtain a DC detection signal.
[0167] The insertion detection unit includes a power management chip PMIC (Power Management IC), and a GPIO pin is provided on the PMIC. Here, the PMIC and the GPIO work together to read or write the DC detection signal and obtain the detection result of the detection signal. Here, the detection result includes the frequency, phase, signal amplitude, signal peak ratio, etc. of the DC detection signal. In the embodiment of the present disclosure, the components required for the circuit can be reduced by multiplexing the components, thereby reducing the complexity of the layout.
[0168] In combination with the above disclosure, at least one of the frequency, phase, signal amplitude and signal peak ratio of the detection result is expressed as different values when the channel pin is configured to be connected or not connected to the impedance element of the external device.
[0169] In some embodiments, when the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is less than or equal to the error threshold, the control module determines that the configuration channel pin is not connected to the impedance element, that is, it determines that the port module is not electrically connected to the external device; when the absolute value of the amplitude difference is greater than the error threshold, it determines that the configuration channel pin is connected to the impedance element, that is, it determines that the port module is electrically connected to the external device.
[0170] The second filter unit of the integral filter element proposed in the present disclosure is capable of filtering and integrating signals, and the DC detection signal obtained after filtering and integration is input into the insertion detection unit, and the detection result of the DC detection signal is obtained based on the insertion detection unit, so that the control module can effectively evaluate the detection result.
[0171] In some embodiments, Figure 5 As shown, the second filtering unit 31 includes a second capacitive element C2 and a second inductive element R2;
[0172] The second inductor element R2 is connected to the connection line between the insertion detection unit 32 and the integrating filter element D5;
[0173] One end of the second capacitive element C2 is connected to the connection line between the second inductive element R2 and the insertion detection unit 32 , and the other end of the second capacitive element C2 is connected to the ground line.
[0174] In combination with the above embodiments of the present disclosure, the half-wave signal passes through the second inductor element R2 and the second capacitive element C2 in sequence to form a DC detection signal.
[0175] Through the second capacitor element and the second inductor element proposed in the present disclosure, the half-wave signal can be effectively filtered to obtain a DC detection signal, thereby ensuring the effective operation of the detection circuit.
[0176] In some embodiments, Figure 5 As shown, the detection circuit also includes:
[0177] A first signal switch S1, connected to the connection line between the signal generating module and the signal connection port X;
[0178] A second signal switch S2, connected to the connection line between the identification module 4 and the signal connection port X;
[0179] The control module 1 is connected to the first signal switch S1 and the second signal switch S2;
[0180] Wherein, when the signal generating module generates the AC signal, the first signal switch S1 is in a closed state, and the second signal switch S2 is in an open state;
[0181] When the identification module 4 identifies, the first signal switch S1 is in an open state, and the second signal switch S2 is in a closed state.
[0182] Here, combined Figure 5The first signal switch S1 is arranged on the first branch and connected to the connection line between the first inductor element R1 and the signal connection port X; the second signal switch S2 is arranged on the second branch and connected to the connection line between the identification module 4 and the signal connection port X.
[0183] The control module is connected to the first signal switch and the second signal switch respectively; when the control module controls the enabling module to send the first enabling signal, the second signal switch is controlled to be closed, and the first signal switch is controlled to be disconnected. At this time, the second branch is turned on, the first branch is disconnected, and the identification module obtains and identifies the detection signal; when the control module controls the enabling module to send the second enabling signal to the signal generating module and the insertion detection module, the second signal switch is controlled to be disconnected, and the first signal switch is controlled to be closed, at this time, the first branch is turned on, the second branch is disconnected, the signal generating module generates (or continues to generate) an AC signal, and the insertion detection module obtains and detects (or continues to detect) the signal.
[0184] The disclosed embodiment can reasonably control the conduction or disconnection of different branches and ensure the effective operation of the detection circuit by connecting the control module to the first signal switch located in the first branch and the second signal switch located in the second branch.
[0185] In some embodiments, in combination Figure 5 , the detection circuit further includes:
[0186] A second inverter U2, comprising a second input terminal and a second output terminal, wherein the second input terminal is connected to the first signal switch S1, and the second output terminal is connected to the second signal switch S2;
[0187] The control module 1 is connected to the connection line between the first signal switch S1 and the second input end;
[0188] Wherein, when the signal generating module generates the AC signal, the level of the input signal of the second input terminal is greater than the level of the output signal of the second output terminal;
[0189] When the identification module 4 identifies that the level of the input signal of the second input terminal is lower than the level of the output signal of the second output terminal.
[0190] Here, the second inverter can invert the phase of the input signal by 180 degrees. The second inverter includes a second NOT gate circuit, and the second NOT gate circuit includes the second input terminal and the second output terminal. When the second input terminal is at a high level (logic is 1), the second output terminal is at a low level (logic is 0), or, when the second input terminal is at a low level (logic is 0), the second output terminal is at a high level (logic is 1), that is, the level states of the second input terminal and the second output terminal are always inverted.
[0191] Here, the second inverter may be the same as or different from the first inverter, and the present disclosure is not limited in this regard.
[0192] It should be noted that both the first signal switch and the second signal switch can be closed when the input signal is at a high level, and opened when the input signal is at a low level. In combination with the embodiment of the present disclosure, when the control module generates the second enable signal to enable the signal generation module to generate an AC signal, a high-level control signal is synchronously generated. When the high-level control signal is transmitted to the first signal switch, the first signal switch is closed and the first branch is turned on; after the high-level control signal is transmitted to the second inverter, a level flip occurs and the output is a low-level control signal. At this time, the second signal switch is turned off and the second branch is turned off; similarly, when the control module generates the first enable signal to enable the recognition module to recognize, a low-level control signal is synchronously generated. When the low-level control signal is transmitted to the first signal switch, the first signal switch is turned off and the first branch is turned off; after the low-level control signal is transmitted to the second inverter, a level flip occurs and the output is a high-level control signal. At this time, the second signal switch is closed and the second branch is turned on.
[0193] The second inverter proposed in the present disclosure can adjust the on and off states of the first signal switch and the second signal switch, so that the branches arranged in parallel in the detection circuit can be turned on or off at appropriate times, ensuring that the signal generation module and the identification module can work in coordination.
[0194] In some embodiments, the first signal switch includes: a first signal terminal, a second signal terminal, and a third signal terminal;
[0195] The first signal end is connected to the signal generating module, the second signal end is connected to the signal connecting port, and the third signal end is connected to the connecting line between the control module and the second input end of the second inverter;
[0196] Wherein, when the level of the input signal of the third signal terminal is greater than the preset level, the first signal terminal is connected to the second signal terminal, and the first signal switch is in a closed state;
[0197] When the level of the input signal of the third signal terminal is less than or equal to the preset level, the connection between the first signal terminal and the second signal terminal is disconnected, and the first signal switch is in an off state.
[0198] Here, the first signal switch includes a transistor, and here, the transistor includes but is not limited to: a P-type metal-oxide-semiconductor (PMOS) transistor, an N-type metal-oxide-semiconductor (NMOS) transistor, etc. Here, the number of NMOS tubes and / or PMOS tubes in the first signal switch is not limited in this disclosure. Exemplarily, the first signal switch includes two NMOS tubes connected in series, or the first signal switch includes two PMOS tubes connected in series, or the first signal switch includes an NMOS tube and a PMOS tube arranged in series.
[0199] The first signal switch proposed in the present disclosure includes two NMOS tubes (such as Figure 5 The first NMOS tube Q10 and the second NMOS tube Q11 are shown, the first NMOS tube includes a first gate, a first drain and a first source, and the second NMOS tube includes a second gate, a second drain and a second source; the first signal terminal of the first signal switch proposed in the present disclosure is connected to the first drain, the second signal terminal is connected to the second drain, the third signal terminal is connected to the first gate and the second gate, and the first source is connected to the second source.
[0200] In actual implementation, when the level of the input signal at the third signal terminal is less than or equal to the preset level, the voltage value between the first gate and the first source is less than the threshold voltage, and the first source and the first drain are disconnected. Similarly, the voltage value between the second gate and the first source is less than the threshold voltage, and the second source and the second drain are disconnected. In this way, the first signal terminal and the second signal terminal are not connected, and the first signal switch is in an open state; when the level of the input signal at the third signal terminal is greater than the preset level, the voltage value between the first gate and the first source is greater than the threshold voltage, and the first source and the first drain are connected. Similarly, the voltage value between the second gate and the first source is greater than the threshold voltage, and the second source and the second drain are connected. In this way, the first signal terminal and the second signal terminal are connected, and the first signal switch is in a closed state.
[0201] It should be noted that the mirror connection (i.e., source connection) of the two NMOS tubes in the example proposed in the present disclosure can not only effectively control the on / off state of the first branch, but also alleviate the leakage of one NMOS tube, thereby ensuring the safety of the detection circuit.
[0202] In some embodiments, the second signal switch includes: a fourth signal terminal, a fifth signal terminal, and a sixth signal terminal;
[0203] The fourth signal terminal is connected to the identification module, the fifth signal terminal is connected to the signal connection port, and the sixth signal terminal is connected to the second output terminal of the second inverter;
[0204] Wherein, when the level of the input signal of the sixth signal terminal is greater than the preset level, the fourth signal terminal is connected to the fifth signal terminal, and the second signal switch is in a closed state;
[0205] When the level of the input signal of the sixth signal terminal is less than or equal to the preset level, the connection between the fourth signal terminal and the fifth signal terminal is disconnected, and the second signal switch is in an off state.
[0206] Here, the second signal switch includes a transistor, and the transistor includes but is not limited to an NMOS transistor and a PMOS transistor; the composition of the second signal switch may be the same as or different from that of the first signal switch, and the present disclosure does not limit this.
[0207] Here, the second signal switch includes NMOS tubes and / or PMOS tubes. The number of tubes is not limited in the present disclosure. Exemplarily, the second signal switch includes two NMOS tubes connected in series, or the second signal switch includes two PMOS tubes connected in series, or the second signal switch includes one NMOS tube and one PMOS tube connected in series.
[0208] The second signal switch proposed in the present disclosure includes two NMOS tubes (such as Figure 5 The third NMOS tube Q12 and the fourth NMOS tube Q13 are shown, the third NMOS tube includes a third gate, a third drain and a third source, and the fourth NMOS tube includes a fourth gate, a fourth drain and a fourth source; the fourth signal terminal of the second signal switch proposed in the present disclosure is connected to the third drain, the fifth signal terminal is connected to the fourth drain, the sixth signal terminal is connected to the third gate and the fourth gate, and the third source is connected to the fourth source.
[0209] In actual implementation, when the level of the input signal at the sixth signal terminal is less than or equal to the preset level, the voltage value between the third gate and the third source is less than the threshold voltage, and the third source and the third drain are disconnected. Similarly, the voltage value between the fourth gate and the third source is less than the threshold voltage, and the fourth source and the fourth drain are disconnected. In this way, the fourth signal terminal and the fifth signal terminal are not connected, and the second signal switch is in an open state; when the level of the input signal at the sixth signal terminal is greater than the preset level, the voltage value between the third gate and the third source is greater than the threshold voltage, and the third source and the third drain are connected. Similarly, the voltage value between the fourth gate and the third source is greater than the threshold voltage, and the fourth source and the fourth drain are connected. In this way, the fourth signal terminal and the fourth and fifth signal terminals are connected, and the second signal switch is in a closed state.
[0210] It should be noted that the mirror connection (i.e., source connection) of the two NMOS tubes in the example proposed in the present disclosure can not only effectively control the on / off state of the second branch, but also alleviate the leakage of one NMOS tube, thereby ensuring the safety of the detection circuit.
[0211] In some embodiments, the detection circuit further includes: a voltage divider module connected to the connection line between the signal generating module and the signal connection port, and configured to perform voltage division on the connection line between the signal generating module and the signal connection port.
[0212] In the present disclosure, the voltage divider module includes at least one of the following: a voltage divider resistor element, a voltage divider inductor element, and a voltage divider capacitor element. Figure 5 As shown, the voltage-dividing inductor element R3 is arranged on the first branch and connected to the connection line between the second signal end of the first signal switch S1 and the signal connection port X.
[0213] In this way, the voltage divider module is connected to the connection line between the second signal end and the signal connection port of the first signal switch, which can divide the voltage of the first branch, protect the first branch, reduce the occurrence of short circuit problems, and ensure the safety of the detection circuit.
[0214] The present disclosure provides a port module, the port module comprising:
[0215] The detection circuit described in the above embodiment of the present disclosure;
[0216] Configure channel pins to connect the signal connection port of the detection circuit;
[0217] The connecting circuit is connected to the configuration channel pin and forms a detection signal when the signal connection port of the detection circuit is connected to the configuration channel pin.
[0218] In the present disclosure, the port module includes but is not limited to a TYPE-C port module, a lightning port module, etc. Taking the port module including the TYPE-C port module as an example, the port module also includes signal transmission pins such as A2, A3, A10, A11, a power supply VBus pin, a ground GND pin, etc.
[0219] Here, the A2-A11 pin, the VBus pin, and the GND pin are connected to the signal connection port and can be connected to the corresponding pins of the external device. After the control module determines to connect the external device based on the detection result and determines the type of the external device based on the identification result, the control module transmits a control signal to the A2-A11 pin, the VBus pin, or the GND pin through the signal connection port to enable signal transmission or charging and discharging between the port module and the external device.
[0220] In the present disclosure, the connection circuit includes a CC signal line and a buffer impedance component, and the buffer impedance component includes a pull-up resistor and / or a pull-down resistor.
[0221] When the configuration channel pin proposed in the present disclosure is not connected to an external device, a first detection signal is formed based on a buffer impedance component; when the configuration channel pin of the present disclosure is connected to the configuration channel pin of an external device, the impedance element in the port circuit of the external device and the buffer impedance component of the connecting circuit in the present application are connected through the CC signal line, and an electrical connection is formed between the port circuit, the detection circuit and the connecting circuit. At this time, the buffer impedance component forms a second detection signal due to the voltage division of the impedance element of the external device; in this way, after the AC signal is transmitted to the configuration channel pin and the connecting circuit through the signal connection port, the port module will generate different detection signals under different connection states.
[0222] The port module proposed in the embodiment of the present disclosure has a detection circuit, and the detection circuit can generate an AC signal so that the port module can perform preliminary signal detection under the action of the AC signal to determine whether the port module is connected to an external device. In this way, on the one hand, the detection circuit generates an AC signal to act on the configuration channel pin of the port module, thereby reducing the problem that the configuration channel pin always carries a positive voltage during the preliminary signal detection process, reducing the electromigration of salt crystals, reducing the occurrence of electrochemical corrosion and circuit short circuit events, and improving the safety of the port module; on the other hand, compared with the method of connecting a comparator to the ground pin for preliminary detection in the related art, the present disclosure does not occupy the ground pin of the port module, ensuring that the port module is firmly grounded, and does not damage the pin structure of the original port module, which conforms to the structural design of the port module and ensures device compatibility.
[0223] The embodiment of the present disclosure further provides an electronic device, comprising the port module provided in the above embodiment of the present disclosure.
[0224] In the present disclosure, the port module includes but is not limited to a TYPE-C port module, a lightning port module, etc. Here, the buffer impedance component in the connection circuit of the port module includes a pull-up resistor and / or a pull-down resistor.
[0225] Here, the electronic device includes a port module; in some examples, the electronic device includes a USB flash drive, a mobile hard disk, a voice recorder, etc., in which case the buffer impedance component of the port module includes a pull-up resistor; in other examples, the electronic device includes a power adapter, in which case the buffer impedance component of the port module includes a pull-down resistor; in other examples, the electronic device includes a laptop computer, a mobile phone, etc., in which case the buffer impedance component of the port module includes a pull-up resistor and a pull-down resistor.
[0226] The electronic device proposed in the embodiment of the present disclosure has a port module, and the port module has a detection circuit. The detection circuit can generate an AC signal so that the port module can perform preliminary signal detection under the action of the AC signal, thereby reducing the problem of configuring the channel pin to always carry positive pressure during the preliminary signal detection process, reducing the frequency of electrochemical corrosion events and circuit short circuit events caused by positive pressure problems, and improving the safety of the port module; and the electronic device can effectively charge and discharge and transmit information with external devices through the port module, thereby improving the practicality of the electronic device.
[0227] The present disclosure provides a detection method, see Figure 6 , Figure 6 is a flow chart of a detection method according to an exemplary embodiment. Figure 1 , Figure 6 As shown, the detection method proposed in the present disclosure includes:
[0228] Step S101, obtaining a detection signal generated by a port module of an electronic device under the action of an AC signal generated by a signal generating module;
[0229] Step S102, detecting the detection signal through the insertion detection module of the electronic device to obtain a detection result;
[0230] Step S103: determining whether the port module is electrically connected to an external device based on the detection result.
[0231] Here, the detection method proposed in the present disclosure is applied to the electronic device proposed in the present disclosure. In some examples, the electronic device includes a USB flash drive, a mobile hard disk, a voice recorder, etc.; in other examples, the electronic device includes a power adapter; in some other examples, the electronic device includes a laptop computer, a mobile phone, etc.
[0232] The detection method proposed in the present disclosure is applied to the port module, and can perform preliminary signal detection based on the detection circuit to determine whether the port module is connected to an external device. In this way, on the one hand, the detection circuit generates an AC signal to act on the configuration channel pin of the port module, thereby reducing the problem that the configuration channel pin always carries positive pressure during the preliminary signal detection process, reducing the frequency of electrochemical corrosion events and circuit short circuit events caused by positive pressure problems, and improving the safety of the port module; on the other hand, compared with the method of connecting a comparator to the ground pin for preliminary detection in the related art, the present disclosure does not occupy the ground pin of the port module, ensuring that the port module is firmly grounded, and does not damage the pin structure of the original port module, which conforms to the structural design of the port module and ensures device compatibility.
[0233] In steps S101-S103, the signal generating module generates an AC signal, and the port module forms a detection signal under the action of the AC signal; the detection signal is detected by inserting a detection module to obtain a detection result; and the control module determines whether the port module is electrically connected to an external device based on the detection result.
[0234] In some embodiments, the step S102 of detecting the detection signal by the insertion detection module of the electronic device to obtain the detection result includes:
[0235] By inserting the detection module, the detection signal is subjected to integration and filtering processing to obtain a half-wave signal;
[0236] Performing filtering on the half-wave signal to obtain a DC detection signal;
[0237] The DC detection signal is detected to obtain the detection result.
[0238] Here, the detection result includes the frequency, phase, signal amplitude, signal peak ratio, etc. of the DC detection signal.
[0239] In combination with the above disclosure, at least one of the frequency, phase, signal amplitude and signal peak ratio of the detection result may be expressed as different values when the channel pin is configured to be connected to or not connected to the impedance element of the external device.
[0240] The present disclosure can perform integration filtering, filtering processing, etc. on the detection signal, and detect the DC detection signal obtained after the processing to obtain the detection result, so that the control module can effectively evaluate the detection result.
[0241] In some embodiments, determining whether the port module is electrically connected to an external device based on the detection result in step S103 includes:
[0242] When the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold, determining that the port module is electrically connected to the external device;
[0243] When the absolute value of the amplitude difference is less than or equal to the error threshold, it is determined that the port module is not electrically connected to the external device.
[0244] It should be noted that the functional modules in the detection circuit of the port module are easily affected by the external environment such as temperature and humidity when working, so there may be errors between the detection signals continuously generated in the early detection process. The error threshold proposed in the present disclosure takes into account the influence of the external environment. When the absolute value of the amplitude difference is less than or equal to the error threshold, the control module determines that the port module is in an unconnected state, that is, it determines that the port module is not electrically connected to the external device; when the absolute value of the amplitude difference is greater than the error threshold, the control module determines that the detection signal has changed significantly, and determines that the port module is in a connected state, that is, it determines that the port module is electrically connected to the external device.
[0245] The embodiment proposed in the present disclosure can quickly determine whether the port module is connected to an external device by obtaining the absolute value of the amplitude difference in the preliminary detection, thereby speeding up the progress of the preliminary detection of the port module.
[0246] In some embodiments, the method further comprises:
[0247] Identify the detection signal through an identification module in the electronic device to obtain an identification result;
[0248] Based on the recognition result, the type of the external device is determined.
[0249] In the disclosed embodiment, the identification module includes PMIC, GPIO, etc., and can analyze the detection signal to obtain an identification result. The identification result includes DC information corresponding to the detection signal, and the DC information includes voltage parameters, current parameters, etc.
[0250] Exemplarily, if the voltage parameter of the identification result is at the first voltage level, it is determined that the impedance element of the external device includes a pull-down resistor. In this case, it can be determined that the external device is a device with a downstream facing part (DFP), such as a power adapter.
[0251] In the disclosed embodiment, the detection circuit has an identification module, which can effectively determine the type of external device based on the identification function of the identification module, facilitate determination of the signal transmission mode between the electronic device and the external device, and ensure the connection validity and information transmission validity between the external device and the electronic device.
[0252] In some embodiments, the method further comprises:
[0253] When it is determined that the port module is electrically connected to the external device, controlling the enabling module of the electronic device to generate a first enabling signal, so that the identifying module can identify the detection signal under the enabling effect of the first enabling signal;
[0254] When it is determined that the port module is not electrically connected to the external device, the enabling module is controlled to generate a second enabling signal, so that the signal generating module can continue to generate the AC signal under the enabling effect of the second enabling signal.
[0255] It should be noted that the control module of the electronic device is connected to the enabling module and can control the enabling module to send the first enabling signal or the second enabling signal.
[0256] Here, the enabling module includes a CCD, which is a detection element that transmits signals in a coupled manner. The charge coupled device connects the signal generating module, the insertion detection module and the identification module, and can send a first enabling signal to the identification module in a coupled manner, or send a second enabling signal to the signal generating module and the insertion detection module in a coupled manner.
[0257] In the method proposed in the present disclosure, the enabling module can be controlled to send different enabling signals to the signal generating module, the insertion detecting module and the identifying module under different conditions, so as to ensure that the signal generating module, the insertion detecting module and the identifying module work in coordination.
[0258] In some embodiments, determining the type of the external device based on the recognition result includes:
[0259] When the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold, obtaining the current detection count;
[0260] If the type of the external device cannot be determined based on the recognition result and the current detection count is less than or equal to the count threshold, acquiring the next detection count until the type of the external device can be determined based on the recognition result, then the acquisition is stopped; or, if the type of the external device cannot be determined based on the recognition result and the current detection count is greater than the count threshold, then the acquisition is stopped;
[0261] Wherein, when the current detection count is obtained for the first time, the current detection count is obtained by adding 1 to the initial value of the count; when the current detection count is not obtained for the first time, the current detection count is obtained by adding 1 to the previous detection count.
[0262] The above detection method is executed by a control module, where the control module includes a program counter, which can obtain a count initial value, obtain a next detection count, accumulate detection counts, etc. Here, the control module is simultaneously connected to an insertion identification module, a signal generation module, and an identification module. After comparing the current detection count with the count threshold, the control module controls the operation of different modules and determines the connection status of the current port module based on the results (detection results or identification results) fed back by different modules.
[0263] It should be noted that after the control module determines the type of the external device based on the identification result, it stops detection and identification, and starts charging and discharging or information transmission with the external device; when the control module cannot determine the type of the external device based on the identification result and the current detection count is greater than the counting threshold, an error message is generated.
[0264] Here, the error message is used to indicate that the port module has a connection failure. Here, the connection failure problem may be manifested as: because the port module is exposed to the external environment, impurities, dust, water vapor, etc. are attached to the surface of the pin.
[0265] The above detection method disclosed in the present invention improves the accuracy of judging the connection status between the electronic device and the external device by counting the number of detections and the identification results, and can also perform security monitoring on the port module to ensure the safety of the port module.
[0266] In an embodiment of the present disclosure, the detection circuit of the electronic device includes a first signal switch connected to the signal generation module and a second signal switch connected to the identification module. The detection method proposed in the present disclosure also includes:
[0267] When the control enable module sends a first enable signal, the second signal switch is controlled to be closed and the first signal switch is controlled to be opened; when the control module controls the enable module to send a second enable signal to the signal generation module and the insertion detection module, the second signal switch is controlled to be opened and the first signal switch is controlled to be closed.
[0268] An exemplary embodiment is described below in conjunction with the above disclosure.
[0269] See also Figure 7 , Figure 7 is a flow chart of a detection method according to an exemplary embodiment. Figure 2 ;like Figure 7 As shown, the detection method can be implemented by the following steps:
[0270] Step S201, start.
[0271] Here, the detection circuit of the port module is turned on;
[0272] Step S202, enabling the signal generating module and closing the first signal switch.
[0273] In combination with the above disclosure, the signal generation module is turned on to generate an AC signal, and the first signal switch is closed to transmit the AC signal to the signal connection port. Here, the port module generates a detection signal based on the AC signal, and the detection module is inserted to detect the detection signal to obtain a detection result.
[0274] Step S203, whether the absolute value of the difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold;
[0275] Here, when the absolute value of the amplitude difference is less than or equal to the error threshold, step S204 is executed, and when the absolute value of the amplitude difference is greater than the error threshold, step S206 is executed.
[0276] Step S204, turning off the signal generating module and disconnecting the first signal switch.
[0277] Step S205, after waiting for a preset time, execute step S202.
[0278] Step S206, obtain the current detection count and add 1.
[0279] When the current detection count is obtained for the first time, the current detection count is obtained by adding 1 to the initial value of the count; when the current detection count is not obtained for the first time, the current detection count is obtained by adding 1 to the previous detection count.
[0280] Step S207, turning off the signal generating module and disconnecting the first signal switch.
[0281] Step S208, enabling the identification module and closing the second signal switch.
[0282] Here, the recognition module acquires and recognizes the detection signal to obtain a recognition result.
[0283] Step S209, determining whether the type of the external device can be determined based on the recognition result;
[0284] Here, if the type of the external device can be determined according to the recognition result, step S210 is executed; if the type of the external device cannot be determined according to the recognition result, step S211 is executed.
[0285] Step S210, determining a signal transmission mode between an external device and an electronic device.
[0286] Here, the charging and discharging operation or signal transmission operation between the electronic device and the external device is determined based on the type of the external device. For example, if the external device is a USB flash drive and the electronic device is a laptop, the signal transmission mode is the data transmission mode; if the external device is a power adapter and the electronic device is a mobile phone, the information transmission mode is the charging and discharging mode.
[0287] Step S211, determining whether the current detection count is greater than a count threshold.
[0288] Here, if the current detection count is greater than the count threshold, step S212 is executed; if the current detection count is less than or equal to the count threshold, step S203 is executed.
[0289] Step S212, generating error information.
[0290] The error message is used to indicate that the port module has a connection failure. Here, the connection failure problem may be manifested as: the port module is exposed to the external environment, and impurities, dust, water vapor, etc. are attached to the pin surface.
[0291] Step S213, end.
[0292] The present disclosure also provides an electronic device, see Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device according to an exemplary embodiment. Figure 8 As shown, the electronic device 800 includes:
[0293] The acquisition device 801 is configured to acquire a detection signal generated by a port module of the electronic device under the action of an AC signal generated by a signal generation module;
[0294] The detection device 802 is configured to detect the detection signal through the insertion detection module of the electronic device to obtain a detection result;
[0295] The determination means 803 is configured to determine whether the port module is electrically connected to an external device based on the detection result.
[0296] In some embodiments, the detection device 802 is further configured to perform integral filtering processing on the detection signal through the insertion detection module to obtain a half-wave signal; perform filtering processing on the half-wave signal to obtain a DC detection signal; and detect the DC detection signal to obtain the detection result.
[0297] In some embodiments, the determination device 803 is further configured to determine that the port module is electrically connected to the external device when the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than an error threshold; and to determine that the port module is not electrically connected to the external device when the absolute value of the amplitude difference is less than or equal to the error threshold.
[0298] In some embodiments, the determining device 803 is further configured to identify the detection signal through an identification module in the electronic device to obtain an identification result; and determine the type of the external device based on the identification result.
[0299] In some embodiments, the electronic device further comprises:
[0300] The control device is configured to, when it is determined that the port module is electrically connected to the external device, control the enable module of the electronic device to generate a first enable signal, so that the identification module can identify the detection signal under the enabling effect of the first enable signal; and when it is determined that the port module is not electrically connected to the external device, control the enable module to generate a second enable signal, so that the signal generating module can continue to generate the AC signal under the enabling effect of the second enable signal.
[0301] In some embodiments, the determination device 803 is further configured to obtain a current detection count when the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold; obtain the next detection count when the type of the external device cannot be determined based on the recognition result and the current detection count is less than or equal to the counting threshold, and stop obtaining until the type of the external device can be determined based on the recognition result; or stop obtaining until the type of the external device cannot be determined based on the recognition result and the current detection count is greater than the counting threshold; wherein, when the current detection count is obtained for the first time, the current detection count is obtained by accumulating 1 from the initial count value; and when the current detection count is not obtained for the first time, the current detection count is obtained by accumulating 1 from the previous detection count.
[0302] Fig. 9 9 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 900 may be a laptop, a mobile phone, a game console, a tablet device, a medical device, a headset, etc.
[0303] Reference Fig. 9 , the electronic device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .
[0304] The processing component 902 generally controls the overall operation of the electronic device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0305] The memory 904 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 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 memory, flash memory, magnetic disk or optical disk.
[0306] The power supply component 906 provides power to the various components of the electronic device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 900.
[0307] The multimedia component 908 includes a screen that provides an output interface between the electronic device 900 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 touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0308] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the electronic device 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.
[0309] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0310] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the electronic device 900. For example, the sensor assembly 914 can detect the open / closed state of the device 900, the relative positioning of components, such as the display and keypad of the electronic device 900, and the sensor assembly 914 can also detect the position change of the electronic device 900 or a component of the electronic device 900, the presence or absence of user contact with the electronic device 900, the orientation or acceleration / deceleration of the electronic device 900, and the temperature change of the electronic device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0311] The communication component 916 is configured to facilitate wired or wireless communication between the electronic device 900 and other devices. The electronic device 900 can access a wireless network based on a communication standard, such as WiFi, 3G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0312] In an exemplary embodiment, the electronic device 900 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 to perform the above methods.
[0313] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by a processor 920 of an electronic device 900 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0314] A non-transitory computer-readable storage medium, when instructions in the non-transitory computer-readable storage medium are executed by a processor of a mobile terminal, enables an electronic device to perform a detection method, the method comprising:
[0315] Acquire a detection signal formed by a port module of the electronic device under the action of an AC signal generated by a signal generating module;
[0316] The detection signal is detected by the insertion detection module of the electronic device to obtain the detection result;
[0317] Based on the detection result, it is determined whether the port module is electrically connected to the external device.
[0318] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0319] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A detection circuit, characterized in that: The detection circuit comprises: A signal connection port configured as a configuration channel pin of a connection port module; a signal generating module, connected to the signal connection port, configured to generate an AC signal, and output the AC signal through the signal connection port; An insert detection module is connected to the signal connection port and is configured to detect a detection signal at the signal connection port, wherein the detection signal is formed by the port module under the action of the AC signal; The control module is connected to the insertion detection module and is configured to determine whether the port module is electrically connected to an external device based on a detection result of the insertion detection module.
2. The detection circuit according to claim 1, characterized in that: The detection circuit also includes: an identification module, connected to the signal connection port, and configured to identify the detection signal at the signal connection port; The control module is connected to the identification module and is further configured to determine the type of the external device based on the identification result of the identification module.
3. The detection circuit according to claim 2, characterized in that: The detection circuit also includes: An enabling module, connecting the signal generating module, the insertion detecting module and the identifying module; The control module is connected to the enabling module and is configured to control the enabling module to send a first enabling signal to the identification module when it is determined that the port module is electrically connected to the external device, or is configured to control the enabling module to send a second enabling signal to the signal generating module and the insertion detection module when it is determined that the port module is not electrically connected to the external device.
4. The detection circuit according to claim 3, characterized in that: The detection circuit also includes: A first inverter, comprising a first input terminal and a first output terminal, wherein the first input terminal is connected between the enabling module and the signal generating module, and the first output terminal is connected to the identifying module; Wherein, when the enabling module sends the first enabling signal, the level of the input signal of the first input terminal is lower than the level of the output signal of the first output terminal; In a case where the enabling module sends the second enabling signal, a level of the input signal of the first input terminal is greater than a level of the output signal of the first output terminal.
5. The detection circuit according to claim 3, characterized in that: The enabling module is connected to the signal connection port to form a first branch, a second branch and a third branch connected in parallel; The signal generating module is connected to the first branch; The identification module is connected to the second branch; The insertion detection module is connected to the third branch.
6. The detection circuit according to claim 2, characterized in that: The detection circuit also includes: A first signal switch connected to a connection line between the signal generating module and the signal connection port; A second signal switch connected to a connection line between the identification module and the signal connection port; The control module is connected to the first signal switch and the second signal switch; Wherein, when the signal generating module generates the AC signal, the first signal switch is in a closed state, and the second signal switch is in an open state; When the identification module identifies, the first signal switch is in an open state, and the second signal switch is in a closed state.
7. The detection circuit according to claim 6, characterized in that: The detection circuit also includes: A second inverter comprises a second input terminal and a second output terminal, wherein the second input terminal is connected to the first signal switch, and the second output terminal is connected to the second signal switch; The control module is connected to the connection line between the first signal switch and the second input end; Wherein, when the signal generating module generates the AC signal, the level of the input signal of the second input terminal is greater than the level of the output signal of the second output terminal; In a case where the identification module identifies that a level of the input signal of the second input terminal is lower than a level of the output signal of the second output terminal.
8. The detection circuit according to claim 7, characterized in that: The first signal switch comprises: a first signal terminal, a second signal terminal and a third signal terminal; The first signal end is connected to the signal generating module, the second signal end is connected to the signal connecting port, and the third signal end is connected to the connecting line between the control module and the second input end of the second inverter; Wherein, when the level of the input signal of the third signal terminal is greater than the preset level, the first signal terminal is connected to the second signal terminal, and the first signal switch is in a closed state; When the level of the input signal of the third signal terminal is less than or equal to the preset level, the connection between the first signal terminal and the second signal terminal is disconnected, and the first signal switch is in an off state.
9. The detection circuit according to claim 7, characterized in that: The second signal switch includes: a fourth signal terminal, a fifth signal terminal and a sixth signal terminal; The fourth signal terminal is connected to the identification module, the fifth signal terminal is connected to the signal connection port, and the sixth signal terminal is connected to the second output terminal of the second inverter; Wherein, when the level of the input signal of the sixth signal terminal is greater than the preset level, the fourth signal terminal is connected to the fifth signal terminal, and the second signal switch is in a closed state; When the level of the input signal of the sixth signal terminal is less than or equal to the preset level, the connection between the fourth signal terminal and the fifth signal terminal is disconnected, and the second signal switch is in an off state.
10. The detection circuit according to any one of claims 1 to 8, characterized in that: The detection circuit further includes: a voltage dividing module connected to the connection line between the signal generating module and the signal connection port, and configured to perform voltage dividing on the connection line between the signal generating module and the signal connection port.
11. The detection circuit according to any one of claims 1 to 8, characterized in that: The signal generating module comprises: a signal generator configured to generate a square wave signal; The first filtering unit is connected in series to the connection line between the signal generator and the signal connection port, and is configured to filter the square wave signal to obtain the AC signal.
12. The detection circuit according to claim 11, characterized in that: The first filtering unit includes a first capacitive element and a first inductive element; The first capacitive element is connected to a connection line between the signal generator and the signal connection port; One end of the first inductor element is connected to a connection line between the first capacitive element and the signal connection port, and the other end of the first inductor element is connected to a ground line.
13. The detection circuit according to any one of claims 1 to 8, characterized in that: The insertion detection module comprises: An integral filter element, connected to the signal connection port, configured to perform integral filtering processing on the detection signal to obtain a half-wave signal; A second filtering unit is configured to filter the half-wave signal to obtain a DC detection signal; The detection unit is inserted and connected to the second filtering unit, and is configured to detect the DC detection signal to obtain the detection result.
14. The detection circuit according to claim 13, characterized in that: The second filtering unit includes a second capacitive element and a second inductive element; The second inductor element is connected to the connection line between the insertion detection unit and the integral filter element; One end of the second capacitance element is connected to a connection line between the second inductance element and the insertion detection unit, and the other end of the second capacitance element is connected to a ground line.
15. A port module, characterized in that: include: The detection circuit according to any one of claims 1 to 14; Configure channel pins to connect the signal connection port of the detection circuit; The connecting circuit is connected to the configuration channel pin and forms a detection signal when the signal connection port of the detection circuit is connected to the configuration channel pin.
16. An electronic device, characterized in that: Comprising the port module as claimed in claim 15.
17. A detection method, characterized in that: Applied in electronic equipment, the detection method includes: Acquire a detection signal formed by a port module of the electronic device under the action of an AC signal generated by a signal generating module; The detection signal is detected by the insertion detection module of the electronic device to obtain a detection result; Based on the detection result, it is determined whether the port module is electrically connected to an external device.
18. The detection method according to claim 17, characterized in that: The detecting signal is detected by the insertion detection module of the electronic device to obtain a detection result, including: By inserting the detection module, the detection signal is subjected to integration and filtering processing to obtain a half-wave signal; Performing filtering on the half-wave signal to obtain a DC detection signal; The DC detection signal is detected to obtain the detection result.
19. The detection method according to claim 17, characterized in that: The step of determining whether the port module is electrically connected to an external device based on the detection result includes: When the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold, determining that the port module is electrically connected to the external device; When the absolute value of the amplitude difference is less than or equal to the error threshold, it is determined that the port module is not electrically connected to the external device.
20. The detection method according to any one of claims 17 to 19, characterized in that: The method further comprises: Identify the detection signal through an identification module in the electronic device to obtain an identification result; Based on the recognition result, the type of the external device is determined.
21. The detection method according to claim 20, characterized in that: The method further comprises: When it is determined that the port module is electrically connected to the external device, controlling the enabling module of the electronic device to generate a first enabling signal, so that the identifying module can identify the detection signal under the enabling effect of the first enabling signal; When it is determined that the port module is not electrically connected to the external device, the enabling module is controlled to generate a second enabling signal, so that the signal generating module can continue to generate the AC signal under the enabling effect of the second enabling signal.
22. The detection method according to claim 20, characterized in that: The determining the type of the external device based on the recognition result includes: When the absolute value of the amplitude difference between the signal amplitude of the detection result and the preset amplitude is greater than the error threshold, obtaining the current detection count; If the type of the external device cannot be determined based on the recognition result and the current detection count is less than or equal to the count threshold, acquiring the next detection count until the type of the external device can be determined based on the recognition result, then the acquisition is stopped; or, if the type of the external device cannot be determined based on the recognition result and the current detection count is greater than the count threshold, then the acquisition is stopped; Wherein, when the current detection count is obtained for the first time, the current detection count is obtained by adding 1 to the initial value of the count; when the current detection count is not obtained for the first time, the current detection count is obtained by adding 1 to the previous detection count.
23. An electronic device, characterized in that: include: An acquisition device is configured to acquire a detection signal formed by a port module of the electronic device under the action of an AC signal generated by a signal generation module; A detection device, configured to detect the detection signal through the insertion detection module of the electronic device to obtain a detection result; The determination device is configured to determine whether the port module is electrically connected to an external device based on the detection result.
24. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the detection method as described in any one of claims 17 to 22.
25. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the non-transitory computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the detection method as described in any one of claims 17 to 22.
Citation Information
Cited By
Communication control method and first electronic equipment
CN119597133A
