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

By introducing a power supply device and a charging unit into an electronic device and using register preset parameters to control the voltage conversion unit, stable power supply to peripheral devices is achieved, solving the problem of power failure of peripheral devices and improving the battery life and charging efficiency of the device.

CN119298263BActive Publication Date: 2025-10-10HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411198907.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-10-10
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

When an electronic device is connected to a charger or has sufficient battery power, peripheral devices are prone to power loss, resulting in the loss of device abnormality information and shortened battery life.

Method used

A power supply device is used, including first-type and second-type voltage conversion units. The parameters pre-set by the register control the opening and closing of the voltage conversion unit. The power supply of the first-type electrical devices is not controlled by the MCU, while the power supply of the second-type electrical devices is controlled by the MCU. The charging unit and the switching unit are combined to realize the switching between constant current and constant voltage charging modes, thereby reducing the probability of power failure of peripheral devices.

Benefits of technology

It effectively reduces the occurrence of power failure of peripheral devices, improves the battery life and charging efficiency of electronic devices, and ensures the storage and processing of key information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119298263B_ABST
    Figure CN119298263B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a power supply device, a charging method, an electronic device, a chip system and a storage medium, and relate to the technical field of terminals. The power supply device includes 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 with 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 includes a peripheral device. The second type power supply interface is connected with a charger or a battery unit of the power supply device to transmit Vsys to an external LDO. The opening, voltage output and closing of the first type voltage conversion unit are all performed according to the parameters set in the register in advance for the first type voltage conversion unit, and are not controlled by an MCU. In this way, the occurrence probability of power failure of the peripheral device can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 Art

[0002] Some electronic devices are equipped with a charge management chip (integrated circuit, IC). A charger or battery connected to the electronic device can use the charge management chip to power the device's microcontroller unit (MCU) and peripheral devices. Peripheral devices can include displays, motors, and sensors.

[0003] However, when the electronic device is connected to a charger or the battery is fully charged, there is a situation where the peripheral device loses power. Summary of the Invention

[0004] The present invention provides a power supply device, a charging method, an electronic device, a chip system, and a storage medium, which are applied to the field of terminal technology and can reduce the probability of power failure of peripheral devices when the electronic device is connected to a charger or the battery is fully charged.

[0005] In a first aspect, an embodiment of the present application proposes 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. Any first-type power supply interface is connected to any first-type voltage conversion unit, and is used to output the output voltage of the first-type voltage conversion unit to 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 to the second-type power supply interface. The first-type power supply interface is connected to a first-type electrical device, and the second-type power supply interface is connected to a second-type voltage conversion unit, and the second-type voltage conversion unit is used to convert the system power supply voltage into the working voltage of the second-type electrical device to supply power to the second-type electrical device. In particular, the activation of the first-type voltage conversion unit, the voltage output of the first-type voltage conversion unit, and the closure of the first-type voltage conversion unit are all executed according to the parameters pre-set for the first-type voltage conversion unit in the register, and the activation of the second-type voltage conversion unit and the closure of the second-type voltage conversion unit are both controlled by a microcontroller unit MCU.

[0006] In this way, the parameters pre-set in the register for the first-type voltage conversion unit can be preset default values ​​for the first-type voltage conversion unit. The MCU does not change the parameters pre-set in the register for the first-type voltage conversion unit. For example, the parameters pre-set in the register for the first-type voltage conversion unit remain unchanged during MCU startup, reset, restart, and operation. Therefore, the power supply to the first-type electrical device is not controlled by the MCU, and MCU abnormalities will not cause the first-type electrical device to lose power. This reduces the probability of peripheral devices such as the first-type electrical device losing power when the electronic device is connected to a charger or the battery unit is fully charged. The electronic device may include a power supply device. The second-type power supply interface is connected to a power supply of the power supply device to output a system power supply voltage to the second-type power supply interface. The second-type voltage conversion unit connected to the second-type power supply interface can convert the system power supply voltage into an operating voltage for the second-type electrical device to power the second-type electrical device. The second-type voltage conversion unit can be enabled and disabled by the MCU. In the event of an MCU abnormality, resetting the MCU can cause the second type of electrical device to lose power to control the second type of electrical device to stop working, which can reduce the power consumption generated by the ineffective operation of the second type of electrical device and thereby reduce the probability of a short battery life of the electronic device.

[0007] In a possible implementation, the parameters pre-set in the register for the first type voltage conversion unit remain unchanged when the MCU is started, restarted, and running.

[0008] In this way, when the MCU is started, reset, restarted and running, the first type of electrical devices will not lose power, thereby reducing the probability of power loss of peripheral devices such as the first type of electrical devices when the electronic device is connected to a charger or the battery unit is fully charged.

[0009] In a possible implementation, the first type voltage conversion unit includes a low dropout linear regulator LDO, a step-down buck circuit, or a step-up boost circuit.

[0010] In this way, power can be supplied to different first-type electrical devices with different operating voltages.

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

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

[0013] In one possible implementation, the device further includes a second charging unit. During the constant current charging phase, the second charging unit is controlled to charge the battery cell with 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 cell with a constant voltage according to the second mode parameters configured in the register, and the second charging unit is disabled.

[0014] In this way, the second charging unit and / or the first charging unit can be controlled by configuring the first mode parameter or the second mode parameter in the register, thereby realizing the switching or control of the charging mode. The charging mode may include constant current charging or constant voltage charging. In addition, compared with the method of charging with the first charging unit in both the constant current charging stage and the constant voltage charging stage, the method of using the second charging unit for constant current charging in the constant current charging stage and using the first charging unit for constant voltage charging in the constant voltage charging stage can improve the charging efficiency of the electronic device.

[0015] In one possible implementation, the device further includes an integrated circuit bus (IC) interface. The first mode parameters are configured in a register as follows: prior to constant current charging, a first instruction is received from the MCU via the IIC interface, and the mode parameters in the register are modified to the first mode parameters. The mode parameters in the register include charging parameters for one of the multiple charging stages. The second mode parameters are configured in the register as follows: prior to constant voltage charging, a second instruction is received from the MCU via the IIC interface, and the mode parameters in the register are modified to the second mode parameters.

[0016] In this way, the MCU can configure the first mode parameter or the second mode parameter in the register by transmitting the first indication or the second indication to the power supply device, thereby controlling the second charging unit and / or the first charging unit, and switching or controlling the charging mode.

[0017] In a possible implementation, it further includes: a power bus interface, a battery voltage interface, a first switch unit, and a second switch unit, and the power supply includes a charger or a battery unit. The first switch unit is connected between the power bus interface and the first charging unit, the second switch 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 unit, or to transmit the voltage output by the battery unit to the first charging unit. The first mode parameter is used to indicate that the first switch unit is controlled to be in the on state and the second switch unit is controlled to be in the off state. The second mode parameter is used to indicate that both the first switch unit and the second switch unit are controlled to be in the on state.

[0018] In this way, during the constant current charging stage, the first switch unit is in the on state and the second switch unit is in the off state. The first charging unit can output the system power supply voltage through the second type power supply interface and transmit the system power supply voltage to any first type voltage conversion unit. The first charging unit does not charge the battery unit. During the constant voltage charging stage, the second charging unit is not enabled, and both the first switch unit and the second switch unit are in the on state. The first charging unit can not only output the system power supply voltage through the second type power supply interface and transmit the system power supply voltage to any first type voltage conversion unit, but also charge the battery unit.

[0019] 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 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 power supply interface, and one end of the first type voltage conversion unit are respectively connected between the first inductor and the first capacitor.

[0020] 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 into a system power supply voltage and output the system power supply voltage, for example, the system power supply voltage can be transmitted to the second type power supply interface and the first type voltage conversion unit respectively.

[0021] In one possible implementation, the power supply device includes a first charging unit and a second charging unit, and the first charging unit and the second charging unit are both used to charge the battery unit. The power supply device implements the target function in the following manner: obtaining 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 unit 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 first intermediate layer interface corresponding to the target sub-function and the first identifier, as well as the first hardware abstraction layer HAL layer interface corresponding to the first intermediate layer interface, are called to operate the registers to control the first charging unit and / or the second charging unit.

[0022] In this way, when the charging component for charging the battery unit on the electronic device includes a power supply device, the method flow provided in the embodiment of the present application can be used to implement any one of the multiple functions related to charging.

[0023] In one possible implementation, a power supply device includes a first charging unit and a second charging unit, both of which are used to charge a battery cell. The power supply device implements a target function by: obtaining a second identifier associated with a first sub-function of the target function. If the second identifier is in an off state, obtaining a third identifier associated with the first sub-function. The off state of the second identifier indicates that the components for charging the battery cell do not include the first charging chip, and the first charging chip is independent of the power supply device. If the third identifier associated with the first sub-function is in an on state, the first charging unit or the second charging unit is controlled by calling a second HAL layer interface corresponding to the first sub-function and the third identifier, and operating a register. The on state of the third identifier indicates that the components for charging the battery cell include the power supply device. Obtaining a fourth identifier associated with the second sub-function of the target function. If the fourth identifier is in an off state, obtaining a third identifier associated with the second sub-function. The off state of the fourth identifier indicates that the components for charging the battery cell do not include the second charging chip, and the second charging chip is independent of the power supply device. When the state of the third flag associated with the second sub-function is on, the register is operated by calling the third HAL layer interface corresponding to the second sub-function and the third flag to control the second charging unit or the first charging unit. Wherein, the target function is any one of multiple functions related to charging.

[0024] In this way, when the charging component for charging the battery unit on the electronic device includes a power supply device, any one of the multiple functions related to charging can be implemented using the method or process provided in the embodiments of the present application.

[0025] In a second aspect, the embodiments of the present application provide a charging method applied to an electronic device, the electronic device comprising the power supply device, the first charging chip, the second charging chip and the battery unit in the first aspect or any possible implementation manner of the first aspect. The method comprises: obtaining an identifier associated with a target sub-function of a target function, the identifier associated with the target sub-function being a first identifier, a fifth identifier or a sixth identifier, the first identifier indicating that the component for charging the battery unit is the power supply device, the fifth identifier indicating that the component for charging the battery unit comprises the first charging chip, the sixth identifier indicating that the component for charging the battery unit comprises the second charging chip, the first charging chip and the second charging chip being 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. In a case where the identifier associated with the target sub-function is the first identifier, registers of the power supply device are operated by calling a first intermediate layer interface corresponding to the target sub-function and the first identifier, and a first HAL layer interface corresponding to the first intermediate layer interface, to implement the target sub-function. In a case where the identifier associated with the target sub-function is the fifth identifier, registers of the first charging chip are operated by calling a second intermediate layer interface corresponding to the target sub-function and the fifth identifier, and a fourth HAL layer interface corresponding to the second intermediate layer interface, to implement the target sub-function. In a case where the identifier associated with the target sub-function is the sixth identifier, registers of the second charging chip are operated by calling a third intermediate layer interface corresponding to the target function and the sixth identifier, and a fifth HAL layer interface corresponding to the third intermediate layer interface, to implement the target sub-function.

[0026] In this way, the method flow provided by the embodiments of the present application can be compatible with the charging function of the electronic device comprising the power supply device, or the first charging chip and the second charging chip. That is, whether the charging component for charging the battery unit on the electronic device is the power supply device, or the first charging chip and the second charging chip, the target function can be implemented by the method or flow provided by the embodiments of the present application.

[0027] In a third aspect, embodiments of the present application provide a charging method, applied to an electronic device, comprising the power supply device according to the first aspect or any possible implementation of the first aspect, a first charging chip, a second charging chip, and a battery cell. The method comprises: obtaining a second identifier associated with a first sub-function of a target function. If the second identifier is in an on state, the register of the first charging chip is operated by invoking a sixth HAL layer interface corresponding to the first sub-function and the second identifier. The on state of the second identifier indicates that the component charging the battery cell includes the first charging chip. A third identifier associated with the first sub-function is obtained. If the third identifier is in an off state, the fourth identifier is associated with a second sub-function of the target function. The off state of the third identifier indicates that the component charging the battery cell does not include the power supply device. If the fourth identifier is in an on state, the register of the second charging chip is operated by invoking a seventh HAL layer interface corresponding to the second sub-function and the fourth identifier to implement the target function. 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.

[0028] In this way, when the charging component for charging the battery unit on the 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 embodiment of the present application.

[0029] In a fourth aspect, embodiments of the present application provide an electronic device, comprising: one or more processors and a memory. The memory is coupled to the one or more processors, and is configured to store computer program code, the computer program code comprising computer instructions, and the one or more processors invoke the computer instructions to cause the electronic device to perform the method described in the second aspect, any possible implementation of the second aspect, the third aspect, or any possible implementation of the third aspect.

[0030] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes the method described in the second aspect, any possible implementation of the second aspect, the third aspect, or any possible implementation of the third aspect.

[0031] In a sixth aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when the computer program is run on a computer, enables the computer to execute the method 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 seventh aspect, the present application provides a chip or chip system, comprising at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is configured to run a computer program or instruction to execute the method 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 may be an input / output interface, a pin, or a circuit, etc.

[0033] In one possible implementation, the chip or chip system described above in this application further includes at least one memory, in which instructions are stored. The memory may be a storage unit within the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).

[0034] It should be understood that the fourth to seventh aspects of the present application correspond to the technical solutions of the second or third aspects of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A circuit diagram of an electronic device provided in an embodiment of the present application;

[0036] Figure 2 Another circuit diagram of an electronic device provided in an embodiment of the present application;

[0037] Figure 3 A schematic diagram of another circuit of an electronic device provided in an embodiment of the present application;

[0038] Figure 4 A schematic diagram of another circuit of an electronic device provided in an embodiment of the present application;

[0039] Figure 5 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of another software architecture of an electronic device provided in an embodiment of the present application;

[0041] Figure 7 A schematic diagram of a charging process provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:

[0043] 1. Battery charging process

[0044] Batteries may include nickel-metal hydride batteries, lithium batteries, graphite batteries, etc. Since lithium batteries have no memory effect, many handheld devices and portable electronic devices are powered by lithium batteries.

[0045] Taking lithium batteries as an example, the battery charging process can include the following four stages:

[0046] Phase 1: Trickle Charge Phase 1 can be called the trickle charge phase.

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

[0048] The unit of current, C, represents the current rate during battery charging. 1C is equal to 1 ampere (A) multiplied by 1 second. C is a method of expressing the nominal battery capacity against the current.

[0049] Phase 2: Constant current charging. Phase 2 can be called the constant current charging phase.

[0050] When the battery voltage rises above the threshold A, the charging current is increased for constant current charging. In the constant current charging stage, the charging current is constant and the battery voltage gradually increases.

[0051] The constant current charging current can be between 0.2C and 1.0C. Threshold A can be called the trickle charge voltage threshold. Threshold A can also be called the constant current charging voltage. Threshold A can be 3V.

[0052] Phase 3: Constant voltage charging. Phase 3 can be called the constant voltage charging phase.

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

[0054] Threshold B can be referred to as a constant current charging threshold. Threshold B can also be referred to as a constant voltage charging voltage. Threshold B can be 4.2V.

[0055] It is understandable that, in the constant voltage charging stage, the battery voltage may be equal to the charging voltage in the constant voltage charging stage, and the battery voltage will not be greater than the charging voltage in the constant voltage charging stage.

[0056] Phase 4: Charge termination. Phase 4 can be called the charge termination phase.

[0057] Charging terminates when the charging current drops to a threshold value Z. Alternatively, charging terminates when the charging current decreases to a current range D. Alternatively, charging terminates when a predetermined duration E is reached from the start of the constant voltage charging phase. It should be understood that charging termination may indicate that the battery is fully charged.

[0058] Threshold Z can be referred to as the current threshold for charging termination. Current range D can be referred to as the current range for charging termination. Threshold Z can be 0.01C or 0.02C. Threshold Z can also be 1 / 10 of the set charging current. The charging current is set to a preset value. The set charging current can be 0.5C. The preset duration E can be 1 hour. Current range D can be 0.02C-0.07C.

[0059] In the embodiment of the present application, charging termination may be referred to as charging cutoff.

[0060] It is understood that when charging is terminated, the electronic device may display a logo or information indicating that the battery is fully charged, that is, the electronic device displays that the battery is fully charged. The electronic device displaying that the battery is fully charged may be referred to as the electronic device displaying that the battery is fully charged.

[0061] 2. Field-effect devices

[0062] Field effect devices can include field effect transistors (FETs). Field effect transistors can be understood as voltage control devices. The gate-source voltage V GS , to achieve the drain current I DS control.

[0063] Field effect transistors may include junction FETs (JFETs) and metal-oxide semiconductor FETs (MOSFETs), wherein the metal-oxide semiconductor FETs are also called MOS transistors.

[0064] According to the channel type of the field effect transistor, the field effect transistor can be divided into N-type field effect transistor and P-type field effect transistor. Taking the field effect transistor as a MOS transistor as an example, the MOS transistor can include N-type MOS transistor and P-type MOS transistor.

[0065] 3. Other terms

[0066] In the embodiments of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the terms "first chip" and "second chip" are used solely to distinguish between different chips and do not define their order. Those skilled in the art will understand that terms such as "first" and "second" do not define the quantity or execution order, and do not necessarily define differences.

[0067] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0068] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items 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, c can be single or multiple.

[0069] 4. Electronic devices

[0070] The electronic devices of the embodiments of the present application may include handheld devices, vehicle-mounted devices, etc. with a charging function. For example, some electronic devices include: mobile phones, tablet computers, PDAs, laptop computers, 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, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (PLMNs), and so on. The terminal equipment in the network (PLMN), etc., is not limited to this in the embodiments of the present application.

[0071] As an example and not a limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0072] In addition, in the embodiments of the present 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.

[0073] The electronic devices in the embodiments of the present 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.

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

[0075] Figure 1 A circuit diagram of an electronic device provided in an embodiment of the present application is shown.

[0076] like Figure 1 As shown, the electronic device may include a switched capacitor (SC) charging IC 101, a buck (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.

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

[0078] The external LDO 105 can be Figure 1LDO1, LDO2, LDO3 or LDO4 in the .

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

[0080] The SC charging IC 101 and the buck charging IC 102 may be connected to the battery cell 104 , respectively.

[0081] The fuel gauge 103 may be connected between the SC charging IC 101 and the battery cell 104 , or may be connected between the buck charging IC 102 and the battery cell 104 .

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

[0083] The SC charging IC 101 can fast charge the battery cell 104. For example, in the constant current charging stage, the SC charging IC 101 can fast charge the battery cell 104 or constant current charge the battery cell 104.

[0084] The buck charging IC 102 can slowly charge the battery cell 104. For example, in the constant voltage charging stage, the buck charging IC 102 can slowly charge the battery cell 104 or charge it at a constant voltage.

[0085] 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 power supply voltage (Vsys).

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

[0087] The buck charging IC 102 can also transmit Vsys to the peripheral device N to provide power to the peripheral device N.

[0088] The MCU 106 can control the on or off of the external LDO 105. For example, the MCU 106 can transmit GPIO to LDO2, LDO3, and LDO4 via a GPIO interface including GPIO pins to control LDO2, LDO3, and LDO4.

[0089] For example, taking the peripheral device 1 as an eMMC, when the MCU 106 is not working, the MCU 106 can control the LDO 2 to be in a shutdown state. The MCU 106 not working may include the MCU 106 starting, resetting, or restarting.

[0090] When the MCU is operating, LDO2 is in the on or enabled state. LDO2 in the on or enabled state can power the eMMC, allowing the eMMC to operate normally. However, if the MCU fails or malfunctions, it will reset the MCU, which will restore the GPIO interface to its pre-initialization state. The pre-initialization GPIO interface state, for example, the state where the GPIO interface does not transmit the voltage level required to turn on LDO2 to LDO2, i.e., the pre-initialization GPIO interface state, can cause LDO2 to be in the off or disabled state. It should be understood that when LDO2 is in the off or disabled state, it will not power the eMMC, causing the eMMC to lose power or become inoperable.

[0091] If the MCU goes from a working state to an abnormal state, the MCU abnormality will cause the eMMC to lose power. In this way, when the electronic device is connected to a charger or the battery unit is fully charged, there is a possibility that the peripheral device will lose power.

[0092] An MCU failure can cause the eMMC to lose power, preventing it from storing the information that caused the MCU failure or the MCU's abnormal status. This can hinder the ability of electronic equipment or MCU technicians to handle or locate the MCU failure. The information that caused the MCU failure and / or the MCU's abnormal status is referred to as MCU failure information.

[0093] In view of this, an embodiment of the present application provides a power supply device, which can be applied to electronic equipment. 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 the first type electrical device. The first type electrical 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 the external LDO. Among them, the opening of the first type voltage conversion unit, the voltage output of the first type voltage conversion unit and the closing of the first type voltage conversion unit are all executed according to the parameters (such as default values) pre-set for the first type voltage conversion unit in the register, and the opening and closing of the external LDO are all controlled by the MCU. Since the opening and closing of the first type voltage conversion unit are all based on the default values ​​preset in the register, they are not controlled by the MCU. In this way, MCU abnormality will not affect the opening, closing and voltage output of the first type voltage conversion unit, and MCU abnormality will not cause eMMC power failure, which can reduce the probability of peripheral device power failure when the electronic device is connected to the charger or the battery unit is fully charged.

[0094] The power supply device provided in the embodiments of the present application is described below in conjunction with some embodiments.

[0095] Figure 2 Another circuit diagram of an electronic device provided in an embodiment of the present application is shown.

[0096] like Figure 2 As shown, the electronic device may include a power supply device, a fuel gauge 103, a battery unit 104, at least one second-type voltage conversion unit 206, an MCU 207, and at least one peripheral device 107. The power supply device 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.

[0097] The second type voltage conversion unit 206, for example, Figure 2 The second type voltage conversion unit 1 or the second type voltage conversion unit 2 in.

[0098] The first type voltage conversion unit 203, for example, Figure 2 The first type voltage conversion unit 1, the first type voltage conversion unit 2 or the first type voltage conversion unit 3 in the embodiment.

[0099] Exemplarily, the first type voltage conversion unit 203 may be an LDO, a buck circuit, or a boost circuit.

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

[0101] The second type of power supply interface, for example, Figure 2 The interface for outputting the system power supply voltage (Vsys).

[0102] The power supply unit register is not in Figure 2 Shown in.

[0103] like Figure 2 As shown, any first-type power supply interface is connected to any first-type voltage conversion unit, so that the output voltage of the first-type voltage conversion unit is outputted at the first-type power supply interface.

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

[0105] The activation of the first type voltage conversion unit 203 , the voltage output of the first type voltage conversion unit 203 , and the 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.

[0106] In this way, the parameters pre-set in the register for the first type of voltage conversion unit can be default values ​​preset for the first type of voltage conversion unit. The MCU (such as MCU 207) will not change the parameters pre-set in the register for the first type of voltage conversion unit. For example, the parameters pre-set in the register for the first type of voltage conversion unit remain unchanged when the MCU is started, reset, restarted and running. Therefore, the power supply of the first type of electrical device is not controlled by the MCU, and the abnormality of the MCU will not cause the first type of electrical device to lose power. This reduces the probability of power failure of peripheral devices such as the first type of electrical device when the electronic device is connected to a charger or the battery unit (such as battery unit 104) is fully charged.

[0107] The second type power supply interface is connected to the power supply of the power supply device, so that the second type power supply interface outputs the system power supply voltage. The power supply of the power supply device can be a charger or a battery unit 104.

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

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

[0110] For example, the second-type electrical device may be a peripheral device 107 whose power supply is controlled by the MCU 207, such as the peripheral device 3. The second-type voltage conversion unit 206 (e.g., the second-type voltage conversion unit 2) may be enabled or disabled by the MCU 207.

[0111] For example, if peripheral device 3 is a speed sensor, when MCU 207 malfunctions, MCU 207 cannot receive or process information transmitted by the speed sensor. Therefore, the speed sensor's transmission of information to MCU 207 is ineffective. Therefore, when MCU 207 malfunctions, MCU 207 is reset, powering off the speed sensor and stopping it from operating. This reduces power consumption caused by the ineffective operation of the speed sensor, thereby reducing the likelihood of a short battery life for the electronic device.

[0112] Fuel meter 103 can be connected between the charging device and battery cell 104. The power supply device can charge battery cell 104. Fuel meter 103 can monitor the voltage transmitted from the power supply device to battery cell 104 to implement charging management. The fuel meter can also monitor the voltage output by battery cell 104 to implement power supply management.

[0113] like Figure 2 As shown, in the power supply device provided by the embodiment of the present application, any first-type power supply interface is connected to any first-type voltage conversion unit, so that the output voltage of the first-type voltage conversion unit is output at the first-type power supply interface to power the first-type electrical device connected to the first-type power supply interface. The opening, voltage output and closing of the first-type voltage conversion unit are all executed according to the parameters pre-set for the first-type voltage conversion unit in the register, that is, the opening, voltage output and closing of the first-type voltage conversion unit are not controlled by the MCU. In this way, the power supply of the first-type electrical device is not controlled by the MCU, and the abnormality of the MCU will not cause the first-type electrical device to lose power. This reduces the probability of power failure of peripheral devices such as the first-type electrical device when the electronic device is connected to the charger or the battery unit is fully charged.

[0114] In the power supply device provided in the embodiment of the present application, the second type of power supply interface is connected to the power supply of the power supply device, so that the system power supply voltage is outputted at 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 working 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 abnormality, the MCU is reset to power off the second type of electrical device to control the second type of electrical device to stop working, which can reduce the power consumption generated by the invalid operation of the second type of electrical device, and further reduce the probability of a short battery life of the electronic device.

[0115] Alternatively, as Figure 2 As shown, the power supply device may further include: a first charging unit 205 .

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

[0117] Any first type voltage conversion unit 203 is connected between the first charging unit 205 and any first type power supply interface. 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 LDO3The first type voltage conversion unit 3 is connected between the first charging unit 205 and the output V LDO2 between interfaces.

[0118] The second type power supply interface is connected to the first charging unit 205. For example, an interface outputting Vsys is connected to the first charging unit 205.

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

[0120] Alternatively, as Figure 2 As shown, the power supply device may further include: a second charging unit 201 .

[0121] During the constant current charging stage, the second charging unit 201 can be controlled to perform constant current charging or fast charging on the battery unit 104 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.

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

[0123] In the constant voltage charging stage, according to the second mode parameters configured in the register, the first charging unit 205 is controlled to perform constant voltage charging or slow charging on the battery unit 104 , and the second charging unit 201 is controlled to be disabled or in an off state.

[0124] For example, the first charging unit 205 may be a buck charging unit, and the second charging unit 201 may be a switched capacitor (SC) charging unit, such as a charge pump with a 2:1 input power:output power ratio (SC 2:1 charger pump).

[0125] In this way, the control of the second charging unit and / or the first charging unit can be achieved by configuring the first mode parameter or the second mode parameter in the register, thereby achieving the switching or control of the charging mode. The charging mode may include constant current charging or constant voltage charging. In addition, compared with the method of charging with the first charging unit in both the constant current charging stage and the constant voltage charging stage, the charging efficiency of the electronic device can be improved by 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. It can be understood that the execution subject of the embodiment of the present application can be an electronic device, or it can be a power supply device or MCU on the electronic device.

[0126] Alternatively, as Figure 2 The power supply device shown may also include: an integrated circuit bus (inter-integrated circuit, IIC) interface. The IIC interface is not shown in Figure 2 Shown in.

[0127] The first mode parameter can be configured in the 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 charging parameters for one of the multiple charging stages.

[0128] The second mode parameter may be configured in the register in the following manner: before constant voltage charging, a second instruction is received from the MCU via the IIC interface, and the mode parameter in the register is modified to the second mode parameter.

[0129] In this way, the MCU can transmit the first instruction or the 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. It is understandable that the execution subject of the embodiment of the present application can be an electronic device or a power supply device on the electronic device.

[0130] Alternatively, as Figure 2 As shown, the power supply device may further include: a power bus interface, a battery voltage interface, a first switch unit 202 and a second switch unit 204 and an electric meter 103 .

[0131] Power bus interfaces, e.g. Figure 2 The interface used to transmit the charger output voltage Vbus.

[0132] Battery voltage interface, e.g. Figure 2 An interface for transmitting battery voltage Vbat.

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

[0134] The second charging unit 201 is connected between the power bus interface and the battery voltage interface, so that the first charging unit 201 transmits 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.

[0135] Taking the power supply as an example of 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.

[0136] 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 be used to transmit the voltage output by the battery unit to the first charging unit 205.

[0137] The first mode parameter can be used to indicate that the first switch unit 202 is controlled to be in a conducting state and the second switch unit 204 is controlled to be in a non-conducting state.

[0138] The second mode parameter can be used to indicate that the first switch unit 202 and the second switch unit 204 are both controlled to be in a conducting state.

[0139] The battery unit 104 can be connected between the battery voltage interface and the battery unit 104.

[0140] In this way, in the constant current charging phase, the first switch unit is in a conducting state and the second switch unit is in a non-conducting state, the first charging unit can output the system power voltage through the second type power supply interface and transmit the system power voltage to any first type voltage conversion unit, and the first charging unit does not charge the battery unit 104. In the constant voltage charging phase, the second charging unit is disabled, and the first switch unit and the second switch unit are both in a conducting state. The first charging unit can not only output the system power voltage through the second type power supply interface and transmit the system power voltage to any first type voltage conversion unit, but also charge the battery unit 104.

[0141] It can be understood that, in the case that the electronic device is not connected with an external device such as a charger, the MCU or the power supply device can control the first switch unit to be in a non-conducting state and control the second switch unit to be in a conducting 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 realize power supply to the external device 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 power consumer.

[0142] Optionally, the LDO in the embodiment of the present application may be a three-level LDO, so that the supply voltage range of the LDO can be extended.

[0143] Figure 3 Another circuit diagram of an electronic device provided in an embodiment of the present application is shown.

[0144] like Figure 3 As shown, in Figure 2 On the basis of, the first switch unit 202 and the second switch unit 204 can be constructed by field effect devices, or can be constructed by other switch devices that can realize the conduction or disconnection of the circuit. The first switch unit 202 is, for example, M1. The second switch unit 204 is, for example, M2.

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

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

[0147] One end of the first inductor L1 is connected to the first switch unit (such as M1 ), 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.

[0148] One end of the second switch unit (eg, 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 .

[0149] The first type voltage conversion unit 1 is, for example, a boost circuit 302. The first type voltage conversion unit 2 is, for example, an LDO 3. The first type voltage conversion unit 3 is, for example, an LDO 2.

[0150] For example, in Figure 3 In the embodiment, one end of the boost circuit 302 , one end of the LDO 3 , and one end of the LDO 2 are respectively connected between the first inductor L1 and the first capacitor C1 .

[0151] The second charging unit 201 may include an SC circuit 301 .

[0152] The second type voltage conversion unit 1, for example, LDO 1. The second type voltage conversion unit 1 can transmit V LDO1 .

[0153] The second type of voltage conversion unit 2, for example, is an LDO 4. The second type of voltage conversion unit 2 can transmit V LDO4 .

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

[0155] As Figure 3 the specific implementation principles and technical effects of the embodiments shown in Figure 2 are similar to those of the embodiments shown in, details are not repeated here. In addition, as Figure 3 shown, the power supply device can be an integrated charging IC. Compared with some electronic devices that deploy SC charging chips and buck charging chips, electronic devices that only deploy integrated charging ICs have fewer chips for charging, so that electronic devices that only deploy integrated charging ICs have more hardware layout margins, and can also save chip costs of electronic devices.

[0156] It can be understood that in the case of electronic devices having SC charging chips and buck charging chips, and / or power supply devices, the electronic devices have multiple charging functions related to charging. The multiple charging functions related to charging include but are not limited to trickle charging, constant current charging, constant voltage charging, charging termination, overcharge protection, overheat protection, or overcurrent protection, etc.

[0157] The scenario of deploying charging components on electronic devices can include scenario one, scenario two, or scenario three as follows:

[0158] Scenario one, the electronic device includes a power supply device.

[0159] Scenario two, the electronic device includes a power supply device, an SC charging chip, and a buck charging chip.

[0160] Scenario three, the electronic device includes an SC charging chip and a buck charging chip.

[0161] The charging component is a component that charges the battery unit of the electronic device. The charging component can include a power supply device, an SC charging chip, and / or a buck charging chip. Scenario one can refer to Figure 2-Figure 3 . Scenario three can refer to Figure 1 . Scenario two can refer to Figure 4 . The SC charging chip can be referred to as an SC charging IC. The buck charging chip can be referred to as a buck charging IC.

[0162] Figure 4 Another circuit schematic diagram of an electronic device provided by an embodiment of the present application is shown.

[0163] Figure 4and Figure 2 The difference is that in Figure 4 In the embodiment, the electronic device further 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. The fuel meter 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.

[0164] The first charging chip 401 may be a buck charging chip. A buck charging chip, for example, Figure 1 The second charging chip 402 may be an SC charging chip. For example, Figure 1 SC charging IC 101 in.

[0165] In this way, the electronic device can use the power supply device to charge the battery cell 104. The electronic device can also use the first charging chip 401 and the second charging chip 402 to charge the battery cell 104. For example, during the constant current charging stage, the electronic device can control the second charging chip 402 to be enabled to charge the battery cell 104 with constant current or fast charging, and control the first charging chip 401 to not charge the battery cell 104. During the constant voltage charging stage, the electronic device can control the second charging chip 402 to be disabled and control the first charging chip 401 to charge the battery cell with constant voltage or slow charging.

[0166] The scenarios for deploying charging components on electronic devices include the following scenario one, scenario two or scenario three. The electronic device provided in the embodiments of the present application can adopt an application and software architecture that is compatible with the charging applications of scenario one, scenario two and scenario three to achieve the target functions of the electronic device.

[0167] The target function may be any one of a plurality of charging functions related to charging, for example, trickle charging, constant current charging, constant voltage charging, charge termination, overcharge protection, overheat protection, or overcurrent protection.

[0168] Figure 5 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application is shown.

[0169] like Figure 5 As shown, the architecture may include an application layer, an intermediate layer, a hardware abstraction layer (HAL) and a driver layer.

[0170] The application layer may include a series of application programs. For example, a charging application may include modules corresponding to each of multiple charging functions related to charging.

[0171] For example, taking the example of multiple charging functions related to charging including charging function 1, charging function 2, and charging function 3, the charging application may include function module 1, function module 2, function module 3, function module 4, and function module 5. Function module 1 and function module 2 correspond to charging function 1. Function module 3 and function module 4 correspond to charging function 2. Function module 5 corresponds to charging function 3.

[0172] The functional module corresponding to the charging function may include a charging function or code for implementing the charging function. It should be understood that the charging function or code may be predefined.

[0173] For example, taking charging function 1 as constant voltage charging, charging function 1 may include a sub-function for controlling the second charging unit or the second charging chip to be disabled, and a sub-function for controlling the first charging unit or the first charging chip to charge the battery cell at constant voltage. The charging function or code contained in functional module 1 can be used to control the second charging unit to be disabled, or to control the second charging chip to be disabled. The charging function or code contained in functional module 2 can be used to control the first charging unit to charge the battery cell at constant voltage, or to control the first charging chip to charge the battery cell at constant voltage.

[0174] The middle layer between the application layer and the HAL layer may include multiple middle layer interfaces. The middle layer interface is pre-encapsulated with the HAL layer function, so that the middle layer interface corresponds one to one with the HAL layer interface in the HAL layer. The application program in the application layer (such as the charging application) can call the middle layer interface to realize the call to the HAL layer interface, thereby realizing the control of the hardware. Hardware, for example, the first charging chip, the second charging chip and / or the power supply device. By calling the middle layer interface, the call to the HAL layer interface is realized to reduce the changes to the HAL layer. Multiple middle layer interfaces, for example, Figure 4 The middle layer interface 11 , the middle layer interface 10 , the middle layer interface 21 , the middle layer interface 20 , the middle layer interface 31 , the middle layer interface 30 , the middle layer interface 41 , the middle layer interface 40 and the middle layer interface 50 are shown.

[0175] Among them, middle-layer interface 11 and middle-layer interface 10 are both middle-layer interfaces corresponding to functional module 1. Middle-layer interface 21 and middle-layer interface 20 are both middle-layer interfaces corresponding to functional module 2. Middle-layer interface 31 and middle-layer interface 30 are both middle-layer interfaces corresponding to functional module 3. Middle-layer interface 41 and middle-layer interface 40 are both middle-layer interfaces corresponding to functional module 4. Middle-layer interface 50 is the middle-layer interface corresponding to functional module 5.

[0176] The HAL layer can provide a unified application program interface for the hardware, so that the application program in the application layer can control the hardware through the HAL layer interface.

[0177] The application program interface may be referred to as a HAL layer interface in the embodiment of the present application. The hardware may be a charging chip or a power supply device.

[0178] The charge HAL of the HAL layer may include multiple HAL layer interfaces. For example, Figure 4 The HAL layer interface 11 , the HAL layer interface 10 , the HAL layer interface 21 , the HAL layer interface 20 , the HAL layer interface 31 , the HAL layer interface 30 , the HAL layer interface 41 , the HAL layer interface 40 and the HAL layer interface 50 are shown.

[0179] The intermediate layer interface 11, the intermediate layer interface 10, the intermediate layer interface 21, the intermediate layer interface 20, the intermediate layer interface 31, the intermediate layer interface 30, the intermediate layer interface 41, the intermediate layer interface 40, and the intermediate layer interface 50 have a one-to-one correspondence with the HAL layer interface 11, the HAL layer interface 10, the HAL layer interface 21, the HAL layer interface 20, the HAL layer interface 31, the HAL layer interface 30, the HAL layer interface 41, the HAL layer interface 40, and the HAL layer interface 50. For example, the intermediate layer interface 11 corresponds to the HAL layer interface 11. The intermediate layer interface 10 corresponds to the HAL layer interface 10. The intermediate layer interface 21 corresponds to the HAL layer interface 21.

[0180] The driver layer can configure or operate registers of the charging chip or the power supply device to control the charging chip or the power supply device. The charging chip, such as the first charging chip and / or the second charging chip, can operate on the registers, for example, reading, writing, or modifying parameters in the registers.

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

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

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

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

[0185] The target function may be charging function 1, charging function 2, or charging function 3.

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

[0187] Exemplarily, the target function of the electronic device may be implemented by the method shown in S101-S103, the method shown in S101-S102, or the method shown in S101 and S103:

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

[0189] The target function is any one of multiple functions related to charging. The target sub-function is any one of multiple sub-functions of the target function. It is understandable that the target function is composed of one or more sub-functions.

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

[0191] The fifth identifier indicates that the component for charging the battery cell includes a first charging chip, and the sixth identifier indicates that the component for charging the battery cell includes a second charging chip, which can be applied to scenario 2 or scenario 3. The first charging chip and the second charging chip are both independent of the power supply device.

[0192] 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 to implement the target sub-function.

[0193] 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, and the fourth HAL layer interface corresponding to the second intermediate layer interface to implement the target sub-function.

[0194] 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, and the fifth HAL layer interface corresponding to the third intermediate layer interface to implement the target sub-function.

[0195] It should be understood that when all target sub-functions in the target function are achieved, the target function is also achieved. The target sub-function in the target function may be the first sub-function of the target function or the second sub-function of the target function described below.

[0196] The following describes S101-S102 in conjunction with the process shown in S201-S204, and S101 and S103 in conjunction with the process shown in S301-S304.

[0197] For example, the target function is charging function 1, which includes a first sub-function and a second sub-function. The first sub-function can be controlling the first charging chip (or first charging unit) to not charge the battery cell, and the second sub-function can be controlling the second charging chip (or second charging unit) to charge the battery cell. The code included in function module 1 can be used to implement the first sub-function, and the code included in function module 2 can be used to implement the second sub-function. The code in function module 1 and the code in function module 2 can both include an identifier for indicating the attributes of the charging component. The identifier used to indicate the attributes of the charging component can be, for example, the first identifier, the fifth identifier, or the sixth identifier.

[0198] For scenario 1 or scenario 2, both functional module 1 and functional module 2 may be preset with a first identifier, and charging function 1 may be implemented through the process (or method) shown in S201-S204:

[0199] S201: Acquire an identifier for indicating the attribute of a charging component in the functional module 1, and identify that the identifier for indicating the attribute of the charging component in the functional module 1 is a first identifier.

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

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

[0202] S203: Acquire an identifier for indicating the attribute of the charging component in the functional module 2, and identify that the identifier for indicating the attribute of the charging component in the functional module 2 is a first identifier.

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

[0204] 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.

[0205] For scenario 2 or scenario 3, the fifth identifier may be preset in the functional module 1 and the sixth identifier may be preset in the functional module 2. The charging function 1 may be implemented through the process (or method) shown in S301-S304:

[0206] S301: Acquire an identifier for indicating the attributes of a charging component in the functional module 1, and identify that the identifier for indicating the attributes of the charging component in the functional module 1 is a fifth identifier.

[0207] S302: Call the function module 1 and the intermediate layer interface 11 corresponding to the fifth identifier, as well as 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 to implement the first sub-function, such as controlling the first charging chip to not charge the battery cell.

[0208] S303: Acquire an identifier for indicating the attribute of the charging component in the functional module 2, and identify that the identifier for indicating the attribute of the charging component in the functional module 2 is a sixth identifier.

[0209] S304: Call the function module 2 and the intermediate layer interface 21 corresponding to 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., the SC charging IC) through the second charging chip driver to implement the second sub-function, such as controlling the second charging chip to charge the battery cell.

[0210] 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.

[0211] It is understandable that in scenario one, the identifier associated with the target subfunction of the target function is the first identifier. The target function of the electronic device can be obtained by obtaining the first identifier associated with the target subfunction. Invoking the first intermediate layer interface corresponding to the target subfunction and the first identifier, and the first HAL layer interface corresponding to the first intermediate layer interface, to operate the register of the power supply device to control the first charging unit and / or the second charging unit of the power supply device.

[0212] 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.

[0213] like Figure 5 The application and software architecture of the charging application shown can be compatible with the charging function in scenario 1, scenario 2 or scenario 3. That is, when the scenario of the charging component deployed on the electronic device is scenario 1, scenario 2 or scenario 3, the electronic device can use Figure 5 The application program and software architecture of the charging application shown implement any one of a plurality of charging functions related to charging. Figure 5 The software architecture shown in the figure 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 compatible with the three charging ICs. It only needs to call the packaged intermediate layer interface. Figure 5In the charging application shown, the set of codes included in functional module 1 can be used to control the first charging chip and the first charging unit, and the set of codes included in functional module 2 can be used to control the second charging chip and the second charging unit. While improving code readability, code space can also be saved and code redundancy can be reduced. Among them, there are three charging ICs, for example, a first charging chip, a second charging chip and a power supply device (such as an integrated charging IC).

[0214] In one embodiment of the present application, the charging function of the first charging chip may be the same as the charging function of the first charging unit, and the charging function of the second charging chip may be the same as the charging function of the second charging unit.

[0215] Figure 6 A schematic diagram of another software architecture of an electronic device provided in an embodiment of the present application is shown.

[0216] Figure 6 and Figure 5 The difference is that Figure 6 The software architecture shown does not include the middle layer. Figure 6 In the software architecture shown, 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 can be the same as those implemented by functional module 10. The functions implemented by functional module 21 can be the same as those implemented by functional module 20.

[0217] The functional modules corresponding to charging function 2 include: functional module 31, functional module 41, functional module 30, and functional module 40. The functions implemented by functional module 31 may be the same as those implemented by functional module 30. The functions implemented by functional module 41 may be the same as those implemented by functional module 40.

[0218] Figure 6 The functional module corresponding to the charging function shown also includes a charging function or code for implementing the charging function. The code included in the functional module also includes an identifier for indicating the attributes of the charging component. The charging component 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. The identifier used to indicate the attributes of the charging component, such as the second identifier, the third identifier, or the fourth identifier.

[0219] Figure 6 and Figure 5 The difference is that Figure 6 The code contained in the function module is the same as Figure 5The codes contained in the functional modules may be different. For example, still taking the charging function 1 as constant voltage charging as an example, the charging function 1 may include a sub-function of controlling the second charging unit or the second charging chip to be disabled, and a sub-function of controlling the first charging unit or the first charging chip to charge the battery cell at constant voltage. The charging function or code contained in the functional module 11 can be used to implement the control of disabling the second charging chip. The charging function or code contained in the functional module 21 can be used to implement the control of the first charging chip to charge the battery cell at constant voltage. The charging function or code contained in the functional module 10 can be used to implement the control of disabling the second charging unit. The charging function or code contained in the functional module 20 can be used to implement the control of the first charging unit to charge the battery cell at constant voltage.

[0220] exist Figure 6 In the example, the functional modules of the charging application correspond one-to-one to the HAL layer interfaces of the charging HAL. For example, functional module 11, functional module 21, functional module 10, functional module 20, functional module 31, functional module 41, functional module 30, and functional module 40 correspond one-to-one to HAL layer interface 11, HAL layer interface 21, HAL layer interface 10, HAL layer interface 20, HAL layer interface 31, HAL layer interface 41, HAL layer interface 30, and HAL layer interface 40. For example, 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. In this way, the functional module can call its corresponding HAL layer interface to operate the registers of the charging chip or the registers of the power supply device through the driver layer to achieve the target function.

[0221] Figure 6 The charging application and software architecture shown are also compatible with electronic devices deployed in Scenario 1, Scenario 2 or Scenario 3. Figure 7 , based on Figure 6 The charging application and software architecture shown here illustrate the process of achieving the target functions of the electronic device.

[0222] Figure 7 A schematic diagram of a charging process provided in an embodiment of the present application is shown.

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

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

[0225] For scenario 1 or scenario 2, the preset charging component on the electronic device is a power supply device, and the power supply device is an integrated charging IC, that is, the integrated charging IC is used to charge the battery unit, and the first charging chip and the second charging chip are not used to charge the battery unit. Figure 7 As shown, the target function of the electronic device can be achieved through the processes shown in S701, S703-S705, and S707-S708:

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

[0227] Exemplarily, the second identifier in the functional module 11 is acquired, and the state of the second identifier is identified.

[0228] If the state of the second identifier is off, it means that the first charging chip does not exist on the electronic device, or the preset charging component on the electronic device does not include the first charging chip. S703 can be executed to determine whether the electronic device has a first charging unit with an integrated charging IC.

[0229] S703: Obtain a third identifier associated with the first sub-function to determine whether the electronic device has a first charging unit of the integrated charging IC or whether a preset charging component of the electronic device includes the first charging unit of the integrated charging IC. If the second identifier is in an off state, it 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.

[0230] Exemplarily, the third identifier associated with the first sub-function may be the third identifier in the functional module 10 .

[0231] When the state of the second identifier is off, the third identifier in the functional module 10 may be acquired and the state of the third identifier may be identified.

[0232] The state of the third identifier is an on state, which may indicate that an integrated charging IC is present on the electronic device, or that a preset charging component on the electronic device includes an integrated charging IC.

[0233] The state of the third identifier is an off state, which may indicate that there is no integrated charging IC on the electronic device, or that the preset charging component on the electronic device does not include an integrated charging IC.

[0234] If the third indicator associated with the first sub-function is in the on state, it indicates that the electronic device has a first charging unit with an integrated charging IC, or that the preset charging component of the electronic device includes the first charging unit with an integrated charging IC, and S704 can be executed to implement the first sub-function, for example, to control the first charging unit to not charge the battery unit.

[0235] S704: When the state of the third flag associated with the first sub-function is enabled, operate a register of the integrated charging IC by calling the second HAL layer interface corresponding to the first sub-function and the third flag to control the first charging unit. The enabled state of the third flag indicates that the component that charges the battery unit includes the integrated charging IC.

[0236] Exemplarily, when the target function is charging function 1 and the third identifier associated with the first sub-function is the identifier in functional 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 functional module 10.

[0237] When the state of the third identifier is on, the HAL layer interface 10 can be called, driven by the integrated charging IC (i.e., the power supply device) of the driving layer, and the register of the integrated charging IC (i.e., the power supply device) can be operated to control the first charging unit not to charge the battery unit.

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

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

[0240] Exemplarily, the fourth identifier in the functional module 21 is obtained, and the state of the fourth identifier is identified.

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

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

[0243] It should be understood that the state of the fourth indicator being the off state indicates that the components for charging the battery unit do not include the second charging chip. The second charging chip is independent of the power supply device.

[0244] Exemplarily, the third identifier associated with the second sub-function may be the third identifier in the functional module 20 .

[0245] When the state of the fourth identifier is off, the third identifier in the functional module 20 may be acquired and the state of the third identifier may be identified.

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

[0247] S708: When the state of the third identifier associated with the second sub-function is on, 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.

[0248] Exemplarily, when the target function is charging function 1 and the third identifier associated with the second sub-function is the identifier in the functional 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 the functional module 20.

[0249] When the state of the third identifier associated with the second sub-function is on, the HAL layer interface 20 can be called, driven by the integrated charging IC (i.e., the power supply device) of the driving layer, and the register of the integrated charging IC can be operated to control the second charging unit to charge the battery unit.

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

[0251] In this way, for scenario one or scenario two, in the case that the charging component preset on the electronic device is the power supply device, the target function can be implemented.

[0252] For scenario two or scenario three, in the case that the charging component preset on the electronic device includes the first charging chip and the second charging chip, i.e., the first charging chip and the second charging chip are used to charge the battery unit, and the power supply device is not used to charge the battery unit, as shown in the following table, the target function of the electronic device can be implemented through the processes shown in S701-S703 and S705-S706: Figure 7

[0253] S701, a second identifier associated with a first sub-function of a target function is acquired to determine whether the first charging chip exists on the electronic device or to determine whether the charging component preset on the electronic device includes the first charging chip.

[0254] For example, the second identifier in the function module 11 is acquired, and the state of the second identifier is identified.

[0255] If the state of the second identifier is an on state, it can be indicated that the first charging chip exists on the electronic device, or the charging component preset on the electronic device includes the first charging chip, and S702 can be executed to control the first charging chip, thereby implementing the target function.

[0256] S702, in the case that the state of the second identifier is the on state, a sixth HAL layer interface corresponding to the first sub-function and the second identifier is called to operate the register of the first charging chip, so as to implement the first sub-function, for example, to control the first charging chip not to charge the battery unit. The on state of the second identifier can indicate that the component for charging the battery unit includes the first charging chip.

[0257] For example, in the case that the target function is the charging function 1 and the second identifier is the identifier in the 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 the 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.

[0258] In the case that the state of the second identifier is the on state, the HAL layer interface 11 can be called to operate the register of the first charging chip through the first charging chip driver of the driver layer, so as to control the first charging chip not to charge the battery unit.

[0259] S703, a third identifier associated with the first sub-function is acquired to determine whether the first charging unit of the integrated charging IC exists on the electronic device or to determine whether the first charging unit of the integrated charging IC is included in the charging component preset on the electronic device.​

[0260] Exemplarily, the third identifier in the functional module 10 may be acquired, and the state of the third identifier may be identified.

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

[0262] S705: Obtain a fourth identifier associated with the second sub-function of the target function to determine whether the electronic device has a second charging chip or whether a preset charging component of the electronic device includes the second charging chip. The state of the third identifier is off, indicating that the component for charging the battery unit does not include a power supply device.

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

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

[0265] S706: If the fourth flag is in the enabled state, operate the register of the second charging chip by calling the second sub-function and the seventh HAL layer interface corresponding to the fourth flag. This implements the second sub-function, for example, controlling the second charging chip to charge the battery cell, thereby achieving the target function. The enabled state of the fourth flag indicates that the component that charges the battery cell includes the second charging chip.

[0266] For example, when the target function is charging function 1 and the fourth identifier is an identifier in functional 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 functional 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.

[0267] When the fourth flag is in the on state, the HAL layer interface 21 can be called to drive the second charging chip and operate the register of the second charging chip to control the second charging chip to charge the battery unit.

[0268] In this way, for scenario 2 or scenario 3, when the charging component preset on the electronic device includes the first charging chip and the second charging chip, the target function can be achieved.

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

[0270] Figure 6 The charging application shown in the figure uses the identifier to indicate the charging component attributes in the function module to realize the control of different charging components. Figure 7 The process shown, Figure 6 The application and software architecture of the charging application shown can be compatible with the charging function in scenario 1, scenario 2 or scenario 3. That is, the electronic device can use the charging function in scenario 1, scenario 2 or scenario 3 when the charging component is deployed on the electronic device. Figure 6 The application and software architecture of the charging application shown in the figure are as follows: Figure 7 The illustrated flow implements any one of a plurality of charging functions related to charging.

[0271] It is understandable that the identifier in the embodiment of the present application can be a macro or a value in a flag bit. Taking the identifier as a macro as an example, the first identifier can be the first macro, the second identifier can be the second macro, the third identifier can be the third macro, the fourth identifier can be the fourth macro, the fifth identifier can be the fifth macro, and the sixth identifier can be the sixth macro. In the case of a macro, the macro definition of the macro related to the application of the charging application in the embodiment of the present application can be included in the configuration directory pre-stored on the electronic device, that is, the macro related to the application of the charging application can be modified or controlled in the configuration directory.

[0272] It is understandable that, in the embodiment of the present application, the first identifier and the third identifier may be the same, the fifth identifier and the second identifier may be the same, and the sixth identifier and the fourth identifier may be the same.

[0273] It can be understood that in the embodiments of the present application, the execution entity of the process related to realizing the target function can be an electronic device, a power supply device or MCU on the electronic device, or a charging application.

[0274] The present application also provides a charging method for an electronic device, which may include the power supply device, a first charging chip, a second charging chip, and a battery unit. The charging method may include S101-S103, and its specific implementation principles and technical effects are not further described.

[0275] The present application also provides a charging method for an electronic device, which may include the power supply device, a first charging chip, a second charging chip, and a battery unit. The charging method may include S701-S703 and S705-S706. The specific implementation principles and technical effects are not further described.

[0276] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.

[0277] 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 the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0278] The charging method of the embodiment of the present application has been described above. The following describes the device for performing the above method provided in the embodiment of the present application. Those skilled in the art will understand that the method and device can be combined and referenced with each other, and the related device or electronic device provided in the embodiment of the present application can perform the steps in the above charging method.

[0279] The charging method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices. The specific device form of the terminal device can refer to the above related descriptions and will not be repeated here.

[0280] An embodiment of the present application provides an electronic device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the above method.

[0281] The present embodiment provides a chip. The chip includes a processor configured to invoke a computer program stored in a memory to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar to those of the above-mentioned related embodiments and will not be further described here.

[0282] An embodiment of the present application provides a chip system, which includes at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is configured to run a computer program or instruction to perform the above method.

[0283] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned method is implemented. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media 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 that can be accessed by a computer.

[0284] In one possible implementation, computer-readable media may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium designed to carry or store the desired 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 a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and disc, as used herein, 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 reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0285] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.

[0286] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0287] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.

Claims

1. A power supply device, characterized in that: include: at least one first type voltage conversion unit, a register, at least one first type power supply interface, at least one second type power supply interface and a first charging unit; Any one of the first-type voltage conversion units is connected between the first charging unit and any one of the first-type power supply interfaces, and the first-type power supply interface is configured to output the output voltage of the first-type voltage conversion unit at the first-type power supply interface; The first charging unit is used to convert the voltage output by the power supply of the power supply device into a system power supply voltage, and is also used to charge the battery unit; The second type power supply interface is connected to the first charging unit and is used to output a system power supply voltage at the second type power supply interface; The first type power supply interface is connected to a first type electrical device, and the second type power supply interface is connected to a second type voltage conversion unit, the second type voltage conversion unit being used to convert the system power supply voltage into an operating voltage of a second type electrical device to supply power to the second type electrical device; Among them, the activation of the first type of voltage conversion unit, the voltage output of the first type of voltage conversion unit and the shutdown of the first type of voltage conversion unit are all executed according to the parameters pre-set for the first type of voltage conversion unit in the register, and the activation of the second type of voltage conversion unit and the shutdown of the second type of voltage conversion unit are both controlled by the microcontroller unit MCU; the parameters pre-set for the first type of voltage conversion unit in the register remain unchanged when the MCU is started, restarted and running.

2. The power supply device according to claim 1, characterized in that: The first type voltage conversion unit includes a low dropout linear regulator LDO, a step-down buck circuit or a step-up boost circuit.

3. The power supply device according to claim 1, wherein: Also includes: a second charging unit; In the constant current charging stage, according to the first mode parameters configured in the register, the second charging unit is controlled to charge the battery unit with a constant current, 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; In the constant voltage charging stage, according to the second mode parameters configured in the register, the first charging unit is controlled to charge the battery unit at a constant voltage, and the second charging unit is controlled to be disabled.

4. The power supply device according to claim 3, 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 is received from the MCU through the IIC interface, and the mode parameter in the register is modified to the first mode parameter; the mode parameter in the register includes a charging parameter of one stage among multiple charging stages; The second mode parameter is configured in the register in the following manner: before the constant voltage charging, a second instruction from the MCU is received through the IIC interface, and the mode parameter in the register is modified to the second mode parameter.

5. The power supply device according to claim 3 or 4, characterized in that: It also includes: a power bus interface, a battery voltage interface, a first switch unit and a second switch unit, and the power supply includes a charger or the battery unit; The first switch unit is connected between the power bus interface and the first charging unit, the second switch 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 configured 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; The first mode parameter is used to indicate that the first switch unit is controlled to be in an on state and the second switch unit is controlled to be in an off state; The second mode parameter is used to indicate that both the first switch unit and the second switch unit are controlled to be in an on state.

6. The power supply device according to claim 5, 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 switch 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 switch unit, 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.

7. The power supply device according to any one of claims 3 to 4 and 6, characterized in that: The power supply device achieves the target function by: Obtaining 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 unit 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; Call the first intermediate layer interface corresponding to the target sub-function and the first identifier, and the first hardware abstraction layer HAL layer interface corresponding to the first intermediate layer interface, and operate the register to control the first charging unit and / or the second charging unit.

8. The power supply device according to any one of claims 3 to 4 and 6, characterized in that: The power supply device achieves the target function by: Obtaining a second identifier associated with the first sub-function of the target function; When the state of the second identifier is off, obtaining a third identifier associated with the first sub-function, wherein the state of the second identifier being off 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 on state, the register is operated to control the first charging unit or the second charging unit by calling the second HAL layer interface corresponding to the first sub-function and the third identifier, and the state of the third identifier being in the on state indicates that the component charging the battery unit includes the power supply device; Obtaining a fourth identifier associated with the second sub-function of the target function; When the state of the fourth identifier is off, obtaining the third identifier associated with the second sub-function, wherein the state of the fourth identifier being off 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 flag associated with the second sub-function is on, operating the register by calling the second sub-function and the third HAL layer interface corresponding to the third flag to control the second charging unit or the first charging unit; The target function is any one of a plurality of functions related to charging.

9. A charging method, characterized in that: Applied to an electronic device, the electronic device comprising a power supply device according to any one of claims 1 to 8, a first charging chip, a second charging chip, and a battery unit; the method comprising: Obtaining an identifier associated with a target subfunction of a target function, where the identifier associated with the target subfunction is a first identifier, a fifth identifier, or a sixth identifier, the first identifier indicating that the component used to charge the battery cell is the power supply device, the fifth identifier indicating that the component used to charge the battery cell includes a first charging chip, and the sixth identifier indicating that the component used to charge the battery cell includes a second charging chip, and 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 subfunction is any one of multiple subfunctions of the target function; When the identifier associated with the target sub-function is the first identifier, operating the register of the power supply device by calling a first intermediate layer interface corresponding to the target sub-function and the first identifier, and a first HAL layer interface corresponding to the first intermediate layer interface, so as to implement 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 implement 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, and the fifth HAL layer interface corresponding to the third intermediate layer interface to implement the target sub-function.

10. A charging method, characterized in that: Applied to an electronic device, the electronic device comprising a power supply device according to any one of claims 1 to 8, a first charging chip, a second charging chip, and a battery unit; the method comprising: Obtaining a second identifier associated with a first sub-function of a target function; When the state of the second flag is on, operating the register of the first charging chip by calling the first sub-function and the sixth HAL layer interface corresponding to the second flag, the state of the second flag being on indicates that the component charging the battery unit includes the first charging chip; Obtaining a third identifier associated with the first sub-function; When the state of the third identifier is an off state, obtaining a fourth identifier associated with the second sub-function of the target function, wherein the off state of the third identifier indicates that the component charging the battery unit does not include the power supply device; When the state of the fourth identifier is on, 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 implement the target function, and the state of the fourth identifier is on, indicating that the component charging the battery unit includes the second charging chip; The target function is any one of a plurality of functions related to charging.

11. 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 includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method as claimed in claim 9 or 10.

12. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as claimed in claim 9 or 10.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method according to claim 9 or 10.

14. A computer program product, characterized in that The computer program product comprises a computer program code, which enables an electronic device to perform the method according to claim 9 or 10 when the computer program code is run on the electronic device.

Citation Information

Patent Citations

  • Abnormal power-down SOC protection method for BMS system

    CN106872908A

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

    CN108205371A