Power supply apparatus, charging method, electronic device, chip system and storage medium

By introducing a power supply device into electronic devices and using pre-set parameters in registers to control the voltage conversion unit, the continuous power supply to peripheral devices is ensured, solving the problem of power failure of peripheral devices and improving the battery life and charging efficiency of electronic devices.

WO2026045374A1PCT designated stage Publication Date: 2026-03-05HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/094456
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-28
Filing Date
2025-05-13
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

When electronic devices are connected to a charger or when the battery is fully charged, peripheral devices are prone to power loss, which can shorten the battery life of electronic devices.

Method used

The power supply device includes a first type and a second type of voltage conversion unit. The first type of voltage conversion unit is controlled to turn on and off by pre-setting parameters in a register, independent of the control of the microcontroller unit (MCU), to ensure continuous power supply to the first type of electrical devices. At the same time, the second type of voltage conversion unit is controlled by the MCU and is used for the conversion of the system power supply voltage and the normal operation of peripheral devices.

Benefits of technology

It reduces the probability of peripheral devices losing power, improves the battery life of electronic devices, avoids unnecessary power consumption caused by MCU malfunctions, and improves charging efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025094456_05032026_PF_FP_ABST
    Figure CN2025094456_05032026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of terminals. Provided in the embodiments are a power supply apparatus, a charging method, an electronic device, a chip system and a storage medium. The power supply apparatus comprises at least one first-type voltage conversion unit, a register, at least one first-type power supply interface and at least one second-type power supply interface. Any first-type power supply interface is connected to any first-type voltage conversion unit, so as to transmit to a first-type electrical device an output voltage of the first-type voltage conversion unit. The first-type electrical device comprises a peripheral device. The second-type power supply interface is connected to a charger or a battery unit of the power supply apparatus, so as to transmit Vsys to an external LDO. The turning on, voltage output and turning off of the first-type voltage conversion unit are all performed according to parameters that are preset in the register for the first-type voltage conversion unit, rather than being controlled by an MCU. Thus, the likelihood of power failure of peripheral devices can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Power supply device, charging method, electronic device, chip system and storage medium

[0001] This application claims priority to Chinese Patent Application No. 202411198907.3, filed on August 28, 2024, entitled "Power Supply Device, Charging Method, Electronic Device, Chip System and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal technology, and in particular to a power supply device, a charging method, an electronic device, a chip system, and a storage medium. Background Technology

[0003] Some electronic devices incorporate a charging management chip (integrated circuit, IC). The charger connected to the electronic device or the battery within the device can power the microcontroller unit (MCU) and peripheral devices on the device via the charging management chip. These peripheral devices can include displays, motors, or sensors, among others.

[0004] However, even when electronic devices are connected to a charger or the battery is fully charged, there are instances where peripheral devices lose power. Summary of the Invention

[0005] This application provides a power supply device, a charging method, an electronic device, a chip system, and a storage medium, applicable to the field of terminal technology. It can reduce the probability of power loss in peripheral devices when the electronic device is connected to a charger or when the battery is fully charged.

[0006] In a first aspect, embodiments of this application propose a power supply device, comprising: at least one first-type voltage conversion unit, a register, at least one first-type power supply interface, and at least one second-type power supply interface. Each first-type power supply interface is connected to each first-type voltage conversion unit and is used to output the output voltage of the first-type voltage conversion unit at the first-type power supply interface. The second-type power supply interface is connected to the power supply of the power supply device and is used to output the system power supply voltage at the second-type power supply interface. A first-type electrical device is connected to the first-type power supply interface, and a second-type voltage conversion unit is connected to the second-type power supply interface. The second-type voltage conversion unit is used to convert the system power supply voltage into the operating voltage of the second-type electrical device, thereby supplying power to the second-type electrical device. The activation, voltage output, and deactivation of the first-type voltage conversion unit are all executed according to parameters pre-set for the first-type voltage conversion unit in the register. The activation and deactivation of the second-type voltage conversion unit are both controlled by a microcontroller unit (MCU).

[0007] In this way, the parameters pre-set for the first type of voltage conversion unit in the register can be default values ​​preset for the first type of voltage conversion unit. The MCU will not change the parameters pre-set for the first type of voltage conversion unit in the register; for example, the parameters pre-set for the first type of voltage conversion unit in the register remain unchanged during MCU startup, reset, restart, and operation. Therefore, the power supply of the first type of power-consuming device is not controlled by the MCU, and MCU malfunctions will not cause the first type of power-consuming device to lose power. This reduces the probability of peripheral devices such as the first type of power-consuming device losing power when the electronic device is connected to the charger or the battery cell has sufficient power. The electronic device may include a power supply device. The second type of power supply interface is connected to the power supply of the power supply device, enabling the output of the system power supply voltage through the second type of power supply interface. The second type of voltage conversion unit connected to the second type of power supply interface can convert the system power supply voltage into the operating voltage of the second type of power-consuming device to power it. The opening and closing of the second type of voltage conversion unit can be controlled by the MCU. In the event of an MCU malfunction, MCU reset can power down the second type of power-consuming device to stop it from working, thereby reducing the power consumption caused by the invalid operation of the second type of power-consuming device and thus reducing the probability of the electronic device having a short battery life.

[0008] In one possible implementation, the parameters pre-set in the register for the first type of voltage conversion unit remain unchanged during MCU startup, restart, and operation.

[0009] In this way, the first type of power-consuming device can remain powered on during MCU startup, reset, restart, and operation, thereby reducing the probability of peripheral devices such as the first type of power-consuming device losing power when the electronic device is connected to the charger or the battery cell has sufficient power.

[0010] In one possible implementation, the first type of voltage conversion unit includes a low-dropout linear regulator (LDO), a buck circuit, or a boost circuit.

[0011] In this way, it is possible to supply power to different types of first-class electrical devices with different operating voltages.

[0012] In one possible implementation, the system further includes a first charging unit. The first charging unit is used to convert the voltage output by the power supply into the system supply voltage and to charge the battery cells. Any first-type voltage conversion unit is connected between the first charging unit and any first-type power supply interface, and a second-type power supply interface is connected to the first charging unit.

[0013] In this way, the first charging unit converts the voltage output by the power supply into the system supply voltage, and the first type of voltage conversion unit can convert the system supply voltage into the operating voltage of the first type of electrical device, thereby powering the first type of electrical device. The first charging unit also outputs the system supply voltage through the second type of power supply interface to power the second type of electrical device.

[0014] In one possible implementation, a second charging unit is also included. During the constant current charging phase, the second charging unit is controlled to provide constant current charging to the battery cell according to the first mode parameters configured in the register, and the first charging unit is controlled to transmit system power supply voltage to the first type voltage conversion unit and the second type power supply interface, respectively. During the constant voltage charging phase, the first charging unit is controlled to provide constant voltage charging to the battery cell according to the second mode parameters configured in the register, and the second charging unit is controlled to be disabled.

[0015] In this way, by configuring the first or second mode parameters in the register, the second charging unit and / or the first charging unit can be controlled, thereby enabling the switching or control of the charging mode. The charging mode can include constant current charging or constant voltage charging. Furthermore, compared to using the first charging unit for both constant current and constant voltage charging stages, using the second charging unit for constant current charging during the constant current charging stage and the first charging unit for constant voltage charging during the constant voltage charging stage can improve the charging efficiency of the electronic device.

[0016] In one possible implementation, an Integrated Circuit Bus (IIC) interface is also included. The first mode parameter is configured in a register as follows: before constant current charging, a first instruction from the MCU is received via the IIC interface, modifying the mode parameter in the register to the first mode parameter. The mode parameter in the register includes charging parameters for one of the multiple charging stages. The second mode parameter is configured in a register as follows: before constant voltage charging, a second instruction from the MCU is received via the IIC interface, modifying the mode parameter in the register to the second mode parameter.

[0017] In this way, the MCU can transmit a first instruction or a second instruction to the power supply device to configure the first mode parameter or the second mode parameter in the register, thereby controlling the second charging unit and / or the first charging unit, and switching or controlling the charging mode.

[0018] In one possible implementation, the system further includes: a power bus interface, a battery voltage interface, a first switching unit, and a second switching unit. The power supply includes a charger or a battery unit. The first switching unit is connected between the power bus interface and a first charging unit, and the second switching unit is connected between the first charging unit and the battery voltage interface. The second charging unit is also connected between the power bus interface and the battery voltage interface. The power bus interface is used to transmit the voltage output by the charger to the first charging unit and / or the second charging unit. The battery voltage interface is used to transmit the voltage output by the first charging unit or the second charging unit to the battery unit, or to transmit the voltage output by the battery unit to the first charging unit. A first mode parameter is used to indicate that the first switching unit is in an on state and the second switching unit is in an off state. A second mode parameter is used to indicate that both the first and second switching units are in an on state.

[0019] Thus, during the constant current charging phase, the first switching unit is in the ON state and the second switching unit is in the OFF state. The first charging unit can output the system supply voltage through the second type of power supply interface and transmit the system supply voltage to any first type of voltage conversion unit. The first charging unit does not charge the battery unit. During the constant voltage charging phase, the second charging unit is disabled, and both the first and second switching units are in the ON state. The first charging unit can not only output the system supply voltage through the second type of power supply interface and transmit the system supply voltage to any first type of voltage conversion unit, but it can also charge the battery unit.

[0020] In one possible implementation, the first charging unit includes a first inductor and a first capacitor. One end of the first inductor is connected to a first switching unit, and the other end of the first inductor is connected to one end of the first capacitor, which is grounded. One end of the second switching unit, one end of the second type power supply interface, and one end of the first type voltage conversion unit are respectively connected between the first inductor and the first capacitor.

[0021] In this way, the first inductor and the first capacitor can form a buck circuit. The first charging unit can convert the voltage output by the power supply to the system supply voltage and output the system supply voltage. For example, it can transmit the system supply voltage to the second type of power supply interface and the first type of voltage conversion unit respectively.

[0022] In one possible implementation, the power supply device includes a first charging unit and a second charging unit, both used to charge the battery cell. The power supply device achieves the target function by: acquiring a first identifier associated with a target sub-function of the target function. The first identifier indicates that the component used to charge the battery cell is the power supply device. The target function is any one of multiple functions related to charging, and the target sub-function is any one of multiple sub-functions of the target function. The device invokes a first intermediate layer interface corresponding to the target sub-function and the first identifier, and a first hardware abstraction layer (HAL) interface corresponding to the first intermediate layer interface, to manipulate registers and control the first charging unit and / or the second charging unit.

[0023] Thus, when the charging component for charging the battery cell in the electronic device includes a power supply device, any one of the multiple functions related to charging can be implemented using the method flow provided in the embodiments of this application.

[0024] In one possible implementation, the power supply device includes a first charging unit and a second charging unit, both used to charge the battery cell. The power supply device achieves the target function by: acquiring a second identifier associated with a first sub-function of the target function; when the second identifier is in a closed state, acquiring a third identifier associated with the first sub-function, where the closed state of the second identifier indicates that the component charging the battery cell does not include the first charging chip, which is independent of the power supply device; when the third identifier associated with the first sub-function is in an open state, controlling the first or second charging unit by calling the second HAL layer interface corresponding to the first sub-function and the third identifier, where the open state of the third identifier indicates that the component charging the battery cell includes the power supply device; acquiring a fourth identifier associated with a second sub-function of the target function; when the fourth identifier is in a closed state, acquiring the third identifier associated with the second sub-function, where the closed state of the fourth identifier indicates that the component charging the battery cell does not include the second charging chip, which is independent of the power supply device. When the third identifier associated with the second sub-function is in the enabled state, the registers are manipulated by calling the third HAL layer interface corresponding to the second sub-function and the third identifier to control the second charging unit or the first charging unit. The target function can be any one of several functions related to charging.

[0025] Thus, when the charging component for charging the battery cell in an electronic device includes a power supply device, any one of the multiple functions related to charging can be implemented using the methods or processes provided in the embodiments of this application.

[0026] Secondly, embodiments of this application provide a charging method applied to an electronic device. The electronic device includes a power supply device, a first charging chip, a second charging chip, and a battery cell, as described in the first aspect or any possible implementation of the first aspect. The method includes: obtaining an identifier associated with a target sub-function of a target function. The identifier associated with the target sub-function is a first identifier, a fifth identifier, or a sixth identifier. The first identifier indicates that the component used to charge the battery cell is a power supply device; the fifth identifier indicates that the component used to charge the battery cell includes the first charging chip; and the sixth identifier indicates that the component used to charge the battery cell includes the second charging chip. Both the first charging chip and the second charging chip are independent of the power supply device. The target function is any one of multiple functions related to charging, and the target sub-function is any one of multiple sub-functions of the target function. When the identifier associated with the target sub-function is the first identifier, the registers of the power supply device are operated by calling the first intermediate layer interface corresponding to the target sub-function and the first identifier, and the first HAL layer interface corresponding to the first intermediate layer interface, to implement the target sub-function. When the identifier associated with the target sub-function is the fifth identifier, the registers of the first charging chip are manipulated by calling the second intermediate layer interface corresponding to the target sub-function and the fifth identifier, as well as the fourth HAL layer interface corresponding to the second intermediate layer interface, to achieve the target sub-function. When the identifier associated with the target sub-function is the sixth identifier, the registers of the second charging chip are manipulated by calling the third intermediate layer interface corresponding to the target function and the sixth identifier, as well as the fifth HAL layer interface corresponding to the third intermediate layer interface, to achieve the target sub-function.

[0027] Thus, the method and flow provided in this application embodiment can be compatible with the charging function of electronic devices that include a power supply device, or a first charging chip and a second charging chip. That is, regardless of whether the charging component on the electronic device that charges the battery cell is a power supply device, or a first charging chip and a second charging chip, the target function can be achieved through the method or flow provided in this application embodiment.

[0028] Thirdly, embodiments of this application provide a charging method applied to an electronic device, the electronic device including a power supply device, a first charging chip, a second charging chip, and a battery cell as described in the first aspect or any possible implementation of the first aspect. The method includes: obtaining a second identifier associated with a first sub-function of a target function; when the second identifier is in an "on" state, operating the register of the first charging chip by calling the sixth HAL layer interface corresponding to the first sub-function and the second identifier, wherein the "on" state of the second identifier indicates that the component charging the battery cell includes the first charging chip; obtaining a third identifier associated with the first sub-function; when the third identifier is in a "off" state, obtaining a fourth identifier associated with a second sub-function of the target function, wherein the "off" state of the third identifier indicates that the component charging the battery cell does not include the power supply device; when the fourth identifier is in an "on" state, operating the register of the second charging chip by calling the seventh HAL layer interface corresponding to the second sub-function and the fourth identifier to implement the target function, wherein the "on" state of the fourth identifier indicates that the component charging the battery cell includes the second charging chip. The target function is any one of multiple functions related to charging.

[0029] Thus, when the charging component for charging the battery cell in an electronic device includes a first charging chip and a second charging chip, the target function can be achieved through the method or process provided in the embodiments of this application.

[0030] Fourthly, embodiments of this application provide an electronic device, which includes one or more processors and a memory. The memory is coupled to one or more processors and is used to store computer program code, which includes computer instructions. The one or more processors invoke the computer instructions to cause the electronic device to perform the methods described in the second aspect, any possible implementation of the second aspect, the third aspect, or any possible implementation of the third aspect.

[0031] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the second aspect, any possible implementation of the second aspect, the third aspect, or any possible implementation of the third aspect.

[0032] In a sixth aspect, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the second aspect, any possible implementation of the second aspect, the third aspect, or any possible implementation of the third aspect.

[0033] Seventhly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform the methods described in the second aspect, any possible implementation of the second aspect, the third aspect, or any possible implementation of the third aspect. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.

[0034] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).

[0035] It should be understood that aspects four through seven of this application correspond to the technical solutions of aspects two or three of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description

[0036] Figure 1 is a circuit diagram of an electronic device provided in an embodiment of this application;

[0037] Figure 2 is another circuit diagram of the electronic device provided in the embodiment of this application;

[0038] Figure 3 is another circuit diagram of the electronic device provided in the embodiment of this application;

[0039] Figure 4 is another circuit diagram of the electronic device provided in the embodiments of this application;

[0040] Figure 5 is a schematic diagram of a software architecture of an electronic device provided in an embodiment of this application;

[0041] Figure 6 is a schematic diagram of another software architecture of the electronic device provided in the embodiments of this application;

[0042] Figure 7 is a schematic diagram of a charging process provided in an embodiment of this application. Detailed Implementation

[0043] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:

[0044] 1. The battery charging process

[0045] Batteries can include nickel-metal hydride batteries, lithium batteries, and graphite batteries. Because lithium batteries have no memory effect, they are used in a variety of handheld devices and portable electronic devices.

[0046] Taking a lithium battery as an example, the charging process can exemplarily include the following four stages:

[0047] Phase 1: Trickle Charging. Phase 1 can be called the trickle charging phase.

[0048] Trickle charging is used to pre-charge (or restore) a fully discharged battery. For example, when the battery voltage is below 3 volts (V), a constant current of up to 0.1 coulombs (C) can be used to charge the battery.

[0049] In this context, the unit of current, C, represents the current ratio during battery charging. 1C equals 1 ampere (A) multiplied by 1 second. C is a method of expressing the battery's nominal capacity relative to the current.

[0050] Phase 2: Constant Current Charging. Phase 2 can be referred to as the constant current charging phase.

[0051] When the battery voltage rises above threshold A, the charging current is increased to perform constant current charging. During the constant current charging phase, the charging current remains constant while the battery voltage gradually increases.

[0052] The constant current charging current can be between 0.2C and 1.0C. The threshold A can be called the trickle charging voltage threshold. The threshold A can also be called the entry voltage for constant current charging. The threshold A can be 3V.

[0053] Stage 3: Constant voltage charging. Stage 3 can be called the constant voltage charging stage.

[0054] When the battery voltage rises to threshold B, constant current charging ends and constant voltage charging begins. During the constant voltage charging phase, the charging voltage remains constant while the charging current gradually decreases.

[0055] Here, threshold B can be called the constant current charging threshold. Threshold B can also be called the entry constant voltage charging voltage. Threshold B can be 4.2V.

[0056] It is understandable that during the constant voltage charging phase, the battery voltage can be equal to the charging voltage of the constant voltage charging phase, and the battery voltage will not be greater than the charging voltage of the constant voltage charging phase.

[0057] Phase 4: Charging terminated. Phase 4 can be referred to as the charging termination phase.

[0058] Charging terminates when the charging current decreases to the threshold Z. Alternatively, charging terminates when the charging current decreases to the current range D. Or, charging terminates from the start of the constant voltage charging phase until the preset duration E is reached. It should be understood that charging termination can indicate that the battery is fully charged.

[0059] Here, the threshold Z can be called the current threshold at which charging ends. The current range D can be called the current range at which charging ends. The threshold Z can be 0.01C or 0.02C. The threshold Z can also be 1 / 10 of the set charging current. The set charging current is a preset value. The set charging current can be 0.5C. The preset duration E can be 1 hour. The current range D can be 0.02C-0.07C.

[0060] In this embodiment of the application, charging termination can be referred to as charging cutoff.

[0061] It is understandable that when charging is completed, the electronic device can display a sign or message indicating that the battery is fully charged; that is, the electronic device displays that the battery is fully charged. This can be referred to as the electronic device displaying a fully charged status.

[0062] 2. Field-effect devices

[0063] Field-effect devices can include field-effect transistors (FETs). FETs can be understood as voltage-controlled devices. The gate-source voltage VFET can be controlled by adjusting the FET's voltage. GS To achieve the drain current I of the field-effect transistor DS Control.

[0064] Field-effect transistors can include junction field-effect transistors (JFETs) and metal-oxide-semiconductor field-effect transistors (MOSFETs). The metal-oxide-semiconductor field-effect transistor is also known as a MOSFET.

[0065] Based on the channel type, field-effect transistors (FETs) can be divided into N-type FETs and P-type FETs. Taking MOSFETs as an example, MOSFETs can include N-type MOSFETs and P-type MOSFETs.

[0066] 3. Other terms

[0067] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.

[0068] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0069] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.

[0070] 4. Electronic equipment

[0071] The electronic devices in this application embodiment may include handheld devices with charging functions, vehicle-mounted devices, etc. For example, some electronic devices include: mobile phones, tablets, PDAs, laptops, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, terminal devices in 5G networks, or future evolution of public land mobile communication networks. Terminal devices in a network (PLMN), etc., are not limited to this in the embodiments of this application.

[0072] By way of example and not limitation, in this embodiment, the electronic device can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not merely hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are feature-rich, large in size, and can achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those that focus on a specific type of application function and require the use of other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0073] Furthermore, in this embodiment of the application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.

[0074] The electronic devices in the embodiments of this application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device, etc.

[0075] In this embodiment, the electronic device or various network devices include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.

[0076] Figure 1 shows a circuit diagram of an electronic device provided in an embodiment of this application.

[0077] As shown in Figure 1, the electronic device may include a switched capacitor (SC) charging IC 101, a buck charging IC 102, a fuel gauge 103, a battery cell 104, at least one external low dropout regulator (LDO) 105, a microcontroller unit (MCU) 106, and at least one peripheral device 107.

[0078] An external LDO can be understood as an LDO independent of the SC charging IC 101 and the buck charging IC 102.

[0079] The external LDO 105 can be LDO1, LDO2, LDO3 or LDO4 as shown in Figure 1.

[0080] Peripheral device 107 can be peripheral device 1, peripheral device 2, peripheral device 3, ..., peripheral device N in Figure 1. N is an integer greater than 0. Peripheral device 107 can be, for example, a display screen, motor, embedded multimedia card (eMMC or EMMC), or sensor of an electronic device.

[0081] The SC charging IC 101 and the buck charging IC 102 can be connected to the battery cell 104 respectively.

[0082] The fuel gauge 103 can be connected between the SC charging IC 101 and the battery cell 104, and can also be connected between the buck charging IC 102 and the battery cell 104.

[0083] Peripheral device 107 can be connected between buck charging IC 102 and MCU 106 or other peripheral devices. For example, LDO1 can be connected between buck charging IC 102 and MCU 106. LDO2 can be connected between buck charging IC 102 and peripheral device 1. LDO3 can be connected between buck charging IC 102 and peripheral device 2. LDO4 can be connected between buck charging IC 102 and peripheral device 3. Peripheral device N can be connected to buck charging IC 102.

[0084] The SC charging IC 101 can fast charge the battery cell 104. For example, during the constant current charging phase, the SC charging IC 101 can fast charge or constant current charge the battery cell 104.

[0085] The buck charging IC 102 can slow charge the battery cell 104. For example, during the constant voltage charging phase, the buck charging IC 102 can slow charge or charge the battery cell 104 at a constant voltage.

[0086] The buck charging IC 102 can also convert the voltage output by the charger (such as Vbus) or the voltage output by the battery cell (such as the battery voltage Vbat) into the system supply voltage (Vsys).

[0087] An external LDO 105 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of the MCU 106 or a peripheral device. For example, LDO1 can convert the system power supply voltage (Vsys) transmitted by the buck charging IC 102 into the power supply voltage of the MCU 106. LDO2 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of peripheral device 1. LDO3 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of peripheral device 2. LDO4 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of peripheral device 3.

[0088] The buck charging IC 102 can also transmit Vsys to peripheral device N, thereby enabling power supply to peripheral device N.

[0089] MCU 106 can control the external LDO 105 to be turned on or off. For example, MCU 106 can transmit GPIO to LDO2, LDO3 and LDO4 through the GPIO interface including GPIO pins to control LDO2, LDO3 and LDO4.

[0090] For example, taking peripheral device 1 as an eMMC, when MCU 106 is not working, MCU 106 can control LDO2 to be in a shutdown state. MCU 106 not working can include MCU 106 starting up, resetting, or restarting.

[0091] When the MCU is operating, LDO2 is either in an enabled or ON state. An ON or ON LDO2 can power the eMMC, allowing the eMMC to function normally. However, if the MCU malfunctions or experiences an anomaly, it will trigger a reset, restoring the GPIO interface to its pre-initialization state. This pre-initialization GPIO interface state, for example, where the GPIO interface does not transmit the ON level to LDO2, effectively turning LDO2 OFF or disabled. It should be understood that in the OFF or disabled state, LDO2 will not power the eMMC, causing the eMMC to lose power or become inoperable.

[0092] When the MCU changes from a working state to an abnormal state, the MCU abnormality will cause the eMMC to lose power. This can occur when the electronic device is connected to the charger or the battery cell has sufficient power, resulting in a power loss of peripheral devices.

[0093] An MCU malfunction causes the eMMC to lose power, preventing the eMMC from saving information that led to the MCU malfunction or the MCU's abnormal state information. This affects the handling or troubleshooting of MCU malfunctions by electronic equipment technicians or MCU engineers. The information that led to the MCU malfunction and / or the MCU's abnormal state information can be referred to as MCU malfunction information.

[0094] In view of this, embodiments of this application provide a power supply device that can be applied to electronic devices. The power supply device may include at least one first-type voltage conversion unit, a register, at least one first-type power supply interface, and at least one second-type power supply interface. Any first-type power supply interface is connected to any first-type voltage conversion unit to transmit the output voltage of the first-type voltage conversion unit to a first-type power-consuming device. The first-type power-consuming device is, for example, an eMMC. The second-type power supply interface is connected to the charger or battery unit of the power supply device to transmit the system power supply voltage (Vsys) to an external LDO. The activation, voltage output, and deactivation of the first-type voltage conversion unit are all performed according to parameters (such as default values) pre-set for the first-type voltage conversion unit in the register. The activation and deactivation of the external LDO are controlled by the MCU. Since the activation and deactivation of the first-type voltage conversion unit operate according to the preset default values ​​in the register, they are not controlled by the MCU. In this way, MCU malfunctions will not affect the on / off state and voltage output of the first type of voltage conversion unit. MCU malfunctions will not cause the eMMC to lose power, which can reduce the probability of peripheral devices losing power when the electronic device is connected to the charger or the battery cell is fully charged.

[0095] The power supply device provided in the embodiments of this application will be described below with reference to some examples.

[0096] Figure 2 shows another circuit diagram of the electronic device provided in an embodiment of this application.

[0097] As shown in Figure 2, the electronic device may include a power supply unit, a fuel gauge 103, a battery cell 104, at least one second-type voltage conversion unit 206, an MCU 207, and at least one peripheral device 107. The power supply unit may include at least one first-type voltage conversion unit 203, a register, at least one first-type power supply interface, and at least one second-type power supply interface.

[0098] Among them, the second type voltage conversion unit 206, for example, the second type voltage conversion unit 1 or the second type voltage conversion unit 2 in FIG2.

[0099] The first type voltage conversion unit 203, for example, the first type voltage conversion unit 1, the first type voltage conversion unit 2, or the first type voltage conversion unit 3 in FIG2.

[0100] For example, the first type of voltage conversion unit 203 may be an LDO, a buck circuit, or a boost circuit.

[0101] The first type of power supply interface, for example, outputs the output voltage V of the first type of voltage conversion unit 1 in Figure 2. boost The interface and output voltage V of the first type voltage conversion unit 2. LDO3 The interface or output of the first type voltage conversion unit 3 output voltage V LDO2 The interface.

[0102] The second type of power supply interface is, for example, the interface in Figure 2 that outputs the system power supply voltage (Vsys).

[0103] The registers of the power supply device are not shown in Figure 2.

[0104] As shown in Figure 2, any first-type power supply interface is connected to any first-type voltage conversion unit to realize the output voltage of the first-type voltage conversion unit output from the first-type power supply interface.

[0105] The first type of power supply interface is connected to a first type of power-consuming device. The first type of power-consuming device can be a peripheral device 107. For example, the first type of power-consuming device can be a peripheral device 107 whose power supply is not controlled by the MCU 207, such as peripheral device 1 (eMMC) or peripheral device 2.

[0106] The activation, voltage output, and deactivation of the first type voltage conversion unit 203 are all performed according to the parameters pre-set for the first type voltage conversion unit 203 in the register.

[0107] In this way, the parameters pre-set for the first type of voltage conversion unit in the register can be the default values ​​preset for the first type of voltage conversion unit. The MCU (such as MCU 207) will not change the parameters pre-set for the first type of voltage conversion unit in the register. For example, the parameters pre-set for the first type of voltage conversion unit in the register remain unchanged during MCU startup, reset, restart, and operation. Therefore, the power supply of the first type of power-consuming device is not controlled by the MCU, and MCU malfunctions will not cause the first type of power-consuming device to lose power. This reduces the probability of peripheral devices such as the first type of power-consuming device losing power when the electronic device is connected to the charger or the battery unit (such as battery unit 104) has sufficient power.

[0108] The second type of power supply interface connects to the power supply of the power supply device, enabling the output of the system power supply voltage through the second type of power supply interface. The power supply of the power supply device can be a charger or battery unit 104.

[0109] The second type of power supply interface is connected to a second type of voltage conversion unit 206. The second type of voltage conversion unit 206 can convert the system power supply voltage into the operating voltage of the second type of electrical device, thereby powering the second type of electrical device. The second type of electrical device can be an MCU 207 or a peripheral device 107.

[0110] For example, the second type of voltage conversion unit 1 can output the operating voltage V of MCU 207. LDO1 This is to power the MCU 207. The second type of voltage conversion unit 2 can output the operating voltage V of the peripheral device 3. LDO4 This is to supply power to peripheral device 3.

[0111] For example, the second type of power-consuming device can be a peripheral device 107 whose power supply is controlled by the MCU 207, such as peripheral device 3. The turning on and the turning off of the second type voltage conversion unit 206 (such as the second type voltage conversion unit 2) can both be controlled by the MCU 207.

[0112] Taking peripheral device 3 as a speed sensor as an example. When MCU 207 malfunctions, it cannot receive or process the information transmitted by the speed sensor; the speed sensor's transmission of information to MCU 207 is therefore invalid. Thus, resetting MCU 207 in case of malfunction causes the speed sensor to lose power, preventing it from working and reducing power consumption caused by the speed sensor's malfunction. This, in turn, reduces the probability of short battery life for electronic devices.

[0113] A fuel gauge 103 can be connected between a charging device and a battery cell 104. A power supply device can charge the battery cell 104. The fuel gauge 103 can monitor the voltage transmitted from the power supply device to the battery cell 104 for charging management. The fuel gauge can also monitor the voltage output from the battery cell 104 for power supply management.

[0114] As shown in Figure 2, in the power supply device provided in this embodiment, any one of the first-type power supply interfaces is connected to any one of the first-type voltage conversion units, enabling the output voltage of the first-type voltage conversion unit to be output from the first-type power supply interface to supply power to the first-type electrical device connected to the first-type power supply interface. The activation, voltage output, and deactivation of the first-type voltage conversion unit are all executed according to parameters pre-set in the register for the first-type voltage conversion unit; that is, the activation, voltage output, and deactivation of the first-type voltage conversion unit are not controlled by the MCU. Thus, the power supply to the first-type electrical device is not controlled by the MCU, and MCU malfunctions will not cause the first-type electrical device to lose power. This reduces the probability of power loss for peripheral devices of the first-type electrical device when the electronic device is connected to a charger or the battery is fully charged.

[0115] In the power supply device provided in this application embodiment, the second type of power supply interface is connected to the power supply of the power supply device, realizing the output of the system power supply voltage through the second type of power supply interface. The second type of voltage conversion unit connected to the second type of power supply interface can convert the system power supply voltage into the operating voltage of the second type of electrical device to power the second type of electrical device. The opening and closing of the second type of voltage conversion unit can be controlled by the MCU. In this way, in the event of an MCU malfunction, the MCU reset causes the second type of electrical device to lose power, thereby controlling the second type of electrical device to stop working. This can reduce the power consumption caused by the invalid operation of the second type of electrical device, and thus reduce the probability of short battery life of electronic devices.

[0116] Optionally, as shown in Figure 2, the power supply device may further include a first charging unit 205.

[0117] The first charging unit 205 can convert the voltage output by the power supply into the system power supply voltage, and can also charge the battery unit 104.

[0118] Any of the first type voltage conversion units 203 is connected between the first charging unit 205 and any of the first type power supply interfaces. For example, the first type voltage conversion unit 1 is connected between the first charging unit 205 and the output V boost The first type voltage conversion unit 2 is connected between the first charging unit 205 and the output V. LDO3 The first type voltage conversion unit 3 is connected between the first charging unit 205 and the output V. LDO2 Between the interfaces.

[0119] The second type of power supply interface is connected to the first charging unit 205. For example, the interface that outputs Vsys is connected to the first charging unit 205.

[0120] In this way, the first charging unit converts the voltage output by the power supply into the system supply voltage, and the first type of voltage conversion unit can convert the system supply voltage into the operating voltage of the first type of electrical device, thereby powering the first type of electrical device. The first charging unit also outputs the system supply voltage through the second type of power supply interface to power the second type of electrical device.

[0121] Optionally, as shown in Figure 2, the power supply device may further include a second charging unit 201.

[0122] During the constant current charging phase, the second charging unit 201 can be controlled to charge the battery unit 104 with constant current or fast charging according to the first mode parameters configured in the register, and the first charging unit 205 can be controlled to transmit the system power supply voltage to the first type voltage conversion unit 203 and the second type power supply interface respectively.

[0123] In this way, the first type of voltage conversion unit can convert the system power supply voltage to output the operating voltage of the first type of electrical device, thereby enabling the first type of electrical device to be powered.

[0124] During the constant voltage charging phase, the first charging unit 205 is controlled to charge the battery unit 104 at a constant voltage or at a slow voltage according to the second mode parameters configured in the register, and the second charging unit 201 is controlled to be disabled or in a turned-off state.

[0125] For example, the first charging unit 205 may be a buck charging unit. The second charging unit 201 may be a switched capacitor (SC) charging unit. A switched capacitor (SC) charging unit is, for example, a charge pump with an input power to output power ratio of 2:1 (SC 2:1 charge pump).

[0126] In this way, by configuring the first mode parameter or the second mode parameter in the register, the second charging unit and / or the first charging unit can be controlled, thereby achieving the switching or control of the charging mode. The charging mode can include constant current charging or constant voltage charging. Furthermore, compared to using the first charging unit for both the constant current charging and constant voltage charging stages, using the second charging unit for constant current charging in the constant current charging stage and the first charging unit for constant voltage charging in the constant voltage charging stage can improve the charging efficiency of the electronic device. It is understood that the execution entity of the embodiments of this application can be an electronic device, or a power supply device or MCU on the electronic device.

[0127] Optionally, the power supply device shown in Figure 2 may also include an inter-integrated circuit (IIC) interface. The IIC interface is not shown in Figure 2.

[0128] The first mode parameter can be configured in a register as follows: Before constant current charging, a first instruction is received from the MCU via the IIC interface, and the mode parameter in the register is modified to the first mode parameter. The mode parameter in the register includes the charging parameters for one of the multiple stages of charging.

[0129] The second mode parameter can be configured in the register as follows: before constant voltage charging, receive a second instruction from the MCU via the IIC interface and modify the mode parameter in the register to the second mode parameter.

[0130] In this way, the MCU can configure the first or second mode parameters in the register by transmitting a first instruction or a second instruction to the power supply device, thereby controlling the second charging unit and / or the first charging unit, and switching or controlling the charging mode. It is understood that the execution entity in this embodiment can be an electronic device or a power supply device on an electronic device.

[0131] Optionally, as shown in Figure 2, the power supply device may further include: a power bus interface, a battery voltage interface, a first switch unit 202, a second switch unit 204, and a fuel meter 103.

[0132] Power bus interface, for example, the interface in Figure 2 used to transmit the voltage Vbus output by the charger.

[0133] Battery voltage interface, for example, the interface in Figure 2 used to transmit battery voltage Vbat.

[0134] The first switching unit 202 is connected between the power bus interface and the first charging unit 205. The second switching unit 204 is connected between the first charging unit 205 and the battery voltage interface.

[0135] The second charging unit 201 is connected between the power bus interface and the battery voltage interface so that the first charging unit 201 can transmit the voltage output by the second charging unit 201 to the battery unit 104 through the battery voltage interface to charge the battery unit 104.

[0136] Taking the power supply as an example, which may include a charger or a battery unit, the power bus interface can transmit the voltage output by the charger to the first charging unit 205 and / or the second charging unit 201.

[0137] The battery voltage interface can transmit the voltage output by the first charging unit 205 or the second charging unit 201 to the battery unit 104, or it can be used to transmit the voltage output by the battery unit to the first charging unit 205.

[0138] The first mode parameter can be used to indicate that the first switching unit 202 is in the on state and the second switching unit 204 is in the off state.

[0139] The second mode parameter can be used to indicate that both the first switching unit 202 and the second switching unit 204 are in the on state.

[0140] The fuel gauge 103 can be connected between the battery voltage interface and the battery cell 104.

[0141] Thus, during the constant current charging phase, the first switching unit is in the ON state and the second switching unit is in the OFF state. The first charging unit can output the system supply voltage through the second type of power supply interface and transmit the system supply voltage to any first type of voltage conversion unit. The first charging unit does not charge the battery unit 104. During the constant voltage charging phase, the second charging unit is disabled, and both the first and second switching units are in the ON state. The first charging unit can not only output the system supply voltage through the second type of power supply interface and transmit the system supply voltage to any first type of voltage conversion unit, but it can also charge the battery unit 104.

[0142] Understandably, when the electronic device is not connected to an external device such as a charger, the MCU or power supply can control the first switching unit to be in the off state and control the second switching unit to be in the on state. The battery unit can transmit the voltage output by the battery unit to the first charging unit and the first type voltage conversion unit respectively to power peripheral devices and / or the MCU. It should be understood that the first type voltage conversion unit can convert the voltage output by the battery unit into the operating voltage of the first type of electrical device.

[0143] Optionally, the LDO in this embodiment can be a three-level LDO. This expands the supply voltage range of the LDO.

[0144] Figure 3 shows another circuit diagram of the electronic device provided in an embodiment of this application.

[0145] As shown in Figure 3, based on Figure 2, both the first switching unit 202 and the second switching unit 204 can be constructed using field-effect devices, or other switching devices capable of turning the circuit on or off. The first switching unit 202 is, for example, M1. The second switching unit 204 is, for example, M2.

[0146] The power supply device can be an integrated charging IC, such as the integrated charging IC in Figure 3. The first type of voltage conversion unit can include a low dropout linear regulator (LDO), a buck circuit, or a boost circuit.

[0147] The first charging unit 205 may include a first inductor L1 and a first capacitor C1.

[0148] One end of the first inductor L1 is connected to the first switching unit (such as M1), and the other end of the first inductor L1 is connected to one end of the first capacitor C1, and the other end of the first capacitor C1 is grounded.

[0149] One end of the second switching unit (such as M2), the second type power supply interface, and one end of the first type voltage conversion unit 203 are respectively connected between the first inductor L1 and the first capacitor C1.

[0150] Type 1 voltage conversion unit 1, for example, boost circuit 302. Type 2 voltage conversion unit 2, for example, LDO3. Type 3 voltage conversion unit 3, for example, LDO2.

[0151] For example, in Figure 3, one end of the boost circuit 302, one end of LDO3, and one end of LDO2 are respectively connected between the first inductor L1 and the first capacitor C1.

[0152] The second charging unit 201 may include: SC circuit 301.

[0153] The second type of voltage conversion unit 1, for example, LDO1. The second type of voltage conversion unit 1 can transmit V to the MCU 207. LDO1 .

[0154] The second type of voltage conversion unit 2, for example, LDO4. The second type of voltage conversion unit 2 can transmit V to peripheral devices 3. LDO4 .

[0155] It should be understood that the first inductor L1 and the first capacitor C1 can form a buck circuit. The first charging unit 205 may include a buck circuit.

[0156] The specific implementation principle and technical effects of the embodiment shown in Figure 3 are similar to those of the embodiment shown in Figure 2, and will not be repeated here. Furthermore, as shown in Figure 3, the power supply device can be an integrated charging IC. Compared to some electronic devices that deploy SC charging chips and buck charging chips, electronic devices that only deploy integrated charging ICs have fewer chips used for charging, giving them more hardware layout leeway and saving on chip costs.

[0157] It is understood that when an electronic device has an SC charging chip and a buck charging chip, and / or a power supply device, the electronic device has multiple functions related to charging. These multiple charging functions include, but are not limited to, trickle charging, constant current charging, constant voltage charging, charging termination, overcharge protection, overheat protection, or overcurrent protection.

[0158] Scenarios for deploying charging components on electronic devices can include the following scenarios: Scenario 1, Scenario 2, or Scenario 3:

[0159] Scenario 1: Electronic devices include power supply devices.

[0160] Scenario 2: Electronic devices include power supply devices, SC charging chips, and buck charging chips.

[0161] Scenario 3: Electronic devices include SC charging chips and buck charging chips.

[0162] A charging component is a component that charges the battery cells of an electronic device. Charging components may include a power supply device, an SC charging chip, and / or a buck charging chip. Scenario 1 can be seen in Figures 2-3. Scenario 3 can be seen in Figure 1. Scenario 2 can be seen in Figure 4. An SC charging chip can be called an SC charging IC. A buck charging chip can be called a buck charging IC.

[0163] Figure 4 shows another circuit diagram of the electronic device provided in the embodiments of this application.

[0164] The difference between Figure 4 and Figure 2 is that, in Figure 4, the electronic device also includes a first charging chip 401 and a second charging chip 402. The first charging chip 401 and the second charging chip 402 are respectively connected between the power bus interface and the battery unit 104. A fuel gauge 103 is connected between the first charging chip 401 and the battery unit 104, and also between the second charging chip 402 and the battery unit 104.

[0165] The first charging chip 401 can be a buck charging chip, such as the buck charging IC 102 in Figure 1. The second charging chip 402 can be an SC charging chip, such as the SC charging IC 101 in Figure 1.

[0166] In this way, the electronic device can use a power supply to charge the battery cell 104. The electronic device can also use a first charging chip 401 and a second charging chip 402 to charge the battery cell 104. For example, during the constant current charging phase, the electronic device can control the second charging chip 402 to enable constant current charging or fast charging of the battery cell 104, and control the first charging chip 401 not to charge the battery cell 104. During the constant voltage charging phase, the electronic device can control the second charging chip 402 to disable, and control the first charging chip 401 to charge the battery cell using constant voltage charging or slow charging.

[0167] The scenarios for deploying charging components on electronic devices include the following scenarios one, two, or three. The electronic devices provided in this application embodiment can adopt application programs and software architectures that are compatible with charging applications in scenarios one, two, and three to achieve the target functions of the electronic devices.

[0168] The target function can be any one of several charging functions related to charging. For example, the target function can be any one of trickle charging, constant current charging, constant voltage charging, charging termination, overcharge protection, overheat protection, or overcurrent protection.

[0169] Figure 5 shows a schematic diagram of a software architecture of an electronic device provided in an embodiment of this application.

[0170] As shown in Figure 5, the architecture can include an application layer, a middleware layer, a hardware abstraction layer (HAL), and a driver layer.

[0171] The application layer can include a series of applications. For example, a charging application. A charging application can include modules corresponding to each of the multiple charging functions related to charging.

[0172] For example, taking multiple charging functions related to charging, including charging function 1, charging function 2, and charging function 3, as an example, the charging application may include functional module 1, functional module 2, functional module 3, functional module 4, and functional module 5. Functional module 1 and functional module 2 correspond to charging function 1. Functional module 3 and functional module 4 correspond to charging function 2. Functional module 5 corresponds to charging function 3.

[0173] The functional module corresponding to the charging function can contain charging functions or code to implement the charging function. It should be understood that the charging functions or code can be predefined.

[0174] For example, taking constant voltage charging as an example, charging function 1 may include a sub-function that disables the second charging unit or the second charging chip, and a sub-function that controls the first charging unit or the first charging chip to provide constant voltage charging to the battery unit. The charging function or code included in function module 1 can be used to disable the second charging unit or the second charging chip. The charging function or code included in function module 2 can be used to control the first charging unit to provide constant voltage charging to the battery unit or the first charging chip to provide constant voltage charging to the battery unit.

[0175] The intermediate layer located between the application layer and the HAL layer can include multiple intermediate layer interfaces. These intermediate layer interfaces pre-encapsulate HAL layer functions, ensuring a one-to-one correspondence between the intermediate layer interfaces and the HAL layer interfaces. Applications in the application layer (such as charging applications) can call the intermediate layer interfaces to access the HAL layer interfaces, thereby controlling the hardware, such as a first charging chip, a second charging chip, and / or a power supply device. Calling the intermediate layer interfaces minimizes modifications to the HAL layer. Multiple intermediate layer interfaces can be used, for example, as shown in Figure 4: intermediate layer interface 11, intermediate layer interface 10, intermediate layer interface 21, intermediate layer interface 20, intermediate layer interface 31, intermediate layer interface 30, intermediate layer interface 41, intermediate layer interface 40, and intermediate layer interface 50.

[0176] Among them, intermediate layer interfaces 11 and 10 both belong to the intermediate layer interfaces corresponding to functional module 1. Intermediate layer interfaces 21 and 20 both belong to the intermediate layer interfaces corresponding to functional module 2. Intermediate layer interfaces 31 and 30 both belong to the intermediate layer interfaces corresponding to functional module 3. Intermediate layer interfaces 41 and 40 both belong to the intermediate layer interfaces corresponding to functional module 4. Intermediate layer interface 50 belongs to the intermediate layer interface corresponding to functional module 5.

[0177] The HAL layer can provide a unified application programming interface for hardware, so that application layer applications can control the hardware through the HAL layer interface.

[0178] In this embodiment, the application programming interface (API) may be referred to as the HAL layer interface. The hardware may be a charging chip or a power supply device.

[0179] The charging HAL of the HAL layer can include multiple HAL layer interfaces. These multiple HAL layer interfaces include, for example, HAL layer interface 11, HAL layer interface 10, HAL layer interface 21, HAL layer interface 20, HAL layer interface 31, HAL layer interface 30, HAL layer interface 41, HAL layer interface 40, and HAL layer interface 50 as shown in Figure 4.

[0180] Intermediate layer interfaces 11, 10, 21, 20, 31, 30, 41, 40, and 50 correspond one-to-one with HAL layer interfaces 11, 10, 21, 20, 31, 30, 41, 40, and 50. For example, intermediate layer interface 11 corresponds to HAL layer interface 11. Intermediate layer interface 10 corresponds to HAL layer interface 10. Intermediate layer interface 21 corresponds to HAL layer interface 21.

[0181] The driver layer can configure or operate the registers of the charging chip or the power supply device to control the charging chip or the power supply device. The charging chip may be a first charging chip or a second charging chip. Operations can be performed on the registers, such as reading, writing, or modifying parameters within the registers.

[0182] The driver layer may include a first charging chip driver, a second charging chip driver, and an integrated charging IC driver. Each of these drivers may include multiple register device functions. For example, the first charging chip driver may include register 1 setting functions and register 2 setting functions. The second charging chip driver may include register 3 setting functions and register 4 setting functions. The integrated charging IC driver may include register 5 setting functions and register 6 setting functions.

[0183] The HAL layer interface corresponding to the first charging chip driver may include HAL layer interface 11 and HAL layer interface 31.

[0184] The HAL layer interface corresponding to the second charging chip driver may include HAL layer interface 21 and HAL layer interface 41.

[0185] The HAL layer interfaces corresponding to the integrated charging IC driver may include HAL layer interface 10, HAL layer interface 20, HAL layer interface 30, HAL layer interface 40 and HAL layer interface 50.

[0186] The target function can be charging function 1, charging function 2, or charging function 3.

[0187] The functional module corresponding to the target function can call the intermediate layer interface and the HAL layer interface corresponding to the intermediate layer interface, and operate the registers of the charging component on the electronic device through the driver layer to achieve the target function.

[0188] For example, the target function of the electronic device may be achieved in the manner shown in S101-S103, the manner shown in S101-S102, or the manner shown in S101 and S103:

[0189] S101. Obtain the identifier associated with the target sub-function of the target function. The identifier associated with the target sub-function is the first identifier, the fifth identifier, or the sixth identifier.

[0190] Here, the target function is any one of several functions related to charging. The target sub-function is any one of several sub-functions of the target function. It can be understood that the target function is composed of one or more sub-functions.

[0191] The first identifier indicates that the component used to charge the battery cell is a power supply device, which can be applied to either scenario one or scenario two.

[0192] The fifth identifier indicates that the component used to charge the battery cell includes a first charging chip, and the sixth identifier indicates that the component used to charge the battery cell includes a second charging chip. This can be applied to either scenario two or scenario three. Both the first charging chip and the second charging chip are independent of the power supply device.

[0193] S102. When the identifier associated with the target sub-function is the first identifier, the register of the power supply device is operated by calling the first intermediate layer interface corresponding to the target sub-function and the first identifier, and the first HAL layer interface corresponding to the first intermediate layer interface, so as to realize the target sub-function.

[0194] S103. When the identifier associated with the target sub-function is the fifth identifier, the register of the first charging chip is operated by calling the second intermediate layer interface corresponding to the target sub-function and the fifth identifier, as well as the fourth HAL layer interface corresponding to the second intermediate layer interface, in order to realize the target sub-function.

[0195] When the identifier associated with the target sub-function is the sixth identifier, the register of the second charging chip is operated by calling the third intermediate layer interface corresponding to the target function and the sixth identifier, as well as the fifth HAL layer interface corresponding to the third intermediate layer interface, in order to realize the target sub-function.

[0196] It should be understood that the target function is achieved when all its sub-functions are realized. A sub-function can be either the first or second sub-function of the target function.

[0197] The following explanations of S101-S102 are based on the flowcharts shown in S201-S204. The explanations of S101 and S103 are based on the flowcharts shown in S301-S304.

[0198] For example, taking charging function 1 as the target function, charging function 1 includes a first sub-function and a second sub-function. The first sub-function can be controlling the first charging chip (or the first charging unit) to not charge the battery unit, and the second sub-function can be controlling the second charging chip (or the second charging unit) to charge the battery unit. The code included in functional module 1 can be used to implement the first sub-function, and the code included in functional module 2 can be used to implement the second sub-function. Both the code in functional module 1 and the code in functional module 2 can include identifiers used to indicate the attributes of the charging component. These identifiers may be, for example, a first identifier, a fifth identifier, or a sixth identifier.

[0199] For either scenario one or scenario two, both functional module 1 and functional module 2 can have a pre-set first identifier, and charging function 1 can be implemented through the process (or method) shown in S201-S204:

[0200] S201. Obtain the identifier in the functional module 1 used to indicate the attributes of the charging component, and identify the identifier in the functional module 1 used to indicate the attributes of the charging component as the first identifier.

[0201] It should be understood that the identifier in functional module 1 used to indicate the attributes of the charging component is the identifier associated with the first sub-function.

[0202] S202: Call the intermediate layer interface 10 corresponding to the functional module 1 and the first identifier, and the HAL layer interface 10 corresponding to the intermediate layer interface 10, and operate the registers of the power supply device (i.e., the integrated charging IC) through the integrated charging IC driver. This is to achieve the first sub-function, such as controlling the first charging unit of the power supply device not to charge the battery unit.

[0203] S203. Obtain the identifier in the functional module 2 used to indicate the attributes of the charging component, and identify the identifier in the functional module 2 used to indicate the attributes of the charging component as the first identifier.

[0204] S204: Call the intermediate layer interface 20 corresponding to the functional module 2 and the first identifier, and the HAL layer interface 20 corresponding to the intermediate layer interface 20, and operate the registers of the power supply device (i.e., the integrated charging IC) through the integrated charging IC driver. This is to realize the second sub-function, such as controlling the second charging unit of the power supply device to charge the battery unit.

[0205] It should be understood that both intermediate layer interface 10 and intermediate layer interface 20 belong to the first intermediate layer interface. Both HAL layer interface 10 and HAL layer interface 20 belong to the first HAL layer interface. Intermediate layer interface 10 is the intermediate layer interface corresponding to the first sub-function and the first identifier. Intermediate layer interface 20 is the intermediate layer interface corresponding to the second sub-function and the first identifier.

[0206] For scenario two or three, functional module 1 can be pre-set with a fifth identifier and functional module 2 can be pre-set with a sixth identifier. Charging function 1 can be implemented through the process (or method) shown in S301-S304:

[0207] S301. Obtain the identifier in the function module 1 used to indicate the attributes of the charging component, and identify the identifier in the function module 1 used to indicate the attributes of the charging component as the fifth identifier.

[0208] S302, calling the intermediate layer interface 11 corresponding to the functional module 1 and the fifth identifier, and the HAL layer interface 11 corresponding to the intermediate layer interface 11, to operate the registers of the first charging chip (i.e., the buck charging IC) through the first charging chip driver. This is to implement the first sub-function, such as controlling the first charging chip not to charge the battery cell.

[0209] S303. Obtain the identifier in the function module 2 used to indicate the attributes of the charging component, and identify the identifier in the function module 2 used to indicate the attributes of the charging component as the sixth identifier.

[0210] S304 calls the intermediate layer interface 21 corresponding to function module 2 and the sixth identifier, as well as the HAL layer interface 21 corresponding to the intermediate layer interface 21, to operate the registers of the second charging chip (i.e., SC charging IC) through the second charging chip driver. This is to implement the second sub-function, such as controlling the second charging chip to charge the battery cell.

[0211] It should be understood that intermediate layer interface 11 belongs to the second intermediate layer interface. HAL layer interface 11 belongs to the fourth HAL layer interface. Intermediate layer interface 21 belongs to the third intermediate layer interface. HAL layer interface 21 belongs to the fifth HAL layer interface. Intermediate layer interface 11 is the intermediate layer interface corresponding to the first sub-function and the fifth identifier. Intermediate layer interface 21 is the intermediate layer interface corresponding to the second sub-function and the sixth identifier.

[0212] Understandably, in Scenario 1, the identifier associated with the target sub-function of the target function is the first identifier. The target function of the electronic device can be obtained in the following way: obtain the first identifier associated with the target sub-function; call the first intermediate layer interface corresponding to the target sub-function and the first identifier, and the first HAL layer interface corresponding to the first intermediate layer interface, to operate the registers of the power supply device to control the first charging unit and / or the second charging unit of the power supply device.

[0213] It is understandable that, when the target function is charging function 2 or charging function 3, the specific implementation principle of charging function 2 or charging function 3 of the electronic device is similar to the specific implementation principle of charging function 1 of the electronic device, and will not be repeated here.

[0214] The application and software architecture of the charging application shown in Figure 5 are compatible with charging functions in Scenario 1, Scenario 2, or Scenario 3. That is, when the charging component is deployed on the electronic device in Scenario 1, Scenario 2, or Scenario 3, the electronic device can use the application and software architecture of the charging application shown in Figure 5 to implement any of the multiple charging functions related to charging. The software architecture shown in Figure 5 adds an intermediate layer between the application layer and the HAL layer. When the application layer calls the charging function, it does not need to consider the code configuration for compatibility with the three charging ICs; it only needs to call the encapsulated intermediate layer interface. In the application of the charging application shown in Figure 5, the code included in functional module 1 can be used to control the first charging chip or the first charging unit. The code included in functional module 2 can be used to control the second charging chip or the second charging unit. This improves code readability while also saving code space and reducing code redundancy. The three charging ICs include, for example, the first charging chip, the second charging chip, and the power supply device (such as an integrated charging IC).

[0215] In one embodiment of this application, the charging function of the first charging chip may be the same as that of the first charging unit. Similarly, the charging function of the second charging chip may be the same as that of the second charging unit.

[0216] Figure 6 illustrates another software architecture diagram of the electronic device provided in an embodiment of this application.

[0217] The difference between Figure 6 and Figure 5 is that the software architecture shown in Figure 6 does not include the middleware layer. In the software architecture shown in Figure 6, the functional modules corresponding to charging function 1 include: functional module 11, functional module 21, functional module 10, and functional module 20. The functions implemented by functional module 11 and functional module 10 can be the same. The functions implemented by functional module 21 and functional module 20 can also be the same.

[0218] The functional modules corresponding to charging function 2 include: functional module 31, functional module 41, functional module 30, and functional module 40. Functional module 31 can perform the same function as functional module 30. Similarly, functional module 41 can perform the same function as functional module 40.

[0219] The functional module corresponding to the charging function shown in Figure 6 also includes charging functions or code for implementing the charging function. The code within the functional module also includes identifiers for indicating the attributes of the charging components. These attributes may include a first charging chip, a second charging chip, a first charging unit of the power supply device, or a second charging unit of the power supply device. Identifiers for indicating the attributes of the charging components may be, for example, a second identifier, a third identifier, or a fourth identifier.

[0220] The difference between Figure 6 and Figure 5 lies in the fact that the code contained in the functional modules in Figure 6 can be different from the code contained in the functional modules in Figure 5. For example, taking constant voltage charging function 1 as an example, charging function 1 can include a sub-function that controls the second charging unit or the second charging chip to be disabled, and a sub-function that controls the first charging unit or the first charging chip to provide constant voltage charging to the battery unit. The charging function or code contained in functional module 11 can be used to control the second charging chip to be disabled. The charging function or code contained in functional module 21 can be used to control the first charging chip to provide constant voltage charging to the battery unit. The charging function or code contained in functional module 10 can be used to control the second charging unit to be disabled. The charging function or code contained in functional module 20 can be used to control the first charging unit to provide constant voltage charging to the battery unit.

[0221] In Figure 6, the functional modules of the charging application correspond one-to-one with the HAL layer interfaces of the charging HAL. For example, functional modules 11, 21, 10, 20, 31, 41, 30, and 40 correspond one-to-one with HAL layer interfaces 11, 21, 10, 20, 31, 41, 30, and 40. For instance, functional module 11 corresponds to HAL layer interface 11. Functional module 21 corresponds to HAL layer interface 21. Functional module 10 corresponds to HAL layer interface 10. Thus, the functional modules can call their corresponding HAL layer interfaces to operate on the registers of the charging chip or the power supply device through the driver layer to achieve the target function.

[0222] The charging application and software architecture shown in Figure 6 are also compatible with electronic devices deployed according to Scenario 1, Scenario 2, or Scenario 3. The following section, with reference to Figure 7, explains the process of implementing the target functions of electronic devices based on the charging application and software architecture shown in Figure 6.

[0223] Figure 7 shows a schematic diagram of a charging process provided in an embodiment of this application.

[0224] For example, taking the target function as charging function 1, charging function 1 includes a first sub-function and a second sub-function. The first sub-function can be to control the first charging chip (or the first charging unit) not to charge the battery unit, and the second sub-function can be to control the second charging chip (or the second charging unit) to charge the battery unit.

[0225] The code included in functional module 11 can be used to implement a first sub-function, such as controlling the first charging chip to prevent charging the battery cell. The code included in functional module 21 can be used to implement a second sub-function, such as controlling the second charging chip to charge the battery cell. The code included in functional module 10 can also be used to implement the first sub-function, such as controlling the first charging chip to prevent charging the battery cell. The code included in functional module 20 can also be used to implement the second sub-function, such as controlling the second charging chip to charge the battery cell. The code included in functional module 11 may also include a second identifier for indicating the first charging chip. The code included in functional module 21 may also include a fourth identifier for indicating the second charging chip. The code included in functional modules 10 and 20 may each include a third identifier for indicating a power supply device (such as an integrated charging IC).

[0226] For scenario one or scenario two, the pre-installed charging component on the electronic device is a power supply device, which is an integrated charging IC. That is, the integrated charging IC is used to charge the battery unit, without using the first charging chip and the second charging chip to charge the battery unit. As shown in Figure 7, the target function of the electronic device can be achieved through the process shown in S701, S703-S705, and S707-S708.

[0227] S701. Obtain the second identifier associated with the first sub-function of the target function to determine whether the electronic device has a first charging chip or whether the preset charging component on the electronic device includes the first charging chip.

[0228] For example, the second identifier in the functional module 11 is obtained, and the state of the second identifier is identified.

[0229] If the second identifier is in the off state, it means that there is no first charging chip on the electronic device, or that the preset charging components on the electronic device do not include the first charging chip. S703 can be executed to determine whether there is a first charging unit with integrated charging IC on the electronic device.

[0230] S703. Obtain the third identifier associated with the first sub-function to determine whether a first charging unit with an integrated charging IC exists on the electronic device or whether a preset charging component on the electronic device includes a first charging unit with an integrated charging IC. A second identifier in an off state indicates that the component charging the battery unit does not include the first charging chip. The first charging chip is independent of the integrated charging IC.

[0231] For example, the third identifier associated with the first sub-function can be the third identifier in the functional module 10.

[0232] When the second identifier is in the off state, the third identifier in the functional module 10 can be obtained and its state can be identified.

[0233] The third identifier being in an "on" state can indicate that an integrated charging IC exists on the electronic device, or that the electronic device has a pre-installed charging component that includes an integrated charging IC.

[0234] The third indicator being in the off state can indicate that there is no integrated charging IC on the electronic device, or that the preset charging components on the electronic device do not include an integrated charging IC.

[0235] If the third identifier associated with the first sub-function is in the ON state, it indicates that a first charging unit with an integrated charging IC exists on the electronic device, or that the preset charging components on the electronic device include a first charging unit with an integrated charging IC, and S704 can be executed to implement the first sub-function, such as controlling the first charging unit not to charge the battery unit.

[0236] S704. When the state of the third identifier associated with the first sub-function is in the "on" state, the register of the integrated charging IC is operated by calling the second HAL layer interface corresponding to the first sub-function and the third identifier to control the first charging unit. The "on" state of the third identifier indicates that the component charging the battery unit includes the integrated charging IC.

[0237] For example, when the target function is charging function 1 and the third identifier associated with the first sub-function is the identifier in function module 10, the second HAL layer interface corresponding to the first sub-function and the third identifier can be the HAL layer interface 10 corresponding to function module 10.

[0238] When the third identifier is in the enabled state, the HAL layer interface 10 can be called to drive the integrated charging IC (i.e., power supply device) in the driver layer and operate the register of the integrated charging IC (i.e., power supply device) to control the first charging unit to not charge the battery unit.

[0239] It should be understood that the second HAL layer interface can be a single HAL layer interface corresponding to the integrated charging IC and the target function.

[0240] S705. Obtain the fourth identifier associated with the second sub-function of the target function to determine whether a second charging chip exists on the electronic device or whether a preset charging component on the electronic device includes a second charging chip.

[0241] For example, the fourth identifier in the functional module 21 is obtained, and the state of the fourth identifier is identified.

[0242] If the fourth identifier is in the off state, it means that there is no second charging chip on the electronic device, or that the preset charging components on the electronic device do not include the second charging chip. S707 can be executed to determine whether there is a second charging unit with integrated charging IC on the electronic device.

[0243] S707. When the fourth identifier is in the off state, obtain the third identifier associated with the second sub-function to determine whether there is a second charging unit with integrated charging IC on the electronic device or whether the preset charging component on the electronic device includes a second charging unit with integrated charging IC.

[0244] It should be understood that the fourth indicator indicating a closed state does not include the second charging chip, which is independent of the power supply device.

[0245] For example, the third identifier associated with the second sub-function may be the third identifier in the functional module 20.

[0246] When the fourth identifier is in the off state, the third identifier in the functional module 20 can be obtained and its state can be identified.

[0247] If the state of the third identifier associated with the second sub-function is on, it indicates that there is a second charging unit with an integrated charging IC on the electronic device, or that the preset charging component on the electronic device includes a second charging unit with an integrated charging IC. S708 can be executed to realize the second sub-function, such as controlling the second charging unit to charge the battery unit, thereby realizing the target function.

[0248] S708 When the state of the third identifier associated with the second sub-function is enabled, the register of the integrated charging IC is operated by calling the third HAL layer interface corresponding to the second sub-function and the third identifier to control the second charging unit.

[0249] For example, when the target function is charging function 1 and the third identifier associated with the second sub-function is the identifier in function module 20, the third HAL layer interface corresponding to the second sub-function and the third identifier can be the HAL layer interface 20 corresponding to function module 20.

[0250] When the third identifier associated with the second sub-function is in the enabled state, the HAL layer interface 20 can be called to drive the integrated charging IC (i.e., power supply device) in the driver layer and operate the register of the integrated charging IC to control the second charging unit to charge the battery unit.

[0251] It should be understood that the third HAL layer interface can be another HAL layer interface corresponding to the integrated charging IC and the target function.

[0252] In this way, for scenario one or scenario two, if the pre-installed charging component on the electronic device is the power supply, the target function can be achieved.

[0253] For scenario two or three, the pre-installed charging components on the electronic device include a first charging chip and a second charging chip. That is, the first charging chip and the second charging chip are used to charge the battery unit. When the power supply device is not used to charge the battery unit, as shown in Figure 7, taking the integrated charging IC as the power supply device as an example, the target function of the electronic device can be achieved through the process shown in S701-S703 and S705-S706:

[0254] S701. Obtain the second identifier associated with the first sub-function of the target function to determine whether the electronic device has a first charging chip or whether the preset charging component on the electronic device includes the first charging chip.

[0255] For example, the second identifier in the functional module 11 is obtained, and the state of the second identifier is identified.

[0256] If the second identifier is in the open state, it indicates that the electronic device has a first charging chip, or that the electronic device has a preset charging component including the first charging chip. S702 can be executed to control the first charging chip and thus achieve the target function.

[0257] S702, when the second identifier is in the "on" state, the register of the first charging chip is operated by calling the sixth HAL layer interface corresponding to the first sub-function and the second identifier. This implements the first sub-function, for example, controlling the first charging chip not to charge the battery cell. The "on" state of the second identifier indicates that the component charging the battery cell includes the first charging chip.

[0258] For example, when the target function is charging function 1 and the second identifier is the identifier in function module 11, the sixth HAL layer interface corresponding to the first sub-function and the second identifier can be the HAL layer interface 11 corresponding to function module 11. It should be understood that the sixth HAL layer interface belongs to the HAL layer interface corresponding to the target function and the first charging chip.

[0259] When the second identifier is in the enabled state, the HAL layer interface 11 can be called to operate the register of the first charging chip through the first charging chip driver in the driver layer, so as to control the first charging chip not to charge the battery unit.

[0260] S703. Obtain the third identifier associated with the first sub-function to determine whether there is a first charging unit with integrated charging IC on the electronic device or whether the preset charging components on the electronic device include a first charging unit with integrated charging IC.

[0261] For example, the third identifier in the functional module 10 can be obtained and the state of the third identifier can be identified.

[0262] If the state of the third identifier associated with the first sub-function is off, it means that there is no first charging unit with integrated charging IC on the electronic device, or that the preset charging components on the electronic device do not include the first charging unit with integrated charging IC. S705 can be executed to determine whether there is a second charging chip on the electronic device.

[0263] S705. Obtain the fourth identifier associated with the second sub-function of the target function to determine whether a second charging chip exists on the electronic device or whether a preset charging component on the electronic device includes a second charging chip. A third identifier in the off state indicates that the component charging the battery cell does not include a power supply device.

[0264] For example, the fourth identifier associated with the second sub-function can be the fourth identifier in the functional module 21. When the state of the third identifier associated with the first sub-function is off, the fourth identifier in the functional module 21 can be obtained and its state can be identified.

[0265] If the fourth identifier is in the open state, it indicates that there is a second charging chip on the electronic device, or that the preset charging component on the electronic device includes the second charging chip. S706 can be executed to control the second charging chip and thus achieve the target function.

[0266] S706. When the fourth identifier is in the "on" state, the register of the second charging chip is operated by calling the seventh HAL layer interface corresponding to the second sub-function and the fourth identifier. This is to implement the second sub-function, such as controlling the second charging chip to charge the battery cell, thereby achieving the target function. The "on" state of the fourth identifier indicates that the component charging the battery cell includes the second charging chip.

[0267] For example, when the target function is charging function 1 and the fourth identifier is the identifier in function module 21, the seventh HAL layer interface corresponding to the second sub-function and the fourth identifier can be the HAL layer interface 21 corresponding to function module 21. It should be understood that the seventh HAL layer interface belongs to the HAL layer interface corresponding to the target function and the second charging chip.

[0268] When the fourth identifier is in the enabled state, the HAL layer interface 21 can be called to operate the registers of the second charging chip through the second charging chip driver, so as to control the second charging chip to charge the battery unit.

[0269] Thus, for scenario two or three, if the charging components preset on the electronic device include a first charging chip and a second charging chip, the target function can be achieved.

[0270] It is understandable that, when the target function is charging function 2, the specific implementation principle of the charging function 2 of the electronic device is similar to that of the charging function 1 of the electronic device, and will not be repeated here.

[0271] The charging application shown in Figure 6 uses identifiers to indicate the attributes of charging components in its functional modules to control different charging components. Following the flow shown in Figure 7, the charging application and software architecture shown in Figure 6 can compatiblely implement charging functions in Scenario 1, Scenario 2, or Scenario 3. That is, regardless of whether the scenario in which the charging component is deployed on the electronic device is Scenario 1, Scenario 2, or Scenario 3, the electronic device can use the charging application and software architecture shown in Figure 6 to implement any of the multiple charging functions related to charging, following the flow shown in Figure 7.

[0272] It is understood that the identifiers in the embodiments of this application can be macros or values ​​in flag bits. Taking a macro as an example, the first identifier can be a first macro, the second identifier can be a second macro, the third identifier can be a third macro, the fourth identifier can be a fourth macro, the fifth identifier can be a fifth macro, and the sixth identifier can be a sixth macro. When the identifier is a macro, the macro definitions of the macros related to the charging application in the embodiments of this application can be included in a configuration directory pre-stored on the electronic device, that is, the macros related to the charging application can be modified or controlled in the configuration directory.

[0273] It is understood that the first identifier and the third identifier in the embodiments of this application may be the same. The fifth identifier and the second identifier may be the same. The sixth identifier and the fourth identifier may be the same.

[0274] It is understood that, in the embodiments of this application, the entity executing the process related to the target function can be an electronic device, a power supply device or MCU on the electronic device, or a charging application.

[0275] This application also provides a charging method for an electronic device, which may include the power supply device, first charging chip, second charging chip, and battery unit as described above. The charging method may include steps S101-S103, and its specific implementation principle and technical effects will not be elaborated further.

[0276] This application also provides a charging method for an electronic device, which may include the power supply device, first charging chip, second charging chip, and battery unit as described above. The charging method may include steps S701-S703 and S705-S706, the specific implementation principles and technical effects of which will not be elaborated further.

[0277] It should be noted that the module names involved in the embodiments of this application can all be defined as other names, as long as they can achieve the function of each module, and no specific restrictions are placed on the module names.

[0278] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0279] The charging method according to the embodiments of this application has been described above. The apparatus for performing the above method provided in the embodiments of this application is described below. Those skilled in the art will understand that the methods and apparatus can be combined with and referenced by each other, and the related apparatus or electronic equipment provided in the embodiments of this application can perform the steps in the above charging method.

[0280] The charging method provided in this application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can be referred to the above-described related descriptions, which will not be repeated here.

[0281] This application provides an electronic device, which includes a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the electronic device to perform the above-described method.

[0282] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.

[0283] This application provides a chip system. The chip system includes at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a circuit, and the at least one processor being used to run computer programs or instructions to perform the above-described method.

[0284] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.

[0285] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0286] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.

[0287] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, create means for implementing the functions specified in one or more flowchart illustrations and / or one or more block diagrams.

[0288] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A power supply device, characterized in that, include: At least one type-first voltage conversion unit, a register, at least one type-first power supply interface, and at least one type-second power supply interface; Any of the first type of power supply interfaces is connected to any of the first type of voltage conversion units, for outputting the output voltage of the first type of voltage conversion unit at the first type of power supply interface; The second type of power supply interface is connected to the power supply of the power supply device and is used to output the system power supply voltage at the second type of power supply interface; The first type of power supply interface is connected to a first type of electrical device, and the second type of power supply interface is connected to a second type of voltage conversion unit. The second type of voltage conversion unit is used to convert the system power supply voltage into the operating voltage of the second type of electrical device to supply power to the second type of electrical device. The activation, voltage output, and deactivation of the first type of voltage conversion unit are all performed according to the parameters pre-set for the first type of voltage conversion unit in the register. The activation and deactivation of the second type of voltage conversion unit are controlled by the microcontroller unit (MCU).

2. The power supply device according to claim 1, characterized in that, The parameters pre-set in the register for the first type of voltage conversion unit remain unchanged during MCU startup, restart, and operation.

3. The power supply device according to claim 1 or 2, characterized in that, The first type of voltage conversion unit includes a low dropout linear regulator (LDO), a buck circuit, or a boost circuit.

4. The power supply device according to any one of claims 1-3, characterized in that, Also includes: First charging unit; The first charging unit is used to convert the voltage output by the power supply into the system power supply voltage, and is also used to charge the battery unit; Any of the first type voltage conversion units is connected between the first charging unit and any of the first type power supply interfaces, and the second type power supply interface is connected to the first charging unit.

5. The power supply device according to claim 4, characterized in that, Also includes: Second charging unit; During the constant current charging phase, the second charging unit is controlled to charge the battery unit at a constant current according to the first mode parameters configured in the register, and the first charging unit is controlled to transmit the system power supply voltage to the first type voltage conversion unit and the second type power supply interface respectively. During the constant voltage charging phase, the first charging unit is controlled to charge the battery unit at a constant voltage according to the second mode parameters configured in the register, and the second charging unit is controlled to be disabled.

6. The power supply device according to claim 5, characterized in that, Also includes: Integrated circuit bus IIC interface; The first mode parameter is configured in the register as follows: before the constant current charging, a first instruction from the MCU is received through the IIC interface to modify the mode parameter in the register to the first mode parameter; the mode parameter in the register includes the charging parameters of one of the multiple charging stages; The second mode parameter is configured in the register as follows: before the constant voltage charging, a second instruction from the MCU is received through the IIC interface to modify the mode parameter in the register to the second mode parameter.

7. The power supply device according to claim 5 or 6, characterized in that, It also includes: a power bus interface, a battery voltage interface, a first switching unit and a second switching unit, wherein the power supply includes a charger or the battery unit; The first switching unit is connected between the power bus interface and the first charging unit, the second switching unit is connected between the first charging unit and the battery voltage interface, and the second charging unit is connected between the power bus interface and the battery voltage interface. The power bus interface is used to transmit the voltage output by the charger to the first charging unit and / or the second charging unit; The battery voltage interface is used to transmit the voltage output by the first charging unit or the second charging unit to the battery cell, or to transmit the voltage output by the battery cell to the first charging unit. The first mode parameter is used to indicate that the first switching unit is in the on state and the second switching unit is in the off state. The second mode parameter is used to indicate that both the first switching unit and the second switching unit are in the on state.

8. The power supply device according to claim 7, characterized in that, The first charging unit includes: a first inductor and a first capacitor; One end of the first inductor is connected to the first switching unit, the other end of the first inductor is connected to one end of the first capacitor, and the other end of the first capacitor is grounded. One end of the second switching unit, the second type of power supply interface, and one end of the first type of voltage conversion unit are respectively connected between the first inductor and the first capacitor.

9. The power supply device according to any one of claims 1-8, characterized in that, The power supply device includes a first charging unit and a second charging unit, both of which are used to charge the battery unit; the power supply device achieves its target function in the following manner: Obtain a first identifier associated with the target sub-function of the target function; the first identifier indicates that the component used to charge the battery cell is the power supply device; the target function is any one of a plurality of functions related to charging, and the target sub-function is any one of a plurality of sub-functions of the target function; The target sub-function and the first intermediate layer interface corresponding to the first identifier, as well as the first hardware abstraction layer (HAL) interface corresponding to the first intermediate layer interface, are invoked to operate the registers to control the first charging unit and / or the second charging unit.

10. The power supply device according to any one of claims 1-8, characterized in that, The power supply device includes a first charging unit and a second charging unit, both of which are used to charge the battery unit; the power supply device achieves its target function in the following manner: Obtain the second identifier associated with the first sub-function of the target function; When the second identifier is in the off state, the third identifier associated with the first sub-function is obtained. The second identifier being in the off state indicates that the component charging the battery unit does not include the first charging chip, and the first charging chip is independent of the power supply device. When the state of the third identifier associated with the first sub-function is in the open state, the register is operated by calling the second HAL layer interface corresponding to the first sub-function and the third identifier to control the first charging unit or the second charging unit. The component that indicates the charging of the battery unit when the state of the third identifier is in the open state includes the power supply device. Obtain the fourth identifier associated with the second sub-function of the target function; When the fourth identifier is in the off state, the third identifier associated with the second sub-function is obtained. The fourth identifier being in the off state indicates that the component charging the battery unit does not include the second charging chip, and the second charging chip is independent of the power supply device. When the state of the third identifier associated with the second sub-function is enabled, the register is operated by calling the third HAL layer interface corresponding to the second sub-function and the third identifier to control the second charging unit or the first charging unit. The target function is any one of several functions related to charging.

11. A charging method, characterized in that, Applied to an electronic device, the electronic device comprising a power supply device, a first charging chip, a second charging chip, and a battery unit as described in any one of claims 1-10; the method comprising: The identifier associated with the target sub-function of the target function is obtained. The identifier associated with the target sub-function is a first identifier, a fifth identifier, or a sixth identifier. The first identifier indicates that the component used to charge the battery unit is the power supply device. The fifth identifier indicates that the component used to charge the battery unit includes a first charging chip. The sixth identifier indicates that the component used to charge the battery unit includes a second charging chip. Both the first charging chip and the second charging chip are independent of the power supply device. The target function is any one of a plurality of functions related to charging, and the target sub-function is any one of a plurality of sub-functions of the target function. When the identifier associated with the target sub-function is the first identifier, the register of the power supply device is operated by calling the first intermediate layer interface corresponding to the target sub-function and the first identifier, and the first HAL layer interface corresponding to the first intermediate layer interface, so as to realize the target sub-function. When the identifier associated with the target sub-function is the fifth identifier, the register of the first charging chip is operated by calling the second intermediate layer interface corresponding to the target sub-function and the fifth identifier, and the fourth HAL layer interface corresponding to the second intermediate layer interface, so as to realize the target sub-function. When the identifier associated with the target sub-function is the sixth identifier, the register of the second charging chip is operated by calling the third intermediate layer interface corresponding to the target function and the sixth identifier, as well as the fifth HAL layer interface corresponding to the third intermediate layer interface, to realize the target sub-function.

12. A charging method, characterized in that, Applied to an electronic device, the electronic device comprising a power supply device, a first charging chip, a second charging chip, and a battery unit as described in any one of claims 1-10; the method comprising: Obtain the second identifier associated with the first sub-function of the target function; When the second identifier is in the enabled state, the register of the first charging chip is operated by calling the sixth HAL layer interface corresponding to the first sub-function and the second identifier. The enabled state of the second identifier indicates that the component charging the battery unit includes the first charging chip. Obtain the third identifier associated with the first sub-function; When the third identifier is in a closed state, a fourth identifier associated with the second sub-function of the target function is obtained, wherein the third identifier being in a closed state indicates that the component charging the battery cell does not include the power supply device; When the fourth identifier is in the enabled state, the register of the second charging chip is operated by calling the second sub-function and the seventh HAL layer interface corresponding to the fourth identifier to achieve the target function. The component that indicates the charging of the battery unit when the fourth identifier is in the enabled state includes the second charging chip. The target function is any one of several functions related to charging.

13. An electronic device, characterized in that, The electronic device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in claim 11 or 12.

14. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in claim 11 or 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in claim 11 or 12.

16. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in claim 11 or 12.

Citation Information

Patent Citations

  • Electronic equipment and power supply control device thereof

    CN106712461A

  • Abnormal power-down SOC protection method for BMS system

    CN106872908A

  • Power supply chip, power supply and electric energy providing method

    CN108205371A

  • Power supply device, charging method, electronic equipment, chip system and storage medium

    CN119298263A