CN116073458A - Adapter unplugging detection method and device, storage medium and electronic equipment - Google Patents

Adapter unplugging detection method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116073458A
CN116073458A CN202111290472.1A CN202111290472A CN116073458A CN 116073458 A CN116073458 A CN 116073458A CN 202111290472 A CN202111290472 A CN 202111290472A CN 116073458 A CN116073458 A CN 116073458A
Authority
CN
China
Prior art keywords
adapter
output voltage
input voltage
battery
voltage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111290472.1A
Other languages
Chinese (zh)
Inventor
杨波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111290472.1A priority Critical patent/CN116073458A/en
Publication of CN116073458A publication Critical patent/CN116073458A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0029Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
    • H02J7/0036Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits using connection detecting circuits
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/007Regulation of charging or discharging current or voltage
    • H02J7/00712Regulation of charging or discharging current or voltage the cycle being controlled or terminated in response to electric parameters
    • H02J7/007182Regulation of charging or discharging current or voltage the cycle being controlled or terminated in response to electric parameters in response to battery voltage
    • H02J7/007186Regulation of charging or discharging current or voltage the cycle being controlled or terminated in response to electric parameters in response to battery voltage obtained with the battery disconnected from the charge or discharge circuit
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The disclosure provides an adapter pull-out detection method, an adapter pull-out detection device, a computer readable storage medium and electronic equipment, and relates to the technical field of terminal charging. The adapter unplugging detection method comprises the following steps: reading a first input voltage of the terminal device and a first output voltage of the adapter when a first discharge time of the battery is longer than a first predetermined time under the condition that the battery of the terminal device is not charged; controlling the charging process to stop, and increasing the output voltage of the adapter from the first output voltage to the second output voltage; delaying 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 is pulled out under the condition that the first input voltage is larger than or equal to the second input voltage. The present disclosure may enable the withdrawal detection of an adapter on a cost-effective basis.

Description

Adapter unplugging detection method and device, storage medium and electronic equipment
Technical Field
The disclosure relates to the technical field of terminal charging, in particular to an adapter pull-out detection method, an adapter pull-out detection device, a computer readable storage medium and electronic equipment.
Background
To avoid the problem that the interface still has the charging icon after the adapter is pulled out, a detection circuit may be added to detect whether the adapter is pulled out, such as adding a series current detection resistor, a differential high-precision operational amplifier, an ADC (Analog-to-Digital Converter) port, and the like. However, this approach increases design costs and may take up space on the PCB (Printed Circuit Board ).
Disclosure of Invention
The disclosure provides an adapter pull-out detection method, an adapter pull-out detection device, a computer readable storage medium and an electronic device, and further solves the problems that the adapter pull-out detection cost is high and the PCB space is occupied to at least a certain extent.
According to a first aspect of the present disclosure, there is provided an adapter pull-out detection method including: reading a first input voltage of the terminal device and a first output voltage of the adapter when a first discharge time of the battery is longer than a first predetermined time under the condition that the battery of the terminal device is not charged; controlling the charging process to stop, and increasing the output voltage of the adapter from the first output voltage to the second output voltage; delaying 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 is pulled out under the condition that the first input voltage is larger than or equal to the second input voltage.
According to a second aspect of the present disclosure, there is provided an adapter extracting detection apparatus including: the first voltage reading module is used for reading a first input voltage of the terminal equipment and a first output voltage of the adapter when the primary discharging time of the battery is longer than a first preset time under the condition that the battery of the terminal equipment is not charged; the charging control module is used for controlling the charging process to stop; the boost module is used for boosting the output voltage of the adapter from the first output voltage to the second output voltage; a second voltage reading module for delaying a second predetermined time, reading a second input voltage of the terminal device; the detection result determining module is used for comparing the first input voltage with the second input voltage, and determining that the adapter is pulled out under the condition that the first input voltage is larger than or equal to the second input voltage.
According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the adapter pull-out detection method described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising a processor; and the memory is used for storing one or more programs, and when the one or more programs are executed by the processor, the processor is enabled to realize the adapter unplugging detection method.
In some embodiments of the present disclosure, when a battery of a terminal device is not charged and a time period of one discharge of the battery is longer than a first predetermined time, a first input voltage of the terminal device and a second output voltage of an adapter are read, charging is controlled to stop, 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, the first input voltage is compared with the second input voltage, and it is determined that the adapter is pulled out under the condition that the first input voltage is greater than or equal to the second input voltage. On one hand, the scheme can realize the detection of whether the adapter is pulled out without modifying hardware, saves cost and PCB space, has simple implementation and strong universality, and is suitable for various types of terminal equipment; on the other hand, in view of the scheme of the present disclosure, whether the adapter is pulled out or not can be detected in time, and on the basis of the result, the display of the charging icon can be controlled in time, so that the problem that the charging icon still appears on the interface when the adapter is pulled out is solved, and the user experience is improved; on the other hand, under the condition that the continuous discharge of the battery is determined, the method still needs to be combined with the adjustment of the output voltage of the adapter to further judge whether the adapter is pulled out or not, and the method does not directly depend on the discharge to judge, so that the possible condition that the battery is charged while being used and the discharge is possibly caused is considered, misjudgment is avoided, and the detection accuracy is high.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort. In the drawings:
FIG. 1 illustrates a schematic diagram of a system architecture of an adapter unplugging scheme of an embodiment of the present disclosure;
FIG. 2 illustrates a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure;
FIG. 3 schematically illustrates a flow chart of an adapter pull-out detection method according to an exemplary embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of an overall process of adapter unplug detection in an embodiment of the disclosure;
fig. 5 schematically illustrates a block diagram of an adapter unplugging detection device according to an exemplary embodiment of the present disclosure;
fig. 6 schematically illustrates a block diagram of an adapter pull-out detection apparatus according to another exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only and not necessarily all steps are included. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations. In addition, all of the following terms "first," "second," are used for distinguishing purposes only and should not be taken as a limitation of the present disclosure.
The direct charging disclosed by the disclosure means that the output of the adapter is directly connected with the battery of the charged terminal equipment, power conversion is not needed in the middle, and the charging efficiency is high and the heating is small.
The terminal equipment cannot acquire accurate adapter state information through protocol communication, a current detection circuit needs to be added on an adapter output loop, and whether the adapter is pulled out or not is judged through the current flowing into the terminal equipment by the adapter.
On the one hand, adding the current detection circuit increases the design cost and occupies the PCB space. On the other hand, in PD (protocol applied to Power control under USB organization), because there is a communication timeout, a situation may occur in which the adapter has been pulled out but a charging icon is still displayed on the terminal interface, which affects the user experience.
In view of this, a new adapter unplugging detection scheme is needed.
Fig. 1 shows a schematic diagram of a system architecture of an adapter unplugging scheme of an embodiment of the present disclosure.
Referring to fig. 1, a terminal device 11 is connected to an adapter 12. The terminal device 11 may communicate data with the adapter 12 via a common protocol. The terminal device 11 may be any device equipped with a secondary battery power supply function, including, but not limited to, a smart phone, a smart wearable device, a tablet computer, a portable computer, a desktop computer, and the like. In addition, adapter 12 may also be referred to as a charger.
The terminal device 11 comprises, in addition to a battery (not shown), at least a processor 110, a power management module 111, an ADC module 112, a protocol module 113.
In implementing the adapter pull-out detection scheme of the embodiment of the present disclosure, first, in a case where the battery of the terminal device 11 is not charged completely, the power management module 111 may acquire a current value flowing into the battery and transmit the current value to the processor 110.
Next, when the processor 110 determines that the time period of one discharge of the battery is longer than the first predetermined time based on the obtained current value, on the one hand, the ADC module 112 may read the current input voltage of the terminal device 11, and record the current input voltage as the first input voltage; on the other hand, the protocol module 113 may implement data transmission between each other based on a protocol between the terminal device 11 and the adapter 12. Specifically, protocol module 113 can read the current output voltage of adapter 12, denoted as the first output voltage.
Subsequently, the processor 110 may send a control command to control the charging process to stop, i.e., disable charge. And controls the boost of the output voltage of adapter 12 from the first output voltage to the second output voltage.
After the output voltage of the adapter 12 rises to the second output voltage, the current input voltage of the terminal device 11 is read by the ADC module 112 by a Delay (Delay) for a second predetermined time, denoted as the second input voltage.
After knowing the first input voltage and the second input voltage of the terminal device 11, the processor 110 may compare the first input voltage with the second input voltage and determine whether the adapter 12 is pulled out from the power supply based on the comparison result.
Specifically, in the case that the first input voltage is equal to or greater than the second input voltage, it is determined that the adapter 12 has been pulled out; in the event that the first input voltage is less than the second input voltage, it is determined that the adapter 12 is not unplugged.
In addition, in the case where the adapter 12 is not pulled out, the adapter 12 may be continuously controlled to charge the terminal device 11.
Fig. 2 shows a schematic diagram of an electronic device suitable for use in implementing exemplary embodiments of the present disclosure. The terminal device of the exemplary embodiments of the present disclosure may be configured as in the form of fig. 2. It should be noted that the electronic device shown in fig. 2 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present disclosure.
The electronic device of the present disclosure includes at least a processor and a memory for storing one or more programs, which when executed by the processor, enable the processor to implement the adapter pull-out detection method of the exemplary embodiments of the present disclosure.
Specifically, as shown in fig. 2, the electronic device 200 may include: processor 210, internal memory 221, external memory interface 222, universal serial bus (Universal Serial Bus, USB) interface 230, charge 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, headset interface 274, sensor module 280, display screen 290, camera module 291, indicator 292, motor 293, keys 294, and subscriber identity module (Subscriber Identification Module, SIM) card interface 295, and the like. The sensor module 280 may include a depth sensor, a pressure sensor, a gyroscope sensor, a barometric sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
It is to be understood that the structure illustrated in the embodiments of the present disclosure does not constitute a specific limitation on the electronic device 200. In other embodiments of the present disclosure, electronic device 200 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 210 may include one or more processing units such as, for example: the processor 210 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processor, ISP), a controller, a video codec, a digital signal processor (Digital Signal Processor, DSP), a baseband processor, and/or a Neural network processor (Neural-etwork Processing Unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. In addition, a memory may be provided in the processor 210 for storing instructions and data.
The USB interface 230 is an interface conforming to the USB standard specification, and may specifically be a MiniUSB interface, a micro USB interface, a USB type c interface, or the like. The USB interface 230 may be used to connect a charger to charge the electronic device 200, or may be used to transfer data between the electronic device 200 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
The charge management module 240 is configured to receive a charge input from a charger. In some wired charging embodiments, the charge management module 240 may receive a charging input of a wired charger through the USB interface 230. The charging management module 240 may also provide power to the electronic device through the power management module 241 while charging the battery 242.
The power management module 241 is used for connecting the battery 242, the charge management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charge management module 240 and provides power to the processor 210, the internal memory 221, the display 290, the camera module 291, the wireless communication module 260, and the like. The power management module 241 may also be configured to monitor battery capacity, battery cycle times, battery health (leakage, impedance), and other parameters. In other embodiments, the power management module 241 may also be disposed in the processor 210. In other embodiments, the power management module 241 and the charge management module 240 may be disposed in the same device.
Internal memory 221 may be used to store computer executable program code that includes instructions. The internal memory 221 may include a storage program area and a storage data area. The external memory interface 222 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 200.
The present disclosure also provides a computer-readable storage medium that may be included in the electronic device described in the above embodiments; or may exist alone without being incorporated into the electronic device.
The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable storage medium may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The computer-readable storage medium carries one or more programs which, when executed by one of the electronic devices, cause the electronic device to implement the methods described in the embodiments below.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Fig. 3 schematically illustrates a flowchart of an adapter pull-out detection method of an exemplary embodiment of the present disclosure. Referring to fig. 3, the adapter pull-out detection method may include the steps of:
s32, when the battery of the terminal equipment is not charged, and the primary discharging time of the battery is longer than the first preset time, the first input voltage of the terminal equipment and the first output voltage of the adapter are read.
The battery charge completion according to the embodiment of the present disclosure refers to a state in which the battery is fully charged. For example, whether the battery is charged or not may be determined by parameters such as current and voltage of the battery, and the present disclosure does not limit a determination manner of whether the battery is charged or not.
For determining whether the battery is in a discharged state or a charged state, the current value flowing into the battery may be used for determination in the embodiments of the present disclosure.
Specifically, the terminal device may read a current value flowing into the battery through the equipped power management module, and determine whether the battery is in a discharged state according to the current value. When the current value is greater than 0, the battery can be determined to be in a charging state; when the current value is less than 0, it can be determined that the battery is in a discharged state. It should be understood that the terminal device may determine the charge and discharge states of the battery in real time.
The one-time discharge period described in the embodiments of the present disclosure refers to a period in which the battery is in a discharge state only, and in this period, there is no case in which the battery is in a charge state.
In some embodiments of the present disclosure, first, upon detecting that the battery is switched from a charged state to a discharged state, counting is started. Next, in the process of the continuous detection by the terminal device, if the battery is detected to be in a discharged state, the count is incremented by 1. When the counted value is equal to the predetermined threshold value, it may be determined that a time period of one discharge of the battery is longer than the first predetermined time. Wherein the disclosure does not limit 〧 the specific values of the predetermined threshold and the first predetermined time For example, the predetermined threshold may be 2, 3, 4, 5, or the like.
It should be noted that in the counting process, when the battery is detected to be switched from a discharging state to a charging state, the count is cleared.
In other embodiments of the present disclosure, first, upon detecting a battery switch from a charged state to a discharged state, a timer is started. Next, if the batteries are in a discharge state within a first predetermined time after starting the timer, it is determined that a time of one discharge of the batteries is longer than the first predetermined time.
When the primary discharge time of the battery is longer than the first preset time, the current input voltage of the terminal equipment can be read and recorded as the first input voltage. The current output voltage of the adapter is read and recorded as a first output voltage.
It will be appreciated that, in theory, the first input voltage of the terminal device is equal to the first output voltage of the adapter. However, the first output voltage of the adapter is typically slightly greater than the first input voltage of the terminal device due to the unavoidable voltage drop over the connection lines.
Specifically, the first input voltage of the terminal device may be read by an ADC module provided with the terminal device. And reads the first output voltage of the adapter based on the protocol module.
S34, controlling the charging process to stop, and increasing the output voltage of the adapter from the first output voltage to the second output voltage.
After reading the first input voltage of the terminal device and the first output voltage of the adapter, the terminal device may control the charging process to stop, i.e. Disable charging. Specifically, the processor of the terminal device may interact with the charging chip based on the I2C protocol, and implement Disable charging by sending a control command to the charging chip.
After stopping the control charging process, the terminal device may control to increase the output voltage of the adapter from the first output voltage to the second output voltage.
Specifically, the first output voltage may be added to a predetermined voltage to obtain a second output voltage, and the output voltage of the adapter may be adjusted to the second output voltage.
For the determination of the predetermined voltage, two aspects may be combined to consider, on the one hand, the input voltage of the terminal device is obtained through conversion by the ADC module, and since there may be a certain error in the conversion process, the conversion may be smaller than the actual voltage, and this error is recorded as the first error in the disclosure. On the other hand, the output voltage of the adapter is also obtained through conversion of the ADC module, and the error is recorded as a second error. Wherein the first error and the second error are both within 1%.
The predetermined voltage is determined based on the first error and the second error. In order to ensure that the voltage after adjustment (second output voltage) is necessarily greater than the voltage before adjustment (first output voltage), a certain margin may be added in consideration of the above-described error.
For example, the predetermined voltage may be configured to be 0.5V.
In addition, the predetermined voltage may be a fixed voltage determined empirically by a developer, and the value of the predetermined voltage is not limited in the present disclosure.
S36, delaying for a second preset time, and reading a second input voltage of the terminal equipment.
After the output voltage of the adapter is raised to the second output voltage, it may be delayed by a second predetermined time, for example, 300ms, and the current input voltage of the terminal device is read again and noted as the second input voltage. In particular, the second input voltage of the terminal device may be read by an ADC module provided with the terminal device.
It will be appreciated that if the adapter has been unplugged, the second input voltage acquired after the delay will not be higher than the first input voltage due to the reverse recharging of the battery.
S38, comparing the first input voltage with the second input voltage, and determining that the adapter is pulled out under the condition that the first input voltage is larger than or equal to the second input voltage.
And if the interface still has the charging icon under the condition that the adapter is pulled out, controlling the charging icon to disappear. For example, the charge icon is disappeared by changing the charge flag bit.
In addition, it is understood that in the event that the first input voltage is less than the second input voltage, it may be determined that the adapter is not unplugged.
And under the condition that the adapter is not pulled out, the terminal equipment can control the charging process to start, namely the Enable charging. Specifically, the processor of the terminal device may send a charging start command to the charging chip based on the I2C protocol to implement Enable charging.
In addition, the terminal device may reduce the output voltage of the adapter from the second input voltage to the first output voltage. I.e., returning to the original charging output voltage, and continuing the charging.
Fig. 4 schematically shows a flowchart of the entire process of adapter pull-out detection of an embodiment of the present disclosure.
In step S402, the terminal device performs PPS direct charging, and counts count=0.
In step S404, the terminal device determines whether the charging is completed, that is, whether the battery is full. If the charging is completed, the flow ends. If the charging is not completed, step S406 is performed.
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, indicating that the battery is in a charged state, returning to step S402; if I is less than 0, it indicates that the battery is in a discharged state, and step S408 is performed. It can be understood that in the case where the terminal device is turned on, there is almost no case where i=0.
In step S408, count+1 is counted.
In step S410, it is determined whether the Count is greater than 2. If greater than 2, then step S412 is performed; if not greater than 2, the process returns to step S402.
In step S412, the first input voltage Vbus1 of the terminal device and the first output voltage Vcv1 of the adapter are read.
In step S414, the terminal device controls the charging process to stop, and raises the output voltage of the adapter to the second output voltage Vcv2.
In step S416, after a delay of 300ms, the second input voltage Vbus2 of the terminal device is read.
In step S418, the terminal device determines that the adapter has been pulled out when the magnitude relation between the second input voltage Vbus2 and the first input voltage Vbus1 is determined and the second input voltage Vbus2 is less than or equal to the first input voltage Vbus 1; if the second input voltage Vbus2 is greater than the first input voltage Vbus1, it is determined that the adapter is not pulled out, and step S420 is performed.
In step S420, the terminal device controls the charging process to start.
In step S422, the terminal device may control to decrease the output voltage of the adapter to the first output voltage Vcv1, and return to step S402 to continue charging.
According to the adapter explosion detection scheme based on the embodiment of the disclosure, on one hand, the detection of whether the adapter is pulled out or not can be realized without modifying hardware, so that the cost and the PCB space are saved, and meanwhile, the scheme is simple to implement, has strong universality and is suitable for various types of terminal equipment; on the other hand, in view of the scheme of the present disclosure, whether the adapter is pulled out or not can be detected in time, and on the basis of the result, the display of the charging icon can be controlled in time, so that the problem that the charging icon still appears on the interface when the adapter is pulled out is solved, and the user experience is improved; on the other hand, under the condition that the continuous discharge of the battery is determined, the method still combines the adjustment of the output voltage of the adapter to further judge whether the adapter is pulled out or not, and the method does not directly depend on the discharge to judge, so that the possible condition that the battery is charged while being used and the discharge is possibly caused is considered, the misjudgment is avoided, and the detection accuracy is high.
It should be noted that although the steps of the methods in the present disclosure are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
Further, in this example embodiment, an adapter pull-out detection apparatus is also provided.
Fig. 5 schematically illustrates a block diagram of an adapter pull-out detection apparatus of an exemplary embodiment of the present disclosure. Referring to fig. 5, the adapter pull-out detection apparatus 5 according to an exemplary embodiment of the present disclosure may include a first voltage reading module 51, a charge control module 53, a boosting module 55, a second voltage reading module 57, and a detection result determining module 59.
Specifically, the first voltage reading module 51 may be configured to read, when a time period of one discharge of the battery is longer than a first predetermined time, a first input voltage of the terminal device and a first output voltage of the adapter in a case where the battery of the terminal device is not charged; the charge control module 53 may be used to control the stopping of the charging process; the boost module 55 may be used to boost the output voltage of the adapter from a first output voltage to a second output voltage; the second voltage reading module 57 may be configured to delay a second predetermined time, and read a second input voltage of the terminal device; the detection result determining module 59 may be configured to compare the first input voltage with the second input voltage, and determine that the adapter has been pulled out when the first input voltage is greater than or equal to the second input voltage.
According to an exemplary embodiment of the present disclosure, the first voltage reading module 51 may be further configured to perform: reading a value of current flowing into the battery; when the current value is greater than 0, determining that the battery is in a charging state; when the current value is smaller than 0, the battery is determined to be in a discharging state.
According to an exemplary embodiment of the present disclosure, the first voltage reading module 51 may be further configured to perform: when the battery is detected to be switched from a charging state to a discharging state, starting counting; in the continuous detection process, if the battery is detected to be in a discharging state, the count is increased by 1; when the counted value is equal to a preset threshold value, determining that the primary discharge time of the battery is longer than a first preset time; in the counting process, when the battery is detected to be switched from a discharging state to a charging state, the counting is cleared.
According to an exemplary embodiment of the present disclosure, the first voltage reading module 51 may be further configured to perform: when the battery is detected to be switched from a charging state to a discharging state, starting timing; if the batteries are in a discharging state within a first preset time after starting timing, determining that the primary discharging time of the batteries is longer than the first preset time.
According to an example embodiment of the present disclosure, the boost module 55 may be configured to perform: adding the first output voltage to a preset voltage to obtain a second output voltage; adjusting the output voltage of the adapter to a second output voltage; wherein the predetermined voltage is determined based on a first error generated during voltage conversion within the terminal device and a second error generated during voltage conversion within the adapter.
According to an example embodiment of the present disclosure, detection result determination module 59 may be further configured to perform: and under the condition that the first input voltage is smaller than the second input voltage, determining that the adapter is not pulled out, and controlling the charging process to start.
According to an exemplary embodiment of the present disclosure, referring to fig. 6, the adapter pull-out detection apparatus 6 may further include a step-down module 61, as compared to the adapter pull-out detection apparatus 5.
Specifically, the buck module 61 may be configured to perform: in the case of controlling the start of the charging process, the output voltage of the adapter is reduced from the second output voltage to the first output voltage.
Since each functional module of the adapter extracting detection device according to the embodiment of the present disclosure is the same as that in the above-described method embodiment, a detailed description thereof will be omitted.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are only schematic illustrations of processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. An adapter pull-out detection method, comprising:
reading a first input voltage of a terminal device and a first output voltage of an adapter when a primary discharge time of a battery of the terminal device is longer than a first preset time under the condition that the battery of the terminal device is not charged;
controlling a 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 equipment;
comparing the first input voltage with the second input voltage, and determining that the adapter is pulled out under the condition that the first input voltage is larger than or equal to the second input voltage.
2. The adapter pull-out detection method according to claim 1, wherein the adapter pull-out detection method further comprises:
reading a value of current flowing into the battery;
when the current value is greater than 0, determining that the battery is in a charging state;
and when the current value is smaller than 0, determining that the battery is in a discharging state.
3. The adapter pull-out detection method according to claim 2, characterized in that the adapter pull-out detection method further comprises:
when the battery is detected to be switched from a charging state to a discharging state, starting counting;
in the continuous detection process, if the battery is detected to be in a discharge state, the count is increased by 1;
when the counted value is equal to a preset threshold value, determining that the primary discharge time of the battery is longer than a first preset time;
and in the counting process, when the battery is detected to be switched from a discharging state to a charging state, the counting is cleared.
4. The adapter pull-out detection method according to claim 2, characterized in that the adapter pull-out detection method further comprises:
when the battery is detected to be switched from a charging state to a discharging state, starting timing;
and if the batteries are in a discharging state within the first preset time after starting timing, determining that the primary discharging time of the batteries is longer than the first preset time.
5. The adapter pull-out detection method according to claim 1, wherein increasing the output voltage of the adapter from the first output voltage to a second output voltage comprises:
adding the first output voltage to a preset voltage to obtain the second output voltage;
adjusting an 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.
6. The adapter pull-out detection method according to any one of claims 1 to 5, characterized in that the adapter pull-out detection method further comprises:
and under the condition that the first input voltage is smaller than the second input voltage, determining that the adapter is not pulled out, and controlling the charging process to start.
7. The adapter pull-out detection method according to claim 6, wherein the adapter pull-out detection method further comprises:
in the case of controlling the start of the charging process, the output voltage of the adapter is reduced from the second output voltage to the first output voltage.
8. An adapter withdrawal detection device, comprising:
a first voltage reading module, configured to read a first input voltage of a terminal device and a first output voltage of an adapter when a primary discharge time of a battery of the terminal device is longer than a first predetermined time, in a case where charging of the battery is not completed;
the charging control module is used for controlling the charging process to stop;
a boost module for boosting an output voltage of the adapter from the first output voltage to a second output voltage;
a second voltage reading module for delaying a second predetermined time and reading a second input voltage of the terminal device;
the detection result determining module is used for comparing the first input voltage with the second input voltage, and determining that the adapter is pulled out under the condition that the first input voltage is larger than or equal to the second input voltage.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the adapter pull-out detection method according to any one of claims 1 to 7.
10. An electronic device, comprising:
a processor;
a memory for storing one or more programs that, when executed by the processor, cause the processor to implement the adapter pull-out detection method of any of claims 1-7.
CN202111290472.1A 2021-11-02 2021-11-02 Adapter unplugging detection method and device, storage medium and electronic equipment Pending CN116073458A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111290472.1A CN116073458A (en) 2021-11-02 2021-11-02 Adapter unplugging detection method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111290472.1A CN116073458A (en) 2021-11-02 2021-11-02 Adapter unplugging detection method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116073458A true CN116073458A (en) 2023-05-05

Family

ID=86170369

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111290472.1A Pending CN116073458A (en) 2021-11-02 2021-11-02 Adapter unplugging detection method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116073458A (en)

Similar Documents

Publication Publication Date Title
US9483093B2 (en) Electronic device and method for controlling a setting of a maximum consumption current
CN106291210B (en) USB interface detector, USB interface detection method, USB connector and electronic equipment
US9866055B2 (en) Automatic scheme to detect multi-standard charger types
US20160336779A1 (en) Charging Method, Alternating Current Adaptor, Charging Management Device and Terminal
JP7121865B2 (en) Reverse charging device, method and device for adjusting reverse charging current
CN110829523B (en) Electronic equipment and reverse charging method
CN102694400B (en) Imput output circuit
US9312576B2 (en) Portable electronic devices capable of obtaining charging current value of charger and charging method thereof
US7930463B2 (en) Information processing apparatus
CN109378877B (en) Charging circuit, charging processing method, electronic device, and storage medium
CN114859258B (en) Electricity meter and electronic equipment applied to multiple batteries
KR20160105167A (en) Electronic device and method for charging controlling of the electronic device
US10996734B2 (en) Electronic device that receives power from power supply apparatus and method thereof
WO2022218046A1 (en) Battery charging method and electronic device
KR20210014356A (en) Electronic device for preventing damage of usb device and operating method thereof
CN114844182B (en) Charging circuit, charging method and electronic equipment
CN114865755B (en) Multi-battery power supply, charging and discharging method and electronic equipment
US10367364B2 (en) Method and apparatus for powering mobile device
CN105071484A (en) Charging method and apparatus of terminal having data exchange function
CN107329520B (en) USB interface connection method, device and system of mobile terminal
CN109286219B (en) Charging circuit, charging processing method, electronic device, and storage medium
CN113572210A (en) Charging method, device, equipment and storage medium
CN113013934A (en) Electronic equipment, electronic device and charging method
CN116073458A (en) Adapter unplugging detection method and device, storage medium and electronic equipment
CN113030794A (en) Device detection method and device, computer readable medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination