Adapter pull-out detection method and apparatus, storage medium, and electronic device

By reading and comparing the input and output voltages when the terminal device's battery is not fully charged, the problem of the charging icon still being displayed on the interface after the adapter is unplugged is solved. This method achieves efficient and accurate adapter unplugging detection, improves user experience, and saves cost and space.

CN116073458BActive Publication Date: 2026-04-28GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2021-11-02
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the charging icon remains on the interface even after the adapter is unplugged, which degrades the user experience and increases design costs and PCB space usage.

Method used

When the battery of the terminal device is not fully charged and the duration of a single discharge of the battery exceeds a first predetermined time, the input voltage of the terminal device and the output voltage of the adapter are read, the charging process is stopped, and the output voltage of the adapter is increased to a second output voltage before the input voltage of the terminal device is read again for comparison to determine whether the adapter is unplugged.

Benefits of technology

It enables adapter unplug detection without hardware modification, saving costs and PCB space, while improving detection accuracy and user experience, and avoiding false positives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116073458B_ABST
    Figure CN116073458B_ABST
Patent Text Reader

Abstract

The present disclosure provides an adapter pull-out detection method, an adapter pull-out detection device, a computer readable storage medium and an electronic device, and relates to the technical field of terminal charging. The adapter pull-out detection method comprises the following steps: in the case that the battery of a terminal device is not charged completely, reading a first input voltage of the terminal device and a first output voltage of an adapter when the one-time discharge duration of the battery is greater than a first predetermined time; controlling the charging process to stop, and increasing the output voltage of the adapter from the first output voltage to a second output voltage; delaying for a second predetermined time, and reading a second input voltage of the terminal device; comparing the first input voltage with the second input voltage, and determining that the adapter has been pulled out in the case that the first input voltage is greater than or equal to the second input voltage. The present disclosure can realize the pull-out detection of the adapter on the basis of saving cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of terminal charging technology, and more specifically, to an adapter unplugging detection method, an adapter unplugging detection device, a computer-readable storage medium, and an electronic device. Background Technology

[0002] To avoid the charging icon remaining on the screen after the adapter is unplugged, a detection circuit can be added to check if the adapter is unplugged. This could be achieved by adding a series current-sensing resistor, a differential high-precision operational amplifier, or an ADC (Analog-to-Digital Converter) port. However, this approach increases design costs and occupies PCB (Printed Circuit Board) space. Summary of the Invention

[0003] This disclosure provides an adapter unplugging detection method, an adapter unplugging detection device, a computer-readable storage medium, and an electronic device, thereby overcoming, at least to some extent, the problems of high cost and PCB space occupation in adapter unplugging detection.

[0004] According to a first aspect of this disclosure, an adapter unplugging detection method is provided, comprising: when the battery of a terminal device is not fully charged, and when a single discharge duration of the battery is longer than a first predetermined time, reading a first input voltage of the terminal device and a first output voltage of the adapter; controlling the charging process to stop, and increasing the output voltage of the adapter from the first output voltage to a second output voltage; delaying for a second predetermined time, and reading a second input voltage of the terminal device; comparing the first input voltage with the second input voltage, and determining that the adapter has been unplugged if the first input voltage is greater than or equal to the second input voltage.

[0005] According to a second aspect of this disclosure, an adapter unplugging detection device is provided, comprising: a first voltage reading module, configured to read a first input voltage of the terminal device and a first output voltage of the adapter when the battery discharge duration is longer than a first predetermined time, provided that the battery of the terminal device has not been fully charged; a charging control module, configured to control the charging process to stop; a boost module, configured to boost the output voltage of the adapter from the first output voltage to a second output voltage; a second voltage reading module, configured to read a second input voltage of the terminal device after a second predetermined time delay; and a detection result determination module, configured to compare the first input voltage with the second input voltage, and determine that the adapter has been unplugged if the first input voltage is greater than or equal to the second input voltage.

[0006] According to a third aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the adapter unplugging detection method described above.

[0007] According to a fourth aspect of this disclosure, an electronic device is provided, including a processor; and a memory for storing one or more programs, which, when executed by the processor, cause the processor to implement the adapter unplug detection method described above.

[0008] In some embodiments of the present disclosure, when the battery of the terminal device is not fully charged and the duration of a single discharge of the battery is longer than a first predetermined time, the first input voltage of the terminal device and the second output voltage of the adapter are read, the charging is stopped, the output voltage of the adapter is increased to the second output voltage, and then the second predetermined time is delayed. The second input voltage of the terminal device is read, and the first input voltage is compared with the second input voltage. If the first input voltage is greater than or equal to the second input voltage, it is determined that the adapter has been unplugged. On the one hand, this disclosed solution can detect whether the adapter is unplugged without modifying the hardware, saving costs and PCB space. The solution is simple to implement, highly versatile, and applicable to various types of terminal devices. On the other hand, since this disclosed solution can detect whether the adapter is unplugged in a timely manner, the display of the charging icon can be controlled accordingly, thus solving the problem of the charging icon still appearing on the interface even when the adapter is unplugged, improving the user experience. Furthermore, even when the battery is determined to be continuously discharging, this disclosed solution still needs to adjust the adapter's output voltage to further determine whether the adapter is unplugged. This method, which does not directly rely on discharge for judgment, considers the possibility of discharge caused by simultaneous charging and use, avoiding misjudgment and achieving high detection accuracy.

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

[0010] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0011] Figure 1 A schematic diagram of the system architecture of the adapter unplugging scheme according to an embodiment of the present disclosure is shown;

[0012] Figure 2 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown;

[0013] Figure 3A flowchart illustrating an adapter unplugging detection method according to an exemplary embodiment of the present disclosure is shown schematically;

[0014] Figure 4 A flowchart illustrating the entire process of adapter unplugging detection according to an embodiment of the present disclosure is shown schematically.

[0015] Figure 5 A block diagram of an adapter unplugging detection device according to an exemplary embodiment of the present disclosure is shown schematically;

[0016] Figure 6 A block diagram of an adapter unplugging detection device according to another exemplary embodiment of the present disclosure is shown schematically. Detailed Implementation

[0017] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0018] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0019] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances. Furthermore, all the terms "first" and "second" used below are for distinction purposes only and should not be construed as limiting the scope of this disclosure.

[0020] The direct charging described in this disclosure refers to the adapter's output being directly connected to the battery of the terminal device being charged, without the need for power conversion in between, resulting in high charging efficiency and low heat generation.

[0021] Since terminal devices cannot obtain accurate adapter status information through protocol communication, a current detection circuit needs to be added to the adapter output circuit to determine whether the adapter has been unplugged based on the current flowing into the terminal device from the adapter.

[0022] On the one hand, adding a current sensing circuit increases design costs and occupies PCB space. On the other hand, in PD (Power Delivery, a protocol used for power control under the USB organization), due to communication timeouts, there may be situations where the adapter is unplugged but the charging icon is still displayed on the terminal interface, affecting the user experience.

[0023] Therefore, a new adapter unplug detection scheme is needed.

[0024] Figure 1 A schematic diagram of the system architecture of the adapter unplugging scheme according to an embodiment of the present disclosure is shown.

[0025] refer to Figure 1 Terminal device 11 is connected to adapter 12. Terminal device 11 can transmit data with adapter 12 via a common protocol. Terminal device 11 can be any device equipped with a rechargeable battery, including but not limited to smartphones, smart wearable devices, tablets, laptops, and desktop computers. Adapter 12 can also be referred to as a charger.

[0026] In addition to a battery (not shown), the terminal device 11 also includes at least a processor 110, a power management module 111, an ADC module 112, and a protocol module 113.

[0027] In implementing the adapter unplug detection scheme of this disclosure, firstly, when the battery of the terminal device 11 is not fully charged, the power management module 111 can obtain the current value flowing into the battery and send the current value to the processor 110.

[0028] Next, when the processor 110 determines, based on the acquired current value, that the duration of a single battery discharge exceeds a first predetermined time, on the one hand, the ADC module 112 can read the current input voltage of the terminal device 11, denoted as the first input voltage; on the other hand, the protocol module 113 can realize data transmission between the terminal device 11 and the adapter 12 based on the protocol between them. Specifically, the protocol module 113 can read the current output voltage of the adapter 12, denoted as the first output voltage.

[0029] Subsequently, the processor 110 can send a control command to stop the charging process, i.e., disable charge. It can also control the output voltage of the adapter 12 to be increased from the first output voltage to the second output voltage.

[0030] After the output voltage of adapter 12 rises to the second output voltage, a second predetermined time is delayed, and the current input voltage of terminal device 11 is read by ADC module 112 and recorded as the second input voltage.

[0031] After obtaining the first input voltage and the second input voltage of the terminal device 11, the processor 110 can compare the first input voltage with the second input voltage and determine whether the adapter 12 is unplugged from the power supply based on the comparison result.

[0032] Specifically, if the first input voltage is greater than or equal to the second input voltage, it is determined that the adapter 12 has been unplugged; if the first input voltage is less than the second input voltage, it is determined that the adapter 12 has not been unplugged.

[0033] Furthermore, even when the adapter 12 is not unplugged, the adapter 12 can continue to charge the terminal device 11.

[0034] Figure 2 A schematic diagram is shown that is suitable for implementing exemplary embodiments of the present disclosure. The terminal device of the exemplary embodiments of the present disclosure can be configured as follows: Figure 2 In the form of. It should be noted that, Figure 2 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0035] The electronic device disclosed herein includes at least a processor and a memory, the memory being used to store one or more programs, which, when executed by the processor, enable the processor to implement the adapter unplug detection method of the exemplary embodiments of this disclosure.

[0036] Specifically, such as Figure 2As shown, the electronic device 200 may include: a processor 210, internal memory 221, external memory interface 222, Universal Serial Bus (USB) interface 230, charging management module 240, power management module 241, battery 242, antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 271, receiver 272, microphone 273, headphone jack 274, sensor module 280, display screen 290, camera module 291, indicator 292, motor 293, buttons 294, and a Subscriber Identification Module (SIM) card interface 295, etc. The sensor module 280 may include depth sensors, pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors, etc.

[0037] It is understood that the structures illustrated in the embodiments of this disclosure do not constitute a specific limitation on the electronic device 200. In other embodiments of this disclosure, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0038] Processor 210 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. Additionally, processor 210 may include memory for storing instructions and data.

[0039] USB port 230 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, or USB Type-C port. USB port 230 can be used to connect a charger to charge electronic device 200, and can also be used for data transfer between electronic device 200 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0040] The charging management module 240 receives charging input from the charger. In some wired charging embodiments, the charging management module 240 can receive charging input from the wired charger via the USB interface 230. While charging the battery 242, the charging management module 240 can also supply power to the electronic device via the power management module 241.

[0041] The power management module 241 connects the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, and supplies power to the processor 210, internal memory 221, display screen 290, camera module 291, and wireless communication module 260. The power management module 241 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 241 may be located within the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may be located in the same device.

[0042] Internal memory 221 can be used to store computer executable program code, which includes instructions. Internal memory 221 may include a program storage area and a data storage area. External memory interface 222 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of electronic device 200.

[0043] This disclosure also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device.

[0044] Computer-readable storage media can be, for example—but not limited to—electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0045] A computer-readable storage medium can be sent, propagated, or transmitted for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.

[0046] A computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to perform the methods described in the following embodiments.

[0047] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0048] The units described in the embodiments of this disclosure can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the unit itself.

[0049] Figure 3A flowchart illustrating an exemplary embodiment of the adapter unplugging detection method of this disclosure is shown schematically. (Reference) Figure 3 The adapter unplug detection method may include the following steps:

[0050] S32. If the battery of the terminal device is not fully charged, and the duration of a single discharge of the battery is longer than a first predetermined time, read the first input voltage of the terminal device and the first output voltage of the adapter.

[0051] In this disclosure, "battery charging complete" refers to the state where the battery is fully charged. For example, whether the battery is fully charged can be determined by parameters such as current and voltage. This disclosure does not limit the method for determining whether charging is complete.

[0052] To determine whether a battery is in a discharging or charging state, the current flowing into the battery can be used in this embodiment of the disclosure.

[0053] Specifically, the terminal device can read the current flowing into the battery through its power management module and determine whether the battery is in a discharging state based on the current value. When the current value is greater than 0, the battery is in a charging state; when the current value is less than 0, the battery is in a discharging state. It should be understood that the terminal device can determine the battery's charging and discharging state in real time.

[0054] The discharge duration mentioned in this disclosure refers to the time period during which the battery is only in a discharging state, and during this time period, the battery is not in a charging state.

[0055] In some embodiments of this disclosure, firstly, counting begins when the battery is detected to have switched from a charging state to a discharging state. Next, during continuous monitoring by the terminal device, if the battery is detected to be in a discharging state, the count is incremented by 1. When the count value equals a predetermined threshold, it can be determined that the duration of one discharge cycle of the battery exceeds a first predetermined time. This disclosure does not limit the specific values ​​of the predetermined threshold and the first predetermined time. For example, the predetermined threshold can be 2, 3, 4, or 5, etc.

[0056] It should be noted that during the counting process, the count is reset to zero when the battery is detected to switch from discharging to charging.

[0057] In some other embodiments of this disclosure, firstly, timing begins when the battery is detected to switch from a charging state to a discharging state. Next, if the battery remains in a discharging state for a first predetermined period after the timing begins, it is determined that the duration of one discharge cycle of the battery exceeds the first predetermined time.

[0058] When the battery discharge time exceeds a first predetermined time, the current input voltage of the terminal device can be read and recorded as the first input voltage. The current output voltage of the adapter can also be read and recorded as the first output voltage.

[0059] Understandably, theoretically, the first input voltage of the terminal device should be equal to the first output voltage of the adapter. However, due to unavoidable voltage drops on the connection lines, the first output voltage of the adapter is usually slightly greater than the first input voltage of the terminal device.

[0060] Specifically, the first input voltage of the terminal device can be read through the ADC module equipped on the terminal device, and the first output voltage of the adapter can be read based on the protocol module.

[0061] S34. Control the charging process to stop, and increase the adapter's output voltage from the first output voltage to the second output voltage.

[0062] After reading the first input voltage of the terminal device and the first output voltage of the adapter, the terminal device can control the charging process to stop, i.e., disable charge. Specifically, the terminal device's processor can interact with the charging chip based on the I2C protocol, and achieve the disable charge by sending control commands to the charging chip.

[0063] After the charging process stops, the terminal device can control the adapter's output voltage to increase from the first output voltage to the second output voltage.

[0064] Specifically, the first output voltage can be added to a predetermined voltage to obtain the second output voltage, and the output voltage of the adapter can be adjusted to the second output voltage.

[0065] Regarding the determination of the predetermined voltage, two aspects can be considered. First, the input voltage of the terminal device is obtained through conversion by the ADC module. Due to potential errors in the conversion process, the converted voltage may be lower than the actual voltage; this disclosure refers to this error as the first error. Second, the output voltage of the adapter is also obtained through conversion by the ADC module; this error is referred to as the second error. Both the first and second errors are within the range of 1%.

[0066] The predetermined voltage is determined based on the first and second errors mentioned above. Furthermore, to ensure that the adjusted voltage (second output voltage) is always greater than the original voltage (first output voltage), a certain margin is added, taking into account the aforementioned errors.

[0067] For example, the predetermined voltage can be configured to 0.5V.

[0068] Alternatively, the predetermined voltage can be a fixed voltage determined by the developers based on experience, and this disclosure does not limit its value.

[0069] S36. Delay for a second predetermined time and read the second input voltage of the terminal device.

[0070] After the adapter's output voltage is increased to the second output voltage, a second predetermined time can be delayed, for example, 300ms, before reading the current input voltage of the terminal device, which is recorded as the second input voltage. Specifically, the second input voltage of the terminal device can be read through the ADC module equipped on the terminal device.

[0071] Understandably, if the adapter is unplugged, the second input voltage acquired after the delay will not be higher than the first input voltage due to reverse battery flow.

[0072] S38. Compare the first input voltage with the second input voltage, and determine that the adapter has been unplugged if the first input voltage is greater than or equal to the second input voltage.

[0073] If the charging icon is still present on the screen after confirming that the adapter has been unplugged, the charging icon should be made to disappear. For example, the charging icon can be made to disappear by changing the charging flag.

[0074] Additionally, it is understandable that if the first input voltage is less than the second input voltage, it can be determined that the adapter is not unplugged.

[0075] If the adapter is confirmed to be in place, the terminal device can initiate the charging process, i.e., enable charge. Specifically, the terminal device's processor can send a charging start command to the charging chip based on the I2C protocol to enable charge.

[0076] Additionally, the terminal device can reduce the adapter's output voltage from the second input voltage to the first output voltage. This returns it to the original charging output voltage, allowing charging to continue.

[0077] Figure 4 A flowchart illustrating the entire process of adapter unplugging detection according to an embodiment of the present disclosure is shown.

[0078] In step S402, the terminal device performs PPS direct charging, and the count Count = 0.

[0079] In step S404, the terminal device determines whether charging is complete, that is, whether the battery is fully charged. If charging is complete, the process ends. If charging is not complete, step S406 is executed.

[0080] In step S406, the terminal device determines whether the current I flowing into the battery is greater than 0. If I is greater than 0, it indicates that the battery is in a charging state, and the process returns to step S402; if I is less than 0, it indicates that the battery is in a discharging state, and the process proceeds to step S408. It is understandable that when the terminal device is powered on, the case of I = 0 is almost non-existent.

[0081] In step S408, the count is incremented by 1.

[0082] In step S410, it is determined whether the count Count is greater than 2. If it is greater than 2, then step S412 is executed; otherwise, the process returns to step S402.

[0083] In step S412, the first input voltage Vbus1 of the terminal device and the first output voltage Vcv1 of the adapter are read.

[0084] In step S414, the terminal device controls the charging process to stop and increases the output voltage of the adapter to the second output voltage Vcv2.

[0085] In step S416, after a delay of 300ms, the second input voltage Vbus2 of the terminal device is read.

[0086] In step S418, the terminal device determines the relationship between the second input voltage Vbus2 and the first input voltage Vbus1. If the second input voltage Vbus2 is less than or equal to the first input voltage Vbus1, it determines that the adapter has been unplugged; if the second input voltage Vbus2 is greater than the first input voltage Vbus1, it determines that the adapter has not been unplugged, and then executes step S420.

[0087] In step S420, the terminal device initiates the charging process.

[0088] In step S422, the terminal device can control the adapter's output voltage to be reduced to the first output voltage Vcv1, and return to step S402 to continue charging.

[0089] The adapter unplug detection scheme based on the embodiments of this disclosure has several advantages. First, it eliminates the need for hardware modifications to detect whether the adapter is unplugged, saving costs and PCB space. The scheme is simple to implement, highly versatile, and applicable to various types of terminal devices. Second, since this scheme can detect whether the adapter is unplugged in a timely manner, the display of the charging icon can be controlled accordingly, thus solving the problem of the charging icon still appearing on the interface even when the adapter is unplugged, improving the user experience. Third, even when the battery is determined to be continuously discharging, this scheme further determines whether the adapter is unplugged by adjusting the adapter's output voltage. This method, which does not directly rely on discharge for judgment, considers the possibility of discharge during simultaneous charging and use, avoiding misjudgments and achieving high detection accuracy.

[0090] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0091] Furthermore, this example embodiment also provides an adapter unplugging detection device.

[0092] Figure 5 A block diagram schematically illustrates an adapter unplugging detection device according to an exemplary embodiment of the present disclosure. (Reference) Figure 5 The adapter unplugging detection device 5 according to an exemplary embodiment of the present disclosure may include a first voltage reading module 51, a charging control module 53, a boost module 55, a second voltage reading module 57, and a detection result determination module 59.

[0093] Specifically, the first voltage reading module 51 can be used to read the first input voltage of the terminal device and the first output voltage of the adapter when the battery discharge time of the terminal device is longer than a first predetermined time, provided that the battery of the terminal device has not been fully charged; the charging control module 53 can be used to control the charging process to stop; the boost module 55 can be used to increase the output voltage of the adapter from the first output voltage to the second output voltage; the second voltage reading module 57 can be used to read the second input voltage of the terminal device after a second predetermined time delay; and the detection result determination module 59 can be used to compare the first input voltage with the second input voltage, and determine that the adapter has been unplugged if the first input voltage is greater than or equal to the second input voltage.

[0094] According to an exemplary embodiment of this disclosure, the first voltage reading module 51 may also be configured to perform: reading the current value flowing into the battery; determining that the battery is in a charging state when the current value is greater than 0; and determining that the battery is in a discharging state when the current value is less than 0.

[0095] According to an exemplary embodiment of the present disclosure, the first voltage reading module 51 may also be configured to perform: starting a count when the battery is detected to switch from a charging state to a discharging state; incrementing the count by 1 if the battery is detected to be in a discharging state during continuous detection; and determining that the duration of a single discharge of the battery is greater than a first predetermined time when the count value is equal to a predetermined threshold; wherein, during the counting process, the count is reset to zero when the battery is detected to switch from a discharging state to a charging state.

[0096] According to an exemplary embodiment of this disclosure, the first voltage reading module 51 may also be configured to perform: when the battery is detected to switch from a charging state to a discharging state, start timing; if the battery is in a discharging state for a first predetermined time after the timing starts, determine that the duration of one discharge of the battery is greater than the first predetermined time.

[0097] According to an exemplary embodiment of the present disclosure, the boost module 55 can be configured to perform: adding a first output voltage to a predetermined voltage to obtain a second output voltage; adjusting the output voltage of the adapter to the second output voltage; wherein the predetermined voltage is determined based on a first error generated by a voltage conversion process within the terminal device and a second error generated by a voltage conversion process within the adapter.

[0098] According to an exemplary embodiment of this disclosure, the detection result determination module 59 can also be configured to perform: if the first input voltage is less than the second input voltage, determine that the adapter has not been unplugged, and control the charging process to start.

[0099] According to exemplary embodiments of this disclosure, reference is made to Figure 6 Compared to the adapter unplug detection device 5, the adapter unplug detection device 6 may also include a step-down module 61.

[0100] Specifically, the step-down module 61 can be configured to perform the following: when the charging process is started, reduce the output voltage of the adapter from the second output voltage to the first output voltage.

[0101] Since the various functional modules of the adapter unplugging detection device in this embodiment are the same as those in the above-described method embodiments, they will not be described again here.

[0102] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0103] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0104] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

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

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

Claims

1. A method for detecting adapter unplugging, characterized in that, include: If the battery of the terminal device is not fully charged, and the duration of a single discharge of the battery is longer than a first predetermined time, the first input voltage of the terminal device and the first output voltage of the adapter are read. The charging process is stopped, and the output voltage of the adapter is increased from the first output voltage to the second output voltage. After a second predetermined time delay, read the second input voltage of the terminal device; The first input voltage is compared with the second input voltage. If the first input voltage is greater than or equal to the second input voltage, it is determined that the adapter has been unplugged.

2. The adapter unplugging detection method according to claim 1, characterized in that, The adapter unplug detection method further includes: Read the current value flowing into the battery; When the current value is greater than 0, it is determined that the battery is in a charging state; When the current value is less than 0, it is determined that the battery is in a discharging state.

3. The adapter unplugging detection method according to claim 2, characterized in that, The adapter unplug detection method further includes: When the battery is detected to switch from charging to discharging, counting begins. If the battery is detected to be in a discharged state during continuous monitoring, the count is incremented by 1. When the count value equals a predetermined threshold, it is determined that the duration of a single discharge of the battery is greater than a first predetermined time; During the counting process, when the battery is detected to switch from a discharging state to a charging state, the count is reset to zero.

4. The adapter unplugging detection method according to claim 2, characterized in that, The adapter unplug detection method further includes: When the battery is detected to switch from charging to discharging, the timer starts. If the battery is in a discharging state for the first predetermined time after the start of timing, then it is determined that the duration of one discharge of the battery is greater than the first predetermined time.

5. The adapter unplugging detection method according to claim 1, characterized in that, Increasing the output voltage of the adapter from the first output voltage to the second output voltage includes: The first output voltage is added to the predetermined voltage to obtain the second output voltage; Adjust the output voltage of the adapter to the second output voltage; The predetermined voltage is determined based on a first error generated by the voltage conversion process within the terminal device and a second error generated by the voltage conversion process within the adapter.

6. The adapter unplugging detection method according to any one of claims 1 to 5, characterized in that, The adapter unplug detection method further includes: If the first input voltage is less than the second input voltage, it is determined that the adapter is not unplugged, and the charging process is started.

7. The adapter unplugging detection method according to claim 6, characterized in that, The adapter unplug detection method further includes: When the charging process begins, the output voltage of the adapter is reduced from the second output voltage to the first output voltage.

8. An adapter unplugging detection device, characterized in that, include: The first voltage reading module is used to read the first input voltage of the terminal device and the first output voltage of the adapter when the battery of the terminal device is not fully charged and the discharge time of the battery is longer than a first predetermined time. The charging control module is used to control the charging process to stop. A boost module is used to increase the output voltage of the adapter from the first output voltage to the second output voltage; The second voltage reading module is used to read the second input voltage of the terminal device after a second predetermined time delay; The detection result determination module is used to compare the first input voltage with the second input voltage, and determine that the adapter has been unplugged if the first input voltage is greater than or equal to the second input voltage.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the adapter unplugging detection method as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, include: processor; A memory for storing one or more programs, which, when executed by the processor, cause the processor to implement the adapter unplug detection method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Detection method for plugging and unplugging of charger of mobile terminal and detection system

    CN104836290A

  • Mobile terminal

    CN106026258A