Liquid inlet detection method and device, electronic equipment and storage medium
By integrating detection circuits into electronic devices, we can determine whether the USB Type-C port is injected with liquid, which solves the problem of electrical corrosion caused by liquid and ensures the reliability and user experience of the port.
Patent Information
- Application Number
- CN202311348644.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2025-04-18
AI Technical Summary
The USB Type-C interface may cause potential difference and electrical corrosion after contacting the liquid, resulting in problems such as charging and charging disconnection and peripherals being unable to recognize, reducing the user experience.
An electronic device is designed, including a processor, a USB Type-C port and a detection circuit. By detecting the resistance value of the first pin of the USB Type-C port and/or the voltage value of the second pin, it is determined whether the port is injected with liquid.
It effectively avoids the problem of liquid corrosion of USB Type-C ports, ensures that the port can work reliably in different usage scenarios, and improves the user experience.
Smart Images

Figure CN119846336A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of detection technology, and in particular to a liquid inflow detection method and device, electronic equipment, and storage medium. Background Art
[0002] Currently, more and more electronic devices are using USB Type-C interfaces; the USB Type-C interface can be used for charging or fast charging, transmitting audio and video data, etc.
[0003] In actual applications, the USB Type-C interface may come into contact with liquid, which will cause a potential difference between adjacent pins and cause electrical corrosion. In addition, certain components in the liquid, such as salt, will also corrode the metal pins. After the USB Type-C interface is corroded, problems such as charging interruption and failure to recognize peripherals may occur, reducing the user experience. Summary of the invention
[0004] The present disclosure provides a liquid ingress detection method and device, an electronic device, and a storage medium to solve the above-mentioned technical problems.
[0005] According to a first aspect of the present disclosure, there is provided an electronic device, including a processor, a USB Type-C port, and a detection circuit;
[0006] The detection circuit is used to detect the resistance value of the first pin and / or the voltage value of the second pin in the USB Type-C port;
[0007] The processor is used to determine whether liquid has entered the USB Type-C port according to the resistance value or the voltage value.
[0008] Optionally, the detection circuit includes a power switch, multiple groups of detection switches and an ADC sampler;
[0009] The first end of the power switch is electrically connected to the target power supply, and the second end of the power switch is electrically connected to the second end of each detection switch and the input end of the ADC sampler respectively; each of the first pins is electrically connected to the first end of each detection switch in turn;
[0010] The control end of the ADC sampler, the control end of each detection switch and the control end of the power switch are electrically connected to the processor respectively.
[0011] Optionally, the detection circuit is used in conjunction with a ground pin in the USB Type-C port to detect a resistance value of the first pin in the second state.
[0012] Optionally, the first pin includes at least one pin of the A-side or B-side pins of the USB Type-C port except a ground pin.
[0013] Optionally, the detection circuit is used in conjunction with a power pin in the USB Type-C port to detect a voltage value of the second pin in the first state;
[0014] The first state refers to a state in which the USB Type-C port of the electronic device is connected to an external device, and the second state refers to a state in which the USB Type-C port of the electronic device is not connected to an external device.
[0015] Optionally, the second pin includes at least one pin of the A-side or B-side pins of the USB Type-C port except a ground pin.
[0016] According to a second aspect of the present disclosure, a liquid inflow detection method is provided, the method comprising:
[0017] Obtaining a connection state of a USB Type-C port; the connection state includes a first state in which the port is connected to an external device and a second state in which the port is not connected to the external device;
[0018] In response to determining that the connection state is the second state, determining whether liquid has entered the port according to a resistance value of the first pin of the USB Type-C port;
[0019] In response to determining that the connection state is the first state, determining whether liquid has entered the port according to a voltage value of a second pin of the USB Type-C port.
[0020] Optionally, determining whether liquid has entered the port according to the resistance value of the first pin of the USB Type-C port includes:
[0021] Detecting a first resistance value of each of the first pins of the USB Type-C port;
[0022] In response to determining that the first resistance value satisfies a first preset condition, it is determined that a first event of liquid intrusion into the USB Type-C port is detected.
[0023] Optionally, the first pin includes a first auxiliary communication pin and a first data communication pin and a second data communication pin on the same side thereof; and / or, the first pin includes a second auxiliary communication pin and a first data communication pin and a second data communication pin on the same side thereof.
[0024] Optionally, the first preset condition includes: a first resistance value of each of the first pins is less than or equal to a resistance value threshold.
[0025] Optionally, the method further comprises:
[0026] In response to determining that the first resistance value does not satisfy the first preset condition, it is determined that a second event of no liquid intrusion into the USB Type-C port is detected.
[0027] Optionally, in response to determining that a first event of liquid intrusion into the USB Type-C port is detected, the method further includes:
[0028] Detecting a second resistance value of each of the first pins of the USB Type-C port;
[0029] In response to determining that the second resistance value satisfies a second preset condition, it is determined that a third event of liquid inflow and disappearance at the USB Type-C port is detected.
[0030] Optionally, the second preset condition includes: the second resistance value of each of the first pins is greater than the resistance value threshold.
[0031] Optionally, the method further comprises:
[0032] In response to determining that the second resistance value does not satisfy the second preset condition, a step of detecting a second resistance value of each of the first pins of the USB Type-C port is performed.
[0033] Optionally, determining whether liquid has entered the port according to the voltage value of the second pin of the USB Type-C port includes:
[0034] Obtain a first voltage value of each pin of the second pin of the USB Type-C port;
[0035] In response to determining that the first voltage value satisfies a third preset condition, it is determined that a first event of liquid intrusion into the USB Type-C port is detected.
[0036] Optionally, the second pin includes a first auxiliary communication pin and a first configuration pin on the same side thereof; and / or, the second pin includes a second auxiliary communication pin and a second configuration pin on the same side thereof.
[0037] Optionally, the third preset condition includes: a voltage value at the first configuration pin is greater than a first voltage threshold and a voltage value at the first auxiliary communication pin SBU1 is greater than a third voltage threshold;
[0038] and / or,
[0039] The third preset condition includes: the voltage value at the second configuration pin is greater than a second voltage threshold and the voltage value at the second auxiliary communication pin is greater than a third voltage threshold.
[0040] Optionally, the method further comprises:
[0041] In response to determining that the first voltage value does not satisfy a third preset condition, it is determined that a second event of no liquid intrusion into the USB Type-C port is detected.
[0042] Optionally, in response to determining that a first event of liquid intrusion into the USB Type-C port is detected, the method further includes:
[0043] Detecting a second voltage value of each of the second pins of the USB Type-C port;
[0044] In response to determining that the second resistance value satisfies a fourth preset condition, it is determined that a third event of liquid inflow disappearance occurring at the USB Type-C port is detected.
[0045] Optionally, the fourth preset condition includes: the second voltage value at the first configuration pin is less than or equal to the first voltage threshold and the second voltage value at the first auxiliary communication pin is less than or equal to the third voltage threshold;
[0046] and / or,
[0047] The fourth preset condition includes: the second voltage value at the second configuration pin is less than or equal to the second voltage threshold and the second voltage value at the second auxiliary communication pin is less than or equal to the third voltage threshold.
[0048] Optionally, the method further comprises:
[0049] In response to determining that the second voltage value does not satisfy the fourth preset condition, a step of detecting a second voltage value of each of the second pins of the USB Type-C port is performed.
[0050] Optionally, the method further comprises:
[0051] In response to detecting that liquid has entered the USB Type-C port, a first pop-up window containing reminder information of the liquid ingress event is generated.
[0052] Optionally, the method further comprises:
[0053] In response to detecting the event of liquid disappearance at the USB Type-C port, a second pop-up window containing reminder information of liquid disappearance is generated.
[0054] According to a third aspect of the present disclosure, a liquid inflow detection device is provided, the device comprising:
[0055] A voltage value acquisition module, used to acquire a connection state of the USB Type-C port; the connection state includes a first state where the port is connected to an external device and a second state where the port is not connected to the external device;
[0056] a liquid inflow event acquisition module, configured to determine whether liquid has entered the port according to a resistance value of a first pin of the USB Type-C port in response to determining that the connection state is the second state;
[0057] The liquid inflow event acquisition module is further used to determine whether the port has liquid inflow according to the voltage value of the second pin of the USB Type-C port in response to determining that the connection state is the first state.
[0058] Optionally, the liquid inflow event acquisition module includes:
[0059] a resistance value detection submodule, used to detect a first resistance value of each of the first pins of the USB Type-C port;
[0060] The first event determination submodule is configured to determine, in response to determining that the first resistance value satisfies a first preset condition, that a first event of liquid intrusion into the USB Type-C port is detected.
[0061] Optionally, the first pin includes a first auxiliary communication pin and a first data communication pin and a second data communication pin on the same side thereof; and / or, the first pin includes a second auxiliary communication pin and a first data communication pin and a second data communication pin on the same side thereof.
[0062] Optionally, the first preset condition includes: a first resistance value of each of the first pins is less than or equal to a resistance value threshold.
[0063] Optionally, the liquid inflow event acquisition module is further configured to, in response to determining that the first resistance value does not satisfy the first preset condition, determine a second event of detecting that no liquid inflow occurs at the USB Type-C port.
[0064] Optionally, the device further comprises:
[0065] A second resistance value detection module, used to detect a second resistance value of each of the first pins of the USB Type-C port;
[0066] The liquid inflow event acquisition module is further configured to determine, in response to determining that the second resistance value satisfies a second preset condition, a third event of detecting that liquid inflow disappears at the USB Type-C port.
[0067] Optionally, the second preset condition includes: the second resistance value of each of the first pins is greater than the resistance value threshold.
[0068] Optionally, the second resistance value detection module is further configured to, in response to determining that the second resistance value does not satisfy the second preset condition, execute a step of detecting the second resistance value of each of the first pins of the USB Type-C port.
[0069] Optionally, the device further comprises
[0070] A first voltage value detection module, used to obtain a first voltage value of each pin of the second pin of the USB Type-C port;
[0071] The liquid inflow event acquisition module is further configured to determine, in response to determining that the first voltage value satisfies a third preset condition, a first event of detecting liquid inflow to the USB Type-C port.
[0072] Optionally, the second pin includes a first auxiliary communication pin and a first configuration pin on the same side thereof; and / or, the second pin includes a second auxiliary communication pin and a second configuration pin on the same side thereof.
[0073] Optionally, the third preset condition includes: a voltage value at the first configuration pin is greater than a first voltage threshold and a voltage value at the first auxiliary communication pin is greater than a third voltage threshold;
[0074] and / or,
[0075] The third preset condition includes: the voltage value at the second configuration pin is greater than a second voltage threshold and the voltage value at the second auxiliary communication pin is greater than a third voltage threshold.
[0076] Optionally, the liquid inflow event acquisition module is further configured to, in response to determining that the first voltage value does not satisfy a third preset condition, determine that a second event of no liquid inflow occurring at the USB Type-C port is detected.
[0077] Optionally, the device further comprises:
[0078] A second voltage value detection module, used to detect a second voltage value of each of the second pins of the USB Type-C port;
[0079] The liquid inflow event acquisition module is further configured to determine, in response to determining that the second resistance value satisfies a fourth preset condition, a third event of detecting that liquid inflow disappears at the USB Type-C port.
[0080] Optionally, the fourth preset condition includes: the second voltage value at the first configuration pin is less than or equal to the first voltage threshold and the second voltage value at the first auxiliary communication pin is less than or equal to the third voltage threshold;
[0081] and / or,
[0082] The fourth preset condition includes: the second voltage value at the second configuration pin is less than or equal to the second voltage threshold and the second voltage value at the second auxiliary communication pin is less than or equal to the third voltage threshold.
[0083] Optionally, the second voltage value detection module is further configured to, in response to determining that the second voltage value does not satisfy the fourth preset condition, execute a step of detecting a second voltage value of each of the second pins of the USB Type-C port.
[0084] Optionally, the device further comprises:
[0085] The first pop-up window generating module is used to generate a first pop-up window containing reminder information of the liquid inflow event in response to detecting the event of liquid inflow into the USB Type-C port.
[0086] Optionally, the method further comprises:
[0087] In response to detecting the event of liquid disappearance at the USB Type-C port, a second pop-up window containing reminder information of liquid disappearance is generated.
[0088] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:
[0089] Processor and memory;
[0090] The memory is used to store a computer program executable by the processor;
[0091] The processor is configured to execute the computer program in the memory to implement the method as described in any one of the second aspects.
[0092] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, and when an executable computer program in the storage medium is executed by a processor, the method described in any one of the second aspects can be implemented.
[0093] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0094] The electronic device provided by the solution of this embodiment includes a processor, a USB Type-C port and a detection circuit; the detection circuit is used to detect the resistance value of the first pin and / or the voltage value of the second pin in the USB Type-C port; the processor is used to determine whether liquid has entered the USB Type-C port according to the resistance value or the voltage value. In this way, this embodiment combines the voltage value of the first power pin and the USB Type-C port to determine the resistance value or the voltage value to determine the liquid ingress event, which can cover the scenarios where the USB Type-C port is used or not, so as to avoid the purpose of liquid ingress corroding the port and ensure the reliable operation of the port.
[0095] 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
[0096] Figure 1 The present invention is a schematic structural diagram of a USB Type-C port according to an embodiment of the present invention.
[0097] Figure 2 The present invention is a circuit diagram of a detection circuit according to an embodiment of the present invention.
[0098] Figure 3 FIG. 4 is a circuit diagram of another detection circuit according to an embodiment of the present disclosure.
[0099] Figure 4 The present invention is a flow chart of a liquid inlet detection method according to an embodiment of the present invention.
[0100] Figure 5 The present invention is a schematic diagram of displaying a first pop-up window in an electronic device according to an embodiment of the present disclosure.
[0101] Figure 6 It is a schematic diagram of displaying a first pop-up window in an electronic device according to an embodiment of the present disclosure.
[0102] Figure 7 The present invention is a flowchart of determining a first event according to a voltage value according to an embodiment of the present invention.
[0103] Figure 8 The present invention is a flow chart of a liquid inlet detection method according to an embodiment of the present invention.
[0104] Fig. 9 The present invention is a block diagram of a liquid inlet detection device according to an embodiment of the present invention.
[0105] Fig.10 The present invention is a block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0106] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.
[0107] In order to solve the above technical problems, the embodiments of the present disclosure provide a liquid inflow detection method and device, an electronic device, and a storage medium. The electronic device includes a processor, a USB Type-C port, and a detection circuit. The above processor can be a CPU processor in an electronic device, or a newly added device with processing functions, such as a single-chip microcomputer, or a chip with processing functions in an electronic device, such as a power management chip.
[0108] See also Figure 1 The USB Type-C port includes an A side and a B side, each of which is provided with a group of pins with the same function and in the opposite order. Taking the A side pins as an example, pins A1 to A12 are respectively GND, TX1+, TX1-, VBUS, CC1, D+, D-, SBU1, VBUS, RX2-, RX2+ and GND.
[0109] In one example, see Figure 2 , the detection circuit includes an ADC sampler, a power switch K1, a pull-up resistor R1 and multiple groups of detection switches K2; the first end of the pull-up resistor R1 is electrically connected to the target power supply (such as 1.875V, adjustable), and the first end of the pull-up resistor R1 is electrically connected to the first end of the power switch K1; the second end of the power switch K1 is electrically connected to the input end of the ADC sampler and the second end of each detection switch K2 respectively; the first end of each detection switch K2 is electrically connected to each pin in the first pin. Among them, the first pin includes at least one pin of the A side or B side pin of the USB Type-C port except the ground pin, such as at least one of A2 to A11.
[0110] In this example, the processor is electrically connected to the control end of the power switch K1, the control end of each group of detection switches K2, and the output end of the ADC sampler. The distance between the first pin and the ground pin is less than or equal to the preset distance, so that when the liquid enters between the pin and the ground pin, the pin and the ground can be short-circuited. The resistance to ground R_gnd formed when the liquid short-circuits the pin is as follows: Figure 2 shown.
[0111] In one example, the detection circuit is used in conjunction with a ground pin in a USB Type-C port to detect the resistance value of the first pin in the second state. Figure 2The working principle of the detection circuit shown is:
[0112] When not detected, the power switch K1 is disconnected and each group of detection switches K2 is disconnected, and the connection status between each pin and the ground pin is unknown, that is, whether liquid is added is unknown. At this time, it is necessary to determine the connection status between each pin and the ground pin. When there is a detection demand, the processor can control the power switch K1 to close and each group of detection switches K2 to close in turn. When there is liquid between a pin and the ground pin, the liquid is equivalent to the wire shorting the pin to the ground pin. The equivalent resistance R_gnd between the liquid and the pin forms a voltage divider circuit with the pull-up resistor R1. At this time, the ADC sampler can collect the voltage division of the equivalent resistance and convert the voltage division into a resistance value to output to the processor. Repeat the above switching operation to switch to each detection switch K2 in turn. The processor can obtain the resistance value of each pin in the first pin, which is subsequently referred to as the first resistance value.
[0113] In another example, the detection circuit is used in conjunction with a power pin in a USB Type-C port to detect a voltage value of a second pin in a first state. Figure 3 The working principle of the detection circuit shown is:
[0114] When not detected, the power switch K1 is disconnected and each group of detection switches K2 is disconnected, and the connection status between each pin and the power pin is unknown, that is, whether liquid is added is unknown. At this time, it is necessary to determine the connection status between each pin and the power pin. When there is a detection requirement, the processor can control the power switch K1 to close and each group of detection switches K2 to close in turn. When there is liquid between a pin and the power pin, the liquid is equivalent to a wire. At this time, the pin is short-connected to the power pin, and the equivalent resistance R_vbus between the liquid and the pin, that is, the voltage of the detection pin is the power supply voltage VBUS. At this time, the ADC sampler can collect the voltage value of the pin and output the voltage value to the processor. Repeat the above switching operation to switch to each detection switch K2 in turn. The processor can obtain the voltage value of each pin in the second pin, which is subsequently referred to as the first voltage value.
[0115] based on Figure 1 to Figure 3 The electronic device shown in the figure, the embodiment of the present disclosure also provides a liquid inflow detection method, Figure 4 Flow chart of a liquid inflow detection method according to an embodiment of the present disclosure. Figure 4 , a liquid inlet detection method includes steps 41 to 43.
[0116] In step 41, the connection state of the USB Type-C port is obtained; the connection state includes a first state of being connected to an external device and a second state of not being connected to the external device.
[0117] In this step, the USB Type-C port of the electronic device may be electrically connected to the USB Type-C port of the external device. The external device may include, but is not limited to, a charging device, other electronic devices, headphones, a data cable, etc. After docking with the external device, the processor of the electronic device may determine the connection state of the USB Type-C port, which includes a first state of being connected to the external device and a second state of not being connected to the external device.
[0118] In one example, when the electronic device is docked with the external device, the configuration pins CC of the USB Type-C ports of the two devices are docked to form a communication channel. After the communication channel is established, the pull-up resistors (or pull-down resistors) in the electronic device and the external device will form a voltage divider circuit to determine whether the USB Type-C port is in a forward plug state or a reverse plug state. Then, the processor can obtain the forward plug state or the reverse plug state of the USB Type-C port, and determine that the connection state is a first state connected to the external device. Alternatively, the processor cannot obtain the forward plug state or the reverse plug state of the USB Type-C port, or is in a suspended state, and determines that the connection state is a second state that is not connected to the external device.
[0119] In another example, when the electronic device is docked with an external device, the power pin VBUS of the USB Type-C port of the electronic device will be powered. The processor can obtain the voltage value at the power pin VBUS, and when the voltage value at the power pin VBUS is a first voltage value (such as 0V), the processor can determine that the connection state of the USB Type-C port is a second state that is not connected to the external device; when the voltage value at the power pin VBUS is a second voltage value (such as VCC, such as 2V), the processor can determine that the connection state of the USB Type-C port is a first state that is connected to the external device.
[0120] In another example, when the electronic device is docked with the external device, the two will determine the role of the electronic device, such as a downstream facing port (DFP), an upstream facing port (UFP), a dual role port (DRP), etc. When the role of the USB Type-C port of the electronic device is detected, the processor can determine that the connection state of the USB Type-C port is a first state of being connected to the external device; when the role of the USB Type-C port of the electronic device cannot be detected, the processor can determine that the connection state of the USB Type-C port is a second state of not being connected to the external device.
[0121] It should be noted that the above embodiments describe solutions for obtaining the connection status of the USB Type-C port of an electronic device. Those skilled in the art can select a corresponding solution according to the specific scenario. If the connection status can be determined, the corresponding solution falls within the protection scope of this disclosure.
[0122] In step 42, in response to determining that the connection state is the second state, determining whether liquid has entered the port according to the resistance value of the first pin of the USB Type-C port.
[0123] In this step, when it is determined that the connection state of the USB Type-C port is the second state, the processor can determine whether the port has been liquid-infiltrated according to the resistance value of the first pin of the USB Type-C port, see Figure 2 , including step 21 and step 22.
[0124] In step 21, the processor may detect a first resistance value of each of the first pins of the USB Type-C port.
[0125] Considering that the USB Type-C port of the electronic device is a receiving end (or female end), liquids are usually splashed into the middle area of the A side and / or the B side. In one example, the first pin is pre-configured. Figure 1 , the first pin may include a first auxiliary communication pin SBU1 and a first data communication pin D+ and a second data communication pin D- on the same side thereof; and / or, the first pin includes a second auxiliary communication pin SBU2 and a first data communication pin D+ and a second data communication pin D- on the same side thereof. In this way, this example detects liquid inflow through three pins in the middle area, which is conducive to improving the accuracy of the detection result.
[0126] In this step, the processor can obtain the resistance value of each pin in the first pin, which is hereinafter referred to as the first resistance value for distinction. The scheme for obtaining the first resistance value can be referred to in Figure 2 The content of the example solution will not be repeated here.
[0127] In step 22, in response to determining that the first resistance value satisfies a first preset condition, the processor may determine that a first event of liquid intrusion into the USB Type-C port is detected.
[0128] A first preset condition is stored in the electronic device, and the first preset condition includes that the resistance value of each pin in the first pin is less than or equal to a resistance value threshold.
[0129] The above resistance threshold can be detected experimentally. Considering the use scenarios of electronic devices, the liquid entering the USB Type-C port may include but is not limited to sweat, tap water, rainwater, beverages, etc. In this way, various liquids can be dropped into the USB Type-C port to detect the resistance value of the above equivalent resistor when different liquids splash into the USB Type-C port; then, the maximum value in the detection value or the preset multiple of the maximum value (such as 1 to 1.5) is determined as the resistance threshold.
[0130] In this step, the processor can compare the first resistance value of each pin in the first pin with the resistance value threshold. When the first resistance value of each pin in the first pin is less than the above resistance value threshold, it is determined that the first resistance value meets the first preset condition. In other words, the first preset condition includes: the first resistance value of each pin in the first pin is less than or equal to the resistance value threshold. At this time, the processor can determine to detect a first event of liquid inflow into the USB Type-C port. When it is determined that the first resistance value does not meet the first preset condition, the processor can determine to detect a second event of no liquid inflow into the USB Type-C port.
[0131] It should be noted that, considering that the splashed liquid is usually one type of liquid, the first resistance value of each pin may be approximately equal, so the first resistance value of each pin is compared with the resistance value threshold to simplify the processing scheme.
[0132] In one example, after determining that a first event of liquid intrusion into the USB Type-C port is detected, a signal may be generated as follows: Figure 5 The first pop-up window containing the reminder information of the liquid inflow event shown in FIG. 1 may be used to remind that the charging port is wet. Figure 6 The first pop-up window shown contains reminder information of a liquid ingress event, for example, the reminder information of a liquid ingress event is used to prompt that the charging port is wet and affects normal use, and user interaction is required for charging.
[0133] The processor detects the second resistance value of each pin in the first pin of the USB Type-C port, wherein the manner of obtaining the second resistance value and the first resistance value is the same, which will not be repeated here. Then, the processor can compare the second resistance value of each pin in the first pin with the resistance value threshold to determine whether the second resistance value meets the second preset condition. Among them, the second preset condition includes: the second resistance value of each pin in the first pin is greater than the resistance value threshold. When it is determined that the second resistance value does not meet the second preset condition, the processor can continue to perform the step of detecting the second resistance value of each pin in the first pin of the USB Type-C port. When it is determined that the second resistance value meets the second preset condition, the processor can determine that a third event of liquid disappearance has been detected in the USB Type-C port, and at this time, the second resistance value can be stopped, that is, liquid inlet detection can be stopped. After it is determined that the third event of liquid disappearance has been detected in the USB Type-C port, a second pop-up window containing reminder information of liquid disappearance can be generated, or no pop-up window is generated.
[0134] In step 43, in response to determining that the connection state is the first state, determining whether liquid has entered the port according to the voltage value of the second pin of the USB Type-C port.
[0135] In this step, when it is determined that the connection state of the USB Type-C port is the first state, the processor can determine whether the port has a liquid inlet event according to the voltage value of the second pin of the USB Type-C port, see Figure 7 , including step 71 and step 72.
[0136] In step 71, the processor may obtain a first voltage value of each of the second pins of the USB Type-C port.
[0137] In this step, the second pin can be preconfigured based on the way of preconfiguring the first pin. In one example, the second pin includes the first auxiliary communication pin SBU1 and the first configuration pin CC1 on the same side thereof; and / or, the second pin includes the second auxiliary communication pin SBU2 and the second configuration pin CC2 on the same side thereof.
[0138] In this step, the processor may obtain the first voltage value of each pin of the second pin of the USB Type-C port, wherein the scheme for obtaining the first voltage value may refer to Figure 3 The content of the example solution will not be repeated here.
[0139] It should be noted that, considering that when no liquid enters the USB Type-C port, each pin in the USB Type-C port is physically connected to the corresponding pin of the external device, the potential at the pin is much smaller than the power supply voltage.
[0140] In step 72, in response to determining that the first voltage value satisfies a third preset condition, it is determined that a first event of liquid intrusion into the USB Type-C port is detected.
[0141] In this step, a third preset condition is stored in the electronic device, and the third preset condition can be adjusted according to the second pin. In one example, the third preset condition includes: the voltage value at the first configuration pin CC1 is greater than the first voltage threshold Vcc_set1 and the voltage value at the first auxiliary communication pin SBU1 is greater than the third voltage threshold Vsbu; and / or, the third preset condition includes: the voltage value at the second configuration pin CC2 is greater than the second voltage threshold Vcc_set2 and the voltage value at the second auxiliary communication pin SBU2 is greater than the third voltage threshold Vsbu.
[0142] In this step, the processor can compare the first voltage value of each pin in the second pin with their respective voltage thresholds, for example, compare the voltage value at the first configuration pin CC1 with the first voltage threshold Vcc_set1, compare the voltage value at the first auxiliary communication pin SBU1 with the third voltage threshold Vsbu; and / or, compare the voltage value at the second configuration pin CC2 with the second voltage threshold Vcc_set2, compare the voltage value at the second auxiliary communication pin SBU2 with the third voltage threshold Vsbu.
[0143] It should be noted that the setting method of the first voltage threshold Vcc_set1, the second voltage threshold Vcc_set2 and the third voltage threshold Vsbu can refer to the setting method of the voltage value threshold, that is, various types of liquids are dripped into the USB Type-C port respectively, and then the voltage value input by the ADC sampler is obtained, and then the maximum value of the sampled voltage value or a preset multiple (such as 1 to 1.5) of the maximum value is taken as the first voltage threshold Vcc_set1, the second voltage threshold Vcc_set2 or the third voltage threshold Vsbu. In this way, when liquid is introduced, the voltage value of the pin can be pulled down from the power supply voltage until it is less than or equal to the above-mentioned voltage thresholds, that is, when the voltage value output by the ADC sampler is less than or equal to the voltage value threshold, it is determined that liquid is introduced.
[0144] In one example, when it is determined that the first voltage value of each pin of the second pin does not meet the third preset condition, the processor may determine that the second event that no liquid inflow occurs to the USB Type-C port is detected. At this time, the processor may stop the liquid inflow detection. In this example, the processor may start a timer, and restart the liquid inflow detection process when the timer counts a preset time.
[0145] In one example, when it is determined that the first voltage value of each pin of the second pin meets the third preset condition, the processor can determine that a first event of liquid inflow is detected in the USB Type-C port. Then, the processor can detect the voltage value of each pin in the second pin of the USB Type-C port, which is hereinafter referred to as the second voltage value. Among them, the method for obtaining the second voltage value can refer to the method for obtaining the first voltage value. The processor can determine whether the second voltage value of each pin in the second pin meets the fourth preset condition. Among them, the above-mentioned fourth preset condition includes: the second voltage value at the first configuration pin CC1 is less than or equal to the first voltage threshold Vcc_set1 and the second voltage value at the first auxiliary communication pin SBU1 (on the same side of CC1) is less than or equal to the third voltage threshold Vsbu; and / or, the fourth preset condition includes: the second voltage value at the second configuration pin CC2 is less than or equal to the second voltage threshold Vcc_set2 and the second voltage value at the second auxiliary communication pin SBU2 (on the same side of CC2) is less than or equal to the third voltage threshold Vsbu.
[0146] In one example, when it is determined that the second resistance value satisfies the fourth preset condition, the processor may determine that a third event of liquid disappearance has been detected in the USB Type-C port. At this time, the processor may stop the liquid inflow detection. When it is determined that the second voltage value does not satisfy the fourth preset condition, the step of detecting the second voltage value of each pin in the second pin of the USB Type-C port is performed. After the liquid disappears, the processor may generate a second pop-up window to remind the user that the liquid disappears and the electronic device can be used normally; or the pop-up window may not be generated, so that the user assumes that the electronic device can be used normally.
[0147] Combination Figure 8 The flowchart shown describes a liquid inlet detection method provided by the present disclosure, see Fig. 9 ,include:
[0148] When the electronic device is started up or the screen is turned on, the processor can detect whether an external device is plugged into the USB Type-C port.
[0149] When it is determined that no external device is inserted, the processor can determine whether liquid has entered the USB Type-C port by detecting the resistance value of the first pin.
[0150] The processor can obtain the first resistance value of each pin in the first pin, for example, first collect a group of first resistance values, and then use another group of first resistance values after a preset time interval (such as 500ms, which can be configured). The above two groups of first resistance values can be used separately or weightedly, and the weight value of the first resistance value of the latter group is higher than the weight value of the first resistance value of the former group.
[0151] Taking a set of first resistance values as an example, the processor can determine whether the first resistance value satisfies a first preset condition, and when the first preset condition is not satisfied, the second event of liquid inflow does not occur in the USB Type-C port and liquid inflow detection is stopped. When it is determined that the first resistance value satisfies the first preset condition, the processor can determine that the first event of liquid inflow occurs.
[0152] Then, the processor can obtain the second resistance value of each pin in the first pin according to a set period (for example, 1 to 10 seconds), and determine whether the second resistance value meets the second preset condition. When it is determined that the second resistance value meets the second preset condition, the third event of liquid disappearance is determined; otherwise, the second resistance value continues to be obtained until the liquid disappears.
[0153] When it is determined that an external device is inserted, the processor can determine whether liquid has entered the USB Type-C port by detecting the voltage value of the second pin.
[0154] The processor may obtain the second voltage value of each pin in the second pin, and determine whether the second voltage value satisfies a third preset condition. When it is determined that the third preset condition is not satisfied, the processor may determine that the second event of liquid inflow has not occurred in the USB Type-C port and stop liquid inflow detection. When it is determined that the third preset condition is satisfied, the processor may determine that the first event of liquid inflow has occurred in the USB Type-C port.
[0155] After determining that the first event has occurred, the processor can obtain the second voltage value of each pin in the second pin according to a set period (for example, 1 to 10 seconds), and determine whether the second voltage value meets the fourth preset condition. When it is determined that the second voltage value meets the fourth preset condition, the third event of the disappearance of liquid inflow is determined; otherwise, the second voltage value continues to be obtained until the liquid inflow disappears and the liquid inflow detection is stopped.
[0156] In this embodiment, by identifying liquid ingress into the USB Type-C port in different scenarios, the accuracy of liquid ingress detection can be improved, which is beneficial for users to promptly handle liquid ingress problems and avoid or alleviate the problem of corrosion of the USB Type-C port.
[0157] Based on a liquid inflow detection method provided in an embodiment of the present disclosure, an embodiment of the present disclosure further provides a liquid inflow detection device, see Fig. 9 , the device comprises:
[0158] A voltage value acquisition module 91 is used to acquire a connection state of the USB Type-C port; the connection state includes a first state in which the port is connected to an external device and a second state in which the port is not connected to the external device;
[0159] a liquid inflow event acquisition module 92, configured to determine whether liquid has entered the port according to a resistance value of a first pin of the USB Type-C port in response to determining that the connection state is the second state;
[0160] The liquid inflow event acquisition module 92 is further configured to determine whether liquid has entered the port according to a voltage value of a second pin of the USB Type-C port in response to determining that the connection state is the first state.
[0161] In one embodiment, the liquid inflow event acquisition module includes:
[0162] a resistance value detection submodule, used to detect a first resistance value of each of the first pins of the USB Type-C port;
[0163] The first event determination submodule is configured to determine, in response to determining that the first resistance value satisfies a first preset condition, that a first event of liquid intrusion into the USB Type-C port is detected.
[0164] In one embodiment, the first pin includes a first auxiliary communication pin SBU1 and a first data communication pin D+ and a second data communication pin D- on the same side thereof; and / or, the first pin includes a second auxiliary communication pin SBU2 and a first data communication pin D+ and a second data communication pin D- on the same side thereof.
[0165] In one embodiment, the first preset condition includes: the first resistance value of each of the first pins is less than or equal to a resistance value threshold.
[0166] In one embodiment, the liquid inflow event acquisition module is further used to determine, in response to determining that the first resistance value does not satisfy the first preset condition, a second event of detecting that no liquid inflow occurs at the USB Type-C port.
[0167] In one embodiment, the device further comprises:
[0168] A second resistance value detection module, used to detect a second resistance value of each of the first pins of the USB Type-C port;
[0169] The liquid inflow event acquisition module is further configured to determine, in response to determining that the second resistance value satisfies a second preset condition, a third event of detecting that liquid inflow disappears at the USB Type-C port.
[0170] In one embodiment, the second preset condition includes: the second resistance value of each of the first pins is greater than the resistance value threshold.
[0171] In one embodiment, the second resistance value detection module is further configured to, in response to determining that the second resistance value does not satisfy the second preset condition, execute the step of detecting the second resistance value of each of the first pins of the USB Type-C port.
[0172] In one embodiment, the device further comprises
[0173] A first voltage value detection module, used to obtain a first voltage value of each pin of the second pin of the USB Type-C port;
[0174] The liquid inflow event acquisition module is further configured to determine, in response to determining that the first voltage value satisfies a third preset condition, a first event of detecting liquid inflow to the USB Type-C port.
[0175] In one embodiment, the second pin includes a first auxiliary communication pin SBU1 and a first configuration pin CC1 on the same side thereof; and / or, the second pin includes a second auxiliary communication pin SBU2 and a second configuration pin CC2 on the same side thereof.
[0176] In one embodiment, the third preset condition includes: the voltage value at the first configuration pin CC1 is greater than a first voltage threshold (Vcc_set1) and the voltage value at the first auxiliary communication pin SBU1 is greater than a third voltage threshold (Vsbu);
[0177] and / or,
[0178] The third preset condition includes: the voltage value at the second configuration pin CC2 is greater than the second voltage threshold (Vcc_set2) and the voltage value at the second auxiliary communication pin SBU2 is greater than the third voltage threshold (Vsbu).
[0179] In one embodiment, the liquid inflow event acquisition module is further used to determine, in response to determining that the first voltage value does not satisfy a third preset condition, a second event of detecting that no liquid inflow occurs at the USB Type-C port.
[0180] In one embodiment, the device further comprises:
[0181] A second voltage value detection module, used to detect a second voltage value of each of the second pins of the USB Type-C port;
[0182] The liquid inflow event acquisition module is further configured to determine, in response to determining that the second resistance value satisfies a fourth preset condition, a third event of detecting that liquid inflow disappears at the USB Type-C port.
[0183] In one embodiment, the fourth preset condition includes: the second voltage value at the first configuration pin CC1 is less than or equal to the first voltage threshold (Vcc_set1) and the second voltage value at the first auxiliary communication pin SBU1 is less than or equal to the third voltage threshold (Vsbu);
[0184] and / or,
[0185] The fourth preset condition includes: the second voltage value at the second configuration pin CC2 is less than or equal to the second voltage threshold (Vcc_set2) and the second voltage value at the second auxiliary communication pin SBU2 is less than or equal to the third voltage threshold (Vsbu).
[0186] In one embodiment, the second voltage value detection module is further configured to, in response to determining that the second voltage value does not satisfy the fourth preset condition, execute the step of detecting the second voltage value of each of the second pins of the USB Type-C port.
[0187] In one embodiment, the device further comprises:
[0188] The first pop-up window generating module is used to generate a first pop-up window containing reminder information of the liquid inflow event in response to detecting the event of liquid inflow into the USB Type-C port.
[0189] In one embodiment, the method further comprises:
[0190] In response to detecting the event of liquid disappearance at the USB Type-C port, a second pop-up window containing reminder information of liquid disappearance is generated. It should be noted that the device embodiment shown in this embodiment matches the content of the above method embodiment, and the content of the above method embodiment can be referred to, and will not be repeated here.
[0191] Fig.10 1 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 1000 may be a smart phone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0192] Reference Fig.10 The electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , a communication component 1016 , and an image acquisition component 1018 .
[0193] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute computer programs. In addition, the processing component 1002 may include one or more modules to facilitate interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate interaction between the multimedia component 1008 and the processing component 1002. In an example, the processor 1020 may implement the scheme of the above method.
[0194] The memory 1004 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include computer programs for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may 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.
[0195] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1000. The power supply component 1006 may include a power supply chip, and the controller may communicate with the power supply chip to control the power supply chip to turn on or off the first switching device, so that the battery supplies power to the mainboard circuit or does not supply power.
[0196] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the target object.
[0197] 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 information from a target object. 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 a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0198] The audio component 1010 is configured to output and / or input audio file information. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive external audio file information. The received audio file information can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio file information.
[0199] The I / O interface 1012 provides an interface between the processing component 1002 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc.
[0200] The sensor component 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor component 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display screen and keypad of the electronic device 1000, and the sensor component 1014 can also detect the position change of the electronic device 1000 or a component, the presence or absence of contact between the target object and the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. In this example, the sensor component 1014 can include a magnetic sensor, a gyroscope, and a magnetic field sensor, and can also include an inertial sensor, an image sensor, etc., wherein the magnetic field sensor includes at least one of the following: a Hall sensor, a thin film magnetoresistive sensor, and a magnetic liquid acceleration sensor.
[0201] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 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.
[0202] In an exemplary embodiment, the electronic device 1000 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.
[0203] In an exemplary embodiment, the present disclosure also provides a non-transitory computer-readable storage medium, and when an executable computer program in the storage medium is executed by a processor, the above-mentioned method can be implemented.
[0204] In an exemplary embodiment, a chip is also provided, the chip including a processor and an interface for reading a computer program through the interface to implement the above method. The chip may be a conventional CPU (central processing unit) chip, a GPU (graphics processing unit) chip, etc., or an acceleration chip dedicated to artificial intelligence technology, such as an AI (Artificial Intelligence) accelerator, etc.
[0205] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations 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 description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0206] 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. An electronic device, characterized in that: include: Processor, USB Type-C port and detection circuit; The detection circuit is used to detect the resistance value of the first pin and / or the voltage value of the second pin in the USB Type-C port; The processor is used to determine whether liquid has entered the USB Type-C port according to the resistance value or the voltage value.
2. The electronic device according to claim 1, characterized in that: The detection circuit includes a power switch, multiple groups of detection switches and an ADC sampler; The first end of the power switch is electrically connected to the target power supply, and the second end of the power switch is electrically connected to the second end of each detection switch and the input end of the ADC sampler respectively; each of the first pins is electrically connected to the first end of each detection switch in turn; The control end of the ADC sampler, the control end of each detection switch and the control end of the power switch are electrically connected to the processor respectively.
3. The electronic device according to claim 2, characterized in that: The detection circuit is used in conjunction with the ground pin in the USB Type-C port to detect the resistance value of the first pin in the second state.
4. The electronic device according to claim 3, characterized in that: The first pin includes at least one pin of the A-side or B-side pins of the USB Type-C port except a ground pin.
5. The electronic device according to claim 2, characterized in that: The detection circuit is used in conjunction with a power pin in the USB Type-C port to detect a voltage value of the second pin in a first state; The first state refers to a state in which the USB Type-C port of the electronic device is connected to an external device, and the second state refers to a state in which the USB Type-C port of the electronic device is not connected to an external device.
6. The electronic device according to claim 5, characterized in that: The second pin includes at least one pin of the A-side or B-side pins of the USB Type-C port except a ground pin.
7. A liquid inlet detection method, characterized in that: The method comprises: Obtaining a connection state of a USB Type-C port; the connection state includes a first state in which the port is connected to an external device and a second state in which the port is not connected to the external device; In response to determining that the connection state is the second state, determining whether liquid has entered the port according to a resistance value of the first pin of the USB Type-C port; In response to determining that the connection state is the first state, determining whether liquid has entered the port according to a voltage value of a second pin of the USB Type-C port.
8. The method according to claim 7, characterized in that The method further comprises: In response to detecting that liquid has entered the USB Type-C port, a first pop-up window containing reminder information of the liquid ingress event is generated.
9. The method according to claim 7, characterized in that: The method further comprises: In response to detecting the event of liquid disappearance at the USB Type-C port, a second pop-up window containing reminder information of liquid disappearance is generated.
10. A liquid inlet detection device, characterized in that: The device comprises: A voltage value acquisition module, used to acquire a connection state of the USB Type-C port; the connection state includes a first state where the port is connected to an external device and a second state where the port is not connected to the external device; a liquid inflow event acquisition module, configured to determine, in response to determining that the connection state is the second state, whether a liquid inflow event has occurred in the port according to a resistance value of the first pin of the USB Type-C port; The liquid inflow event acquisition module is also used to determine whether the port has liquid inflow according to the voltage value of the second pin of the USB Type-C port in response to determining that the connection state is the first state.
11. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a computer program executable by the processor; The processor is configured to execute the computer program in the memory to implement the method according to any one of claims 7 to 9.
12. A non-transitory computer-readable storage medium, characterized in that: When the executable computer program in the storage medium is executed by a processor, the method according to any one of claims 7 to 9 can be implemented.